From 72370ff0b293b7340b6db9c3d9253219b00065bc Mon Sep 17 00:00:00 2001 From: Sukchan Lee Date: Thu, 4 Jun 2020 14:12:05 -0400 Subject: [PATCH] Add AUSF, UDM, and UDR --- configs/5gc.yaml.in | 28 +- configs/minimal.yaml.in | 32 +- configs/open5gs/amf.yaml.in | 2 + configs/open5gs/ausf.yaml.in | 179 + configs/open5gs/meson.build | 3 + configs/open5gs/nrf.yaml.in | 2 + configs/open5gs/smf.yaml.in | 2 + configs/open5gs/udm.yaml.in | 179 + configs/open5gs/udr.yaml.in | 181 + configs/open5gs/upf.yaml.in | 2 + lib/app/ogs-app.h | 9 + lib/app/ogs-config.c | 29 +- lib/app/ogs-config.h | 9 +- lib/asn1c/util/conv.c | 55 +- lib/asn1c/util/conv.h | 12 + lib/core/ogs-3gpp-types.c | 76 +- lib/core/ogs-3gpp-types.h | 13 + lib/core/ogs-conv.c | 3 +- lib/core/ogs-fsm.c | 7 +- lib/core/ogs-macros.h | 4 +- lib/crypt/meson.build | 3 + lib/crypt/ogs-crypt.h | 11 + lib/crypt/ogs-kdf.c | 311 + lib/crypt/ogs-kdf.h | 99 + lib/dbi/meson.build | 7 +- lib/dbi/ogs-dbi.h | 10 +- lib/dbi/ogs-mongoc.c | 29 +- lib/dbi/ogs-mongoc.h | 9 +- lib/dbi/subscription.c | 422 ++ lib/dbi/subscription.h | 81 + lib/nas/5gs/conv.c | 111 + lib/nas/5gs/conv.h | 44 + lib/nas/5gs/decoder.c | 2 +- lib/nas/5gs/encoder.c | 6 +- lib/nas/5gs/ies.c | 216 +- lib/nas/5gs/ies.h | 2 +- lib/nas/5gs/meson.build | 3 +- lib/nas/5gs/message.h | 6 +- lib/nas/5gs/ogs-nas-5gs.h | 3 +- lib/nas/5gs/support/nas-message.py | 20 +- lib/nas/5gs/support/type-list.py | 15 - lib/nas/5gs/types.h | 214 +- lib/nas/common/conv.c | 4 +- lib/nas/common/conv.h | 4 +- lib/nas/common/meson.build | 2 +- lib/nas/common/ogs-nas-common.h | 2 +- lib/nas/common/security.c | 2 +- lib/nas/common/security.h | 2 +- lib/nas/common/types.c | 8 +- lib/nas/common/types.h | 107 +- lib/ngap/conv.c | 91 +- lib/ngap/conv.h | 16 +- lib/sbi/client.c | 115 +- lib/sbi/client.h | 14 +- lib/sbi/context.c | 294 +- lib/sbi/context.h | 47 +- lib/sbi/conv.c | 47 +- lib/sbi/conv.h | 10 +- lib/sbi/meson.build | 1 + lib/sbi/message.c | 298 +- lib/sbi/message.h | 50 +- lib/sbi/nnrf-build.c | 199 +- lib/sbi/nnrf-build.h | 20 +- lib/sbi/nnrf-handler.c | 20 +- lib/sbi/nnrf-handler.h | 3 - lib/sbi/ogs-sbi.h | 9 + .../openapi/.openapi-generator/config.yaml | 2 + .../templates/model-body.mustache | 39 +- lib/sbi/openapi/meson.build | 363 ++ .../openapi/model/access_and_mobility_data.c | 537 ++ .../openapi/model/access_and_mobility_data.h | 81 + .../access_and_mobility_subscription_data.c | 1505 +++++ .../access_and_mobility_subscription_data.h | 155 + lib/sbi/openapi/model/access_right_status.c | 51 + lib/sbi/openapi/model/access_right_status.h | 35 + lib/sbi/openapi/model/access_tech.c | 51 + lib/sbi/openapi/model/access_tech.h | 35 + lib/sbi/openapi/model/acknowledge_info.c | 136 + lib/sbi/openapi/model/acknowledge_info.h | 43 + lib/sbi/openapi/model/acs_info.c | 111 + lib/sbi/openapi/model/acs_info.h | 41 + lib/sbi/openapi/model/acs_info_rm.c | 111 + lib/sbi/openapi/model/acs_info_rm.h | 43 + .../openapi/model/additional_snssai_data.c | 70 + .../openapi/model/additional_snssai_data.h | 37 + lib/sbi/openapi/model/af_event.c | 51 + lib/sbi/openapi/model/af_event.h | 35 + .../openapi/model/af_event_exposure_data.c | 192 + .../openapi/model/af_event_exposure_data.h | 42 + lib/sbi/openapi/model/af_external.c | 166 + lib/sbi/openapi/model/af_external.h | 46 + lib/sbi/openapi/model/af_non_external.c | 192 + lib/sbi/openapi/model/af_non_external.h | 49 + lib/sbi/openapi/model/am_policy_data.c | 147 + lib/sbi/openapi/model/am_policy_data.h | 40 + lib/sbi/openapi/model/ambr.c | 101 + lib/sbi/openapi/model/ambr.h | 39 + lib/sbi/openapi/model/ambr_rm.c | 101 + lib/sbi/openapi/model/ambr_rm.h | 39 + .../model/amf3_gpp_access_registration.c | 548 ++ .../model/amf3_gpp_access_registration.h | 83 + ...mf3_gpp_access_registration_modification.c | 236 + ...mf3_gpp_access_registration_modification.h | 53 + lib/sbi/openapi/model/amf_cond.h | 2 +- lib/sbi/openapi/model/amf_dereg_info.c | 80 + lib/sbi/openapi/model/amf_dereg_info.h | 38 + lib/sbi/openapi/model/amf_info.h | 2 +- .../model/amf_non3_gpp_access_registration.c | 496 ++ .../model/amf_non3_gpp_access_registration.h | 77 + ...on3_gpp_access_registration_modification.c | 193 + ...on3_gpp_access_registration_modification.h | 48 + lib/sbi/openapi/model/amf_subscription_info.c | 121 + lib/sbi/openapi/model/amf_subscription_info.h | 41 + lib/sbi/openapi/model/an_node_type.c | 51 + lib/sbi/openapi/model/an_node_type.h | 35 + lib/sbi/openapi/model/app_descriptor.c | 91 + lib/sbi/openapi/model/app_descriptor.h | 39 + lib/sbi/openapi/model/app_port_id.c | 89 + lib/sbi/openapi/model/app_port_id.h | 39 + .../model/application_data_change_notif.c | 172 + .../model/application_data_change_notif.h | 49 + lib/sbi/openapi/model/application_data_subs.c | 166 + lib/sbi/openapi/model/application_data_subs.h | 44 + lib/sbi/openapi/model/area.c | 114 + lib/sbi/openapi/model/area.h | 39 + lib/sbi/openapi/model/arp.c | 133 + lib/sbi/openapi/model/arp.h | 43 + lib/sbi/openapi/model/association_type.c | 51 + lib/sbi/openapi/model/association_type.h | 35 + lib/sbi/openapi/model/atom.c | 2 +- lib/sbi/openapi/model/atsss_capability.c | 4 +- lib/sbi/openapi/model/ausf_info.h | 2 +- lib/sbi/openapi/model/auth_event.c | 172 + lib/sbi/openapi/model/auth_event.h | 46 + lib/sbi/openapi/model/auth_method.c | 30 + lib/sbi/openapi/model/auth_method.h | 31 + lib/sbi/openapi/model/auth_result.c | 30 + lib/sbi/openapi/model/auth_result.h | 31 + lib/sbi/openapi/model/auth_type.c | 30 + lib/sbi/openapi/model/auth_type.h | 31 + lib/sbi/openapi/model/authentication_info.c | 229 + lib/sbi/openapi/model/authentication_info.h | 53 + .../model/authentication_info_request.c | 165 + .../model/authentication_info_request.h | 46 + .../model/authentication_info_result.c | 141 + .../model/authentication_info_result.h | 45 + .../model/authentication_subscription.c | 240 + .../model/authentication_subscription.h | 55 + lib/sbi/openapi/model/authentication_vector.c | 227 + lib/sbi/openapi/model/authentication_vector.h | 54 + lib/sbi/openapi/model/authorization_data.c | 126 + lib/sbi/openapi/model/authorization_data.h | 40 + lib/sbi/openapi/model/av5_g_he_aka.c | 167 + lib/sbi/openapi/model/av5_g_he_aka.h | 46 + lib/sbi/openapi/model/av5g_aka.c | 126 + lib/sbi/openapi/model/av5g_aka.h | 41 + lib/sbi/openapi/model/av_eap_aka_prime.c | 187 + lib/sbi/openapi/model/av_eap_aka_prime.h | 48 + lib/sbi/openapi/model/av_eps_aka.c | 180 + lib/sbi/openapi/model/av_eps_aka.h | 46 + lib/sbi/openapi/model/av_ims_gba_eap_aka.c | 205 + lib/sbi/openapi/model/av_ims_gba_eap_aka.h | 48 + lib/sbi/openapi/model/av_type.c | 30 + lib/sbi/openapi/model/av_type.h | 31 + lib/sbi/openapi/model/backup_amf_info.c | 126 + lib/sbi/openapi/model/backup_amf_info.h | 40 + lib/sbi/openapi/model/battery_indication.c | 108 + lib/sbi/openapi/model/battery_indication.h | 41 + lib/sbi/openapi/model/battery_indication_rm.c | 108 + lib/sbi/openapi/model/battery_indication_rm.h | 43 + lib/sbi/openapi/model/bdt_data.c | 236 + lib/sbi/openapi/model/bdt_data.h | 55 + lib/sbi/openapi/model/bdt_policy_data.c | 160 + lib/sbi/openapi/model/bdt_policy_data.h | 46 + lib/sbi/openapi/model/bdt_policy_data_patch.c | 76 + lib/sbi/openapi/model/bdt_policy_data_patch.h | 37 + lib/sbi/openapi/model/bsf_info.h | 2 +- lib/sbi/openapi/model/cag_ack_data.c | 102 + lib/sbi/openapi/model/cag_ack_data.h | 40 + lib/sbi/openapi/model/cag_data.c | 129 + lib/sbi/openapi/model/cag_data.h | 40 + lib/sbi/openapi/model/cag_info.c | 118 + lib/sbi/openapi/model/cag_info.h | 39 + lib/sbi/openapi/model/charging_information.c | 181 + lib/sbi/openapi/model/charging_information.h | 47 + lib/sbi/openapi/model/chf_info.c | 24 +- lib/sbi/openapi/model/chf_info.h | 6 +- lib/sbi/openapi/model/chf_service_info.h | 2 +- lib/sbi/openapi/model/civic_address.c | 671 +++ lib/sbi/openapi/model/civic_address.h | 97 + lib/sbi/openapi/model/cm_info.c | 106 + lib/sbi/openapi/model/cm_info.h | 41 + lib/sbi/openapi/model/cm_info_report.c | 156 + lib/sbi/openapi/model/cm_info_report.h | 40 + lib/sbi/openapi/model/cm_state.c | 51 + lib/sbi/openapi/model/cm_state.h | 35 + lib/sbi/openapi/model/code_word_ind.c | 30 + lib/sbi/openapi/model/code_word_ind.h | 31 + .../model/communication_characteristics.c | 190 + .../model/communication_characteristics.h | 52 + .../model/configuration_parameters_eutra.c | 251 + .../model/configuration_parameters_eutra.h | 47 + .../model/configuration_parameters_nr.c | 351 ++ .../model/configuration_parameters_nr.h | 51 + lib/sbi/openapi/model/confirmation_data.c | 76 + lib/sbi/openapi/model/confirmation_data.h | 37 + .../model/confirmation_data_response.c | 117 + .../model/confirmation_data_response.h | 42 + lib/sbi/openapi/model/context_data_set_name.c | 51 + lib/sbi/openapi/model/context_data_set_name.h | 35 + lib/sbi/openapi/model/context_data_sets.c | 347 ++ lib/sbi/openapi/model/context_data_sets.h | 58 + lib/sbi/openapi/model/core_network_type.c | 51 + lib/sbi/openapi/model/core_network_type.h | 35 + lib/sbi/openapi/model/data_change_notify.c | 288 + lib/sbi/openapi/model/data_change_notify.h | 50 + lib/sbi/openapi/model/data_filter.c | 431 ++ lib/sbi/openapi/model/data_filter.h | 55 + lib/sbi/openapi/model/data_ind.c | 51 + lib/sbi/openapi/model/data_ind.h | 35 + lib/sbi/openapi/model/data_set_id.h | 2 +- lib/sbi/openapi/model/data_set_name.c | 51 + lib/sbi/openapi/model/data_set_name.h | 35 + .../model/datalink_reporting_configuration.c | 195 + .../model/datalink_reporting_configuration.h | 46 + .../openapi/model/ddd_traffic_descriptor.c | 130 + .../openapi/model/ddd_traffic_descriptor.h | 43 + .../model/default_notification_subscription.c | 47 +- .../model/default_notification_subscription.h | 6 +- lib/sbi/openapi/model/deregistration_data.c | 145 + lib/sbi/openapi/model/deregistration_data.h | 45 + lib/sbi/openapi/model/deregistration_reason.c | 51 + lib/sbi/openapi/model/deregistration_reason.h | 35 + .../openapi/model/dl_data_delivery_status.c | 51 + .../openapi/model/dl_data_delivery_status.h | 35 + lib/sbi/openapi/model/dnai_change_type.c | 51 + lib/sbi/openapi/model/dnai_change_type.h | 35 + lib/sbi/openapi/model/dnn_configuration.c | 516 ++ lib/sbi/openapi/model/dnn_configuration.h | 79 + lib/sbi/openapi/model/dnn_info.c | 152 + lib/sbi/openapi/model/dnn_info.h | 45 + .../model/dnn_route_selection_descriptor.c | 176 + .../model/dnn_route_selection_descriptor.h | 43 + lib/sbi/openapi/model/dnn_smf_info_item.h | 2 +- lib/sbi/openapi/model/dnn_upf_info_item.c | 104 +- lib/sbi/openapi/model/dnn_upf_info_item.h | 10 +- lib/sbi/openapi/model/domain_name_protocol.c | 51 + lib/sbi/openapi/model/domain_name_protocol.h | 35 + lib/sbi/openapi/model/eap_session.c | 190 + lib/sbi/openapi/model/eap_session.h | 47 + lib/sbi/openapi/model/ec_restriction.c | 150 + lib/sbi/openapi/model/ec_restriction.h | 42 + lib/sbi/openapi/model/ec_restriction_data.c | 89 + lib/sbi/openapi/model/ec_restriction_data.h | 39 + lib/sbi/openapi/model/ecgi.c | 125 + lib/sbi/openapi/model/ecgi.h | 42 + lib/sbi/openapi/model/edrx_parameters.c | 105 + lib/sbi/openapi/model/edrx_parameters.h | 40 + lib/sbi/openapi/model/ee_profile_data.c | 121 + lib/sbi/openapi/model/ee_profile_data.h | 40 + lib/sbi/openapi/model/ee_subscription.c | 198 + lib/sbi/openapi/model/ee_subscription.h | 47 + lib/sbi/openapi/model/ellipsoid_arc.c | 229 + lib/sbi/openapi/model/ellipsoid_arc.h | 53 + lib/sbi/openapi/model/ellipsoid_arc_all_of.c | 200 + lib/sbi/openapi/model/ellipsoid_arc_all_of.h | 48 + lib/sbi/openapi/model/emergency_info.c | 115 + lib/sbi/openapi/model/emergency_info.h | 42 + .../enhanced_coverage_restriction_data.c | 101 + .../enhanced_coverage_restriction_data.h | 38 + lib/sbi/openapi/model/eps_interworking_info.c | 104 + lib/sbi/openapi/model/eps_interworking_info.h | 38 + lib/sbi/openapi/model/eps_iwk_pgw.c | 101 + lib/sbi/openapi/model/eps_iwk_pgw.h | 39 + lib/sbi/openapi/model/eth_flow_description.c | 243 + lib/sbi/openapi/model/eth_flow_description.h | 52 + lib/sbi/openapi/model/eutra_location.c | 255 + lib/sbi/openapi/model/eutra_location.h | 56 + lib/sbi/openapi/model/event_report_mode.c | 51 + lib/sbi/openapi/model/event_report_mode.h | 35 + lib/sbi/openapi/model/event_type.c | 51 + lib/sbi/openapi/model/event_type.h | 35 + lib/sbi/openapi/model/expected_ue_behaviour.c | 328 ++ lib/sbi/openapi/model/expected_ue_behaviour.h | 63 + .../model/expected_ue_behaviour_data.c | 279 + .../model/expected_ue_behaviour_data.h | 59 + .../model/exposure_data_change_notification.c | 188 + .../model/exposure_data_change_notification.h | 45 + .../model/exposure_data_subscription.c | 164 + .../model/exposure_data_subscription.h | 43 + lib/sbi/openapi/model/external_client_type.c | 51 + lib/sbi/openapi/model/external_client_type.h | 35 + .../openapi/model/external_unrelated_class.c | 201 + .../openapi/model/external_unrelated_class.h | 44 + lib/sbi/openapi/model/flow_direction.c | 51 + lib/sbi/openapi/model/flow_direction.h | 35 + lib/sbi/openapi/model/flow_info.c | 118 + lib/sbi/openapi/model/flow_info.h | 39 + lib/sbi/openapi/model/frame_route_info.c | 91 + lib/sbi/openapi/model/frame_route_info.h | 39 + lib/sbi/openapi/model/g_nb_id.c | 100 + lib/sbi/openapi/model/g_nb_id.h | 39 + lib/sbi/openapi/model/gad_shape.c | 80 + lib/sbi/openapi/model/gad_shape.h | 38 + lib/sbi/openapi/model/geographic_area.c | 385 ++ lib/sbi/openapi/model/geographic_area.h | 69 + .../openapi/model/geographical_coordinates.c | 99 + .../openapi/model/geographical_coordinates.h | 39 + lib/sbi/openapi/model/global_ran_node_id.c | 184 + lib/sbi/openapi/model/global_ran_node_id.h | 49 + lib/sbi/openapi/model/gmlc_info.c | 101 + lib/sbi/openapi/model/gmlc_info.h | 38 + lib/sbi/openapi/model/group_identifiers.c | 141 + lib/sbi/openapi/model/group_identifiers.h | 42 + lib/sbi/openapi/model/guami_list_cond.h | 2 +- lib/sbi/openapi/model/hfc_node_id.c | 76 + lib/sbi/openapi/model/hfc_node_id.h | 37 + lib/sbi/openapi/model/hss_auth_type.c | 51 + lib/sbi/openapi/model/hss_auth_type.h | 35 + .../model/hss_authentication_info_request.c | 172 + .../model/hss_authentication_info_request.h | 48 + .../model/hss_authentication_info_result.c | 100 + .../model/hss_authentication_info_result.h | 40 + .../model/hss_authentication_vectors.c | 51 + .../model/hss_authentication_vectors.h | 35 + lib/sbi/openapi/model/hss_av_type.c | 51 + lib/sbi/openapi/model/hss_av_type.h | 35 + lib/sbi/openapi/model/hss_info.c | 121 + lib/sbi/openapi/model/hss_info.h | 40 + lib/sbi/openapi/model/id_translation_result.c | 116 + lib/sbi/openapi/model/id_translation_result.h | 41 + lib/sbi/openapi/model/identity_data.c | 137 + lib/sbi/openapi/model/identity_data.h | 39 + lib/sbi/openapi/model/identity_range.h | 2 +- lib/sbi/openapi/model/ims_vo_ps.c | 51 + lib/sbi/openapi/model/ims_vo_ps.h | 35 + lib/sbi/openapi/model/imsi_range.c | 111 + lib/sbi/openapi/model/imsi_range.h | 41 + .../openapi/model/interface_upf_info_item.h | 2 +- .../openapi/model/internal_group_id_range.c | 111 + .../openapi/model/internal_group_id_range.h | 41 + lib/sbi/openapi/model/ip_address.c | 111 + lib/sbi/openapi/model/ip_address.h | 41 + lib/sbi/openapi/model/ip_end_point.c | 21 +- lib/sbi/openapi/model/ip_end_point.h | 6 +- lib/sbi/openapi/model/iptv_config_data.c | 243 + lib/sbi/openapi/model/iptv_config_data.h | 51 + .../openapi/model/iptv_config_data_patch.c | 104 + .../openapi/model/iptv_config_data_patch.h | 38 + lib/sbi/openapi/model/ipv4_address_range.h | 2 +- lib/sbi/openapi/model/ipv6_prefix_range.h | 2 +- lib/sbi/openapi/model/lcs_client_class.c | 30 + lib/sbi/openapi/model/lcs_client_class.h | 31 + lib/sbi/openapi/model/lcs_client_external.c | 146 + lib/sbi/openapi/model/lcs_client_external.h | 44 + .../openapi/model/lcs_client_group_external.c | 166 + .../openapi/model/lcs_client_group_external.h | 46 + .../openapi/model/lcs_client_non_external.c | 192 + .../openapi/model/lcs_client_non_external.h | 49 + lib/sbi/openapi/model/lcs_mo_data.c | 97 + lib/sbi/openapi/model/lcs_mo_data.h | 38 + lib/sbi/openapi/model/lcs_mo_service_class.c | 30 + lib/sbi/openapi/model/lcs_mo_service_class.h | 31 + lib/sbi/openapi/model/lcs_privacy.c | 114 + lib/sbi/openapi/model/lcs_privacy.h | 42 + lib/sbi/openapi/model/lcs_privacy_data.c | 175 + lib/sbi/openapi/model/lcs_privacy_data.h | 44 + .../model/limit_id_to_monitoring_key.c | 119 + .../model/limit_id_to_monitoring_key.h | 39 + lib/sbi/openapi/model/lmf_info.c | 262 + lib/sbi/openapi/model/lmf_info.h | 49 + lib/sbi/openapi/model/location_accuracy.c | 51 + lib/sbi/openapi/model/location_accuracy.h | 35 + lib/sbi/openapi/model/location_area.c | 175 + lib/sbi/openapi/model/location_area.h | 44 + lib/sbi/openapi/model/location_info.c | 166 + lib/sbi/openapi/model/location_info.h | 44 + lib/sbi/openapi/model/location_privacy_ind.c | 30 + lib/sbi/openapi/model/location_privacy_ind.h | 31 + .../model/location_reporting_configuration.c | 138 + .../model/location_reporting_configuration.h | 44 + lib/sbi/openapi/model/lpi.c | 101 + lib/sbi/openapi/model/lpi.h | 41 + lib/sbi/openapi/model/lte_v2x_auth.c | 99 + lib/sbi/openapi/model/lte_v2x_auth.h | 40 + lib/sbi/openapi/model/maximum_latency.c | 139 + lib/sbi/openapi/model/maximum_latency.h | 44 + lib/sbi/openapi/model/maximum_response_time.c | 139 + lib/sbi/openapi/model/maximum_response_time.h | 44 + .../model/model_5_g_vn_group_configuration.c | 177 + .../model/model_5_g_vn_group_configuration.h | 46 + .../openapi/model/model_5_g_vn_group_data.c | 205 + .../openapi/model/model_5_g_vn_group_data.h | 46 + .../openapi/model/modification_notification.c | 106 + .../openapi/model/modification_notification.h | 38 + .../openapi/model/monitoring_configuration.c | 171 + .../openapi/model/monitoring_configuration.h | 49 + .../openapi/model/multicast_access_control.c | 160 + .../openapi/model/multicast_access_control.h | 46 + lib/sbi/openapi/model/n1_message_class.c | 4 +- lib/sbi/openapi/model/n1_message_class.h | 2 +- lib/sbi/openapi/model/n2_interface_amf_info.h | 2 +- lib/sbi/openapi/model/n3ga_location.c | 256 + lib/sbi/openapi/model/n3ga_location.h | 57 + lib/sbi/openapi/model/ncgi.c | 125 + lib/sbi/openapi/model/ncgi.h | 42 + lib/sbi/openapi/model/nef_info.c | 119 + lib/sbi/openapi/model/nef_info.h | 43 + lib/sbi/openapi/model/network_area_info.c | 251 + lib/sbi/openapi/model/network_area_info.h | 47 + lib/sbi/openapi/model/network_area_info_2.c | 251 + lib/sbi/openapi/model/network_area_info_2.h | 47 + .../model/network_node_diameter_address.c | 101 + .../model/network_node_diameter_address.h | 39 + lib/sbi/openapi/model/network_slice_cond.h | 2 +- lib/sbi/openapi/model/nf_group_cond.c | 4 +- lib/sbi/openapi/model/nf_group_cond.h | 4 +- lib/sbi/openapi/model/nf_info.c | 72 + lib/sbi/openapi/model/nf_info.h | 38 + lib/sbi/openapi/model/nf_instance_id_cond.h | 2 +- lib/sbi/openapi/model/nf_profile.c | 500 +- lib/sbi/openapi/model/nf_profile.h | 39 +- lib/sbi/openapi/model/nf_service.c | 297 +- lib/sbi/openapi/model/nf_service.h | 23 +- lib/sbi/openapi/model/nf_service_set_cond.c | 76 + lib/sbi/openapi/model/nf_service_set_cond.h | 37 + lib/sbi/openapi/model/nf_service_version.h | 2 +- lib/sbi/openapi/model/nf_set_cond.c | 76 + lib/sbi/openapi/model/nf_set_cond.h | 37 + lib/sbi/openapi/model/nf_type.c | 4 +- lib/sbi/openapi/model/nf_type.h | 2 +- lib/sbi/openapi/model/nf_type_cond.h | 2 +- lib/sbi/openapi/model/nidd_information.c | 116 + lib/sbi/openapi/model/nidd_information.h | 41 + .../model/non_external_unrelated_class.c | 151 + .../model/non_external_unrelated_class.h | 41 + lib/sbi/openapi/model/notif_condition.h | 2 +- lib/sbi/openapi/model/notification_data.h | 2 +- lib/sbi/openapi/model/notification_item.c | 131 + lib/sbi/openapi/model/notification_item.h | 40 + lib/sbi/openapi/model/notification_type.c | 4 +- lib/sbi/openapi/model/notification_type.h | 2 +- lib/sbi/openapi/model/notify_item.c | 131 + lib/sbi/openapi/model/notify_item.h | 40 + lib/sbi/openapi/model/nr_location.c | 212 + lib/sbi/openapi/model/nr_location.h | 52 + lib/sbi/openapi/model/nr_v2x_auth.c | 99 + lib/sbi/openapi/model/nr_v2x_auth.h | 40 + lib/sbi/openapi/model/nrf_info.c | 322 +- lib/sbi/openapi/model/nrf_info.h | 22 +- lib/sbi/openapi/model/nssai.c | 249 + lib/sbi/openapi/model/nssai.h | 47 + lib/sbi/openapi/model/nssai_ack_data.c | 102 + lib/sbi/openapi/model/nssai_ack_data.h | 40 + lib/sbi/openapi/model/null_value.c | 30 + lib/sbi/openapi/model/null_value.h | 31 + lib/sbi/openapi/model/nwdaf_info.h | 2 +- lib/sbi/openapi/model/odb_data.c | 75 + lib/sbi/openapi/model/odb_data.h | 38 + lib/sbi/openapi/model/odb_packet_services.c | 51 + lib/sbi/openapi/model/odb_packet_services.h | 36 + lib/sbi/openapi/model/operation_mode.c | 30 + lib/sbi/openapi/model/operation_mode.h | 31 + lib/sbi/openapi/model/operator_managed.c | 51 + lib/sbi/openapi/model/operator_managed.h | 35 + .../model/operator_specific_data_container.c | 165 + .../model/operator_specific_data_container.h | 48 + lib/sbi/openapi/model/parameter_over_pc5.c | 338 ++ lib/sbi/openapi/model/parameter_over_pc5.h | 57 + lib/sbi/openapi/model/parameter_over_uu.c | 171 + lib/sbi/openapi/model/parameter_over_uu.h | 43 + lib/sbi/openapi/model/patch_result.c | 106 + lib/sbi/openapi/model/patch_result.h | 38 + lib/sbi/openapi/model/pc5_flow_bit_rates.c | 91 + lib/sbi/openapi/model/pc5_flow_bit_rates.h | 39 + lib/sbi/openapi/model/pc5_qo_s_para.c | 126 + lib/sbi/openapi/model/pc5_qo_s_para.h | 40 + lib/sbi/openapi/model/pc5_qos_flow_item.c | 118 + lib/sbi/openapi/model/pc5_qos_flow_item.h | 42 + lib/sbi/openapi/model/pc5_qos_mapping.c | 123 + lib/sbi/openapi/model/pc5_qos_mapping.h | 40 + lib/sbi/openapi/model/pcf_info.c | 23 +- lib/sbi/openapi/model/pcf_info.h | 6 +- lib/sbi/openapi/model/pcscf_info.c | 135 + lib/sbi/openapi/model/pcscf_info.h | 40 + .../model/pcscf_restoration_notification.c | 76 + .../model/pcscf_restoration_notification.h | 37 + lib/sbi/openapi/model/pdu_session.c | 130 + lib/sbi/openapi/model/pdu_session.h | 42 + .../model/pdu_session_continuity_ind.c | 30 + .../model/pdu_session_continuity_ind.h | 31 + .../model/pdu_session_management_data.c | 394 ++ .../model/pdu_session_management_data.h | 64 + lib/sbi/openapi/model/pdu_session_status.c | 51 + lib/sbi/openapi/model/pdu_session_status.h | 35 + lib/sbi/openapi/model/pdu_session_types.c | 130 + lib/sbi/openapi/model/pdu_session_types.h | 40 + lib/sbi/openapi/model/pei_update_info.c | 76 + lib/sbi/openapi/model/pei_update_info.h | 37 + lib/sbi/openapi/model/periodicity.c | 51 + lib/sbi/openapi/model/periodicity.h | 35 + .../openapi/model/pfd_change_notification.c | 164 + .../openapi/model/pfd_change_notification.h | 44 + lib/sbi/openapi/model/pfd_content.c | 224 + lib/sbi/openapi/model/pfd_content.h | 46 + lib/sbi/openapi/model/pfd_data.c | 137 + lib/sbi/openapi/model/pfd_data.h | 39 + lib/sbi/openapi/model/pfd_data_for_app.c | 151 + lib/sbi/openapi/model/pfd_data_for_app.h | 42 + lib/sbi/openapi/model/pfd_data_for_app_ext.c | 171 + lib/sbi/openapi/model/pfd_data_for_app_ext.h | 46 + .../model/pfd_data_for_app_ext_all_of.c | 71 + .../model/pfd_data_for_app_ext_all_of.h | 37 + lib/sbi/openapi/model/pgw_info.c | 125 + lib/sbi/openapi/model/pgw_info.h | 42 + lib/sbi/openapi/model/plmn_ec_info.c | 118 + lib/sbi/openapi/model/plmn_ec_info.h | 42 + lib/sbi/openapi/model/plmn_id_nid.c | 121 + lib/sbi/openapi/model/plmn_id_nid.h | 41 + lib/sbi/openapi/model/plmn_operator_class.c | 125 + lib/sbi/openapi/model/plmn_operator_class.h | 40 + lib/sbi/openapi/model/plmn_range.h | 2 +- lib/sbi/openapi/model/plmn_rat_served.c | 135 + lib/sbi/openapi/model/plmn_rat_served.h | 41 + .../model/plmn_route_selection_descriptor.c | 130 + .../model/plmn_route_selection_descriptor.h | 41 + lib/sbi/openapi/model/plmn_snssai.c | 24 +- lib/sbi/openapi/model/plmn_snssai.h | 6 +- lib/sbi/openapi/model/point.c | 109 + lib/sbi/openapi/model/point.h | 43 + lib/sbi/openapi/model/point_all_of.c | 80 + lib/sbi/openapi/model/point_all_of.h | 38 + lib/sbi/openapi/model/point_altitude.c | 133 + lib/sbi/openapi/model/point_altitude.h | 45 + lib/sbi/openapi/model/point_altitude_all_of.c | 104 + lib/sbi/openapi/model/point_altitude_all_of.h | 40 + .../model/point_altitude_uncertainty.c | 210 + .../model/point_altitude_uncertainty.h | 52 + .../model/point_altitude_uncertainty_all_of.c | 181 + .../model/point_altitude_uncertainty_all_of.h | 47 + .../openapi/model/point_uncertainty_circle.c | 133 + .../openapi/model/point_uncertainty_circle.h | 45 + .../model/point_uncertainty_circle_all_of.c | 104 + .../model/point_uncertainty_circle_all_of.h | 40 + .../openapi/model/point_uncertainty_ellipse.c | 162 + .../openapi/model/point_uncertainty_ellipse.h | 48 + .../model/point_uncertainty_ellipse_all_of.c | 133 + .../model/point_uncertainty_ellipse_all_of.h | 43 + .../model/policy_data_change_notification.c | 460 ++ .../model/policy_data_change_notification.h | 76 + .../openapi/model/policy_data_subscription.c | 234 + .../openapi/model/policy_data_subscription.h | 48 + lib/sbi/openapi/model/polygon.c | 135 + lib/sbi/openapi/model/polygon.h | 43 + lib/sbi/openapi/model/polygon_all_of.c | 106 + lib/sbi/openapi/model/polygon_all_of.h | 38 + lib/sbi/openapi/model/pp_active_time.c | 144 + lib/sbi/openapi/model/pp_active_time.h | 43 + lib/sbi/openapi/model/pp_data.c | 211 + lib/sbi/openapi/model/pp_data.h | 54 + .../openapi/model/pp_dl_packet_count_ext.c | 120 + .../openapi/model/pp_dl_packet_count_ext.h | 41 + lib/sbi/openapi/model/pp_maximum_latency.c | 144 + lib/sbi/openapi/model/pp_maximum_latency.h | 43 + .../openapi/model/pp_maximum_response_time.c | 144 + .../openapi/model/pp_maximum_response_time.h | 43 + lib/sbi/openapi/model/pp_subs_reg_timer.c | 144 + lib/sbi/openapi/model/pp_subs_reg_timer.h | 43 + lib/sbi/openapi/model/pppp_to_pdb.c | 99 + lib/sbi/openapi/model/pppp_to_pdb.h | 39 + lib/sbi/openapi/model/preemption_capability.c | 51 + lib/sbi/openapi/model/preemption_capability.h | 35 + .../openapi/model/preemption_vulnerability.c | 51 + .../openapi/model/preemption_vulnerability.h | 35 + lib/sbi/openapi/model/preferred_search.c | 70 + lib/sbi/openapi/model/preferred_search.h | 37 + lib/sbi/openapi/model/presence_info.c | 345 ++ lib/sbi/openapi/model/presence_info.h | 54 + lib/sbi/openapi/model/presence_state.c | 51 + lib/sbi/openapi/model/presence_state.h | 35 + .../model/privacy_check_related_action.c | 30 + .../model/privacy_check_related_action.h | 31 + lib/sbi/openapi/model/privacy_parameter.c | 148 + lib/sbi/openapi/model/privacy_parameter.h | 41 + lib/sbi/openapi/model/problem_details_2.c | 240 + lib/sbi/openapi/model/problem_details_2.h | 52 + lib/sbi/openapi/model/provisioned_data_sets.c | 269 + lib/sbi/openapi/model/provisioned_data_sets.h | 59 + lib/sbi/openapi/model/ptw_parameters.c | 102 + lib/sbi/openapi/model/ptw_parameters.h | 40 + .../model/radio_parameter_not_served.c | 159 + .../model/radio_parameter_not_served.h | 45 + lib/sbi/openapi/model/rat_type.c | 51 + lib/sbi/openapi/model/rat_type.h | 35 + lib/sbi/openapi/model/registration_reason.c | 51 + lib/sbi/openapi/model/registration_reason.h | 35 + lib/sbi/openapi/model/report_item.c | 76 + lib/sbi/openapi/model/report_item.h | 37 + lib/sbi/openapi/model/reporting_options.c | 171 + lib/sbi/openapi/model/reporting_options.h | 48 + lib/sbi/openapi/model/resource_item.c | 124 + lib/sbi/openapi/model/resource_item.h | 39 + lib/sbi/openapi/model/restriction_type.c | 51 + lib/sbi/openapi/model/restriction_type.h | 35 + .../openapi/model/resynchronization_info.c | 101 + .../openapi/model/resynchronization_info.h | 39 + lib/sbi/openapi/model/rg_auth_ctx.c | 116 + lib/sbi/openapi/model/rg_auth_ctx.h | 42 + .../openapi/model/rg_authentication_info.c | 96 + .../openapi/model/rg_authentication_info.h | 39 + lib/sbi/openapi/model/rm_info.c | 106 + lib/sbi/openapi/model/rm_info.h | 41 + lib/sbi/openapi/model/rm_state.c | 51 + lib/sbi/openapi/model/rm_state.h | 35 + lib/sbi/openapi/model/roaming_odb.c | 51 + lib/sbi/openapi/model/roaming_odb.h | 35 + lib/sbi/openapi/model/route_information.c | 115 + lib/sbi/openapi/model/route_information.h | 41 + lib/sbi/openapi/model/route_to_location.c | 120 + lib/sbi/openapi/model/route_to_location.h | 42 + .../model/scheduled_communication_time.c | 134 + .../model/scheduled_communication_time.h | 41 + .../model/scheduled_communication_time_rm.c | 134 + .../model/scheduled_communication_time_rm.h | 43 + .../model/scheduled_communication_type.c | 51 + .../model/scheduled_communication_type.h | 35 + .../model/scheduled_communication_type_rm.c | 51 + .../model/scheduled_communication_type_rm.h | 37 + lib/sbi/openapi/model/sdm_subs_modification.c | 114 + lib/sbi/openapi/model/sdm_subs_modification.h | 39 + lib/sbi/openapi/model/sdm_subscription.c | 339 ++ lib/sbi/openapi/model/sdm_subscription.h | 62 + lib/sbi/openapi/model/search_result.c | 24 + lib/sbi/openapi/model/search_result.h | 5 +- lib/sbi/openapi/model/sequence_number.c | 173 + lib/sbi/openapi/model/sequence_number.h | 47 + .../service_application_server_address.c | 366 ++ .../service_application_server_address.h | 52 + .../openapi/model/service_area_restriction.c | 163 + .../openapi/model/service_area_restriction.h | 45 + .../openapi/model/service_id_to_frequency.c | 143 + .../openapi/model/service_id_to_frequency.h | 41 + .../openapi/model/service_id_to_layer2_id.c | 124 + .../openapi/model/service_id_to_layer2_id.h | 39 + lib/sbi/openapi/model/service_id_to_pppr.c | 123 + lib/sbi/openapi/model/service_id_to_pppr.h | 39 + lib/sbi/openapi/model/service_name_cond.h | 2 +- .../openapi/model/service_parameter_data.c | 283 + .../openapi/model/service_parameter_data.h | 60 + .../openapi/model/service_to_pdu_session.c | 240 + .../openapi/model/service_to_pdu_session.h | 48 + lib/sbi/openapi/model/service_to_tx.c | 153 + lib/sbi/openapi/model/service_to_tx.h | 42 + .../model/service_type_unrelated_class.c | 191 + .../model/service_type_unrelated_class.h | 49 + .../session_management_subscription_data.c | 484 ++ .../session_management_subscription_data.h | 66 + lib/sbi/openapi/model/shared_data.c | 331 ++ lib/sbi/openapi/model/shared_data.h | 58 + lib/sbi/openapi/model/sign.c | 30 + lib/sbi/openapi/model/sign.h | 31 + lib/sbi/openapi/model/slrb_configurations.c | 105 + lib/sbi/openapi/model/slrb_configurations.h | 40 + lib/sbi/openapi/model/sm_policy_data.c | 235 + lib/sbi/openapi/model/sm_policy_data.h | 46 + lib/sbi/openapi/model/sm_policy_data_patch.c | 157 + lib/sbi/openapi/model/sm_policy_data_patch.h | 41 + lib/sbi/openapi/model/sm_policy_dnn_data.c | 582 ++ lib/sbi/openapi/model/sm_policy_dnn_data.h | 78 + .../openapi/model/sm_policy_dnn_data_patch.c | 117 + .../openapi/model/sm_policy_dnn_data_patch.h | 39 + lib/sbi/openapi/model/sm_policy_snssai_data.c | 133 + lib/sbi/openapi/model/sm_policy_snssai_data.h | 41 + .../model/sm_policy_snssai_data_patch.c | 133 + .../model/sm_policy_snssai_data_patch.h | 41 + lib/sbi/openapi/model/smf_info.c | 23 +- lib/sbi/openapi/model/smf_info.h | 6 +- lib/sbi/openapi/model/smf_registration.c | 360 ++ lib/sbi/openapi/model/smf_registration.h | 66 + lib/sbi/openapi/model/smf_registration_info.c | 106 + lib/sbi/openapi/model/smf_registration_info.h | 38 + .../model/smf_selection_subscription_data.c | 144 + .../model/smf_selection_subscription_data.h | 42 + .../model/sms_management_subscription_data.c | 252 + .../model/sms_management_subscription_data.h | 54 + lib/sbi/openapi/model/sms_subscription_data.c | 90 + lib/sbi/openapi/model/sms_subscription_data.h | 39 + lib/sbi/openapi/model/sms_support.c | 51 + lib/sbi/openapi/model/sms_support.h | 35 + lib/sbi/openapi/model/smsf_info.c | 105 + lib/sbi/openapi/model/smsf_info.h | 40 + lib/sbi/openapi/model/smsf_registration.c | 209 + lib/sbi/openapi/model/smsf_registration.h | 51 + lib/sbi/openapi/model/snssai_info.c | 106 + lib/sbi/openapi/model/snssai_info.h | 38 + .../model/snssai_route_selection_descriptor.c | 130 + .../model/snssai_route_selection_descriptor.h | 41 + lib/sbi/openapi/model/snssai_smf_info_item.h | 2 +- lib/sbi/openapi/model/snssai_upf_info_item.c | 23 +- lib/sbi/openapi/model/snssai_upf_info_item.h | 6 +- lib/sbi/openapi/model/sor_data.c | 142 + lib/sbi/openapi/model/sor_data.h | 44 + lib/sbi/openapi/model/sor_info.c | 160 + lib/sbi/openapi/model/sor_info.h | 46 + lib/sbi/openapi/model/sor_update_indicator.c | 30 + lib/sbi/openapi/model/sor_update_indicator.h | 31 + lib/sbi/openapi/model/sor_update_info.c | 80 + lib/sbi/openapi/model/sor_update_info.h | 38 + .../openapi/model/sponsor_connectivity_data.c | 99 + .../openapi/model/sponsor_connectivity_data.h | 37 + lib/sbi/openapi/model/sqn_scheme.c | 30 + lib/sbi/openapi/model/sqn_scheme.h | 31 + lib/sbi/openapi/model/ssc_mode.c | 51 + lib/sbi/openapi/model/ssc_mode.h | 35 + lib/sbi/openapi/model/ssc_modes.c | 130 + lib/sbi/openapi/model/ssc_modes.h | 40 + lib/sbi/openapi/model/stationary_indication.c | 51 + lib/sbi/openapi/model/stationary_indication.h | 35 + .../openapi/model/stationary_indication_rm.c | 51 + .../openapi/model/stationary_indication_rm.h | 37 + lib/sbi/openapi/model/steering_container.c | 51 + lib/sbi/openapi/model/steering_container.h | 35 + lib/sbi/openapi/model/steering_info.c | 130 + lib/sbi/openapi/model/steering_info.h | 41 + lib/sbi/openapi/model/stored_search_result.h | 2 +- .../openapi/model/subscribed_default_qos.c | 123 + .../openapi/model/subscribed_default_qos.h | 42 + lib/sbi/openapi/model/subscribed_event.c | 51 + lib/sbi/openapi/model/subscribed_event.h | 35 + lib/sbi/openapi/model/subscription_data.c | 74 +- lib/sbi/openapi/model/subscription_data.h | 8 +- .../openapi/model/subscription_data_sets.c | 317 ++ .../openapi/model/subscription_data_sets.h | 65 + .../model/subscription_data_subscriptions.c | 248 + .../model/subscription_data_subscriptions.h | 52 + .../openapi/model/suggested_packet_num_dl.c | 95 + .../openapi/model/suggested_packet_num_dl.h | 39 + lib/sbi/openapi/model/supi_range.h | 2 +- lib/sbi/openapi/model/supported_gad_shapes.c | 51 + lib/sbi/openapi/model/supported_gad_shapes.h | 35 + lib/sbi/openapi/model/tac_range.h | 2 +- lib/sbi/openapi/model/tai.c | 24 +- lib/sbi/openapi/model/tai.h | 4 +- lib/sbi/openapi/model/tai_range.c | 24 +- lib/sbi/openapi/model/tai_range.h | 6 +- lib/sbi/openapi/model/temporal_validity.c | 91 + lib/sbi/openapi/model/temporal_validity.h | 39 + lib/sbi/openapi/model/time_period.c | 99 + lib/sbi/openapi/model/time_period.h | 40 + lib/sbi/openapi/model/time_window.c | 101 + lib/sbi/openapi/model/time_window.h | 39 + lib/sbi/openapi/model/tmbr.c | 101 + lib/sbi/openapi/model/tmbr.h | 39 + lib/sbi/openapi/model/tngf_info.c | 157 + lib/sbi/openapi/model/tngf_info.h | 41 + lib/sbi/openapi/model/trace_data.c | 215 + lib/sbi/openapi/model/trace_data.h | 50 + lib/sbi/openapi/model/trace_data_response.c | 95 + lib/sbi/openapi/model/trace_data_response.h | 40 + lib/sbi/openapi/model/trace_depth.c | 51 + lib/sbi/openapi/model/trace_depth.h | 35 + lib/sbi/openapi/model/traffic_influ_data.c | 629 ++ lib/sbi/openapi/model/traffic_influ_data.h | 85 + .../openapi/model/traffic_influ_data_notif.c | 95 + .../openapi/model/traffic_influ_data_notif.h | 40 + .../openapi/model/traffic_influ_data_patch.c | 515 ++ .../openapi/model/traffic_influ_data_patch.h | 75 + lib/sbi/openapi/model/traffic_influ_sub.c | 295 + lib/sbi/openapi/model/traffic_influ_sub.h | 50 + lib/sbi/openapi/model/traffic_profile.c | 51 + lib/sbi/openapi/model/traffic_profile.h | 35 + lib/sbi/openapi/model/traffic_profile_rm.c | 51 + lib/sbi/openapi/model/traffic_profile_rm.h | 37 + lib/sbi/openapi/model/transfer_policy.c | 168 + lib/sbi/openapi/model/transfer_policy.h | 46 + lib/sbi/openapi/model/transport_protocol.c | 61 +- lib/sbi/openapi/model/transport_protocol.h | 14 +- lib/sbi/openapi/model/trigger_request.c | 76 + lib/sbi/openapi/model/trigger_request.h | 37 + lib/sbi/openapi/model/twif_info.c | 157 + lib/sbi/openapi/model/twif_info.h | 41 + lib/sbi/openapi/model/udm_info.c | 54 +- lib/sbi/openapi/model/udm_info.h | 7 +- lib/sbi/openapi/model/udr_info.h | 2 +- lib/sbi/openapi/model/udsf_info.c | 121 + lib/sbi/openapi/model/udsf_info.h | 40 + lib/sbi/openapi/model/ue_auth.c | 51 + lib/sbi/openapi/model/ue_auth.h | 35 + lib/sbi/openapi/model/ue_authentication_ctx.c | 184 + lib/sbi/openapi/model/ue_authentication_ctx.h | 46 + .../openapi/model/ue_context_in_smf_data.c | 178 + .../openapi/model/ue_context_in_smf_data.h | 44 + .../openapi/model/ue_context_in_smsf_data.c | 99 + .../openapi/model/ue_context_in_smsf_data.h | 40 + lib/sbi/openapi/model/ue_id.c | 119 + lib/sbi/openapi/model/ue_id.h | 39 + lib/sbi/openapi/model/ue_policy_section.c | 100 + lib/sbi/openapi/model/ue_policy_section.h | 39 + lib/sbi/openapi/model/ue_policy_set.c | 378 ++ lib/sbi/openapi/model/ue_policy_set.h | 54 + lib/sbi/openapi/model/ue_policy_set_patch.c | 229 + lib/sbi/openapi/model/ue_policy_set_patch.h | 46 + lib/sbi/openapi/model/ue_reachability.c | 51 + lib/sbi/openapi/model/ue_reachability.h | 35 + lib/sbi/openapi/model/ue_update_status.c | 30 + lib/sbi/openapi/model/ue_update_status.h | 31 + lib/sbi/openapi/model/uncertainty_ellipse.c | 123 + lib/sbi/openapi/model/uncertainty_ellipse.h | 41 + lib/sbi/openapi/model/unrelated_class.c | 154 + lib/sbi/openapi/model/unrelated_class.h | 44 + lib/sbi/openapi/model/up_confidentiality.c | 51 + lib/sbi/openapi/model/up_confidentiality.h | 35 + lib/sbi/openapi/model/up_integrity.c | 51 + lib/sbi/openapi/model/up_integrity.h | 35 + lib/sbi/openapi/model/up_interface_type.h | 2 +- lib/sbi/openapi/model/up_security.c | 109 + lib/sbi/openapi/model/up_security.h | 41 + lib/sbi/openapi/model/updated_item.c | 101 + lib/sbi/openapi/model/updated_item.h | 39 + lib/sbi/openapi/model/upf_cond.c | 144 + lib/sbi/openapi/model/upf_cond.h | 40 + lib/sbi/openapi/model/upf_info.c | 168 +- lib/sbi/openapi/model/upf_info.h | 20 +- lib/sbi/openapi/model/upu_data.c | 142 + lib/sbi/openapi/model/upu_data.h | 44 + lib/sbi/openapi/model/upu_data_2.c | 141 + lib/sbi/openapi/model/upu_data_2.h | 42 + lib/sbi/openapi/model/upu_info.c | 211 + lib/sbi/openapi/model/upu_info.h | 48 + lib/sbi/openapi/model/usage_mon_data.c | 201 + lib/sbi/openapi/model/usage_mon_data.h | 49 + lib/sbi/openapi/model/usage_mon_data_limit.c | 237 + lib/sbi/openapi/model/usage_mon_data_limit.h | 52 + lib/sbi/openapi/model/usage_mon_data_scope.c | 123 + lib/sbi/openapi/model/usage_mon_data_scope.h | 40 + lib/sbi/openapi/model/usage_mon_level.c | 51 + lib/sbi/openapi/model/usage_mon_level.h | 35 + lib/sbi/openapi/model/usage_threshold.c | 127 + lib/sbi/openapi/model/usage_threshold.h | 43 + lib/sbi/openapi/model/user_identifier.c | 116 + lib/sbi/openapi/model/user_identifier.h | 41 + lib/sbi/openapi/model/user_location.c | 123 + lib/sbi/openapi/model/user_location.h | 44 + lib/sbi/openapi/model/v2x_rat_type.c | 51 + lib/sbi/openapi/model/v2x_rat_type.h | 35 + lib/sbi/openapi/model/valid_time_period.c | 91 + lib/sbi/openapi/model/valid_time_period.h | 39 + .../openapi/model/vendor_specific_feature.c | 101 + .../openapi/model/vendor_specific_feature.h | 39 + lib/sbi/openapi/model/vgmlc_address.c | 111 + lib/sbi/openapi/model/vgmlc_address.h | 41 + lib/sbi/openapi/model/vn_group_data.c | 169 + lib/sbi/openapi/model/vn_group_data.h | 46 + lib/sbi/openapi/model/w_agf_info.c | 157 + lib/sbi/openapi/model/w_agf_info.h | 41 + lib/sbi/path.c | 114 + src/amf/nnrf-build.h => lib/sbi/path.h | 29 +- lib/sbi/server.c | 50 +- lib/sbi/server.h | 15 +- .../3gpp-spec/TS29222_AEF_Security_API.yaml | 133 - ...9222_CAPIF_API_Invoker_Management_API.yaml | 277 - ...222_CAPIF_API_Provider_Management_API.yaml | 208 - ...29222_CAPIF_Access_Control_Policy_API.yaml | 111 - .../3gpp-spec/TS29222_CAPIF_Auditing_API.yaml | 123 - .../TS29222_CAPIF_Discover_Service_API.yaml | 121 - .../3gpp-spec/TS29222_CAPIF_Events_API.yaml | 277 - ...9222_CAPIF_Logging_API_Invocation_API.yaml | 157 - .../TS29222_CAPIF_Publish_Service_API.yaml | 495 -- .../3gpp-spec/TS29222_CAPIF_Security_API.yaml | 444 -- .../TS29486_VAE_ApplicationRequirement.yaml | 237 - .../3gpp-spec/TS29486_VAE_DynamicGroup.yaml | 223 - .../TS29486_VAE_FileDistribution.yaml | 213 - .../TS29486_VAE_ServiceContinuity.yaml | 91 - .../3gpp-spec/TS29502_Nsmf_PDUSession.yaml | 2620 --------- .../support/3gpp-spec/TS29503_Nudm_EE.yaml | 8 - .../3gpp-spec/TS29503_Nudm_NIDDAU.yaml | 120 - .../support/3gpp-spec/TS29503_Nudm_PP.yaml | 8 - .../support/3gpp-spec/TS29503_Nudm_SDM.yaml | 8 - .../support/3gpp-spec/TS29503_Nudm_UEAU.yaml | 7 - .../support/3gpp-spec/TS29503_Nudm_UECM.yaml | 8 - .../support/3gpp-spec/TS29504_Nudr_DR.yaml | 0 .../TS29507_Npcf_AMPolicyControl.yaml | 586 -- .../3gpp-spec/TS29508_Nsmf_EventExposure.yaml | 545 -- .../3gpp-spec/TS29521_Nbsf_Management.yaml | 382 -- .../3gpp-spec/TS29523_Npcf_EventExposure.yaml | 425 -- .../TS29525_Npcf_UEPolicyControl.yaml | 501 -- .../3gpp-spec/TS29540_Nsmsf_SMService.yaml | 269 - .../support/3gpp-spec/TS29549_SS_Events.yaml | 263 - .../3gpp-spec/TS29549_SS_GroupManagement.yaml | 212 - .../TS29549_SS_NetworkResourceAdaptation.yaml | 294 - .../TS29549_SS_UserProfileRetrieval.yaml | 82 - .../TS29594_Nchf_SpendingLimitControl.yaml | 288 - .../3gpp-spec/TS29675_Nucmf_Provisioning.yaml | 282 - .../TS32291_Nchf_ConvergedCharging.yaml | 1261 ---- lib/sbi/support/generator.sh | 5 + .../TS29122_CommonData.yaml | 32 +- .../TS29122_PfdManagement.yaml | 6 +- lib/sbi/support/modified/TS29503_Nudm_EE.yaml | 448 ++ .../support/modified/TS29503_Nudm_NIDDAU.yaml | 169 + lib/sbi/support/modified/TS29503_Nudm_PP.yaml | 483 ++ .../support/modified/TS29503_Nudm_SDM.yaml | 2744 +++++++++ .../support/modified/TS29503_Nudm_UEAU.yaml | 576 ++ .../support/modified/TS29503_Nudm_UECM.yaml | 1414 +++++ lib/sbi/support/modified/TS29504_Nudr_DR.yaml | 172 + .../modified/TS29505_Subscription_Data.yaml | 3645 ++++++++++++ .../TS29509_Nausf_SoRProtection.yaml | 257 +- .../TS29509_Nausf_UEAuthentication.yaml | 406 ++ .../TS29509_Nausf_UPUProtection.yaml | 220 +- .../modified/TS29510_Nnrf_NFDiscovery.yaml | 295 +- .../modified/TS29510_Nnrf_NFManagement.yaml | 646 ++- .../TS29512_Npcf_SMPolicyControl.yaml | 1987 +++++++ .../TS29514_Npcf_PolicyAuthorization.yaml | 2 +- .../TS29517_Naf_EventExposure.yaml | 2 +- .../modified/TS29518_Namf_Communication.yaml | 5061 +++++++++-------- .../TS29518_Namf_EventExposure.yaml | 1115 ++-- .../TS29519_Application_Data.yaml | 2 +- .../TS29519_Exposure_Data.yaml | 2 +- .../support/modified/TS29519_Policy_Data.yaml | 1505 +++++ .../TS29522_IPTVConfiguration.yaml | 2 +- .../TS29522_ServiceParameter.yaml | 2 +- .../TS29522_TrafficInfluence.yaml | 2 +- .../modified/TS29544_Nspaf_SecuredPacket.yaml | 93 + .../TS29551_Nnef_PFDmanagement.yaml | 2 +- .../TS29554_Npcf_BDTPolicyControl.yaml | 2 +- .../support/modified/TS29571_CommonData.yaml | 4320 +++++++------- .../modified/TS29572_Nlmf_Location.yaml | 1139 ++++ .../TS29122_AsSessionWithQoS.yaml | 4 +- .../TS29122_ChargeableParty.yaml | 4 +- .../support/standard/TS29122_CommonData.yaml | 505 ++ .../TS29122_CpProvisioning.yaml | 2 +- .../TS29122_DeviceTriggering.yaml | 4 +- .../TS29122_ECRControl.yaml | 4 +- .../TS29122_GMDviaMBMSbyMB2.yaml | 6 +- .../TS29122_GMDviaMBMSbyxMB.yaml | 6 +- .../TS29122_MonitoringEvent.yaml | 24 +- .../TS29122_MsisdnLessMoSms.yaml | 4 +- .../{3gpp-spec => standard}/TS29122_NIDD.yaml | 18 +- .../TS29122_NpConfiguration.yaml | 4 +- .../standard/TS29122_PfdManagement.yaml | 600 ++ .../TS29122_RacsParameterProvisioning.yaml | 7 +- .../TS29122_ReportingNetworkStatus.yaml | 6 +- .../TS29122_ResourceManagementOfBdt.yaml | 2 +- lib/sbi/support/standard/TS29503_Nudm_EE.yaml | 448 ++ lib/sbi/support/standard/TS29503_Nudm_MT.yaml | 191 + .../support/standard/TS29503_Nudm_NIDDAU.yaml | 169 + lib/sbi/support/standard/TS29503_Nudm_PP.yaml | 483 ++ .../support/standard/TS29503_Nudm_SDM.yaml | 2742 +++++++++ .../support/standard/TS29503_Nudm_UEAU.yaml | 576 ++ .../support/standard/TS29503_Nudm_UECM.yaml | 1414 +++++ lib/sbi/support/standard/TS29504_Nudr_DR.yaml | 172 + .../standard/TS29504_Nudr_GroupIDmap.yaml | 94 + .../standard/TS29505_Subscription_Data.yaml | 3645 ++++++++++++ .../standard/TS29509_Nausf_SoRProtection.yaml | 129 + .../TS29509_Nausf_UEAuthentication.yaml | 680 ++- .../standard/TS29509_Nausf_UPUProtection.yaml | 111 + .../TS29510_Nnrf_AccessToken.yaml | 60 +- .../standard/TS29510_Nnrf_Bootstrapping.yaml | 59 + .../TS29510_Nnrf_NFDiscovery.yaml | 295 +- .../TS29510_Nnrf_NFManagement.yaml | 642 ++- .../TS29512_Npcf_SMPolicyControl.yaml | 6 +- .../TS29514_Npcf_PolicyAuthorization.yaml | 1702 ++++++ .../TS29517_Naf_EventExposure.yaml} | 284 +- .../TS29518_Namf_Communication.yaml | 5061 +++++++++-------- .../standard/TS29518_Namf_EventExposure.yaml | 586 ++ .../TS29518_Namf_Location.yaml | 737 ++- .../TS29518_Namf_MT.yaml | 409 +- .../standard/TS29519_Application_Data.yaml | 2001 +++++++ .../standard/TS29519_Exposure_Data.yaml | 656 +++ .../TS29519_Policy_Data.yaml | 2 +- .../TS29520_Nnwdaf_AnalyticsInfo.yaml | 2 +- .../TS29520_Nnwdaf_EventsSubscription.yaml | 4 +- .../TS29522_5GLANParameterProvision.yaml | 2 +- .../TS29522_AnalyticsExposure.yaml | 4 +- .../TS29522_ApplyingBdtPolicy.yaml | 2 +- .../standard/TS29522_IPTVConfiguration.yaml | 380 ++ .../TS29522_LpiParameterProvision.yaml | 2 +- .../TS29522_NIDDConfigurationTrigger.yaml | 2 +- .../standard/TS29522_ServiceParameter.yaml | 637 +++ .../standard/TS29522_TrafficInfluence.yaml | 564 ++ .../standard/TS29544_Nspaf_SecuredPacket.yaml | 93 + .../TS29551_Nnef_PFDmanagement.yaml} | 474 +- .../TS29554_Npcf_BDTPolicyControl.yaml | 383 ++ .../TS29571_CommonData.yaml | 4306 +++++++------- .../standard/TS29572_Nlmf_Broadcast.yaml | 210 + .../standard/TS29572_Nlmf_Location.yaml | 1139 ++++ misc/netconf.sh | 2 + src/amf/amf-sm.c | 235 +- src/amf/amf-sm.h | 18 + src/amf/app.c | 3 + src/amf/context.c | 1175 +++- src/amf/context.h | 538 +- src/amf/event.c | 9 + src/amf/event.h | 51 +- src/amf/gmm-build.c | 533 ++ src/amf/gmm-build.h | 56 + src/amf/gmm-handler.c | 730 +++ src/amf/gmm-handler.h | 60 + src/amf/gmm-sm.c | 1009 ++++ src/amf/gsm-sm.c | 360 ++ src/amf/meson.build | 13 +- src/amf/nas-path.c | 587 ++ src/amf/nas-path.h | 87 + src/amf/nas-security.c | 192 + src/amf/nas-security.h | 40 + src/amf/nausf-build.c | 93 + src/amf/nausf-build.h | 37 + src/amf/nausf-handler.c | 155 + src/amf/nausf-handler.h | 38 + src/amf/nf-sm.c | 60 +- src/amf/ngap-build.c | 480 +- src/amf/ngap-build.h | 42 +- src/amf/ngap-handler.c | 739 +-- src/amf/ngap-handler.h | 2 +- src/amf/ngap-path.c | 153 +- src/amf/ngap-path.h | 30 +- src/amf/ngap-sm.c | 10 +- src/amf/nnrf-build.c | 204 - src/amf/nnrf-handler.c | 127 +- src/amf/nnrf-handler.h | 5 +- src/amf/sbi-path.c | 190 +- src/amf/sbi-path.h | 19 +- src/amf/timer.c | 160 +- src/amf/timer.h | 20 + src/ausf/app.c | 40 + src/ausf/ausf-sm.c | 362 ++ src/ausf/ausf-sm.h | 55 + src/ausf/context.c | 229 + src/ausf/context.h | 120 + src/ausf/event.c | 92 + src/ausf/event.h | 84 + src/ausf/init.c | 134 + src/ausf/meson.build | 63 + src/ausf/nausf-handler.c | 106 + src/ausf/nausf-handler.h | 38 + src/ausf/nf-sm.c | 390 ++ src/ausf/nnrf-handler.c | 328 ++ src/ausf/nnrf-handler.h | 44 + src/ausf/nudm-build.c | 106 + src/{mme/mme-kdf.h => ausf/nudm-build.h} | 30 +- src/ausf/nudm-handler.c | 272 + src/ausf/nudm-handler.h | 36 + src/ausf/sbi-path.c | 238 + src/ausf/sbi-path.h | 47 + src/ausf/timer.c | 117 + src/ausf/timer.h | 64 + src/ausf/ue-sm.c | 188 + src/hss/hss-auc.c | 4 +- src/hss/hss-auc.h | 3 - src/hss/hss-context.c | 30 +- src/hss/hss-context.h | 13 +- src/hss/hss-fd-path.c | 54 +- src/meson.build | 3 + src/mme/emm-build.c | 5 +- src/mme/emm-handler.c | 15 +- src/mme/emm-sm.c | 12 +- src/mme/meson.build | 2 - src/mme/mme-context.c | 2 +- src/mme/mme-kdf.c | 71 - src/mme/mme-sm.c | 2 +- src/mme/nas-path.h | 6 +- src/mme/nas-security.h | 6 +- src/mme/s1ap-build.c | 1 - src/mme/s1ap-handler.c | 5 +- src/mme/sgsap-handler.c | 14 +- src/nrf/nf-sm.c | 66 +- src/nrf/nnrf-build.c | 6 +- src/nrf/nnrf-build.h | 2 +- src/nrf/nnrf-handler.c | 85 +- src/nrf/nnrf-handler.h | 16 +- src/nrf/nrf-sm.c | 60 +- src/nrf/sbi-path.c | 9 +- src/nrf/sbi-path.h | 5 +- src/smf/context.h | 16 + src/smf/nf-sm.c | 69 +- src/smf/nnrf-build.c | 182 +- src/smf/nnrf-build.h | 15 +- src/smf/nnrf-handler.c | 101 +- src/smf/nnrf-handler.h | 3 +- src/smf/sbi-path.c | 113 +- src/smf/sbi-path.h | 15 +- src/smf/smf-sm.c | 45 +- src/smf/timer.c | 15 + src/smf/timer.h | 2 + src/udm/app.c | 40 + src/udm/context.c | 229 + src/udm/context.h | 115 + src/udm/event.c | 92 + src/udm/event.h | 84 + src/udm/init.c | 134 + src/udm/meson.build | 63 + src/udm/nf-sm.c | 390 ++ src/udm/nnrf-handler.c | 325 ++ src/udm/nnrf-handler.h | 43 + src/udm/nudm-handler.c | 109 + src/udm/nudm-handler.h | 37 + src/udm/nudr-build.c | 85 + src/udm/nudr-build.h | 36 + src/udm/nudr-handler.c | 251 + src/udm/nudr-handler.h | 36 + src/udm/sbi-path.c | 229 + src/udm/sbi-path.h | 48 + src/udm/timer.c | 117 + src/udm/timer.h | 64 + src/udm/udm-sm.c | 381 ++ src/udm/udm-sm.h | 55 + src/udm/ue-sm.c | 170 + src/udr/app.c | 40 + src/udr/context.c | 99 + src/udr/context.h | 76 + src/udr/event.c | 92 + src/udr/event.h | 80 + src/udr/init.c | 139 + src/udr/meson.build | 59 + src/udr/nf-sm.c | 390 ++ src/udr/nnrf-handler.c | 218 + src/udr/nnrf-handler.h | 41 + src/udr/nudr-handler.c | 180 + src/udr/nudr-handler.h | 36 + src/udr/sbi-path.c | 115 + src/udr/sbi-path.h | 38 + src/udr/timer.c | 107 + src/udr/timer.h | 62 + src/udr/udr-sm.c | 285 + src/udr/udr-sm.h | 50 + tests/app/5gc-init.c | 42 +- tests/app/epc-init.c | 2 +- tests/app/meson.build | 6 +- tests/app/test-5gc.h | 4 +- tests/app/test-epc.h | 2 +- tests/common/context.c | 41 + tests/common/context.h | 62 + tests/common/gmm-build.c | 164 + tests/common/gmm-build.h | 37 + tests/common/gmm-handler.c | 73 + tests/common/gmm-handler.h | 36 + tests/common/meson.build | 7 + tests/common/nas-path.c | 54 + tests/common/nas-path.h | 34 + tests/common/nas-security.c | 190 + tests/common/nas-security.h | 37 + tests/common/ngap-build.c | 233 +- tests/common/ngap-build.h | 5 +- tests/common/ngap-handler.c | 69 + tests/common/ngap-handler.h | 34 + tests/common/ngap-path.c | 169 + tests/common/ngap-path.h | 34 + tests/common/test-common.h | 4 + tests/common/test-ngap.h | 2 + tests/core/conv-test.c | 8 +- tests/core/fsm-test.c | 6 +- tests/minimal/minimal-test.c | 111 +- 1151 files changed, 140173 insertions(+), 24799 deletions(-) create mode 100644 configs/open5gs/ausf.yaml.in create mode 100644 configs/open5gs/udm.yaml.in create mode 100644 configs/open5gs/udr.yaml.in create mode 100644 lib/crypt/ogs-kdf.c create mode 100644 lib/crypt/ogs-kdf.h create mode 100644 lib/dbi/subscription.c create mode 100644 lib/dbi/subscription.h create mode 100644 lib/nas/5gs/conv.c create mode 100644 lib/nas/5gs/conv.h create mode 100644 lib/sbi/openapi/model/access_and_mobility_data.c create mode 100644 lib/sbi/openapi/model/access_and_mobility_data.h create mode 100644 lib/sbi/openapi/model/access_and_mobility_subscription_data.c create mode 100644 lib/sbi/openapi/model/access_and_mobility_subscription_data.h create mode 100644 lib/sbi/openapi/model/access_right_status.c create mode 100644 lib/sbi/openapi/model/access_right_status.h create mode 100644 lib/sbi/openapi/model/access_tech.c create mode 100644 lib/sbi/openapi/model/access_tech.h create mode 100644 lib/sbi/openapi/model/acknowledge_info.c create mode 100644 lib/sbi/openapi/model/acknowledge_info.h create mode 100644 lib/sbi/openapi/model/acs_info.c create mode 100644 lib/sbi/openapi/model/acs_info.h create mode 100644 lib/sbi/openapi/model/acs_info_rm.c create mode 100644 lib/sbi/openapi/model/acs_info_rm.h create mode 100644 lib/sbi/openapi/model/additional_snssai_data.c create mode 100644 lib/sbi/openapi/model/additional_snssai_data.h create mode 100644 lib/sbi/openapi/model/af_event.c create mode 100644 lib/sbi/openapi/model/af_event.h create mode 100644 lib/sbi/openapi/model/af_event_exposure_data.c create mode 100644 lib/sbi/openapi/model/af_event_exposure_data.h create mode 100644 lib/sbi/openapi/model/af_external.c create mode 100644 lib/sbi/openapi/model/af_external.h create mode 100644 lib/sbi/openapi/model/af_non_external.c create mode 100644 lib/sbi/openapi/model/af_non_external.h create mode 100644 lib/sbi/openapi/model/am_policy_data.c create mode 100644 lib/sbi/openapi/model/am_policy_data.h create mode 100644 lib/sbi/openapi/model/ambr.c create mode 100644 lib/sbi/openapi/model/ambr.h create mode 100644 lib/sbi/openapi/model/ambr_rm.c create mode 100644 lib/sbi/openapi/model/ambr_rm.h create mode 100644 lib/sbi/openapi/model/amf3_gpp_access_registration.c create mode 100644 lib/sbi/openapi/model/amf3_gpp_access_registration.h create mode 100644 lib/sbi/openapi/model/amf3_gpp_access_registration_modification.c create mode 100644 lib/sbi/openapi/model/amf3_gpp_access_registration_modification.h create mode 100644 lib/sbi/openapi/model/amf_dereg_info.c create mode 100644 lib/sbi/openapi/model/amf_dereg_info.h create mode 100644 lib/sbi/openapi/model/amf_non3_gpp_access_registration.c create mode 100644 lib/sbi/openapi/model/amf_non3_gpp_access_registration.h create mode 100644 lib/sbi/openapi/model/amf_non3_gpp_access_registration_modification.c create mode 100644 lib/sbi/openapi/model/amf_non3_gpp_access_registration_modification.h create mode 100644 lib/sbi/openapi/model/amf_subscription_info.c create mode 100644 lib/sbi/openapi/model/amf_subscription_info.h create mode 100644 lib/sbi/openapi/model/an_node_type.c create mode 100644 lib/sbi/openapi/model/an_node_type.h create mode 100644 lib/sbi/openapi/model/app_descriptor.c create mode 100644 lib/sbi/openapi/model/app_descriptor.h create mode 100644 lib/sbi/openapi/model/app_port_id.c create mode 100644 lib/sbi/openapi/model/app_port_id.h create mode 100644 lib/sbi/openapi/model/application_data_change_notif.c create mode 100644 lib/sbi/openapi/model/application_data_change_notif.h create mode 100644 lib/sbi/openapi/model/application_data_subs.c create mode 100644 lib/sbi/openapi/model/application_data_subs.h create mode 100644 lib/sbi/openapi/model/area.c create mode 100644 lib/sbi/openapi/model/area.h create mode 100644 lib/sbi/openapi/model/arp.c create mode 100644 lib/sbi/openapi/model/arp.h create mode 100644 lib/sbi/openapi/model/association_type.c create mode 100644 lib/sbi/openapi/model/association_type.h create mode 100644 lib/sbi/openapi/model/auth_event.c create mode 100644 lib/sbi/openapi/model/auth_event.h create mode 100644 lib/sbi/openapi/model/auth_method.c create mode 100644 lib/sbi/openapi/model/auth_method.h create mode 100644 lib/sbi/openapi/model/auth_result.c create mode 100644 lib/sbi/openapi/model/auth_result.h create mode 100644 lib/sbi/openapi/model/auth_type.c create mode 100644 lib/sbi/openapi/model/auth_type.h create mode 100644 lib/sbi/openapi/model/authentication_info.c create mode 100644 lib/sbi/openapi/model/authentication_info.h create mode 100644 lib/sbi/openapi/model/authentication_info_request.c create mode 100644 lib/sbi/openapi/model/authentication_info_request.h create mode 100644 lib/sbi/openapi/model/authentication_info_result.c create mode 100644 lib/sbi/openapi/model/authentication_info_result.h create mode 100644 lib/sbi/openapi/model/authentication_subscription.c create mode 100644 lib/sbi/openapi/model/authentication_subscription.h create mode 100644 lib/sbi/openapi/model/authentication_vector.c create mode 100644 lib/sbi/openapi/model/authentication_vector.h create mode 100644 lib/sbi/openapi/model/authorization_data.c create mode 100644 lib/sbi/openapi/model/authorization_data.h create mode 100644 lib/sbi/openapi/model/av5_g_he_aka.c create mode 100644 lib/sbi/openapi/model/av5_g_he_aka.h create mode 100644 lib/sbi/openapi/model/av5g_aka.c create mode 100644 lib/sbi/openapi/model/av5g_aka.h create mode 100644 lib/sbi/openapi/model/av_eap_aka_prime.c create mode 100644 lib/sbi/openapi/model/av_eap_aka_prime.h create mode 100644 lib/sbi/openapi/model/av_eps_aka.c create mode 100644 lib/sbi/openapi/model/av_eps_aka.h create mode 100644 lib/sbi/openapi/model/av_ims_gba_eap_aka.c create mode 100644 lib/sbi/openapi/model/av_ims_gba_eap_aka.h create mode 100644 lib/sbi/openapi/model/av_type.c create mode 100644 lib/sbi/openapi/model/av_type.h create mode 100644 lib/sbi/openapi/model/backup_amf_info.c create mode 100644 lib/sbi/openapi/model/backup_amf_info.h create mode 100644 lib/sbi/openapi/model/battery_indication.c create mode 100644 lib/sbi/openapi/model/battery_indication.h create mode 100644 lib/sbi/openapi/model/battery_indication_rm.c create mode 100644 lib/sbi/openapi/model/battery_indication_rm.h create mode 100644 lib/sbi/openapi/model/bdt_data.c create mode 100644 lib/sbi/openapi/model/bdt_data.h create mode 100644 lib/sbi/openapi/model/bdt_policy_data.c create mode 100644 lib/sbi/openapi/model/bdt_policy_data.h create mode 100644 lib/sbi/openapi/model/bdt_policy_data_patch.c create mode 100644 lib/sbi/openapi/model/bdt_policy_data_patch.h create mode 100644 lib/sbi/openapi/model/cag_ack_data.c create mode 100644 lib/sbi/openapi/model/cag_ack_data.h create mode 100644 lib/sbi/openapi/model/cag_data.c create mode 100644 lib/sbi/openapi/model/cag_data.h create mode 100644 lib/sbi/openapi/model/cag_info.c create mode 100644 lib/sbi/openapi/model/cag_info.h create mode 100644 lib/sbi/openapi/model/charging_information.c create mode 100644 lib/sbi/openapi/model/charging_information.h create mode 100644 lib/sbi/openapi/model/civic_address.c create mode 100644 lib/sbi/openapi/model/civic_address.h create mode 100644 lib/sbi/openapi/model/cm_info.c create mode 100644 lib/sbi/openapi/model/cm_info.h create mode 100644 lib/sbi/openapi/model/cm_info_report.c create mode 100644 lib/sbi/openapi/model/cm_info_report.h create mode 100644 lib/sbi/openapi/model/cm_state.c create mode 100644 lib/sbi/openapi/model/cm_state.h create mode 100644 lib/sbi/openapi/model/code_word_ind.c create mode 100644 lib/sbi/openapi/model/code_word_ind.h create mode 100644 lib/sbi/openapi/model/communication_characteristics.c create mode 100644 lib/sbi/openapi/model/communication_characteristics.h create mode 100644 lib/sbi/openapi/model/configuration_parameters_eutra.c create mode 100644 lib/sbi/openapi/model/configuration_parameters_eutra.h create mode 100644 lib/sbi/openapi/model/configuration_parameters_nr.c create mode 100644 lib/sbi/openapi/model/configuration_parameters_nr.h create mode 100644 lib/sbi/openapi/model/confirmation_data.c create mode 100644 lib/sbi/openapi/model/confirmation_data.h create mode 100644 lib/sbi/openapi/model/confirmation_data_response.c create mode 100644 lib/sbi/openapi/model/confirmation_data_response.h create mode 100644 lib/sbi/openapi/model/context_data_set_name.c create mode 100644 lib/sbi/openapi/model/context_data_set_name.h create mode 100644 lib/sbi/openapi/model/context_data_sets.c create mode 100644 lib/sbi/openapi/model/context_data_sets.h create mode 100644 lib/sbi/openapi/model/core_network_type.c create mode 100644 lib/sbi/openapi/model/core_network_type.h create mode 100644 lib/sbi/openapi/model/data_change_notify.c create mode 100644 lib/sbi/openapi/model/data_change_notify.h create mode 100644 lib/sbi/openapi/model/data_filter.c create mode 100644 lib/sbi/openapi/model/data_filter.h create mode 100644 lib/sbi/openapi/model/data_ind.c create mode 100644 lib/sbi/openapi/model/data_ind.h create mode 100644 lib/sbi/openapi/model/data_set_name.c create mode 100644 lib/sbi/openapi/model/data_set_name.h create mode 100644 lib/sbi/openapi/model/datalink_reporting_configuration.c create mode 100644 lib/sbi/openapi/model/datalink_reporting_configuration.h create mode 100644 lib/sbi/openapi/model/ddd_traffic_descriptor.c create mode 100644 lib/sbi/openapi/model/ddd_traffic_descriptor.h create mode 100644 lib/sbi/openapi/model/deregistration_data.c create mode 100644 lib/sbi/openapi/model/deregistration_data.h create mode 100644 lib/sbi/openapi/model/deregistration_reason.c create mode 100644 lib/sbi/openapi/model/deregistration_reason.h create mode 100644 lib/sbi/openapi/model/dl_data_delivery_status.c create mode 100644 lib/sbi/openapi/model/dl_data_delivery_status.h create mode 100644 lib/sbi/openapi/model/dnai_change_type.c create mode 100644 lib/sbi/openapi/model/dnai_change_type.h create mode 100644 lib/sbi/openapi/model/dnn_configuration.c create mode 100644 lib/sbi/openapi/model/dnn_configuration.h create mode 100644 lib/sbi/openapi/model/dnn_info.c create mode 100644 lib/sbi/openapi/model/dnn_info.h create mode 100644 lib/sbi/openapi/model/dnn_route_selection_descriptor.c create mode 100644 lib/sbi/openapi/model/dnn_route_selection_descriptor.h create mode 100644 lib/sbi/openapi/model/domain_name_protocol.c create mode 100644 lib/sbi/openapi/model/domain_name_protocol.h create mode 100644 lib/sbi/openapi/model/eap_session.c create mode 100644 lib/sbi/openapi/model/eap_session.h create mode 100644 lib/sbi/openapi/model/ec_restriction.c create mode 100644 lib/sbi/openapi/model/ec_restriction.h create mode 100644 lib/sbi/openapi/model/ec_restriction_data.c create mode 100644 lib/sbi/openapi/model/ec_restriction_data.h create mode 100644 lib/sbi/openapi/model/ecgi.c create mode 100644 lib/sbi/openapi/model/ecgi.h create mode 100644 lib/sbi/openapi/model/edrx_parameters.c create mode 100644 lib/sbi/openapi/model/edrx_parameters.h create mode 100644 lib/sbi/openapi/model/ee_profile_data.c create mode 100644 lib/sbi/openapi/model/ee_profile_data.h create mode 100644 lib/sbi/openapi/model/ee_subscription.c create mode 100644 lib/sbi/openapi/model/ee_subscription.h create mode 100644 lib/sbi/openapi/model/ellipsoid_arc.c create mode 100644 lib/sbi/openapi/model/ellipsoid_arc.h create mode 100644 lib/sbi/openapi/model/ellipsoid_arc_all_of.c create mode 100644 lib/sbi/openapi/model/ellipsoid_arc_all_of.h create mode 100644 lib/sbi/openapi/model/emergency_info.c create mode 100644 lib/sbi/openapi/model/emergency_info.h create mode 100644 lib/sbi/openapi/model/enhanced_coverage_restriction_data.c create mode 100644 lib/sbi/openapi/model/enhanced_coverage_restriction_data.h create mode 100644 lib/sbi/openapi/model/eps_interworking_info.c create mode 100644 lib/sbi/openapi/model/eps_interworking_info.h create mode 100644 lib/sbi/openapi/model/eps_iwk_pgw.c create mode 100644 lib/sbi/openapi/model/eps_iwk_pgw.h create mode 100644 lib/sbi/openapi/model/eth_flow_description.c create mode 100644 lib/sbi/openapi/model/eth_flow_description.h create mode 100644 lib/sbi/openapi/model/eutra_location.c create mode 100644 lib/sbi/openapi/model/eutra_location.h create mode 100644 lib/sbi/openapi/model/event_report_mode.c create mode 100644 lib/sbi/openapi/model/event_report_mode.h create mode 100644 lib/sbi/openapi/model/event_type.c create mode 100644 lib/sbi/openapi/model/event_type.h create mode 100644 lib/sbi/openapi/model/expected_ue_behaviour.c create mode 100644 lib/sbi/openapi/model/expected_ue_behaviour.h create mode 100644 lib/sbi/openapi/model/expected_ue_behaviour_data.c create mode 100644 lib/sbi/openapi/model/expected_ue_behaviour_data.h create mode 100644 lib/sbi/openapi/model/exposure_data_change_notification.c create mode 100644 lib/sbi/openapi/model/exposure_data_change_notification.h create mode 100644 lib/sbi/openapi/model/exposure_data_subscription.c create mode 100644 lib/sbi/openapi/model/exposure_data_subscription.h create mode 100644 lib/sbi/openapi/model/external_client_type.c create mode 100644 lib/sbi/openapi/model/external_client_type.h create mode 100644 lib/sbi/openapi/model/external_unrelated_class.c create mode 100644 lib/sbi/openapi/model/external_unrelated_class.h create mode 100644 lib/sbi/openapi/model/flow_direction.c create mode 100644 lib/sbi/openapi/model/flow_direction.h create mode 100644 lib/sbi/openapi/model/flow_info.c create mode 100644 lib/sbi/openapi/model/flow_info.h create mode 100644 lib/sbi/openapi/model/frame_route_info.c create mode 100644 lib/sbi/openapi/model/frame_route_info.h create mode 100644 lib/sbi/openapi/model/g_nb_id.c create mode 100644 lib/sbi/openapi/model/g_nb_id.h create mode 100644 lib/sbi/openapi/model/gad_shape.c create mode 100644 lib/sbi/openapi/model/gad_shape.h create mode 100644 lib/sbi/openapi/model/geographic_area.c create mode 100644 lib/sbi/openapi/model/geographic_area.h create mode 100644 lib/sbi/openapi/model/geographical_coordinates.c create mode 100644 lib/sbi/openapi/model/geographical_coordinates.h create mode 100644 lib/sbi/openapi/model/global_ran_node_id.c create mode 100644 lib/sbi/openapi/model/global_ran_node_id.h create mode 100644 lib/sbi/openapi/model/gmlc_info.c create mode 100644 lib/sbi/openapi/model/gmlc_info.h create mode 100644 lib/sbi/openapi/model/group_identifiers.c create mode 100644 lib/sbi/openapi/model/group_identifiers.h create mode 100644 lib/sbi/openapi/model/hfc_node_id.c create mode 100644 lib/sbi/openapi/model/hfc_node_id.h create mode 100644 lib/sbi/openapi/model/hss_auth_type.c create mode 100644 lib/sbi/openapi/model/hss_auth_type.h create mode 100644 lib/sbi/openapi/model/hss_authentication_info_request.c create mode 100644 lib/sbi/openapi/model/hss_authentication_info_request.h create mode 100644 lib/sbi/openapi/model/hss_authentication_info_result.c create mode 100644 lib/sbi/openapi/model/hss_authentication_info_result.h create mode 100644 lib/sbi/openapi/model/hss_authentication_vectors.c create mode 100644 lib/sbi/openapi/model/hss_authentication_vectors.h create mode 100644 lib/sbi/openapi/model/hss_av_type.c create mode 100644 lib/sbi/openapi/model/hss_av_type.h create mode 100644 lib/sbi/openapi/model/hss_info.c create mode 100644 lib/sbi/openapi/model/hss_info.h create mode 100644 lib/sbi/openapi/model/id_translation_result.c create mode 100644 lib/sbi/openapi/model/id_translation_result.h create mode 100644 lib/sbi/openapi/model/identity_data.c create mode 100644 lib/sbi/openapi/model/identity_data.h create mode 100644 lib/sbi/openapi/model/ims_vo_ps.c create mode 100644 lib/sbi/openapi/model/ims_vo_ps.h create mode 100644 lib/sbi/openapi/model/imsi_range.c create mode 100644 lib/sbi/openapi/model/imsi_range.h create mode 100644 lib/sbi/openapi/model/internal_group_id_range.c create mode 100644 lib/sbi/openapi/model/internal_group_id_range.h create mode 100644 lib/sbi/openapi/model/ip_address.c create mode 100644 lib/sbi/openapi/model/ip_address.h create mode 100644 lib/sbi/openapi/model/iptv_config_data.c create mode 100644 lib/sbi/openapi/model/iptv_config_data.h create mode 100644 lib/sbi/openapi/model/iptv_config_data_patch.c create mode 100644 lib/sbi/openapi/model/iptv_config_data_patch.h create mode 100644 lib/sbi/openapi/model/lcs_client_class.c create mode 100644 lib/sbi/openapi/model/lcs_client_class.h create mode 100644 lib/sbi/openapi/model/lcs_client_external.c create mode 100644 lib/sbi/openapi/model/lcs_client_external.h create mode 100644 lib/sbi/openapi/model/lcs_client_group_external.c create mode 100644 lib/sbi/openapi/model/lcs_client_group_external.h create mode 100644 lib/sbi/openapi/model/lcs_client_non_external.c create mode 100644 lib/sbi/openapi/model/lcs_client_non_external.h create mode 100644 lib/sbi/openapi/model/lcs_mo_data.c create mode 100644 lib/sbi/openapi/model/lcs_mo_data.h create mode 100644 lib/sbi/openapi/model/lcs_mo_service_class.c create mode 100644 lib/sbi/openapi/model/lcs_mo_service_class.h create mode 100644 lib/sbi/openapi/model/lcs_privacy.c create mode 100644 lib/sbi/openapi/model/lcs_privacy.h create mode 100644 lib/sbi/openapi/model/lcs_privacy_data.c create mode 100644 lib/sbi/openapi/model/lcs_privacy_data.h create mode 100644 lib/sbi/openapi/model/limit_id_to_monitoring_key.c create mode 100644 lib/sbi/openapi/model/limit_id_to_monitoring_key.h create mode 100644 lib/sbi/openapi/model/lmf_info.c create mode 100644 lib/sbi/openapi/model/lmf_info.h create mode 100644 lib/sbi/openapi/model/location_accuracy.c create mode 100644 lib/sbi/openapi/model/location_accuracy.h create mode 100644 lib/sbi/openapi/model/location_area.c create mode 100644 lib/sbi/openapi/model/location_area.h create mode 100644 lib/sbi/openapi/model/location_info.c create mode 100644 lib/sbi/openapi/model/location_info.h create mode 100644 lib/sbi/openapi/model/location_privacy_ind.c create mode 100644 lib/sbi/openapi/model/location_privacy_ind.h create mode 100644 lib/sbi/openapi/model/location_reporting_configuration.c create mode 100644 lib/sbi/openapi/model/location_reporting_configuration.h create mode 100644 lib/sbi/openapi/model/lpi.c create mode 100644 lib/sbi/openapi/model/lpi.h create mode 100644 lib/sbi/openapi/model/lte_v2x_auth.c create mode 100644 lib/sbi/openapi/model/lte_v2x_auth.h create mode 100644 lib/sbi/openapi/model/maximum_latency.c create mode 100644 lib/sbi/openapi/model/maximum_latency.h create mode 100644 lib/sbi/openapi/model/maximum_response_time.c create mode 100644 lib/sbi/openapi/model/maximum_response_time.h create mode 100644 lib/sbi/openapi/model/model_5_g_vn_group_configuration.c create mode 100644 lib/sbi/openapi/model/model_5_g_vn_group_configuration.h create mode 100644 lib/sbi/openapi/model/model_5_g_vn_group_data.c create mode 100644 lib/sbi/openapi/model/model_5_g_vn_group_data.h create mode 100644 lib/sbi/openapi/model/modification_notification.c create mode 100644 lib/sbi/openapi/model/modification_notification.h create mode 100644 lib/sbi/openapi/model/monitoring_configuration.c create mode 100644 lib/sbi/openapi/model/monitoring_configuration.h create mode 100644 lib/sbi/openapi/model/multicast_access_control.c create mode 100644 lib/sbi/openapi/model/multicast_access_control.h create mode 100644 lib/sbi/openapi/model/n3ga_location.c create mode 100644 lib/sbi/openapi/model/n3ga_location.h create mode 100644 lib/sbi/openapi/model/ncgi.c create mode 100644 lib/sbi/openapi/model/ncgi.h create mode 100644 lib/sbi/openapi/model/nef_info.c create mode 100644 lib/sbi/openapi/model/nef_info.h create mode 100644 lib/sbi/openapi/model/network_area_info.c create mode 100644 lib/sbi/openapi/model/network_area_info.h create mode 100644 lib/sbi/openapi/model/network_area_info_2.c create mode 100644 lib/sbi/openapi/model/network_area_info_2.h create mode 100644 lib/sbi/openapi/model/network_node_diameter_address.c create mode 100644 lib/sbi/openapi/model/network_node_diameter_address.h create mode 100644 lib/sbi/openapi/model/nf_info.c create mode 100644 lib/sbi/openapi/model/nf_info.h create mode 100644 lib/sbi/openapi/model/nf_service_set_cond.c create mode 100644 lib/sbi/openapi/model/nf_service_set_cond.h create mode 100644 lib/sbi/openapi/model/nf_set_cond.c create mode 100644 lib/sbi/openapi/model/nf_set_cond.h create mode 100644 lib/sbi/openapi/model/nidd_information.c create mode 100644 lib/sbi/openapi/model/nidd_information.h create mode 100644 lib/sbi/openapi/model/non_external_unrelated_class.c create mode 100644 lib/sbi/openapi/model/non_external_unrelated_class.h create mode 100644 lib/sbi/openapi/model/notification_item.c create mode 100644 lib/sbi/openapi/model/notification_item.h create mode 100644 lib/sbi/openapi/model/notify_item.c create mode 100644 lib/sbi/openapi/model/notify_item.h create mode 100644 lib/sbi/openapi/model/nr_location.c create mode 100644 lib/sbi/openapi/model/nr_location.h create mode 100644 lib/sbi/openapi/model/nr_v2x_auth.c create mode 100644 lib/sbi/openapi/model/nr_v2x_auth.h create mode 100644 lib/sbi/openapi/model/nssai.c create mode 100644 lib/sbi/openapi/model/nssai.h create mode 100644 lib/sbi/openapi/model/nssai_ack_data.c create mode 100644 lib/sbi/openapi/model/nssai_ack_data.h create mode 100644 lib/sbi/openapi/model/null_value.c create mode 100644 lib/sbi/openapi/model/null_value.h create mode 100644 lib/sbi/openapi/model/odb_data.c create mode 100644 lib/sbi/openapi/model/odb_data.h create mode 100644 lib/sbi/openapi/model/odb_packet_services.c create mode 100644 lib/sbi/openapi/model/odb_packet_services.h create mode 100644 lib/sbi/openapi/model/operation_mode.c create mode 100644 lib/sbi/openapi/model/operation_mode.h create mode 100644 lib/sbi/openapi/model/operator_managed.c create mode 100644 lib/sbi/openapi/model/operator_managed.h create mode 100644 lib/sbi/openapi/model/operator_specific_data_container.c create mode 100644 lib/sbi/openapi/model/operator_specific_data_container.h create mode 100644 lib/sbi/openapi/model/parameter_over_pc5.c create mode 100644 lib/sbi/openapi/model/parameter_over_pc5.h create mode 100644 lib/sbi/openapi/model/parameter_over_uu.c create mode 100644 lib/sbi/openapi/model/parameter_over_uu.h create mode 100644 lib/sbi/openapi/model/patch_result.c create mode 100644 lib/sbi/openapi/model/patch_result.h create mode 100644 lib/sbi/openapi/model/pc5_flow_bit_rates.c create mode 100644 lib/sbi/openapi/model/pc5_flow_bit_rates.h create mode 100644 lib/sbi/openapi/model/pc5_qo_s_para.c create mode 100644 lib/sbi/openapi/model/pc5_qo_s_para.h create mode 100644 lib/sbi/openapi/model/pc5_qos_flow_item.c create mode 100644 lib/sbi/openapi/model/pc5_qos_flow_item.h create mode 100644 lib/sbi/openapi/model/pc5_qos_mapping.c create mode 100644 lib/sbi/openapi/model/pc5_qos_mapping.h create mode 100644 lib/sbi/openapi/model/pcscf_info.c create mode 100644 lib/sbi/openapi/model/pcscf_info.h create mode 100644 lib/sbi/openapi/model/pcscf_restoration_notification.c create mode 100644 lib/sbi/openapi/model/pcscf_restoration_notification.h create mode 100644 lib/sbi/openapi/model/pdu_session.c create mode 100644 lib/sbi/openapi/model/pdu_session.h create mode 100644 lib/sbi/openapi/model/pdu_session_continuity_ind.c create mode 100644 lib/sbi/openapi/model/pdu_session_continuity_ind.h create mode 100644 lib/sbi/openapi/model/pdu_session_management_data.c create mode 100644 lib/sbi/openapi/model/pdu_session_management_data.h create mode 100644 lib/sbi/openapi/model/pdu_session_status.c create mode 100644 lib/sbi/openapi/model/pdu_session_status.h create mode 100644 lib/sbi/openapi/model/pdu_session_types.c create mode 100644 lib/sbi/openapi/model/pdu_session_types.h create mode 100644 lib/sbi/openapi/model/pei_update_info.c create mode 100644 lib/sbi/openapi/model/pei_update_info.h create mode 100644 lib/sbi/openapi/model/periodicity.c create mode 100644 lib/sbi/openapi/model/periodicity.h create mode 100644 lib/sbi/openapi/model/pfd_change_notification.c create mode 100644 lib/sbi/openapi/model/pfd_change_notification.h create mode 100644 lib/sbi/openapi/model/pfd_content.c create mode 100644 lib/sbi/openapi/model/pfd_content.h create mode 100644 lib/sbi/openapi/model/pfd_data.c create mode 100644 lib/sbi/openapi/model/pfd_data.h create mode 100644 lib/sbi/openapi/model/pfd_data_for_app.c create mode 100644 lib/sbi/openapi/model/pfd_data_for_app.h create mode 100644 lib/sbi/openapi/model/pfd_data_for_app_ext.c create mode 100644 lib/sbi/openapi/model/pfd_data_for_app_ext.h create mode 100644 lib/sbi/openapi/model/pfd_data_for_app_ext_all_of.c create mode 100644 lib/sbi/openapi/model/pfd_data_for_app_ext_all_of.h create mode 100644 lib/sbi/openapi/model/pgw_info.c create mode 100644 lib/sbi/openapi/model/pgw_info.h create mode 100644 lib/sbi/openapi/model/plmn_ec_info.c create mode 100644 lib/sbi/openapi/model/plmn_ec_info.h create mode 100644 lib/sbi/openapi/model/plmn_id_nid.c create mode 100644 lib/sbi/openapi/model/plmn_id_nid.h create mode 100644 lib/sbi/openapi/model/plmn_operator_class.c create mode 100644 lib/sbi/openapi/model/plmn_operator_class.h create mode 100644 lib/sbi/openapi/model/plmn_rat_served.c create mode 100644 lib/sbi/openapi/model/plmn_rat_served.h create mode 100644 lib/sbi/openapi/model/plmn_route_selection_descriptor.c create mode 100644 lib/sbi/openapi/model/plmn_route_selection_descriptor.h create mode 100644 lib/sbi/openapi/model/point.c create mode 100644 lib/sbi/openapi/model/point.h create mode 100644 lib/sbi/openapi/model/point_all_of.c create mode 100644 lib/sbi/openapi/model/point_all_of.h create mode 100644 lib/sbi/openapi/model/point_altitude.c create mode 100644 lib/sbi/openapi/model/point_altitude.h create mode 100644 lib/sbi/openapi/model/point_altitude_all_of.c create mode 100644 lib/sbi/openapi/model/point_altitude_all_of.h create mode 100644 lib/sbi/openapi/model/point_altitude_uncertainty.c create mode 100644 lib/sbi/openapi/model/point_altitude_uncertainty.h create mode 100644 lib/sbi/openapi/model/point_altitude_uncertainty_all_of.c create mode 100644 lib/sbi/openapi/model/point_altitude_uncertainty_all_of.h create mode 100644 lib/sbi/openapi/model/point_uncertainty_circle.c create mode 100644 lib/sbi/openapi/model/point_uncertainty_circle.h create mode 100644 lib/sbi/openapi/model/point_uncertainty_circle_all_of.c create mode 100644 lib/sbi/openapi/model/point_uncertainty_circle_all_of.h create mode 100644 lib/sbi/openapi/model/point_uncertainty_ellipse.c create mode 100644 lib/sbi/openapi/model/point_uncertainty_ellipse.h create mode 100644 lib/sbi/openapi/model/point_uncertainty_ellipse_all_of.c create mode 100644 lib/sbi/openapi/model/point_uncertainty_ellipse_all_of.h create mode 100644 lib/sbi/openapi/model/policy_data_change_notification.c create mode 100644 lib/sbi/openapi/model/policy_data_change_notification.h create mode 100644 lib/sbi/openapi/model/policy_data_subscription.c create mode 100644 lib/sbi/openapi/model/policy_data_subscription.h create mode 100644 lib/sbi/openapi/model/polygon.c create mode 100644 lib/sbi/openapi/model/polygon.h create mode 100644 lib/sbi/openapi/model/polygon_all_of.c create mode 100644 lib/sbi/openapi/model/polygon_all_of.h create mode 100644 lib/sbi/openapi/model/pp_active_time.c create mode 100644 lib/sbi/openapi/model/pp_active_time.h create mode 100644 lib/sbi/openapi/model/pp_data.c create mode 100644 lib/sbi/openapi/model/pp_data.h create mode 100644 lib/sbi/openapi/model/pp_dl_packet_count_ext.c create mode 100644 lib/sbi/openapi/model/pp_dl_packet_count_ext.h create mode 100644 lib/sbi/openapi/model/pp_maximum_latency.c create mode 100644 lib/sbi/openapi/model/pp_maximum_latency.h create mode 100644 lib/sbi/openapi/model/pp_maximum_response_time.c create mode 100644 lib/sbi/openapi/model/pp_maximum_response_time.h create mode 100644 lib/sbi/openapi/model/pp_subs_reg_timer.c create mode 100644 lib/sbi/openapi/model/pp_subs_reg_timer.h create mode 100644 lib/sbi/openapi/model/pppp_to_pdb.c create mode 100644 lib/sbi/openapi/model/pppp_to_pdb.h create mode 100644 lib/sbi/openapi/model/preemption_capability.c create mode 100644 lib/sbi/openapi/model/preemption_capability.h create mode 100644 lib/sbi/openapi/model/preemption_vulnerability.c create mode 100644 lib/sbi/openapi/model/preemption_vulnerability.h create mode 100644 lib/sbi/openapi/model/preferred_search.c create mode 100644 lib/sbi/openapi/model/preferred_search.h create mode 100644 lib/sbi/openapi/model/presence_info.c create mode 100644 lib/sbi/openapi/model/presence_info.h create mode 100644 lib/sbi/openapi/model/presence_state.c create mode 100644 lib/sbi/openapi/model/presence_state.h create mode 100644 lib/sbi/openapi/model/privacy_check_related_action.c create mode 100644 lib/sbi/openapi/model/privacy_check_related_action.h create mode 100644 lib/sbi/openapi/model/privacy_parameter.c create mode 100644 lib/sbi/openapi/model/privacy_parameter.h create mode 100644 lib/sbi/openapi/model/problem_details_2.c create mode 100644 lib/sbi/openapi/model/problem_details_2.h create mode 100644 lib/sbi/openapi/model/provisioned_data_sets.c create mode 100644 lib/sbi/openapi/model/provisioned_data_sets.h create mode 100644 lib/sbi/openapi/model/ptw_parameters.c create mode 100644 lib/sbi/openapi/model/ptw_parameters.h create mode 100644 lib/sbi/openapi/model/radio_parameter_not_served.c create mode 100644 lib/sbi/openapi/model/radio_parameter_not_served.h create mode 100644 lib/sbi/openapi/model/rat_type.c create mode 100644 lib/sbi/openapi/model/rat_type.h create mode 100644 lib/sbi/openapi/model/registration_reason.c create mode 100644 lib/sbi/openapi/model/registration_reason.h create mode 100644 lib/sbi/openapi/model/report_item.c create mode 100644 lib/sbi/openapi/model/report_item.h create mode 100644 lib/sbi/openapi/model/reporting_options.c create mode 100644 lib/sbi/openapi/model/reporting_options.h create mode 100644 lib/sbi/openapi/model/resource_item.c create mode 100644 lib/sbi/openapi/model/resource_item.h create mode 100644 lib/sbi/openapi/model/restriction_type.c create mode 100644 lib/sbi/openapi/model/restriction_type.h create mode 100644 lib/sbi/openapi/model/resynchronization_info.c create mode 100644 lib/sbi/openapi/model/resynchronization_info.h create mode 100644 lib/sbi/openapi/model/rg_auth_ctx.c create mode 100644 lib/sbi/openapi/model/rg_auth_ctx.h create mode 100644 lib/sbi/openapi/model/rg_authentication_info.c create mode 100644 lib/sbi/openapi/model/rg_authentication_info.h create mode 100644 lib/sbi/openapi/model/rm_info.c create mode 100644 lib/sbi/openapi/model/rm_info.h create mode 100644 lib/sbi/openapi/model/rm_state.c create mode 100644 lib/sbi/openapi/model/rm_state.h create mode 100644 lib/sbi/openapi/model/roaming_odb.c create mode 100644 lib/sbi/openapi/model/roaming_odb.h create mode 100644 lib/sbi/openapi/model/route_information.c create mode 100644 lib/sbi/openapi/model/route_information.h create mode 100644 lib/sbi/openapi/model/route_to_location.c create mode 100644 lib/sbi/openapi/model/route_to_location.h create mode 100644 lib/sbi/openapi/model/scheduled_communication_time.c create mode 100644 lib/sbi/openapi/model/scheduled_communication_time.h create mode 100644 lib/sbi/openapi/model/scheduled_communication_time_rm.c create mode 100644 lib/sbi/openapi/model/scheduled_communication_time_rm.h create mode 100644 lib/sbi/openapi/model/scheduled_communication_type.c create mode 100644 lib/sbi/openapi/model/scheduled_communication_type.h create mode 100644 lib/sbi/openapi/model/scheduled_communication_type_rm.c create mode 100644 lib/sbi/openapi/model/scheduled_communication_type_rm.h create mode 100644 lib/sbi/openapi/model/sdm_subs_modification.c create mode 100644 lib/sbi/openapi/model/sdm_subs_modification.h create mode 100644 lib/sbi/openapi/model/sdm_subscription.c create mode 100644 lib/sbi/openapi/model/sdm_subscription.h create mode 100644 lib/sbi/openapi/model/sequence_number.c create mode 100644 lib/sbi/openapi/model/sequence_number.h create mode 100644 lib/sbi/openapi/model/service_application_server_address.c create mode 100644 lib/sbi/openapi/model/service_application_server_address.h create mode 100644 lib/sbi/openapi/model/service_area_restriction.c create mode 100644 lib/sbi/openapi/model/service_area_restriction.h create mode 100644 lib/sbi/openapi/model/service_id_to_frequency.c create mode 100644 lib/sbi/openapi/model/service_id_to_frequency.h create mode 100644 lib/sbi/openapi/model/service_id_to_layer2_id.c create mode 100644 lib/sbi/openapi/model/service_id_to_layer2_id.h create mode 100644 lib/sbi/openapi/model/service_id_to_pppr.c create mode 100644 lib/sbi/openapi/model/service_id_to_pppr.h create mode 100644 lib/sbi/openapi/model/service_parameter_data.c create mode 100644 lib/sbi/openapi/model/service_parameter_data.h create mode 100644 lib/sbi/openapi/model/service_to_pdu_session.c create mode 100644 lib/sbi/openapi/model/service_to_pdu_session.h create mode 100644 lib/sbi/openapi/model/service_to_tx.c create mode 100644 lib/sbi/openapi/model/service_to_tx.h create mode 100644 lib/sbi/openapi/model/service_type_unrelated_class.c create mode 100644 lib/sbi/openapi/model/service_type_unrelated_class.h create mode 100644 lib/sbi/openapi/model/session_management_subscription_data.c create mode 100644 lib/sbi/openapi/model/session_management_subscription_data.h create mode 100644 lib/sbi/openapi/model/shared_data.c create mode 100644 lib/sbi/openapi/model/shared_data.h create mode 100644 lib/sbi/openapi/model/sign.c create mode 100644 lib/sbi/openapi/model/sign.h create mode 100644 lib/sbi/openapi/model/slrb_configurations.c create mode 100644 lib/sbi/openapi/model/slrb_configurations.h create mode 100644 lib/sbi/openapi/model/sm_policy_data.c create mode 100644 lib/sbi/openapi/model/sm_policy_data.h create mode 100644 lib/sbi/openapi/model/sm_policy_data_patch.c create mode 100644 lib/sbi/openapi/model/sm_policy_data_patch.h create mode 100644 lib/sbi/openapi/model/sm_policy_dnn_data.c create mode 100644 lib/sbi/openapi/model/sm_policy_dnn_data.h create mode 100644 lib/sbi/openapi/model/sm_policy_dnn_data_patch.c create mode 100644 lib/sbi/openapi/model/sm_policy_dnn_data_patch.h create mode 100644 lib/sbi/openapi/model/sm_policy_snssai_data.c create mode 100644 lib/sbi/openapi/model/sm_policy_snssai_data.h create mode 100644 lib/sbi/openapi/model/sm_policy_snssai_data_patch.c create mode 100644 lib/sbi/openapi/model/sm_policy_snssai_data_patch.h create mode 100644 lib/sbi/openapi/model/smf_registration.c create mode 100644 lib/sbi/openapi/model/smf_registration.h create mode 100644 lib/sbi/openapi/model/smf_registration_info.c create mode 100644 lib/sbi/openapi/model/smf_registration_info.h create mode 100644 lib/sbi/openapi/model/smf_selection_subscription_data.c create mode 100644 lib/sbi/openapi/model/smf_selection_subscription_data.h create mode 100644 lib/sbi/openapi/model/sms_management_subscription_data.c create mode 100644 lib/sbi/openapi/model/sms_management_subscription_data.h create mode 100644 lib/sbi/openapi/model/sms_subscription_data.c create mode 100644 lib/sbi/openapi/model/sms_subscription_data.h create mode 100644 lib/sbi/openapi/model/sms_support.c create mode 100644 lib/sbi/openapi/model/sms_support.h create mode 100644 lib/sbi/openapi/model/smsf_info.c create mode 100644 lib/sbi/openapi/model/smsf_info.h create mode 100644 lib/sbi/openapi/model/smsf_registration.c create mode 100644 lib/sbi/openapi/model/smsf_registration.h create mode 100644 lib/sbi/openapi/model/snssai_info.c create mode 100644 lib/sbi/openapi/model/snssai_info.h create mode 100644 lib/sbi/openapi/model/snssai_route_selection_descriptor.c create mode 100644 lib/sbi/openapi/model/snssai_route_selection_descriptor.h create mode 100644 lib/sbi/openapi/model/sor_data.c create mode 100644 lib/sbi/openapi/model/sor_data.h create mode 100644 lib/sbi/openapi/model/sor_info.c create mode 100644 lib/sbi/openapi/model/sor_info.h create mode 100644 lib/sbi/openapi/model/sor_update_indicator.c create mode 100644 lib/sbi/openapi/model/sor_update_indicator.h create mode 100644 lib/sbi/openapi/model/sor_update_info.c create mode 100644 lib/sbi/openapi/model/sor_update_info.h create mode 100644 lib/sbi/openapi/model/sponsor_connectivity_data.c create mode 100644 lib/sbi/openapi/model/sponsor_connectivity_data.h create mode 100644 lib/sbi/openapi/model/sqn_scheme.c create mode 100644 lib/sbi/openapi/model/sqn_scheme.h create mode 100644 lib/sbi/openapi/model/ssc_mode.c create mode 100644 lib/sbi/openapi/model/ssc_mode.h create mode 100644 lib/sbi/openapi/model/ssc_modes.c create mode 100644 lib/sbi/openapi/model/ssc_modes.h create mode 100644 lib/sbi/openapi/model/stationary_indication.c create mode 100644 lib/sbi/openapi/model/stationary_indication.h create mode 100644 lib/sbi/openapi/model/stationary_indication_rm.c create mode 100644 lib/sbi/openapi/model/stationary_indication_rm.h create mode 100644 lib/sbi/openapi/model/steering_container.c create mode 100644 lib/sbi/openapi/model/steering_container.h create mode 100644 lib/sbi/openapi/model/steering_info.c create mode 100644 lib/sbi/openapi/model/steering_info.h create mode 100644 lib/sbi/openapi/model/subscribed_default_qos.c create mode 100644 lib/sbi/openapi/model/subscribed_default_qos.h create mode 100644 lib/sbi/openapi/model/subscribed_event.c create mode 100644 lib/sbi/openapi/model/subscribed_event.h create mode 100644 lib/sbi/openapi/model/subscription_data_sets.c create mode 100644 lib/sbi/openapi/model/subscription_data_sets.h create mode 100644 lib/sbi/openapi/model/subscription_data_subscriptions.c create mode 100644 lib/sbi/openapi/model/subscription_data_subscriptions.h create mode 100644 lib/sbi/openapi/model/suggested_packet_num_dl.c create mode 100644 lib/sbi/openapi/model/suggested_packet_num_dl.h create mode 100644 lib/sbi/openapi/model/supported_gad_shapes.c create mode 100644 lib/sbi/openapi/model/supported_gad_shapes.h create mode 100644 lib/sbi/openapi/model/temporal_validity.c create mode 100644 lib/sbi/openapi/model/temporal_validity.h create mode 100644 lib/sbi/openapi/model/time_period.c create mode 100644 lib/sbi/openapi/model/time_period.h create mode 100644 lib/sbi/openapi/model/time_window.c create mode 100644 lib/sbi/openapi/model/time_window.h create mode 100644 lib/sbi/openapi/model/tmbr.c create mode 100644 lib/sbi/openapi/model/tmbr.h create mode 100644 lib/sbi/openapi/model/tngf_info.c create mode 100644 lib/sbi/openapi/model/tngf_info.h create mode 100644 lib/sbi/openapi/model/trace_data.c create mode 100644 lib/sbi/openapi/model/trace_data.h create mode 100644 lib/sbi/openapi/model/trace_data_response.c create mode 100644 lib/sbi/openapi/model/trace_data_response.h create mode 100644 lib/sbi/openapi/model/trace_depth.c create mode 100644 lib/sbi/openapi/model/trace_depth.h create mode 100644 lib/sbi/openapi/model/traffic_influ_data.c create mode 100644 lib/sbi/openapi/model/traffic_influ_data.h create mode 100644 lib/sbi/openapi/model/traffic_influ_data_notif.c create mode 100644 lib/sbi/openapi/model/traffic_influ_data_notif.h create mode 100644 lib/sbi/openapi/model/traffic_influ_data_patch.c create mode 100644 lib/sbi/openapi/model/traffic_influ_data_patch.h create mode 100644 lib/sbi/openapi/model/traffic_influ_sub.c create mode 100644 lib/sbi/openapi/model/traffic_influ_sub.h create mode 100644 lib/sbi/openapi/model/traffic_profile.c create mode 100644 lib/sbi/openapi/model/traffic_profile.h create mode 100644 lib/sbi/openapi/model/traffic_profile_rm.c create mode 100644 lib/sbi/openapi/model/traffic_profile_rm.h create mode 100644 lib/sbi/openapi/model/transfer_policy.c create mode 100644 lib/sbi/openapi/model/transfer_policy.h create mode 100644 lib/sbi/openapi/model/trigger_request.c create mode 100644 lib/sbi/openapi/model/trigger_request.h create mode 100644 lib/sbi/openapi/model/twif_info.c create mode 100644 lib/sbi/openapi/model/twif_info.h create mode 100644 lib/sbi/openapi/model/udsf_info.c create mode 100644 lib/sbi/openapi/model/udsf_info.h create mode 100644 lib/sbi/openapi/model/ue_auth.c create mode 100644 lib/sbi/openapi/model/ue_auth.h create mode 100644 lib/sbi/openapi/model/ue_authentication_ctx.c create mode 100644 lib/sbi/openapi/model/ue_authentication_ctx.h create mode 100644 lib/sbi/openapi/model/ue_context_in_smf_data.c create mode 100644 lib/sbi/openapi/model/ue_context_in_smf_data.h create mode 100644 lib/sbi/openapi/model/ue_context_in_smsf_data.c create mode 100644 lib/sbi/openapi/model/ue_context_in_smsf_data.h create mode 100644 lib/sbi/openapi/model/ue_id.c create mode 100644 lib/sbi/openapi/model/ue_id.h create mode 100644 lib/sbi/openapi/model/ue_policy_section.c create mode 100644 lib/sbi/openapi/model/ue_policy_section.h create mode 100644 lib/sbi/openapi/model/ue_policy_set.c create mode 100644 lib/sbi/openapi/model/ue_policy_set.h create mode 100644 lib/sbi/openapi/model/ue_policy_set_patch.c create mode 100644 lib/sbi/openapi/model/ue_policy_set_patch.h create mode 100644 lib/sbi/openapi/model/ue_reachability.c create mode 100644 lib/sbi/openapi/model/ue_reachability.h create mode 100644 lib/sbi/openapi/model/ue_update_status.c create mode 100644 lib/sbi/openapi/model/ue_update_status.h create mode 100644 lib/sbi/openapi/model/uncertainty_ellipse.c create mode 100644 lib/sbi/openapi/model/uncertainty_ellipse.h create mode 100644 lib/sbi/openapi/model/unrelated_class.c create mode 100644 lib/sbi/openapi/model/unrelated_class.h create mode 100644 lib/sbi/openapi/model/up_confidentiality.c create mode 100644 lib/sbi/openapi/model/up_confidentiality.h create mode 100644 lib/sbi/openapi/model/up_integrity.c create mode 100644 lib/sbi/openapi/model/up_integrity.h create mode 100644 lib/sbi/openapi/model/up_security.c create mode 100644 lib/sbi/openapi/model/up_security.h create mode 100644 lib/sbi/openapi/model/updated_item.c create mode 100644 lib/sbi/openapi/model/updated_item.h create mode 100644 lib/sbi/openapi/model/upf_cond.c create mode 100644 lib/sbi/openapi/model/upf_cond.h create mode 100644 lib/sbi/openapi/model/upu_data.c create mode 100644 lib/sbi/openapi/model/upu_data.h create mode 100644 lib/sbi/openapi/model/upu_data_2.c create mode 100644 lib/sbi/openapi/model/upu_data_2.h create mode 100644 lib/sbi/openapi/model/upu_info.c create mode 100644 lib/sbi/openapi/model/upu_info.h create mode 100644 lib/sbi/openapi/model/usage_mon_data.c create mode 100644 lib/sbi/openapi/model/usage_mon_data.h create mode 100644 lib/sbi/openapi/model/usage_mon_data_limit.c create mode 100644 lib/sbi/openapi/model/usage_mon_data_limit.h create mode 100644 lib/sbi/openapi/model/usage_mon_data_scope.c create mode 100644 lib/sbi/openapi/model/usage_mon_data_scope.h create mode 100644 lib/sbi/openapi/model/usage_mon_level.c create mode 100644 lib/sbi/openapi/model/usage_mon_level.h create mode 100644 lib/sbi/openapi/model/usage_threshold.c create mode 100644 lib/sbi/openapi/model/usage_threshold.h create mode 100644 lib/sbi/openapi/model/user_identifier.c create mode 100644 lib/sbi/openapi/model/user_identifier.h create mode 100644 lib/sbi/openapi/model/user_location.c create mode 100644 lib/sbi/openapi/model/user_location.h create mode 100644 lib/sbi/openapi/model/v2x_rat_type.c create mode 100644 lib/sbi/openapi/model/v2x_rat_type.h create mode 100644 lib/sbi/openapi/model/valid_time_period.c create mode 100644 lib/sbi/openapi/model/valid_time_period.h create mode 100644 lib/sbi/openapi/model/vendor_specific_feature.c create mode 100644 lib/sbi/openapi/model/vendor_specific_feature.h create mode 100644 lib/sbi/openapi/model/vgmlc_address.c create mode 100644 lib/sbi/openapi/model/vgmlc_address.h create mode 100644 lib/sbi/openapi/model/vn_group_data.c create mode 100644 lib/sbi/openapi/model/vn_group_data.h create mode 100644 lib/sbi/openapi/model/w_agf_info.c create mode 100644 lib/sbi/openapi/model/w_agf_info.h create mode 100644 lib/sbi/path.c rename src/amf/nnrf-build.h => lib/sbi/path.h (60%) delete mode 100644 lib/sbi/support/3gpp-spec/TS29222_AEF_Security_API.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29222_CAPIF_API_Invoker_Management_API.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29222_CAPIF_API_Provider_Management_API.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29222_CAPIF_Access_Control_Policy_API.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29222_CAPIF_Auditing_API.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29222_CAPIF_Discover_Service_API.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29222_CAPIF_Events_API.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29222_CAPIF_Logging_API_Invocation_API.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29222_CAPIF_Publish_Service_API.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29222_CAPIF_Security_API.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29486_VAE_ApplicationRequirement.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29486_VAE_DynamicGroup.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29486_VAE_FileDistribution.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29486_VAE_ServiceContinuity.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29502_Nsmf_PDUSession.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29503_Nudm_EE.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29503_Nudm_NIDDAU.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29503_Nudm_PP.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29503_Nudm_SDM.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29503_Nudm_UEAU.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29503_Nudm_UECM.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29504_Nudr_DR.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29507_Npcf_AMPolicyControl.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29508_Nsmf_EventExposure.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29521_Nbsf_Management.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29523_Npcf_EventExposure.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29525_Npcf_UEPolicyControl.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29540_Nsmsf_SMService.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29549_SS_Events.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29549_SS_GroupManagement.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29549_SS_NetworkResourceAdaptation.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29549_SS_UserProfileRetrieval.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29594_Nchf_SpendingLimitControl.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS29675_Nucmf_Provisioning.yaml delete mode 100644 lib/sbi/support/3gpp-spec/TS32291_Nchf_ConvergedCharging.yaml rename lib/sbi/support/{3gpp-spec => modified}/TS29122_CommonData.yaml (92%) rename lib/sbi/support/{3gpp-spec => modified}/TS29122_PfdManagement.yaml (99%) create mode 100644 lib/sbi/support/modified/TS29503_Nudm_EE.yaml create mode 100644 lib/sbi/support/modified/TS29503_Nudm_NIDDAU.yaml create mode 100644 lib/sbi/support/modified/TS29503_Nudm_PP.yaml create mode 100644 lib/sbi/support/modified/TS29503_Nudm_SDM.yaml create mode 100644 lib/sbi/support/modified/TS29503_Nudm_UEAU.yaml create mode 100644 lib/sbi/support/modified/TS29503_Nudm_UECM.yaml create mode 100644 lib/sbi/support/modified/TS29504_Nudr_DR.yaml create mode 100644 lib/sbi/support/modified/TS29505_Subscription_Data.yaml rename lib/sbi/support/{3gpp-spec => modified}/TS29509_Nausf_SoRProtection.yaml (87%) create mode 100644 lib/sbi/support/modified/TS29509_Nausf_UEAuthentication.yaml rename lib/sbi/support/{3gpp-spec => modified}/TS29509_Nausf_UPUProtection.yaml (84%) create mode 100644 lib/sbi/support/modified/TS29512_Npcf_SMPolicyControl.yaml rename lib/sbi/support/{3gpp-spec => modified}/TS29514_Npcf_PolicyAuthorization.yaml (99%) rename lib/sbi/support/{3gpp-spec => modified}/TS29517_Naf_EventExposure.yaml (99%) rename lib/sbi/support/{3gpp-spec => modified}/TS29518_Namf_EventExposure.yaml (85%) rename lib/sbi/support/{3gpp-spec => modified}/TS29519_Application_Data.yaml (99%) rename lib/sbi/support/{3gpp-spec => modified}/TS29519_Exposure_Data.yaml (99%) create mode 100644 lib/sbi/support/modified/TS29519_Policy_Data.yaml rename lib/sbi/support/{3gpp-spec => modified}/TS29522_IPTVConfiguration.yaml (99%) rename lib/sbi/support/{3gpp-spec => modified}/TS29522_ServiceParameter.yaml (99%) rename lib/sbi/support/{3gpp-spec => modified}/TS29522_TrafficInfluence.yaml (99%) create mode 100644 lib/sbi/support/modified/TS29544_Nspaf_SecuredPacket.yaml rename lib/sbi/support/{3gpp-spec => modified}/TS29551_Nnef_PFDmanagement.yaml (99%) rename lib/sbi/support/{3gpp-spec => modified}/TS29554_Npcf_BDTPolicyControl.yaml (99%) create mode 100644 lib/sbi/support/modified/TS29572_Nlmf_Location.yaml rename lib/sbi/support/{3gpp-spec => standard}/TS29122_AsSessionWithQoS.yaml (99%) rename lib/sbi/support/{3gpp-spec => standard}/TS29122_ChargeableParty.yaml (98%) create mode 100644 lib/sbi/support/standard/TS29122_CommonData.yaml rename lib/sbi/support/{3gpp-spec => standard}/TS29122_CpProvisioning.yaml (99%) rename lib/sbi/support/{3gpp-spec => standard}/TS29122_DeviceTriggering.yaml (98%) rename lib/sbi/support/{3gpp-spec => standard}/TS29122_ECRControl.yaml (97%) rename lib/sbi/support/{3gpp-spec => standard}/TS29122_GMDviaMBMSbyMB2.yaml (99%) rename lib/sbi/support/{3gpp-spec => standard}/TS29122_GMDviaMBMSbyxMB.yaml (99%) rename lib/sbi/support/{3gpp-spec => standard}/TS29122_MonitoringEvent.yaml (97%) rename lib/sbi/support/{3gpp-spec => standard}/TS29122_MsisdnLessMoSms.yaml (96%) rename lib/sbi/support/{3gpp-spec => standard}/TS29122_NIDD.yaml (96%) rename lib/sbi/support/{3gpp-spec => standard}/TS29122_NpConfiguration.yaml (98%) create mode 100644 lib/sbi/support/standard/TS29122_PfdManagement.yaml rename lib/sbi/support/{3gpp-spec => standard}/TS29122_RacsParameterProvisioning.yaml (97%) rename lib/sbi/support/{3gpp-spec => standard}/TS29122_ReportingNetworkStatus.yaml (98%) rename lib/sbi/support/{3gpp-spec => standard}/TS29122_ResourceManagementOfBdt.yaml (99%) create mode 100644 lib/sbi/support/standard/TS29503_Nudm_EE.yaml create mode 100644 lib/sbi/support/standard/TS29503_Nudm_MT.yaml create mode 100644 lib/sbi/support/standard/TS29503_Nudm_NIDDAU.yaml create mode 100644 lib/sbi/support/standard/TS29503_Nudm_PP.yaml create mode 100644 lib/sbi/support/standard/TS29503_Nudm_SDM.yaml create mode 100644 lib/sbi/support/standard/TS29503_Nudm_UEAU.yaml create mode 100644 lib/sbi/support/standard/TS29503_Nudm_UECM.yaml create mode 100644 lib/sbi/support/standard/TS29504_Nudr_DR.yaml create mode 100644 lib/sbi/support/standard/TS29504_Nudr_GroupIDmap.yaml create mode 100644 lib/sbi/support/standard/TS29505_Subscription_Data.yaml create mode 100644 lib/sbi/support/standard/TS29509_Nausf_SoRProtection.yaml rename lib/sbi/support/{3gpp-spec => standard}/TS29509_Nausf_UEAuthentication.yaml (60%) create mode 100644 lib/sbi/support/standard/TS29509_Nausf_UPUProtection.yaml rename lib/sbi/support/{3gpp-spec => standard}/TS29510_Nnrf_AccessToken.yaml (74%) create mode 100644 lib/sbi/support/standard/TS29510_Nnrf_Bootstrapping.yaml rename lib/sbi/support/{3gpp-spec => standard}/TS29510_Nnrf_NFDiscovery.yaml (69%) rename lib/sbi/support/{3gpp-spec => standard}/TS29510_Nnrf_NFManagement.yaml (70%) rename lib/sbi/support/{3gpp-spec => standard}/TS29512_Npcf_SMPolicyControl.yaml (99%) create mode 100644 lib/sbi/support/standard/TS29514_Npcf_PolicyAuthorization.yaml rename lib/sbi/support/{3gpp-spec/TS29591_Nnef_EventExposure.yaml => standard/TS29517_Naf_EventExposure.yaml} (62%) rename lib/sbi/support/{3gpp-spec => standard}/TS29518_Namf_Communication.yaml (86%) create mode 100644 lib/sbi/support/standard/TS29518_Namf_EventExposure.yaml rename lib/sbi/support/{3gpp-spec => standard}/TS29518_Namf_Location.yaml (66%) rename lib/sbi/support/{3gpp-spec => standard}/TS29518_Namf_MT.yaml (77%) create mode 100644 lib/sbi/support/standard/TS29519_Application_Data.yaml create mode 100644 lib/sbi/support/standard/TS29519_Exposure_Data.yaml rename lib/sbi/support/{3gpp-spec => standard}/TS29519_Policy_Data.yaml (99%) rename lib/sbi/support/{3gpp-spec => standard}/TS29520_Nnwdaf_AnalyticsInfo.yaml (99%) rename lib/sbi/support/{3gpp-spec => standard}/TS29520_Nnwdaf_EventsSubscription.yaml (99%) rename lib/sbi/support/{3gpp-spec => standard}/TS29522_5GLANParameterProvision.yaml (99%) rename lib/sbi/support/{3gpp-spec => standard}/TS29522_AnalyticsExposure.yaml (99%) rename lib/sbi/support/{3gpp-spec => standard}/TS29522_ApplyingBdtPolicy.yaml (99%) create mode 100644 lib/sbi/support/standard/TS29522_IPTVConfiguration.yaml rename lib/sbi/support/{3gpp-spec => standard}/TS29522_LpiParameterProvision.yaml (99%) rename lib/sbi/support/{3gpp-spec => standard}/TS29522_NIDDConfigurationTrigger.yaml (97%) create mode 100644 lib/sbi/support/standard/TS29522_ServiceParameter.yaml create mode 100644 lib/sbi/support/standard/TS29522_TrafficInfluence.yaml create mode 100644 lib/sbi/support/standard/TS29544_Nspaf_SecuredPacket.yaml rename lib/sbi/support/{3gpp-spec/TS29486_VAE_MessageDelivery.yaml => standard/TS29551_Nnef_PFDmanagement.yaml} (50%) create mode 100644 lib/sbi/support/standard/TS29554_Npcf_BDTPolicyControl.yaml rename lib/sbi/support/{3gpp-spec => standard}/TS29571_CommonData.yaml (62%) create mode 100644 lib/sbi/support/standard/TS29572_Nlmf_Broadcast.yaml create mode 100644 lib/sbi/support/standard/TS29572_Nlmf_Location.yaml create mode 100644 src/amf/gmm-build.c create mode 100644 src/amf/gmm-build.h create mode 100644 src/amf/gmm-handler.c create mode 100644 src/amf/gmm-handler.h create mode 100644 src/amf/gmm-sm.c create mode 100644 src/amf/gsm-sm.c create mode 100644 src/amf/nas-path.c create mode 100644 src/amf/nas-path.h create mode 100644 src/amf/nas-security.c create mode 100644 src/amf/nas-security.h create mode 100644 src/amf/nausf-build.c create mode 100644 src/amf/nausf-build.h create mode 100644 src/amf/nausf-handler.c create mode 100644 src/amf/nausf-handler.h delete mode 100644 src/amf/nnrf-build.c create mode 100644 src/ausf/app.c create mode 100644 src/ausf/ausf-sm.c create mode 100644 src/ausf/ausf-sm.h create mode 100644 src/ausf/context.c create mode 100644 src/ausf/context.h create mode 100644 src/ausf/event.c create mode 100644 src/ausf/event.h create mode 100644 src/ausf/init.c create mode 100644 src/ausf/meson.build create mode 100644 src/ausf/nausf-handler.c create mode 100644 src/ausf/nausf-handler.h create mode 100644 src/ausf/nf-sm.c create mode 100644 src/ausf/nnrf-handler.c create mode 100644 src/ausf/nnrf-handler.h create mode 100644 src/ausf/nudm-build.c rename src/{mme/mme-kdf.h => ausf/nudm-build.h} (53%) create mode 100644 src/ausf/nudm-handler.c create mode 100644 src/ausf/nudm-handler.h create mode 100644 src/ausf/sbi-path.c create mode 100644 src/ausf/sbi-path.h create mode 100644 src/ausf/timer.c create mode 100644 src/ausf/timer.h create mode 100644 src/ausf/ue-sm.c delete mode 100644 src/mme/mme-kdf.c create mode 100644 src/udm/app.c create mode 100644 src/udm/context.c create mode 100644 src/udm/context.h create mode 100644 src/udm/event.c create mode 100644 src/udm/event.h create mode 100644 src/udm/init.c create mode 100644 src/udm/meson.build create mode 100644 src/udm/nf-sm.c create mode 100644 src/udm/nnrf-handler.c create mode 100644 src/udm/nnrf-handler.h create mode 100644 src/udm/nudm-handler.c create mode 100644 src/udm/nudm-handler.h create mode 100644 src/udm/nudr-build.c create mode 100644 src/udm/nudr-build.h create mode 100644 src/udm/nudr-handler.c create mode 100644 src/udm/nudr-handler.h create mode 100644 src/udm/sbi-path.c create mode 100644 src/udm/sbi-path.h create mode 100644 src/udm/timer.c create mode 100644 src/udm/timer.h create mode 100644 src/udm/udm-sm.c create mode 100644 src/udm/udm-sm.h create mode 100644 src/udm/ue-sm.c create mode 100644 src/udr/app.c create mode 100644 src/udr/context.c create mode 100644 src/udr/context.h create mode 100644 src/udr/event.c create mode 100644 src/udr/event.h create mode 100644 src/udr/init.c create mode 100644 src/udr/meson.build create mode 100644 src/udr/nf-sm.c create mode 100644 src/udr/nnrf-handler.c create mode 100644 src/udr/nnrf-handler.h create mode 100644 src/udr/nudr-handler.c create mode 100644 src/udr/nudr-handler.h create mode 100644 src/udr/sbi-path.c create mode 100644 src/udr/sbi-path.h create mode 100644 src/udr/timer.c create mode 100644 src/udr/timer.h create mode 100644 src/udr/udr-sm.c create mode 100644 src/udr/udr-sm.h create mode 100644 tests/common/gmm-build.c create mode 100644 tests/common/gmm-build.h create mode 100644 tests/common/gmm-handler.c create mode 100644 tests/common/gmm-handler.h create mode 100644 tests/common/nas-path.c create mode 100644 tests/common/nas-path.h create mode 100644 tests/common/nas-security.c create mode 100644 tests/common/nas-security.h create mode 100644 tests/common/ngap-handler.c create mode 100644 tests/common/ngap-handler.h create mode 100644 tests/common/ngap-path.c create mode 100644 tests/common/ngap-path.h diff --git a/configs/5gc.yaml.in b/configs/5gc.yaml.in index 70cae816b8..5ec0e7ee33 100644 --- a/configs/5gc.yaml.in +++ b/configs/5gc.yaml.in @@ -4,13 +4,6 @@ logger: parameter: -nrf: - sbi: - - addr: - - 127.0.0.1 - - ::1 - port: 7777 - amf: sbi: - addr: 127.0.0.2 @@ -83,3 +76,24 @@ upf: - 127.0.0.4 - ::1 pdn: + +ausf: + sbi: + - addr: 127.0.0.5 + port: 7777 + +udm: + sbi: + - addr: 127.0.0.6 + port: 7777 + +udr: + sbi: + - addr: 127.0.0.7 + port: 7777 +nrf: + sbi: + - addr: + - 127.0.0.1 + - ::1 + port: 7777 diff --git a/configs/minimal.yaml.in b/configs/minimal.yaml.in index c3b798c452..1881aa7972 100644 --- a/configs/minimal.yaml.in +++ b/configs/minimal.yaml.in @@ -4,13 +4,6 @@ logger: parameter: -nrf: - sbi: - - addr: - - 127.0.0.1 - - ::1 - port: 7777 - amf: sbi: - addr: 127.0.0.2 @@ -39,8 +32,8 @@ amf: - sst: 1 sd: 112233 security: - integrity_order : [ EIA1, EIA2, EIA0 ] - ciphering_order : [ EEA0, EEA1, EEA2 ] + integrity_order : [ EIA2, EIA1 ] + ciphering_order : [ EEA2, EEA1, EEA0 ] network_name: full: Open5GS amf_name: open5gs-amf0 @@ -87,3 +80,24 @@ upf: - 127.0.0.4 - ::1 pdn: + +ausf: + sbi: + - addr: 127.0.0.5 + port: 7777 + +udm: + sbi: + - addr: 127.0.0.6 + port: 7777 + +udr: + sbi: + - addr: 127.0.0.7 + port: 7777 +nrf: + sbi: + - addr: + - 127.0.0.1 + - ::1 + port: 7777 diff --git a/configs/open5gs/amf.yaml.in b/configs/open5gs/amf.yaml.in index 9f5a3437f8..ed88a5c8f8 100644 --- a/configs/open5gs/amf.yaml.in +++ b/configs/open5gs/amf.yaml.in @@ -155,6 +155,8 @@ parameter: # gnb: 32 # o Maximum Number of UE per gNB # ue: 128 +# o Maximum Number of NF Instance +# nf: 512 # max: diff --git a/configs/open5gs/ausf.yaml.in b/configs/open5gs/ausf.yaml.in new file mode 100644 index 0000000000..7ab11c3895 --- /dev/null +++ b/configs/open5gs/ausf.yaml.in @@ -0,0 +1,179 @@ +# +# logger: +# +# o Set OGS_LOG_INFO to all domain level +# - If `level` is omitted, the default level is OGS_LOG_INFO) +# - If `domain` is omitted, the all domain level is set from 'level' +# (Nothing is needed) +# +# o Set OGS_LOG_ERROR to all domain level +# - `level` can be set with none, fatal, error, warn, info, debug, trace +# level: error +# +# o Set OGS_LOG_DEBUG to mme/emm domain level +# level: debug +# domain: mme,emm +# +# o Set OGS_LOG_TRACE to all domain level +# level: trace +# domain: core,pfcp,fd,gtp,ausf,event,tlv,mem,sock +# +logger: + file: @localstatedir@/log/open5gs/ausf.log +# +# ausf: +# +# +# +# o SBI Server(http://:80) +# sbi: +# +# o SBI Server(http://:80) +# sbi: +# - addr: +# - 0.0.0.0 +# - ::0 +# port: 7777 +# +# o SBI Server(https://:443) +# sbi: +# tls: +# key: ausf.key +# pem: ausf.pem +# +# o SBI Server(https://127.0.0.5:443, http://[::1]:80) +# sbi: +# - addr: 127.0.0.5 +# tls: +# key: ausf.key +# pem: ausf.pem +# - addr: ::1 +# +# o SBI Server(http://ausf.open5gs.org:80) +# sbi: +# name: ausf.open5gs.org +# +# o SBI Server(http://127.0.0.5:7777) +# sbi: +# - addr: 127.0.0.5 +# port: 7777 +# +# o SBI Server(http://:80) +# sbi: +# dev: eth0 +# +ausf: + sbi: + - addr: 127.0.0.5 + port: 7777 + +# +# nrf: +# +# > +# +# o SBI Client(http://127.0.0.1:7777) +# sbi: +# addr: 127.0.0.1 +# port: 7777 +# +# o SBI Client(https://127.0.0.1:443, http://nrf.open5gs.org:80) +# sbi: +# - addr: 127.0.0.1 +# tls: +# key: nrf.key +# pem: nrf.pem +# - name: nrf.open5gs.org +# +# o SBI Client(http://[fe80::1%@loopback_devname@]:80) +# If prefer_ipv4 is true, http://127.0.0.1:80 is selected. +# +# sbi: +# addr: +# - 127.0.0.1 +# - fe80::1%@loopback_devname@ +# +nrf: + sbi: + - addr: + - 127.0.0.1 + - ::1 + port: 7777 + +# +# parameter: +# +# o Number of output streams per SCTP associations. +# sctp_streams: 30 +# +# o Disable use of IPv4 addresses (only IPv6) +# no_ipv4: true +# +# o Disable use of IPv6 addresses (only IPv4) +# no_ipv6: true +# +# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections. +# prefer_ipv4: true +# +# o Enable Multicast traffic to the UE +# multicast: true +# +# o Disable Stateless Address Autoconfiguration for IPv6 +# no_slaac: true +# +parameter: + +# +# max: +# +# o Maximum Number of gNB per AMF +# gnb: 32 +# o Maximum Number of UE per gNB +# ue: 128 +# o Maximum Number of NF Instance +# nf: 512 +# +max: + +# +# pool: +# +# o The Number of Default Memory Pool Size +# +# - Pool-size 128 => 8192 Number +# - Pool-size 256 => 4096 Number +# - Pool-size 512 => 2048 Number +# - Pool-size 1024 => 1024 Number +# - Pool-size 2048 => 512 Number +# - Pool-size 8192 => 128 Number +# - Pool-size 1024*1024 => 8 Number +# +# 128: 8192 +# 256: 4096 +# 512: 2048 +# 1024: 1024 +# 2048: 512 +# 8192: 128 +# big: 8 +# +# o Memory of Packet Buffering in SGW +# - Maximum Number of packet(SDU size = 8Kbytes) pool in SGW +# - SGW Memory Usage : 65536 * 8Kbytes = 512Mbytes +# +# packet: 65536 +# +pool: + +# +# time: +# +# o NF Instance Heartbeat (Default : 3 seconds) +# +# o NF Instance Heartbeat (Disabled) +# nf_instance: +# heartbeat: 0 +# +# o NF Instance Heartbeat (5 seconds) +# nf_instance: +# heartbeat: 5 +time: diff --git a/configs/open5gs/meson.build b/configs/open5gs/meson.build index 3b7829eb0e..4e2101b9cd 100644 --- a/configs/open5gs/meson.build +++ b/configs/open5gs/meson.build @@ -27,6 +27,9 @@ open5gs_conf = ''' pcrf.yaml nrf.yaml + udr.yaml + udm.yaml + ausf.yaml upf.yaml smf.yaml amf.yaml diff --git a/configs/open5gs/nrf.yaml.in b/configs/open5gs/nrf.yaml.in index 0c3690e81c..e8c6f6b7b7 100644 --- a/configs/open5gs/nrf.yaml.in +++ b/configs/open5gs/nrf.yaml.in @@ -102,6 +102,8 @@ parameter: # gnb: 32 # o Maximum Number of UE per gNB # ue: 128 +# o Maximum Number of NF Instance +# nf: 512 # max: diff --git a/configs/open5gs/smf.yaml.in b/configs/open5gs/smf.yaml.in index 04b1890207..cb96e26a40 100644 --- a/configs/open5gs/smf.yaml.in +++ b/configs/open5gs/smf.yaml.in @@ -277,6 +277,8 @@ parameter: # gnb: 32 # o Maximum Number of UE per gNB # ue: 128 +# o Maximum Number of NF Instance +# nf: 512 # max: diff --git a/configs/open5gs/udm.yaml.in b/configs/open5gs/udm.yaml.in new file mode 100644 index 0000000000..168e9bf0f3 --- /dev/null +++ b/configs/open5gs/udm.yaml.in @@ -0,0 +1,179 @@ +# +# logger: +# +# o Set OGS_LOG_INFO to all domain level +# - If `level` is omitted, the default level is OGS_LOG_INFO) +# - If `domain` is omitted, the all domain level is set from 'level' +# (Nothing is needed) +# +# o Set OGS_LOG_ERROR to all domain level +# - `level` can be set with none, fatal, error, warn, info, debug, trace +# level: error +# +# o Set OGS_LOG_DEBUG to mme/emm domain level +# level: debug +# domain: mme,emm +# +# o Set OGS_LOG_TRACE to all domain level +# level: trace +# domain: core,pfcp,fd,gtp,udm,event,tlv,mem,sock +# +logger: + file: @localstatedir@/log/open5gs/udm.log +# +# udm: +# +# +# +# o SBI Server(http://:80) +# sbi: +# +# o SBI Server(http://:80) +# sbi: +# - addr: +# - 0.0.0.0 +# - ::0 +# port: 7777 +# +# o SBI Server(https://:443) +# sbi: +# tls: +# key: udm.key +# pem: udm.pem +# +# o SBI Server(https://127.0.0.6:443, http://[::1]:80) +# sbi: +# - addr: 127.0.0.6 +# tls: +# key: udm.key +# pem: udm.pem +# - addr: ::1 +# +# o SBI Server(http://udm.open5gs.org:80) +# sbi: +# name: udm.open5gs.org +# +# o SBI Server(http://127.0.0.6:7777) +# sbi: +# - addr: 127.0.0.6 +# port: 7777 +# +# o SBI Server(http://:80) +# sbi: +# dev: eth0 +# +udm: + sbi: + - addr: 127.0.0.6 + port: 7777 + +# +# nrf: +# +# > +# +# o SBI Client(http://127.0.0.1:7777) +# sbi: +# addr: 127.0.0.1 +# port: 7777 +# +# o SBI Client(https://127.0.0.1:443, http://nrf.open5gs.org:80) +# sbi: +# - addr: 127.0.0.1 +# tls: +# key: nrf.key +# pem: nrf.pem +# - name: nrf.open5gs.org +# +# o SBI Client(http://[fe80::1%@loopback_devname@]:80) +# If prefer_ipv4 is true, http://127.0.0.1:80 is selected. +# +# sbi: +# addr: +# - 127.0.0.1 +# - fe80::1%@loopback_devname@ +# +nrf: + sbi: + - addr: + - 127.0.0.1 + - ::1 + port: 7777 + +# +# parameter: +# +# o Number of output streams per SCTP associations. +# sctp_streams: 30 +# +# o Disable use of IPv4 addresses (only IPv6) +# no_ipv4: true +# +# o Disable use of IPv6 addresses (only IPv4) +# no_ipv6: true +# +# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections. +# prefer_ipv4: true +# +# o Enable Multicast traffic to the UE +# multicast: true +# +# o Disable Stateless Address Autoconfiguration for IPv6 +# no_slaac: true +# +parameter: + +# +# max: +# +# o Maximum Number of gNB per AMF +# gnb: 32 +# o Maximum Number of UE per gNB +# ue: 128 +# o Maximum Number of NF Instance +# nf: 512 +# +max: + +# +# pool: +# +# o The Number of Default Memory Pool Size +# +# - Pool-size 128 => 8192 Number +# - Pool-size 256 => 4096 Number +# - Pool-size 512 => 2048 Number +# - Pool-size 1024 => 1024 Number +# - Pool-size 2048 => 512 Number +# - Pool-size 8192 => 128 Number +# - Pool-size 1024*1024 => 8 Number +# +# 128: 8192 +# 256: 4096 +# 512: 2048 +# 1024: 1024 +# 2048: 512 +# 8192: 128 +# big: 8 +# +# o Memory of Packet Buffering in SGW +# - Maximum Number of packet(SDU size = 8Kbytes) pool in SGW +# - SGW Memory Usage : 65536 * 8Kbytes = 512Mbytes +# +# packet: 65536 +# +pool: + +# +# time: +# +# o NF Instance Heartbeat (Default : 3 seconds) +# +# o NF Instance Heartbeat (Disabled) +# nf_instance: +# heartbeat: 0 +# +# o NF Instance Heartbeat (5 seconds) +# nf_instance: +# heartbeat: 5 +time: diff --git a/configs/open5gs/udr.yaml.in b/configs/open5gs/udr.yaml.in new file mode 100644 index 0000000000..dd3f93fe4c --- /dev/null +++ b/configs/open5gs/udr.yaml.in @@ -0,0 +1,181 @@ +db_uri: mongodb://localhost/open5gs + +# +# logger: +# +# o Set OGS_LOG_INFO to all domain level +# - If `level` is omitted, the default level is OGS_LOG_INFO) +# - If `domain` is omitted, the all domain level is set from 'level' +# (Nothing is needed) +# +# o Set OGS_LOG_ERROR to all domain level +# - `level` can be set with none, fatal, error, warn, info, debug, trace +# level: error +# +# o Set OGS_LOG_DEBUG to mme/emm domain level +# level: debug +# domain: mme,emm +# +# o Set OGS_LOG_TRACE to all domain level +# level: trace +# domain: core,pfcp,fd,gtp,udr,event,tlv,mem,sock +# +logger: + file: @localstatedir@/log/open5gs/udr.log +# +# udr: +# +# +# +# o SBI Server(http://:80) +# sbi: +# +# o SBI Server(http://:80) +# sbi: +# - addr: +# - 0.0.0.0 +# - ::0 +# port: 7777 +# +# o SBI Server(https://:443) +# sbi: +# tls: +# key: udr.key +# pem: udr.pem +# +# o SBI Server(https://127.0.0.7:443, http://[::1]:80) +# sbi: +# - addr: 127.0.0.7 +# tls: +# key: udr.key +# pem: udr.pem +# - addr: ::1 +# +# o SBI Server(http://udr.open5gs.org:80) +# sbi: +# name: udr.open5gs.org +# +# o SBI Server(http://127.0.0.7:7777) +# sbi: +# - addr: 127.0.0.7 +# port: 7777 +# +# o SBI Server(http://:80) +# sbi: +# dev: eth0 +# +udr: + sbi: + - addr: 127.0.0.7 + port: 7777 + +# +# nrf: +# +# > +# +# o SBI Client(http://127.0.0.1:7777) +# sbi: +# addr: 127.0.0.1 +# port: 7777 +# +# o SBI Client(https://127.0.0.1:443, http://nrf.open5gs.org:80) +# sbi: +# - addr: 127.0.0.1 +# tls: +# key: nrf.key +# pem: nrf.pem +# - name: nrf.open5gs.org +# +# o SBI Client(http://[fe80::1%@loopback_devname@]:80) +# If prefer_ipv4 is true, http://127.0.0.1:80 is selected. +# +# sbi: +# addr: +# - 127.0.0.1 +# - fe80::1%@loopback_devname@ +# +nrf: + sbi: + - addr: + - 127.0.0.1 + - ::1 + port: 7777 + +# +# parameter: +# +# o Number of output streams per SCTP associations. +# sctp_streams: 30 +# +# o Disable use of IPv4 addresses (only IPv6) +# no_ipv4: true +# +# o Disable use of IPv6 addresses (only IPv4) +# no_ipv6: true +# +# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections. +# prefer_ipv4: true +# +# o Enable Multicast traffic to the UE +# multicast: true +# +# o Disable Stateless Address Autoconfiguration for IPv6 +# no_slaac: true +# +parameter: + +# +# max: +# +# o Maximum Number of gNB per AMF +# gnb: 32 +# o Maximum Number of UE per gNB +# ue: 128 +# o Maximum Number of NF Instance +# nf: 512 +# +max: + +# +# pool: +# +# o The Number of Default Memory Pool Size +# +# - Pool-size 128 => 8192 Number +# - Pool-size 256 => 4096 Number +# - Pool-size 512 => 2048 Number +# - Pool-size 1024 => 1024 Number +# - Pool-size 2048 => 512 Number +# - Pool-size 8192 => 128 Number +# - Pool-size 1024*1024 => 8 Number +# +# 128: 8192 +# 256: 4096 +# 512: 2048 +# 1024: 1024 +# 2048: 512 +# 8192: 128 +# big: 8 +# +# o Memory of Packet Buffering in SGW +# - Maximum Number of packet(SDU size = 8Kbytes) pool in SGW +# - SGW Memory Usage : 65536 * 8Kbytes = 512Mbytes +# +# packet: 65536 +# +pool: + +# +# time: +# +# o NF Instance Heartbeat (Default : 3 seconds) +# +# o NF Instance Heartbeat (Disabled) +# nf_instance: +# heartbeat: 0 +# +# o NF Instance Heartbeat (5 seconds) +# nf_instance: +# heartbeat: 5 +time: diff --git a/configs/open5gs/upf.yaml.in b/configs/open5gs/upf.yaml.in index 04bd8257b9..c1df02fc10 100644 --- a/configs/open5gs/upf.yaml.in +++ b/configs/open5gs/upf.yaml.in @@ -111,6 +111,8 @@ parameter: # gnb: 32 # o Maximum Number of UE per gNB # ue: 128 +# o Maximum Number of NF Instance +# nf: 512 # max: diff --git a/lib/app/ogs-app.h b/lib/app/ogs-app.h index c97abab189..017b0b459d 100644 --- a/lib/app/ogs-app.h +++ b/lib/app/ogs-app.h @@ -60,6 +60,15 @@ void pcrf_terminate(void); int nrf_initialize(void); void nrf_terminate(void); +int udr_initialize(void); +void udr_terminate(void); + +int udm_initialize(void); +void udm_terminate(void); + +int ausf_initialize(void); +void ausf_terminate(void); + int upf_initialize(void); void upf_terminate(void); diff --git a/lib/app/ogs-config.c b/lib/app/ogs-config.c index 367cb925a1..9a7ba16c1f 100644 --- a/lib/app/ogs-config.c +++ b/lib/app/ogs-config.c @@ -137,14 +137,21 @@ static void recalculate_pool_size(void) #define MAX_NUM_OF_BEARER 4 /* Num of Bearer per APN(Session) */ #define MAX_NUM_OF_TUNNEL 3 /* Num of Tunnel per Bearer */ #define MAX_NUM_OF_PF 16 /* Num of PacketFilter per Bearer */ +#define MAX_NUM_OF_NF_SERVICE 16 /* Num of NF Service per NF Instance */ +#define MAX_NUM_OF_SBI_MESSAGE 8 /* Num of HTTP(s) Request/Response per NF */ +#define MAX_NUM_OF_NF_SUBSCRIPTION 4 /* Num of Subscription per NF */ +#define MAX_NUM_OF_AUTH 4 /* Num of Subscription per UE */ self.pool.ue = self.max.ue * self.max.gnb; + self.pool.auth = self.pool.ue * MAX_NUM_OF_AUTH; self.pool.pfcp = ogs_max(self.max.smf, self.max.upf); - self.pool.sbi = self.pool.pfcp; self.pool.sess = self.pool.ue * OGS_MAX_NUM_OF_SESS; self.pool.bearer = self.pool.sess * MAX_NUM_OF_BEARER; self.pool.tunnel = self.pool.bearer * MAX_NUM_OF_TUNNEL; self.pool.pf = self.pool.bearer * MAX_NUM_OF_PF; + self.pool.nf_service = self.max.nf * MAX_NUM_OF_NF_SERVICE; + self.pool.sbi_message = self.max.nf * MAX_NUM_OF_SBI_MESSAGE; + self.pool.nf_subscription = self.max.nf * MAX_NUM_OF_NF_SUBSCRIPTION; } static int config_prepare(void) @@ -161,6 +168,7 @@ static int config_prepare(void) #define MAX_NUM_OF_SMF 32 /* Num of SMF per AMF */ #define MAX_NUM_OF_UPF 32 /* Num of PGW per AMF */ #define MAX_NUM_OF_GNB 32 /* Num of gNB per AMF */ +#define MAX_NUM_OF_NF 512 /* Num of NF Instance */ self.max.sgw = MAX_NUM_OF_SGW; self.max.pgw = MAX_NUM_OF_PGW; self.max.vlr = MAX_NUM_OF_VLR; @@ -170,6 +178,7 @@ static int config_prepare(void) self.max.ue = MAX_NUM_OF_UE; self.max.smf = MAX_NUM_OF_SMF; self.max.upf = MAX_NUM_OF_UPF; + self.max.nf = MAX_NUM_OF_NF; #define MAX_NUM_OF_PACKET_POOL 65536 self.pool.packet = MAX_NUM_OF_PACKET_POOL; @@ -259,6 +268,21 @@ int ogs_config_parse() } else if (!strcmp(parameter_key, "no_pcrf")) { self.parameter.no_pcrf = ogs_yaml_iter_bool(¶meter_iter); + } else if (!strcmp(parameter_key, "no_upf")) { + self.parameter.no_upf = + ogs_yaml_iter_bool(¶meter_iter); + } else if (!strcmp(parameter_key, "no_smf")) { + self.parameter.no_smf = + ogs_yaml_iter_bool(¶meter_iter); + } else if (!strcmp(parameter_key, "no_ausf")) { + self.parameter.no_ausf = + ogs_yaml_iter_bool(¶meter_iter); + } else if (!strcmp(parameter_key, "no_udm")) { + self.parameter.no_udm = + ogs_yaml_iter_bool(¶meter_iter); + } else if (!strcmp(parameter_key, "no_udr")) { + self.parameter.no_udr = + ogs_yaml_iter_bool(¶meter_iter); } else if (!strcmp(parameter_key, "no_ipv4")) { self.parameter.no_ipv4 = ogs_yaml_iter_bool(¶meter_iter); @@ -329,6 +353,9 @@ int ogs_config_parse() !strcmp(max_key, "enb")) { const char *v = ogs_yaml_iter_value(&max_iter); if (v) self.max.gnb = atoi(v); + } else if (!strcmp(max_key, "nf")) { + const char *v = ogs_yaml_iter_value(&max_iter); + if (v) self.max.nf = atoi(v); } else ogs_warn("unknown key `%s`", max_key); } diff --git a/lib/app/ogs-config.h b/lib/app/ogs-config.h index b2c9c40869..2a0f117553 100644 --- a/lib/app/ogs-config.h +++ b/lib/app/ogs-config.h @@ -51,6 +51,9 @@ typedef struct ogs_config_s { int no_amf; int no_smf; int no_upf; + int no_ausf; + int no_udm; + int no_udr; int no_nrf; /* Network */ @@ -76,6 +79,7 @@ typedef struct ogs_config_s { int smf; int upf; int gnb; + int nf; } max; struct { @@ -83,12 +87,15 @@ typedef struct ogs_config_s { int packet; int ue; + int auth; int pfcp; - int sbi; int sess; int bearer; int tunnel; int pf; + int nf_service; + int nf_subscription; + int sbi_message; } pool; struct { diff --git a/lib/asn1c/util/conv.c b/lib/asn1c/util/conv.c index e16db23571..f02e910bd9 100644 --- a/lib/asn1c/util/conv.c +++ b/lib/asn1c/util/conv.c @@ -22,6 +22,8 @@ void ogs_asn_uint8_to_OCTET_STRING( uint8_t uint8, OCTET_STRING_t *octet_string) { + ogs_assert(octet_string); + octet_string->size = 1; octet_string->buf = CALLOC(octet_string->size, sizeof(uint8_t)); @@ -31,6 +33,8 @@ void ogs_asn_uint8_to_OCTET_STRING( void ogs_asn_uint16_to_OCTET_STRING( uint16_t uint16, OCTET_STRING_t *octet_string) { + ogs_assert(octet_string); + octet_string->size = 2; octet_string->buf = CALLOC(octet_string->size, sizeof(uint8_t)); @@ -41,6 +45,8 @@ void ogs_asn_uint16_to_OCTET_STRING( void ogs_asn_uint24_to_OCTET_STRING( ogs_uint24_t uint24, OCTET_STRING_t *octet_string) { + ogs_assert(octet_string); + octet_string->size = 3; octet_string->buf = CALLOC(octet_string->size, sizeof(uint8_t)); @@ -52,6 +58,8 @@ void ogs_asn_uint24_to_OCTET_STRING( void ogs_asn_uint32_to_OCTET_STRING( uint32_t uint32, OCTET_STRING_t *octet_string) { + ogs_assert(octet_string); + octet_string->size = 4; octet_string->buf = CALLOC(octet_string->size, sizeof(uint8_t)); @@ -61,6 +69,41 @@ void ogs_asn_uint32_to_OCTET_STRING( octet_string->buf[3] = uint32; } +void ogs_asn_OCTET_STRING_to_uint8( + OCTET_STRING_t *octet_string, uint8_t *uint8) +{ + ogs_assert(octet_string); + ogs_assert(uint8); + + *uint8 = octet_string->buf[0]; +} +void ogs_asn_OCTET_STRING_to_uint16( + OCTET_STRING_t *octet_string, uint16_t *uint16) +{ + ogs_assert(octet_string); + ogs_assert(uint16); + + *uint16 = (octet_string->buf[0] << 8) + octet_string->buf[1]; +} +void ogs_asn_OCTET_STRING_to_uint24( + OCTET_STRING_t *octet_string, ogs_uint24_t *uint24) +{ + ogs_assert(octet_string); + ogs_assert(uint24); + + memcpy(uint24, octet_string->buf, sizeof(ogs_uint24_t)); + *uint24 = ogs_be24toh(*uint24); +} +void ogs_asn_OCTET_STRING_to_uint32( + OCTET_STRING_t *octet_string, uint32_t *uint32) +{ + ogs_assert(octet_string); + ogs_assert(uint32); + + *uint32 = (octet_string->buf[0] << 24) + (octet_string->buf[1] << 16) + + (octet_string->buf[2] << 8) + octet_string->buf[3]; +} + void ogs_asn_buffer_to_OCTET_STRING( void *buf, int size, OCTET_STRING_t *octet_string) { @@ -70,6 +113,16 @@ void ogs_asn_buffer_to_OCTET_STRING( memcpy(octet_string->buf, buf, size); } +void ogs_asn_buffer_to_BIT_STRING( + void *buf, int size, int unused, BIT_STRING_t *bit_string) +{ + bit_string->size = size; + bit_string->buf = CALLOC(bit_string->size, sizeof(uint8_t)); + bit_string->bits_unused = unused; + + memcpy(bit_string->buf, buf, size); +} + int ogs_asn_BIT_STRING_to_ip(BIT_STRING_t *bit_string, ogs_ip_t *ip) { char buf[OGS_ADDRSTRLEN], buf2[OGS_ADDRSTRLEN]; @@ -95,7 +148,7 @@ int ogs_asn_BIT_STRING_to_ip(BIT_STRING_t *bit_string, ogs_ip_t *ip) } else ogs_assert_if_reached(); - ip->len = bit_string->size; + ip->len = bit_string->size; return OGS_OK; } diff --git a/lib/asn1c/util/conv.h b/lib/asn1c/util/conv.h index f511213d2b..53b88abbd4 100644 --- a/lib/asn1c/util/conv.h +++ b/lib/asn1c/util/conv.h @@ -58,8 +58,20 @@ void ogs_asn_uint24_to_OCTET_STRING( ogs_uint24_t uint24, OCTET_STRING_t *octet_string); void ogs_asn_uint32_to_OCTET_STRING( uint32_t uint32, OCTET_STRING_t *octet_string); + +void ogs_asn_OCTET_STRING_to_uint8( + OCTET_STRING_t *octet_string, uint8_t *uint8); +void ogs_asn_OCTET_STRING_to_uint16( + OCTET_STRING_t *octet_string, uint16_t *uint16); +void ogs_asn_OCTET_STRING_to_uint24( + OCTET_STRING_t *octet_string, ogs_uint24_t *uint24); +void ogs_asn_OCTET_STRING_to_uint32( + OCTET_STRING_t *octet_string, uint32_t *uint32); + void ogs_asn_buffer_to_OCTET_STRING( void *buf, int size, OCTET_STRING_t *octet_string); +void ogs_asn_buffer_to_BIT_STRING( + void *buf, int size, int unused, BIT_STRING_t *bit_string); int ogs_asn_BIT_STRING_to_ip( BIT_STRING_t *bit_string, ogs_ip_t *ip); diff --git a/lib/core/ogs-3gpp-types.c b/lib/core/ogs-3gpp-types.c index 52b14ffceb..9bc5e79670 100644 --- a/lib/core/ogs-3gpp-types.c +++ b/lib/core/ogs-3gpp-types.c @@ -64,6 +64,14 @@ void *ogs_plmn_id_build(ogs_plmn_id_t *plmn_id, return plmn_id; } +char *ogs_plmn_id_string(ogs_plmn_id_t *plmn_id) +{ + ogs_assert(plmn_id); + + return ogs_msprintf("5G:mnc%03d.mcc%03d.3gppnetwork.org", + ogs_plmn_id_mnc(plmn_id), ogs_plmn_id_mcc(plmn_id)); +} + uint32_t ogs_amf_id_hexdump(ogs_amf_id_t *amf_id) { uint32_t hex; @@ -95,17 +103,11 @@ ogs_amf_id_t *ogs_amf_id_from_string(ogs_amf_id_t *amf_id, const char *hex) char *ogs_amf_id_to_string(ogs_amf_id_t *amf_id, char *buf) { - int i; ogs_assert(amf_id); ogs_assert(buf); ogs_hex_to_ascii(amf_id, sizeof(ogs_amf_id_t), buf, OGS_AMFIDSTRLEN); - /* I'd just like to use lower character */ - for (i = 0; buf[i]; i++) - if (buf[i] >= 'A' && buf[i] <= 'Z') - buf[i] = buf[i] + 'a' - 'A'; - return buf; } @@ -140,6 +142,68 @@ ogs_amf_id_t *ogs_amf_id_build(ogs_amf_id_t *amf_id, return amf_id; } +char *ogs_supi_from_suci(char *suci) +{ +#define MAX_SUCI_TOKEN 16 + char *array[MAX_SUCI_TOKEN]; + char *saveptr = NULL; + char *p, *tmp; + int i; + char *supi = NULL; + + ogs_assert(suci); + tmp = ogs_strdup(suci); + + p = strtok_r(tmp, "-", &saveptr); + + memset(array, 0, sizeof(array)); + for (i = 0; i < MAX_SUCI_TOKEN && p; i++) { + array[i] = p; + p = strtok_r(NULL, "-", &saveptr); + } + + SWITCH(array[0]) + CASE("suci") + SWITCH(array[1]) + CASE("0") /* SUPI format : IMSI */ + if (array[2] && array[3] && array[7]) + supi = ogs_msprintf("imsi-%s%s%s", + array[2], array[3], array[7]); + + break; + DEFAULT + ogs_error("Not implemented [%s]", array[1]); + break; + END + break; + DEFAULT + ogs_error("Not implemented [%s]", array[0]); + break; + END + + ogs_free(tmp); + return supi; +} + +char *ogs_ueid_from_supi(char *supi) +{ + char *saveptr = NULL; + char *p, *tmp; + char *ueid = NULL; + + ogs_assert(supi); + tmp = ogs_strdup(supi); + + p = strtok_r(tmp, "-", &saveptr); + ogs_assert(p); + p = strtok_r(NULL, "-", &saveptr); + ogs_assert(p); + ueid = ogs_strdup(p); + + ogs_free(tmp); + return ueid; +} + int ogs_fqdn_build(char *dst, char *src, int length) { int i = 0, j = 0; diff --git a/lib/core/ogs-3gpp-types.h b/lib/core/ogs-3gpp-types.h index 231c9bb8c8..08f9b33626 100644 --- a/lib/core/ogs-3gpp-types.h +++ b/lib/core/ogs-3gpp-types.h @@ -33,6 +33,7 @@ extern "C" { #define OGS_MAX_SDU_LEN 8192 #define OGS_PLMN_ID_LEN 3 +#define OGS_MAX_PLMN_ID_BCD_LEN 6 #define OGS_BCD_TO_BUFFER_LEN(x) (((x)+1)/2) #define OGS_MAX_IMSI_BCD_LEN 15 @@ -126,6 +127,8 @@ uint16_t ogs_plmn_id_mnc_len(ogs_plmn_id_t *plmn_id); void *ogs_plmn_id_build(ogs_plmn_id_t *plmn_id, uint16_t mcc, uint16_t mnc, uint16_t mnc_len); +char *ogs_plmn_id_string(ogs_plmn_id_t *plmn_id); + /************************************ * AMF_ID Structure */ typedef struct ogs_amf_id_s { @@ -148,6 +151,11 @@ uint8_t ogs_amf_pointer(ogs_amf_id_t *amf_id); ogs_amf_id_t *ogs_amf_id_build(ogs_amf_id_t *amf_id, uint8_t region, uint16_t set, uint8_t pointer); +/************************************ + * SUPI/SUCI */ +char *ogs_supi_from_suci(char *suci); +char *ogs_ueid_from_supi(char *supi); + /************************************ * TAI Structure */ #define OGS_MAX_NUM_OF_TAI 16 @@ -166,6 +174,11 @@ typedef struct ogs_e_cgi_s { uint32_t cell_id; /* 28 bit */ } __attribute__ ((packed)) ogs_e_cgi_t; +typedef struct ogs_nr_cgi_s { + ogs_plmn_id_t plmn_id; + uint64_t cell_id; /* 36 bit */ +} __attribute__ ((packed)) ogs_nr_cgi_t; + /************************************ * S-NSSAI Structure */ #define OGS_MAX_NUM_OF_S_NSSAI 8 diff --git a/lib/core/ogs-conv.c b/lib/core/ogs-conv.c index cbf07cb18f..cbbdf706f4 100644 --- a/lib/core/ogs-conv.c +++ b/lib/core/ogs-conv.c @@ -58,8 +58,7 @@ void *ogs_hex_to_ascii(void *in, int in_len, void *out, int out_len) l = (in_len - off) > out_len ? out_len : in_len - off; for (i = 0; i < l; i++) { - p += sprintf(p, "%02X", ((char*)in)[off+i] & 0xff); - if ((i & 0x3) == 3 && (i != (l-1))) p += sprintf(p, " "); + p += sprintf(p, "%02x", ((char*)in)[off+i] & 0xff); } return out; diff --git a/lib/core/ogs-fsm.c b/lib/core/ogs-fsm.c index d244f98463..8eb016ce03 100644 --- a/lib/core/ogs-fsm.c +++ b/lib/core/ogs-fsm.c @@ -39,8 +39,7 @@ void ogs_fsm_init(void *sm, void *event) ogs_fsm_t *s = sm; fsm_event_t *e = event; - if (s->init != NULL) - { + if (s->init != NULL) { (*s->init)(s, e); if (s->init != s->state) { if (e) { @@ -59,7 +58,9 @@ void ogs_fsm_dispatch(void *sm, void *event) fsm_event_t *e = event; ogs_fsm_handler_t tmp = s->state; - (*tmp)(s, e); + if (e) + (*tmp)(s, e); + if (s->state != tmp) { if (e) { e->id = OGS_FSM_EXIT_SIG; diff --git a/lib/core/ogs-macros.h b/lib/core/ogs-macros.h index 470e3b779a..abe9740266 100644 --- a/lib/core/ogs-macros.h +++ b/lib/core/ogs-macros.h @@ -167,7 +167,9 @@ extern "C" { #ifndef SWITCH_CASE_INIT #define SWITCH_CASE_INIT #define SWITCH(X) {char *__switch_p__, __switch_next__; \ - for (__switch_p__ = (char *)X, __switch_next__ = 1; \ + for (__switch_p__ = \ + X ? (char *)X : (char *)"OGS_SWITCH_NULL", \ + __switch_next__ = 1; \ __switch_p__; \ __switch_p__ = 0, __switch_next__ = 1) { { #define CASE(X) } if (!__switch_next__ || \ diff --git a/lib/crypt/meson.build b/lib/crypt/meson.build index dc0c02c15a..512fb7bca9 100644 --- a/lib/crypt/meson.build +++ b/lib/crypt/meson.build @@ -28,6 +28,7 @@ libcrypt_sources = files(''' snow-3g.h zuc.h kasumi.h + ogs-kdf.h ogs-aes.c ogs-aes-cmac.c @@ -39,6 +40,8 @@ libcrypt_sources = files(''' snow-3g.c zuc.c kasumi.c + + ogs-kdf.c '''.split()) libcrypt_inc = include_directories('.') diff --git a/lib/crypt/ogs-crypt.h b/lib/crypt/ogs-crypt.h index 8ca7b0dd11..a27132ada7 100644 --- a/lib/crypt/ogs-crypt.h +++ b/lib/crypt/ogs-crypt.h @@ -36,17 +36,28 @@ #include "crypt/zuc.h" #include "crypt/kasumi.h" +#include "crypt/ogs-kdf.h" + #undef OGS_CRYPT_INSIDE #ifdef __cplusplus extern "C" { #endif +#define OGS_KEY_LEN 16 +#define OGS_AMF_LEN 2 #define OGS_RAND_LEN 16 #define OGS_AUTN_LEN 16 #define OGS_AUTS_LEN 14 #define OGS_MAX_RES_LEN 16 +#define OGS_SQN_XOR_AK_LEN 6 +#define OGS_AK_LEN 6 +#define OGS_SQN_LEN 6 +#define OGS_MAX_SQN 0xffffffffffff + +#define OGS_KEYSTRLEN(x) ((x*2)+1) + #ifdef __cplusplus } #endif diff --git a/lib/crypt/ogs-kdf.c b/lib/crypt/ogs-kdf.c new file mode 100644 index 0000000000..2fa4e851d0 --- /dev/null +++ b/lib/crypt/ogs-kdf.c @@ -0,0 +1,311 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "ogs-crypt.h" + +#define MAX_NUM_OF_KDF_PARAM 16 + +#define FC_FOR_CK_PRIME_IK_PRIME_DERIVATION 0x20 +#define FC_FOR_5GS_ALGORITHM_KEY_DERIVATION 0x69 +#define FC_FOR_KAUSF_DERIVATION 0x6A +#define FC_FOR_RES_STAR_XRES_STAR_DERIVATION 0x6B +#define FC_FOR_KSEAF_DERIVATION 0x6C +#define FC_FOR_KAMF_DERIVATION 0x6D +#define FC_FOR_KGNB_KN3IWF_DERIVATION 0x6E +#define FC_FOR_NH_GNB_DERIVATION 0x6F + +#define FC_FOR_KENB_DERIVATION 0x11 +#define FC_FOR_NH_ENB_DERIVATION 0x12 +#define FC_FOR_EPS_ALGORITHM_KEY_DERIVATION 0x15 + +typedef struct kdf_param_s { + uint8_t *buf; + uint16_t len; +} kdf_param_t[MAX_NUM_OF_KDF_PARAM]; + +/* KDF function : TS.33220 cluase B.2.0 */ +static void ogs_kdf_common(uint8_t *key, uint32_t key_size, + uint8_t fc, kdf_param_t param, uint8_t *output) +{ + int i = 0, pos; + uint8_t *s = NULL; + + ogs_assert(key); + ogs_assert(key_size); + ogs_assert(fc); + ogs_assert(param[0].buf); + ogs_assert(param[0].len); + ogs_assert(output); + + pos = 1; /* FC Value */ + + /* Calculate buffer length */ + for (i = 0; i < MAX_NUM_OF_KDF_PARAM && param[i].buf && param[i].len; i++) { + pos += (param[i].len + 2); + } + + s = ogs_calloc(1, pos); + ogs_assert(s); + + /* Copy buffer from param */ + pos = 0; + s[pos++] = fc; + for (i = 0; i < MAX_NUM_OF_KDF_PARAM && param[i].buf && param[i].len; i++) { + uint16_t len; + + memcpy(&s[pos], param[i].buf, param[i].len); + pos += param[i].len; + len = htobe16(param[i].len); + memcpy(&s[pos], &len, sizeof(len)); + pos += 2; + } + + ogs_hmac_sha256(key, key_size, s, pos, output, OGS_SHA256_DIGEST_SIZE); + + ogs_free(s); +} + +/* TS33.501 Annex A.2 : Kausf derviation function */ +void ogs_kdf_kausf( + uint8_t *ck, uint8_t *ik, + char *serving_network_name, uint8_t *autn, + uint8_t *kausf) +{ + kdf_param_t param; + uint8_t key[OGS_KEY_LEN*2]; + + ogs_assert(ck); + ogs_assert(ik); + ogs_assert(serving_network_name); + ogs_assert(autn); + ogs_assert(kausf); + + memcpy(key, ck, OGS_KEY_LEN); + memcpy(key+OGS_KEY_LEN, ik, OGS_KEY_LEN); + + memset(param, 0, sizeof(param)); + param[0].buf = (uint8_t *)serving_network_name; + param[0].len = strlen(serving_network_name); + param[1].buf = autn; + param[1].len = OGS_SQN_XOR_AK_LEN; + + ogs_kdf_common(key, OGS_KEY_LEN*2, + FC_FOR_KAUSF_DERIVATION, param, kausf); +} + +/* TS33.501 Annex A.4 : RES* and XRES* derivation function */ +void ogs_kdf_xres_star( + uint8_t *ck, uint8_t *ik, + char *serving_network_name, uint8_t *rand, + uint8_t *xres, size_t xres_len, + uint8_t *xres_star) +{ + kdf_param_t param; + uint8_t key[OGS_KEY_LEN*2]; + uint8_t output[OGS_SHA256_DIGEST_SIZE]; + + ogs_assert(ck); + ogs_assert(ik); + ogs_assert(serving_network_name); + ogs_assert(rand); + ogs_assert(xres); + ogs_assert(xres_len); + + memcpy(key, ck, OGS_KEY_LEN); + memcpy(key+OGS_KEY_LEN, ik, OGS_KEY_LEN); + + memset(param, 0, sizeof(param)); + param[0].buf = (uint8_t *)serving_network_name; + param[0].len = strlen(serving_network_name); + param[1].buf = rand; + param[1].len = OGS_RAND_LEN; + param[2].buf = xres; + param[2].len = xres_len; + + ogs_kdf_common(key, OGS_KEY_LEN*2, + FC_FOR_RES_STAR_XRES_STAR_DERIVATION, param, output); + + memcpy(xres_star, output+OGS_KEY_LEN, OGS_KEY_LEN); +} + +/* TS33.501 Annex A.5 : HRES* and HXRES* derivation function */ +void ogs_kdf_hxres_star(uint8_t *rand, uint8_t *xres_star, uint8_t *hxres_star) +{ + uint8_t message[OGS_RAND_LEN + OGS_KEY_LEN]; + uint8_t output[OGS_SHA256_DIGEST_SIZE]; + + ogs_assert(rand); + ogs_assert(xres_star); + ogs_assert(hxres_star); + + memcpy(message, rand, OGS_RAND_LEN); + memcpy(message+OGS_RAND_LEN, xres_star, OGS_KEY_LEN); + + ogs_sha256(message, OGS_RAND_LEN+OGS_KEY_LEN, output); + + memcpy(hxres_star, output+OGS_KEY_LEN, OGS_KEY_LEN); +} + +/* TS33.501 Annex A.6 : Kseaf derivation function */ +void ogs_kdf_kseaf(char *serving_network_name, uint8_t *kausf, uint8_t *kseaf) +{ + kdf_param_t param; + + ogs_assert(serving_network_name); + ogs_assert(kausf); + ogs_assert(kseaf); + + memset(param, 0, sizeof(param)); + param[0].buf = (uint8_t *)serving_network_name; + param[0].len = strlen(serving_network_name); + + ogs_kdf_common(kausf, OGS_SHA256_DIGEST_SIZE, + FC_FOR_KSEAF_DERIVATION, param, kseaf); +} + +/* TS33.501 Annex A.7 : Kamf derivation function */ +void ogs_kdf_kamf(char *supi, uint8_t *abba, uint8_t abba_len, + uint8_t *kseaf, uint8_t *kamf) +{ + kdf_param_t param; + char *ueid = NULL; + + ogs_assert(supi); + ogs_assert(abba); + ogs_assert(abba_len); + ogs_assert(kseaf); + ogs_assert(kamf); + + ueid = ogs_ueid_from_supi(supi); + ogs_assert(ueid); + + memset(param, 0, sizeof(param)); + param[0].buf = (uint8_t *)ueid; + param[0].len = strlen(ueid); + param[1].buf = abba; + param[1].len = abba_len; + + ogs_kdf_common(kseaf, OGS_SHA256_DIGEST_SIZE, + FC_FOR_KAMF_DERIVATION, param, kamf); + + ogs_free(ueid); +} + +/* TS33.501 Annex A.8 : Algorithm key derivation functions */ +void ogs_kdf_nas_5gs(uint8_t algorithm_type_distinguishers, + uint8_t algorithm_identity, uint8_t *kamf, uint8_t *knas) +{ + kdf_param_t param; + uint8_t output[OGS_SHA256_DIGEST_SIZE]; + + ogs_assert(kamf); + ogs_assert(knas); + + memset(param, 0, sizeof(param)); + param[0].buf = &algorithm_type_distinguishers; + param[0].len = 1; + param[1].buf = &algorithm_identity; + param[1].len = 1; + + ogs_kdf_common(kamf, OGS_SHA256_DIGEST_SIZE, + FC_FOR_5GS_ALGORITHM_KEY_DERIVATION, param, output); + memcpy(knas, output+16, 16); +} + +/* TS33.501 Annex A.9 KgNB and Kn3iwf derivation function */ +void ogs_kdf_kgnb_and_kn3iwf(uint8_t *kamf, uint32_t ul_count, + uint8_t access_type_distinguisher, uint8_t *kgnb) +{ + kdf_param_t param; + + ogs_assert(kamf); + ogs_assert(kgnb); + + memset(param, 0, sizeof(param)); + ul_count = htobe32(ul_count); + param[0].buf = (uint8_t *)&ul_count; + param[0].len = 4; + param[0].buf = &access_type_distinguisher; + param[0].len = 1; + + ogs_kdf_common(kamf, OGS_SHA256_DIGEST_SIZE, + FC_FOR_KGNB_KN3IWF_DERIVATION, param, kgnb); +} + +/* TS33.501 Annex A.10 NH derivation function */ +void ogs_kdf_nh_gnb(uint8_t *kamf, uint8_t *sync_input, uint8_t *kgnb) +{ + kdf_param_t param; + + ogs_assert(kamf); + ogs_assert(kgnb); + + memset(param, 0, sizeof(param)); + param[0].buf = sync_input; + param[0].len = OGS_SHA256_DIGEST_SIZE; + + ogs_kdf_common(kamf, OGS_SHA256_DIGEST_SIZE, + FC_FOR_NH_GNB_DERIVATION, param, kgnb); +} + +/* TS33.401 Annex A.3 KeNB derivation function */ +void ogs_kdf_kenb(uint8_t *kasme, uint32_t ul_count, uint8_t *kenb) +{ + kdf_param_t param; + + memset(param, 0, sizeof(param)); + ul_count = htobe32(ul_count); + param[0].buf = (uint8_t *)&ul_count; + param[0].len = 4; + + ogs_kdf_common(kasme, OGS_SHA256_DIGEST_SIZE, + FC_FOR_KENB_DERIVATION, param, kenb); +} + +/* TS33.401 Annex A.4 NH derivation function */ +void ogs_kdf_nh_enb(uint8_t *kasme, uint8_t *sync_input, uint8_t *kenb) +{ + kdf_param_t param; + + memset(param, 0, sizeof(param)); + param[0].buf = sync_input; + param[0].len = OGS_SHA256_DIGEST_SIZE; + + ogs_kdf_common(kasme, OGS_SHA256_DIGEST_SIZE, + FC_FOR_NH_ENB_DERIVATION, param, kenb); +} + +/* TS33.401 Annex A.7 Algorithm key derivation functions */ +void ogs_kdf_nas_eps(uint8_t algorithm_type_distinguishers, + uint8_t algorithm_identity, uint8_t *kasme, uint8_t *knas) +{ + kdf_param_t param; + uint8_t output[OGS_SHA256_DIGEST_SIZE]; + + memset(param, 0, sizeof(param)); + param[0].buf = &algorithm_type_distinguishers; + param[0].len = 1; + param[1].buf = &algorithm_identity; + param[1].len = 1; + + ogs_kdf_common(kasme, OGS_SHA256_DIGEST_SIZE, + FC_FOR_EPS_ALGORITHM_KEY_DERIVATION, param, output); + memcpy(knas, output+16, 16); +} + diff --git a/lib/crypt/ogs-kdf.h b/lib/crypt/ogs-kdf.h new file mode 100644 index 0000000000..20a93f90bf --- /dev/null +++ b/lib/crypt/ogs-kdf.h @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#if !defined(OGS_CRYPT_INSIDE) && !defined(OGS_CRYPT_COMPILATION) +#error "This header cannot be included directly." +#endif + +#ifndef OGS_KDF_H +#define OGS_KDF_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* TS33.501 Annex A.2 : Kausf derviation function */ +void ogs_kdf_kausf( + uint8_t *ck, uint8_t *ik, + char *serving_network_name, uint8_t *autn, + uint8_t *kausf); + +/* TS33.501 Annex A.4 : RES* and XRES* derivation function */ +void ogs_kdf_xres_star( + uint8_t *ck, uint8_t *ik, + char *serving_network_name, uint8_t *rand, + uint8_t *xres, size_t xres_len, + uint8_t *xres_star); + +/* TS33.501 Annex A.5 : HRES* and HXRES* derivation function */ +void ogs_kdf_hxres_star(uint8_t *rand, uint8_t *xres_star, uint8_t *hxres_star); + +/* TS33.501 Annex A.6 : Kseaf derivation function */ +void ogs_kdf_kseaf(char *serving_network_name, uint8_t *kausf, uint8_t *kseaf); + +/* TS33.501 Annex A.7 : Kamf derivation function */ +void ogs_kdf_kamf(char *supi, uint8_t *abba, uint8_t abba_len, + uint8_t *kseaf, uint8_t *kamf); + +/* Algorithm Type Distinguishers */ +#define OGS_KDF_NAS_ENC_ALG 0x01 +#define OGS_KDF_NAS_INT_ALG 0x02 + +/* Algorithm Identity defined in lib/nas/common/types.h +#define OGS_NAS_SECURITY_ALGORITHMS_NIA0 0 +#define OGS_NAS_SECURITY_ALGORITHMS_128_NIA1 1 +#define OGS_NAS_SECURITY_ALGORITHMS_128_NIA1 2 +#define OGS_NAS_SECURITY_ALGORITHMS_128_NIA3 3 +#define OGS_NAS_SECURITY_ALGORITHMS_NEA0 0 +#define OGS_NAS_SECURITY_ALGORITHMS_128_NEA1 1 +#define OGS_NAS_SECURITY_ALGORITHMS_128_NEA2 2 +#define OGS_NAS_SECURITY_ALGORITHMS_128_NEA3 3 +*/ + +/* TS33.501 Annex A.8 : Algorithm key derivation functions */ +void ogs_kdf_nas_5gs(uint8_t algorithm_type_distinguishers, + uint8_t algorithm_identity, uint8_t *kamf, uint8_t *knas); + +/* Access Type Distinguishers */ +#define OGS_KDF_ACCESS_TYPE_3GPP 0x01 +#define OGS_KDF_ACCESS_TYPE_NON_3GPP 0x02 + +/* TS33.501 Annex A.9 KgNB and Kn3iwf derivation function */ +void ogs_kdf_kgnb_and_kn3iwf(uint8_t *kamf, uint32_t ul_count, + uint8_t access_type_distinguisher, uint8_t *kgnb); + +/* TS33.501 Annex A.10 NH derivation function */ +void ogs_kdf_nh_gnb(uint8_t *kamf, uint8_t *sync_input, uint8_t *kgnb); + +/* TS33.401 Annex A.3 KeNB derivation function */ +void ogs_kdf_kenb(uint8_t *kasme, uint32_t ul_count, uint8_t *kenb); + +/* TS33.401 Annex A.4 NH derivation function */ +void ogs_kdf_nh_enb(uint8_t *kasme, uint8_t *sync_input, uint8_t *kenb); + +/* TS33.401 Annex A.7 Algorithm key derivation functions */ +void ogs_kdf_nas_eps(uint8_t algorithm_type_distinguishers, + uint8_t algorithm_identity, uint8_t *kasme, uint8_t *knas); + + +#ifdef __cplusplus +} +#endif + +#endif /* OGS_KDF_H */ diff --git a/lib/dbi/meson.build b/lib/dbi/meson.build index 790f77c4bb..3ddb18516f 100644 --- a/lib/dbi/meson.build +++ b/lib/dbi/meson.build @@ -1,4 +1,4 @@ -# Copyright (C) 2019 by Sukchan Lee +# Copyright (C) 2019,2020 by Sukchan Lee # This file is part of Open5GS. @@ -21,6 +21,7 @@ libdbi_sources = files(''' ogs-mongoc.h ogs-mongoc.c + subscription.c '''.split()) libmongoc_dep = dependency('libmongoc-1.0') @@ -32,10 +33,10 @@ libdbi = library('ogsdbi', version : libogslib_version, c_args : '-DOGS_DBI_COMPILATION', include_directories : [libdbi_inc, libinc], - dependencies : [libcore_dep, libmongoc_dep], + dependencies : [libcrypt_dep, libmongoc_dep], install : true) libdbi_dep = declare_dependency( link_with : libdbi, include_directories : [libdbi_inc, libinc], - dependencies : [libcore_dep, libmongoc_dep]) + dependencies : [libcrypt_dep, libmongoc_dep]) diff --git a/lib/dbi/ogs-dbi.h b/lib/dbi/ogs-dbi.h index f389d00f41..1b1f30e52c 100644 --- a/lib/dbi/ogs-dbi.h +++ b/lib/dbi/ogs-dbi.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019,2020 by Sukchan Lee * * This file is part of Open5GS. * @@ -17,14 +17,16 @@ * along with this program. If not, see . */ -#ifndef OGS_DB_H -#define OGS_DB_H +#ifndef OGS_DBI_H +#define OGS_DBI_H #include "ogs-core.h" +#include "ogs-crypt.h" #define OGS_DBI_INSIDE #include "dbi/ogs-mongoc.h" +#include "dbi/subscription.h" #undef OGS_DBI_INSIDE @@ -41,4 +43,4 @@ extern int __ogs_dbi_domain; } #endif -#endif /* OGS_DB_H */ +#endif /* OGS_DBI_H */ diff --git a/lib/dbi/ogs-mongoc.c b/lib/dbi/ogs-mongoc.c index 16f7b7d708..114b6000f9 100644 --- a/lib/dbi/ogs-mongoc.c +++ b/lib/dbi/ogs-mongoc.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019,2020 by Sukchan Lee * * This file is part of Open5GS. * @@ -122,3 +122,30 @@ ogs_mongoc_t *ogs_mongoc(void) { return &self; } + +int ogs_dbi_init(const char *db_uri) +{ + int rv; + + ogs_assert(db_uri); + + rv = ogs_mongoc_init(db_uri); + if (rv != OGS_OK) return rv; + + if (ogs_mongoc()->client && ogs_mongoc()->name) { + self.collection.subscriber = mongoc_client_get_collection( + ogs_mongoc()->client, ogs_mongoc()->name, "subscribers"); + ogs_assert(self.collection.subscriber); + } + + return OGS_OK; +} + +void ogs_dbi_final() +{ + if (self.collection.subscriber) { + mongoc_collection_destroy(self.collection.subscriber); + } + + ogs_mongoc_final(); +} diff --git a/lib/dbi/ogs-mongoc.h b/lib/dbi/ogs-mongoc.h index 407453ded1..3c80c8b8c6 100644 --- a/lib/dbi/ogs-mongoc.h +++ b/lib/dbi/ogs-mongoc.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019,2020 by Sukchan Lee * * This file is part of Open5GS. * @@ -36,12 +36,19 @@ typedef struct ogs_mongoc_s { void *uri; void *client; void *database; + + struct { + void *subscriber; + } collection; } ogs_mongoc_t; int ogs_mongoc_init(const char *db_uri); void ogs_mongoc_final(void); ogs_mongoc_t *ogs_mongoc(void); +int ogs_dbi_init(const char *db_uri); +void ogs_dbi_final(void); + #ifdef __cplusplus } #endif diff --git a/lib/dbi/subscription.c b/lib/dbi/subscription.c new file mode 100644 index 0000000000..eb5b70fe44 --- /dev/null +++ b/lib/dbi/subscription.c @@ -0,0 +1,422 @@ +/* + * Copyright (C) 2019 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "ogs-dbi.h" + +int ogs_dbi_auth_info(const char *id_type, const char *ue_id, + ogs_dbi_auth_info_t *auth_info) +{ + int rv = OGS_OK; + mongoc_cursor_t *cursor = NULL; + bson_t *query = NULL; + bson_error_t error; + const bson_t *document; + bson_iter_t iter; + bson_iter_t inner_iter; + char buf[OGS_KEY_LEN]; + char *utf8 = NULL; + uint32_t length = 0; + + ogs_assert(id_type); + ogs_assert(ue_id); + ogs_assert(auth_info); + + query = BCON_NEW(id_type, BCON_UTF8(ue_id)); +#if MONGOC_MAJOR_VERSION >= 1 && MONGOC_MINOR_VERSION >= 5 + cursor = mongoc_collection_find_with_opts( + ogs_mongoc()->collection.subscriber, query, NULL, NULL); +#else + cursor = mongoc_collection_find(ogs_mongoc()->collection.subscriber, + MONGOC_QUERY_NONE, 0, 0, 0, query, NULL, NULL); +#endif + + if (!mongoc_cursor_next(cursor, &document)) { + ogs_warn("Cannot find IMSI in DB : %s-%s", id_type, ue_id); + + rv = OGS_ERROR; + goto out; + } + + if (mongoc_cursor_error(cursor, &error)) { + ogs_error("Cursor Failure: %s", error.message); + + rv = OGS_ERROR; + goto out; + } + + if (!bson_iter_init_find(&iter, document, "security")) { + ogs_error("No 'security' field in this document"); + + rv = OGS_ERROR; + goto out; + } + + memset(auth_info, 0, sizeof(ogs_dbi_auth_info_t)); + bson_iter_recurse(&iter, &inner_iter); + while (bson_iter_next(&inner_iter)) { + const char *key = bson_iter_key(&inner_iter); + + if (!strcmp(key, "k") && BSON_ITER_HOLDS_UTF8(&inner_iter)) { + utf8 = (char *)bson_iter_utf8(&inner_iter, &length); + memcpy(auth_info->k, OGS_HEX(utf8, length, buf), OGS_KEY_LEN); + } else if (!strcmp(key, "opc") && BSON_ITER_HOLDS_UTF8(&inner_iter)) { + utf8 = (char *)bson_iter_utf8(&inner_iter, &length); + auth_info->use_opc = 1; + memcpy(auth_info->opc, OGS_HEX(utf8, length, buf), OGS_KEY_LEN); + } else if (!strcmp(key, "op") && BSON_ITER_HOLDS_UTF8(&inner_iter)) { + utf8 = (char *)bson_iter_utf8(&inner_iter, &length); + memcpy(auth_info->op, OGS_HEX(utf8, length, buf), OGS_KEY_LEN); + } else if (!strcmp(key, "amf") && BSON_ITER_HOLDS_UTF8(&inner_iter)) { + utf8 = (char *)bson_iter_utf8(&inner_iter, &length); + memcpy(auth_info->amf, OGS_HEX(utf8, length, buf), OGS_AMF_LEN); + } else if (!strcmp(key, "rand") && BSON_ITER_HOLDS_UTF8(&inner_iter)) { + utf8 = (char *)bson_iter_utf8(&inner_iter, &length); + memcpy(auth_info->rand, OGS_HEX(utf8, length, buf), OGS_RAND_LEN); + } else if (!strcmp(key, "sqn") && BSON_ITER_HOLDS_INT64(&inner_iter)) { + auth_info->sqn = bson_iter_int64(&inner_iter); + } + } + +out: + if (query) bson_destroy(query); + if (cursor) mongoc_cursor_destroy(cursor); + + return rv; +} + +int ogs_dbi_update_sqn(const char *id_type, const char *ue_id, uint64_t sqn) +{ + int rv = OGS_OK; + bson_t *query = NULL; + bson_t *update = NULL; + bson_error_t error; + char printable_rand[OGS_KEYSTRLEN(OGS_RAND_LEN)]; + + ogs_assert(id_type); + ogs_assert(ue_id); + ogs_hex_to_ascii(rand, + OGS_RAND_LEN, printable_rand, sizeof(printable_rand)); + + query = BCON_NEW(id_type, BCON_UTF8(ue_id)); + update = BCON_NEW("$set", + "{", + "security.sqn", BCON_INT64(sqn), + "}"); + + if (!mongoc_collection_update(ogs_mongoc()->collection.subscriber, + MONGOC_UPDATE_NONE, query, update, NULL, &error)) { + ogs_error("mongoc_collection_update() failure: %s", error.message); + + rv = OGS_ERROR; + } + + if (query) bson_destroy(query); + if (update) bson_destroy(update); + + return rv; +} + +int ogs_dbi_increment_sqn(const char *id_type, const char *ue_id) +{ + int rv = OGS_OK; + bson_t *query = NULL; + bson_t *update = NULL; + bson_error_t error; + uint64_t max_sqn = OGS_MAX_SQN; + + ogs_assert(id_type); + ogs_assert(ue_id); + + query = BCON_NEW(id_type, BCON_UTF8(ue_id)); + update = BCON_NEW("$inc", + "{", + "security.sqn", BCON_INT64(32), + "}"); + if (!mongoc_collection_update(ogs_mongoc()->collection.subscriber, + MONGOC_UPDATE_NONE, query, update, NULL, &error)) { + ogs_error("mongoc_collection_update() failure: %s", error.message); + + rv = OGS_ERROR; + goto out; + } + bson_destroy(update); + + update = BCON_NEW("$bit", + "{", + "security.sqn", + "{", "and", BCON_INT64(max_sqn), "}", + "}"); + if (!mongoc_collection_update(ogs_mongoc()->collection.subscriber, + MONGOC_UPDATE_NONE, query, update, NULL, &error)) { + ogs_error("mongoc_collection_update() failure: %s", error.message); + + rv = OGS_ERROR; + } + +out: + if (query) bson_destroy(query); + if (update) bson_destroy(update); + + return rv; +} + +int ogs_dbi_subscription_data(const char *id_type, const char *ue_id, + ogs_dbi_subscription_data_t *subscription_data) +{ + int rv = OGS_OK; + mongoc_cursor_t *cursor = NULL; + bson_t *query = NULL; + bson_error_t error; + const bson_t *document; + bson_iter_t iter; + bson_iter_t child1_iter, child2_iter, child3_iter, child4_iter; + const char *utf8 = NULL; + uint32_t length = 0; + + ogs_assert(id_type); + ogs_assert(ue_id); + ogs_assert(subscription_data); + + query = BCON_NEW(id_type, BCON_UTF8(ue_id)); +#if MONGOC_MAJOR_VERSION >= 1 && MONGOC_MINOR_VERSION >= 5 + cursor = mongoc_collection_find_with_opts( + ogs_mongoc()->collection.subscriber, query, NULL, NULL); +#else + cursor = mongoc_collection_find(ogs_mongoc()->collection.subscriber, + MONGOC_QUERY_NONE, 0, 0, 0, query, NULL, NULL); +#endif + + if (!mongoc_cursor_next(cursor, &document)) { + ogs_error("Cannot find IMSI in DB : %s-%s", id_type, ue_id); + + rv = OGS_ERROR; + goto out; + } + + if (mongoc_cursor_error(cursor, &error)) { + ogs_error("Cursor Failure: %s", error.message); + + rv = OGS_ERROR; + goto out; + } + + if (!bson_iter_init(&iter, document)) { + ogs_error("bson_iter_init failed in this document"); + + rv = OGS_ERROR; + goto out; + } + + memset(subscription_data, 0, sizeof(ogs_dbi_subscription_data_t)); + while (bson_iter_next(&iter)) { + const char *key = bson_iter_key(&iter); + if (!strcmp(key, "access_restriction_data") && + BSON_ITER_HOLDS_INT32(&iter)) { + subscription_data->access_restriction_data = + bson_iter_int32(&iter); + + } else if (!strcmp(key, "subscriber_status") && + BSON_ITER_HOLDS_INT32(&iter)) { + subscription_data->subscriber_status = + bson_iter_int32(&iter); + } else if (!strcmp(key, "network_access_mode") && + BSON_ITER_HOLDS_INT32(&iter)) { + subscription_data->network_access_mode = + bson_iter_int32(&iter); + } else if (!strcmp(key, "subscribed_rau_tau_timer") && + BSON_ITER_HOLDS_INT32(&iter)) { + subscription_data->subscribed_rau_tau_timer = + bson_iter_int32(&iter); + } else if (!strcmp(key, "ambr") && + BSON_ITER_HOLDS_DOCUMENT(&iter)) { + bson_iter_recurse(&iter, &child1_iter); + while (bson_iter_next(&child1_iter)) { + const char *child1_key = bson_iter_key(&child1_iter); + if (!strcmp(child1_key, "uplink") && + BSON_ITER_HOLDS_INT64(&child1_iter)) { + subscription_data->ambr.uplink = + bson_iter_int64(&child1_iter) * 1024; + } else if (!strcmp(child1_key, "downlink") && + BSON_ITER_HOLDS_INT64(&child1_iter)) { + subscription_data->ambr.downlink = + bson_iter_int64(&child1_iter) * 1024; + } + } + } else if (!strcmp(key, "pdn") && + BSON_ITER_HOLDS_ARRAY(&iter)) { + int pdn_index = 0; + + bson_iter_recurse(&iter, &child1_iter); + while (bson_iter_next(&child1_iter)) { + const char *child1_key = bson_iter_key(&child1_iter); + ogs_pdn_t *pdn = NULL; + + ogs_assert(child1_key); + pdn_index = atoi(child1_key); + ogs_assert(pdn_index < OGS_MAX_NUM_OF_SESS); + + pdn = &subscription_data->pdn[pdn_index]; + + bson_iter_recurse(&child1_iter, &child2_iter); + while (bson_iter_next(&child2_iter)) { + const char *child2_key = bson_iter_key(&child2_iter); + if (!strcmp(child2_key, "apn") && + BSON_ITER_HOLDS_UTF8(&child2_iter)) { + utf8 = bson_iter_utf8(&child2_iter, &length); + ogs_cpystrn(pdn->apn, utf8, + ogs_min(length, OGS_MAX_APN_LEN)+1); + } else if (!strcmp(child2_key, "type") && + BSON_ITER_HOLDS_INT32(&child2_iter)) { + pdn->pdn_type = bson_iter_int32(&child2_iter); + } else if (!strcmp(child2_key, "qos") && + BSON_ITER_HOLDS_DOCUMENT(&child2_iter)) { + bson_iter_recurse(&child2_iter, &child3_iter); + while (bson_iter_next(&child3_iter)) { + const char *child3_key = + bson_iter_key(&child3_iter); + if (!strcmp(child3_key, "qci") && + BSON_ITER_HOLDS_INT32(&child3_iter)) { + pdn->qos.qci = bson_iter_int32(&child3_iter); + } else if (!strcmp(child3_key, "arp") && + BSON_ITER_HOLDS_DOCUMENT(&child3_iter)) { + bson_iter_recurse(&child3_iter, &child4_iter); + while (bson_iter_next(&child4_iter)) { + const char *child4_key = + bson_iter_key(&child4_iter); + if (!strcmp(child4_key, "priority_level") && + BSON_ITER_HOLDS_INT32(&child4_iter)) { + pdn->qos.arp.priority_level = + bson_iter_int32(&child4_iter); + } else if (!strcmp(child4_key, + "pre_emption_capability") && + BSON_ITER_HOLDS_INT32(&child4_iter)) { + pdn->qos.arp.pre_emption_capability = + bson_iter_int32(&child4_iter); + } else if (!strcmp(child4_key, + "pre_emption_vulnerability") && + BSON_ITER_HOLDS_INT32(&child4_iter)) { + pdn->qos.arp.pre_emption_vulnerability = + bson_iter_int32(&child4_iter); + } + } + } + } + } else if (!strcmp(child2_key, "ambr") && + BSON_ITER_HOLDS_DOCUMENT(&child2_iter)) { + bson_iter_recurse(&child2_iter, &child3_iter); + while (bson_iter_next(&child3_iter)) { + const char *child3_key = + bson_iter_key(&child3_iter); + if (!strcmp(child3_key, "uplink") && + BSON_ITER_HOLDS_INT64(&child3_iter)) { + pdn->ambr.uplink = + bson_iter_int64(&child3_iter) * 1024; + } else if (!strcmp(child3_key, "downlink") && + BSON_ITER_HOLDS_INT64(&child3_iter)) { + pdn->ambr.downlink = + bson_iter_int64(&child3_iter) * 1024; + } + } + } else if (!strcmp(child2_key, "pgw") && + BSON_ITER_HOLDS_DOCUMENT(&child2_iter)) { + bson_iter_recurse(&child2_iter, &child3_iter); + while (bson_iter_next(&child3_iter)) { + const char *child3_key = + bson_iter_key(&child3_iter); + if (!strcmp(child3_key, "addr") && + BSON_ITER_HOLDS_UTF8(&child3_iter)) { + ogs_ipsubnet_t ipsub; + const char *v = + bson_iter_utf8(&child3_iter, &length); + rv = ogs_ipsubnet(&ipsub, v, NULL); + if (rv == OGS_OK) { + pdn->pgw_ip.ipv4 = 1; + pdn->pgw_ip.both.addr = ipsub.sub[0]; + } + } else if (!strcmp(child3_key, "addr6") && + BSON_ITER_HOLDS_UTF8(&child3_iter)) { + ogs_ipsubnet_t ipsub; + const char *v = + bson_iter_utf8(&child3_iter, &length); + rv = ogs_ipsubnet(&ipsub, v, NULL); + if (rv == OGS_OK) { + pdn->pgw_ip.ipv6 = 1; + memcpy(pdn->pgw_ip.both.addr6, + ipsub.sub, sizeof(ipsub.sub)); + } + } + } + } else if (!strcmp(child2_key, "ue") && + BSON_ITER_HOLDS_DOCUMENT(&child2_iter)) { + bson_iter_recurse(&child2_iter, &child3_iter); + while (bson_iter_next(&child3_iter)) { + const char *child3_key = + bson_iter_key(&child3_iter); + if (!strcmp(child3_key, "addr") && + BSON_ITER_HOLDS_UTF8(&child3_iter)) { + ogs_ipsubnet_t ipsub; + const char *v = + bson_iter_utf8(&child3_iter, &length); + rv = ogs_ipsubnet(&ipsub, v, NULL); + if (rv == OGS_OK) { + if (pdn->paa.pdn_type == + OGS_GTP_PDN_TYPE_IPV6) { + pdn->paa.pdn_type = + OGS_GTP_PDN_TYPE_IPV4V6; + } else { + pdn->paa.pdn_type = + OGS_GTP_PDN_TYPE_IPV4; + } + pdn->paa.both.addr = ipsub.sub[0]; + } + } else if (!strcmp(child3_key, "addr6") && + BSON_ITER_HOLDS_UTF8(&child3_iter)) { + ogs_ipsubnet_t ipsub; + const char *v = + bson_iter_utf8(&child3_iter, &length); + rv = ogs_ipsubnet(&ipsub, v, NULL); + if (rv == OGS_OK) { + if (pdn->paa.pdn_type == + OGS_GTP_PDN_TYPE_IPV4) { + pdn->paa.pdn_type = + OGS_GTP_PDN_TYPE_IPV4V6; + } else { + pdn->paa.pdn_type = + OGS_GTP_PDN_TYPE_IPV6; + } + memcpy(&(pdn->paa.both.addr6), + ipsub.sub, OGS_IPV6_LEN); + } + + } + } + } + } + pdn_index++; + } + subscription_data->num_of_pdn = pdn_index; + } + } + +out: + if (query) bson_destroy(query); + if (cursor) mongoc_cursor_destroy(cursor); + + return rv; +} diff --git a/lib/dbi/subscription.h b/lib/dbi/subscription.h new file mode 100644 index 0000000000..0448a16ba5 --- /dev/null +++ b/lib/dbi/subscription.h @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2019 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#if !defined(OGS_DBI_INSIDE) && !defined(OGS_DBI_COMPILATION) +#error "This header cannot be included directly." +#endif + +#ifndef OGS_DBI_SUBSCRIPTION_H +#define OGS_DBI_SUBSCRIPTION_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define OGS_DBI_UE_ID_TYPE_IMSI "imsi" + +typedef struct ogs_dbi_subscription_data_s { +#define OGS_DBI_ACCESS_RESTRICTION_UTRAN_NOT_ALLOWED (1) +#define OGS_DBI_ACCESS_RESTRICTION_GERAN_NOT_ALLOWED (1<<1) +#define OGS_DBI_ACCESS_RESTRICTION_GAN_NOT_ALLOWED (1<<2) +#define OGS_DBI_ACCESS_RESTRICTION_I_HSPA_EVOLUTION_NOT_ALLOWED (1<<3) +#define OGS_DBI_ACCESS_RESTRICTION_WB_E_UTRAN_NOT_ALLOWED (1<<4) +#define OGS_DBI_ACCESS_RESTRICTION_HO_TO_NON_3GPP_ACCESS_NOT_ALLOWED (1<<5) +#define OGS_DBI_ACCESS_RESTRICTION_NB_IOT_NOT_ALLOWED (1<<6) + uint32_t access_restriction_data; +#define OGS_DBI_SUBSCRIBER_STATUS_SERVICE_GRANTED 0 +#define OGS_DBI_SUBSCRIBER_STATUS_OPERATOR_DETERMINED_BARRING 1 + uint32_t subscriber_status; +#define OGS_DBI_NETWORK_ACCESS_MODE_PACKET_AND_CIRCUIT 0 +#define OGS_DBI_NETWORK_ACCESS_MODE_RESERVED 1 +#define OGS_DBI_NETWORK_ACCESS_MODE_ONLY_PACKET 2 + uint32_t network_access_mode; + + ogs_bitrate_t ambr; /* UE-AMBR */ + +#define OGS_DBI_RAU_TAU_DEFAULT_TIME (12*60) /* 12 min */ + uint32_t subscribed_rau_tau_timer; /* unit : seconds */ + + ogs_pdn_t pdn[OGS_MAX_NUM_OF_SESS]; + int num_of_pdn; +} ogs_dbi_subscription_data_t; + +typedef struct ogs_dbi_auth_info_s { + uint8_t k[OGS_KEY_LEN]; + uint8_t use_opc; + uint8_t opc[OGS_KEY_LEN]; + uint8_t op[OGS_KEY_LEN]; + uint8_t amf[OGS_AMF_LEN]; + uint8_t rand[OGS_RAND_LEN]; + uint64_t sqn; +} ogs_dbi_auth_info_t; + +int ogs_dbi_auth_info(const char *id_type, const char *ue_id, + ogs_dbi_auth_info_t *auth_info); +int ogs_dbi_update_sqn(const char *id_type, const char *ue_id, uint64_t sqn); +int ogs_dbi_increment_sqn(const char *id_type, const char *ue_id); + +int ogs_dbi_subscription_data(const char *id_type, const char *ue_id, + ogs_dbi_subscription_data_t *subscription_data); + +#ifdef __cplusplus +} +#endif + +#endif /* OGS_DBI_SUBSCRIPTION_H */ diff --git a/lib/nas/5gs/conv.c b/lib/nas/5gs/conv.c new file mode 100644 index 0000000000..739f29c080 --- /dev/null +++ b/lib/nas/5gs/conv.c @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "ogs-nas-5gs.h" + +void ogs_nas_5gs_imsi_to_bcd( + ogs_nas_5gs_mobile_identity_t *mobile_identity, char *imsi_bcd) +{ + ogs_nas_5gs_mobile_identity_imsi_t *mobile_identity_imsi = NULL; + ogs_plmn_id_t plmn_id; + char tmp[OGS_MAX_IMSI_BCD_LEN+1]; + char *p, *last; + + ogs_assert(mobile_identity); + ogs_assert(imsi_bcd); + + p = imsi_bcd; + last = imsi_bcd + OGS_MAX_IMSI_BCD_LEN + 1; + + mobile_identity_imsi = + (ogs_nas_5gs_mobile_identity_imsi_t *)mobile_identity->buffer; + ogs_assert(mobile_identity_imsi); + + ogs_nas_to_plmn_id(&plmn_id, &mobile_identity_imsi->nas_plmn_id); + if (ogs_plmn_id_mnc_len(&plmn_id) == 2) + p = ogs_slprintf(p, last, "%03d%02d", + ogs_plmn_id_mcc(&plmn_id), ogs_plmn_id_mnc(&plmn_id)); + else + p = ogs_slprintf(p, last, "%03d%03d", + ogs_plmn_id_mcc(&plmn_id), ogs_plmn_id_mnc(&plmn_id)); + + ogs_assert(mobile_identity->length > 8); + ogs_buffer_to_bcd(mobile_identity_imsi->scheme_output, + mobile_identity->length - 8, tmp); + p = ogs_slprintf(p, last, "%s", tmp); +} + +char *ogs_nas_5gs_ueid_from_mobile_identity( + ogs_nas_5gs_mobile_identity_t *mobile_identity) +{ + ogs_nas_5gs_mobile_identity_imsi_t *mobile_identity_imsi = NULL; + ogs_plmn_id_t plmn_id; + char tmp[OGS_MAX_IMSI_BCD_LEN+1]; + char routing_indicator[5]; + char *ueid = NULL; + + ogs_assert(mobile_identity); + + mobile_identity_imsi = + (ogs_nas_5gs_mobile_identity_imsi_t *)mobile_identity->buffer; + ogs_assert(mobile_identity_imsi); + + ueid = ogs_msprintf("suci-%d-", mobile_identity_imsi->h.supi_format); + ogs_assert(ueid); + + ogs_nas_to_plmn_id(&plmn_id, &mobile_identity_imsi->nas_plmn_id); + if (ogs_plmn_id_mnc_len(&plmn_id) == 2) { + ueid = ogs_mstrcatf(ueid, "%03d-%02d-", + ogs_plmn_id_mcc(&plmn_id), ogs_plmn_id_mnc(&plmn_id)); + ogs_assert(ueid); + } else { + ueid = ogs_mstrcatf(ueid, "%03d-%03d-", + ogs_plmn_id_mcc(&plmn_id), ogs_plmn_id_mnc(&plmn_id)); + ogs_assert(ueid); + } + + memset(routing_indicator, 0, sizeof(routing_indicator)); + if (mobile_identity_imsi->routing_indicator1 != 0xf) { + routing_indicator[0] = + mobile_identity_imsi->routing_indicator1 + '0'; + if (mobile_identity_imsi->routing_indicator2 != 0xf) { + routing_indicator[1] = + mobile_identity_imsi->routing_indicator2 + '0'; + if (mobile_identity_imsi->routing_indicator3 != 0xf) { + routing_indicator[2] = + mobile_identity_imsi->routing_indicator3 + '0'; + if (mobile_identity_imsi->routing_indicator4 != 0xf) + routing_indicator[3] = + mobile_identity_imsi->routing_indicator4 + '0'; + } + } + } + + ogs_assert(mobile_identity->length > 8); + ogs_buffer_to_bcd(mobile_identity_imsi->scheme_output, + mobile_identity->length - 8, tmp); + + ueid = ogs_mstrcatf(ueid, "%s-%d-%d-%s", + routing_indicator, + mobile_identity_imsi->protection_scheme_id, + mobile_identity_imsi->home_network_pki_value, + tmp); + + return ueid; +} diff --git a/lib/nas/5gs/conv.h b/lib/nas/5gs/conv.h new file mode 100644 index 0000000000..2e2e7688b3 --- /dev/null +++ b/lib/nas/5gs/conv.h @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#if !defined(OGS_NAS_INSIDE) && !defined(OGS_NAS_COMPILATION) +#error "This header cannot be included directly." +#endif + +#ifndef OGS_NAS_5GS_CONV_H +#define OGS_NAS_5GS_CONV_H + +#include "ogs-nas-common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void ogs_nas_5gs_imsi_to_bcd( + ogs_nas_5gs_mobile_identity_t *mobile_identity, char *bcd); + +char *ogs_nas_5gs_ueid_from_mobile_identity( + ogs_nas_5gs_mobile_identity_t *mobile_identity); + +#ifdef __cplusplus +} +#endif + +#endif /* OGS_NAS_5GS_CONV_H */ + diff --git a/lib/nas/5gs/decoder.c b/lib/nas/5gs/decoder.c index 8bfdb7ab37..aa190539bc 100644 --- a/lib/nas/5gs/decoder.c +++ b/lib/nas/5gs/decoder.c @@ -28,7 +28,7 @@ /******************************************************************************* * This file had been created by nas-message.py script v0.2.0 * Please do not modify this file but regenerate it via script. - * Created on: 2020-05-24 17:29:31.606634 by acetcom + * Created on: 2020-06-03 23:05:14.877346 by acetcom * from 24501-g41.docx ******************************************************************************/ diff --git a/lib/nas/5gs/encoder.c b/lib/nas/5gs/encoder.c index 240f481451..1dc2543698 100644 --- a/lib/nas/5gs/encoder.c +++ b/lib/nas/5gs/encoder.c @@ -28,7 +28,7 @@ /******************************************************************************* * This file had been created by nas-message.py script v0.2.0 * Please do not modify this file but regenerate it via script. - * Created on: 2020-05-24 17:29:31.617845 by acetcom + * Created on: 2020-06-03 23:05:14.888322 by acetcom * from 24501-g41.docx ******************************************************************************/ @@ -3177,10 +3177,10 @@ ogs_pkbuf_t *ogs_nas_5gs_plain_encode(ogs_nas_5gs_message_t *message) message->gsm.h.extended_protocol_discriminator); if (message->gmm.h.extended_protocol_discriminator == - OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_EMM) + OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM) return ogs_nas_5gmm_encode(message); else if (message->gmm.h.extended_protocol_discriminator == - OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_ESM) + OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GSM) return ogs_nas_5gsm_encode(message); return NULL; diff --git a/lib/nas/5gs/ies.c b/lib/nas/5gs/ies.c index 355ffc1b12..091dd5bb2b 100644 --- a/lib/nas/5gs/ies.c +++ b/lib/nas/5gs/ies.c @@ -28,7 +28,7 @@ /******************************************************************************* * This file had been created by nas-message.py script v0.2.0 * Please do not modify this file but regenerate it via script. - * Created on: 2020-05-24 17:29:31.588956 by acetcom + * Created on: 2020-06-03 23:05:14.860106 by acetcom * from 24501-g41.docx ******************************************************************************/ @@ -630,12 +630,15 @@ int ogs_nas_5gs_encode_authentication_response_parameter(ogs_pkbuf_t *pkbuf, ogs * O TV 1 */ int ogs_nas_5gs_decode_configuration_update_indication(ogs_nas_configuration_update_indication_t *configuration_update_indication, ogs_pkbuf_t *pkbuf) { - memcpy(configuration_update_indication, pkbuf->data - 1, 1); + uint16_t size = sizeof(ogs_nas_configuration_update_indication_t); + + ogs_assert(ogs_pkbuf_pull(pkbuf, size)); + memcpy(configuration_update_indication, pkbuf->data - size, size); ogs_trace(" CONFIGURATION_UPDATE_INDICATION - "); - ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - 1, 1); + ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - size, size); - return 0; + return size; } int ogs_nas_5gs_encode_configuration_update_indication(ogs_pkbuf_t *pkbuf, ogs_nas_configuration_update_indication_t *configuration_update_indication) @@ -1113,12 +1116,15 @@ int ogs_nas_5gs_encode_extended_drx_parameters(ogs_pkbuf_t *pkbuf, ogs_nas_exten * O TV 1 */ int ogs_nas_5gs_decode_imeisv_request(ogs_nas_imeisv_request_t *imeisv_request, ogs_pkbuf_t *pkbuf) { - memcpy(imeisv_request, pkbuf->data - 1, 1); + uint16_t size = sizeof(ogs_nas_imeisv_request_t); + + ogs_assert(ogs_pkbuf_pull(pkbuf, size)); + memcpy(imeisv_request, pkbuf->data - size, size); ogs_trace(" IMEISV_REQUEST - "); - ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - 1, 1); + ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - size, size); - return 0; + return size; } int ogs_nas_5gs_encode_imeisv_request(ogs_pkbuf_t *pkbuf, ogs_nas_imeisv_request_t *imeisv_request) @@ -1286,12 +1292,15 @@ int ogs_nas_5gs_encode_ladn_information(ogs_pkbuf_t *pkbuf, ogs_nas_ladn_informa * O TV 1 */ int ogs_nas_5gs_decode_mico_indication(ogs_nas_mico_indication_t *mico_indication, ogs_pkbuf_t *pkbuf) { - memcpy(mico_indication, pkbuf->data - 1, 1); + uint16_t size = sizeof(ogs_nas_mico_indication_t); + + ogs_assert(ogs_pkbuf_pull(pkbuf, size)); + memcpy(mico_indication, pkbuf->data - size, size); ogs_trace(" MICO_INDICATION - "); - ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - 1, 1); + ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - size, size); - return 0; + return size; } int ogs_nas_5gs_encode_mico_indication(ogs_pkbuf_t *pkbuf, ogs_nas_mico_indication_t *mico_indication) @@ -1311,12 +1320,15 @@ int ogs_nas_5gs_encode_mico_indication(ogs_pkbuf_t *pkbuf, ogs_nas_mico_indicati * O TV 1 */ int ogs_nas_5gs_decode_ma_pdu_session_information(ogs_nas_ma_pdu_session_information_t *ma_pdu_session_information, ogs_pkbuf_t *pkbuf) { - memcpy(ma_pdu_session_information, pkbuf->data - 1, 1); + uint16_t size = sizeof(ogs_nas_ma_pdu_session_information_t); + + ogs_assert(ogs_pkbuf_pull(pkbuf, size)); + memcpy(ma_pdu_session_information, pkbuf->data - size, size); ogs_trace(" MA_PDU_SESSION_INFORMATION - "); - ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - 1, 1); + ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - size, size); - return 0; + return size; } int ogs_nas_5gs_encode_ma_pdu_session_information(ogs_pkbuf_t *pkbuf, ogs_nas_ma_pdu_session_information_t *ma_pdu_session_information) @@ -1404,12 +1416,15 @@ int ogs_nas_5gs_encode_mobile_station_classmark_2(ogs_pkbuf_t *pkbuf, ogs_nas_mo * O TV 1 */ int ogs_nas_5gs_decode_key_set_identifier(ogs_nas_key_set_identifier_t *key_set_identifier, ogs_pkbuf_t *pkbuf) { - memcpy(key_set_identifier, pkbuf->data - 1, 1); + uint16_t size = sizeof(ogs_nas_key_set_identifier_t); + + ogs_assert(ogs_pkbuf_pull(pkbuf, size)); + memcpy(key_set_identifier, pkbuf->data - size, size); ogs_trace(" KEY_SET_IDENTIFIER - "); - ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - 1, 1); + ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - size, size); - return 0; + return size; } int ogs_nas_5gs_encode_key_set_identifier(ogs_pkbuf_t *pkbuf, ogs_nas_key_set_identifier_t *key_set_identifier) @@ -1535,12 +1550,15 @@ int ogs_nas_5gs_encode_network_name(ogs_pkbuf_t *pkbuf, ogs_nas_network_name_t * * O TV 1 */ int ogs_nas_5gs_decode_network_slicing_indication(ogs_nas_network_slicing_indication_t *network_slicing_indication, ogs_pkbuf_t *pkbuf) { - memcpy(network_slicing_indication, pkbuf->data - 1, 1); + uint16_t size = sizeof(ogs_nas_network_slicing_indication_t); + + ogs_assert(ogs_pkbuf_pull(pkbuf, size)); + memcpy(network_slicing_indication, pkbuf->data - size, size); ogs_trace(" NETWORK_SLICING_INDICATION - "); - ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - 1, 1); + ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - size, size); - return 0; + return size; } int ogs_nas_5gs_encode_network_slicing_indication(ogs_pkbuf_t *pkbuf, ogs_nas_network_slicing_indication_t *network_slicing_indication) @@ -1560,12 +1578,15 @@ int ogs_nas_5gs_encode_network_slicing_indication(ogs_pkbuf_t *pkbuf, ogs_nas_ne * O TV 1 */ int ogs_nas_5gs_decode_non_3gpp_nw_provided_policies(ogs_nas_non_3gpp_nw_provided_policies_t *non_3gpp_nw_provided_policies, ogs_pkbuf_t *pkbuf) { - memcpy(non_3gpp_nw_provided_policies, pkbuf->data - 1, 1); + uint16_t size = sizeof(ogs_nas_non_3gpp_nw_provided_policies_t); + + ogs_assert(ogs_pkbuf_pull(pkbuf, size)); + memcpy(non_3gpp_nw_provided_policies, pkbuf->data - size, size); ogs_trace(" NON_3GPP_NW_PROVIDED_POLICIES - "); - ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - 1, 1); + ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - size, size); - return 0; + return size; } int ogs_nas_5gs_encode_non_3gpp_nw_provided_policies(ogs_pkbuf_t *pkbuf, ogs_nas_non_3gpp_nw_provided_policies_t *non_3gpp_nw_provided_policies) @@ -1619,12 +1640,15 @@ int ogs_nas_5gs_encode_nssai(ogs_pkbuf_t *pkbuf, ogs_nas_nssai_t *nssai) * O TV 1 */ int ogs_nas_5gs_decode_nssai_inclusion_mode(ogs_nas_nssai_inclusion_mode_t *nssai_inclusion_mode, ogs_pkbuf_t *pkbuf) { - memcpy(nssai_inclusion_mode, pkbuf->data - 1, 1); + uint16_t size = sizeof(ogs_nas_nssai_inclusion_mode_t); + + ogs_assert(ogs_pkbuf_pull(pkbuf, size)); + memcpy(nssai_inclusion_mode, pkbuf->data - size, size); ogs_trace(" NSSAI_INCLUSION_MODE - "); - ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - 1, 1); + ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - size, size); - return 0; + return size; } int ogs_nas_5gs_encode_nssai_inclusion_mode(ogs_pkbuf_t *pkbuf, ogs_nas_nssai_inclusion_mode_t *nssai_inclusion_mode) @@ -1731,57 +1755,54 @@ int ogs_nas_5gs_decode_5gs_mobile_identity(ogs_nas_5gs_mobile_identity_t *mobile uint16_t size = 0; ogs_nas_5gs_mobile_identity_t *source = (ogs_nas_5gs_mobile_identity_t *)pkbuf->data; - mobile_identity->length = source->length; + mobile_identity->length = be16toh(source->length); size = mobile_identity->length + sizeof(mobile_identity->length); ogs_assert(ogs_pkbuf_pull(pkbuf, size)); - memcpy(mobile_identity, pkbuf->data - size, size); - - if (mobile_identity->guti.type == OGS_NAS_5GS_MOBILE_IDENTITY_GUTI) { - mobile_identity->guti.m_tmsi = be32toh(mobile_identity->guti.m_tmsi); - } else if (mobile_identity->s_tmsi.type == OGS_NAS_5GS_MOBILE_IDENTITY_S_TMSI) { - mobile_identity->s_tmsi.m_tmsi = be32toh(mobile_identity->s_tmsi.m_tmsi); - } + mobile_identity->buffer = pkbuf->data - size + sizeof(mobile_identity->length); ogs_trace(" 5GS_MOBILE_IDENTITY - "); - ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - size, size); + ogs_log_hexdump(OGS_LOG_TRACE, (void*)mobile_identity->buffer, mobile_identity->length); return size; } int ogs_nas_5gs_encode_5gs_mobile_identity(ogs_pkbuf_t *pkbuf, ogs_nas_5gs_mobile_identity_t *mobile_identity) { - uint16_t size = mobile_identity->length + sizeof(mobile_identity->length); - ogs_nas_5gs_mobile_identity_t target; + uint16_t size = 0; + uint16_t target; - memcpy(&target, mobile_identity, sizeof(ogs_nas_5gs_mobile_identity_t)); - if (mobile_identity->guti.type == OGS_NAS_5GS_MOBILE_IDENTITY_GUTI) { - target.guti.m_tmsi = htobe32(mobile_identity->guti.m_tmsi); - target.guti._0xf = 0xf; - } else if (mobile_identity->s_tmsi.type == OGS_NAS_5GS_MOBILE_IDENTITY_S_TMSI) { - target.s_tmsi.m_tmsi = htobe32(mobile_identity->s_tmsi.m_tmsi); - target.s_tmsi._0xf = 0xf; - } + ogs_assert(mobile_identity); + ogs_assert(mobile_identity->buffer); + size = sizeof(mobile_identity->length); ogs_assert(ogs_pkbuf_pull(pkbuf, size)); + target = htobe16(mobile_identity->length); memcpy(pkbuf->data - size, &target, size); + size = mobile_identity->length; + ogs_assert(ogs_pkbuf_pull(pkbuf, size)); + memcpy(pkbuf->data - size, mobile_identity->buffer, size); + ogs_trace(" 5GS_MOBILE_IDENTITY - "); ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - size, size); - return size; + return mobile_identity->length + sizeof(mobile_identity->length); } /* 9.11.3.40 Payload container type * O TV 1 */ int ogs_nas_5gs_decode_payload_container_type(ogs_nas_payload_container_type_t *payload_container_type, ogs_pkbuf_t *pkbuf) { - memcpy(payload_container_type, pkbuf->data - 1, 1); + uint16_t size = sizeof(ogs_nas_payload_container_type_t); + + ogs_assert(ogs_pkbuf_pull(pkbuf, size)); + memcpy(payload_container_type, pkbuf->data - size, size); ogs_trace(" PAYLOAD_CONTAINER_TYPE - "); - ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - 1, 1); + ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - size, size); - return 0; + return size; } int ogs_nas_5gs_encode_payload_container_type(ogs_pkbuf_t *pkbuf, ogs_nas_payload_container_type_t *payload_container_type) @@ -2009,12 +2030,15 @@ int ogs_nas_5gs_encode_rejected_nssai(ogs_pkbuf_t *pkbuf, ogs_nas_rejected_nssai * O TV 1 */ int ogs_nas_5gs_decode_release_assistance_indication(ogs_nas_release_assistance_indication_t *release_assistance_indication, ogs_pkbuf_t *pkbuf) { - memcpy(release_assistance_indication, pkbuf->data - 1, 1); + uint16_t size = sizeof(ogs_nas_release_assistance_indication_t); + + ogs_assert(ogs_pkbuf_pull(pkbuf, size)); + memcpy(release_assistance_indication, pkbuf->data - size, size); ogs_trace(" RELEASE_ASSISTANCE_INDICATION - "); - ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - 1, 1); + ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - size, size); - return 0; + return size; } int ogs_nas_5gs_encode_release_assistance_indication(ogs_pkbuf_t *pkbuf, ogs_nas_release_assistance_indication_t *release_assistance_indication) @@ -2034,12 +2058,15 @@ int ogs_nas_5gs_encode_release_assistance_indication(ogs_pkbuf_t *pkbuf, ogs_nas * O TV 1 */ int ogs_nas_5gs_decode_request_type(ogs_nas_request_type_t *request_type, ogs_pkbuf_t *pkbuf) { - memcpy(request_type, pkbuf->data - 1, 1); + uint16_t size = sizeof(ogs_nas_request_type_t); + + ogs_assert(ogs_pkbuf_pull(pkbuf, size)); + memcpy(request_type, pkbuf->data - size, size); ogs_trace(" REQUEST_TYPE - "); - ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - 1, 1); + ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - size, size); - return 0; + return size; } int ogs_nas_5gs_encode_request_type(ogs_pkbuf_t *pkbuf, ogs_nas_request_type_t *request_type) @@ -2195,12 +2222,15 @@ int ogs_nas_5gs_encode_5gs_network_feature_support(ogs_pkbuf_t *pkbuf, ogs_nas_5 * O TV 1 */ int ogs_nas_5gs_decode_sms_indication(ogs_nas_sms_indication_t *sms_indication, ogs_pkbuf_t *pkbuf) { - memcpy(sms_indication, pkbuf->data - 1, 1); + uint16_t size = sizeof(ogs_nas_sms_indication_t); + + ogs_assert(ogs_pkbuf_pull(pkbuf, size)); + memcpy(sms_indication, pkbuf->data - size, size); ogs_trace(" SMS_INDICATION - "); - ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - 1, 1); + ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - size, size); - return 0; + return size; } int ogs_nas_5gs_encode_sms_indication(ogs_pkbuf_t *pkbuf, ogs_nas_sms_indication_t *sms_indication) @@ -2560,12 +2590,15 @@ int ogs_nas_5gs_encode_ue_radio_capability_id(ogs_pkbuf_t *pkbuf, ogs_nas_ue_rad * O TV 1 */ int ogs_nas_5gs_decode_ue_radio_capability_id_deletion_indication(ogs_nas_ue_radio_capability_id_deletion_indication_t *ue_radio_capability_id_deletion_indication, ogs_pkbuf_t *pkbuf) { - memcpy(ue_radio_capability_id_deletion_indication, pkbuf->data - 1, 1); + uint16_t size = sizeof(ogs_nas_ue_radio_capability_id_deletion_indication_t); + + ogs_assert(ogs_pkbuf_pull(pkbuf, size)); + memcpy(ue_radio_capability_id_deletion_indication, pkbuf->data - size, size); ogs_trace(" UE_RADIO_CAPABILITY_ID_DELETION_INDICATION - "); - ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - 1, 1); + ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - size, size); - return 0; + return size; } int ogs_nas_5gs_encode_ue_radio_capability_id_deletion_indication(ogs_pkbuf_t *pkbuf, ogs_nas_ue_radio_capability_id_deletion_indication_t *ue_radio_capability_id_deletion_indication) @@ -2683,12 +2716,15 @@ int ogs_nas_5gs_encode_wus_assistance_information(ogs_pkbuf_t *pkbuf, ogs_nas_wu * O T 1 */ int ogs_nas_5gs_decode_n5gc_indication(ogs_nas_n5gc_indication_t *n5gc_indication, ogs_pkbuf_t *pkbuf) { - memcpy(n5gc_indication, pkbuf->data - 1, 1); + uint16_t size = sizeof(ogs_nas_n5gc_indication_t); + + ogs_assert(ogs_pkbuf_pull(pkbuf, size)); + memcpy(n5gc_indication, pkbuf->data - size, size); ogs_trace(" N5GC_INDICATION - "); - ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - 1, 1); + ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - size, size); - return 0; + return size; } int ogs_nas_5gs_encode_n5gc_indication(ogs_pkbuf_t *pkbuf, ogs_nas_n5gc_indication_t *n5gc_indication) @@ -2878,12 +2914,15 @@ int ogs_nas_5gs_encode_pdu_address(ogs_pkbuf_t *pkbuf, ogs_nas_pdu_address_t *pd * O TV 1 */ int ogs_nas_5gs_decode_pdu_session_type(ogs_nas_pdu_session_type_t *pdu_session_type, ogs_pkbuf_t *pkbuf) { - memcpy(pdu_session_type, pkbuf->data - 1, 1); + uint16_t size = sizeof(ogs_nas_pdu_session_type_t); + + ogs_assert(ogs_pkbuf_pull(pkbuf, size)); + memcpy(pdu_session_type, pkbuf->data - size, size); ogs_trace(" PDU_SESSION_TYPE - "); - ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - 1, 1); + ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - size, size); - return 0; + return size; } int ogs_nas_5gs_encode_pdu_session_type(ogs_pkbuf_t *pkbuf, ogs_nas_pdu_session_type_t *pdu_session_type) @@ -3055,12 +3094,15 @@ int ogs_nas_5gs_encode_sm_pdu_dn_request_container(ogs_pkbuf_t *pkbuf, ogs_nas_s * O TV 1 */ int ogs_nas_5gs_decode_ssc_mode(ogs_nas_ssc_mode_t *ssc_mode, ogs_pkbuf_t *pkbuf) { - memcpy(ssc_mode, pkbuf->data - 1, 1); + uint16_t size = sizeof(ogs_nas_ssc_mode_t); + + ogs_assert(ogs_pkbuf_pull(pkbuf, size)); + memcpy(ssc_mode, pkbuf->data - size, size); ogs_trace(" SSC_MODE - "); - ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - 1, 1); + ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - size, size); - return 0; + return size; } int ogs_nas_5gs_encode_ssc_mode(ogs_pkbuf_t *pkbuf, ogs_nas_ssc_mode_t *ssc_mode) @@ -3288,12 +3330,15 @@ int ogs_nas_5gs_encode_atsss_container(ogs_pkbuf_t *pkbuf, ogs_nas_atsss_contain * O TV 1 */ int ogs_nas_5gs_decode_control_plane_only_indication(ogs_nas_control_plane_only_indication_t *control_plane_only_indication, ogs_pkbuf_t *pkbuf) { - memcpy(control_plane_only_indication, pkbuf->data - 1, 1); + uint16_t size = sizeof(ogs_nas_control_plane_only_indication_t); + + ogs_assert(ogs_pkbuf_pull(pkbuf, size)); + memcpy(control_plane_only_indication, pkbuf->data - size, size); ogs_trace(" CONTROL_PLANE_ONLY_INDICATION - "); - ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - 1, 1); + ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - size, size); - return 0; + return size; } int ogs_nas_5gs_encode_control_plane_only_indication(ogs_pkbuf_t *pkbuf, ogs_nas_control_plane_only_indication_t *control_plane_only_indication) @@ -3461,12 +3506,15 @@ int ogs_nas_5gs_encode_port_management_information_container(ogs_pkbuf_t *pkbuf, * O TV 1 */ int ogs_nas_5gs_decode_always_on_pdu_session_indication(ogs_nas_always_on_pdu_session_indication_t *always_on_pdu_session_indication, ogs_pkbuf_t *pkbuf) { - memcpy(always_on_pdu_session_indication, pkbuf->data - 1, 1); + uint16_t size = sizeof(ogs_nas_always_on_pdu_session_indication_t); + + ogs_assert(ogs_pkbuf_pull(pkbuf, size)); + memcpy(always_on_pdu_session_indication, pkbuf->data - size, size); ogs_trace(" ALWAYS_ON_PDU_SESSION_INDICATION - "); - ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - 1, 1); + ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - size, size); - return 0; + return size; } int ogs_nas_5gs_encode_always_on_pdu_session_indication(ogs_pkbuf_t *pkbuf, ogs_nas_always_on_pdu_session_indication_t *always_on_pdu_session_indication) @@ -3486,12 +3534,15 @@ int ogs_nas_5gs_encode_always_on_pdu_session_indication(ogs_pkbuf_t *pkbuf, ogs_ * O TV 1 */ int ogs_nas_5gs_decode_always_on_pdu_session_requested(ogs_nas_always_on_pdu_session_requested_t *always_on_pdu_session_requested, ogs_pkbuf_t *pkbuf) { - memcpy(always_on_pdu_session_requested, pkbuf->data - 1, 1); + uint16_t size = sizeof(ogs_nas_always_on_pdu_session_requested_t); + + ogs_assert(ogs_pkbuf_pull(pkbuf, size)); + memcpy(always_on_pdu_session_requested, pkbuf->data - size, size); ogs_trace(" ALWAYS_ON_PDU_SESSION_REQUESTED - "); - ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - 1, 1); + ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - size, size); - return 0; + return size; } int ogs_nas_5gs_encode_always_on_pdu_session_requested(ogs_pkbuf_t *pkbuf, ogs_nas_always_on_pdu_session_requested_t *always_on_pdu_session_requested) @@ -3511,12 +3562,15 @@ int ogs_nas_5gs_encode_always_on_pdu_session_requested(ogs_pkbuf_t *pkbuf, ogs_n * O TV 1 */ int ogs_nas_5gs_decode_allowed_ssc_mode(ogs_nas_allowed_ssc_mode_t *allowed_ssc_mode, ogs_pkbuf_t *pkbuf) { - memcpy(allowed_ssc_mode, pkbuf->data - 1, 1); + uint16_t size = sizeof(ogs_nas_allowed_ssc_mode_t); + + ogs_assert(ogs_pkbuf_pull(pkbuf, size)); + memcpy(allowed_ssc_mode, pkbuf->data - size, size); ogs_trace(" ALLOWED_SSC_MODE - "); - ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - 1, 1); + ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - size, size); - return 0; + return size; } int ogs_nas_5gs_encode_allowed_ssc_mode(ogs_pkbuf_t *pkbuf, ogs_nas_allowed_ssc_mode_t *allowed_ssc_mode) diff --git a/lib/nas/5gs/ies.h b/lib/nas/5gs/ies.h index 654907a622..3193c60f87 100644 --- a/lib/nas/5gs/ies.h +++ b/lib/nas/5gs/ies.h @@ -28,7 +28,7 @@ /******************************************************************************* * This file had been created by nas-message.py script v0.2.0 * Please do not modify this file but regenerate it via script. - * Created on: 2020-05-24 17:29:31.586197 by acetcom + * Created on: 2020-06-03 23:05:14.857252 by acetcom * from 24501-g41.docx ******************************************************************************/ diff --git a/lib/nas/5gs/meson.build b/lib/nas/5gs/meson.build index 6c49c5ef4a..bc5a78de0a 100644 --- a/lib/nas/5gs/meson.build +++ b/lib/nas/5gs/meson.build @@ -1,4 +1,4 @@ -# Copyright (C) 2019 by Sukchan Lee +# Copyright (C) 2019,2020 by Sukchan Lee # This file is part of Open5GS. @@ -17,6 +17,7 @@ libnas_5gs_sources = files(''' types.c + conv.c ies.c decoder.c encoder.c diff --git a/lib/nas/5gs/message.h b/lib/nas/5gs/message.h index c72ba73674..a5844b867f 100644 --- a/lib/nas/5gs/message.h +++ b/lib/nas/5gs/message.h @@ -28,7 +28,7 @@ /******************************************************************************* * This file had been created by nas-message.py script v0.2.0 * Please do not modify this file but regenerate it via script. - * Created on: 2020-05-24 17:29:31.598549 by acetcom + * Created on: 2020-06-03 23:05:14.869400 by acetcom * from 24501-g41.docx ******************************************************************************/ @@ -43,8 +43,8 @@ extern "C" { #endif -#define OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_ESM 0x2e -#define OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_EMM 0x7e +#define OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GSM 0x2e +#define OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM 0x7e #define OGS_NAS_PDU_SESSION_IDENTITY_UNASSIGNED 0 diff --git a/lib/nas/5gs/ogs-nas-5gs.h b/lib/nas/5gs/ogs-nas-5gs.h index ecc6b1bab5..457cd5149f 100644 --- a/lib/nas/5gs/ogs-nas-5gs.h +++ b/lib/nas/5gs/ogs-nas-5gs.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019,2020 by Sukchan Lee * * This file is part of Open5GS. * @@ -25,6 +25,7 @@ #define OGS_NAS_INSIDE #include "nas/5gs/types.h" +#include "nas/5gs/conv.h" #include "nas/5gs/ies.h" #include "nas/5gs/message.h" diff --git a/lib/nas/5gs/support/nas-message.py b/lib/nas/5gs/support/nas-message.py index db81b137ca..664c21248a 100644 --- a/lib/nas/5gs/support/nas-message.py +++ b/lib/nas/5gs/support/nas-message.py @@ -385,10 +385,14 @@ for (k, v) in sorted_type_list: if (type_list[k]["format"] == "TV" or type_list[k]["format"] == "T") and type_list[k]["length"] == "1": f.write("int ogs_nas_5gs_decode_%s(ogs_nas_%s_t *%s, ogs_pkbuf_t *pkbuf)\n" % (v_lower(k), v_lower(k), get_value(k))) f.write("{\n") - f.write(" memcpy(%s, pkbuf->data - 1, 1);\n\n" % get_value(k)) + f.write(" uint16_t size = sizeof(ogs_nas_%s_t);\n\n" % v_lower(k)) + f.write(" ogs_assert(ogs_pkbuf_pull(pkbuf, size));\n") + f.write(" memcpy(%s, pkbuf->data - size, size);\n\n" % get_value(k)) + if "decode" in type_list[k]: + f.write("%s" % type_list[k]["decode"]) f.write(" ogs_trace(\" %s - \");\n" % v_upper(k)) - f.write(" ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - 1, 1);\n\n"); - f.write(" return 0;\n") + f.write(" ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - size, size);\n\n"); + f.write(" return size;\n") f.write("}\n\n") f.write("int ogs_nas_5gs_encode_%s(ogs_pkbuf_t *pkbuf, ogs_nas_%s_t *%s)\n" % (v_lower(k), v_lower(k), get_value(k))) f.write("{\n") @@ -430,7 +434,7 @@ for (k, v) in sorted_type_list: f.write(" ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - size, size);\n\n"); f.write(" return size;\n") f.write("}\n\n") - elif (type_list[k]["format"] == "LV-E" or type_list[k]["format"] == "TLV-E") and type_list[k]["value"] != "5GS mobile identity": + elif type_list[k]["format"] == "LV-E" or type_list[k]["format"] == "TLV-E": f.write("int ogs_nas_5gs_decode_%s(ogs_nas_%s_t *%s, ogs_pkbuf_t *pkbuf)\n" % (v_lower(k), v_lower(k), get_value(k))) f.write("{\n") f.write(" uint16_t size = 0;\n") @@ -503,8 +507,8 @@ f.write("""#if !defined(OGS_NAS_INSIDE) && !defined(OGS_NAS_COMPILATION) extern "C" { #endif -#define OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_ESM 0x2e -#define OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_EMM 0x7e +#define OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GSM 0x2e +#define OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM 0x7e #define OGS_NAS_PDU_SESSION_IDENTITY_UNASSIGNED 0 @@ -939,10 +943,10 @@ ogs_pkbuf_t *ogs_nas_5gs_plain_encode(ogs_nas_5gs_message_t *message) message->gsm.h.extended_protocol_discriminator); if (message->gmm.h.extended_protocol_discriminator == - OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_EMM) + OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM) return ogs_nas_5gmm_encode(message); else if (message->gmm.h.extended_protocol_discriminator == - OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_ESM) + OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GSM) return ogs_nas_5gsm_encode(message); return NULL; diff --git a/lib/nas/5gs/support/type-list.py b/lib/nas/5gs/support/type-list.py index 599f3eb613..999784196a 100644 --- a/lib/nas/5gs/support/type-list.py +++ b/lib/nas/5gs/support/type-list.py @@ -21,21 +21,6 @@ type_list["5GS tracking area identity"]["decode"] = \ type_list["5GS tracking area identity"]["encode"] = \ " target.tac = ogs_htobe24(tracking_area_identity->tac);\n\n" -type_list["5GS mobile identity"]["decode"] = \ -" if (mobile_identity->guti.type == OGS_NAS_5GS_MOBILE_IDENTITY_GUTI) {\n" \ -" mobile_identity->guti.m_tmsi = be32toh(mobile_identity->guti.m_tmsi);\n" \ -" } else if (mobile_identity->s_tmsi.type == OGS_NAS_5GS_MOBILE_IDENTITY_S_TMSI) {\n" \ -" mobile_identity->s_tmsi.m_tmsi = be32toh(mobile_identity->s_tmsi.m_tmsi);\n" \ -" }\n\n" -type_list["5GS mobile identity"]["encode"] = \ -" if (mobile_identity->guti.type == OGS_NAS_5GS_MOBILE_IDENTITY_GUTI) {\n" \ -" target.guti.m_tmsi = htobe32(mobile_identity->guti.m_tmsi);\n" \ -" target.guti._0xf = 0xf;\n" \ -" } else if (mobile_identity->s_tmsi.type == OGS_NAS_5GS_MOBILE_IDENTITY_S_TMSI) {\n" \ -" target.s_tmsi.m_tmsi = htobe32(mobile_identity->s_tmsi.m_tmsi);\n" \ -" target.s_tmsi._0xf = 0xf;\n" \ -" }\n\n" - type_list["Header compression configuration"]["decode"] = \ " header_compression_configuration->max_cid = be16toh(header_compression_configuration->max_cid);\n\n" type_list["Header compression configuration"]["encode"] = \ diff --git a/lib/nas/5gs/types.h b/lib/nas/5gs/types.h index 73dd7a5c2e..57dc6eb6f8 100644 --- a/lib/nas/5gs/types.h +++ b/lib/nas/5gs/types.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019,2020 by Sukchan Lee * * This file is part of Open5GS. * @@ -67,49 +67,49 @@ typedef struct ogs_nas_s_nssai_s { typedef struct ogs_nas_5gmm_capability_s { uint8_t length; ED4(uint8_t spare:5;, - uint8_t lpp:1;, - uint8_t ho:1;, - uint8_t s1:1;) + uint8_t lte_positioning_protocol_capability:1;, + uint8_t ho_attach:1;, + uint8_t s1_mode:1;) } __attribute__ ((packed)) ogs_nas_5gmm_capability_t; /* 9.11.3.2 5GMM cause * M V 1 */ -#define OGS_NAS_GMM_ILLEGAL_UE 3 -#define OGS_NAS_GMM_PEI_NOT_ACCEPTED 5 -#define OGS_NAS_GMM_ILLEGAL_ME 6 -#define OGS_NAS_GMM_5GS_SERVICES_NOT_ALLOWED 7 -#define OGS_NAS_GMM_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK 9 -#define OGS_NAS_GMM_IMPLICITLY_DE_REGISTERED 10 -#define OGS_NAS_GMM_PLMN_NOT_ALLOWED 11 -#define OGS_NAS_GMM_TRACKING_AREA_NOT_ALLOWED 12 -#define OGS_NAS_GMM_ROAMING_NOT_ALLOWED_IN_THIS_TRACKING_AREA 13 -#define OGS_NAS_GMM_NO_SUITABLE_CELLS_IN_TRACKING_AREA 15 -#define OGS_NAS_GMM_MAC_FAILURE 20 -#define OGS_NAS_GMM_SYNCH_FAILURE 21 -#define OGS_NAS_GMM_CONGESTION 22 -#define OGS_NAS_GMM_UE_SECURITY_CAPABILITIES_MISMATCH 23 -#define OGS_NAS_GMM_SECURITY_MODE_REJECTED_UNSPECIFIED 24 -#define OGS_NAS_GMM_NON_5G_AUTHENTICATION_UNACCEPTABLE 26 -#define OGS_NAS_GMM_N1_MODE_NOT_ALLOWED 27 -#define OGS_NAS_GMM_RESTRICTED_SERVICE_AREA 28 -#define OGS_NAS_GMM_LADN_NOT_AVAILABLE 43 -#define OGS_NAS_GMM_MAXIMUM_NUMBER_OF_PDU_SESSIONS_REACHED 65 -#define OGS_NAS_GMM_INSUFFICIENT_RESOURCES_FOR_SPECIFIC_SLICE_AND_DNN 67 -#define OGS_NAS_GMM_INSUFFICIENT_RESOURCES_FOR_SPECIFIC_SLICE 69 -#define OGS_NAS_GMM_NGKSI_ALREADY_IN_USE 71 -#define OGS_NAS_GMM_NON_3GPP_ACCESS_TO_5GCN_NOT_ALLOWED 72 -#define OGS_NAS_GMM_SERVING_NETWORK_NOT_AUTHORIZED 73 -#define OGS_NAS_GMM_PAYLOAD_WAS_NOT_FORWARDED 90 -#define OGS_NAS_GMM_DNN_NOT_SUPPORTED_OR_NOT_SUBSCRIBED_IN_THE_SLICE 91 -#define OGS_NAS_GMM_INSUFFICIENT_USER_PLANE_RESOURCES_FOR_THE_PDU_SESSION 92 -#define OGS_NAS_GMM_SEMANTICALLY_INCORRECT_MESSAGE 95 -#define OGS_NAS_GMM_INVALID_MANDATORY_INFORMATION 96 -#define OGS_NAS_GMM_MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED 97 -#define OGS_NAS_GMM_MESSAGE_TYPE_NOT_COMPATIBLE_WITH_THE_PROTOCOL_STATE 98 -#define OGS_NAS_GMM_INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED 99 -#define OGS_NAS_GMM_CONDITIONAL_IE_ERROR 100 -#define OGS_NAS_GMM_MESSAGE_NOT_COMPATIBLE_WITH_THE_PROTOCOL_STATE 101 -#define OGS_NAS_GMM_PROTOCOL_ERROR_UNSPECIFIED 111 +#define OGS_5GMM_CAUSE_ILLEGAL_UE 3 +#define OGS_5GMM_CAUSE_PEI_NOT_ACCEPTED 5 +#define OGS_5GMM_CAUSE_ILLEGAL_ME 6 +#define OGS_5GMM_CAUSE_5GS_SERVICES_NOT_ALLOWED 7 +#define OGS_5GMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK 9 +#define OGS_5GMM_CAUSE_IMPLICITLY_DE_REGISTERED 10 +#define OGS_5GMM_CAUSE_PLMN_NOT_ALLOWED 11 +#define OGS_5GMM_CAUSE_TRACKING_AREA_NOT_ALLOWED 12 +#define OGS_5GMM_CAUSE_ROAMING_NOT_ALLOWED_IN_THIS_TRACKING_AREA 13 +#define OGS_5GMM_CAUSE_NO_SUITABLE_CELLS_IN_TRACKING_AREA 15 +#define OGS_5GMM_CAUSE_MAC_FAILURE 20 +#define OGS_5GMM_CAUSE_SYNCH_FAILURE 21 +#define OGS_5GMM_CAUSE_CONGESTION 22 +#define OGS_5GMM_CAUSE_UE_SECURITY_CAPABILITIES_MISMATCH 23 +#define OGS_5GMM_CAUSE_SECURITY_MODE_REJECTED_UNSPECIFIED 24 +#define OGS_5GMM_CAUSE_NON_5G_AUTHENTICATION_UNACCEPTABLE 26 +#define OGS_5GMM_CAUSE_N1_MODE_NOT_ALLOWED 27 +#define OGS_5GMM_CAUSE_RESTRICTED_SERVICE_AREA 28 +#define OGS_5GMM_CAUSE_LADN_NOT_AVAILABLE 43 +#define OGS_5GMM_CAUSE_MAXIMUM_NUMBER_OF_PDU_SESSIONS_REACHED 65 +#define OGS_5GMM_CAUSE_INSUFFICIENT_RESOURCES_FOR_SPECIFIC_SLICE_AND_DNN 67 +#define OGS_5GMM_CAUSE_INSUFFICIENT_RESOURCES_FOR_SPECIFIC_SLICE 69 +#define OGS_5GMM_CAUSE_NGKSI_ALREADY_IN_USE 71 +#define OGS_5GMM_CAUSE_NON_3GPP_ACCESS_TO_5GCN_NOT_ALLOWED 72 +#define OGS_5GMM_CAUSE_SERVING_NETWORK_NOT_AUTHORIZED 73 +#define OGS_5GMM_CAUSE_PAYLOAD_WAS_NOT_FORWARDED 90 +#define OGS_5GMM_CAUSE_DNN_NOT_SUPPORTED_OR_NOT_SUBSCRIBED_IN_THE_SLICE 91 +#define OGS_5GMM_CAUSE_INSUFFICIENT_USER_PLANE_RESOURCES_FOR_THE_PDU_SESSION 92 +#define OGS_5GMM_CAUSE_SEMANTICALLY_INCORRECT_MESSAGE 95 +#define OGS_5GMM_CAUSE_INVALID_MANDATORY_INFORMATION 96 +#define OGS_5GMM_CAUSE_MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED 97 +#define OGS_5GMM_CAUSE_MESSAGE_TYPE_NOT_COMPATIBLE_WITH_THE_PROTOCOL_STATE 98 +#define OGS_5GMM_CAUSE_INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED 99 +#define OGS_5GMM_CAUSE_CONDITIONAL_IE_ERROR 100 +#define OGS_5GMM_CAUSE_MESSAGE_NOT_COMPATIBLE_WITH_THE_PROTOCOL_STATE 101 +#define OGS_5GMM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED 111 typedef uint8_t ogs_nas_5gmm_cause_t; /* 9.11.3.2A 5GS DRX parameters @@ -140,36 +140,44 @@ ED3(uint8_t type:4;, /* 9.11.3.4 5GS mobile identity * M LV-E 6-n */ -typedef struct ogs_nas_5gs_mobile_identity_guti_s { -ED3(uint8_t _0xf:4;, +#define OGS_NAS_MAX_SCHEME_OUTPUT_LEN 64 +typedef struct ogs_nas_5gs_mobile_identity_header_s { +ED4(uint8_t spare1:1;, +#define OGS_NAS_5GS_SUPI_FORMAT_IMSI 0 +#define OGS_NAS_5GS_SUPI_FORMAT_NETWORK_SPECIFIC_IDENTIFIER 1 + uint8_t supi_format:3;, uint8_t spare:1;, uint8_t type:3;) +} __attribute__ ((packed)) ogs_nas_5gs_mobile_identity_header_t; +typedef struct ogs_nas_5gs_mobile_identity_imsi_s { + ogs_nas_5gs_mobile_identity_header_t h; ogs_nas_plmn_id_t nas_plmn_id; - uint8_t amf_region_id; - uint8_t amf_set_id1; -ED2(uint8_t amf_set_id2:2;, - uint8_t amf_pointer:6;) + ED2(uint8_t routing_indicator2:4;, + uint8_t routing_indicator1:4;) + ED2(uint8_t routing_indicator4:4;, + uint8_t routing_indicator3:4;) +ED2(uint8_t spare3:4;, +#define OGS_NAS_5GS_NULL_SCHEME 0 +#define OGS_NAS_5GS_ECIES_SCHEME_PROFILE_A 1 +#define OGS_NAS_5GS_ECIES_SCHEME_PROFILE_B 2 + uint8_t protection_scheme_id:4;) + uint8_t home_network_pki_value; + uint8_t scheme_output[OGS_NAS_MAX_SCHEME_OUTPUT_LEN]; +} __attribute__ ((packed)) ogs_nas_5gs_mobile_identity_imsi_t; +typedef struct ogs_nas_5gs_mobile_identity_guti_s { + ogs_nas_5gs_mobile_identity_header_t h; + ogs_nas_plmn_id_t nas_plmn_id; + ogs_amf_id_t amf_id; uint32_t m_tmsi; } __attribute__ ((packed)) ogs_nas_5gs_mobile_identity_guti_t; typedef struct ogs_nas_5gs_mobile_identity_s_tmsi_s { -ED3(uint8_t _0xf:4;, - uint8_t spare:1;, - uint8_t type:3;) - uint8_t amf_region_id; - uint8_t amf_set_id1; -ED2(uint8_t amf_set_id2:2;, - uint8_t amf_pointer:6;) + ogs_nas_5gs_mobile_identity_header_t h; + ogs_amf_id_t amf_id; uint32_t m_tmsi; } __attribute__ ((packed)) ogs_nas_5gs_mobile_identity_s_tmsi_t; typedef struct ogs_nas_5gs_mobile_identity_s { uint16_t length; - union { - ogs_nas_mobile_identity_imsi_t imsi; - ogs_nas_5gs_mobile_identity_guti_t guti; - ogs_nas_5gs_mobile_identity_s_tmsi_t s_tmsi; - ogs_nas_mobile_identity_imei_t imei; - ogs_nas_mobile_identity_imeisv_t imeisv; - }; + uint8_t *buffer; } ogs_nas_5gs_mobile_identity_t; /* 9.11.3.5 5GS network feature support @@ -276,10 +284,10 @@ ED6(uint8_t spare:2;, /* 9.11.3.10 ABBA * M LV 3-n */ -#define OGS_NAS_ABBA_LEN 255 +#define OGS_NAS_MAX_ABBA_LEN 255 typedef struct ogs_nas_abba_s { uint8_t length; - uint8_t abba[OGS_NAS_ABBA_LEN]; + uint8_t value[OGS_NAS_MAX_ABBA_LEN]; } ogs_nas_abba_t; /* 9.11.3.11 Access Type @@ -342,7 +350,7 @@ ED4(uint8_t type:4;, /* 9.11.3.18A CAG information list * O TLV-E 3-n */ typedef struct ogs_nas_cag_information_list_s { - uint8_t length; + uint16_t length; uint8_t *buffer; } ogs_nas_cag_information_list_t; @@ -360,7 +368,7 @@ ED3(uint8_t data_type:3;, /* 9.11.3.18C Ciphering key data * O TLV-E x-n */ typedef struct ogs_nas_ciphering_key_data_s { - uint8_t length; + uint16_t length; uint8_t *buffer; } ogs_nas_ciphering_key_data_t; @@ -500,7 +508,7 @@ typedef ogs_nas_allowed_pdu_session_status_t ogs_nas_pdu_session_reactivation_re /* 9.11.3.43 PDU session reactivation result error cause * O TLV-E 5-515 */ typedef struct ogs_nas_pdu_session_reactivation_result_error_cause_s { - uint8_t length; + uint16_t length; uint8_t *buffer; } ogs_nas_pdu_session_reactivation_result_error_cause_t; @@ -622,44 +630,44 @@ ED3(uint8_t spare:6;, /* 9.11.4.2 5GSM cause * O TV 2 */ -#define OGS_NAS_GSM_OPERATOR_DETERMINED_BARRING 8 -#define OGS_NAS_GSM_INSUFFICIENT_RESOURCES 26 -#define OGS_NAS_GSM_MISSING_OR_UNKNOWN_DNN 27 -#define OGS_NAS_GSM_UNKNOWN_PDU_SESSION_TYPE 28 -#define OGS_NAS_GSM_USER_AUTHENTICATION_OR_AUTHORIZATION_FAILED 29 -#define OGS_NAS_GSM_REQUEST_REJECTED_UNSPECIFIED 31 -#define OGS_NAS_GSM_SERVICE_OPTION_NOT_SUPPORTED 32 -#define OGS_NAS_GSM_REQUESTED_SERVICE_OPTION_NOT_SUBSCRIBED 33 -#define OGS_NAS_GSM_SERVICE_OPTION_TEMPORARILY_OUT_OF_ORDER 34 -#define OGS_NAS_GSM_PTI_ALREADY_IN_USE 35 -#define OGS_NAS_GSM_REGULAR_DEACTIVATION 36 -#define OGS_NAS_GSM_NETWORK_FAILURE 38 -#define OGS_NAS_GSM_REACTIVATION_REQUESTED 39 -#define OGS_NAS_GSM_INVALID_PDU_SESSION_IDENTITY 43 -#define OGS_NAS_GSM_SEMANTIC_ERRORS_IN_PACKET_FILTERS 44 -#define OGS_NAS_GSM_SYNTACTICAL_ERROR_IN_PACKET_FILTERS 45 -#define OGS_NAS_GSM_OUT_OF_LADN_SERVICE_AREA 46 -#define OGS_NAS_GSM_PTI_MISMATCH 47 -#define OGS_NAS_GSM_PDU_SESSION_TYPE_IPV4_ONLY_ALLOWED 50 -#define OGS_NAS_GSM_PDU_SESSION_TYPE_IPV6_ONLY_ALLOWED 51 -#define OGS_NAS_GSM_PDU_SESSION_DOES_NOT_EXIST 54 -#define OGS_NAS_GSM_INSUFFICIENT_RESOURCES_FOR_SPECIFIC_SLICE_AND_DNN 67 -#define OGS_NAS_GSM_NOT_SUPPORTED_SSC_MODE 68 -#define OGS_NAS_GSM_INSUFFICIENT_RESOURCES_FOR_SPECIFIC_SLICE 69 -#define OGS_NAS_GSM_MISSING_OR_UNKNOWN_DNN_IN_A_SLICE 70 -#define OGS_NAS_GSM_INVALID_PTI_VALUE 81 -#define OGS_NAS_GSM_MAXIMUM_DATA_RATE_PER_UE_FOR_USER_PLANE_INTEGRITY_PROTECTION_IS_TOO_LOW 82 -#define OGS_NAS_GSM_SEMANTIC_ERROR_IN_THE_QOS_OPERATION 83 -#define OGS_NAS_GSM_SYNTACTICAL_ERROR_IN_THE_QOS_OPERATION 84 -#define OGS_NAS_GSM_INVALID_MAPPED_EPS_BEARER_IDENTITY 85 -#define OGS_NAS_GSM_SEMANTICALLY_INCORRECT_MESSAGE 95 -#define OGS_NAS_GSM_INVALID_MANDATORY_INFORMATION 96 -#define OGS_NAS_GSM_MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED 97 -#define OGS_NAS_GSM_MESSAGE_TYPE_NOT_COMPATIBLE_WITH_THE_PROTOCOL_STATE 98 -#define OGS_NAS_GSM_INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT IMPLEMENTED 99 -#define OGS_NAS_GSM_CONDITIONAL_IE_ERROR 100 -#define OGS_NAS_GSM_MESSAGE_NOT_COMPATIBLE_WITH_THE_PROTOCOL_STATE 101 -#define OGS_NAS_GSM_PROTOCOL_ERROR_UNSPECIFIED 111 +#define OGS_5GSM_CAUSE_OPERATOR_DETERMINED_BARRING 8 +#define OGS_5GSM_CAUSE_INSUFFICIENT_RESOURCES 26 +#define OGS_5GSM_CAUSE_MISSING_OR_UNKNOWN_DNN 27 +#define OGS_5GSM_CAUSE_UNKNOWN_PDU_SESSION_TYPE 28 +#define OGS_5GSM_CAUSE_USER_AUTHENTICATION_OR_AUTHORIZATION_FAILED 29 +#define OGS_5GSM_CAUSE_REQUEST_REJECTED_UNSPECIFIED 31 +#define OGS_5GSM_CAUSE_SERVICE_OPTION_NOT_SUPPORTED 32 +#define OGS_5GSM_CAUSE_REQUESTED_SERVICE_OPTION_NOT_SUBSCRIBED 33 +#define OGS_5GSM_CAUSE_SERVICE_OPTION_TEMPORARILY_OUT_OF_ORDER 34 +#define OGS_5GSM_CAUSE_PTI_ALREADY_IN_USE 35 +#define OGS_5GSM_CAUSE_REGULAR_DEACTIVATION 36 +#define OGS_5GSM_CAUSE_NETWORK_FAILURE 38 +#define OGS_5GSM_CAUSE_REACTIVATION_REQUESTED 39 +#define OGS_5GSM_CAUSE_INVALID_PDU_SESSION_IDENTITY 43 +#define OGS_5GSM_CAUSE_SEMANTIC_ERRORS_IN_PACKET_FILTERS 44 +#define OGS_5GSM_CAUSE_SYNTACTICAL_ERROR_IN_PACKET_FILTERS 45 +#define OGS_5GSM_CAUSE_OUT_OF_LADN_SERVICE_AREA 46 +#define OGS_5GSM_CAUSE_PTI_MISMATCH 47 +#define OGS_5GSM_CAUSE_PDU_SESSION_TYPE_IPV4_ONLY_ALLOWED 50 +#define OGS_5GSM_CAUSE_PDU_SESSION_TYPE_IPV6_ONLY_ALLOWED 51 +#define OGS_5GSM_CAUSE_PDU_SESSION_DOES_NOT_EXIST 54 +#define OGS_5GSM_CAUSE_INSUFFICIENT_RESOURCES_FOR_SPECIFIC_SLICE_AND_DNN 67 +#define OGS_5GSM_CAUSE_NOT_SUPPORTED_SSC_MODE 68 +#define OGS_5GSM_CAUSE_INSUFFICIENT_RESOURCES_FOR_SPECIFIC_SLICE 69 +#define OGS_5GSM_CAUSE_MISSING_OR_UNKNOWN_DNN_IN_A_SLICE 70 +#define OGS_5GSM_CAUSE_INVALID_PTI_VALUE 81 +#define OGS_5GSM_CAUSE_MAXIMUM_DATA_RATE_PER_UE_FOR_USER_PLANE_INTEGRITY_PROTECTION_IS_TOO_LOW 82 +#define OGS_5GSM_CAUSE_SEMANTIC_ERROR_IN_THE_QOS_OPERATION 83 +#define OGS_5GSM_CAUSE_SYNTACTICAL_ERROR_IN_THE_QOS_OPERATION 84 +#define OGS_5GSM_CAUSE_INVALID_MAPPED_EPS_BEARER_IDENTITY 85 +#define OGS_5GSM_CAUSE_SEMANTICALLY_INCORRECT_MESSAGE 95 +#define OGS_5GSM_CAUSE_INVALID_MANDATORY_INFORMATION 96 +#define OGS_5GSM_CAUSE_MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED 97 +#define OGS_5GSM_CAUSE_MESSAGE_TYPE_NOT_COMPATIBLE_WITH_THE_PROTOCOL_STATE 98 +#define OGS_5GSM_CAUSE_INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT IMPLEMENTED 99 +#define OGS_5GSM_CAUSE_CONDITIONAL_IE_ERROR 100 +#define OGS_5GSM_CAUSE_MESSAGE_NOT_COMPATIBLE_WITH_THE_PROTOCOL_STATE 101 +#define OGS_5GSM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED 111 typedef uint8_t ogs_nas_5gsm_cause_t; /* 9.11.4.21 5GSM congestion re-attempt indicator diff --git a/lib/nas/common/conv.c b/lib/nas/common/conv.c index 512604ce97..c0551236be 100644 --- a/lib/nas/common/conv.c +++ b/lib/nas/common/conv.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019,2020 by Sukchan Lee * * This file is part of Open5GS. * @@ -19,7 +19,7 @@ #include "ogs-nas-common.h" -void ogs_nas_imsi_to_bcd( +void ogs_nas_eps_imsi_to_bcd( ogs_nas_mobile_identity_imsi_t *imsi, uint8_t imsi_len, char *bcd) { int bcd_len; diff --git a/lib/nas/common/conv.h b/lib/nas/common/conv.h index 6692a27f8f..187c4b6267 100644 --- a/lib/nas/common/conv.h +++ b/lib/nas/common/conv.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019,2020 by Sukchan Lee * * This file is part of Open5GS. * @@ -34,7 +34,7 @@ void ogs_nas_imsi_to_buffer( ogs_nas_mobile_identity_imsi_t *imsi, uint8_t imsi_len, uint8_t *buf, uint8_t *buf_len); -void ogs_nas_imsi_to_bcd( +void ogs_nas_eps_imsi_to_bcd( ogs_nas_mobile_identity_imsi_t *imsi, uint8_t imsi_len, char *bcd); void ogs_nas_imeisv_to_bcd( diff --git a/lib/nas/common/meson.build b/lib/nas/common/meson.build index bfc6b65ef6..6c3aaccd3d 100644 --- a/lib/nas/common/meson.build +++ b/lib/nas/common/meson.build @@ -1,4 +1,4 @@ -# Copyright (C) 2019 by Sukchan Lee +# Copyright (C) 2019,2020 by Sukchan Lee # This file is part of Open5GS. diff --git a/lib/nas/common/ogs-nas-common.h b/lib/nas/common/ogs-nas-common.h index 8c653b9771..245e09d6b1 100644 --- a/lib/nas/common/ogs-nas-common.h +++ b/lib/nas/common/ogs-nas-common.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019,2020 by Sukchan Lee * * This file is part of Open5GS. * diff --git a/lib/nas/common/security.c b/lib/nas/common/security.c index 81a23be301..8594aafc69 100644 --- a/lib/nas/common/security.c +++ b/lib/nas/common/security.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019,2020 by Sukchan Lee * * This file is part of Open5GS. * diff --git a/lib/nas/common/security.h b/lib/nas/common/security.h index b0d0a067d5..465fa2f7aa 100644 --- a/lib/nas/common/security.h +++ b/lib/nas/common/security.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019,2020 by Sukchan Lee * * This file is part of Open5GS. * diff --git a/lib/nas/common/types.c b/lib/nas/common/types.c index 8c2fcc900f..14167ab2d6 100644 --- a/lib/nas/common/types.c +++ b/lib/nas/common/types.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019,2020 by Sukchan Lee * * This file is part of Open5GS. * @@ -21,7 +21,8 @@ int __ogs_nas_domain; -void *ogs_nas_from_plmn_id(ogs_nas_plmn_id_t *ogs_nas_plmn_id, ogs_plmn_id_t *plmn_id) +void *ogs_nas_from_plmn_id( + ogs_nas_plmn_id_t *ogs_nas_plmn_id, ogs_plmn_id_t *plmn_id) { memcpy(ogs_nas_plmn_id, plmn_id, OGS_PLMN_ID_LEN); if (plmn_id->mnc1 != 0xf) { @@ -31,7 +32,8 @@ void *ogs_nas_from_plmn_id(ogs_nas_plmn_id_t *ogs_nas_plmn_id, ogs_plmn_id_t *pl } return ogs_nas_plmn_id; } -void *ogs_nas_to_plmn_id(ogs_plmn_id_t *plmn_id, ogs_nas_plmn_id_t *ogs_nas_plmn_id) +void *ogs_nas_to_plmn_id( + ogs_plmn_id_t *plmn_id, ogs_nas_plmn_id_t *ogs_nas_plmn_id) { memcpy(plmn_id, ogs_nas_plmn_id, OGS_PLMN_ID_LEN); if (plmn_id->mnc1 != 0xf) { diff --git a/lib/nas/common/types.h b/lib/nas/common/types.h index 0f052ccbb1..8d6acf52c7 100644 --- a/lib/nas/common/types.h +++ b/lib/nas/common/types.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019,2020 by Sukchan Lee * * This file is part of Open5GS. * @@ -388,22 +388,22 @@ ED3(uint8_t type:4;, #define OGS_NAS_SECURITY_ALGORITHMS_128_EEA1 1 #define OGS_NAS_SECURITY_ALGORITHMS_128_EEA2 2 #define OGS_NAS_SECURITY_ALGORITHMS_128_EEA3 3 -#define OGS_NAS_SECURITY_ALGORITHMS_IA0 0 -#define OGS_NAS_SECURITY_ALGORITHMS_128_IA1 1 -#define OGS_NAS_SECURITY_ALGORITHMS_128_IA2 2 -#define OGS_NAS_SECURITY_ALGORITHMS_128_IA3 3 -#define OGS_NAS_SECURITY_ALGORITHMS_IA4 4 -#define OGS_NAS_SECURITY_ALGORITHMS_IA5 5 -#define OGS_NAS_SECURITY_ALGORITHMS_IA6 6 -#define OGS_NAS_SECURITY_ALGORITHMS_IA7 7 -#define OGS_NAS_SECURITY_ALGORITHMS_EA0 0 -#define OGS_NAS_SECURITY_ALGORITHMS_128_EA1 1 -#define OGS_NAS_SECURITY_ALGORITHMS_128_EA2 2 -#define OGS_NAS_SECURITY_ALGORITHMS_128_EA3 3 -#define OGS_NAS_SECURITY_ALGORITHMS_EA4 4 -#define OGS_NAS_SECURITY_ALGORITHMS_EA5 5 -#define OGS_NAS_SECURITY_ALGORITHMS_EA6 6 -#define OGS_NAS_SECURITY_ALGORITHMS_EA7 7 +#define OGS_NAS_SECURITY_ALGORITHMS_NIA0 0 +#define OGS_NAS_SECURITY_ALGORITHMS_128_NIA1 1 +#define OGS_NAS_SECURITY_ALGORITHMS_128_NIA2 2 +#define OGS_NAS_SECURITY_ALGORITHMS_128_NIA3 3 +#define OGS_NAS_SECURITY_ALGORITHMS_NIA4 4 +#define OGS_NAS_SECURITY_ALGORITHMS_NIA5 5 +#define OGS_NAS_SECURITY_ALGORITHMS_NIA6 6 +#define OGS_NAS_SECURITY_ALGORITHMS_NIA7 7 +#define OGS_NAS_SECURITY_ALGORITHMS_NEA0 0 +#define OGS_NAS_SECURITY_ALGORITHMS_128_NEA1 1 +#define OGS_NAS_SECURITY_ALGORITHMS_128_NEA2 2 +#define OGS_NAS_SECURITY_ALGORITHMS_128_NEA3 3 +#define OGS_NAS_SECURITY_ALGORITHMS_NEA4 4 +#define OGS_NAS_SECURITY_ALGORITHMS_NEA5 5 +#define OGS_NAS_SECURITY_ALGORITHMS_NEA6 6 +#define OGS_NAS_SECURITY_ALGORITHMS_NEA7 7 typedef struct ogs_nas_security_algorithms_s { ED2(uint8_t type_of_ciphering_algorithm:4;, uint8_t type_of_integrity_protection_algorithm:4;) @@ -565,16 +565,16 @@ typedef struct ogs_nas_ue_security_capability_s { uint8_t eea; struct { - ED8(uint8_t ea0_5g:1;, - uint8_t ea1_5g_128:1;, - uint8_t ea2_5g_128:1;, - uint8_t ea3_5g_128:1;, - uint8_t ea4_5g:1;, - uint8_t ea5_5g:1;, - uint8_t ea6_5g:1;, - uint8_t ea7_5g:1;) + ED8(uint8_t nea0:1;, + uint8_t nea1:1;, + uint8_t nea2:1;, + uint8_t nea3:1;, + uint8_t nea4:1;, + uint8_t nea5:1;, + uint8_t nea6:1;, + uint8_t nea7:1;) }; - uint8_t ea_5g; + uint8_t nea; }; union { struct { @@ -590,16 +590,16 @@ typedef struct ogs_nas_ue_security_capability_s { uint8_t eia; struct { - ED8(uint8_t ia0_5g:1;, - uint8_t ia1_5g_128:1;, - uint8_t ia2_5g_128:1;, - uint8_t ia3_5g_128:1;, - uint8_t ia4_5g:1;, - uint8_t ia5_5g:1;, - uint8_t ia6_5g:1;, - uint8_t ia7_5g:1;) + ED8(uint8_t nia0:1;, + uint8_t nia1:1;, + uint8_t nia2:1;, + uint8_t nia3:1;, + uint8_t nia4:1;, + uint8_t nia5:1;, + uint8_t nia6:1;, + uint8_t nia7:1;) }; - uint8_t ia_5g; + uint8_t nia; }; union { struct { @@ -615,16 +615,16 @@ typedef struct ogs_nas_ue_security_capability_s { uint8_t uea; struct { - ED8(uint8_t ea0:1;, - uint8_t ea1_128:1;, - uint8_t ea2_128:1;, - uint8_t ea3_128:1;, - uint8_t ea4:1;, - uint8_t ea5:1;, - uint8_t ea6:1;, - uint8_t ea7:1;) + ED8(uint8_t eps_ea0:1;, + uint8_t eps_ea1:1;, + uint8_t eps_ea2:1;, + uint8_t eps_ea3:1;, + uint8_t eps_ea4:1;, + uint8_t eps_ea5:1;, + uint8_t eps_ea6:1;, + uint8_t eps_ea7:1;) }; - uint8_t ea; + uint8_t eps_ea; }; union { struct { @@ -640,16 +640,16 @@ typedef struct ogs_nas_ue_security_capability_s { uint8_t uia; struct { - ED8(uint8_t ia0:1;, - uint8_t ia1_128:1;, - uint8_t ia2_128:1;, - uint8_t ia3_128:1;, - uint8_t ia4:1;, - uint8_t ia5:1;, - uint8_t ia6:1;, - uint8_t ia7:1;) + ED8(uint8_t eps_ia0:1;, + uint8_t eps_ia1:1;, + uint8_t eps_ia2:1;, + uint8_t eps_ia3:1;, + uint8_t eps_ia4:1;, + uint8_t eps_ia5:1;, + uint8_t eps_ia6:1;, + uint8_t eps_ia7:1;) }; - uint8_t ia; + uint8_t eps_ia; }; union { struct { @@ -664,6 +664,7 @@ typedef struct ogs_nas_ue_security_capability_s { }; uint8_t gea; }; + char spare[3]; } __attribute__ ((packed)) ogs_nas_ue_security_capability_t; /* 9.9.3.62 WUS assistance information diff --git a/lib/ngap/conv.c b/lib/ngap/conv.c index bc34a3620b..efb89c10b1 100644 --- a/lib/ngap/conv.c +++ b/lib/ngap/conv.c @@ -25,10 +25,10 @@ void ogs_ngap_uint32_to_GNB_ID(uint32_t gnb_id, NGAP_GNB_ID_t *gNB_ID) ogs_assert(gNB_ID); + gNB_ID->present = NGAP_GNB_ID_PR_gNB_ID; bit_string = &gNB_ID->choice.gNB_ID; ogs_assert(bit_string); - gNB_ID->present = NGAP_GNB_ID_PR_gNB_ID; bit_string->size = 3; bit_string->buf = CALLOC(bit_string->size, sizeof(uint8_t)); @@ -60,7 +60,7 @@ void ogs_ngap_uint8_to_AMFRegionID( aMFRegionID->buf[0] = region; } -void ogs_ngap_uint16_to_NGAP_AMFSetID( +void ogs_ngap_uint16_to_AMFSetID( uint16_t set, NGAP_AMFSetID_t *aMFSetID) { ogs_assert(aMFSetID); @@ -72,7 +72,7 @@ void ogs_ngap_uint16_to_NGAP_AMFSetID( aMFSetID->buf[0] = (set >> 2); aMFSetID->buf[1] = ((set & 0x03) << 6); } -void ogs_ngap_uint8_to_NGAP_NGAP_AMFPointer( +void ogs_ngap_uint8_to_AMFPointer( uint8_t pointer, NGAP_AMFPointer_t *aMFPointer) { ogs_assert(aMFPointer); @@ -83,3 +83,88 @@ void ogs_ngap_uint8_to_NGAP_NGAP_AMFPointer( aMFPointer->buf[0] = (pointer << 2); } + +void ogs_ngap_AMFRegionID_to_uint8( + NGAP_AMFRegionID_t *aMFRegionID, uint8_t *region) +{ + uint8_t *buf = NULL; + + ogs_assert(aMFRegionID); + ogs_assert(region); + + buf = aMFRegionID->buf; + ogs_assert(buf); + + *region = buf[0]; +} +void ogs_ngap_AMFSetID_to_uint16( + NGAP_AMFSetID_t *aMFSetID, uint16_t *set) +{ + uint8_t *buf = NULL; + + ogs_assert(aMFSetID); + ogs_assert(set); + + buf = aMFSetID->buf; + ogs_assert(buf); + + *set = (buf[0] << 2) + ((buf[1] >> 6) & 0x03); +} +void ogs_ngap_AMFPointer_to_uint8( + NGAP_AMFPointer_t *aMFPointer, uint8_t *pointer) +{ + uint8_t *buf = NULL; + + ogs_assert(aMFPointer); + ogs_assert(pointer); + + buf = aMFPointer->buf; + ogs_assert(buf); + + *pointer = (buf[0] >> 2); +} + +void ogs_ngap_nr_cgi_to_ASN(ogs_nr_cgi_t *cgi, NGAP_NR_CGI_t *nR_CGI) +{ + char buf[5]; + + ogs_assert(cgi); + ogs_assert(nR_CGI); + + ogs_asn_buffer_to_OCTET_STRING( + &cgi->plmn_id, OGS_PLMN_ID_LEN, &nR_CGI->pLMNIdentity); + + /* CellIdentity : 36bit */ + ogs_uint64_to_buffer((cgi->cell_id << 4), 5, buf); + ogs_asn_buffer_to_BIT_STRING(buf, 5, 4, &nR_CGI->nRCellIdentity); +} + +void ogs_ngap_ASN_to_nr_cgi(NGAP_NR_CGI_t *nR_CGI, ogs_nr_cgi_t *cgi) +{ + ogs_assert(cgi); + ogs_assert(nR_CGI); + + memcpy(&cgi->plmn_id, nR_CGI->pLMNIdentity.buf, OGS_PLMN_ID_LEN); + + /* CellIdentity : 36bit */ + cgi->cell_id = (ogs_buffer_to_uint64(nR_CGI->nRCellIdentity.buf, 5) >> 4); +} + +void ogs_ngap_5gs_tai_to_ASN(ogs_5gs_tai_t *tai, NGAP_TAI_t *tAI) +{ + ogs_assert(tai); + ogs_assert(tAI); + + ogs_asn_buffer_to_OCTET_STRING( + &tai->plmn_id, OGS_PLMN_ID_LEN, &tAI->pLMNIdentity); + ogs_asn_uint24_to_OCTET_STRING(tai->tac, &tAI->tAC); +} + +void ogs_ngap_ASN_to_5gs_tai(NGAP_TAI_t *tAI, ogs_5gs_tai_t *tai) +{ + ogs_assert(tai); + ogs_assert(tAI); + + memcpy(&tai->plmn_id, tAI->pLMNIdentity.buf, OGS_PLMN_ID_LEN); + ogs_asn_OCTET_STRING_to_uint24(&tAI->tAC, &tai->tac); +} diff --git a/lib/ngap/conv.h b/lib/ngap/conv.h index e039d39252..5b6db7ebd7 100644 --- a/lib/ngap/conv.h +++ b/lib/ngap/conv.h @@ -33,10 +33,22 @@ void ogs_ngap_GNB_ID_to_uint32(NGAP_GNB_ID_t *gNB_ID, uint32_t *gnb_id); void ogs_ngap_uint8_to_AMFRegionID( uint8_t region, NGAP_AMFRegionID_t *aMFRegionID); -void ogs_ngap_uint16_to_NGAP_AMFSetID( +void ogs_ngap_uint16_to_AMFSetID( uint16_t set, NGAP_AMFSetID_t *aMFSetID); -void ogs_ngap_uint8_to_NGAP_NGAP_AMFPointer( +void ogs_ngap_uint8_to_AMFPointer( uint8_t pointer, NGAP_AMFPointer_t *aMFPointer); +void ogs_ngap_AMFRegionID_to_uint8( + NGAP_AMFRegionID_t *aMFRegionID, uint8_t *region); +void ogs_ngap_AMFSetID_to_uint16( + NGAP_AMFSetID_t *aMFSetID, uint16_t *set); +void ogs_ngap_AMFPointer_to_uint8( + NGAP_AMFPointer_t *aMFPointer, uint8_t *pointer); + +void ogs_ngap_nr_cgi_to_ASN(ogs_nr_cgi_t *cgi, NGAP_NR_CGI_t *nR_CGI); +void ogs_ngap_ASN_to_nr_cgi(NGAP_NR_CGI_t *nR_CGI, ogs_nr_cgi_t *cgi); + +void ogs_ngap_5gs_tai_to_ASN(ogs_5gs_tai_t *tai, NGAP_TAI_t *tAI); +void ogs_ngap_ASN_to_5gs_tai(NGAP_TAI_t *tAI, ogs_5gs_tai_t *tai); #ifdef __cplusplus } diff --git a/lib/sbi/client.c b/lib/sbi/client.c index 91ec16e94b..66e67e3ee3 100644 --- a/lib/sbi/client.c +++ b/lib/sbi/client.c @@ -45,6 +45,8 @@ typedef struct connection_s { char *memory; size_t size; + char *location; + ogs_timer_t *timer; CURL *easy; char error[CURL_ERROR_SIZE]; @@ -57,6 +59,7 @@ static OGS_POOL(sockinfo_pool, sockinfo_t); static OGS_POOL(connection_pool, connection_t); static size_t write_cb(void *contents, size_t size, size_t nmemb, void *data); +static size_t header_cb(void *ptr, size_t size, size_t nmemb, void *data); static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp); static int multi_timer_cb(CURLM *multi, long timeout_ms, void *cbp); static void multi_timer_expired(void *data); @@ -68,7 +71,7 @@ void ogs_sbi_client_init(int num_of_sockinfo_pool, int num_of_connection_pool) curl_global_init(CURL_GLOBAL_DEFAULT); ogs_list_init(&ogs_sbi_self()->client_list); - ogs_pool_init(&client_pool, ogs_config()->pool.sbi); + ogs_pool_init(&client_pool, ogs_config()->max.nf); ogs_pool_init(&sockinfo_pool, num_of_sockinfo_pool); ogs_pool_init(&connection_pool, num_of_connection_pool); @@ -76,8 +79,6 @@ void ogs_sbi_client_init(int num_of_sockinfo_pool, int num_of_connection_pool) } void ogs_sbi_client_final(void) { - ogs_sbi_client_remove_all(); - ogs_pool_final(&client_pool); ogs_pool_final(&sockinfo_pool); ogs_pool_final(&connection_pool); @@ -115,70 +116,17 @@ ogs_sbi_client_t *ogs_sbi_client_add(ogs_sockaddr_t *addr) return client; } -ogs_sbi_client_t *ogs_sbi_client_find_or_add(char *url) -{ - int rv; - - ogs_sbi_client_t *client = NULL; - struct yuarel yuarel; - char *p = ogs_strdup(url); - int port; - - ogs_sockaddr_t *addr = NULL; - - rv = yuarel_parse(&yuarel, p); - if (rv != OGS_OK) { - ogs_free(p); - ogs_error("yuarel_parse() failed [%s]", url); - return NULL; - } - - if (!yuarel.scheme) { - ogs_error("No http.scheme found [%s]", url); - ogs_free(p); - return NULL; - } - - if (strcmp(yuarel.scheme, "https") == 0) { - port = OGS_SBI_HTTPS_PORT; - } else if (strcmp(yuarel.scheme, "http") == 0) { - port = OGS_SBI_HTTP_PORT; - } else { - ogs_error("Invalid http.scheme [%s:%s]", yuarel.scheme, url); - ogs_free(p); - return NULL; - } - - if (!yuarel.host) { - ogs_error("No http.host found [%s]", url); - ogs_free(p); - return NULL; - } - - if (yuarel.port) port = yuarel.port; - - rv = ogs_getaddrinfo(&addr, AF_UNSPEC, yuarel.host, port, 0); - if (rv != OGS_OK) { - ogs_error("ogs_getaddrinfo() failed [%s]", url); - ogs_free(p); - } - - client = ogs_sbi_client_find(addr); - if (!client) { - client = ogs_sbi_client_add(addr); - ogs_assert(client); - } - - ogs_freeaddrinfo(addr); - ogs_free(p); - - return client; -} - void ogs_sbi_client_remove(ogs_sbi_client_t *client) { ogs_assert(client); + /* ogs_sbi_client_t is always created with reference context */ + ogs_assert(client->reference_count > 0); + + client->reference_count--; + if (client->reference_count > 0) + return; + ogs_list_remove(&ogs_sbi_self()->client_list, client); connection_remove_all(client); @@ -195,14 +143,6 @@ void ogs_sbi_client_remove(ogs_sbi_client_t *client) ogs_pool_free(&client_pool, client); } -void ogs_sbi_client_remove_all(void) -{ - ogs_sbi_client_t *client = NULL, *next_client = NULL; - - ogs_list_for_each_safe(&ogs_sbi_self()->client_list, next_client, client) - ogs_sbi_client_remove(client); -} - ogs_sbi_client_t *ogs_sbi_client_find(ogs_sockaddr_t *addr) { ogs_sbi_client_t *client = NULL; @@ -210,7 +150,8 @@ ogs_sbi_client_t *ogs_sbi_client_find(ogs_sockaddr_t *addr) ogs_assert(addr); ogs_list_for_each(&ogs_sbi_self()->client_list, client) { - if (ogs_sockaddr_is_equal(client->addr, addr) == true) + if (ogs_sockaddr_is_equal(client->addr, addr) == true && + OGS_PORT(client->addr) == OGS_PORT(addr)) break; } @@ -338,12 +279,13 @@ static connection_t *connection_add(ogs_sbi_client_t *client, curl_easy_setopt(conn->easy, CURLOPT_CUSTOMREQUEST, request->h.method); if (request->http.content) { - curl_easy_setopt(conn->easy, CURLOPT_HTTPHEADER, conn->header_list); curl_easy_setopt(conn->easy, CURLOPT_POSTFIELDS, request->http.content); } } + curl_easy_setopt(conn->easy, CURLOPT_HTTPHEADER, conn->header_list); + if (ogs_hash_count(request->http.params)) { request->h.url = add_params_to_url(conn->easy, request->h.url, request->http.params); @@ -354,6 +296,8 @@ static connection_t *connection_add(ogs_sbi_client_t *client, curl_easy_setopt(conn->easy, CURLOPT_PRIVATE, conn); curl_easy_setopt(conn->easy, CURLOPT_WRITEFUNCTION, write_cb); curl_easy_setopt(conn->easy, CURLOPT_WRITEDATA, conn); + curl_easy_setopt(conn->easy, CURLOPT_HEADERFUNCTION, header_cb); + curl_easy_setopt(conn->easy, CURLOPT_HEADERDATA, conn); curl_easy_setopt(conn->easy, CURLOPT_ERRORBUFFER, conn->error); ogs_assert(client->multi); @@ -390,6 +334,9 @@ static void connection_remove(connection_t *conn) ogs_assert(conn->method); ogs_free(conn->method); + if (conn->location) + ogs_free(conn->location); + if (conn->num_of_header) { for (i = 0; i < conn->num_of_header; i++) ogs_free(conn->headers[i]); @@ -473,7 +420,10 @@ static void check_multi_info(ogs_sbi_client_t *client) if (content_type) ogs_sbi_header_set(response->http.headers, - "Content-Type", content_type); + OGS_SBI_CONTENT_TYPE, content_type); + if (conn->location) + ogs_sbi_header_set(response->http.headers, + OGS_SBI_LOCATION, conn->location); if (client->cb) client->cb(response, conn->data); @@ -503,9 +453,7 @@ void ogs_sbi_client_send_request( ogs_assert(request); if (request->h.url == NULL) { - request->h.url = ogs_sbi_client_uri(client, - request->h.service.name, request->h.api.version, - request->h.resource.name, request->h.resource.id); + request->h.url = ogs_sbi_client_uri(client, &request->h); } conn = connection_add(client, request, data); @@ -537,6 +485,19 @@ static size_t write_cb(void *contents, size_t size, size_t nmemb, void *data) return realsize; } +static size_t header_cb(void *ptr, size_t size, size_t nmemb, void *data) +{ + connection_t *conn = NULL; + + conn = data; + ogs_assert(conn); + + if (strncmp(ptr, OGS_SBI_LOCATION, strlen(OGS_SBI_LOCATION)) == 0) + conn->location = ogs_strdup((char *)ptr + strlen(OGS_SBI_LOCATION) + 2); + + return (nmemb*size); +} + static void event_cb(short when, ogs_socket_t fd, void *data) { sockinfo_t *sockinfo = NULL; diff --git a/lib/sbi/client.h b/lib/sbi/client.h index 3a17b7e21c..b571b1b62e 100644 --- a/lib/sbi/client.h +++ b/lib/sbi/client.h @@ -32,6 +32,8 @@ extern "C" { do { \ ogs_assert((__cTX)); \ ogs_assert((__pCLIENT)); \ + if ((__cTX)->client != __pCLIENT) \ + __pCLIENT->reference_count++; \ (__cTX)->client = __pCLIENT; \ } while(0) typedef struct ogs_sbi_client_s { @@ -46,20 +48,20 @@ typedef struct ogs_sbi_client_s { int (*cb)(ogs_sbi_response_t *response, void *data); - ogs_timer_t *t_curl; /* timer for CURL */ - ogs_list_t connection_list; /* CURL connection list */ + ogs_timer_t *t_curl; /* timer for CURL */ + ogs_list_t connection_list; /* CURL connection list */ - void *multi; /* CURL multi handle */ - int still_running; /* number of running CURL handle */ + void *multi; /* CURL multi handle */ + int still_running; /* number of running CURL handle */ + + unsigned int reference_count; /* reference count for memory free */ } ogs_sbi_client_t; void ogs_sbi_client_init(int num_of_sockinfo_pool, int num_of_connection_pool); void ogs_sbi_client_final(void); ogs_sbi_client_t *ogs_sbi_client_add(ogs_sockaddr_t *addr); -ogs_sbi_client_t *ogs_sbi_client_find_or_add(char *uri); void ogs_sbi_client_remove(ogs_sbi_client_t *client); -void ogs_sbi_client_remove_all(void); ogs_sbi_client_t *ogs_sbi_client_find(ogs_sockaddr_t *addr); void ogs_sbi_client_send_request( diff --git a/lib/sbi/context.c b/lib/sbi/context.c index a1dbf72aa3..e93caf07f4 100644 --- a/lib/sbi/context.c +++ b/lib/sbi/context.c @@ -44,17 +44,17 @@ void ogs_sbi_context_init(ogs_pollset_t *pollset, ogs_timer_mgr_t *timer_mgr) ogs_log_install_domain(&__ogs_sbi_domain, "sbi", ogs_core()->log.level); - /* FIXME : number of pool size */ - ogs_sbi_message_init(32, 32); - ogs_sbi_server_init(32); - ogs_sbi_client_init(512, 512); + ogs_sbi_message_init( + ogs_config()->pool.sbi_message, ogs_config()->pool.sbi_message); + ogs_sbi_server_init(ogs_config()->max.nf); + ogs_sbi_client_init(ogs_config()->max.nf, ogs_config()->max.nf); ogs_list_init(&self.nf_instance_list); - ogs_pool_init(&nf_instance_pool, ogs_config()->pool.sbi); - ogs_pool_init(&nf_service_pool, ogs_config()->pool.sbi); + ogs_pool_init(&nf_instance_pool, ogs_config()->max.nf); + ogs_pool_init(&nf_service_pool, ogs_config()->pool.nf_service); ogs_list_init(&self.subscription_list); - ogs_pool_init(&subscription_pool, ogs_config()->pool.sbi); + ogs_pool_init(&subscription_pool, ogs_config()->pool.nf_subscription); ogs_uuid_get(&self.uuid); ogs_uuid_format(self.nf_instance_id, &self.uuid); @@ -303,6 +303,7 @@ int ogs_sbi_context_parse_config(const char *local, const char *remote) ogs_yaml_iter_t sbi_array, sbi_iter; ogs_yaml_iter_recurse(&remote_iter, &sbi_array); do { + ogs_sbi_nf_instance_t *nf_instance = NULL; ogs_sbi_client_t *client = NULL; ogs_sockaddr_t *addr = NULL; int family = AF_UNSPEC; @@ -400,6 +401,12 @@ int ogs_sbi_context_parse_config(const char *local, const char *remote) client = ogs_sbi_client_add(addr); ogs_assert(client); + nf_instance = ogs_sbi_nf_instance_add( + ogs_sbi_self()->nf_instance_id); + ogs_assert(nf_instance); + + OGS_SETUP_SBI_CLIENT(nf_instance, client); + if (key) client->tls.key = key; if (pem) client->tls.pem = pem; @@ -428,6 +435,8 @@ ogs_sbi_nf_instance_t *ogs_sbi_nf_instance_add(char *id) ogs_assert(nf_instance); memset(nf_instance, 0, sizeof(ogs_sbi_nf_instance_t)); + nf_instance->reference_count++; + nf_instance->id = ogs_strdup(id); ogs_assert(nf_instance->id); @@ -453,7 +462,6 @@ void ogs_sbi_nf_instance_clear(ogs_sbi_nf_instance_t *nf_instance) ogs_freeaddrinfo(nf_instance->ipv6[i]); } - ogs_sbi_nf_service_remove_all(nf_instance); } @@ -461,6 +469,10 @@ void ogs_sbi_nf_instance_remove(ogs_sbi_nf_instance_t *nf_instance) { ogs_assert(nf_instance); + nf_instance->reference_count--; + if (nf_instance->reference_count > 0) + return; + ogs_list_remove(&ogs_sbi_self()->nf_instance_list, nf_instance); ogs_sbi_subscription_remove_all_by_nf_instance_id(nf_instance->id); @@ -470,6 +482,9 @@ void ogs_sbi_nf_instance_remove(ogs_sbi_nf_instance_t *nf_instance) ogs_sbi_nf_instance_clear(nf_instance); + if (nf_instance->client) + ogs_sbi_client_remove(nf_instance->client); + ogs_pool_free(&nf_instance_pool, nf_instance); } @@ -497,53 +512,6 @@ ogs_sbi_nf_instance_t *ogs_sbi_nf_instance_find(char *id) return nf_instance; } -ogs_sbi_nf_instance_t *ogs_sbi_nf_instance_build_default( - OpenAPI_nf_type_e nf_type, ogs_sbi_client_t *client) -{ - ogs_sbi_server_t *server = NULL; - ogs_sbi_nf_instance_t *nf_instance = NULL; - char *hostname = NULL; - - nf_instance = ogs_sbi_nf_instance_add(ogs_sbi_self()->nf_instance_id); - ogs_assert(nf_instance); - - nf_instance->nf_type = nf_type; - nf_instance->nf_status = OpenAPI_nf_status_REGISTERED; - OGS_SETUP_SBI_CLIENT(nf_instance, client); - - hostname = NULL; - ogs_list_for_each(&ogs_sbi_self()->server_list, server) { - ogs_assert(server->addr); - - /* First FQDN is selected */ - if (!hostname) { - hostname = ogs_gethostname(server->addr); - if (hostname) - continue; - } - - if (nf_instance->num_of_ipv4 < OGS_SBI_MAX_NUM_OF_IP_ADDRESS) { - ogs_sockaddr_t *addr = NULL; - ogs_copyaddrinfo(&addr, server->addr); - ogs_assert(addr); - - if (addr->ogs_sa_family == AF_INET) { - nf_instance->ipv4[nf_instance->num_of_ipv4] = addr; - nf_instance->num_of_ipv4++; - } else if (addr->ogs_sa_family == AF_INET6) { - nf_instance->ipv6[nf_instance->num_of_ipv6] = addr; - nf_instance->num_of_ipv6++; - } else - ogs_assert_if_reached(); - } - } - - if (hostname) - strcpy(nf_instance->fqdn, hostname); - - return nf_instance; -} - ogs_sbi_nf_service_t *ogs_sbi_nf_service_add(ogs_sbi_nf_instance_t *nf_instance, char *id, char *name, OpenAPI_uri_scheme_e scheme) { @@ -592,21 +560,14 @@ void ogs_sbi_nf_service_add_version(ogs_sbi_nf_service_t *nf_service, } } -void ogs_sbi_nf_service_remove(ogs_sbi_nf_instance_t *nf_instance, - ogs_sbi_nf_service_t *nf_service) +void ogs_sbi_nf_service_clear(ogs_sbi_nf_service_t *nf_service) { + ogs_sbi_nf_instance_t *nf_instance = NULL; int i; - ogs_assert(nf_instance); ogs_assert(nf_service); - - ogs_list_remove(&nf_instance->nf_service_list, nf_service); - - ogs_assert(nf_service->id); - ogs_free(nf_service->id); - - ogs_assert(nf_service->name); - ogs_free(nf_service->name); + nf_instance = nf_service->nf_instance; + ogs_assert(nf_instance); for (i = 0; i < nf_service->num_of_version; i++) { if (nf_service->versions[i].in_uri) @@ -623,6 +584,28 @@ void ogs_sbi_nf_service_remove(ogs_sbi_nf_instance_t *nf_instance, if (nf_service->addr[i].ipv6) ogs_freeaddrinfo(nf_service->addr[i].ipv6); } +} + +void ogs_sbi_nf_service_remove(ogs_sbi_nf_service_t *nf_service) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + + ogs_assert(nf_service); + nf_instance = nf_service->nf_instance; + ogs_assert(nf_instance); + + ogs_list_remove(&nf_instance->nf_service_list, nf_service); + + ogs_assert(nf_service->id); + ogs_free(nf_service->id); + + ogs_assert(nf_service->name); + ogs_free(nf_service->name); + + ogs_sbi_nf_service_clear(nf_service); + + if (nf_service->client) + ogs_sbi_client_remove(nf_service->client); ogs_pool_free(&nf_service_pool, nf_service); } @@ -635,7 +618,7 @@ void ogs_sbi_nf_service_remove_all(ogs_sbi_nf_instance_t *nf_instance) ogs_list_for_each_safe(&nf_instance->nf_service_list, next_nf_service, nf_service) - ogs_sbi_nf_service_remove(nf_instance, nf_service); + ogs_sbi_nf_service_remove(nf_service); } ogs_sbi_nf_service_t *ogs_sbi_nf_service_find( @@ -655,11 +638,53 @@ ogs_sbi_nf_service_t *ogs_sbi_nf_service_find( return nf_service; } -ogs_sbi_nf_service_t *ogs_sbi_nf_service_build_default( - ogs_sbi_nf_instance_t *nf_instance, - char *name, ogs_sbi_client_t *client) +void ogs_sbi_nf_instance_build_default( + ogs_sbi_nf_instance_t *nf_instance, OpenAPI_nf_type_e nf_type) { ogs_sbi_server_t *server = NULL; + char *hostname = NULL; + + ogs_assert(nf_instance); + + nf_instance->nf_type = nf_type; + nf_instance->nf_status = OpenAPI_nf_status_REGISTERED; + + hostname = NULL; + ogs_list_for_each(&ogs_sbi_self()->server_list, server) { + ogs_assert(server->addr); + + /* First FQDN is selected */ + if (!hostname) { + hostname = ogs_gethostname(server->addr); + if (hostname) + continue; + } + + if (nf_instance->num_of_ipv4 < OGS_SBI_MAX_NUM_OF_IP_ADDRESS) { + ogs_sockaddr_t *addr = NULL; + ogs_copyaddrinfo(&addr, server->addr); + ogs_assert(addr); + + if (addr->ogs_sa_family == AF_INET) { + nf_instance->ipv4[nf_instance->num_of_ipv4] = addr; + nf_instance->num_of_ipv4++; + } else if (addr->ogs_sa_family == AF_INET6) { + nf_instance->ipv6[nf_instance->num_of_ipv6] = addr; + nf_instance->num_of_ipv6++; + } else + ogs_assert_if_reached(); + } + } + + if (hostname) + strcpy(nf_instance->fqdn, hostname); +} + +ogs_sbi_nf_service_t *ogs_sbi_nf_service_build_default( + ogs_sbi_nf_instance_t *nf_instance, char *name) +{ + ogs_sbi_server_t *server = NULL; + ogs_sbi_client_t *client = NULL; ogs_sbi_nf_service_t *nf_service = NULL; ogs_uuid_t uuid; char id[OGS_UUID_FORMATTED_LENGTH + 1]; @@ -667,11 +692,13 @@ ogs_sbi_nf_service_t *ogs_sbi_nf_service_build_default( ogs_assert(nf_instance); ogs_assert(name); - ogs_assert(client); ogs_uuid_get(&uuid); ogs_uuid_format(id, &uuid); + client = nf_instance->client; + ogs_assert(client); + nf_service = ogs_sbi_nf_service_add(nf_instance, id, name, (client->tls.key && client->tls.pem) ? OpenAPI_uri_scheme_https : OpenAPI_uri_scheme_http); @@ -744,7 +771,7 @@ static ogs_sbi_client_t *find_client_by_fqdn(char *fqdn, int port) return client; } -ogs_sbi_client_t *ogs_sbi_nf_instance_find_client( +static ogs_sbi_client_t *nf_instance_find_client( ogs_sbi_nf_instance_t *nf_instance) { ogs_sbi_client_t *client = NULL; @@ -767,13 +794,10 @@ ogs_sbi_client_t *ogs_sbi_nf_instance_find_client( } } - ogs_sbi_nf_service_find_client_all(nf_instance); - return client; } -ogs_sbi_client_t *ogs_sbi_nf_service_find_client( - ogs_sbi_nf_service_t *nf_service) +static void nf_service_associate_client(ogs_sbi_nf_service_t *nf_service) { ogs_sbi_client_t *client = NULL; ogs_sockaddr_t *addr = NULL; @@ -798,24 +822,121 @@ ogs_sbi_client_t *ogs_sbi_nf_service_find_client( } } - if (!client) { - ogs_sbi_nf_instance_t *nf_instance = NULL; - nf_instance = nf_service->nf_instance; - ogs_assert(nf_instance); - client = nf_instance->client; + if (client) { + if (nf_service->client && nf_service->client != client) { + ogs_warn("NF EndPoint updated [%s]", nf_service->id); + ogs_sbi_client_remove(nf_service->client); + } + OGS_SETUP_SBI_CLIENT(nf_service, client); } - - return client; } -void ogs_sbi_nf_service_find_client_all(ogs_sbi_nf_instance_t *nf_instance) +static void nf_service_associate_client_all(ogs_sbi_nf_instance_t *nf_instance) { ogs_sbi_nf_service_t *nf_service = NULL; ogs_assert(nf_instance); ogs_list_for_each(&nf_instance->nf_service_list, nf_service) - ogs_sbi_nf_service_find_client(nf_service); + nf_service_associate_client(nf_service); +} + +bool ogs_sbi_nf_types_associate( + ogs_sbi_nf_types_t nf_types, OpenAPI_nf_type_e nf_type, void *state) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + + if (nf_type == OpenAPI_nf_type_NRF) { + nf_instance = ogs_sbi_nf_instance_find(ogs_sbi_self()->nf_instance_id); + if (nf_instance) { + if (OGS_FSM_CHECK(&nf_instance->sm, state)) { + if (OGS_SBI_NF_INSTANCE_GET( + nf_types, OpenAPI_nf_type_NRF)) { + ogs_warn("UE %s-EndPoint updated [%s]", + OpenAPI_nf_type_ToString(OpenAPI_nf_type_NRF), + nf_instance->id); + ogs_sbi_nf_instance_remove( + nf_types[OpenAPI_nf_type_NRF].nf_instance); + } + OGS_SETUP_SBI_NF_INSTANCE( + &nf_types[OpenAPI_nf_type_NRF], nf_instance); + return true; + } + } + } + + ogs_list_for_each(&ogs_sbi_self()->nf_instance_list, nf_instance) { + if (nf_instance->nf_type == nf_type) { + if (OGS_FSM_CHECK(&nf_instance->sm, state)) { + if (OGS_SBI_NF_INSTANCE_GET(nf_types, nf_type)) { + ogs_warn("%s-EndPoint updated [%s]", + OpenAPI_nf_type_ToString(nf_type), + nf_instance->id); + ogs_sbi_nf_instance_remove( + nf_types[nf_type].nf_instance); + } + OGS_SETUP_SBI_NF_INSTANCE( + &nf_types[nf_type], nf_instance); + return true; + } + } + } + + return false; +} + +bool ogs_sbi_client_associate(ogs_sbi_nf_instance_t *nf_instance) +{ + ogs_sbi_client_t *client = NULL; + + ogs_assert(nf_instance); + + client = nf_instance_find_client(nf_instance); + if (!client) return false; + + if (nf_instance->client && nf_instance->client != client) { + ogs_warn("NF EndPoint updated [%s]", nf_instance->id); + ogs_sbi_client_remove(nf_instance->client); + } + + OGS_SETUP_SBI_CLIENT(nf_instance, client); + + nf_service_associate_client_all(nf_instance); + + return true; +} + +ogs_sbi_client_t *ogs_sbi_client_find_by_service_name( + ogs_sbi_nf_instance_t *nf_instance, char *name) +{ + ogs_sbi_nf_service_t *nf_service = NULL; + + ogs_assert(nf_instance); + ogs_assert(name); + + ogs_list_for_each(&nf_instance->nf_service_list, nf_service) { + ogs_assert(nf_service->name); + if (strcmp(nf_service->name, name) == 0) + break; + } + + if (nf_service) + return nf_service->client; + else + return nf_instance->client; +} + +ogs_sbi_nf_instance_t *ogs_sbi_nf_instance_find_by_nf_type( + OpenAPI_nf_type_e nf_type) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + + ogs_list_for_each(&ogs_sbi_self()->nf_instance_list, nf_instance) { + if (nf_instance->nf_type == nf_type) + break; + } + + return nf_instance; } ogs_sbi_subscription_t *ogs_sbi_subscription_add(void) @@ -860,6 +981,9 @@ void ogs_sbi_subscription_remove(ogs_sbi_subscription_t *subscription) if (subscription->t_validity) ogs_timer_delete(subscription->t_validity); + if (subscription->client) + ogs_sbi_client_remove(subscription->client); + ogs_pool_free(&subscription_pool, subscription); } diff --git a/lib/sbi/context.h b/lib/sbi/context.h index 540ee300d7..92fc1a847a 100644 --- a/lib/sbi/context.h +++ b/lib/sbi/context.h @@ -28,6 +28,8 @@ extern "C" { #endif +#define OGS_SBI_MAX_NF_TYPE 64 + typedef struct ogs_sbi_client_s ogs_sbi_client_t; typedef struct ogs_sbi_context_s { ogs_pollset_t *pollset; /* Poll Set for I/O Multiplexing */ @@ -48,6 +50,14 @@ typedef struct ogs_sbi_context_s { const char *content_encoding; } ogs_sbi_context_t; +#define OGS_SETUP_SBI_NF_INSTANCE(__cTX, __pNF_INSTANCE) \ + do { \ + ogs_assert((__cTX)); \ + ogs_assert((__pNF_INSTANCE)); \ + if ((__cTX)->nf_instance != __pNF_INSTANCE) \ + __pNF_INSTANCE->reference_count++; \ + (__cTX)->nf_instance = __pNF_INSTANCE; \ + } while(0) typedef struct ogs_sbi_nf_instance_s { ogs_lnode_t lnode; @@ -84,9 +94,16 @@ typedef struct ogs_sbi_nf_instance_s { ogs_list_t nf_service_list; - void *client; /* only used in CLIENT */ + void *client; /* only used in CLIENT */ + unsigned int reference_count; /* reference count for memory free */ } ogs_sbi_nf_instance_t; +#define OGS_SBI_NF_INSTANCE_GET(__aRRAY, __nFType) \ + ((__aRRAY)[__nFType].nf_instance) +typedef struct ogs_sbi_nf_types_s { + ogs_sbi_nf_instance_t *nf_instance; +} ogs_sbi_nf_types_t[OGS_SBI_MAX_NF_TYPE]; + typedef struct ogs_sbi_nf_service_s { ogs_lnode_t lnode; @@ -145,28 +162,30 @@ void ogs_sbi_nf_instance_clear(ogs_sbi_nf_instance_t *nf_instance); void ogs_sbi_nf_instance_remove(ogs_sbi_nf_instance_t *nf_instance); void ogs_sbi_nf_instance_remove_all(void); ogs_sbi_nf_instance_t *ogs_sbi_nf_instance_find(char *id); - -ogs_sbi_nf_instance_t *ogs_sbi_nf_instance_build_default( - OpenAPI_nf_type_e nf_type, ogs_sbi_client_t *client); +ogs_sbi_nf_instance_t *ogs_sbi_nf_instance_find_by_nf_type( + OpenAPI_nf_type_e nf_type); ogs_sbi_nf_service_t *ogs_sbi_nf_service_add(ogs_sbi_nf_instance_t *nf_instance, char *id, char *name, OpenAPI_uri_scheme_e scheme); void ogs_sbi_nf_service_add_version(ogs_sbi_nf_service_t *nf_service, char *in_uri, char *full, char *expiry); -void ogs_sbi_nf_service_remove(ogs_sbi_nf_instance_t *nf_instance, - ogs_sbi_nf_service_t *nf_service); +void ogs_sbi_nf_service_clear(ogs_sbi_nf_service_t *nf_service); +void ogs_sbi_nf_service_remove(ogs_sbi_nf_service_t *nf_service); void ogs_sbi_nf_service_remove_all(ogs_sbi_nf_instance_t *nf_instance); ogs_sbi_nf_service_t *ogs_sbi_nf_service_find( ogs_sbi_nf_instance_t *nf_instance, char *name); -ogs_sbi_nf_service_t *ogs_sbi_nf_service_build_default( - ogs_sbi_nf_instance_t *nf_instance, - char *name, ogs_sbi_client_t *client); -ogs_sbi_client_t *ogs_sbi_nf_instance_find_client( - ogs_sbi_nf_instance_t *nf_instance); -ogs_sbi_client_t *ogs_sbi_nf_service_find_client( - ogs_sbi_nf_service_t *nf_service); -void ogs_sbi_nf_service_find_client_all(ogs_sbi_nf_instance_t *nf_instance); +void ogs_sbi_nf_instance_build_default( + ogs_sbi_nf_instance_t *nf_instance, OpenAPI_nf_type_e nf_type); +ogs_sbi_nf_service_t *ogs_sbi_nf_service_build_default( + ogs_sbi_nf_instance_t *nf_instance, char *name); + +ogs_sbi_client_t *ogs_sbi_client_find_by_service_name( + ogs_sbi_nf_instance_t *nf_instance, char *name); + +bool ogs_sbi_client_associate(ogs_sbi_nf_instance_t *nf_instance); +bool ogs_sbi_nf_types_associate( + ogs_sbi_nf_types_t nf_types, OpenAPI_nf_type_e nf_type, void *state); ogs_sbi_subscription_t *ogs_sbi_subscription_add(void); void ogs_sbi_subscription_set_id( diff --git a/lib/sbi/conv.c b/lib/sbi/conv.c index 3efeb5ecc0..a03dbdced1 100644 --- a/lib/sbi/conv.c +++ b/lib/sbi/conv.c @@ -21,18 +21,15 @@ #include "sbi-private.h" -static char *ogs_uridup(bool https, ogs_sockaddr_t *addr, - const char *service_name, const char *api_version, - const char *resource_name, const char *resource_id) +static char *ogs_uridup(bool https, ogs_sockaddr_t *addr, ogs_sbi_header_t *h) { char buf[OGS_ADDRSTRLEN]; char url[OGS_HUGE_LEN]; char *p, *last; + int i; ogs_assert(addr); - ogs_assert(service_name); - ogs_assert(api_version); - ogs_assert(resource_name); + ogs_assert(h); p = url; last = url + OGS_HUGE_LEN; @@ -55,42 +52,44 @@ static char *ogs_uridup(bool https, ogs_sockaddr_t *addr, } /* API */ - ogs_assert(service_name); - p = ogs_slprintf(p, last, "/%s", service_name); - ogs_assert(api_version); - p = ogs_slprintf(p, last, "/%s", api_version); + ogs_assert(h->service.name); + p = ogs_slprintf(p, last, "/%s", h->service.name); + ogs_assert(h->api.version); + p = ogs_slprintf(p, last, "/%s", h->api.version); /* Resource */ - ogs_assert(resource_name); - p = ogs_slprintf(p, last, "/%s", resource_name); - if (resource_id) - p = ogs_slprintf(p, last, "/%s", resource_id); + ogs_assert(h->resource.component[0]); + for (i = 0; i < OGS_SBI_MAX_NUM_OF_RESOURCE_COMPONENT && + h->resource.component[i]; i++) + p = ogs_slprintf(p, last, "/%s", h->resource.component[i]); return ogs_strdup(url); } -char *ogs_sbi_server_uri(ogs_sbi_server_t *server, - const char *service_name, const char *api_version, - const char *resource_name, const char *resource_id) +char *ogs_sbi_server_uri(ogs_sbi_server_t *server, ogs_sbi_header_t *h) { bool https = false; + + ogs_assert(server); + ogs_assert(h); + if (server->tls.key && server->tls.pem) https = true; - return ogs_uridup(https, server->addr, service_name, api_version, - resource_name, resource_id); + return ogs_uridup(https, server->addr, h); } -char *ogs_sbi_client_uri(ogs_sbi_client_t *client, - const char *service_name, const char *api_version, - const char *resource_name, const char *resource_id) +char *ogs_sbi_client_uri(ogs_sbi_client_t *client, ogs_sbi_header_t *h) { bool https = false; + + ogs_assert(client); + ogs_assert(h); + if (client->tls.key && client->tls.pem) https = true; - return ogs_uridup(https, client->addr, service_name, api_version, - resource_name, resource_id); + return ogs_uridup(https, client->addr, h); } /** diff --git a/lib/sbi/conv.h b/lib/sbi/conv.h index 0f427f2a5a..cf9bcd2b1e 100644 --- a/lib/sbi/conv.h +++ b/lib/sbi/conv.h @@ -30,14 +30,10 @@ extern "C" { typedef struct ogs_sbi_server_s ogs_sbi_server_t; typedef struct ogs_sbi_client_s ogs_sbi_client_t; +typedef struct ogs_sbi_header_s ogs_sbi_header_t; -char *ogs_sbi_server_uri(ogs_sbi_server_t *server, - const char *service_name, const char *api_version, - const char *resource_name, const char *resource_id); - -char *ogs_sbi_client_uri(ogs_sbi_client_t *client, - const char *service_name, const char *api_version, - const char *resource_name, const char *resource_id); +char *ogs_sbi_server_uri(ogs_sbi_server_t *server, ogs_sbi_header_t *h); +char *ogs_sbi_client_uri(ogs_sbi_client_t *client, ogs_sbi_header_t *h); char *ogs_sbi_parse_url(char *url, const char *delim, char **saveptr); ogs_sockaddr_t *ogs_sbi_getaddr_from_uri(char *uri); diff --git a/lib/sbi/meson.build b/lib/sbi/meson.build index ad247d4531..e2be9ccb1d 100644 --- a/lib/sbi/meson.build +++ b/lib/sbi/meson.build @@ -30,6 +30,7 @@ libsbi_sources = files(''' nnrf-build.c nnrf-handler.c + path.c '''.split()) libsbi_inc = include_directories('.') diff --git a/lib/sbi/message.c b/lib/sbi/message.c index 95afad7067..1ccb87c22a 100644 --- a/lib/sbi/message.c +++ b/lib/sbi/message.c @@ -57,6 +57,26 @@ void ogs_sbi_message_free(ogs_sbi_message_t *message) OpenAPI_notification_data_free(message->NotificationData); if (message->SearchResult) OpenAPI_search_result_free(message->SearchResult); + if (message->AuthenticationInfo) + OpenAPI_authentication_info_free(message->AuthenticationInfo); + if (message->AuthenticationInfoRequest) + OpenAPI_authentication_info_request_free( + message->AuthenticationInfoRequest); + if (message->AuthenticationInfoResult) + OpenAPI_authentication_info_result_free( + message->AuthenticationInfoResult); + if (message->AuthenticationSubscription) + OpenAPI_authentication_subscription_free( + message->AuthenticationSubscription); + if (message->UeAuthenticationCtx) + OpenAPI_ue_authentication_ctx_free(message->UeAuthenticationCtx); + if (message->ConfirmationData) + OpenAPI_confirmation_data_free(message->ConfirmationData); + if (message->ConfirmationDataResponse) + OpenAPI_confirmation_data_response_free( + message->ConfirmationDataResponse); + if (message->AuthEvent) + OpenAPI_auth_event_free(message->AuthEvent); } ogs_sbi_request_t *ogs_sbi_request_new(void) @@ -119,13 +139,16 @@ void ogs_sbi_response_free(ogs_sbi_response_t *response) static void sbi_header_free(ogs_sbi_header_t *h) { + int i; ogs_assert(h); if (h->method) ogs_free(h->method); if (h->service.name) ogs_free(h->service.name); if (h->api.version) ogs_free(h->api.version); - if (h->resource.name) ogs_free(h->resource.name); - if (h->resource.id) ogs_free(h->resource.id); + + for (i = 0; i < OGS_SBI_MAX_NUM_OF_RESOURCE_COMPONENT && + h->resource.component[i]; i++) + ogs_free(h->resource.component[i]); } static void http_message_free(http_message_t *http) @@ -168,14 +191,18 @@ ogs_sbi_request_t *ogs_sbi_build_request(ogs_sbi_message_t *message) if (message->h.url) { request->h.url = ogs_strdup(message->h.url); } else { + int i; + ogs_assert(message->h.service.name); request->h.service.name = ogs_strdup(message->h.service.name); ogs_assert(message->h.api.version); request->h.api.version = ogs_strdup(message->h.api.version); - ogs_assert(message->h.resource.name); - request->h.resource.name = ogs_strdup(message->h.resource.name); - if (message->h.resource.id) - request->h.resource.id = ogs_strdup(message->h.resource.id); + + ogs_assert(message->h.resource.component[0]); + for (i = 0; i < OGS_SBI_MAX_NUM_OF_RESOURCE_COMPONENT && + message->h.resource.component[i]; i++) + request->h.resource.component[i] = ogs_strdup( + message->h.resource.component[i]); } /* URL Param */ @@ -213,6 +240,22 @@ ogs_sbi_request_t *ogs_sbi_build_request(ogs_sbi_message_t *message) OGS_SBI_CONTENT_TYPE, OGS_SBI_CONTENT_JSON_TYPE); } + if (message->http.accept) { + ogs_sbi_header_set(request->http.headers, OGS_SBI_ACCEPT, + message->http.accept); + } else { + SWITCH(message->h.method) + CASE(OGS_SBI_HTTP_METHOD_DELETE) + ogs_sbi_header_set(request->http.headers, OGS_SBI_ACCEPT, + OGS_SBI_CONTENT_PROBLEM_TYPE); + break; + DEFAULT + ogs_sbi_header_set(request->http.headers, OGS_SBI_ACCEPT, + OGS_SBI_CONTENT_JSON_TYPE "," OGS_SBI_CONTENT_PROBLEM_TYPE); + break; + END + } + if (message->http.content_encoding) ogs_sbi_header_set(request->http.headers, OGS_SBI_ACCEPT_ENCODING, message->http.content_encoding); @@ -220,7 +263,8 @@ ogs_sbi_request_t *ogs_sbi_build_request(ogs_sbi_message_t *message) return request; } -ogs_sbi_response_t *ogs_sbi_build_response(ogs_sbi_message_t *message) +ogs_sbi_response_t *ogs_sbi_build_response( + ogs_sbi_message_t *message, int status) { ogs_sbi_response_t *response = NULL; @@ -229,19 +273,25 @@ ogs_sbi_response_t *ogs_sbi_build_response(ogs_sbi_message_t *message) response = ogs_sbi_response_new(); ogs_assert(response); + response->status = status; + /* HTTP Message */ - response->http.content = build_content(message); - if (response->http.content) { - if (message->http.content_type) - ogs_sbi_header_set(response->http.headers, - OGS_SBI_CONTENT_TYPE, message->http.content_type); - else - ogs_sbi_header_set(response->http.headers, - OGS_SBI_CONTENT_TYPE, OGS_SBI_CONTENT_JSON_TYPE); + if (response->status != OGS_SBI_HTTP_STATUS_NO_CONTENT) { + response->http.content = build_content(message); + if (response->http.content) { + if (message->http.content_type) + ogs_sbi_header_set(response->http.headers, + OGS_SBI_CONTENT_TYPE, message->http.content_type); + else + ogs_sbi_header_set(response->http.headers, + OGS_SBI_CONTENT_TYPE, OGS_SBI_CONTENT_JSON_TYPE); + } } - if (message->http.location == true) - ogs_sbi_header_set(response->http.headers, "Location", message->h.url); + if (message->http.location) { + ogs_sbi_header_set(response->http.headers, "Location", + message->http.location); + } if (message->http.cache_control) ogs_sbi_header_set(response->http.headers, "Cache-Control", message->http.cache_control); @@ -286,6 +336,37 @@ static char *build_content(ogs_sbi_message_t *message) } else if (message->links) { item = ogs_sbi_links_convertToJSON(message->links); ogs_assert(item); + } else if (message->AuthenticationInfo) { + item = OpenAPI_authentication_info_convertToJSON( + message->AuthenticationInfo); + ogs_assert(item); + } else if (message->AuthenticationInfoRequest) { + item = OpenAPI_authentication_info_request_convertToJSON( + message->AuthenticationInfoRequest); + ogs_assert(item); + } else if (message->AuthenticationInfoResult) { + item = OpenAPI_authentication_info_result_convertToJSON( + message->AuthenticationInfoResult); + ogs_assert(item); + } else if (message->AuthenticationSubscription) { + item = OpenAPI_authentication_subscription_convertToJSON( + message->AuthenticationSubscription); + ogs_assert(item); + } else if (message->UeAuthenticationCtx) { + item = OpenAPI_ue_authentication_ctx_convertToJSON( + message->UeAuthenticationCtx); + ogs_assert(item); + } else if (message->ConfirmationData) { + item = OpenAPI_confirmation_data_convertToJSON( + message->ConfirmationData); + ogs_assert(item); + } else if (message->ConfirmationDataResponse) { + item = OpenAPI_confirmation_data_response_convertToJSON( + message->ConfirmationDataResponse); + ogs_assert(item); + } else if (message->AuthEvent) { + item = OpenAPI_auth_event_convertToJSON(message->AuthEvent); + ogs_assert(item); } if (item) { @@ -341,6 +422,8 @@ int ogs_sbi_parse_request( message->http.content_encoding = ogs_hash_this_val(hi); } else if (!strcmp(ogs_hash_this_key(hi), OGS_SBI_CONTENT_TYPE)) { message->http.content_type = ogs_hash_this_val(hi); + } else if (!strcmp(ogs_hash_this_key(hi), OGS_SBI_ACCEPT)) { + message->http.accept = ogs_hash_this_val(hi); } } @@ -369,18 +452,19 @@ int ogs_sbi_parse_response( for (hi = ogs_hash_first(response->http.headers); hi; hi = ogs_hash_next(hi)) { - if (!strcmp(ogs_hash_this_key(hi), OGS_SBI_CONTENT_TYPE)) { + if (!strcmp(ogs_hash_this_key(hi), OGS_SBI_CONTENT_TYPE)) message->http.content_type = ogs_hash_this_val(hi); - } + else if (!strcmp(ogs_hash_this_key(hi), OGS_SBI_LOCATION)) + message->http.location = ogs_hash_this_val(hi); } + message->res_status = response->status; + if (parse_content(message, response->http.content) != OGS_OK) { ogs_error("parse_content() failed"); return OGS_ERROR; } - message->res_status = response->status; - return OGS_OK; } @@ -391,6 +475,9 @@ static int parse_sbi_header( char *saveptr = NULL; char *url = NULL, *p = NULL;; + char *component = NULL; + int i = 0; + ogs_assert(message); ogs_assert(header); @@ -432,16 +519,12 @@ static int parse_sbi_header( } message->h.api.version = header->api.version; - header->resource.name = ogs_sbi_parse_url(NULL, "/", &saveptr); - if (!header->resource.name) { - ogs_error("ogs_sbi_parse_url() failed"); - ogs_free(url); - return OGS_ERROR; + for (i = 0; i < OGS_SBI_MAX_NUM_OF_RESOURCE_COMPONENT && + (component = ogs_sbi_parse_url(NULL, "/", &saveptr)) != NULL; + i++) { + header->resource.component[i] = component; + message->h.resource.component[i] = component; } - message->h.resource.name = header->resource.name; - - header->resource.id = ogs_sbi_parse_url(NULL, "/", &saveptr); - message->h.resource.id = header->resource.id; ogs_free(url); @@ -495,9 +578,9 @@ static int parse_content(ogs_sbi_message_t *message, char *content) } } else { SWITCH(message->h.service.name) - CASE(OGS_SBI_SERVICE_NAME_NRF_NFM) + CASE(OGS_SBI_SERVICE_NAME_NNRF_NFM) - SWITCH(message->h.resource.name) + SWITCH(message->h.resource.component[0]) CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES) message->NFProfile = OpenAPI_nf_profile_parseFromJSON(item); @@ -528,12 +611,12 @@ static int parse_content(ogs_sbi_message_t *message, char *content) DEFAULT rv = OGS_ERROR; ogs_error("Unknown resource name [%s]", - message->h.resource.name); + message->h.resource.component[0]); END break; - CASE(OGS_SBI_SERVICE_NAME_NRF_DISC) - SWITCH(message->h.resource.name) + CASE(OGS_SBI_SERVICE_NAME_NNRF_DISC) + SWITCH(message->h.resource.component[0]) CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES) message->SearchResult = OpenAPI_search_result_parseFromJSON(item); @@ -546,10 +629,153 @@ static int parse_content(ogs_sbi_message_t *message, char *content) DEFAULT rv = OGS_ERROR; ogs_error("Unknown resource name [%s]", - message->h.resource.name); + message->h.resource.component[0]); END break; + CASE(OGS_SBI_SERVICE_NAME_NAUSF_AUTH) + SWITCH(message->h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_UE_AUTHENTICATIONS) + SWITCH(message->h.method) + CASE(OGS_SBI_HTTP_METHOD_POST) + if (message->res_status == + OGS_SBI_HTTP_STATUS_CREATED) { + message->UeAuthenticationCtx = + OpenAPI_ue_authentication_ctx_parseFromJSON(item); + if (!message->UeAuthenticationCtx) { + rv = OGS_ERROR; + ogs_error("JSON parse error"); + } + } else { + message->AuthenticationInfo = + OpenAPI_authentication_info_parseFromJSON(item); + if (!message->AuthenticationInfo) { + rv = OGS_ERROR; + ogs_error("JSON parse error"); + } + } + break; + CASE(OGS_SBI_HTTP_METHOD_PUT) + if (message->res_status == OGS_SBI_HTTP_STATUS_OK) { + message->ConfirmationDataResponse = + OpenAPI_confirmation_data_response_parseFromJSON(item); + if (!message->ConfirmationDataResponse) { + rv = OGS_ERROR; + ogs_error("JSON parse error"); + } + } else { + message->ConfirmationData = + OpenAPI_confirmation_data_parseFromJSON(item); + if (!message->ConfirmationData) { + rv = OGS_ERROR; + ogs_error("JSON parse error"); + } + } + break; + DEFAULT + rv = OGS_ERROR; + ogs_error("Unknown method [%s]", message->h.method); + END + break; + + DEFAULT + rv = OGS_ERROR; + ogs_error("Unknown resource name [%s]", + message->h.resource.component[0]); + END + break; + + CASE(OGS_SBI_SERVICE_NAME_NUDM_UEAU) + SWITCH(message->h.resource.component[1]) + CASE(OGS_SBI_RESOURCE_NAME_SECURITY_INFORMATION) + SWITCH(message->h.resource.component[2]) + CASE(OGS_SBI_RESOURCE_NAME_GENERATE_AUTH_DATA) + if (message->res_status == OGS_SBI_HTTP_STATUS_OK) { + message->AuthenticationInfoResult = + OpenAPI_authentication_info_result_parseFromJSON( + item); + if (!message->AuthenticationInfoResult) { + rv = OGS_ERROR; + ogs_error("JSON parse error"); + } + } else { + message->AuthenticationInfoRequest = + OpenAPI_authentication_info_request_parseFromJSON( + item); + if (!message->AuthenticationInfoRequest) { + rv = OGS_ERROR; + ogs_error("JSON parse error"); + } + } + break; + DEFAULT + rv = OGS_ERROR; + ogs_error("Unknown resource name [%s]", + message->h.resource.component[2]); + END + break; + + CASE(OGS_SBI_RESOURCE_NAME_AUTH_EVENTS) + message->AuthEvent = OpenAPI_auth_event_parseFromJSON(item); + if (!message->AuthEvent) { + rv = OGS_ERROR; + ogs_error("JSON parse error"); + } + break; + + DEFAULT + rv = OGS_ERROR; + ogs_error("Unknown resource name [%s]", + message->h.resource.component[1]); + END + break; + + CASE(OGS_SBI_SERVICE_NAME_NUDR_DR) + SWITCH(message->h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_SUBSCRIPTION_DATA) + SWITCH(message->h.resource.component[2]) + CASE(OGS_SBI_RESOURCE_NAME_AUTHENTICATION_DATA) + SWITCH(message->h.resource.component[3]) + CASE(OGS_SBI_RESOURCE_NAME_AUTHENTICATION_SUBSCRIPTION) + if (message->res_status == OGS_SBI_HTTP_STATUS_OK) { + message->AuthenticationSubscription = + OpenAPI_authentication_subscription_parseFromJSON(item); + if (!message->AuthenticationSubscription) { + rv = OGS_ERROR; + ogs_error("JSON parse error"); + } + } + break; + CASE(OGS_SBI_RESOURCE_NAME_AUTHENTICATION_STATUS) + message->AuthEvent = + OpenAPI_auth_event_parseFromJSON(item); + if (!message->AuthEvent) { + rv = OGS_ERROR; + ogs_error("JSON parse error"); + } + break; + DEFAULT + rv = OGS_ERROR; + ogs_error("Unknown resource name [%s]", + message->h.resource.component[3]); + END + break; + + DEFAULT + rv = OGS_ERROR; + ogs_error("Unknown resource name [%s]", + message->h.resource.component[2]); + END + break; + + DEFAULT + rv = OGS_ERROR; + ogs_error("Unknown resource name [%s]", + message->h.resource.component[0]); + END + break; + + DEFAULT rv = OGS_ERROR; ogs_error("Not implemented API name [%s]", diff --git a/lib/sbi/message.h b/lib/sbi/message.h index b5d63bb4ef..afbeed4e3a 100644 --- a/lib/sbi/message.h +++ b/lib/sbi/message.h @@ -77,22 +77,45 @@ extern "C" { #define OGS_SBI_API_VERSION "v1" #define OGS_SBI_API_FULL_VERSION "1.0.0" -#define OGS_SBI_SERVICE_NAME_NRF_NFM "nnrf-nfm" -#define OGS_SBI_SERVICE_NAME_NRF_DISC "nnrf-disc" -#define OGS_SBI_SERVICE_NAME_SMF_PDUSESSION "nsmf-pdusession" -#define OGS_SBI_SERVICE_NAME_SMF_EVENT_EXPOSURE "nsmf-event-exposure" +#define OGS_SBI_SERVICE_NAME_NNRF_NFM "nnrf-nfm" +#define OGS_SBI_SERVICE_NAME_NNRF_DISC "nnrf-disc" #define OGS_SBI_RESOURCE_NAME_NF_INSTANCES "nf-instances" #define OGS_SBI_RESOURCE_NAME_SUBSCRIPTIONS "subscriptions" #define OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY "nf-status-notify" +#define OGS_SBI_SERVICE_NAME_NAUSF_AUTH "nausf-auth" +#define OGS_SBI_RESOURCE_NAME_UE_AUTHENTICATIONS "ue-authentications" +#define OGS_SBI_RESOURCE_NAME_5G_AKA "5g-aka" +#define OGS_SBI_RESOURCE_NAME_5G_AKA_CONFIRMATION "5g-aka-confirmation" +#define OGS_SBI_RESOURCE_NAME_EAP_SESSION "eap-session" + +#define OGS_SBI_SERVICE_NAME_NUDM_SDM "nudm-sdm" +#define OGS_SBI_SERVICE_NAME_NUDM_UECM "nudm-uecm" +#define OGS_SBI_SERVICE_NAME_NUDM_UEAU "nudm-ueau" +#define OGS_SBI_RESOURCE_NAME_SECURITY_INFORMATION "security-information" +#define OGS_SBI_RESOURCE_NAME_GENERATE_AUTH_DATA "generate-auth-data" +#define OGS_SBI_RESOURCE_NAME_AUTH_EVENTS "auth-events" + +#define OGS_SBI_SERVICE_NAME_NUDR_DR "nudr-dr" +#define OGS_SBI_RESOURCE_NAME_SUBSCRIPTION_DATA "subscription-data" +#define OGS_SBI_RESOURCE_NAME_AUTHENTICATION_DATA "authentication-data" +#define OGS_SBI_RESOURCE_NAME_AUTHENTICATION_SUBSCRIPTION \ + "authentication-subscription" +#define OGS_SBI_RESOURCE_NAME_AUTHENTICATION_STATUS "authentication-status" + +#define OGS_SBI_SERVICE_NAME_NSMF_PDUSESSION "nsmf-pdusession" +#define OGS_SBI_SERVICE_NAME_NSMF_EVENT_EXPOSURE "nsmf-event-exposure" + #define OGS_SBI_PARAM_NF_TYPE "nf-type" #define OGS_SBI_PARAM_TARGET_NF_TYPE "target-nf-type" #define OGS_SBI_PARAM_REQUESTER_NF_TYPE "requester-nf-type" #define OGS_SBI_PARAM_LIMIT "limit" +#define OGS_SBI_ACCEPT "Accept" #define OGS_SBI_ACCEPT_ENCODING "Accept-Encoding" #define OGS_SBI_CONTENT_TYPE "Content-Type" +#define OGS_SBI_LOCATION "Location" #define OGS_SBI_CONTENT_JSON_TYPE "application/json" #define OGS_SBI_CONTENT_PROBLEM_TYPE "application/problem+json" #define OGS_SBI_CONTENT_PATCH_TYPE \ @@ -115,18 +138,20 @@ typedef struct ogs_sbi_header_s { } api; struct { - char *name; - char *id; +#define OGS_SBI_MAX_NUM_OF_RESOURCE_COMPONENT 8 + char *component[OGS_SBI_MAX_NUM_OF_RESOURCE_COMPONENT]; } resource; + } ogs_sbi_header_t; typedef struct ogs_sbi_message_s { ogs_sbi_header_t h; struct { + char *accept; char *content_encoding; char *content_type; - bool location; + char *location; char *cache_control; } http; @@ -146,6 +171,14 @@ typedef struct ogs_sbi_message_s { OpenAPI_subscription_data_t *SubscriptionData; OpenAPI_notification_data_t *NotificationData; OpenAPI_search_result_t *SearchResult; + OpenAPI_authentication_info_t *AuthenticationInfo; + OpenAPI_authentication_info_request_t *AuthenticationInfoRequest; + OpenAPI_authentication_info_result_t *AuthenticationInfoResult; + OpenAPI_authentication_subscription_t *AuthenticationSubscription; + OpenAPI_ue_authentication_ctx_t *UeAuthenticationCtx; + OpenAPI_confirmation_data_t *ConfirmationData; + OpenAPI_confirmation_data_response_t *ConfirmationDataResponse; + OpenAPI_auth_event_t *AuthEvent; ogs_sbi_links_t *links; } ogs_sbi_message_t; @@ -163,7 +196,8 @@ int ogs_sbi_parse_request( ogs_sbi_response_t *ogs_sbi_response_new(void); void ogs_sbi_response_free(ogs_sbi_response_t *response); -ogs_sbi_response_t *ogs_sbi_build_response(ogs_sbi_message_t *message); +ogs_sbi_response_t *ogs_sbi_build_response( + ogs_sbi_message_t *message, int status); int ogs_sbi_parse_response( ogs_sbi_message_t *message, ogs_sbi_response_t *response); diff --git a/lib/sbi/nnrf-build.c b/lib/sbi/nnrf-build.c index 2037ec879d..59acb89fd6 100644 --- a/lib/sbi/nnrf-build.c +++ b/lib/sbi/nnrf-build.c @@ -17,9 +17,9 @@ * along with this program. If not, see . */ -#include "nnrf-build.h" +#include "ogs-sbi.h" -OpenAPI_nf_profile_t *ogs_sbi_nnrf_build_nf_profile( +OpenAPI_nf_profile_t *ogs_nnrf_nfm_build_nf_profile( ogs_sbi_nf_instance_t *nf_instance) { ogs_sbi_nf_service_t *nf_service = NULL; @@ -212,3 +212,198 @@ void ogs_sbi_nnrf_free_nf_profile(OpenAPI_nf_profile_t *NFProfile) ogs_free(NFProfile); } + +ogs_sbi_request_t *ogs_nnrf_nfm_build_register( + ogs_sbi_nf_instance_t *nf_instance) +{ + ogs_sbi_message_t message; + ogs_sbi_request_t *request = NULL; + ogs_sbi_client_t *client = NULL; + + OpenAPI_nf_profile_t *NFProfile = NULL; + + ogs_assert(nf_instance); + client = nf_instance->client; + ogs_assert(client); + + memset(&message, 0, sizeof(message)); + message.h.method = (char *)OGS_SBI_HTTP_METHOD_PUT; + message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NNRF_NFM; + message.h.api.version = (char *)OGS_SBI_API_VERSION; + message.h.resource.component[0] = + (char *)OGS_SBI_RESOURCE_NAME_NF_INSTANCES; + message.h.resource.component[1] = ogs_sbi_self()->nf_instance_id; + + message.http.content_encoding = (char*)ogs_sbi_self()->content_encoding; + + NFProfile = ogs_nnrf_nfm_build_nf_profile(nf_instance); + ogs_assert(NFProfile); + + NFProfile->heart_beat_timer = nf_instance->time.heartbeat; + + message.NFProfile = NFProfile; + + request = ogs_sbi_build_request(&message); + ogs_assert(request); + + ogs_sbi_nnrf_free_nf_profile(NFProfile); + + return request; +} + +ogs_sbi_request_t *ogs_nnrf_nfm_build_update(ogs_sbi_nf_instance_t *nf_instance) +{ + ogs_sbi_message_t message; + ogs_sbi_request_t *request = NULL; + + OpenAPI_list_t *PatchItemList; + OpenAPI_patch_item_t item; + + ogs_assert(nf_instance); + + memset(&message, 0, sizeof(message)); + message.h.method = (char *)OGS_SBI_HTTP_METHOD_PATCH; + message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NNRF_NFM; + message.h.api.version = (char *)OGS_SBI_API_VERSION; + message.h.resource.component[0] = + (char *)OGS_SBI_RESOURCE_NAME_NF_INSTANCES; + message.h.resource.component[1] = ogs_sbi_self()->nf_instance_id; + message.http.content_type = (char *)OGS_SBI_CONTENT_PATCH_TYPE; + + PatchItemList = OpenAPI_list_create(); + ogs_assert(PatchItemList); + + memset(&item, 0, sizeof(item)); + item.op = OpenAPI_patch_operation_replace; + item.path = (char *)"/nfStatus"; + item.value = OpenAPI_nf_status_ToString(OpenAPI_nf_status_REGISTERED); + + OpenAPI_list_add(PatchItemList, &item); + + message.PatchItemList = PatchItemList; + + request = ogs_sbi_build_request(&message); + ogs_assert(request); + + OpenAPI_list_free(PatchItemList); + + return request; +} + +ogs_sbi_request_t *ogs_nnrf_nfm_build_de_register( + ogs_sbi_nf_instance_t *nf_instance) +{ + ogs_sbi_message_t message; + ogs_sbi_request_t *request = NULL; + + ogs_assert(nf_instance); + + memset(&message, 0, sizeof(message)); + message.h.method = (char *)OGS_SBI_HTTP_METHOD_DELETE; + message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NNRF_NFM; + message.h.api.version = (char *)OGS_SBI_API_VERSION; + message.h.resource.component[0] = + (char *)OGS_SBI_RESOURCE_NAME_NF_INSTANCES; + message.h.resource.component[1] = nf_instance->id; + + request = ogs_sbi_build_request(&message); + ogs_assert(request); + + return request; +} + +ogs_sbi_request_t *ogs_nnrf_nfm_build_status_subscribe( + ogs_sbi_subscription_t *subscription) +{ + ogs_sbi_message_t message; + ogs_sbi_header_t header; + ogs_sbi_request_t *request = NULL; + ogs_sbi_server_t *server = NULL; + + OpenAPI_subscription_data_t *SubscriptionData = NULL; + + ogs_assert(subscription); + ogs_assert(subscription->nf_type); + + memset(&message, 0, sizeof(message)); + message.h.method = (char *)OGS_SBI_HTTP_METHOD_POST; + message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NNRF_NFM; + message.h.api.version = (char *)OGS_SBI_API_VERSION; + message.h.resource.component[0] = + (char *)OGS_SBI_RESOURCE_NAME_SUBSCRIPTIONS; + + SubscriptionData = ogs_calloc(1, sizeof(*SubscriptionData)); + ogs_assert(SubscriptionData); + + server = ogs_list_first(&ogs_sbi_self()->server_list); + ogs_assert(server); + + memset(&header, 0, sizeof(header)); + header.service.name = (char *)OGS_SBI_SERVICE_NAME_NNRF_NFM; + header.api.version = (char *)OGS_SBI_API_VERSION; + header.resource.component[0] = + (char *)OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY; + SubscriptionData->nf_status_notification_uri = + ogs_sbi_server_uri(server, &header); + ogs_assert(SubscriptionData->nf_status_notification_uri); + + SubscriptionData->req_nf_type = subscription->nf_type; + SubscriptionData->req_nf_instance_id = subscription->nf_instance_id; + + message.SubscriptionData = SubscriptionData; + + request = ogs_sbi_build_request(&message); + ogs_assert(request); + + ogs_free(SubscriptionData->nf_status_notification_uri); + ogs_free(SubscriptionData); + + return request; +} + +ogs_sbi_request_t *ogs_nnrf_nfm_build_status_unsubscribe( + ogs_sbi_subscription_t *subscription) +{ + ogs_sbi_message_t message; + ogs_sbi_request_t *request = NULL; + + ogs_assert(subscription); + + memset(&message, 0, sizeof(message)); + message.h.method = (char *)OGS_SBI_HTTP_METHOD_DELETE; + message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NNRF_NFM; + message.h.api.version = (char *)OGS_SBI_API_VERSION; + message.h.resource.component[0] = + (char *)OGS_SBI_RESOURCE_NAME_SUBSCRIPTIONS; + message.h.resource.component[1] = subscription->id; + + request = ogs_sbi_build_request(&message); + ogs_assert(request); + + return request; +} + +ogs_sbi_request_t *ogs_nnrf_disc_build_discover( + OpenAPI_nf_type_e target_nf_type, OpenAPI_nf_type_e requester_nf_type) +{ + ogs_sbi_message_t message; + ogs_sbi_request_t *request = NULL; + + ogs_assert(target_nf_type); + ogs_assert(requester_nf_type); + + memset(&message, 0, sizeof(message)); + message.h.method = (char *)OGS_SBI_HTTP_METHOD_GET; + message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NNRF_DISC; + message.h.api.version = (char *)OGS_SBI_API_VERSION; + message.h.resource.component[0] = + (char *)OGS_SBI_RESOURCE_NAME_NF_INSTANCES; + + message.param.target_nf_type = target_nf_type; + message.param.requester_nf_type = requester_nf_type; + + request = ogs_sbi_build_request(&message); + ogs_assert(request); + + return request; +} diff --git a/lib/sbi/nnrf-build.h b/lib/sbi/nnrf-build.h index abbb789885..2272b5bbe3 100644 --- a/lib/sbi/nnrf-build.h +++ b/lib/sbi/nnrf-build.h @@ -20,17 +20,29 @@ #ifndef OGS_NNRF_BUILD_H #define OGS_NNRF_BUILD_H -#include "ogs-sbi.h" -#include "context.h" - #ifdef __cplusplus extern "C" { #endif -OpenAPI_nf_profile_t *ogs_sbi_nnrf_build_nf_profile( +OpenAPI_nf_profile_t *ogs_nnrf_nfm_build_nf_profile( ogs_sbi_nf_instance_t *nf_instance); void ogs_sbi_nnrf_free_nf_profile(OpenAPI_nf_profile_t *NFProfile); +ogs_sbi_request_t *ogs_nnrf_nfm_build_register( + ogs_sbi_nf_instance_t *nf_instance); +ogs_sbi_request_t *ogs_nnrf_nfm_build_update( + ogs_sbi_nf_instance_t *nf_instance); +ogs_sbi_request_t *ogs_nnrf_nfm_build_de_register( + ogs_sbi_nf_instance_t *nf_instance); + +ogs_sbi_request_t *ogs_nnrf_nfm_build_status_subscribe( + ogs_sbi_subscription_t *subscription); +ogs_sbi_request_t *ogs_nnrf_nfm_build_status_unsubscribe( + ogs_sbi_subscription_t *subscription); + +ogs_sbi_request_t *ogs_nnrf_disc_build_discover( + OpenAPI_nf_type_e target_nf_type, OpenAPI_nf_type_e requester_nf_type); + #ifdef __cplusplus } #endif diff --git a/lib/sbi/nnrf-handler.c b/lib/sbi/nnrf-handler.c index 4e304b2d53..bb9bb7d46f 100644 --- a/lib/sbi/nnrf-handler.c +++ b/lib/sbi/nnrf-handler.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include "nnrf-handler.h" +#include "ogs-sbi.h" bool ogs_sbi_nnrf_handle_nf_profile(ogs_sbi_nf_instance_t *nf_instance, OpenAPI_nf_profile_t *NFProfile, @@ -113,14 +113,22 @@ bool ogs_sbi_nnrf_handle_nf_profile(ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_nf_service_t *nf_service = NULL; if (!NFService) continue; + if (!NFService->service_instance_id) continue; + if (!NFService->service_name) continue; VersionList = NFService->versions; IpEndPointList = NFService->ip_end_points; - nf_service = ogs_sbi_nf_service_add(nf_instance, - NFService->service_instance_id, - NFService->service_name, NFService->scheme); - ogs_assert(nf_service); + nf_service = ogs_sbi_nf_service_find(nf_instance, + NFService->service_name); + if (!nf_service) { + nf_service = ogs_sbi_nf_service_add(nf_instance, + NFService->service_instance_id, + NFService->service_name, NFService->scheme); + ogs_assert(nf_service); + } + + ogs_sbi_nf_service_clear(nf_service); OpenAPI_list_for_each(VersionList, node2) { OpenAPI_nf_service_version_t *NFServiceVersion = node2->data; @@ -174,8 +182,8 @@ bool ogs_sbi_nnrf_handle_nf_profile(ogs_sbi_nf_instance_t *nf_instance, ipv4 = addr; nf_service->addr[nf_service->num_of_addr]. ipv6 = addr6; + nf_service->num_of_addr++; } - nf_service->num_of_addr++; } } } diff --git a/lib/sbi/nnrf-handler.h b/lib/sbi/nnrf-handler.h index 149e5da4dc..c5e0ee8c7a 100644 --- a/lib/sbi/nnrf-handler.h +++ b/lib/sbi/nnrf-handler.h @@ -20,9 +20,6 @@ #ifndef OGS_NNRF_HANDLER_H #define OGS_NNRF_HANDLER_H -#include "ogs-sbi.h" -#include "context.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/lib/sbi/ogs-sbi.h b/lib/sbi/ogs-sbi.h index 113a23440a..28888f2d27 100644 --- a/lib/sbi/ogs-sbi.h +++ b/lib/sbi/ogs-sbi.h @@ -35,6 +35,14 @@ #include "model/subscription_data.h" #include "model/notification_data.h" #include "model/search_result.h" +#include "model/authentication_info.h" +#include "model/authentication_info_request.h" +#include "model/authentication_info_result.h" +#include "model/authentication_subscription.h" +#include "model/ue_authentication_ctx.h" +#include "model/confirmation_data.h" +#include "model/confirmation_data_response.h" +#include "model/auth_event.h" #include "custom/links.h" @@ -53,6 +61,7 @@ #include "sbi/nnrf-build.h" #include "sbi/nnrf-handler.h" +#include "sbi/path.h" #undef OGS_SBI_INSIDE diff --git a/lib/sbi/openapi/.openapi-generator/config.yaml b/lib/sbi/openapi/.openapi-generator/config.yaml index eb2ec34177..66f23e3c8a 100644 --- a/lib/sbi/openapi/.openapi-generator/config.yaml +++ b/lib/sbi/openapi/.openapi-generator/config.yaml @@ -3,4 +3,6 @@ templateDir: "../openapi/.openapi-generator/templates" reservedWordMappings: 3GPP_ACCESS: "3GPP_ACCESS" 5G_EIR: "5G_EIR" + 5G_AKA: "5G_AKA" + 5G_HE_AKA: "5G_HE_AKA" 5GMM: "5GMM" diff --git a/lib/sbi/openapi/.openapi-generator/templates/model-body.mustache b/lib/sbi/openapi/.openapi-generator/templates/model-body.mustache index 17a097d4ab..c59c0be2c3 100644 --- a/lib/sbi/openapi/.openapi-generator/templates/model-body.mustache +++ b/lib/sbi/openapi/.openapi-generator/templates/model-body.mustache @@ -194,12 +194,22 @@ void OpenAPI_{{classname}}_free(OpenAPI_{{classname}}_t *{{classname}}) {{/isPrimitiveType}} {{/isListContainer}} {{#isMapContainer}} - OpenAPI_list_for_each({{classname}}->{{name}}, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - OpenAPI_{{complexType}}_free(localKeyValue->value); - ogs_free(localKeyValue); - } - OpenAPI_list_free({{classname}}->{{name}}); + {{#isPrimitiveType}} + OpenAPI_list_for_each({{classname}}->{{name}}, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free({{classname}}->{{name}}); + {{/isPrimitiveType}} + {{^isPrimitiveType}} + OpenAPI_list_for_each({{classname}}->{{name}}, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_{{complexType}}_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free({{classname}}->{{name}}); + {{/isPrimitiveType}} {{/isMapContainer}} {{/isContainer}} {{/vars}} @@ -218,13 +228,20 @@ cJSON *OpenAPI_{{classname}}_convertToJSON(OpenAPI_{{classname}}_t *{{classname} item = cJSON_CreateObject(); {{#vars}} {{#required}} - if (!{{{classname}}}->{{{name}}}) { - ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); - goto end; - } + {{^isBoolean}} + if (!{{{classname}}}->{{{name}}}) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isBoolean}} {{/required}} {{^required}} - if ({{{classname}}}->{{{name}}}) { + {{#isBoolean}} + if ({{{classname}}}->{{{name}}} >= 0) { + {{/isBoolean}} + {{^isBoolean}} + if ({{{classname}}}->{{{name}}}) { + {{/isBoolean}} {{/required}} {{^isContainer}} {{#isPrimitiveType}} diff --git a/lib/sbi/openapi/meson.build b/lib/sbi/openapi/meson.build index 9c858f9f8f..0a21cb6b21 100644 --- a/lib/sbi/openapi/meson.build +++ b/lib/sbi/openapi/meson.build @@ -100,6 +100,369 @@ libsbi_openapi_sources = files(''' model/search_result.c model/stored_search_result.c + model/af_event.c + model/af_event_exposure_data.c + model/an_node_type.c + model/external_client_type.c + model/gmlc_info.c + model/hss_info.c + model/imsi_range.c + model/internal_group_id_range.c + model/lmf_info.c + model/nef_info.c + model/nf_info.c + model/nf_service_set_cond.c + model/nf_set_cond.c + model/pcscf_info.c + model/pfd_data.c + model/plmn_id_nid.c + model/preferred_search.c + model/rat_type.c + model/tngf_info.c + model/twif_info.c + model/udsf_info.c + model/upf_cond.c + model/vendor_specific_feature.c + model/w_agf_info.c + + model/auth_result.c + model/auth_type.c + model/authentication_info.c + model/av5g_aka.c + model/confirmation_data.c + model/confirmation_data_response.c + model/eap_session.c + model/resynchronization_info.c + model/rg_auth_ctx.c + model/rg_authentication_info.c + model/trace_data.c + model/trace_depth.c + model/ue_authentication_ctx.c + + model/auth_event.c + model/authentication_info_request.c + model/authentication_info_result.c + model/authentication_vector.c + model/av5_g_he_aka.c + model/av_eap_aka_prime.c + model/av_eps_aka.c + model/av_ims_gba_eap_aka.c + model/av_type.c + model/hss_auth_type.c + model/hss_authentication_info_request.c + model/hss_authentication_info_result.c + model/hss_authentication_vectors.c + model/hss_av_type.c + + model/amf3_gpp_access_registration.c + model/amf3_gpp_access_registration_modification.c + model/amf_dereg_info.c + model/amf_non3_gpp_access_registration.c + model/amf_non3_gpp_access_registration_modification.c + model/backup_amf_info.c + model/cm_info.c + model/cm_info_report.c + model/cm_state.c + model/deregistration_data.c + model/deregistration_reason.c + model/eps_interworking_info.c + model/eps_iwk_pgw.c + model/ims_vo_ps.c + model/location_info.c + model/network_node_diameter_address.c + model/patch_result.c + model/pcscf_restoration_notification.c + model/pei_update_info.c + model/registration_reason.c + model/report_item.c + model/smf_registration.c + model/smf_registration_info.c + model/smsf_registration.c + model/trigger_request.c + model/vgmlc_address.c + + model/access_and_mobility_subscription_data.c + model/access_tech.c + model/acknowledge_info.c + model/acs_info.c + model/additional_snssai_data.c + model/af_external.c + model/af_non_external.c + model/ambr.c + model/ambr_rm.c + model/app_descriptor.c + model/app_port_id.c + model/area.c + model/arp.c + model/battery_indication.c + model/cag_data.c + model/cag_info.c + model/civic_address.c + model/code_word_ind.c + model/core_network_type.c + model/data_set_name.c + model/dnn_configuration.c + model/dnn_info.c + model/ec_restriction_data.c + model/ecgi.c + model/edrx_parameters.c + model/ellipsoid_arc.c + model/ellipsoid_arc_all_of.c + model/emergency_info.c + model/enhanced_coverage_restriction_data.c + model/expected_ue_behaviour_data.c + model/external_unrelated_class.c + model/frame_route_info.c + model/g_nb_id.c + model/gad_shape.c + model/geographic_area.c + model/geographical_coordinates.c + model/global_ran_node_id.c + model/group_identifiers.c + model/id_translation_result.c + model/ip_address.c + model/lcs_client_class.c + model/lcs_client_external.c + model/lcs_client_group_external.c + model/lcs_client_non_external.c + model/lcs_mo_data.c + model/lcs_mo_service_class.c + model/lcs_privacy_data.c + model/location_area.c + model/location_privacy_ind.c + model/lpi.c + model/lte_v2x_auth.c + model/maximum_latency.c + model/maximum_response_time.c + model/modification_notification.c + model/ncgi.c + model/network_area_info.c + model/nidd_information.c + model/non_external_unrelated_class.c + model/notify_item.c + model/nr_v2x_auth.c + model/nssai.c + model/null_value.c + model/odb_packet_services.c + model/operation_mode.c + model/pdu_session.c + model/pdu_session_continuity_ind.c + model/pdu_session_types.c + model/pgw_info.c + model/plmn_ec_info.c + model/plmn_operator_class.c + model/point.c + model/point_all_of.c + model/point_altitude.c + model/point_altitude_all_of.c + model/point_altitude_uncertainty.c + model/point_altitude_uncertainty_all_of.c + model/point_uncertainty_circle.c + model/point_uncertainty_circle_all_of.c + model/point_uncertainty_ellipse.c + model/point_uncertainty_ellipse_all_of.c + model/polygon.c + model/polygon_all_of.c + model/preemption_capability.c + model/preemption_vulnerability.c + model/privacy_check_related_action.c + model/ptw_parameters.c + model/restriction_type.c + model/scheduled_communication_time.c + model/scheduled_communication_type.c + model/sdm_subs_modification.c + model/sdm_subscription.c + model/service_area_restriction.c + model/service_type_unrelated_class.c + model/session_management_subscription_data.c + model/shared_data.c + model/smf_selection_subscription_data.c + model/sms_management_subscription_data.c + model/sms_subscription_data.c + model/smsf_info.c + model/snssai_info.c + model/sor_info.c + model/sor_update_indicator.c + model/sor_update_info.c + model/ssc_mode.c + model/ssc_modes.c + model/stationary_indication.c + model/steering_container.c + model/steering_info.c + model/subscribed_default_qos.c + model/subscription_data_sets.c + model/suggested_packet_num_dl.c + model/supported_gad_shapes.c + model/tmbr.c + model/trace_data_response.c + model/traffic_profile.c + model/ue_auth.c + model/ue_context_in_smf_data.c + model/ue_context_in_smsf_data.c + model/ue_id.c + model/uncertainty_ellipse.c + model/unrelated_class.c + model/up_confidentiality.c + model/up_integrity.c + model/up_security.c + model/upu_data.c + model/upu_info.c + model/valid_time_period.c + model/vn_group_data.c + + model/access_and_mobility_data.c + model/acs_info_rm.c + model/amf_subscription_info.c + model/association_type.c + model/auth_method.c + model/authentication_subscription.c + model/authorization_data.c + model/battery_indication_rm.c + model/cag_ack_data.c + model/communication_characteristics.c + model/data_change_notify.c + model/datalink_reporting_configuration.c + model/ddd_traffic_descriptor.c + model/dl_data_delivery_status.c + model/domain_name_protocol.c + model/ec_restriction.c + model/ee_profile_data.c + model/ee_subscription.c + model/eutra_location.c + model/event_report_mode.c + model/event_type.c + model/expected_ue_behaviour.c + model/exposure_data_change_notification.c + model/exposure_data_subscription.c + model/hfc_node_id.c + model/identity_data.c + model/lcs_privacy.c + model/location_accuracy.c + model/location_reporting_configuration.c + model/model_5_g_vn_group_configuration.c + model/model_5_g_vn_group_data.c + model/monitoring_configuration.c + model/n3ga_location.c + model/nr_location.c + model/nssai_ack_data.c + model/odb_data.c + model/operator_specific_data_container.c + model/pdu_session_management_data.c + model/pdu_session_status.c + model/pfd_content.c + model/pfd_data_for_app.c + model/pfd_data_for_app_ext.c + model/pfd_data_for_app_ext_all_of.c + model/pp_active_time.c + model/pp_data.c + model/pp_dl_packet_count_ext.c + model/pp_maximum_latency.c + model/pp_maximum_response_time.c + model/pp_subs_reg_timer.c + model/problem_details_2.c + model/provisioned_data_sets.c + model/reporting_options.c + model/rm_info.c + model/rm_state.c + model/roaming_odb.c + model/route_information.c + model/route_to_location.c + model/scheduled_communication_time_rm.c + model/scheduled_communication_type_rm.c + model/sequence_number.c + model/sign.c + model/sms_support.c + model/sor_data.c + model/sqn_scheme.c + model/stationary_indication_rm.c + model/subscription_data_subscriptions.c + model/traffic_profile_rm.c + model/ue_reachability.c + model/ue_update_status.c + model/upu_data_2.c + model/user_identifier.c + model/user_location.c + + model/access_right_status.c + model/am_policy_data.c + model/application_data_change_notif.c + model/application_data_subs.c + model/bdt_data.c + model/bdt_policy_data.c + model/bdt_policy_data_patch.c + model/charging_information.c + model/configuration_parameters_eutra.c + model/configuration_parameters_nr.c + model/context_data_set_name.c + model/context_data_sets.c + model/data_filter.c + model/data_ind.c + model/dnai_change_type.c + model/dnn_route_selection_descriptor.c + model/eth_flow_description.c + model/flow_direction.c + model/flow_info.c + model/iptv_config_data.c + model/iptv_config_data_patch.c + model/limit_id_to_monitoring_key.c + model/multicast_access_control.c + model/network_area_info_2.c + model/notification_item.c + model/operator_managed.c + model/parameter_over_pc5.c + model/parameter_over_uu.c + model/pc5_flow_bit_rates.c + model/pc5_qo_s_para.c + model/pc5_qos_flow_item.c + model/pc5_qos_mapping.c + model/periodicity.c + model/pfd_change_notification.c + model/plmn_rat_served.c + model/plmn_route_selection_descriptor.c + model/policy_data_change_notification.c + model/policy_data_subscription.c + model/pppp_to_pdb.c + model/presence_info.c + model/presence_state.c + model/privacy_parameter.c + model/radio_parameter_not_served.c + model/resource_item.c + model/service_application_server_address.c + model/service_id_to_frequency.c + model/service_id_to_layer2_id.c + model/service_id_to_pppr.c + model/service_parameter_data.c + model/service_to_pdu_session.c + model/service_to_tx.c + model/slrb_configurations.c + model/sm_policy_data.c + model/sm_policy_data_patch.c + model/sm_policy_dnn_data.c + model/sm_policy_dnn_data_patch.c + model/sm_policy_snssai_data.c + model/sm_policy_snssai_data_patch.c + model/snssai_route_selection_descriptor.c + model/sponsor_connectivity_data.c + model/subscribed_event.c + model/temporal_validity.c + model/time_period.c + model/time_window.c + model/traffic_influ_data.c + model/traffic_influ_data_notif.c + model/traffic_influ_data_patch.c + model/traffic_influ_sub.c + model/transfer_policy.c + model/ue_policy_section.c + model/ue_policy_set.c + model/ue_policy_set_patch.c + model/updated_item.c + model/usage_mon_data.c + model/usage_mon_data_limit.c + model/usage_mon_data_scope.c + model/usage_mon_level.c + model/usage_threshold.c + model/v2x_rat_type.c + '''.split()) libsbi_openapi_inc = include_directories('.') diff --git a/lib/sbi/openapi/model/access_and_mobility_data.c b/lib/sbi/openapi/model/access_and_mobility_data.c new file mode 100644 index 0000000000..091e4da9dc --- /dev/null +++ b/lib/sbi/openapi/model/access_and_mobility_data.c @@ -0,0 +1,537 @@ + +#include +#include +#include +#include "access_and_mobility_data.h" + +OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_create( + OpenAPI_user_location_t *location, + char *location_ts, + char *time_zone, + char *time_zone_ts, + OpenAPI_access_type_e access_type, + OpenAPI_list_t *reg_states, + char *reg_states_ts, + OpenAPI_list_t *conn_states, + char *conn_states_ts, + OpenAPI_ue_reachability_t *reachability_status, + char *reachability_status_ts, + OpenAPI_sms_support_t *sms_over_nas_status, + char *sms_over_nas_status_ts, + int roaming_status, + char *roaming_status_ts, + OpenAPI_plmn_id_t *current_plmn, + char *current_plmn_ts, + OpenAPI_list_t *rat_type, + char *rat_types_ts + ) +{ + OpenAPI_access_and_mobility_data_t *access_and_mobility_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_access_and_mobility_data_t)); + if (!access_and_mobility_data_local_var) { + return NULL; + } + access_and_mobility_data_local_var->location = location; + access_and_mobility_data_local_var->location_ts = location_ts; + access_and_mobility_data_local_var->time_zone = time_zone; + access_and_mobility_data_local_var->time_zone_ts = time_zone_ts; + access_and_mobility_data_local_var->access_type = access_type; + access_and_mobility_data_local_var->reg_states = reg_states; + access_and_mobility_data_local_var->reg_states_ts = reg_states_ts; + access_and_mobility_data_local_var->conn_states = conn_states; + access_and_mobility_data_local_var->conn_states_ts = conn_states_ts; + access_and_mobility_data_local_var->reachability_status = reachability_status; + access_and_mobility_data_local_var->reachability_status_ts = reachability_status_ts; + access_and_mobility_data_local_var->sms_over_nas_status = sms_over_nas_status; + access_and_mobility_data_local_var->sms_over_nas_status_ts = sms_over_nas_status_ts; + access_and_mobility_data_local_var->roaming_status = roaming_status; + access_and_mobility_data_local_var->roaming_status_ts = roaming_status_ts; + access_and_mobility_data_local_var->current_plmn = current_plmn; + access_and_mobility_data_local_var->current_plmn_ts = current_plmn_ts; + access_and_mobility_data_local_var->rat_type = rat_type; + access_and_mobility_data_local_var->rat_types_ts = rat_types_ts; + + return access_and_mobility_data_local_var; +} + +void OpenAPI_access_and_mobility_data_free(OpenAPI_access_and_mobility_data_t *access_and_mobility_data) +{ + if (NULL == access_and_mobility_data) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_user_location_free(access_and_mobility_data->location); + ogs_free(access_and_mobility_data->location_ts); + ogs_free(access_and_mobility_data->time_zone); + ogs_free(access_and_mobility_data->time_zone_ts); + OpenAPI_list_for_each(access_and_mobility_data->reg_states, node) { + OpenAPI_rm_info_free(node->data); + } + OpenAPI_list_free(access_and_mobility_data->reg_states); + ogs_free(access_and_mobility_data->reg_states_ts); + OpenAPI_list_for_each(access_and_mobility_data->conn_states, node) { + OpenAPI_cm_info_free(node->data); + } + OpenAPI_list_free(access_and_mobility_data->conn_states); + ogs_free(access_and_mobility_data->conn_states_ts); + OpenAPI_ue_reachability_free(access_and_mobility_data->reachability_status); + ogs_free(access_and_mobility_data->reachability_status_ts); + OpenAPI_sms_support_free(access_and_mobility_data->sms_over_nas_status); + ogs_free(access_and_mobility_data->sms_over_nas_status_ts); + ogs_free(access_and_mobility_data->roaming_status_ts); + OpenAPI_plmn_id_free(access_and_mobility_data->current_plmn); + ogs_free(access_and_mobility_data->current_plmn_ts); + OpenAPI_list_for_each(access_and_mobility_data->rat_type, node) { + OpenAPI_rat_type_free(node->data); + } + OpenAPI_list_free(access_and_mobility_data->rat_type); + ogs_free(access_and_mobility_data->rat_types_ts); + ogs_free(access_and_mobility_data); +} + +cJSON *OpenAPI_access_and_mobility_data_convertToJSON(OpenAPI_access_and_mobility_data_t *access_and_mobility_data) +{ + cJSON *item = NULL; + + if (access_and_mobility_data == NULL) { + ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [AccessAndMobilityData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (access_and_mobility_data->location) { + cJSON *location_local_JSON = OpenAPI_user_location_convertToJSON(access_and_mobility_data->location); + if (location_local_JSON == NULL) { + ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [location]"); + goto end; + } + cJSON_AddItemToObject(item, "location", location_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [location]"); + goto end; + } + } + + if (access_and_mobility_data->location_ts) { + if (cJSON_AddStringToObject(item, "locationTs", access_and_mobility_data->location_ts) == NULL) { + ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [location_ts]"); + goto end; + } + } + + if (access_and_mobility_data->time_zone) { + if (cJSON_AddStringToObject(item, "timeZone", access_and_mobility_data->time_zone) == NULL) { + ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [time_zone]"); + goto end; + } + } + + if (access_and_mobility_data->time_zone_ts) { + if (cJSON_AddStringToObject(item, "timeZoneTs", access_and_mobility_data->time_zone_ts) == NULL) { + ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [time_zone_ts]"); + goto end; + } + } + + if (access_and_mobility_data->access_type) { + if (cJSON_AddStringToObject(item, "accessType", OpenAPI_access_type_ToString(access_and_mobility_data->access_type)) == NULL) { + ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [access_type]"); + goto end; + } + } + + if (access_and_mobility_data->reg_states) { + cJSON *reg_statesList = cJSON_AddArrayToObject(item, "regStates"); + if (reg_statesList == NULL) { + ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [reg_states]"); + goto end; + } + + OpenAPI_lnode_t *reg_states_node; + if (access_and_mobility_data->reg_states) { + OpenAPI_list_for_each(access_and_mobility_data->reg_states, reg_states_node) { + cJSON *itemLocal = OpenAPI_rm_info_convertToJSON(reg_states_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [reg_states]"); + goto end; + } + cJSON_AddItemToArray(reg_statesList, itemLocal); + } + } + } + + if (access_and_mobility_data->reg_states_ts) { + if (cJSON_AddStringToObject(item, "regStatesTs", access_and_mobility_data->reg_states_ts) == NULL) { + ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [reg_states_ts]"); + goto end; + } + } + + if (access_and_mobility_data->conn_states) { + cJSON *conn_statesList = cJSON_AddArrayToObject(item, "connStates"); + if (conn_statesList == NULL) { + ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [conn_states]"); + goto end; + } + + OpenAPI_lnode_t *conn_states_node; + if (access_and_mobility_data->conn_states) { + OpenAPI_list_for_each(access_and_mobility_data->conn_states, conn_states_node) { + cJSON *itemLocal = OpenAPI_cm_info_convertToJSON(conn_states_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [conn_states]"); + goto end; + } + cJSON_AddItemToArray(conn_statesList, itemLocal); + } + } + } + + if (access_and_mobility_data->conn_states_ts) { + if (cJSON_AddStringToObject(item, "connStatesTs", access_and_mobility_data->conn_states_ts) == NULL) { + ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [conn_states_ts]"); + goto end; + } + } + + if (access_and_mobility_data->reachability_status) { + cJSON *reachability_status_local_JSON = OpenAPI_ue_reachability_convertToJSON(access_and_mobility_data->reachability_status); + if (reachability_status_local_JSON == NULL) { + ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [reachability_status]"); + goto end; + } + cJSON_AddItemToObject(item, "reachabilityStatus", reachability_status_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [reachability_status]"); + goto end; + } + } + + if (access_and_mobility_data->reachability_status_ts) { + if (cJSON_AddStringToObject(item, "reachabilityStatusTs", access_and_mobility_data->reachability_status_ts) == NULL) { + ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [reachability_status_ts]"); + goto end; + } + } + + if (access_and_mobility_data->sms_over_nas_status) { + cJSON *sms_over_nas_status_local_JSON = OpenAPI_sms_support_convertToJSON(access_and_mobility_data->sms_over_nas_status); + if (sms_over_nas_status_local_JSON == NULL) { + ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [sms_over_nas_status]"); + goto end; + } + cJSON_AddItemToObject(item, "smsOverNasStatus", sms_over_nas_status_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [sms_over_nas_status]"); + goto end; + } + } + + if (access_and_mobility_data->sms_over_nas_status_ts) { + if (cJSON_AddStringToObject(item, "smsOverNasStatusTs", access_and_mobility_data->sms_over_nas_status_ts) == NULL) { + ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [sms_over_nas_status_ts]"); + goto end; + } + } + + if (access_and_mobility_data->roaming_status >= 0) { + if (cJSON_AddBoolToObject(item, "roamingStatus", access_and_mobility_data->roaming_status) == NULL) { + ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [roaming_status]"); + goto end; + } + } + + if (access_and_mobility_data->roaming_status_ts) { + if (cJSON_AddStringToObject(item, "roamingStatusTs", access_and_mobility_data->roaming_status_ts) == NULL) { + ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [roaming_status_ts]"); + goto end; + } + } + + if (access_and_mobility_data->current_plmn) { + cJSON *current_plmn_local_JSON = OpenAPI_plmn_id_convertToJSON(access_and_mobility_data->current_plmn); + if (current_plmn_local_JSON == NULL) { + ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [current_plmn]"); + goto end; + } + cJSON_AddItemToObject(item, "currentPlmn", current_plmn_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [current_plmn]"); + goto end; + } + } + + if (access_and_mobility_data->current_plmn_ts) { + if (cJSON_AddStringToObject(item, "currentPlmnTs", access_and_mobility_data->current_plmn_ts) == NULL) { + ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [current_plmn_ts]"); + goto end; + } + } + + if (access_and_mobility_data->rat_type) { + cJSON *rat_typeList = cJSON_AddArrayToObject(item, "ratType"); + if (rat_typeList == NULL) { + ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [rat_type]"); + goto end; + } + + OpenAPI_lnode_t *rat_type_node; + if (access_and_mobility_data->rat_type) { + OpenAPI_list_for_each(access_and_mobility_data->rat_type, rat_type_node) { + cJSON *itemLocal = OpenAPI_rat_type_convertToJSON(rat_type_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [rat_type]"); + goto end; + } + cJSON_AddItemToArray(rat_typeList, itemLocal); + } + } + } + + if (access_and_mobility_data->rat_types_ts) { + if (cJSON_AddStringToObject(item, "ratTypesTs", access_and_mobility_data->rat_types_ts) == NULL) { + ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [rat_types_ts]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_parseFromJSON(cJSON *access_and_mobility_dataJSON) +{ + OpenAPI_access_and_mobility_data_t *access_and_mobility_data_local_var = NULL; + cJSON *location = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "location"); + + OpenAPI_user_location_t *location_local_nonprim = NULL; + if (location) { + location_local_nonprim = OpenAPI_user_location_parseFromJSON(location); + } + + cJSON *location_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "locationTs"); + + if (location_ts) { + if (!cJSON_IsString(location_ts)) { + ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [location_ts]"); + goto end; + } + } + + cJSON *time_zone = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "timeZone"); + + if (time_zone) { + if (!cJSON_IsString(time_zone)) { + ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [time_zone]"); + goto end; + } + } + + cJSON *time_zone_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "timeZoneTs"); + + if (time_zone_ts) { + if (!cJSON_IsString(time_zone_ts)) { + ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [time_zone_ts]"); + goto end; + } + } + + cJSON *access_type = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "accessType"); + + OpenAPI_access_type_e access_typeVariable; + if (access_type) { + if (!cJSON_IsString(access_type)) { + ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [access_type]"); + goto end; + } + access_typeVariable = OpenAPI_access_type_FromString(access_type->valuestring); + } + + cJSON *reg_states = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "regStates"); + + OpenAPI_list_t *reg_statesList; + if (reg_states) { + cJSON *reg_states_local_nonprimitive; + if (!cJSON_IsArray(reg_states)) { + ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [reg_states]"); + goto end; + } + + reg_statesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(reg_states_local_nonprimitive, reg_states ) { + if (!cJSON_IsObject(reg_states_local_nonprimitive)) { + ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [reg_states]"); + goto end; + } + OpenAPI_rm_info_t *reg_statesItem = OpenAPI_rm_info_parseFromJSON(reg_states_local_nonprimitive); + + OpenAPI_list_add(reg_statesList, reg_statesItem); + } + } + + cJSON *reg_states_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "regStatesTs"); + + if (reg_states_ts) { + if (!cJSON_IsString(reg_states_ts)) { + ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [reg_states_ts]"); + goto end; + } + } + + cJSON *conn_states = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "connStates"); + + OpenAPI_list_t *conn_statesList; + if (conn_states) { + cJSON *conn_states_local_nonprimitive; + if (!cJSON_IsArray(conn_states)) { + ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [conn_states]"); + goto end; + } + + conn_statesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(conn_states_local_nonprimitive, conn_states ) { + if (!cJSON_IsObject(conn_states_local_nonprimitive)) { + ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [conn_states]"); + goto end; + } + OpenAPI_cm_info_t *conn_statesItem = OpenAPI_cm_info_parseFromJSON(conn_states_local_nonprimitive); + + OpenAPI_list_add(conn_statesList, conn_statesItem); + } + } + + cJSON *conn_states_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "connStatesTs"); + + if (conn_states_ts) { + if (!cJSON_IsString(conn_states_ts)) { + ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [conn_states_ts]"); + goto end; + } + } + + cJSON *reachability_status = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "reachabilityStatus"); + + OpenAPI_ue_reachability_t *reachability_status_local_nonprim = NULL; + if (reachability_status) { + reachability_status_local_nonprim = OpenAPI_ue_reachability_parseFromJSON(reachability_status); + } + + cJSON *reachability_status_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "reachabilityStatusTs"); + + if (reachability_status_ts) { + if (!cJSON_IsString(reachability_status_ts)) { + ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [reachability_status_ts]"); + goto end; + } + } + + cJSON *sms_over_nas_status = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "smsOverNasStatus"); + + OpenAPI_sms_support_t *sms_over_nas_status_local_nonprim = NULL; + if (sms_over_nas_status) { + sms_over_nas_status_local_nonprim = OpenAPI_sms_support_parseFromJSON(sms_over_nas_status); + } + + cJSON *sms_over_nas_status_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "smsOverNasStatusTs"); + + if (sms_over_nas_status_ts) { + if (!cJSON_IsString(sms_over_nas_status_ts)) { + ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [sms_over_nas_status_ts]"); + goto end; + } + } + + cJSON *roaming_status = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "roamingStatus"); + + if (roaming_status) { + if (!cJSON_IsBool(roaming_status)) { + ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [roaming_status]"); + goto end; + } + } + + cJSON *roaming_status_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "roamingStatusTs"); + + if (roaming_status_ts) { + if (!cJSON_IsString(roaming_status_ts)) { + ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [roaming_status_ts]"); + goto end; + } + } + + cJSON *current_plmn = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "currentPlmn"); + + OpenAPI_plmn_id_t *current_plmn_local_nonprim = NULL; + if (current_plmn) { + current_plmn_local_nonprim = OpenAPI_plmn_id_parseFromJSON(current_plmn); + } + + cJSON *current_plmn_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "currentPlmnTs"); + + if (current_plmn_ts) { + if (!cJSON_IsString(current_plmn_ts)) { + ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [current_plmn_ts]"); + goto end; + } + } + + cJSON *rat_type = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "ratType"); + + OpenAPI_list_t *rat_typeList; + if (rat_type) { + cJSON *rat_type_local_nonprimitive; + if (!cJSON_IsArray(rat_type)) { + ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [rat_type]"); + goto end; + } + + rat_typeList = OpenAPI_list_create(); + + cJSON_ArrayForEach(rat_type_local_nonprimitive, rat_type ) { + if (!cJSON_IsObject(rat_type_local_nonprimitive)) { + ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [rat_type]"); + goto end; + } + OpenAPI_rat_type_t *rat_typeItem = OpenAPI_rat_type_parseFromJSON(rat_type_local_nonprimitive); + + OpenAPI_list_add(rat_typeList, rat_typeItem); + } + } + + cJSON *rat_types_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "ratTypesTs"); + + if (rat_types_ts) { + if (!cJSON_IsString(rat_types_ts)) { + ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [rat_types_ts]"); + goto end; + } + } + + access_and_mobility_data_local_var = OpenAPI_access_and_mobility_data_create ( + location ? location_local_nonprim : NULL, + location_ts ? ogs_strdup(location_ts->valuestring) : NULL, + time_zone ? ogs_strdup(time_zone->valuestring) : NULL, + time_zone_ts ? ogs_strdup(time_zone_ts->valuestring) : NULL, + access_type ? access_typeVariable : 0, + reg_states ? reg_statesList : NULL, + reg_states_ts ? ogs_strdup(reg_states_ts->valuestring) : NULL, + conn_states ? conn_statesList : NULL, + conn_states_ts ? ogs_strdup(conn_states_ts->valuestring) : NULL, + reachability_status ? reachability_status_local_nonprim : NULL, + reachability_status_ts ? ogs_strdup(reachability_status_ts->valuestring) : NULL, + sms_over_nas_status ? sms_over_nas_status_local_nonprim : NULL, + sms_over_nas_status_ts ? ogs_strdup(sms_over_nas_status_ts->valuestring) : NULL, + roaming_status ? roaming_status->valueint : 0, + roaming_status_ts ? ogs_strdup(roaming_status_ts->valuestring) : NULL, + current_plmn ? current_plmn_local_nonprim : NULL, + current_plmn_ts ? ogs_strdup(current_plmn_ts->valuestring) : NULL, + rat_type ? rat_typeList : NULL, + rat_types_ts ? ogs_strdup(rat_types_ts->valuestring) : NULL + ); + + return access_and_mobility_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/access_and_mobility_data.h b/lib/sbi/openapi/model/access_and_mobility_data.h new file mode 100644 index 0000000000..e0d7f9fd00 --- /dev/null +++ b/lib/sbi/openapi/model/access_and_mobility_data.h @@ -0,0 +1,81 @@ +/* + * access_and_mobility_data.h + * + * + */ + +#ifndef _OpenAPI_access_and_mobility_data_H_ +#define _OpenAPI_access_and_mobility_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "access_type.h" +#include "cm_info.h" +#include "plmn_id.h" +#include "rat_type.h" +#include "rm_info.h" +#include "sms_support.h" +#include "ue_reachability.h" +#include "user_location.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_access_and_mobility_data_s OpenAPI_access_and_mobility_data_t; +typedef struct OpenAPI_access_and_mobility_data_s { + struct OpenAPI_user_location_s *location; + char *location_ts; + char *time_zone; + char *time_zone_ts; + OpenAPI_access_type_e access_type; + OpenAPI_list_t *reg_states; + char *reg_states_ts; + OpenAPI_list_t *conn_states; + char *conn_states_ts; + struct OpenAPI_ue_reachability_s *reachability_status; + char *reachability_status_ts; + struct OpenAPI_sms_support_s *sms_over_nas_status; + char *sms_over_nas_status_ts; + int roaming_status; + char *roaming_status_ts; + struct OpenAPI_plmn_id_s *current_plmn; + char *current_plmn_ts; + OpenAPI_list_t *rat_type; + char *rat_types_ts; +} OpenAPI_access_and_mobility_data_t; + +OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_create( + OpenAPI_user_location_t *location, + char *location_ts, + char *time_zone, + char *time_zone_ts, + OpenAPI_access_type_e access_type, + OpenAPI_list_t *reg_states, + char *reg_states_ts, + OpenAPI_list_t *conn_states, + char *conn_states_ts, + OpenAPI_ue_reachability_t *reachability_status, + char *reachability_status_ts, + OpenAPI_sms_support_t *sms_over_nas_status, + char *sms_over_nas_status_ts, + int roaming_status, + char *roaming_status_ts, + OpenAPI_plmn_id_t *current_plmn, + char *current_plmn_ts, + OpenAPI_list_t *rat_type, + char *rat_types_ts + ); +void OpenAPI_access_and_mobility_data_free(OpenAPI_access_and_mobility_data_t *access_and_mobility_data); +OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_parseFromJSON(cJSON *access_and_mobility_dataJSON); +cJSON *OpenAPI_access_and_mobility_data_convertToJSON(OpenAPI_access_and_mobility_data_t *access_and_mobility_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_access_and_mobility_data_H_ */ + diff --git a/lib/sbi/openapi/model/access_and_mobility_subscription_data.c b/lib/sbi/openapi/model/access_and_mobility_subscription_data.c new file mode 100644 index 0000000000..94c2cc3a32 --- /dev/null +++ b/lib/sbi/openapi/model/access_and_mobility_subscription_data.c @@ -0,0 +1,1505 @@ + +#include +#include +#include +#include "access_and_mobility_subscription_data.h" + +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, + OpenAPI_list_t *rat_restrictions, + OpenAPI_list_t *forbidden_areas, + OpenAPI_service_area_restriction_t *service_area_restriction, + OpenAPI_list_t *core_network_type_restrictions, + int rfsp_index, + int subs_reg_timer, + int ue_usage_type, + int mps_priority, + int mcs_priority, + int active_time, + int dl_packet_count, + OpenAPI_sor_info_t *sor_info, + int sor_info_expect_ind, + int soraf_retrieval, + OpenAPI_list_t *sor_update_indicator_list, + 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_list_t *subscribed_dnn_list, + int service_gap_time, + OpenAPI_trace_data_t *trace_data, + OpenAPI_cag_data_t *cag_data, + char *stn_sr, + char *c_msisdn, + 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_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_access_and_mobility_subscription_data_t *access_and_mobility_subscription_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_access_and_mobility_subscription_data_t)); + if (!access_and_mobility_subscription_data_local_var) { + return NULL; + } + 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; + access_and_mobility_subscription_data_local_var->rat_restrictions = rat_restrictions; + access_and_mobility_subscription_data_local_var->forbidden_areas = forbidden_areas; + access_and_mobility_subscription_data_local_var->service_area_restriction = service_area_restriction; + access_and_mobility_subscription_data_local_var->core_network_type_restrictions = core_network_type_restrictions; + access_and_mobility_subscription_data_local_var->rfsp_index = rfsp_index; + access_and_mobility_subscription_data_local_var->subs_reg_timer = subs_reg_timer; + access_and_mobility_subscription_data_local_var->ue_usage_type = ue_usage_type; + 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; + access_and_mobility_subscription_data_local_var->sor_update_indicator_list = sor_update_indicator_list; + access_and_mobility_subscription_data_local_var->upu_info = upu_info; + access_and_mobility_subscription_data_local_var->mico_allowed = mico_allowed; + access_and_mobility_subscription_data_local_var->shared_am_data_ids = shared_am_data_ids; + 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->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; + access_and_mobility_subscription_data_local_var->c_msisdn = c_msisdn; + 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->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; + + return access_and_mobility_subscription_data_local_var; +} + +void OpenAPI_access_and_mobility_subscription_data_free(OpenAPI_access_and_mobility_subscription_data_t *access_and_mobility_subscription_data) +{ + if (NULL == access_and_mobility_subscription_data) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(access_and_mobility_subscription_data->supported_features); + OpenAPI_list_for_each(access_and_mobility_subscription_data->gpsis, node) { + ogs_free(node->data); + } + OpenAPI_list_free(access_and_mobility_subscription_data->gpsis); + OpenAPI_list_for_each(access_and_mobility_subscription_data->internal_group_ids, node) { + 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); + ogs_free(localKeyValue); + } + OpenAPI_list_free(access_and_mobility_subscription_data->shared_vn_group_data_ids); + OpenAPI_ambr_rm_free(access_and_mobility_subscription_data->subscribed_ue_ambr); + OpenAPI_nssai_free(access_and_mobility_subscription_data->nssai); + OpenAPI_list_for_each(access_and_mobility_subscription_data->rat_restrictions, node) { + OpenAPI_rat_type_free(node->data); + } + OpenAPI_list_free(access_and_mobility_subscription_data->rat_restrictions); + OpenAPI_list_for_each(access_and_mobility_subscription_data->forbidden_areas, node) { + OpenAPI_area_free(node->data); + } + OpenAPI_list_free(access_and_mobility_subscription_data->forbidden_areas); + OpenAPI_service_area_restriction_free(access_and_mobility_subscription_data->service_area_restriction); + OpenAPI_list_for_each(access_and_mobility_subscription_data->core_network_type_restrictions, node) { + OpenAPI_core_network_type_free(node->data); + } + OpenAPI_list_free(access_and_mobility_subscription_data->core_network_type_restrictions); + OpenAPI_sor_info_free(access_and_mobility_subscription_data->sor_info); + OpenAPI_list_free(access_and_mobility_subscription_data->sor_update_indicator_list); + OpenAPI_upu_info_free(access_and_mobility_subscription_data->upu_info); + OpenAPI_list_for_each(access_and_mobility_subscription_data->shared_am_data_ids, node) { + 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_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_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_for_each(access_and_mobility_subscription_data->primary_rat_restrictions, node) { + OpenAPI_rat_type_free(node->data); + } + OpenAPI_list_free(access_and_mobility_subscription_data->primary_rat_restrictions); + OpenAPI_list_for_each(access_and_mobility_subscription_data->secondary_rat_restrictions, node) { + OpenAPI_rat_type_free(node->data); + } + OpenAPI_list_free(access_and_mobility_subscription_data->secondary_rat_restrictions); + OpenAPI_list_for_each(access_and_mobility_subscription_data->edrx_parameters_list, node) { + OpenAPI_edrx_parameters_free(node->data); + } + OpenAPI_list_free(access_and_mobility_subscription_data->edrx_parameters_list); + OpenAPI_list_for_each(access_and_mobility_subscription_data->ptw_parameters_list, node) { + 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); + ogs_free(access_and_mobility_subscription_data); +} + +cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_access_and_mobility_subscription_data_t *access_and_mobility_subscription_data) +{ + cJSON *item = NULL; + + if (access_and_mobility_subscription_data == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [AccessAndMobilitySubscriptionData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (access_and_mobility_subscription_data->supported_features) { + if (cJSON_AddStringToObject(item, "supportedFeatures", access_and_mobility_subscription_data->supported_features) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [supported_features]"); + goto end; + } + } + + if (access_and_mobility_subscription_data->gpsis) { + cJSON *gpsis = cJSON_AddArrayToObject(item, "gpsis"); + if (gpsis == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [gpsis]"); + goto end; + } + + OpenAPI_lnode_t *gpsis_node; + OpenAPI_list_for_each(access_and_mobility_subscription_data->gpsis, gpsis_node) { + if (cJSON_AddStringToObject(gpsis, "", (char*)gpsis_node->data) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [gpsis]"); + goto end; + } + } + } + + if (access_and_mobility_subscription_data->internal_group_ids) { + cJSON *internal_group_ids = cJSON_AddArrayToObject(item, "internalGroupIds"); + if (internal_group_ids == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [internal_group_ids]"); + goto end; + } + + OpenAPI_lnode_t *internal_group_ids_node; + OpenAPI_list_for_each(access_and_mobility_subscription_data->internal_group_ids, internal_group_ids_node) { + if (cJSON_AddStringToObject(internal_group_ids, "", (char*)internal_group_ids_node->data) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [internal_group_ids]"); + goto end; + } + } + } + + 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) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [shared_vn_group_data_ids]"); + goto end; + } + cJSON *localMapObject = shared_vn_group_data_ids; + OpenAPI_lnode_t *shared_vn_group_data_ids_node; + if (access_and_mobility_subscription_data->shared_vn_group_data_ids) { + OpenAPI_list_for_each(access_and_mobility_subscription_data->shared_vn_group_data_ids, shared_vn_group_data_ids_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)shared_vn_group_data_ids_node->data; + } + } + } + + if (access_and_mobility_subscription_data->subscribed_ue_ambr) { + cJSON *subscribed_ue_ambr_local_JSON = OpenAPI_ambr_rm_convertToJSON(access_and_mobility_subscription_data->subscribed_ue_ambr); + if (subscribed_ue_ambr_local_JSON == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [subscribed_ue_ambr]"); + goto end; + } + cJSON_AddItemToObject(item, "subscribedUeAmbr", subscribed_ue_ambr_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [subscribed_ue_ambr]"); + goto end; + } + } + + if (access_and_mobility_subscription_data->nssai) { + cJSON *nssai_local_JSON = OpenAPI_nssai_convertToJSON(access_and_mobility_subscription_data->nssai); + if (nssai_local_JSON == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [nssai]"); + goto end; + } + cJSON_AddItemToObject(item, "nssai", nssai_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [nssai]"); + goto end; + } + } + + if (access_and_mobility_subscription_data->rat_restrictions) { + cJSON *rat_restrictionsList = cJSON_AddArrayToObject(item, "ratRestrictions"); + if (rat_restrictionsList == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [rat_restrictions]"); + goto end; + } + + OpenAPI_lnode_t *rat_restrictions_node; + if (access_and_mobility_subscription_data->rat_restrictions) { + OpenAPI_list_for_each(access_and_mobility_subscription_data->rat_restrictions, rat_restrictions_node) { + cJSON *itemLocal = OpenAPI_rat_type_convertToJSON(rat_restrictions_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [rat_restrictions]"); + goto end; + } + cJSON_AddItemToArray(rat_restrictionsList, itemLocal); + } + } + } + + if (access_and_mobility_subscription_data->forbidden_areas) { + cJSON *forbidden_areasList = cJSON_AddArrayToObject(item, "forbiddenAreas"); + if (forbidden_areasList == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [forbidden_areas]"); + goto end; + } + + OpenAPI_lnode_t *forbidden_areas_node; + if (access_and_mobility_subscription_data->forbidden_areas) { + OpenAPI_list_for_each(access_and_mobility_subscription_data->forbidden_areas, forbidden_areas_node) { + cJSON *itemLocal = OpenAPI_area_convertToJSON(forbidden_areas_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [forbidden_areas]"); + goto end; + } + cJSON_AddItemToArray(forbidden_areasList, itemLocal); + } + } + } + + if (access_and_mobility_subscription_data->service_area_restriction) { + cJSON *service_area_restriction_local_JSON = OpenAPI_service_area_restriction_convertToJSON(access_and_mobility_subscription_data->service_area_restriction); + if (service_area_restriction_local_JSON == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [service_area_restriction]"); + goto end; + } + cJSON_AddItemToObject(item, "serviceAreaRestriction", service_area_restriction_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [service_area_restriction]"); + goto end; + } + } + + if (access_and_mobility_subscription_data->core_network_type_restrictions) { + cJSON *core_network_type_restrictionsList = cJSON_AddArrayToObject(item, "coreNetworkTypeRestrictions"); + if (core_network_type_restrictionsList == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [core_network_type_restrictions]"); + goto end; + } + + OpenAPI_lnode_t *core_network_type_restrictions_node; + if (access_and_mobility_subscription_data->core_network_type_restrictions) { + OpenAPI_list_for_each(access_and_mobility_subscription_data->core_network_type_restrictions, core_network_type_restrictions_node) { + cJSON *itemLocal = OpenAPI_core_network_type_convertToJSON(core_network_type_restrictions_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [core_network_type_restrictions]"); + goto end; + } + cJSON_AddItemToArray(core_network_type_restrictionsList, itemLocal); + } + } + } + + if (access_and_mobility_subscription_data->rfsp_index) { + if (cJSON_AddNumberToObject(item, "rfspIndex", access_and_mobility_subscription_data->rfsp_index) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [rfsp_index]"); + goto end; + } + } + + if (access_and_mobility_subscription_data->subs_reg_timer) { + if (cJSON_AddNumberToObject(item, "subsRegTimer", access_and_mobility_subscription_data->subs_reg_timer) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [subs_reg_timer]"); + goto end; + } + } + + if (access_and_mobility_subscription_data->ue_usage_type) { + if (cJSON_AddNumberToObject(item, "ueUsageType", access_and_mobility_subscription_data->ue_usage_type) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [ue_usage_type]"); + goto end; + } + } + + if (access_and_mobility_subscription_data->mps_priority >= 0) { + if (cJSON_AddBoolToObject(item, "mpsPriority", access_and_mobility_subscription_data->mps_priority) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [mps_priority]"); + goto end; + } + } + + if (access_and_mobility_subscription_data->mcs_priority >= 0) { + if (cJSON_AddBoolToObject(item, "mcsPriority", access_and_mobility_subscription_data->mcs_priority) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [mcs_priority]"); + goto end; + } + } + + if (access_and_mobility_subscription_data->active_time) { + if (cJSON_AddNumberToObject(item, "activeTime", access_and_mobility_subscription_data->active_time) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [active_time]"); + goto end; + } + } + + 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) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [sor_info]"); + goto end; + } + cJSON_AddItemToObject(item, "sorInfo", sor_info_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [sor_info]"); + goto end; + } + } + + if (access_and_mobility_subscription_data->sor_info_expect_ind >= 0) { + if (cJSON_AddBoolToObject(item, "sorInfoExpectInd", access_and_mobility_subscription_data->sor_info_expect_ind) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [sor_info_expect_ind]"); + goto end; + } + } + + if (access_and_mobility_subscription_data->soraf_retrieval >= 0) { + if (cJSON_AddBoolToObject(item, "sorafRetrieval", access_and_mobility_subscription_data->soraf_retrieval) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [soraf_retrieval]"); + goto end; + } + } + + if (access_and_mobility_subscription_data->sor_update_indicator_list) { + cJSON *sor_update_indicator_list = cJSON_AddArrayToObject(item, "sorUpdateIndicatorList"); + if (sor_update_indicator_list == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [sor_update_indicator_list]"); + goto end; + } + OpenAPI_lnode_t *sor_update_indicator_list_node; + OpenAPI_list_for_each(access_and_mobility_subscription_data->sor_update_indicator_list, sor_update_indicator_list_node) { + if (cJSON_AddStringToObject(sor_update_indicator_list, "", OpenAPI_sor_update_indicator_ToString((OpenAPI_sor_update_indicator_e)sor_update_indicator_list_node->data)) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [sor_update_indicator_list]"); + goto end; + } + } + } + + if (access_and_mobility_subscription_data->upu_info) { + cJSON *upu_info_local_JSON = OpenAPI_upu_info_convertToJSON(access_and_mobility_subscription_data->upu_info); + if (upu_info_local_JSON == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [upu_info]"); + goto end; + } + cJSON_AddItemToObject(item, "upuInfo", upu_info_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [upu_info]"); + goto end; + } + } + + if (access_and_mobility_subscription_data->mico_allowed >= 0) { + if (cJSON_AddBoolToObject(item, "micoAllowed", access_and_mobility_subscription_data->mico_allowed) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [mico_allowed]"); + goto end; + } + } + + if (access_and_mobility_subscription_data->shared_am_data_ids) { + cJSON *shared_am_data_ids = cJSON_AddArrayToObject(item, "sharedAmDataIds"); + if (shared_am_data_ids == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [shared_am_data_ids]"); + goto end; + } + + OpenAPI_lnode_t *shared_am_data_ids_node; + OpenAPI_list_for_each(access_and_mobility_subscription_data->shared_am_data_ids, shared_am_data_ids_node) { + if (cJSON_AddStringToObject(shared_am_data_ids, "", (char*)shared_am_data_ids_node->data) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [shared_am_data_ids]"); + goto end; + } + } + } + + 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) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [odb_packet_services]"); + goto end; + } + } + + if (access_and_mobility_subscription_data->subscribed_dnn_list) { + cJSON *subscribed_dnn_list = cJSON_AddArrayToObject(item, "subscribedDnnList"); + if (subscribed_dnn_list == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [subscribed_dnn_list]"); + goto end; + } + + OpenAPI_lnode_t *subscribed_dnn_list_node; + OpenAPI_list_for_each(access_and_mobility_subscription_data->subscribed_dnn_list, subscribed_dnn_list_node) { + if (cJSON_AddStringToObject(subscribed_dnn_list, "", (char*)subscribed_dnn_list_node->data) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [subscribed_dnn_list]"); + goto end; + } + } + } + + if (access_and_mobility_subscription_data->service_gap_time) { + if (cJSON_AddNumberToObject(item, "serviceGapTime", access_and_mobility_subscription_data->service_gap_time) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [service_gap_time]"); + 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) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [trace_data]"); + goto end; + } + cJSON_AddItemToObject(item, "traceData", trace_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [trace_data]"); + goto end; + } + } + + if (access_and_mobility_subscription_data->cag_data) { + cJSON *cag_data_local_JSON = OpenAPI_cag_data_convertToJSON(access_and_mobility_subscription_data->cag_data); + if (cag_data_local_JSON == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [cag_data]"); + goto end; + } + cJSON_AddItemToObject(item, "cagData", cag_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [cag_data]"); + goto end; + } + } + + if (access_and_mobility_subscription_data->stn_sr) { + if (cJSON_AddStringToObject(item, "stnSr", access_and_mobility_subscription_data->stn_sr) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [stn_sr]"); + goto end; + } + } + + if (access_and_mobility_subscription_data->c_msisdn) { + if (cJSON_AddStringToObject(item, "cMsisdn", access_and_mobility_subscription_data->c_msisdn) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [c_msisdn]"); + goto end; + } + } + + if (access_and_mobility_subscription_data->nb_io_t_ue_priority) { + if (cJSON_AddNumberToObject(item, "nbIoTUePriority", access_and_mobility_subscription_data->nb_io_t_ue_priority) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [nb_io_t_ue_priority]"); + goto end; + } + } + + if (access_and_mobility_subscription_data->nssai_inclusion_allowed >= 0) { + if (cJSON_AddBoolToObject(item, "nssaiInclusionAllowed", access_and_mobility_subscription_data->nssai_inclusion_allowed) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [nssai_inclusion_allowed]"); + goto end; + } + } + + if (access_and_mobility_subscription_data->rg_wireline_characteristics) { + if (cJSON_AddNumberToObject(item, "rgWirelineCharacteristics", access_and_mobility_subscription_data->rg_wireline_characteristics) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [rg_wireline_characteristics]"); + goto end; + } + } + + 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]"); + goto end; + } + cJSON_AddItemToObject(item, "rgTMBR", rg_tmbr_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [rg_tmbr]"); + 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]"); + goto end; + } + } + + if (access_and_mobility_subscription_data->expected_ue_behaviour_list) { + cJSON *expected_ue_behaviour_list_local_JSON = OpenAPI_expected_ue_behaviour_data_convertToJSON(access_and_mobility_subscription_data->expected_ue_behaviour_list); + if (expected_ue_behaviour_list_local_JSON == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [expected_ue_behaviour_list]"); + goto end; + } + cJSON_AddItemToObject(item, "expectedUeBehaviourList", expected_ue_behaviour_list_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [expected_ue_behaviour_list]"); + goto end; + } + } + + 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_restrictionsList = cJSON_AddArrayToObject(item, "primaryRatRestrictions"); + if (primary_rat_restrictionsList == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [primary_rat_restrictions]"); + goto end; + } + + OpenAPI_lnode_t *primary_rat_restrictions_node; + if (access_and_mobility_subscription_data->primary_rat_restrictions) { + OpenAPI_list_for_each(access_and_mobility_subscription_data->primary_rat_restrictions, primary_rat_restrictions_node) { + cJSON *itemLocal = OpenAPI_rat_type_convertToJSON(primary_rat_restrictions_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [primary_rat_restrictions]"); + goto end; + } + cJSON_AddItemToArray(primary_rat_restrictionsList, itemLocal); + } + } + } + + if (access_and_mobility_subscription_data->secondary_rat_restrictions) { + cJSON *secondary_rat_restrictionsList = cJSON_AddArrayToObject(item, "secondaryRatRestrictions"); + if (secondary_rat_restrictionsList == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [secondary_rat_restrictions]"); + goto end; + } + + OpenAPI_lnode_t *secondary_rat_restrictions_node; + if (access_and_mobility_subscription_data->secondary_rat_restrictions) { + OpenAPI_list_for_each(access_and_mobility_subscription_data->secondary_rat_restrictions, secondary_rat_restrictions_node) { + cJSON *itemLocal = OpenAPI_rat_type_convertToJSON(secondary_rat_restrictions_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [secondary_rat_restrictions]"); + goto end; + } + cJSON_AddItemToArray(secondary_rat_restrictionsList, itemLocal); + } + } + } + + if (access_and_mobility_subscription_data->edrx_parameters_list) { + cJSON *edrx_parameters_listList = cJSON_AddArrayToObject(item, "edrxParametersList"); + if (edrx_parameters_listList == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [edrx_parameters_list]"); + goto end; + } + + OpenAPI_lnode_t *edrx_parameters_list_node; + if (access_and_mobility_subscription_data->edrx_parameters_list) { + OpenAPI_list_for_each(access_and_mobility_subscription_data->edrx_parameters_list, edrx_parameters_list_node) { + cJSON *itemLocal = OpenAPI_edrx_parameters_convertToJSON(edrx_parameters_list_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [edrx_parameters_list]"); + goto end; + } + cJSON_AddItemToArray(edrx_parameters_listList, itemLocal); + } + } + } + + if (access_and_mobility_subscription_data->ptw_parameters_list) { + cJSON *ptw_parameters_listList = cJSON_AddArrayToObject(item, "ptwParametersList"); + if (ptw_parameters_listList == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [ptw_parameters_list]"); + goto end; + } + + OpenAPI_lnode_t *ptw_parameters_list_node; + if (access_and_mobility_subscription_data->ptw_parameters_list) { + OpenAPI_list_for_each(access_and_mobility_subscription_data->ptw_parameters_list, ptw_parameters_list_node) { + cJSON *itemLocal = OpenAPI_ptw_parameters_convertToJSON(ptw_parameters_list_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [ptw_parameters_list]"); + goto end; + } + cJSON_AddItemToArray(ptw_parameters_listList, itemLocal); + } + } + } + + if (access_and_mobility_subscription_data->iab_operation_allowed >= 0) { + if (cJSON_AddBoolToObject(item, "iabOperationAllowed", access_and_mobility_subscription_data->iab_operation_allowed) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [iab_operation_allowed]"); + goto end; + } + } + + 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]"); + goto end; + } + cJSON_AddItemToObject(item, "nrV2xServicesAuth", nr_v2x_services_auth_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]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_subscription_data_parseFromJSON(cJSON *access_and_mobility_subscription_dataJSON) +{ + OpenAPI_access_and_mobility_subscription_data_t *access_and_mobility_subscription_data_local_var = NULL; + cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "supportedFeatures"); + + if (supported_features) { + if (!cJSON_IsString(supported_features)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [supported_features]"); + goto end; + } + } + + cJSON *gpsis = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "gpsis"); + + OpenAPI_list_t *gpsisList; + if (gpsis) { + cJSON *gpsis_local; + if (!cJSON_IsArray(gpsis)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [gpsis]"); + goto end; + } + gpsisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(gpsis_local, gpsis) { + if (!cJSON_IsString(gpsis_local)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [gpsis]"); + goto end; + } + OpenAPI_list_add(gpsisList, ogs_strdup(gpsis_local->valuestring)); + } + } + + cJSON *internal_group_ids = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "internalGroupIds"); + + OpenAPI_list_t *internal_group_idsList; + if (internal_group_ids) { + cJSON *internal_group_ids_local; + if (!cJSON_IsArray(internal_group_ids)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [internal_group_ids]"); + goto end; + } + internal_group_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(internal_group_ids_local, internal_group_ids) { + if (!cJSON_IsString(internal_group_ids_local)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [internal_group_ids]"); + goto end; + } + OpenAPI_list_add(internal_group_idsList, ogs_strdup(internal_group_ids_local->valuestring)); + } + } + + 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; + if (shared_vn_group_data_ids) { + cJSON *shared_vn_group_data_ids_local_map; + if (!cJSON_IsObject(shared_vn_group_data_ids)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [shared_vn_group_data_ids]"); + goto end; + } + shared_vn_group_data_idsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(shared_vn_group_data_ids_local_map, shared_vn_group_data_ids) { + cJSON *localMapObject = shared_vn_group_data_ids_local_map; + OpenAPI_list_add(shared_vn_group_data_idsList, localMapKeyPair); + } + } + + cJSON *subscribed_ue_ambr = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "subscribedUeAmbr"); + + OpenAPI_ambr_rm_t *subscribed_ue_ambr_local_nonprim = NULL; + if (subscribed_ue_ambr) { + subscribed_ue_ambr_local_nonprim = OpenAPI_ambr_rm_parseFromJSON(subscribed_ue_ambr); + } + + cJSON *nssai = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "nssai"); + + OpenAPI_nssai_t *nssai_local_nonprim = NULL; + if (nssai) { + nssai_local_nonprim = OpenAPI_nssai_parseFromJSON(nssai); + } + + cJSON *rat_restrictions = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "ratRestrictions"); + + OpenAPI_list_t *rat_restrictionsList; + if (rat_restrictions) { + cJSON *rat_restrictions_local_nonprimitive; + if (!cJSON_IsArray(rat_restrictions)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [rat_restrictions]"); + goto end; + } + + rat_restrictionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(rat_restrictions_local_nonprimitive, rat_restrictions ) { + if (!cJSON_IsObject(rat_restrictions_local_nonprimitive)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [rat_restrictions]"); + goto end; + } + OpenAPI_rat_type_t *rat_restrictionsItem = OpenAPI_rat_type_parseFromJSON(rat_restrictions_local_nonprimitive); + + OpenAPI_list_add(rat_restrictionsList, rat_restrictionsItem); + } + } + + cJSON *forbidden_areas = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "forbiddenAreas"); + + OpenAPI_list_t *forbidden_areasList; + if (forbidden_areas) { + cJSON *forbidden_areas_local_nonprimitive; + if (!cJSON_IsArray(forbidden_areas)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [forbidden_areas]"); + goto end; + } + + forbidden_areasList = OpenAPI_list_create(); + + cJSON_ArrayForEach(forbidden_areas_local_nonprimitive, forbidden_areas ) { + if (!cJSON_IsObject(forbidden_areas_local_nonprimitive)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [forbidden_areas]"); + goto end; + } + OpenAPI_area_t *forbidden_areasItem = OpenAPI_area_parseFromJSON(forbidden_areas_local_nonprimitive); + + OpenAPI_list_add(forbidden_areasList, forbidden_areasItem); + } + } + + cJSON *service_area_restriction = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "serviceAreaRestriction"); + + OpenAPI_service_area_restriction_t *service_area_restriction_local_nonprim = NULL; + if (service_area_restriction) { + service_area_restriction_local_nonprim = OpenAPI_service_area_restriction_parseFromJSON(service_area_restriction); + } + + cJSON *core_network_type_restrictions = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "coreNetworkTypeRestrictions"); + + OpenAPI_list_t *core_network_type_restrictionsList; + if (core_network_type_restrictions) { + cJSON *core_network_type_restrictions_local_nonprimitive; + if (!cJSON_IsArray(core_network_type_restrictions)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [core_network_type_restrictions]"); + goto end; + } + + core_network_type_restrictionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(core_network_type_restrictions_local_nonprimitive, core_network_type_restrictions ) { + if (!cJSON_IsObject(core_network_type_restrictions_local_nonprimitive)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [core_network_type_restrictions]"); + goto end; + } + OpenAPI_core_network_type_t *core_network_type_restrictionsItem = OpenAPI_core_network_type_parseFromJSON(core_network_type_restrictions_local_nonprimitive); + + OpenAPI_list_add(core_network_type_restrictionsList, core_network_type_restrictionsItem); + } + } + + cJSON *rfsp_index = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "rfspIndex"); + + if (rfsp_index) { + if (!cJSON_IsNumber(rfsp_index)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [rfsp_index]"); + goto end; + } + } + + cJSON *subs_reg_timer = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "subsRegTimer"); + + if (subs_reg_timer) { + if (!cJSON_IsNumber(subs_reg_timer)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [subs_reg_timer]"); + goto end; + } + } + + cJSON *ue_usage_type = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "ueUsageType"); + + if (ue_usage_type) { + if (!cJSON_IsNumber(ue_usage_type)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [ue_usage_type]"); + goto end; + } + } + + cJSON *mps_priority = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "mpsPriority"); + + if (mps_priority) { + if (!cJSON_IsBool(mps_priority)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [mps_priority]"); + goto end; + } + } + + cJSON *mcs_priority = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "mcsPriority"); + + if (mcs_priority) { + if (!cJSON_IsBool(mcs_priority)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [mcs_priority]"); + goto end; + } + } + + cJSON *active_time = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "activeTime"); + + if (active_time) { + if (!cJSON_IsNumber(active_time)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [active_time]"); + goto end; + } + } + + 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; + if (sor_info) { + sor_info_local_nonprim = OpenAPI_sor_info_parseFromJSON(sor_info); + } + + cJSON *sor_info_expect_ind = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "sorInfoExpectInd"); + + if (sor_info_expect_ind) { + if (!cJSON_IsBool(sor_info_expect_ind)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [sor_info_expect_ind]"); + goto end; + } + } + + cJSON *soraf_retrieval = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "sorafRetrieval"); + + if (soraf_retrieval) { + if (!cJSON_IsBool(soraf_retrieval)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [soraf_retrieval]"); + goto end; + } + } + + cJSON *sor_update_indicator_list = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "sorUpdateIndicatorList"); + + OpenAPI_list_t *sor_update_indicator_listList; + if (sor_update_indicator_list) { + cJSON *sor_update_indicator_list_local_nonprimitive; + if (!cJSON_IsArray(sor_update_indicator_list)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [sor_update_indicator_list]"); + goto end; + } + + sor_update_indicator_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(sor_update_indicator_list_local_nonprimitive, sor_update_indicator_list ) { + if (!cJSON_IsString(sor_update_indicator_list_local_nonprimitive)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [sor_update_indicator_list]"); + goto end; + } + + OpenAPI_list_add(sor_update_indicator_listList, (void *)OpenAPI_sor_update_indicator_FromString(sor_update_indicator_list_local_nonprimitive->valuestring)); + } + } + + cJSON *upu_info = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "upuInfo"); + + OpenAPI_upu_info_t *upu_info_local_nonprim = NULL; + if (upu_info) { + upu_info_local_nonprim = OpenAPI_upu_info_parseFromJSON(upu_info); + } + + cJSON *mico_allowed = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "micoAllowed"); + + if (mico_allowed) { + if (!cJSON_IsBool(mico_allowed)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [mico_allowed]"); + goto end; + } + } + + cJSON *shared_am_data_ids = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "sharedAmDataIds"); + + OpenAPI_list_t *shared_am_data_idsList; + if (shared_am_data_ids) { + cJSON *shared_am_data_ids_local; + if (!cJSON_IsArray(shared_am_data_ids)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [shared_am_data_ids]"); + goto end; + } + shared_am_data_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(shared_am_data_ids_local, shared_am_data_ids) { + if (!cJSON_IsString(shared_am_data_ids_local)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [shared_am_data_ids]"); + goto end; + } + OpenAPI_list_add(shared_am_data_idsList, ogs_strdup(shared_am_data_ids_local->valuestring)); + } + } + + cJSON *odb_packet_services = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "odbPacketServices"); + + OpenAPI_odb_packet_services_t *odb_packet_services_local_nonprim = NULL; + if (odb_packet_services) { + odb_packet_services_local_nonprim = OpenAPI_odb_packet_services_parseFromJSON(odb_packet_services); + } + + cJSON *subscribed_dnn_list = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "subscribedDnnList"); + + OpenAPI_list_t *subscribed_dnn_listList; + if (subscribed_dnn_list) { + cJSON *subscribed_dnn_list_local; + if (!cJSON_IsArray(subscribed_dnn_list)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [subscribed_dnn_list]"); + goto end; + } + subscribed_dnn_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(subscribed_dnn_list_local, subscribed_dnn_list) { + if (!cJSON_IsString(subscribed_dnn_list_local)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [subscribed_dnn_list]"); + goto end; + } + OpenAPI_list_add(subscribed_dnn_listList, ogs_strdup(subscribed_dnn_list_local->valuestring)); + } + } + + cJSON *service_gap_time = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "serviceGapTime"); + + if (service_gap_time) { + if (!cJSON_IsNumber(service_gap_time)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [service_gap_time]"); + goto end; + } + } + + cJSON *trace_data = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "traceData"); + + OpenAPI_trace_data_t *trace_data_local_nonprim = NULL; + if (trace_data) { + trace_data_local_nonprim = OpenAPI_trace_data_parseFromJSON(trace_data); + } + + cJSON *cag_data = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "cagData"); + + OpenAPI_cag_data_t *cag_data_local_nonprim = NULL; + if (cag_data) { + cag_data_local_nonprim = OpenAPI_cag_data_parseFromJSON(cag_data); + } + + cJSON *stn_sr = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "stnSr"); + + if (stn_sr) { + if (!cJSON_IsString(stn_sr)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [stn_sr]"); + goto end; + } + } + + cJSON *c_msisdn = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "cMsisdn"); + + if (c_msisdn) { + if (!cJSON_IsString(c_msisdn)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [c_msisdn]"); + goto end; + } + } + + cJSON *nb_io_t_ue_priority = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "nbIoTUePriority"); + + if (nb_io_t_ue_priority) { + if (!cJSON_IsNumber(nb_io_t_ue_priority)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [nb_io_t_ue_priority]"); + goto end; + } + } + + cJSON *nssai_inclusion_allowed = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "nssaiInclusionAllowed"); + + if (nssai_inclusion_allowed) { + if (!cJSON_IsBool(nssai_inclusion_allowed)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [nssai_inclusion_allowed]"); + goto end; + } + } + + cJSON *rg_wireline_characteristics = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "rgWirelineCharacteristics"); + + if (rg_wireline_characteristics) { + if (!cJSON_IsNumber(rg_wireline_characteristics)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [rg_wireline_characteristics]"); + goto end; + } + } + + cJSON *rg_tmbr = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "rgTMBR"); + + OpenAPI_tmbr_t *rg_tmbr_local_nonprim = NULL; + if (rg_tmbr) { + rg_tmbr_local_nonprim = OpenAPI_tmbr_parseFromJSON(rg_tmbr); + } + + cJSON *ec_restriction_data = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "ecRestrictionData"); + + 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); + } + + cJSON *expected_ue_behaviour_list = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "expectedUeBehaviourList"); + + OpenAPI_expected_ue_behaviour_data_t *expected_ue_behaviour_list_local_nonprim = NULL; + if (expected_ue_behaviour_list) { + 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; + if (primary_rat_restrictions) { + cJSON *primary_rat_restrictions_local_nonprimitive; + if (!cJSON_IsArray(primary_rat_restrictions)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [primary_rat_restrictions]"); + goto end; + } + + primary_rat_restrictionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(primary_rat_restrictions_local_nonprimitive, primary_rat_restrictions ) { + if (!cJSON_IsObject(primary_rat_restrictions_local_nonprimitive)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [primary_rat_restrictions]"); + goto end; + } + OpenAPI_rat_type_t *primary_rat_restrictionsItem = OpenAPI_rat_type_parseFromJSON(primary_rat_restrictions_local_nonprimitive); + + OpenAPI_list_add(primary_rat_restrictionsList, primary_rat_restrictionsItem); + } + } + + cJSON *secondary_rat_restrictions = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "secondaryRatRestrictions"); + + OpenAPI_list_t *secondary_rat_restrictionsList; + if (secondary_rat_restrictions) { + cJSON *secondary_rat_restrictions_local_nonprimitive; + if (!cJSON_IsArray(secondary_rat_restrictions)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [secondary_rat_restrictions]"); + goto end; + } + + secondary_rat_restrictionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(secondary_rat_restrictions_local_nonprimitive, secondary_rat_restrictions ) { + if (!cJSON_IsObject(secondary_rat_restrictions_local_nonprimitive)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [secondary_rat_restrictions]"); + goto end; + } + OpenAPI_rat_type_t *secondary_rat_restrictionsItem = OpenAPI_rat_type_parseFromJSON(secondary_rat_restrictions_local_nonprimitive); + + OpenAPI_list_add(secondary_rat_restrictionsList, secondary_rat_restrictionsItem); + } + } + + cJSON *edrx_parameters_list = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "edrxParametersList"); + + OpenAPI_list_t *edrx_parameters_listList; + if (edrx_parameters_list) { + cJSON *edrx_parameters_list_local_nonprimitive; + if (!cJSON_IsArray(edrx_parameters_list)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [edrx_parameters_list]"); + goto end; + } + + edrx_parameters_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(edrx_parameters_list_local_nonprimitive, edrx_parameters_list ) { + if (!cJSON_IsObject(edrx_parameters_list_local_nonprimitive)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [edrx_parameters_list]"); + goto end; + } + OpenAPI_edrx_parameters_t *edrx_parameters_listItem = OpenAPI_edrx_parameters_parseFromJSON(edrx_parameters_list_local_nonprimitive); + + OpenAPI_list_add(edrx_parameters_listList, edrx_parameters_listItem); + } + } + + cJSON *ptw_parameters_list = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "ptwParametersList"); + + OpenAPI_list_t *ptw_parameters_listList; + if (ptw_parameters_list) { + cJSON *ptw_parameters_list_local_nonprimitive; + if (!cJSON_IsArray(ptw_parameters_list)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [ptw_parameters_list]"); + goto end; + } + + ptw_parameters_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ptw_parameters_list_local_nonprimitive, ptw_parameters_list ) { + if (!cJSON_IsObject(ptw_parameters_list_local_nonprimitive)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [ptw_parameters_list]"); + goto end; + } + OpenAPI_ptw_parameters_t *ptw_parameters_listItem = OpenAPI_ptw_parameters_parseFromJSON(ptw_parameters_list_local_nonprimitive); + + OpenAPI_list_add(ptw_parameters_listList, ptw_parameters_listItem); + } + } + + cJSON *iab_operation_allowed = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "iabOperationAllowed"); + + if (iab_operation_allowed) { + if (!cJSON_IsBool(iab_operation_allowed)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [iab_operation_allowed]"); + goto end; + } + } + + cJSON *nr_v2x_services_auth = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "nrV2xServicesAuth"); + + 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]"); + goto end; + } + } + + cJSON *lte_pc5_ambr = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "ltePc5Ambr"); + + 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; + } + } + + 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, + rat_restrictions ? rat_restrictionsList : NULL, + forbidden_areas ? forbidden_areasList : NULL, + service_area_restriction ? service_area_restriction_local_nonprim : NULL, + core_network_type_restrictions ? core_network_type_restrictionsList : NULL, + rfsp_index ? rfsp_index->valuedouble : 0, + subs_reg_timer ? subs_reg_timer->valuedouble : 0, + ue_usage_type ? ue_usage_type->valuedouble : 0, + 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, + sor_update_indicator_list ? sor_update_indicator_listList : NULL, + 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, + subscribed_dnn_list ? subscribed_dnn_listList : NULL, + service_gap_time ? service_gap_time->valuedouble : 0, + trace_data ? trace_data_local_nonprim : NULL, + cag_data ? cag_data_local_nonprim : NULL, + stn_sr ? ogs_strdup(stn_sr->valuestring) : NULL, + c_msisdn ? ogs_strdup(c_msisdn->valuestring) : NULL, + 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, + 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 + ); + + return access_and_mobility_subscription_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/access_and_mobility_subscription_data.h b/lib/sbi/openapi/model/access_and_mobility_subscription_data.h new file mode 100644 index 0000000000..a4705fe50a --- /dev/null +++ b/lib/sbi/openapi/model/access_and_mobility_subscription_data.h @@ -0,0 +1,155 @@ +/* + * access_and_mobility_subscription_data.h + * + * + */ + +#ifndef _OpenAPI_access_and_mobility_subscription_data_H_ +#define _OpenAPI_access_and_mobility_subscription_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "ambr_rm.h" +#include "area.h" +#include "cag_data.h" +#include "core_network_type.h" +#include "ec_restriction_data.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 "nssai.h" +#include "odb_packet_services.h" +#include "ptw_parameters.h" +#include "rat_type.h" +#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" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_access_and_mobility_subscription_data_s OpenAPI_access_and_mobility_subscription_data_t; +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; + OpenAPI_list_t *rat_restrictions; + OpenAPI_list_t *forbidden_areas; + struct OpenAPI_service_area_restriction_s *service_area_restriction; + OpenAPI_list_t *core_network_type_restrictions; + int rfsp_index; + int subs_reg_timer; + int ue_usage_type; + int mps_priority; + int mcs_priority; + int active_time; + int dl_packet_count; + struct OpenAPI_sor_info_s *sor_info; + int sor_info_expect_ind; + int soraf_retrieval; + OpenAPI_list_t *sor_update_indicator_list; + 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_list_t *subscribed_dnn_list; + int service_gap_time; + struct OpenAPI_trace_data_s *trace_data; + struct OpenAPI_cag_data_s *cag_data; + char *stn_sr; + char *c_msisdn; + 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_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_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, + OpenAPI_list_t *rat_restrictions, + OpenAPI_list_t *forbidden_areas, + OpenAPI_service_area_restriction_t *service_area_restriction, + OpenAPI_list_t *core_network_type_restrictions, + int rfsp_index, + int subs_reg_timer, + int ue_usage_type, + int mps_priority, + int mcs_priority, + int active_time, + int dl_packet_count, + OpenAPI_sor_info_t *sor_info, + int sor_info_expect_ind, + int soraf_retrieval, + OpenAPI_list_t *sor_update_indicator_list, + 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_list_t *subscribed_dnn_list, + int service_gap_time, + OpenAPI_trace_data_t *trace_data, + OpenAPI_cag_data_t *cag_data, + char *stn_sr, + char *c_msisdn, + 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_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 + ); +void OpenAPI_access_and_mobility_subscription_data_free(OpenAPI_access_and_mobility_subscription_data_t *access_and_mobility_subscription_data); +OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_subscription_data_parseFromJSON(cJSON *access_and_mobility_subscription_dataJSON); +cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_access_and_mobility_subscription_data_t *access_and_mobility_subscription_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_access_and_mobility_subscription_data_H_ */ + diff --git a/lib/sbi/openapi/model/access_right_status.c b/lib/sbi/openapi/model/access_right_status.c new file mode 100644 index 0000000000..a712f9cef9 --- /dev/null +++ b/lib/sbi/openapi/model/access_right_status.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "access_right_status.h" + +OpenAPI_access_right_status_t *OpenAPI_access_right_status_create( + ) +{ + OpenAPI_access_right_status_t *access_right_status_local_var = OpenAPI_malloc(sizeof(OpenAPI_access_right_status_t)); + if (!access_right_status_local_var) { + return NULL; + } + + return access_right_status_local_var; +} + +void OpenAPI_access_right_status_free(OpenAPI_access_right_status_t *access_right_status) +{ + if (NULL == access_right_status) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(access_right_status); +} + +cJSON *OpenAPI_access_right_status_convertToJSON(OpenAPI_access_right_status_t *access_right_status) +{ + cJSON *item = NULL; + + if (access_right_status == NULL) { + ogs_error("OpenAPI_access_right_status_convertToJSON() failed [AccessRightStatus]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_access_right_status_t *OpenAPI_access_right_status_parseFromJSON(cJSON *access_right_statusJSON) +{ + OpenAPI_access_right_status_t *access_right_status_local_var = NULL; + access_right_status_local_var = OpenAPI_access_right_status_create ( + ); + + return access_right_status_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/access_right_status.h b/lib/sbi/openapi/model/access_right_status.h new file mode 100644 index 0000000000..6b5e17c55e --- /dev/null +++ b/lib/sbi/openapi/model/access_right_status.h @@ -0,0 +1,35 @@ +/* + * access_right_status.h + * + * Possible values are - FULLY_ALLOWED: The User is fully allowed to access to the channel. - PREVIEW_ALLOWED: The User is preview allowed to access to the channel. - NO_ALLOWED: The User is not allowed to access to the channel. + */ + +#ifndef _OpenAPI_access_right_status_H_ +#define _OpenAPI_access_right_status_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_access_right_status_s OpenAPI_access_right_status_t; +typedef struct OpenAPI_access_right_status_s { +} OpenAPI_access_right_status_t; + +OpenAPI_access_right_status_t *OpenAPI_access_right_status_create( + ); +void OpenAPI_access_right_status_free(OpenAPI_access_right_status_t *access_right_status); +OpenAPI_access_right_status_t *OpenAPI_access_right_status_parseFromJSON(cJSON *access_right_statusJSON); +cJSON *OpenAPI_access_right_status_convertToJSON(OpenAPI_access_right_status_t *access_right_status); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_access_right_status_H_ */ + diff --git a/lib/sbi/openapi/model/access_tech.c b/lib/sbi/openapi/model/access_tech.c new file mode 100644 index 0000000000..d1f949f04a --- /dev/null +++ b/lib/sbi/openapi/model/access_tech.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "access_tech.h" + +OpenAPI_access_tech_t *OpenAPI_access_tech_create( + ) +{ + OpenAPI_access_tech_t *access_tech_local_var = OpenAPI_malloc(sizeof(OpenAPI_access_tech_t)); + if (!access_tech_local_var) { + return NULL; + } + + return access_tech_local_var; +} + +void OpenAPI_access_tech_free(OpenAPI_access_tech_t *access_tech) +{ + if (NULL == access_tech) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(access_tech); +} + +cJSON *OpenAPI_access_tech_convertToJSON(OpenAPI_access_tech_t *access_tech) +{ + cJSON *item = NULL; + + if (access_tech == NULL) { + ogs_error("OpenAPI_access_tech_convertToJSON() failed [AccessTech]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_access_tech_t *OpenAPI_access_tech_parseFromJSON(cJSON *access_techJSON) +{ + OpenAPI_access_tech_t *access_tech_local_var = NULL; + access_tech_local_var = OpenAPI_access_tech_create ( + ); + + return access_tech_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/access_tech.h b/lib/sbi/openapi/model/access_tech.h new file mode 100644 index 0000000000..83b7f079f1 --- /dev/null +++ b/lib/sbi/openapi/model/access_tech.h @@ -0,0 +1,35 @@ +/* + * access_tech.h + * + * + */ + +#ifndef _OpenAPI_access_tech_H_ +#define _OpenAPI_access_tech_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_access_tech_s OpenAPI_access_tech_t; +typedef struct OpenAPI_access_tech_s { +} OpenAPI_access_tech_t; + +OpenAPI_access_tech_t *OpenAPI_access_tech_create( + ); +void OpenAPI_access_tech_free(OpenAPI_access_tech_t *access_tech); +OpenAPI_access_tech_t *OpenAPI_access_tech_parseFromJSON(cJSON *access_techJSON); +cJSON *OpenAPI_access_tech_convertToJSON(OpenAPI_access_tech_t *access_tech); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_access_tech_H_ */ + diff --git a/lib/sbi/openapi/model/acknowledge_info.c b/lib/sbi/openapi/model/acknowledge_info.c new file mode 100644 index 0000000000..2e7628033a --- /dev/null +++ b/lib/sbi/openapi/model/acknowledge_info.c @@ -0,0 +1,136 @@ + +#include +#include +#include +#include "acknowledge_info.h" + +OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_create( + char *sor_mac_iue, + char *upu_mac_iue, + char *secured_packet, + char *provisioning_time + ) +{ + OpenAPI_acknowledge_info_t *acknowledge_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_acknowledge_info_t)); + if (!acknowledge_info_local_var) { + return NULL; + } + acknowledge_info_local_var->sor_mac_iue = sor_mac_iue; + acknowledge_info_local_var->upu_mac_iue = upu_mac_iue; + acknowledge_info_local_var->secured_packet = secured_packet; + acknowledge_info_local_var->provisioning_time = provisioning_time; + + return acknowledge_info_local_var; +} + +void OpenAPI_acknowledge_info_free(OpenAPI_acknowledge_info_t *acknowledge_info) +{ + if (NULL == acknowledge_info) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(acknowledge_info->sor_mac_iue); + ogs_free(acknowledge_info->upu_mac_iue); + ogs_free(acknowledge_info->secured_packet); + ogs_free(acknowledge_info->provisioning_time); + ogs_free(acknowledge_info); +} + +cJSON *OpenAPI_acknowledge_info_convertToJSON(OpenAPI_acknowledge_info_t *acknowledge_info) +{ + cJSON *item = NULL; + + if (acknowledge_info == NULL) { + ogs_error("OpenAPI_acknowledge_info_convertToJSON() failed [AcknowledgeInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (acknowledge_info->sor_mac_iue) { + if (cJSON_AddStringToObject(item, "sorMacIue", acknowledge_info->sor_mac_iue) == NULL) { + ogs_error("OpenAPI_acknowledge_info_convertToJSON() failed [sor_mac_iue]"); + goto end; + } + } + + if (acknowledge_info->upu_mac_iue) { + if (cJSON_AddStringToObject(item, "upuMacIue", acknowledge_info->upu_mac_iue) == NULL) { + ogs_error("OpenAPI_acknowledge_info_convertToJSON() failed [upu_mac_iue]"); + goto end; + } + } + + if (acknowledge_info->secured_packet) { + if (cJSON_AddStringToObject(item, "securedPacket", acknowledge_info->secured_packet) == NULL) { + ogs_error("OpenAPI_acknowledge_info_convertToJSON() failed [secured_packet]"); + goto end; + } + } + + if (!acknowledge_info->provisioning_time) { + ogs_error("OpenAPI_acknowledge_info_convertToJSON() failed [provisioning_time]"); + goto end; + } + if (cJSON_AddStringToObject(item, "provisioningTime", acknowledge_info->provisioning_time) == NULL) { + ogs_error("OpenAPI_acknowledge_info_convertToJSON() failed [provisioning_time]"); + goto end; + } + +end: + return item; +} + +OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_parseFromJSON(cJSON *acknowledge_infoJSON) +{ + OpenAPI_acknowledge_info_t *acknowledge_info_local_var = NULL; + cJSON *sor_mac_iue = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "sorMacIue"); + + if (sor_mac_iue) { + if (!cJSON_IsString(sor_mac_iue)) { + ogs_error("OpenAPI_acknowledge_info_parseFromJSON() failed [sor_mac_iue]"); + goto end; + } + } + + cJSON *upu_mac_iue = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "upuMacIue"); + + if (upu_mac_iue) { + if (!cJSON_IsString(upu_mac_iue)) { + ogs_error("OpenAPI_acknowledge_info_parseFromJSON() failed [upu_mac_iue]"); + goto end; + } + } + + cJSON *secured_packet = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "securedPacket"); + + if (secured_packet) { + if (!cJSON_IsString(secured_packet)) { + ogs_error("OpenAPI_acknowledge_info_parseFromJSON() failed [secured_packet]"); + goto end; + } + } + + cJSON *provisioning_time = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "provisioningTime"); + if (!provisioning_time) { + ogs_error("OpenAPI_acknowledge_info_parseFromJSON() failed [provisioning_time]"); + goto end; + } + + + if (!cJSON_IsString(provisioning_time)) { + ogs_error("OpenAPI_acknowledge_info_parseFromJSON() failed [provisioning_time]"); + goto end; + } + + acknowledge_info_local_var = OpenAPI_acknowledge_info_create ( + sor_mac_iue ? ogs_strdup(sor_mac_iue->valuestring) : NULL, + upu_mac_iue ? ogs_strdup(upu_mac_iue->valuestring) : NULL, + secured_packet ? ogs_strdup(secured_packet->valuestring) : NULL, + ogs_strdup(provisioning_time->valuestring) + ); + + return acknowledge_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/acknowledge_info.h b/lib/sbi/openapi/model/acknowledge_info.h new file mode 100644 index 0000000000..cfd54c9614 --- /dev/null +++ b/lib/sbi/openapi/model/acknowledge_info.h @@ -0,0 +1,43 @@ +/* + * acknowledge_info.h + * + * + */ + +#ifndef _OpenAPI_acknowledge_info_H_ +#define _OpenAPI_acknowledge_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_acknowledge_info_s OpenAPI_acknowledge_info_t; +typedef struct OpenAPI_acknowledge_info_s { + char *sor_mac_iue; + char *upu_mac_iue; + char *secured_packet; + char *provisioning_time; +} OpenAPI_acknowledge_info_t; + +OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_create( + char *sor_mac_iue, + char *upu_mac_iue, + char *secured_packet, + char *provisioning_time + ); +void OpenAPI_acknowledge_info_free(OpenAPI_acknowledge_info_t *acknowledge_info); +OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_parseFromJSON(cJSON *acknowledge_infoJSON); +cJSON *OpenAPI_acknowledge_info_convertToJSON(OpenAPI_acknowledge_info_t *acknowledge_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_acknowledge_info_H_ */ + diff --git a/lib/sbi/openapi/model/acs_info.c b/lib/sbi/openapi/model/acs_info.c new file mode 100644 index 0000000000..362aa690fb --- /dev/null +++ b/lib/sbi/openapi/model/acs_info.c @@ -0,0 +1,111 @@ + +#include +#include +#include +#include "acs_info.h" + +OpenAPI_acs_info_t *OpenAPI_acs_info_create( + char *acs_url, + char *acs_ipv4_addr, + char *acs_ipv6_addr + ) +{ + OpenAPI_acs_info_t *acs_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_acs_info_t)); + if (!acs_info_local_var) { + return NULL; + } + acs_info_local_var->acs_url = acs_url; + acs_info_local_var->acs_ipv4_addr = acs_ipv4_addr; + acs_info_local_var->acs_ipv6_addr = acs_ipv6_addr; + + return acs_info_local_var; +} + +void OpenAPI_acs_info_free(OpenAPI_acs_info_t *acs_info) +{ + if (NULL == acs_info) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(acs_info->acs_url); + ogs_free(acs_info->acs_ipv4_addr); + ogs_free(acs_info->acs_ipv6_addr); + ogs_free(acs_info); +} + +cJSON *OpenAPI_acs_info_convertToJSON(OpenAPI_acs_info_t *acs_info) +{ + cJSON *item = NULL; + + if (acs_info == NULL) { + ogs_error("OpenAPI_acs_info_convertToJSON() failed [AcsInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (acs_info->acs_url) { + if (cJSON_AddStringToObject(item, "acsUrl", acs_info->acs_url) == NULL) { + ogs_error("OpenAPI_acs_info_convertToJSON() failed [acs_url]"); + goto end; + } + } + + if (acs_info->acs_ipv4_addr) { + if (cJSON_AddStringToObject(item, "acsIpv4Addr", acs_info->acs_ipv4_addr) == NULL) { + ogs_error("OpenAPI_acs_info_convertToJSON() failed [acs_ipv4_addr]"); + goto end; + } + } + + if (acs_info->acs_ipv6_addr) { + if (cJSON_AddStringToObject(item, "acsIpv6Addr", acs_info->acs_ipv6_addr) == NULL) { + ogs_error("OpenAPI_acs_info_convertToJSON() failed [acs_ipv6_addr]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_acs_info_t *OpenAPI_acs_info_parseFromJSON(cJSON *acs_infoJSON) +{ + OpenAPI_acs_info_t *acs_info_local_var = NULL; + cJSON *acs_url = cJSON_GetObjectItemCaseSensitive(acs_infoJSON, "acsUrl"); + + if (acs_url) { + if (!cJSON_IsString(acs_url)) { + ogs_error("OpenAPI_acs_info_parseFromJSON() failed [acs_url]"); + goto end; + } + } + + cJSON *acs_ipv4_addr = cJSON_GetObjectItemCaseSensitive(acs_infoJSON, "acsIpv4Addr"); + + if (acs_ipv4_addr) { + if (!cJSON_IsString(acs_ipv4_addr)) { + ogs_error("OpenAPI_acs_info_parseFromJSON() failed [acs_ipv4_addr]"); + goto end; + } + } + + cJSON *acs_ipv6_addr = cJSON_GetObjectItemCaseSensitive(acs_infoJSON, "acsIpv6Addr"); + + if (acs_ipv6_addr) { + if (!cJSON_IsString(acs_ipv6_addr)) { + ogs_error("OpenAPI_acs_info_parseFromJSON() failed [acs_ipv6_addr]"); + goto end; + } + } + + acs_info_local_var = OpenAPI_acs_info_create ( + acs_url ? ogs_strdup(acs_url->valuestring) : NULL, + acs_ipv4_addr ? ogs_strdup(acs_ipv4_addr->valuestring) : NULL, + acs_ipv6_addr ? ogs_strdup(acs_ipv6_addr->valuestring) : NULL + ); + + return acs_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/acs_info.h b/lib/sbi/openapi/model/acs_info.h new file mode 100644 index 0000000000..598085cdf0 --- /dev/null +++ b/lib/sbi/openapi/model/acs_info.h @@ -0,0 +1,41 @@ +/* + * acs_info.h + * + * + */ + +#ifndef _OpenAPI_acs_info_H_ +#define _OpenAPI_acs_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_acs_info_s OpenAPI_acs_info_t; +typedef struct OpenAPI_acs_info_s { + char *acs_url; + char *acs_ipv4_addr; + char *acs_ipv6_addr; +} OpenAPI_acs_info_t; + +OpenAPI_acs_info_t *OpenAPI_acs_info_create( + char *acs_url, + char *acs_ipv4_addr, + char *acs_ipv6_addr + ); +void OpenAPI_acs_info_free(OpenAPI_acs_info_t *acs_info); +OpenAPI_acs_info_t *OpenAPI_acs_info_parseFromJSON(cJSON *acs_infoJSON); +cJSON *OpenAPI_acs_info_convertToJSON(OpenAPI_acs_info_t *acs_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_acs_info_H_ */ + diff --git a/lib/sbi/openapi/model/acs_info_rm.c b/lib/sbi/openapi/model/acs_info_rm.c new file mode 100644 index 0000000000..1a5f935b25 --- /dev/null +++ b/lib/sbi/openapi/model/acs_info_rm.c @@ -0,0 +1,111 @@ + +#include +#include +#include +#include "acs_info_rm.h" + +OpenAPI_acs_info_rm_t *OpenAPI_acs_info_rm_create( + char *acs_url, + char *acs_ipv4_addr, + char *acs_ipv6_addr + ) +{ + OpenAPI_acs_info_rm_t *acs_info_rm_local_var = OpenAPI_malloc(sizeof(OpenAPI_acs_info_rm_t)); + if (!acs_info_rm_local_var) { + return NULL; + } + acs_info_rm_local_var->acs_url = acs_url; + acs_info_rm_local_var->acs_ipv4_addr = acs_ipv4_addr; + acs_info_rm_local_var->acs_ipv6_addr = acs_ipv6_addr; + + return acs_info_rm_local_var; +} + +void OpenAPI_acs_info_rm_free(OpenAPI_acs_info_rm_t *acs_info_rm) +{ + if (NULL == acs_info_rm) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(acs_info_rm->acs_url); + ogs_free(acs_info_rm->acs_ipv4_addr); + ogs_free(acs_info_rm->acs_ipv6_addr); + ogs_free(acs_info_rm); +} + +cJSON *OpenAPI_acs_info_rm_convertToJSON(OpenAPI_acs_info_rm_t *acs_info_rm) +{ + cJSON *item = NULL; + + if (acs_info_rm == NULL) { + ogs_error("OpenAPI_acs_info_rm_convertToJSON() failed [AcsInfoRm]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (acs_info_rm->acs_url) { + if (cJSON_AddStringToObject(item, "acsUrl", acs_info_rm->acs_url) == NULL) { + ogs_error("OpenAPI_acs_info_rm_convertToJSON() failed [acs_url]"); + goto end; + } + } + + if (acs_info_rm->acs_ipv4_addr) { + if (cJSON_AddStringToObject(item, "acsIpv4Addr", acs_info_rm->acs_ipv4_addr) == NULL) { + ogs_error("OpenAPI_acs_info_rm_convertToJSON() failed [acs_ipv4_addr]"); + goto end; + } + } + + if (acs_info_rm->acs_ipv6_addr) { + if (cJSON_AddStringToObject(item, "acsIpv6Addr", acs_info_rm->acs_ipv6_addr) == NULL) { + ogs_error("OpenAPI_acs_info_rm_convertToJSON() failed [acs_ipv6_addr]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_acs_info_rm_t *OpenAPI_acs_info_rm_parseFromJSON(cJSON *acs_info_rmJSON) +{ + OpenAPI_acs_info_rm_t *acs_info_rm_local_var = NULL; + cJSON *acs_url = cJSON_GetObjectItemCaseSensitive(acs_info_rmJSON, "acsUrl"); + + if (acs_url) { + if (!cJSON_IsString(acs_url)) { + ogs_error("OpenAPI_acs_info_rm_parseFromJSON() failed [acs_url]"); + goto end; + } + } + + cJSON *acs_ipv4_addr = cJSON_GetObjectItemCaseSensitive(acs_info_rmJSON, "acsIpv4Addr"); + + if (acs_ipv4_addr) { + if (!cJSON_IsString(acs_ipv4_addr)) { + ogs_error("OpenAPI_acs_info_rm_parseFromJSON() failed [acs_ipv4_addr]"); + goto end; + } + } + + cJSON *acs_ipv6_addr = cJSON_GetObjectItemCaseSensitive(acs_info_rmJSON, "acsIpv6Addr"); + + if (acs_ipv6_addr) { + if (!cJSON_IsString(acs_ipv6_addr)) { + ogs_error("OpenAPI_acs_info_rm_parseFromJSON() failed [acs_ipv6_addr]"); + goto end; + } + } + + acs_info_rm_local_var = OpenAPI_acs_info_rm_create ( + acs_url ? ogs_strdup(acs_url->valuestring) : NULL, + acs_ipv4_addr ? ogs_strdup(acs_ipv4_addr->valuestring) : NULL, + acs_ipv6_addr ? ogs_strdup(acs_ipv6_addr->valuestring) : NULL + ); + + return acs_info_rm_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/acs_info_rm.h b/lib/sbi/openapi/model/acs_info_rm.h new file mode 100644 index 0000000000..1704ae4dfe --- /dev/null +++ b/lib/sbi/openapi/model/acs_info_rm.h @@ -0,0 +1,43 @@ +/* + * acs_info_rm.h + * + * + */ + +#ifndef _OpenAPI_acs_info_rm_H_ +#define _OpenAPI_acs_info_rm_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "acs_info.h" +#include "null_value.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_acs_info_rm_s OpenAPI_acs_info_rm_t; +typedef struct OpenAPI_acs_info_rm_s { + char *acs_url; + char *acs_ipv4_addr; + char *acs_ipv6_addr; +} OpenAPI_acs_info_rm_t; + +OpenAPI_acs_info_rm_t *OpenAPI_acs_info_rm_create( + char *acs_url, + char *acs_ipv4_addr, + char *acs_ipv6_addr + ); +void OpenAPI_acs_info_rm_free(OpenAPI_acs_info_rm_t *acs_info_rm); +OpenAPI_acs_info_rm_t *OpenAPI_acs_info_rm_parseFromJSON(cJSON *acs_info_rmJSON); +cJSON *OpenAPI_acs_info_rm_convertToJSON(OpenAPI_acs_info_rm_t *acs_info_rm); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_acs_info_rm_H_ */ + diff --git a/lib/sbi/openapi/model/additional_snssai_data.c b/lib/sbi/openapi/model/additional_snssai_data.c new file mode 100644 index 0000000000..c901d485a5 --- /dev/null +++ b/lib/sbi/openapi/model/additional_snssai_data.c @@ -0,0 +1,70 @@ + +#include +#include +#include +#include "additional_snssai_data.h" + +OpenAPI_additional_snssai_data_t *OpenAPI_additional_snssai_data_create( + int required_authn_authz + ) +{ + OpenAPI_additional_snssai_data_t *additional_snssai_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_additional_snssai_data_t)); + if (!additional_snssai_data_local_var) { + return NULL; + } + additional_snssai_data_local_var->required_authn_authz = required_authn_authz; + + return additional_snssai_data_local_var; +} + +void OpenAPI_additional_snssai_data_free(OpenAPI_additional_snssai_data_t *additional_snssai_data) +{ + if (NULL == additional_snssai_data) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(additional_snssai_data); +} + +cJSON *OpenAPI_additional_snssai_data_convertToJSON(OpenAPI_additional_snssai_data_t *additional_snssai_data) +{ + cJSON *item = NULL; + + if (additional_snssai_data == NULL) { + ogs_error("OpenAPI_additional_snssai_data_convertToJSON() failed [AdditionalSnssaiData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (additional_snssai_data->required_authn_authz >= 0) { + if (cJSON_AddBoolToObject(item, "requiredAuthnAuthz", additional_snssai_data->required_authn_authz) == NULL) { + ogs_error("OpenAPI_additional_snssai_data_convertToJSON() failed [required_authn_authz]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_additional_snssai_data_t *OpenAPI_additional_snssai_data_parseFromJSON(cJSON *additional_snssai_dataJSON) +{ + OpenAPI_additional_snssai_data_t *additional_snssai_data_local_var = NULL; + cJSON *required_authn_authz = cJSON_GetObjectItemCaseSensitive(additional_snssai_dataJSON, "requiredAuthnAuthz"); + + if (required_authn_authz) { + if (!cJSON_IsBool(required_authn_authz)) { + ogs_error("OpenAPI_additional_snssai_data_parseFromJSON() failed [required_authn_authz]"); + goto end; + } + } + + additional_snssai_data_local_var = OpenAPI_additional_snssai_data_create ( + required_authn_authz ? required_authn_authz->valueint : 0 + ); + + return additional_snssai_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/additional_snssai_data.h b/lib/sbi/openapi/model/additional_snssai_data.h new file mode 100644 index 0000000000..b3af4cf34e --- /dev/null +++ b/lib/sbi/openapi/model/additional_snssai_data.h @@ -0,0 +1,37 @@ +/* + * additional_snssai_data.h + * + * + */ + +#ifndef _OpenAPI_additional_snssai_data_H_ +#define _OpenAPI_additional_snssai_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_additional_snssai_data_s OpenAPI_additional_snssai_data_t; +typedef struct OpenAPI_additional_snssai_data_s { + int required_authn_authz; +} OpenAPI_additional_snssai_data_t; + +OpenAPI_additional_snssai_data_t *OpenAPI_additional_snssai_data_create( + int required_authn_authz + ); +void OpenAPI_additional_snssai_data_free(OpenAPI_additional_snssai_data_t *additional_snssai_data); +OpenAPI_additional_snssai_data_t *OpenAPI_additional_snssai_data_parseFromJSON(cJSON *additional_snssai_dataJSON); +cJSON *OpenAPI_additional_snssai_data_convertToJSON(OpenAPI_additional_snssai_data_t *additional_snssai_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_additional_snssai_data_H_ */ + diff --git a/lib/sbi/openapi/model/af_event.c b/lib/sbi/openapi/model/af_event.c new file mode 100644 index 0000000000..9f6b3bdcdf --- /dev/null +++ b/lib/sbi/openapi/model/af_event.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "af_event.h" + +OpenAPI_af_event_t *OpenAPI_af_event_create( + ) +{ + OpenAPI_af_event_t *af_event_local_var = OpenAPI_malloc(sizeof(OpenAPI_af_event_t)); + if (!af_event_local_var) { + return NULL; + } + + return af_event_local_var; +} + +void OpenAPI_af_event_free(OpenAPI_af_event_t *af_event) +{ + if (NULL == af_event) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(af_event); +} + +cJSON *OpenAPI_af_event_convertToJSON(OpenAPI_af_event_t *af_event) +{ + cJSON *item = NULL; + + if (af_event == NULL) { + ogs_error("OpenAPI_af_event_convertToJSON() failed [AfEvent]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_af_event_t *OpenAPI_af_event_parseFromJSON(cJSON *af_eventJSON) +{ + OpenAPI_af_event_t *af_event_local_var = NULL; + af_event_local_var = OpenAPI_af_event_create ( + ); + + return af_event_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/af_event.h b/lib/sbi/openapi/model/af_event.h new file mode 100644 index 0000000000..25048b9ad5 --- /dev/null +++ b/lib/sbi/openapi/model/af_event.h @@ -0,0 +1,35 @@ +/* + * af_event.h + * + * + */ + +#ifndef _OpenAPI_af_event_H_ +#define _OpenAPI_af_event_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_af_event_s OpenAPI_af_event_t; +typedef struct OpenAPI_af_event_s { +} OpenAPI_af_event_t; + +OpenAPI_af_event_t *OpenAPI_af_event_create( + ); +void OpenAPI_af_event_free(OpenAPI_af_event_t *af_event); +OpenAPI_af_event_t *OpenAPI_af_event_parseFromJSON(cJSON *af_eventJSON); +cJSON *OpenAPI_af_event_convertToJSON(OpenAPI_af_event_t *af_event); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_af_event_H_ */ + diff --git a/lib/sbi/openapi/model/af_event_exposure_data.c b/lib/sbi/openapi/model/af_event_exposure_data.c new file mode 100644 index 0000000000..c7a7cbc703 --- /dev/null +++ b/lib/sbi/openapi/model/af_event_exposure_data.c @@ -0,0 +1,192 @@ + +#include +#include +#include +#include "af_event_exposure_data.h" + +OpenAPI_af_event_exposure_data_t *OpenAPI_af_event_exposure_data_create( + OpenAPI_list_t *af_events, + OpenAPI_list_t *af_ids, + OpenAPI_list_t *app_ids + ) +{ + OpenAPI_af_event_exposure_data_t *af_event_exposure_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_af_event_exposure_data_t)); + if (!af_event_exposure_data_local_var) { + return NULL; + } + af_event_exposure_data_local_var->af_events = af_events; + af_event_exposure_data_local_var->af_ids = af_ids; + af_event_exposure_data_local_var->app_ids = app_ids; + + return af_event_exposure_data_local_var; +} + +void OpenAPI_af_event_exposure_data_free(OpenAPI_af_event_exposure_data_t *af_event_exposure_data) +{ + if (NULL == af_event_exposure_data) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(af_event_exposure_data->af_events, node) { + OpenAPI_af_event_free(node->data); + } + OpenAPI_list_free(af_event_exposure_data->af_events); + OpenAPI_list_for_each(af_event_exposure_data->af_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(af_event_exposure_data->af_ids); + OpenAPI_list_for_each(af_event_exposure_data->app_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(af_event_exposure_data->app_ids); + ogs_free(af_event_exposure_data); +} + +cJSON *OpenAPI_af_event_exposure_data_convertToJSON(OpenAPI_af_event_exposure_data_t *af_event_exposure_data) +{ + cJSON *item = NULL; + + if (af_event_exposure_data == NULL) { + ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [AfEventExposureData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!af_event_exposure_data->af_events) { + ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [af_events]"); + goto end; + } + cJSON *af_eventsList = cJSON_AddArrayToObject(item, "afEvents"); + if (af_eventsList == NULL) { + ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [af_events]"); + goto end; + } + + OpenAPI_lnode_t *af_events_node; + if (af_event_exposure_data->af_events) { + OpenAPI_list_for_each(af_event_exposure_data->af_events, af_events_node) { + cJSON *itemLocal = OpenAPI_af_event_convertToJSON(af_events_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [af_events]"); + goto end; + } + cJSON_AddItemToArray(af_eventsList, itemLocal); + } + } + + if (af_event_exposure_data->af_ids) { + cJSON *af_ids = cJSON_AddArrayToObject(item, "afIds"); + if (af_ids == NULL) { + ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [af_ids]"); + goto end; + } + + OpenAPI_lnode_t *af_ids_node; + OpenAPI_list_for_each(af_event_exposure_data->af_ids, af_ids_node) { + if (cJSON_AddStringToObject(af_ids, "", (char*)af_ids_node->data) == NULL) { + ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [af_ids]"); + goto end; + } + } + } + + if (af_event_exposure_data->app_ids) { + cJSON *app_ids = cJSON_AddArrayToObject(item, "appIds"); + if (app_ids == NULL) { + ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [app_ids]"); + goto end; + } + + OpenAPI_lnode_t *app_ids_node; + OpenAPI_list_for_each(af_event_exposure_data->app_ids, app_ids_node) { + if (cJSON_AddStringToObject(app_ids, "", (char*)app_ids_node->data) == NULL) { + ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [app_ids]"); + goto end; + } + } + } + +end: + return item; +} + +OpenAPI_af_event_exposure_data_t *OpenAPI_af_event_exposure_data_parseFromJSON(cJSON *af_event_exposure_dataJSON) +{ + OpenAPI_af_event_exposure_data_t *af_event_exposure_data_local_var = NULL; + cJSON *af_events = cJSON_GetObjectItemCaseSensitive(af_event_exposure_dataJSON, "afEvents"); + if (!af_events) { + ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [af_events]"); + goto end; + } + + OpenAPI_list_t *af_eventsList; + + cJSON *af_events_local_nonprimitive; + if (!cJSON_IsArray(af_events)) { + ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [af_events]"); + goto end; + } + + af_eventsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(af_events_local_nonprimitive, af_events ) { + if (!cJSON_IsObject(af_events_local_nonprimitive)) { + ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [af_events]"); + goto end; + } + OpenAPI_af_event_t *af_eventsItem = OpenAPI_af_event_parseFromJSON(af_events_local_nonprimitive); + + OpenAPI_list_add(af_eventsList, af_eventsItem); + } + + cJSON *af_ids = cJSON_GetObjectItemCaseSensitive(af_event_exposure_dataJSON, "afIds"); + + OpenAPI_list_t *af_idsList; + if (af_ids) { + cJSON *af_ids_local; + if (!cJSON_IsArray(af_ids)) { + ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [af_ids]"); + goto end; + } + af_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(af_ids_local, af_ids) { + if (!cJSON_IsString(af_ids_local)) { + ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [af_ids]"); + goto end; + } + OpenAPI_list_add(af_idsList, ogs_strdup(af_ids_local->valuestring)); + } + } + + cJSON *app_ids = cJSON_GetObjectItemCaseSensitive(af_event_exposure_dataJSON, "appIds"); + + OpenAPI_list_t *app_idsList; + if (app_ids) { + cJSON *app_ids_local; + if (!cJSON_IsArray(app_ids)) { + ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [app_ids]"); + goto end; + } + app_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(app_ids_local, app_ids) { + if (!cJSON_IsString(app_ids_local)) { + ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [app_ids]"); + goto end; + } + OpenAPI_list_add(app_idsList, ogs_strdup(app_ids_local->valuestring)); + } + } + + af_event_exposure_data_local_var = OpenAPI_af_event_exposure_data_create ( + af_eventsList, + af_ids ? af_idsList : NULL, + app_ids ? app_idsList : NULL + ); + + return af_event_exposure_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/af_event_exposure_data.h b/lib/sbi/openapi/model/af_event_exposure_data.h new file mode 100644 index 0000000000..844957655e --- /dev/null +++ b/lib/sbi/openapi/model/af_event_exposure_data.h @@ -0,0 +1,42 @@ +/* + * af_event_exposure_data.h + * + * AF Event Exposure data managed by a given NEF Instance + */ + +#ifndef _OpenAPI_af_event_exposure_data_H_ +#define _OpenAPI_af_event_exposure_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "af_event.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_af_event_exposure_data_s OpenAPI_af_event_exposure_data_t; +typedef struct OpenAPI_af_event_exposure_data_s { + OpenAPI_list_t *af_events; + OpenAPI_list_t *af_ids; + OpenAPI_list_t *app_ids; +} OpenAPI_af_event_exposure_data_t; + +OpenAPI_af_event_exposure_data_t *OpenAPI_af_event_exposure_data_create( + OpenAPI_list_t *af_events, + OpenAPI_list_t *af_ids, + OpenAPI_list_t *app_ids + ); +void OpenAPI_af_event_exposure_data_free(OpenAPI_af_event_exposure_data_t *af_event_exposure_data); +OpenAPI_af_event_exposure_data_t *OpenAPI_af_event_exposure_data_parseFromJSON(cJSON *af_event_exposure_dataJSON); +cJSON *OpenAPI_af_event_exposure_data_convertToJSON(OpenAPI_af_event_exposure_data_t *af_event_exposure_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_af_event_exposure_data_H_ */ + diff --git a/lib/sbi/openapi/model/af_external.c b/lib/sbi/openapi/model/af_external.c new file mode 100644 index 0000000000..14f2a32c70 --- /dev/null +++ b/lib/sbi/openapi/model/af_external.c @@ -0,0 +1,166 @@ + +#include +#include +#include +#include "af_external.h" + +OpenAPI_af_external_t *OpenAPI_af_external_create( + char *af_id, + OpenAPI_list_t *allowed_geographic_area, + OpenAPI_privacy_check_related_action_e privacy_check_related_action, + OpenAPI_valid_time_period_t *valid_time_period + ) +{ + OpenAPI_af_external_t *af_external_local_var = OpenAPI_malloc(sizeof(OpenAPI_af_external_t)); + if (!af_external_local_var) { + return NULL; + } + af_external_local_var->af_id = af_id; + af_external_local_var->allowed_geographic_area = allowed_geographic_area; + af_external_local_var->privacy_check_related_action = privacy_check_related_action; + af_external_local_var->valid_time_period = valid_time_period; + + return af_external_local_var; +} + +void OpenAPI_af_external_free(OpenAPI_af_external_t *af_external) +{ + if (NULL == af_external) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(af_external->af_id); + OpenAPI_list_for_each(af_external->allowed_geographic_area, node) { + OpenAPI_geographic_area_free(node->data); + } + OpenAPI_list_free(af_external->allowed_geographic_area); + OpenAPI_valid_time_period_free(af_external->valid_time_period); + ogs_free(af_external); +} + +cJSON *OpenAPI_af_external_convertToJSON(OpenAPI_af_external_t *af_external) +{ + cJSON *item = NULL; + + if (af_external == NULL) { + ogs_error("OpenAPI_af_external_convertToJSON() failed [AfExternal]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (af_external->af_id) { + if (cJSON_AddStringToObject(item, "afId", af_external->af_id) == NULL) { + ogs_error("OpenAPI_af_external_convertToJSON() failed [af_id]"); + goto end; + } + } + + if (af_external->allowed_geographic_area) { + cJSON *allowed_geographic_areaList = cJSON_AddArrayToObject(item, "allowedGeographicArea"); + if (allowed_geographic_areaList == NULL) { + ogs_error("OpenAPI_af_external_convertToJSON() failed [allowed_geographic_area]"); + goto end; + } + + OpenAPI_lnode_t *allowed_geographic_area_node; + if (af_external->allowed_geographic_area) { + OpenAPI_list_for_each(af_external->allowed_geographic_area, allowed_geographic_area_node) { + cJSON *itemLocal = OpenAPI_geographic_area_convertToJSON(allowed_geographic_area_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_af_external_convertToJSON() failed [allowed_geographic_area]"); + goto end; + } + cJSON_AddItemToArray(allowed_geographic_areaList, itemLocal); + } + } + } + + if (af_external->privacy_check_related_action) { + if (cJSON_AddStringToObject(item, "privacyCheckRelatedAction", OpenAPI_privacy_check_related_action_ToString(af_external->privacy_check_related_action)) == NULL) { + ogs_error("OpenAPI_af_external_convertToJSON() failed [privacy_check_related_action]"); + goto end; + } + } + + if (af_external->valid_time_period) { + cJSON *valid_time_period_local_JSON = OpenAPI_valid_time_period_convertToJSON(af_external->valid_time_period); + if (valid_time_period_local_JSON == NULL) { + ogs_error("OpenAPI_af_external_convertToJSON() failed [valid_time_period]"); + goto end; + } + cJSON_AddItemToObject(item, "validTimePeriod", valid_time_period_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_af_external_convertToJSON() failed [valid_time_period]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_af_external_t *OpenAPI_af_external_parseFromJSON(cJSON *af_externalJSON) +{ + OpenAPI_af_external_t *af_external_local_var = NULL; + cJSON *af_id = cJSON_GetObjectItemCaseSensitive(af_externalJSON, "afId"); + + if (af_id) { + if (!cJSON_IsString(af_id)) { + ogs_error("OpenAPI_af_external_parseFromJSON() failed [af_id]"); + goto end; + } + } + + cJSON *allowed_geographic_area = cJSON_GetObjectItemCaseSensitive(af_externalJSON, "allowedGeographicArea"); + + OpenAPI_list_t *allowed_geographic_areaList; + if (allowed_geographic_area) { + cJSON *allowed_geographic_area_local_nonprimitive; + if (!cJSON_IsArray(allowed_geographic_area)) { + ogs_error("OpenAPI_af_external_parseFromJSON() failed [allowed_geographic_area]"); + goto end; + } + + allowed_geographic_areaList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_geographic_area_local_nonprimitive, allowed_geographic_area ) { + if (!cJSON_IsObject(allowed_geographic_area_local_nonprimitive)) { + ogs_error("OpenAPI_af_external_parseFromJSON() failed [allowed_geographic_area]"); + goto end; + } + OpenAPI_geographic_area_t *allowed_geographic_areaItem = OpenAPI_geographic_area_parseFromJSON(allowed_geographic_area_local_nonprimitive); + + OpenAPI_list_add(allowed_geographic_areaList, allowed_geographic_areaItem); + } + } + + cJSON *privacy_check_related_action = cJSON_GetObjectItemCaseSensitive(af_externalJSON, "privacyCheckRelatedAction"); + + OpenAPI_privacy_check_related_action_e privacy_check_related_actionVariable; + if (privacy_check_related_action) { + if (!cJSON_IsString(privacy_check_related_action)) { + ogs_error("OpenAPI_af_external_parseFromJSON() failed [privacy_check_related_action]"); + goto end; + } + privacy_check_related_actionVariable = OpenAPI_privacy_check_related_action_FromString(privacy_check_related_action->valuestring); + } + + cJSON *valid_time_period = cJSON_GetObjectItemCaseSensitive(af_externalJSON, "validTimePeriod"); + + OpenAPI_valid_time_period_t *valid_time_period_local_nonprim = NULL; + if (valid_time_period) { + valid_time_period_local_nonprim = OpenAPI_valid_time_period_parseFromJSON(valid_time_period); + } + + af_external_local_var = OpenAPI_af_external_create ( + af_id ? ogs_strdup(af_id->valuestring) : NULL, + allowed_geographic_area ? allowed_geographic_areaList : NULL, + privacy_check_related_action ? privacy_check_related_actionVariable : 0, + valid_time_period ? valid_time_period_local_nonprim : NULL + ); + + return af_external_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/af_external.h b/lib/sbi/openapi/model/af_external.h new file mode 100644 index 0000000000..8a95369b12 --- /dev/null +++ b/lib/sbi/openapi/model/af_external.h @@ -0,0 +1,46 @@ +/* + * af_external.h + * + * + */ + +#ifndef _OpenAPI_af_external_H_ +#define _OpenAPI_af_external_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.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_external_s OpenAPI_af_external_t; +typedef struct OpenAPI_af_external_s { + char *af_id; + OpenAPI_list_t *allowed_geographic_area; + OpenAPI_privacy_check_related_action_e privacy_check_related_action; + struct OpenAPI_valid_time_period_s *valid_time_period; +} OpenAPI_af_external_t; + +OpenAPI_af_external_t *OpenAPI_af_external_create( + char *af_id, + OpenAPI_list_t *allowed_geographic_area, + OpenAPI_privacy_check_related_action_e privacy_check_related_action, + OpenAPI_valid_time_period_t *valid_time_period + ); +void OpenAPI_af_external_free(OpenAPI_af_external_t *af_external); +OpenAPI_af_external_t *OpenAPI_af_external_parseFromJSON(cJSON *af_externalJSON); +cJSON *OpenAPI_af_external_convertToJSON(OpenAPI_af_external_t *af_external); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_af_external_H_ */ + diff --git a/lib/sbi/openapi/model/af_non_external.c b/lib/sbi/openapi/model/af_non_external.c new file mode 100644 index 0000000000..ccd050d0bf --- /dev/null +++ b/lib/sbi/openapi/model/af_non_external.c @@ -0,0 +1,192 @@ + +#include +#include +#include +#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; +} + diff --git a/lib/sbi/openapi/model/af_non_external.h b/lib/sbi/openapi/model/af_non_external.h new file mode 100644 index 0000000000..fc53f1414f --- /dev/null +++ b/lib/sbi/openapi/model/af_non_external.h @@ -0,0 +1,49 @@ +/* + * af_non_external.h + * + * + */ + +#ifndef _OpenAPI_af_non_external_H_ +#define _OpenAPI_af_non_external_H_ + +#include +#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); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_af_non_external_H_ */ + diff --git a/lib/sbi/openapi/model/am_policy_data.c b/lib/sbi/openapi/model/am_policy_data.c new file mode 100644 index 0000000000..0e3031963d --- /dev/null +++ b/lib/sbi/openapi/model/am_policy_data.c @@ -0,0 +1,147 @@ + +#include +#include +#include +#include "am_policy_data.h" + +OpenAPI_am_policy_data_t *OpenAPI_am_policy_data_create( + OpenAPI_list_t* pra_infos, + OpenAPI_list_t *subsc_cats + ) +{ + OpenAPI_am_policy_data_t *am_policy_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_am_policy_data_t)); + if (!am_policy_data_local_var) { + return NULL; + } + am_policy_data_local_var->pra_infos = pra_infos; + am_policy_data_local_var->subsc_cats = subsc_cats; + + return am_policy_data_local_var; +} + +void OpenAPI_am_policy_data_free(OpenAPI_am_policy_data_t *am_policy_data) +{ + if (NULL == am_policy_data) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(am_policy_data->pra_infos, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_presence_info_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(am_policy_data->pra_infos); + OpenAPI_list_for_each(am_policy_data->subsc_cats, node) { + ogs_free(node->data); + } + OpenAPI_list_free(am_policy_data->subsc_cats); + ogs_free(am_policy_data); +} + +cJSON *OpenAPI_am_policy_data_convertToJSON(OpenAPI_am_policy_data_t *am_policy_data) +{ + cJSON *item = NULL; + + if (am_policy_data == NULL) { + ogs_error("OpenAPI_am_policy_data_convertToJSON() failed [AmPolicyData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (am_policy_data->pra_infos) { + cJSON *pra_infos = cJSON_AddObjectToObject(item, "praInfos"); + if (pra_infos == NULL) { + ogs_error("OpenAPI_am_policy_data_convertToJSON() failed [pra_infos]"); + goto end; + } + cJSON *localMapObject = pra_infos; + OpenAPI_lnode_t *pra_infos_node; + if (am_policy_data->pra_infos) { + OpenAPI_list_for_each(am_policy_data->pra_infos, pra_infos_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)pra_infos_node->data; + cJSON *itemLocal = OpenAPI_presence_info_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_am_policy_data_convertToJSON() failed [pra_infos]"); + goto end; + } + cJSON_AddItemToObject(pra_infos, localKeyValue->key, itemLocal); + } + } + } + + if (am_policy_data->subsc_cats) { + cJSON *subsc_cats = cJSON_AddArrayToObject(item, "subscCats"); + if (subsc_cats == NULL) { + ogs_error("OpenAPI_am_policy_data_convertToJSON() failed [subsc_cats]"); + goto end; + } + + OpenAPI_lnode_t *subsc_cats_node; + OpenAPI_list_for_each(am_policy_data->subsc_cats, subsc_cats_node) { + if (cJSON_AddStringToObject(subsc_cats, "", (char*)subsc_cats_node->data) == NULL) { + ogs_error("OpenAPI_am_policy_data_convertToJSON() failed [subsc_cats]"); + goto end; + } + } + } + +end: + return item; +} + +OpenAPI_am_policy_data_t *OpenAPI_am_policy_data_parseFromJSON(cJSON *am_policy_dataJSON) +{ + OpenAPI_am_policy_data_t *am_policy_data_local_var = NULL; + cJSON *pra_infos = cJSON_GetObjectItemCaseSensitive(am_policy_dataJSON, "praInfos"); + + OpenAPI_list_t *pra_infosList; + if (pra_infos) { + cJSON *pra_infos_local_map; + if (!cJSON_IsObject(pra_infos)) { + ogs_error("OpenAPI_am_policy_data_parseFromJSON() failed [pra_infos]"); + goto end; + } + pra_infosList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(pra_infos_local_map, pra_infos) { + cJSON *localMapObject = pra_infos_local_map; + if (!cJSON_IsObject(pra_infos_local_map)) { + ogs_error("OpenAPI_am_policy_data_parseFromJSON() failed [pra_infos]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_presence_info_parseFromJSON(localMapObject)); + OpenAPI_list_add(pra_infosList, localMapKeyPair); + } + } + + cJSON *subsc_cats = cJSON_GetObjectItemCaseSensitive(am_policy_dataJSON, "subscCats"); + + OpenAPI_list_t *subsc_catsList; + if (subsc_cats) { + cJSON *subsc_cats_local; + if (!cJSON_IsArray(subsc_cats)) { + ogs_error("OpenAPI_am_policy_data_parseFromJSON() failed [subsc_cats]"); + goto end; + } + subsc_catsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(subsc_cats_local, subsc_cats) { + if (!cJSON_IsString(subsc_cats_local)) { + ogs_error("OpenAPI_am_policy_data_parseFromJSON() failed [subsc_cats]"); + goto end; + } + OpenAPI_list_add(subsc_catsList, ogs_strdup(subsc_cats_local->valuestring)); + } + } + + am_policy_data_local_var = OpenAPI_am_policy_data_create ( + pra_infos ? pra_infosList : NULL, + subsc_cats ? subsc_catsList : NULL + ); + + return am_policy_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/am_policy_data.h b/lib/sbi/openapi/model/am_policy_data.h new file mode 100644 index 0000000000..dc508be649 --- /dev/null +++ b/lib/sbi/openapi/model/am_policy_data.h @@ -0,0 +1,40 @@ +/* + * am_policy_data.h + * + * Contains the AM policy data for a given subscriber. + */ + +#ifndef _OpenAPI_am_policy_data_H_ +#define _OpenAPI_am_policy_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "presence_info.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_am_policy_data_s OpenAPI_am_policy_data_t; +typedef struct OpenAPI_am_policy_data_s { + OpenAPI_list_t* pra_infos; + OpenAPI_list_t *subsc_cats; +} OpenAPI_am_policy_data_t; + +OpenAPI_am_policy_data_t *OpenAPI_am_policy_data_create( + OpenAPI_list_t* pra_infos, + OpenAPI_list_t *subsc_cats + ); +void OpenAPI_am_policy_data_free(OpenAPI_am_policy_data_t *am_policy_data); +OpenAPI_am_policy_data_t *OpenAPI_am_policy_data_parseFromJSON(cJSON *am_policy_dataJSON); +cJSON *OpenAPI_am_policy_data_convertToJSON(OpenAPI_am_policy_data_t *am_policy_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_am_policy_data_H_ */ + diff --git a/lib/sbi/openapi/model/ambr.c b/lib/sbi/openapi/model/ambr.c new file mode 100644 index 0000000000..e215d1d2af --- /dev/null +++ b/lib/sbi/openapi/model/ambr.c @@ -0,0 +1,101 @@ + +#include +#include +#include +#include "ambr.h" + +OpenAPI_ambr_t *OpenAPI_ambr_create( + char *uplink, + char *downlink + ) +{ + OpenAPI_ambr_t *ambr_local_var = OpenAPI_malloc(sizeof(OpenAPI_ambr_t)); + if (!ambr_local_var) { + return NULL; + } + ambr_local_var->uplink = uplink; + ambr_local_var->downlink = downlink; + + return ambr_local_var; +} + +void OpenAPI_ambr_free(OpenAPI_ambr_t *ambr) +{ + if (NULL == ambr) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(ambr->uplink); + ogs_free(ambr->downlink); + ogs_free(ambr); +} + +cJSON *OpenAPI_ambr_convertToJSON(OpenAPI_ambr_t *ambr) +{ + cJSON *item = NULL; + + if (ambr == NULL) { + ogs_error("OpenAPI_ambr_convertToJSON() failed [Ambr]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!ambr->uplink) { + ogs_error("OpenAPI_ambr_convertToJSON() failed [uplink]"); + goto end; + } + if (cJSON_AddStringToObject(item, "uplink", ambr->uplink) == NULL) { + ogs_error("OpenAPI_ambr_convertToJSON() failed [uplink]"); + goto end; + } + + if (!ambr->downlink) { + ogs_error("OpenAPI_ambr_convertToJSON() failed [downlink]"); + goto end; + } + if (cJSON_AddStringToObject(item, "downlink", ambr->downlink) == NULL) { + ogs_error("OpenAPI_ambr_convertToJSON() failed [downlink]"); + goto end; + } + +end: + return item; +} + +OpenAPI_ambr_t *OpenAPI_ambr_parseFromJSON(cJSON *ambrJSON) +{ + OpenAPI_ambr_t *ambr_local_var = NULL; + cJSON *uplink = cJSON_GetObjectItemCaseSensitive(ambrJSON, "uplink"); + if (!uplink) { + ogs_error("OpenAPI_ambr_parseFromJSON() failed [uplink]"); + goto end; + } + + + if (!cJSON_IsString(uplink)) { + ogs_error("OpenAPI_ambr_parseFromJSON() failed [uplink]"); + goto end; + } + + cJSON *downlink = cJSON_GetObjectItemCaseSensitive(ambrJSON, "downlink"); + if (!downlink) { + ogs_error("OpenAPI_ambr_parseFromJSON() failed [downlink]"); + goto end; + } + + + if (!cJSON_IsString(downlink)) { + ogs_error("OpenAPI_ambr_parseFromJSON() failed [downlink]"); + goto end; + } + + ambr_local_var = OpenAPI_ambr_create ( + ogs_strdup(uplink->valuestring), + ogs_strdup(downlink->valuestring) + ); + + return ambr_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/ambr.h b/lib/sbi/openapi/model/ambr.h new file mode 100644 index 0000000000..cbc051d094 --- /dev/null +++ b/lib/sbi/openapi/model/ambr.h @@ -0,0 +1,39 @@ +/* + * ambr.h + * + * + */ + +#ifndef _OpenAPI_ambr_H_ +#define _OpenAPI_ambr_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_ambr_s OpenAPI_ambr_t; +typedef struct OpenAPI_ambr_s { + char *uplink; + char *downlink; +} OpenAPI_ambr_t; + +OpenAPI_ambr_t *OpenAPI_ambr_create( + char *uplink, + char *downlink + ); +void OpenAPI_ambr_free(OpenAPI_ambr_t *ambr); +OpenAPI_ambr_t *OpenAPI_ambr_parseFromJSON(cJSON *ambrJSON); +cJSON *OpenAPI_ambr_convertToJSON(OpenAPI_ambr_t *ambr); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_ambr_H_ */ + diff --git a/lib/sbi/openapi/model/ambr_rm.c b/lib/sbi/openapi/model/ambr_rm.c new file mode 100644 index 0000000000..9fbaf7f0be --- /dev/null +++ b/lib/sbi/openapi/model/ambr_rm.c @@ -0,0 +1,101 @@ + +#include +#include +#include +#include "ambr_rm.h" + +OpenAPI_ambr_rm_t *OpenAPI_ambr_rm_create( + char *uplink, + char *downlink + ) +{ + OpenAPI_ambr_rm_t *ambr_rm_local_var = OpenAPI_malloc(sizeof(OpenAPI_ambr_rm_t)); + if (!ambr_rm_local_var) { + return NULL; + } + ambr_rm_local_var->uplink = uplink; + ambr_rm_local_var->downlink = downlink; + + return ambr_rm_local_var; +} + +void OpenAPI_ambr_rm_free(OpenAPI_ambr_rm_t *ambr_rm) +{ + if (NULL == ambr_rm) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(ambr_rm->uplink); + ogs_free(ambr_rm->downlink); + ogs_free(ambr_rm); +} + +cJSON *OpenAPI_ambr_rm_convertToJSON(OpenAPI_ambr_rm_t *ambr_rm) +{ + cJSON *item = NULL; + + if (ambr_rm == NULL) { + ogs_error("OpenAPI_ambr_rm_convertToJSON() failed [AmbrRm]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!ambr_rm->uplink) { + ogs_error("OpenAPI_ambr_rm_convertToJSON() failed [uplink]"); + goto end; + } + if (cJSON_AddStringToObject(item, "uplink", ambr_rm->uplink) == NULL) { + ogs_error("OpenAPI_ambr_rm_convertToJSON() failed [uplink]"); + goto end; + } + + if (!ambr_rm->downlink) { + ogs_error("OpenAPI_ambr_rm_convertToJSON() failed [downlink]"); + goto end; + } + if (cJSON_AddStringToObject(item, "downlink", ambr_rm->downlink) == NULL) { + ogs_error("OpenAPI_ambr_rm_convertToJSON() failed [downlink]"); + goto end; + } + +end: + return item; +} + +OpenAPI_ambr_rm_t *OpenAPI_ambr_rm_parseFromJSON(cJSON *ambr_rmJSON) +{ + OpenAPI_ambr_rm_t *ambr_rm_local_var = NULL; + cJSON *uplink = cJSON_GetObjectItemCaseSensitive(ambr_rmJSON, "uplink"); + if (!uplink) { + ogs_error("OpenAPI_ambr_rm_parseFromJSON() failed [uplink]"); + goto end; + } + + + if (!cJSON_IsString(uplink)) { + ogs_error("OpenAPI_ambr_rm_parseFromJSON() failed [uplink]"); + goto end; + } + + cJSON *downlink = cJSON_GetObjectItemCaseSensitive(ambr_rmJSON, "downlink"); + if (!downlink) { + ogs_error("OpenAPI_ambr_rm_parseFromJSON() failed [downlink]"); + goto end; + } + + + if (!cJSON_IsString(downlink)) { + ogs_error("OpenAPI_ambr_rm_parseFromJSON() failed [downlink]"); + goto end; + } + + ambr_rm_local_var = OpenAPI_ambr_rm_create ( + ogs_strdup(uplink->valuestring), + ogs_strdup(downlink->valuestring) + ); + + return ambr_rm_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/ambr_rm.h b/lib/sbi/openapi/model/ambr_rm.h new file mode 100644 index 0000000000..a376aff8a9 --- /dev/null +++ b/lib/sbi/openapi/model/ambr_rm.h @@ -0,0 +1,39 @@ +/* + * ambr_rm.h + * + * + */ + +#ifndef _OpenAPI_ambr_rm_H_ +#define _OpenAPI_ambr_rm_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_ambr_rm_s OpenAPI_ambr_rm_t; +typedef struct OpenAPI_ambr_rm_s { + char *uplink; + char *downlink; +} OpenAPI_ambr_rm_t; + +OpenAPI_ambr_rm_t *OpenAPI_ambr_rm_create( + char *uplink, + char *downlink + ); +void OpenAPI_ambr_rm_free(OpenAPI_ambr_rm_t *ambr_rm); +OpenAPI_ambr_rm_t *OpenAPI_ambr_rm_parseFromJSON(cJSON *ambr_rmJSON); +cJSON *OpenAPI_ambr_rm_convertToJSON(OpenAPI_ambr_rm_t *ambr_rm); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_ambr_rm_H_ */ + diff --git a/lib/sbi/openapi/model/amf3_gpp_access_registration.c b/lib/sbi/openapi/model/amf3_gpp_access_registration.c new file mode 100644 index 0000000000..2dbc842ce3 --- /dev/null +++ b/lib/sbi/openapi/model/amf3_gpp_access_registration.c @@ -0,0 +1,548 @@ + +#include +#include +#include +#include "amf3_gpp_access_registration.h" + +OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_create( + char *amf_instance_id, + char *supported_features, + int purge_flag, + char *pei, + OpenAPI_ims_vo_ps_t *ims_vo_ps, + char *dereg_callback_uri, + char *amf_service_name_dereg, + char *pcscf_restoration_callback_uri, + char *amf_service_name_pcscf_rest, + int initial_registration_ind, + OpenAPI_guami_t *guami, + OpenAPI_list_t *backup_amf_info, + int dr_flag, + OpenAPI_rat_type_t *rat_type, + int urrp_indicator, + char *amf_ee_subscription_id, + int ue_srvcc_capability, + char *nid, + char *registration_time, + char *vgmlc_address_ipv4, + char *vgmlc_address_ipv6, + char *vgmlc_fqdn + ) +{ + OpenAPI_amf3_gpp_access_registration_t *amf3_gpp_access_registration_local_var = OpenAPI_malloc(sizeof(OpenAPI_amf3_gpp_access_registration_t)); + if (!amf3_gpp_access_registration_local_var) { + return NULL; + } + amf3_gpp_access_registration_local_var->amf_instance_id = amf_instance_id; + amf3_gpp_access_registration_local_var->supported_features = supported_features; + amf3_gpp_access_registration_local_var->purge_flag = purge_flag; + amf3_gpp_access_registration_local_var->pei = pei; + amf3_gpp_access_registration_local_var->ims_vo_ps = ims_vo_ps; + amf3_gpp_access_registration_local_var->dereg_callback_uri = dereg_callback_uri; + amf3_gpp_access_registration_local_var->amf_service_name_dereg = amf_service_name_dereg; + amf3_gpp_access_registration_local_var->pcscf_restoration_callback_uri = pcscf_restoration_callback_uri; + amf3_gpp_access_registration_local_var->amf_service_name_pcscf_rest = amf_service_name_pcscf_rest; + amf3_gpp_access_registration_local_var->initial_registration_ind = initial_registration_ind; + amf3_gpp_access_registration_local_var->guami = guami; + amf3_gpp_access_registration_local_var->backup_amf_info = backup_amf_info; + amf3_gpp_access_registration_local_var->dr_flag = dr_flag; + 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->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; + + return amf3_gpp_access_registration_local_var; +} + +void OpenAPI_amf3_gpp_access_registration_free(OpenAPI_amf3_gpp_access_registration_t *amf3_gpp_access_registration) +{ + if (NULL == amf3_gpp_access_registration) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(amf3_gpp_access_registration->amf_instance_id); + ogs_free(amf3_gpp_access_registration->supported_features); + ogs_free(amf3_gpp_access_registration->pei); + OpenAPI_ims_vo_ps_free(amf3_gpp_access_registration->ims_vo_ps); + ogs_free(amf3_gpp_access_registration->dereg_callback_uri); + ogs_free(amf3_gpp_access_registration->amf_service_name_dereg); + ogs_free(amf3_gpp_access_registration->pcscf_restoration_callback_uri); + ogs_free(amf3_gpp_access_registration->amf_service_name_pcscf_rest); + OpenAPI_guami_free(amf3_gpp_access_registration->guami); + OpenAPI_list_for_each(amf3_gpp_access_registration->backup_amf_info, node) { + OpenAPI_backup_amf_info_free(node->data); + } + OpenAPI_list_free(amf3_gpp_access_registration->backup_amf_info); + OpenAPI_rat_type_free(amf3_gpp_access_registration->rat_type); + ogs_free(amf3_gpp_access_registration->amf_ee_subscription_id); + ogs_free(amf3_gpp_access_registration->nid); + 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); + ogs_free(amf3_gpp_access_registration); +} + +cJSON *OpenAPI_amf3_gpp_access_registration_convertToJSON(OpenAPI_amf3_gpp_access_registration_t *amf3_gpp_access_registration) +{ + cJSON *item = NULL; + + if (amf3_gpp_access_registration == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [Amf3GppAccessRegistration]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!amf3_gpp_access_registration->amf_instance_id) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [amf_instance_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "amfInstanceId", amf3_gpp_access_registration->amf_instance_id) == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [amf_instance_id]"); + goto end; + } + + if (amf3_gpp_access_registration->supported_features) { + if (cJSON_AddStringToObject(item, "supportedFeatures", amf3_gpp_access_registration->supported_features) == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [supported_features]"); + goto end; + } + } + + if (amf3_gpp_access_registration->purge_flag >= 0) { + if (cJSON_AddBoolToObject(item, "purgeFlag", amf3_gpp_access_registration->purge_flag) == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [purge_flag]"); + goto end; + } + } + + if (amf3_gpp_access_registration->pei) { + if (cJSON_AddStringToObject(item, "pei", amf3_gpp_access_registration->pei) == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [pei]"); + goto end; + } + } + + if (amf3_gpp_access_registration->ims_vo_ps) { + cJSON *ims_vo_ps_local_JSON = OpenAPI_ims_vo_ps_convertToJSON(amf3_gpp_access_registration->ims_vo_ps); + if (ims_vo_ps_local_JSON == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [ims_vo_ps]"); + goto end; + } + cJSON_AddItemToObject(item, "imsVoPs", ims_vo_ps_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [ims_vo_ps]"); + goto end; + } + } + + if (!amf3_gpp_access_registration->dereg_callback_uri) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [dereg_callback_uri]"); + goto end; + } + if (cJSON_AddStringToObject(item, "deregCallbackUri", amf3_gpp_access_registration->dereg_callback_uri) == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [dereg_callback_uri]"); + goto end; + } + + if (amf3_gpp_access_registration->amf_service_name_dereg) { + if (cJSON_AddStringToObject(item, "amfServiceNameDereg", amf3_gpp_access_registration->amf_service_name_dereg) == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [amf_service_name_dereg]"); + goto end; + } + } + + if (amf3_gpp_access_registration->pcscf_restoration_callback_uri) { + if (cJSON_AddStringToObject(item, "pcscfRestorationCallbackUri", amf3_gpp_access_registration->pcscf_restoration_callback_uri) == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [pcscf_restoration_callback_uri]"); + goto end; + } + } + + if (amf3_gpp_access_registration->amf_service_name_pcscf_rest) { + if (cJSON_AddStringToObject(item, "amfServiceNamePcscfRest", amf3_gpp_access_registration->amf_service_name_pcscf_rest) == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [amf_service_name_pcscf_rest]"); + goto end; + } + } + + if (amf3_gpp_access_registration->initial_registration_ind >= 0) { + if (cJSON_AddBoolToObject(item, "initialRegistrationInd", amf3_gpp_access_registration->initial_registration_ind) == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [initial_registration_ind]"); + goto end; + } + } + + if (!amf3_gpp_access_registration->guami) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [guami]"); + goto end; + } + cJSON *guami_local_JSON = OpenAPI_guami_convertToJSON(amf3_gpp_access_registration->guami); + if (guami_local_JSON == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [guami]"); + goto end; + } + cJSON_AddItemToObject(item, "guami", guami_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [guami]"); + goto end; + } + + if (amf3_gpp_access_registration->backup_amf_info) { + cJSON *backup_amf_infoList = cJSON_AddArrayToObject(item, "backupAmfInfo"); + if (backup_amf_infoList == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [backup_amf_info]"); + goto end; + } + + OpenAPI_lnode_t *backup_amf_info_node; + if (amf3_gpp_access_registration->backup_amf_info) { + OpenAPI_list_for_each(amf3_gpp_access_registration->backup_amf_info, backup_amf_info_node) { + cJSON *itemLocal = OpenAPI_backup_amf_info_convertToJSON(backup_amf_info_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [backup_amf_info]"); + goto end; + } + cJSON_AddItemToArray(backup_amf_infoList, itemLocal); + } + } + } + + if (amf3_gpp_access_registration->dr_flag >= 0) { + if (cJSON_AddBoolToObject(item, "drFlag", amf3_gpp_access_registration->dr_flag) == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [dr_flag]"); + goto end; + } + } + + if (!amf3_gpp_access_registration->rat_type) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [rat_type]"); + goto end; + } + cJSON *rat_type_local_JSON = OpenAPI_rat_type_convertToJSON(amf3_gpp_access_registration->rat_type); + if (rat_type_local_JSON == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [rat_type]"); + goto end; + } + cJSON_AddItemToObject(item, "ratType", rat_type_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [rat_type]"); + goto end; + } + + if (amf3_gpp_access_registration->urrp_indicator >= 0) { + if (cJSON_AddBoolToObject(item, "urrpIndicator", amf3_gpp_access_registration->urrp_indicator) == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [urrp_indicator]"); + goto end; + } + } + + if (amf3_gpp_access_registration->amf_ee_subscription_id) { + if (cJSON_AddStringToObject(item, "amfEeSubscriptionId", amf3_gpp_access_registration->amf_ee_subscription_id) == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [amf_ee_subscription_id]"); + goto end; + } + } + + if (amf3_gpp_access_registration->ue_srvcc_capability >= 0) { + if (cJSON_AddBoolToObject(item, "ueSrvccCapability", amf3_gpp_access_registration->ue_srvcc_capability) == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [ue_srvcc_capability]"); + goto end; + } + } + + if (amf3_gpp_access_registration->nid) { + if (cJSON_AddStringToObject(item, "nid", amf3_gpp_access_registration->nid) == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [nid]"); + goto end; + } + } + + if (amf3_gpp_access_registration->registration_time) { + if (cJSON_AddStringToObject(item, "registrationTime", amf3_gpp_access_registration->registration_time) == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [registration_time]"); + goto end; + } + } + + if (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]"); + 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]"); + 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]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_parseFromJSON(cJSON *amf3_gpp_access_registrationJSON) +{ + OpenAPI_amf3_gpp_access_registration_t *amf3_gpp_access_registration_local_var = NULL; + cJSON *amf_instance_id = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "amfInstanceId"); + if (!amf_instance_id) { + ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [amf_instance_id]"); + goto end; + } + + + if (!cJSON_IsString(amf_instance_id)) { + ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [amf_instance_id]"); + goto end; + } + + cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "supportedFeatures"); + + if (supported_features) { + if (!cJSON_IsString(supported_features)) { + ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [supported_features]"); + goto end; + } + } + + cJSON *purge_flag = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "purgeFlag"); + + if (purge_flag) { + if (!cJSON_IsBool(purge_flag)) { + ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [purge_flag]"); + goto end; + } + } + + cJSON *pei = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "pei"); + + if (pei) { + if (!cJSON_IsString(pei)) { + ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [pei]"); + goto end; + } + } + + cJSON *ims_vo_ps = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "imsVoPs"); + + OpenAPI_ims_vo_ps_t *ims_vo_ps_local_nonprim = NULL; + if (ims_vo_ps) { + ims_vo_ps_local_nonprim = OpenAPI_ims_vo_ps_parseFromJSON(ims_vo_ps); + } + + cJSON *dereg_callback_uri = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "deregCallbackUri"); + if (!dereg_callback_uri) { + ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [dereg_callback_uri]"); + goto end; + } + + + if (!cJSON_IsString(dereg_callback_uri)) { + ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [dereg_callback_uri]"); + goto end; + } + + cJSON *amf_service_name_dereg = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "amfServiceNameDereg"); + + if (amf_service_name_dereg) { + if (!cJSON_IsString(amf_service_name_dereg)) { + ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [amf_service_name_dereg]"); + goto end; + } + } + + cJSON *pcscf_restoration_callback_uri = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "pcscfRestorationCallbackUri"); + + if (pcscf_restoration_callback_uri) { + if (!cJSON_IsString(pcscf_restoration_callback_uri)) { + ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [pcscf_restoration_callback_uri]"); + goto end; + } + } + + cJSON *amf_service_name_pcscf_rest = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "amfServiceNamePcscfRest"); + + if (amf_service_name_pcscf_rest) { + if (!cJSON_IsString(amf_service_name_pcscf_rest)) { + ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [amf_service_name_pcscf_rest]"); + goto end; + } + } + + cJSON *initial_registration_ind = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "initialRegistrationInd"); + + if (initial_registration_ind) { + if (!cJSON_IsBool(initial_registration_ind)) { + ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [initial_registration_ind]"); + goto end; + } + } + + cJSON *guami = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "guami"); + if (!guami) { + ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [guami]"); + goto end; + } + + OpenAPI_guami_t *guami_local_nonprim = NULL; + + guami_local_nonprim = OpenAPI_guami_parseFromJSON(guami); + + cJSON *backup_amf_info = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "backupAmfInfo"); + + OpenAPI_list_t *backup_amf_infoList; + if (backup_amf_info) { + cJSON *backup_amf_info_local_nonprimitive; + if (!cJSON_IsArray(backup_amf_info)) { + ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [backup_amf_info]"); + goto end; + } + + backup_amf_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(backup_amf_info_local_nonprimitive, backup_amf_info ) { + if (!cJSON_IsObject(backup_amf_info_local_nonprimitive)) { + ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [backup_amf_info]"); + goto end; + } + OpenAPI_backup_amf_info_t *backup_amf_infoItem = OpenAPI_backup_amf_info_parseFromJSON(backup_amf_info_local_nonprimitive); + + OpenAPI_list_add(backup_amf_infoList, backup_amf_infoItem); + } + } + + cJSON *dr_flag = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "drFlag"); + + if (dr_flag) { + if (!cJSON_IsBool(dr_flag)) { + ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [dr_flag]"); + goto end; + } + } + + cJSON *rat_type = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "ratType"); + if (!rat_type) { + ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [rat_type]"); + goto end; + } + + OpenAPI_rat_type_t *rat_type_local_nonprim = NULL; + + rat_type_local_nonprim = OpenAPI_rat_type_parseFromJSON(rat_type); + + cJSON *urrp_indicator = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "urrpIndicator"); + + if (urrp_indicator) { + if (!cJSON_IsBool(urrp_indicator)) { + ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [urrp_indicator]"); + goto end; + } + } + + cJSON *amf_ee_subscription_id = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "amfEeSubscriptionId"); + + if (amf_ee_subscription_id) { + if (!cJSON_IsString(amf_ee_subscription_id)) { + ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [amf_ee_subscription_id]"); + goto end; + } + } + + cJSON *ue_srvcc_capability = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "ueSrvccCapability"); + + if (ue_srvcc_capability) { + if (!cJSON_IsBool(ue_srvcc_capability)) { + ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [ue_srvcc_capability]"); + goto end; + } + } + + 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) { + if (!cJSON_IsString(registration_time)) { + ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [registration_time]"); + goto end; + } + } + + cJSON *vgmlc_address_ipv4 = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "vgmlcAddressIpv4"); + + if (vgmlc_address_ipv4) { + if (!cJSON_IsString(vgmlc_address_ipv4)) { + ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [vgmlc_address_ipv4]"); + goto end; + } + } + + cJSON *vgmlc_address_ipv6 = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "vgmlcAddressIpv6"); + + if (vgmlc_address_ipv6) { + if (!cJSON_IsString(vgmlc_address_ipv6)) { + ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [vgmlc_address_ipv6]"); + goto end; + } + } + + cJSON *vgmlc_fqdn = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "vgmlcFqdn"); + + if (vgmlc_fqdn) { + if (!cJSON_IsString(vgmlc_fqdn)) { + ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [vgmlc_fqdn]"); + goto end; + } + } + + amf3_gpp_access_registration_local_var = OpenAPI_amf3_gpp_access_registration_create ( + ogs_strdup(amf_instance_id->valuestring), + supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + purge_flag ? purge_flag->valueint : 0, + pei ? ogs_strdup(pei->valuestring) : NULL, + ims_vo_ps ? ims_vo_ps_local_nonprim : NULL, + ogs_strdup(dereg_callback_uri->valuestring), + amf_service_name_dereg ? ogs_strdup(amf_service_name_dereg->valuestring) : NULL, + pcscf_restoration_callback_uri ? ogs_strdup(pcscf_restoration_callback_uri->valuestring) : NULL, + amf_service_name_pcscf_rest ? ogs_strdup(amf_service_name_pcscf_rest->valuestring) : NULL, + initial_registration_ind ? initial_registration_ind->valueint : 0, + guami_local_nonprim, + backup_amf_info ? backup_amf_infoList : NULL, + dr_flag ? dr_flag->valueint : 0, + rat_type_local_nonprim, + urrp_indicator ? urrp_indicator->valueint : 0, + amf_ee_subscription_id ? ogs_strdup(amf_ee_subscription_id->valuestring) : 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 + ); + + return amf3_gpp_access_registration_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/amf3_gpp_access_registration.h b/lib/sbi/openapi/model/amf3_gpp_access_registration.h new file mode 100644 index 0000000000..5dd1eefc3d --- /dev/null +++ b/lib/sbi/openapi/model/amf3_gpp_access_registration.h @@ -0,0 +1,83 @@ +/* + * amf3_gpp_access_registration.h + * + * + */ + +#ifndef _OpenAPI_amf3_gpp_access_registration_H_ +#define _OpenAPI_amf3_gpp_access_registration_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "backup_amf_info.h" +#include "guami.h" +#include "ims_vo_ps.h" +#include "rat_type.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_amf3_gpp_access_registration_s OpenAPI_amf3_gpp_access_registration_t; +typedef struct OpenAPI_amf3_gpp_access_registration_s { + char *amf_instance_id; + char *supported_features; + int purge_flag; + char *pei; + struct OpenAPI_ims_vo_ps_s *ims_vo_ps; + char *dereg_callback_uri; + char *amf_service_name_dereg; + char *pcscf_restoration_callback_uri; + char *amf_service_name_pcscf_rest; + int initial_registration_ind; + struct OpenAPI_guami_s *guami; + OpenAPI_list_t *backup_amf_info; + int dr_flag; + struct OpenAPI_rat_type_s *rat_type; + int urrp_indicator; + char *amf_ee_subscription_id; + int ue_srvcc_capability; + char *nid; + char *registration_time; + char *vgmlc_address_ipv4; + char *vgmlc_address_ipv6; + char *vgmlc_fqdn; +} OpenAPI_amf3_gpp_access_registration_t; + +OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_create( + char *amf_instance_id, + char *supported_features, + int purge_flag, + char *pei, + OpenAPI_ims_vo_ps_t *ims_vo_ps, + char *dereg_callback_uri, + char *amf_service_name_dereg, + char *pcscf_restoration_callback_uri, + char *amf_service_name_pcscf_rest, + int initial_registration_ind, + OpenAPI_guami_t *guami, + OpenAPI_list_t *backup_amf_info, + int dr_flag, + OpenAPI_rat_type_t *rat_type, + int urrp_indicator, + char *amf_ee_subscription_id, + int ue_srvcc_capability, + char *nid, + char *registration_time, + char *vgmlc_address_ipv4, + char *vgmlc_address_ipv6, + char *vgmlc_fqdn + ); +void OpenAPI_amf3_gpp_access_registration_free(OpenAPI_amf3_gpp_access_registration_t *amf3_gpp_access_registration); +OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_parseFromJSON(cJSON *amf3_gpp_access_registrationJSON); +cJSON *OpenAPI_amf3_gpp_access_registration_convertToJSON(OpenAPI_amf3_gpp_access_registration_t *amf3_gpp_access_registration); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_amf3_gpp_access_registration_H_ */ + diff --git a/lib/sbi/openapi/model/amf3_gpp_access_registration_modification.c b/lib/sbi/openapi/model/amf3_gpp_access_registration_modification.c new file mode 100644 index 0000000000..d8255f1746 --- /dev/null +++ b/lib/sbi/openapi/model/amf3_gpp_access_registration_modification.c @@ -0,0 +1,236 @@ + +#include +#include +#include +#include "amf3_gpp_access_registration_modification.h" + +OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_registration_modification_create( + OpenAPI_guami_t *guami, + int purge_flag, + char *pei, + 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 + ) +{ + OpenAPI_amf3_gpp_access_registration_modification_t *amf3_gpp_access_registration_modification_local_var = OpenAPI_malloc(sizeof(OpenAPI_amf3_gpp_access_registration_modification_t)); + if (!amf3_gpp_access_registration_modification_local_var) { + return NULL; + } + amf3_gpp_access_registration_modification_local_var->guami = guami; + amf3_gpp_access_registration_modification_local_var->purge_flag = purge_flag; + amf3_gpp_access_registration_modification_local_var->pei = pei; + amf3_gpp_access_registration_modification_local_var->ims_vo_ps = ims_vo_ps; + 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; + + return amf3_gpp_access_registration_modification_local_var; +} + +void OpenAPI_amf3_gpp_access_registration_modification_free(OpenAPI_amf3_gpp_access_registration_modification_t *amf3_gpp_access_registration_modification) +{ + if (NULL == amf3_gpp_access_registration_modification) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_guami_free(amf3_gpp_access_registration_modification->guami); + ogs_free(amf3_gpp_access_registration_modification->pei); + OpenAPI_ims_vo_ps_free(amf3_gpp_access_registration_modification->ims_vo_ps); + OpenAPI_list_for_each(amf3_gpp_access_registration_modification->backup_amf_info, node) { + OpenAPI_backup_amf_info_free(node->data); + } + OpenAPI_list_free(amf3_gpp_access_registration_modification->backup_amf_info); + OpenAPI_eps_interworking_info_free(amf3_gpp_access_registration_modification->eps_interworking_info); + ogs_free(amf3_gpp_access_registration_modification); +} + +cJSON *OpenAPI_amf3_gpp_access_registration_modification_convertToJSON(OpenAPI_amf3_gpp_access_registration_modification_t *amf3_gpp_access_registration_modification) +{ + cJSON *item = NULL; + + if (amf3_gpp_access_registration_modification == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [Amf3GppAccessRegistrationModification]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!amf3_gpp_access_registration_modification->guami) { + ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [guami]"); + goto end; + } + cJSON *guami_local_JSON = OpenAPI_guami_convertToJSON(amf3_gpp_access_registration_modification->guami); + if (guami_local_JSON == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [guami]"); + goto end; + } + cJSON_AddItemToObject(item, "guami", guami_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [guami]"); + goto end; + } + + if (amf3_gpp_access_registration_modification->purge_flag >= 0) { + if (cJSON_AddBoolToObject(item, "purgeFlag", amf3_gpp_access_registration_modification->purge_flag) == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [purge_flag]"); + goto end; + } + } + + if (amf3_gpp_access_registration_modification->pei) { + if (cJSON_AddStringToObject(item, "pei", amf3_gpp_access_registration_modification->pei) == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [pei]"); + goto end; + } + } + + if (amf3_gpp_access_registration_modification->ims_vo_ps) { + cJSON *ims_vo_ps_local_JSON = OpenAPI_ims_vo_ps_convertToJSON(amf3_gpp_access_registration_modification->ims_vo_ps); + if (ims_vo_ps_local_JSON == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [ims_vo_ps]"); + goto end; + } + cJSON_AddItemToObject(item, "imsVoPs", ims_vo_ps_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [ims_vo_ps]"); + goto end; + } + } + + if (amf3_gpp_access_registration_modification->backup_amf_info) { + cJSON *backup_amf_infoList = cJSON_AddArrayToObject(item, "backupAmfInfo"); + if (backup_amf_infoList == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [backup_amf_info]"); + goto end; + } + + OpenAPI_lnode_t *backup_amf_info_node; + if (amf3_gpp_access_registration_modification->backup_amf_info) { + OpenAPI_list_for_each(amf3_gpp_access_registration_modification->backup_amf_info, backup_amf_info_node) { + cJSON *itemLocal = OpenAPI_backup_amf_info_convertToJSON(backup_amf_info_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [backup_amf_info]"); + goto end; + } + cJSON_AddItemToArray(backup_amf_infoList, itemLocal); + } + } + } + + if (amf3_gpp_access_registration_modification->eps_interworking_info) { + cJSON *eps_interworking_info_local_JSON = OpenAPI_eps_interworking_info_convertToJSON(amf3_gpp_access_registration_modification->eps_interworking_info); + if (eps_interworking_info_local_JSON == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [eps_interworking_info]"); + goto end; + } + cJSON_AddItemToObject(item, "epsInterworkingInfo", eps_interworking_info_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [eps_interworking_info]"); + goto end; + } + } + + if (amf3_gpp_access_registration_modification->ue_srvcc_capability >= 0) { + if (cJSON_AddBoolToObject(item, "ueSrvccCapability", amf3_gpp_access_registration_modification->ue_srvcc_capability) == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [ue_srvcc_capability]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON(cJSON *amf3_gpp_access_registration_modificationJSON) +{ + OpenAPI_amf3_gpp_access_registration_modification_t *amf3_gpp_access_registration_modification_local_var = NULL; + cJSON *guami = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "guami"); + if (!guami) { + ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [guami]"); + goto end; + } + + OpenAPI_guami_t *guami_local_nonprim = NULL; + + guami_local_nonprim = OpenAPI_guami_parseFromJSON(guami); + + cJSON *purge_flag = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "purgeFlag"); + + if (purge_flag) { + if (!cJSON_IsBool(purge_flag)) { + ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [purge_flag]"); + goto end; + } + } + + cJSON *pei = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "pei"); + + if (pei) { + if (!cJSON_IsString(pei)) { + ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [pei]"); + goto end; + } + } + + cJSON *ims_vo_ps = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "imsVoPs"); + + OpenAPI_ims_vo_ps_t *ims_vo_ps_local_nonprim = NULL; + if (ims_vo_ps) { + ims_vo_ps_local_nonprim = OpenAPI_ims_vo_ps_parseFromJSON(ims_vo_ps); + } + + cJSON *backup_amf_info = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "backupAmfInfo"); + + OpenAPI_list_t *backup_amf_infoList; + if (backup_amf_info) { + cJSON *backup_amf_info_local_nonprimitive; + if (!cJSON_IsArray(backup_amf_info)) { + ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [backup_amf_info]"); + goto end; + } + + backup_amf_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(backup_amf_info_local_nonprimitive, backup_amf_info ) { + if (!cJSON_IsObject(backup_amf_info_local_nonprimitive)) { + ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [backup_amf_info]"); + goto end; + } + OpenAPI_backup_amf_info_t *backup_amf_infoItem = OpenAPI_backup_amf_info_parseFromJSON(backup_amf_info_local_nonprimitive); + + OpenAPI_list_add(backup_amf_infoList, backup_amf_infoItem); + } + } + + cJSON *eps_interworking_info = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "epsInterworkingInfo"); + + OpenAPI_eps_interworking_info_t *eps_interworking_info_local_nonprim = NULL; + if (eps_interworking_info) { + eps_interworking_info_local_nonprim = OpenAPI_eps_interworking_info_parseFromJSON(eps_interworking_info); + } + + cJSON *ue_srvcc_capability = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "ueSrvccCapability"); + + if (ue_srvcc_capability) { + if (!cJSON_IsBool(ue_srvcc_capability)) { + ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [ue_srvcc_capability]"); + goto end; + } + } + + amf3_gpp_access_registration_modification_local_var = OpenAPI_amf3_gpp_access_registration_modification_create ( + guami_local_nonprim, + purge_flag ? purge_flag->valueint : 0, + pei ? ogs_strdup(pei->valuestring) : NULL, + 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 + ); + + return amf3_gpp_access_registration_modification_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/amf3_gpp_access_registration_modification.h b/lib/sbi/openapi/model/amf3_gpp_access_registration_modification.h new file mode 100644 index 0000000000..0b9deaf83c --- /dev/null +++ b/lib/sbi/openapi/model/amf3_gpp_access_registration_modification.h @@ -0,0 +1,53 @@ +/* + * amf3_gpp_access_registration_modification.h + * + * + */ + +#ifndef _OpenAPI_amf3_gpp_access_registration_modification_H_ +#define _OpenAPI_amf3_gpp_access_registration_modification_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "backup_amf_info.h" +#include "eps_interworking_info.h" +#include "guami.h" +#include "ims_vo_ps.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_amf3_gpp_access_registration_modification_s OpenAPI_amf3_gpp_access_registration_modification_t; +typedef struct OpenAPI_amf3_gpp_access_registration_modification_s { + struct OpenAPI_guami_s *guami; + int purge_flag; + char *pei; + struct OpenAPI_ims_vo_ps_s *ims_vo_ps; + OpenAPI_list_t *backup_amf_info; + struct OpenAPI_eps_interworking_info_s *eps_interworking_info; + int ue_srvcc_capability; +} OpenAPI_amf3_gpp_access_registration_modification_t; + +OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_registration_modification_create( + OpenAPI_guami_t *guami, + int purge_flag, + char *pei, + 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 + ); +void OpenAPI_amf3_gpp_access_registration_modification_free(OpenAPI_amf3_gpp_access_registration_modification_t *amf3_gpp_access_registration_modification); +OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON(cJSON *amf3_gpp_access_registration_modificationJSON); +cJSON *OpenAPI_amf3_gpp_access_registration_modification_convertToJSON(OpenAPI_amf3_gpp_access_registration_modification_t *amf3_gpp_access_registration_modification); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_amf3_gpp_access_registration_modification_H_ */ + diff --git a/lib/sbi/openapi/model/amf_cond.h b/lib/sbi/openapi/model/amf_cond.h index d14506dea6..ea3e90b926 100644 --- a/lib/sbi/openapi/model/amf_cond.h +++ b/lib/sbi/openapi/model/amf_cond.h @@ -1,7 +1,7 @@ /* * amf_cond.h * - * + * Subscription to a set of AMFs, based on AMF Set Id and/or AMF Region Id */ #ifndef _OpenAPI_amf_cond_H_ diff --git a/lib/sbi/openapi/model/amf_dereg_info.c b/lib/sbi/openapi/model/amf_dereg_info.c new file mode 100644 index 0000000000..9f9075e9cf --- /dev/null +++ b/lib/sbi/openapi/model/amf_dereg_info.c @@ -0,0 +1,80 @@ + +#include +#include +#include +#include "amf_dereg_info.h" + +OpenAPI_amf_dereg_info_t *OpenAPI_amf_dereg_info_create( + OpenAPI_deregistration_reason_t *dereg_reason + ) +{ + OpenAPI_amf_dereg_info_t *amf_dereg_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_amf_dereg_info_t)); + if (!amf_dereg_info_local_var) { + return NULL; + } + amf_dereg_info_local_var->dereg_reason = dereg_reason; + + return amf_dereg_info_local_var; +} + +void OpenAPI_amf_dereg_info_free(OpenAPI_amf_dereg_info_t *amf_dereg_info) +{ + if (NULL == amf_dereg_info) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_deregistration_reason_free(amf_dereg_info->dereg_reason); + ogs_free(amf_dereg_info); +} + +cJSON *OpenAPI_amf_dereg_info_convertToJSON(OpenAPI_amf_dereg_info_t *amf_dereg_info) +{ + cJSON *item = NULL; + + if (amf_dereg_info == NULL) { + ogs_error("OpenAPI_amf_dereg_info_convertToJSON() failed [AmfDeregInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!amf_dereg_info->dereg_reason) { + ogs_error("OpenAPI_amf_dereg_info_convertToJSON() failed [dereg_reason]"); + goto end; + } + cJSON *dereg_reason_local_JSON = OpenAPI_deregistration_reason_convertToJSON(amf_dereg_info->dereg_reason); + if (dereg_reason_local_JSON == NULL) { + ogs_error("OpenAPI_amf_dereg_info_convertToJSON() failed [dereg_reason]"); + goto end; + } + cJSON_AddItemToObject(item, "deregReason", dereg_reason_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_amf_dereg_info_convertToJSON() failed [dereg_reason]"); + goto end; + } + +end: + return item; +} + +OpenAPI_amf_dereg_info_t *OpenAPI_amf_dereg_info_parseFromJSON(cJSON *amf_dereg_infoJSON) +{ + OpenAPI_amf_dereg_info_t *amf_dereg_info_local_var = NULL; + cJSON *dereg_reason = cJSON_GetObjectItemCaseSensitive(amf_dereg_infoJSON, "deregReason"); + if (!dereg_reason) { + ogs_error("OpenAPI_amf_dereg_info_parseFromJSON() failed [dereg_reason]"); + goto end; + } + + OpenAPI_deregistration_reason_t *dereg_reason_local_nonprim = NULL; + + dereg_reason_local_nonprim = OpenAPI_deregistration_reason_parseFromJSON(dereg_reason); + + amf_dereg_info_local_var = OpenAPI_amf_dereg_info_create ( + dereg_reason_local_nonprim + ); + + return amf_dereg_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/amf_dereg_info.h b/lib/sbi/openapi/model/amf_dereg_info.h new file mode 100644 index 0000000000..173a258dd0 --- /dev/null +++ b/lib/sbi/openapi/model/amf_dereg_info.h @@ -0,0 +1,38 @@ +/* + * amf_dereg_info.h + * + * + */ + +#ifndef _OpenAPI_amf_dereg_info_H_ +#define _OpenAPI_amf_dereg_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "deregistration_reason.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_amf_dereg_info_s OpenAPI_amf_dereg_info_t; +typedef struct OpenAPI_amf_dereg_info_s { + struct OpenAPI_deregistration_reason_s *dereg_reason; +} OpenAPI_amf_dereg_info_t; + +OpenAPI_amf_dereg_info_t *OpenAPI_amf_dereg_info_create( + OpenAPI_deregistration_reason_t *dereg_reason + ); +void OpenAPI_amf_dereg_info_free(OpenAPI_amf_dereg_info_t *amf_dereg_info); +OpenAPI_amf_dereg_info_t *OpenAPI_amf_dereg_info_parseFromJSON(cJSON *amf_dereg_infoJSON); +cJSON *OpenAPI_amf_dereg_info_convertToJSON(OpenAPI_amf_dereg_info_t *amf_dereg_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_amf_dereg_info_H_ */ + diff --git a/lib/sbi/openapi/model/amf_info.h b/lib/sbi/openapi/model/amf_info.h index eb500f2be8..8b361d7631 100644 --- a/lib/sbi/openapi/model/amf_info.h +++ b/lib/sbi/openapi/model/amf_info.h @@ -1,7 +1,7 @@ /* * amf_info.h * - * + * Information of an AMF NF Instance */ #ifndef _OpenAPI_amf_info_H_ diff --git a/lib/sbi/openapi/model/amf_non3_gpp_access_registration.c b/lib/sbi/openapi/model/amf_non3_gpp_access_registration.c new file mode 100644 index 0000000000..048af547f5 --- /dev/null +++ b/lib/sbi/openapi/model/amf_non3_gpp_access_registration.c @@ -0,0 +1,496 @@ + +#include +#include +#include +#include "amf_non3_gpp_access_registration.h" + +OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registration_create( + char *amf_instance_id, + char *supported_features, + int purge_flag, + char *pei, + OpenAPI_ims_vo_ps_t *ims_vo_ps, + char *dereg_callback_uri, + char *amf_service_name_dereg, + char *pcscf_restoration_callback_uri, + char *amf_service_name_pcscf_rest, + OpenAPI_guami_t *guami, + OpenAPI_list_t *backup_amf_info, + OpenAPI_rat_type_t *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_amf_non3_gpp_access_registration_t *amf_non3_gpp_access_registration_local_var = OpenAPI_malloc(sizeof(OpenAPI_amf_non3_gpp_access_registration_t)); + if (!amf_non3_gpp_access_registration_local_var) { + return NULL; + } + amf_non3_gpp_access_registration_local_var->amf_instance_id = amf_instance_id; + amf_non3_gpp_access_registration_local_var->supported_features = supported_features; + amf_non3_gpp_access_registration_local_var->purge_flag = purge_flag; + amf_non3_gpp_access_registration_local_var->pei = pei; + amf_non3_gpp_access_registration_local_var->ims_vo_ps = ims_vo_ps; + amf_non3_gpp_access_registration_local_var->dereg_callback_uri = dereg_callback_uri; + amf_non3_gpp_access_registration_local_var->amf_service_name_dereg = amf_service_name_dereg; + amf_non3_gpp_access_registration_local_var->pcscf_restoration_callback_uri = pcscf_restoration_callback_uri; + amf_non3_gpp_access_registration_local_var->amf_service_name_pcscf_rest = amf_service_name_pcscf_rest; + amf_non3_gpp_access_registration_local_var->guami = guami; + amf_non3_gpp_access_registration_local_var->backup_amf_info = backup_amf_info; + 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; + + return amf_non3_gpp_access_registration_local_var; +} + +void OpenAPI_amf_non3_gpp_access_registration_free(OpenAPI_amf_non3_gpp_access_registration_t *amf_non3_gpp_access_registration) +{ + if (NULL == amf_non3_gpp_access_registration) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(amf_non3_gpp_access_registration->amf_instance_id); + ogs_free(amf_non3_gpp_access_registration->supported_features); + ogs_free(amf_non3_gpp_access_registration->pei); + OpenAPI_ims_vo_ps_free(amf_non3_gpp_access_registration->ims_vo_ps); + ogs_free(amf_non3_gpp_access_registration->dereg_callback_uri); + ogs_free(amf_non3_gpp_access_registration->amf_service_name_dereg); + ogs_free(amf_non3_gpp_access_registration->pcscf_restoration_callback_uri); + ogs_free(amf_non3_gpp_access_registration->amf_service_name_pcscf_rest); + OpenAPI_guami_free(amf_non3_gpp_access_registration->guami); + OpenAPI_list_for_each(amf_non3_gpp_access_registration->backup_amf_info, node) { + OpenAPI_backup_amf_info_free(node->data); + } + OpenAPI_list_free(amf_non3_gpp_access_registration->backup_amf_info); + OpenAPI_rat_type_free(amf_non3_gpp_access_registration->rat_type); + 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); + ogs_free(amf_non3_gpp_access_registration); +} + +cJSON *OpenAPI_amf_non3_gpp_access_registration_convertToJSON(OpenAPI_amf_non3_gpp_access_registration_t *amf_non3_gpp_access_registration) +{ + cJSON *item = NULL; + + if (amf_non3_gpp_access_registration == NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [AmfNon3GppAccessRegistration]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!amf_non3_gpp_access_registration->amf_instance_id) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [amf_instance_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "amfInstanceId", amf_non3_gpp_access_registration->amf_instance_id) == NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [amf_instance_id]"); + goto end; + } + + if (amf_non3_gpp_access_registration->supported_features) { + if (cJSON_AddStringToObject(item, "supportedFeatures", amf_non3_gpp_access_registration->supported_features) == NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [supported_features]"); + goto end; + } + } + + if (amf_non3_gpp_access_registration->purge_flag >= 0) { + if (cJSON_AddBoolToObject(item, "purgeFlag", amf_non3_gpp_access_registration->purge_flag) == NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [purge_flag]"); + goto end; + } + } + + if (amf_non3_gpp_access_registration->pei) { + if (cJSON_AddStringToObject(item, "pei", amf_non3_gpp_access_registration->pei) == NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [pei]"); + goto end; + } + } + + if (!amf_non3_gpp_access_registration->ims_vo_ps) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [ims_vo_ps]"); + goto end; + } + cJSON *ims_vo_ps_local_JSON = OpenAPI_ims_vo_ps_convertToJSON(amf_non3_gpp_access_registration->ims_vo_ps); + if (ims_vo_ps_local_JSON == NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [ims_vo_ps]"); + goto end; + } + cJSON_AddItemToObject(item, "imsVoPs", ims_vo_ps_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [ims_vo_ps]"); + goto end; + } + + if (!amf_non3_gpp_access_registration->dereg_callback_uri) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [dereg_callback_uri]"); + goto end; + } + if (cJSON_AddStringToObject(item, "deregCallbackUri", amf_non3_gpp_access_registration->dereg_callback_uri) == NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [dereg_callback_uri]"); + goto end; + } + + if (amf_non3_gpp_access_registration->amf_service_name_dereg) { + if (cJSON_AddStringToObject(item, "amfServiceNameDereg", amf_non3_gpp_access_registration->amf_service_name_dereg) == NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [amf_service_name_dereg]"); + goto end; + } + } + + if (amf_non3_gpp_access_registration->pcscf_restoration_callback_uri) { + if (cJSON_AddStringToObject(item, "pcscfRestorationCallbackUri", amf_non3_gpp_access_registration->pcscf_restoration_callback_uri) == NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [pcscf_restoration_callback_uri]"); + goto end; + } + } + + if (amf_non3_gpp_access_registration->amf_service_name_pcscf_rest) { + if (cJSON_AddStringToObject(item, "amfServiceNamePcscfRest", amf_non3_gpp_access_registration->amf_service_name_pcscf_rest) == NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [amf_service_name_pcscf_rest]"); + goto end; + } + } + + if (!amf_non3_gpp_access_registration->guami) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [guami]"); + goto end; + } + cJSON *guami_local_JSON = OpenAPI_guami_convertToJSON(amf_non3_gpp_access_registration->guami); + if (guami_local_JSON == NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [guami]"); + goto end; + } + cJSON_AddItemToObject(item, "guami", guami_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [guami]"); + goto end; + } + + if (amf_non3_gpp_access_registration->backup_amf_info) { + cJSON *backup_amf_infoList = cJSON_AddArrayToObject(item, "backupAmfInfo"); + if (backup_amf_infoList == NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [backup_amf_info]"); + goto end; + } + + OpenAPI_lnode_t *backup_amf_info_node; + if (amf_non3_gpp_access_registration->backup_amf_info) { + OpenAPI_list_for_each(amf_non3_gpp_access_registration->backup_amf_info, backup_amf_info_node) { + cJSON *itemLocal = OpenAPI_backup_amf_info_convertToJSON(backup_amf_info_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [backup_amf_info]"); + goto end; + } + cJSON_AddItemToArray(backup_amf_infoList, itemLocal); + } + } + } + + if (!amf_non3_gpp_access_registration->rat_type) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [rat_type]"); + goto end; + } + cJSON *rat_type_local_JSON = OpenAPI_rat_type_convertToJSON(amf_non3_gpp_access_registration->rat_type); + if (rat_type_local_JSON == NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [rat_type]"); + goto end; + } + cJSON_AddItemToObject(item, "ratType", rat_type_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [rat_type]"); + goto end; + } + + if (amf_non3_gpp_access_registration->urrp_indicator >= 0) { + if (cJSON_AddBoolToObject(item, "urrpIndicator", amf_non3_gpp_access_registration->urrp_indicator) == NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [urrp_indicator]"); + goto end; + } + } + + if (amf_non3_gpp_access_registration->amf_ee_subscription_id) { + if (cJSON_AddStringToObject(item, "amfEeSubscriptionId", amf_non3_gpp_access_registration->amf_ee_subscription_id) == NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [amf_ee_subscription_id]"); + goto end; + } + } + + 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]"); + goto end; + } + } + + 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]"); + 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]"); + 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]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registration_parseFromJSON(cJSON *amf_non3_gpp_access_registrationJSON) +{ + OpenAPI_amf_non3_gpp_access_registration_t *amf_non3_gpp_access_registration_local_var = NULL; + cJSON *amf_instance_id = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "amfInstanceId"); + if (!amf_instance_id) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [amf_instance_id]"); + goto end; + } + + + if (!cJSON_IsString(amf_instance_id)) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [amf_instance_id]"); + goto end; + } + + cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "supportedFeatures"); + + if (supported_features) { + if (!cJSON_IsString(supported_features)) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [supported_features]"); + goto end; + } + } + + cJSON *purge_flag = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "purgeFlag"); + + if (purge_flag) { + if (!cJSON_IsBool(purge_flag)) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [purge_flag]"); + goto end; + } + } + + cJSON *pei = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "pei"); + + if (pei) { + if (!cJSON_IsString(pei)) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [pei]"); + goto end; + } + } + + cJSON *ims_vo_ps = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "imsVoPs"); + if (!ims_vo_ps) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [ims_vo_ps]"); + goto end; + } + + OpenAPI_ims_vo_ps_t *ims_vo_ps_local_nonprim = NULL; + + ims_vo_ps_local_nonprim = OpenAPI_ims_vo_ps_parseFromJSON(ims_vo_ps); + + cJSON *dereg_callback_uri = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "deregCallbackUri"); + if (!dereg_callback_uri) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [dereg_callback_uri]"); + goto end; + } + + + if (!cJSON_IsString(dereg_callback_uri)) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [dereg_callback_uri]"); + goto end; + } + + cJSON *amf_service_name_dereg = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "amfServiceNameDereg"); + + if (amf_service_name_dereg) { + if (!cJSON_IsString(amf_service_name_dereg)) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [amf_service_name_dereg]"); + goto end; + } + } + + cJSON *pcscf_restoration_callback_uri = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "pcscfRestorationCallbackUri"); + + if (pcscf_restoration_callback_uri) { + if (!cJSON_IsString(pcscf_restoration_callback_uri)) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [pcscf_restoration_callback_uri]"); + goto end; + } + } + + cJSON *amf_service_name_pcscf_rest = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "amfServiceNamePcscfRest"); + + if (amf_service_name_pcscf_rest) { + if (!cJSON_IsString(amf_service_name_pcscf_rest)) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [amf_service_name_pcscf_rest]"); + goto end; + } + } + + cJSON *guami = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "guami"); + if (!guami) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [guami]"); + goto end; + } + + OpenAPI_guami_t *guami_local_nonprim = NULL; + + guami_local_nonprim = OpenAPI_guami_parseFromJSON(guami); + + cJSON *backup_amf_info = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "backupAmfInfo"); + + OpenAPI_list_t *backup_amf_infoList; + if (backup_amf_info) { + cJSON *backup_amf_info_local_nonprimitive; + if (!cJSON_IsArray(backup_amf_info)) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [backup_amf_info]"); + goto end; + } + + backup_amf_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(backup_amf_info_local_nonprimitive, backup_amf_info ) { + if (!cJSON_IsObject(backup_amf_info_local_nonprimitive)) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [backup_amf_info]"); + goto end; + } + OpenAPI_backup_amf_info_t *backup_amf_infoItem = OpenAPI_backup_amf_info_parseFromJSON(backup_amf_info_local_nonprimitive); + + OpenAPI_list_add(backup_amf_infoList, backup_amf_infoItem); + } + } + + cJSON *rat_type = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "ratType"); + if (!rat_type) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [rat_type]"); + goto end; + } + + OpenAPI_rat_type_t *rat_type_local_nonprim = NULL; + + rat_type_local_nonprim = OpenAPI_rat_type_parseFromJSON(rat_type); + + cJSON *urrp_indicator = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "urrpIndicator"); + + if (urrp_indicator) { + if (!cJSON_IsBool(urrp_indicator)) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [urrp_indicator]"); + goto end; + } + } + + cJSON *amf_ee_subscription_id = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "amfEeSubscriptionId"); + + if (amf_ee_subscription_id) { + if (!cJSON_IsString(amf_ee_subscription_id)) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [amf_ee_subscription_id]"); + goto end; + } + } + + 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) { + if (!cJSON_IsString(registration_time)) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [registration_time]"); + goto end; + } + } + + cJSON *vgmlc_address_ipv4 = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "vgmlcAddressIpv4"); + + 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; + } + } + + cJSON *vgmlc_address_ipv6 = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "vgmlcAddressIpv6"); + + 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; + } + } + + amf_non3_gpp_access_registration_local_var = OpenAPI_amf_non3_gpp_access_registration_create ( + ogs_strdup(amf_instance_id->valuestring), + supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + purge_flag ? purge_flag->valueint : 0, + pei ? ogs_strdup(pei->valuestring) : NULL, + ims_vo_ps_local_nonprim, + ogs_strdup(dereg_callback_uri->valuestring), + amf_service_name_dereg ? ogs_strdup(amf_service_name_dereg->valuestring) : NULL, + pcscf_restoration_callback_uri ? ogs_strdup(pcscf_restoration_callback_uri->valuestring) : NULL, + amf_service_name_pcscf_rest ? ogs_strdup(amf_service_name_pcscf_rest->valuestring) : NULL, + guami_local_nonprim, + backup_amf_info ? backup_amf_infoList : NULL, + rat_type_local_nonprim, + 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 + ); + + return amf_non3_gpp_access_registration_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/amf_non3_gpp_access_registration.h b/lib/sbi/openapi/model/amf_non3_gpp_access_registration.h new file mode 100644 index 0000000000..f2b88b7d27 --- /dev/null +++ b/lib/sbi/openapi/model/amf_non3_gpp_access_registration.h @@ -0,0 +1,77 @@ +/* + * amf_non3_gpp_access_registration.h + * + * + */ + +#ifndef _OpenAPI_amf_non3_gpp_access_registration_H_ +#define _OpenAPI_amf_non3_gpp_access_registration_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "backup_amf_info.h" +#include "guami.h" +#include "ims_vo_ps.h" +#include "rat_type.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_amf_non3_gpp_access_registration_s OpenAPI_amf_non3_gpp_access_registration_t; +typedef struct OpenAPI_amf_non3_gpp_access_registration_s { + char *amf_instance_id; + char *supported_features; + int purge_flag; + char *pei; + struct OpenAPI_ims_vo_ps_s *ims_vo_ps; + char *dereg_callback_uri; + char *amf_service_name_dereg; + char *pcscf_restoration_callback_uri; + char *amf_service_name_pcscf_rest; + struct OpenAPI_guami_s *guami; + OpenAPI_list_t *backup_amf_info; + struct OpenAPI_rat_type_s *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_amf_non3_gpp_access_registration_t; + +OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registration_create( + char *amf_instance_id, + char *supported_features, + int purge_flag, + char *pei, + OpenAPI_ims_vo_ps_t *ims_vo_ps, + char *dereg_callback_uri, + char *amf_service_name_dereg, + char *pcscf_restoration_callback_uri, + char *amf_service_name_pcscf_rest, + OpenAPI_guami_t *guami, + OpenAPI_list_t *backup_amf_info, + OpenAPI_rat_type_t *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 + ); +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); +cJSON *OpenAPI_amf_non3_gpp_access_registration_convertToJSON(OpenAPI_amf_non3_gpp_access_registration_t *amf_non3_gpp_access_registration); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_amf_non3_gpp_access_registration_H_ */ + diff --git a/lib/sbi/openapi/model/amf_non3_gpp_access_registration_modification.c b/lib/sbi/openapi/model/amf_non3_gpp_access_registration_modification.c new file mode 100644 index 0000000000..55d7d91eec --- /dev/null +++ b/lib/sbi/openapi/model/amf_non3_gpp_access_registration_modification.c @@ -0,0 +1,193 @@ + +#include +#include +#include +#include "amf_non3_gpp_access_registration_modification.h" + +OpenAPI_amf_non3_gpp_access_registration_modification_t *OpenAPI_amf_non3_gpp_access_registration_modification_create( + OpenAPI_guami_t *guami, + int purge_flag, + char *pei, + OpenAPI_ims_vo_ps_t *ims_vo_ps, + OpenAPI_list_t *backup_amf_info + ) +{ + OpenAPI_amf_non3_gpp_access_registration_modification_t *amf_non3_gpp_access_registration_modification_local_var = OpenAPI_malloc(sizeof(OpenAPI_amf_non3_gpp_access_registration_modification_t)); + if (!amf_non3_gpp_access_registration_modification_local_var) { + return NULL; + } + amf_non3_gpp_access_registration_modification_local_var->guami = guami; + amf_non3_gpp_access_registration_modification_local_var->purge_flag = purge_flag; + amf_non3_gpp_access_registration_modification_local_var->pei = pei; + amf_non3_gpp_access_registration_modification_local_var->ims_vo_ps = ims_vo_ps; + amf_non3_gpp_access_registration_modification_local_var->backup_amf_info = backup_amf_info; + + return amf_non3_gpp_access_registration_modification_local_var; +} + +void OpenAPI_amf_non3_gpp_access_registration_modification_free(OpenAPI_amf_non3_gpp_access_registration_modification_t *amf_non3_gpp_access_registration_modification) +{ + if (NULL == amf_non3_gpp_access_registration_modification) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_guami_free(amf_non3_gpp_access_registration_modification->guami); + ogs_free(amf_non3_gpp_access_registration_modification->pei); + OpenAPI_ims_vo_ps_free(amf_non3_gpp_access_registration_modification->ims_vo_ps); + OpenAPI_list_for_each(amf_non3_gpp_access_registration_modification->backup_amf_info, node) { + OpenAPI_backup_amf_info_free(node->data); + } + OpenAPI_list_free(amf_non3_gpp_access_registration_modification->backup_amf_info); + ogs_free(amf_non3_gpp_access_registration_modification); +} + +cJSON *OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON(OpenAPI_amf_non3_gpp_access_registration_modification_t *amf_non3_gpp_access_registration_modification) +{ + cJSON *item = NULL; + + if (amf_non3_gpp_access_registration_modification == NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON() failed [AmfNon3GppAccessRegistrationModification]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!amf_non3_gpp_access_registration_modification->guami) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON() failed [guami]"); + goto end; + } + cJSON *guami_local_JSON = OpenAPI_guami_convertToJSON(amf_non3_gpp_access_registration_modification->guami); + if (guami_local_JSON == NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON() failed [guami]"); + goto end; + } + cJSON_AddItemToObject(item, "guami", guami_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON() failed [guami]"); + goto end; + } + + if (amf_non3_gpp_access_registration_modification->purge_flag >= 0) { + if (cJSON_AddBoolToObject(item, "purgeFlag", amf_non3_gpp_access_registration_modification->purge_flag) == NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON() failed [purge_flag]"); + goto end; + } + } + + if (amf_non3_gpp_access_registration_modification->pei) { + if (cJSON_AddStringToObject(item, "pei", amf_non3_gpp_access_registration_modification->pei) == NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON() failed [pei]"); + goto end; + } + } + + if (amf_non3_gpp_access_registration_modification->ims_vo_ps) { + cJSON *ims_vo_ps_local_JSON = OpenAPI_ims_vo_ps_convertToJSON(amf_non3_gpp_access_registration_modification->ims_vo_ps); + if (ims_vo_ps_local_JSON == NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON() failed [ims_vo_ps]"); + goto end; + } + cJSON_AddItemToObject(item, "imsVoPs", ims_vo_ps_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON() failed [ims_vo_ps]"); + goto end; + } + } + + if (amf_non3_gpp_access_registration_modification->backup_amf_info) { + cJSON *backup_amf_infoList = cJSON_AddArrayToObject(item, "backupAmfInfo"); + if (backup_amf_infoList == NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON() failed [backup_amf_info]"); + goto end; + } + + OpenAPI_lnode_t *backup_amf_info_node; + if (amf_non3_gpp_access_registration_modification->backup_amf_info) { + OpenAPI_list_for_each(amf_non3_gpp_access_registration_modification->backup_amf_info, backup_amf_info_node) { + cJSON *itemLocal = OpenAPI_backup_amf_info_convertToJSON(backup_amf_info_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON() failed [backup_amf_info]"); + goto end; + } + cJSON_AddItemToArray(backup_amf_infoList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_amf_non3_gpp_access_registration_modification_t *OpenAPI_amf_non3_gpp_access_registration_modification_parseFromJSON(cJSON *amf_non3_gpp_access_registration_modificationJSON) +{ + OpenAPI_amf_non3_gpp_access_registration_modification_t *amf_non3_gpp_access_registration_modification_local_var = NULL; + cJSON *guami = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registration_modificationJSON, "guami"); + if (!guami) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_parseFromJSON() failed [guami]"); + goto end; + } + + OpenAPI_guami_t *guami_local_nonprim = NULL; + + guami_local_nonprim = OpenAPI_guami_parseFromJSON(guami); + + cJSON *purge_flag = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registration_modificationJSON, "purgeFlag"); + + if (purge_flag) { + if (!cJSON_IsBool(purge_flag)) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_parseFromJSON() failed [purge_flag]"); + goto end; + } + } + + cJSON *pei = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registration_modificationJSON, "pei"); + + if (pei) { + if (!cJSON_IsString(pei)) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_parseFromJSON() failed [pei]"); + goto end; + } + } + + cJSON *ims_vo_ps = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registration_modificationJSON, "imsVoPs"); + + OpenAPI_ims_vo_ps_t *ims_vo_ps_local_nonprim = NULL; + if (ims_vo_ps) { + ims_vo_ps_local_nonprim = OpenAPI_ims_vo_ps_parseFromJSON(ims_vo_ps); + } + + cJSON *backup_amf_info = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registration_modificationJSON, "backupAmfInfo"); + + OpenAPI_list_t *backup_amf_infoList; + if (backup_amf_info) { + cJSON *backup_amf_info_local_nonprimitive; + if (!cJSON_IsArray(backup_amf_info)) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_parseFromJSON() failed [backup_amf_info]"); + goto end; + } + + backup_amf_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(backup_amf_info_local_nonprimitive, backup_amf_info ) { + if (!cJSON_IsObject(backup_amf_info_local_nonprimitive)) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_parseFromJSON() failed [backup_amf_info]"); + goto end; + } + OpenAPI_backup_amf_info_t *backup_amf_infoItem = OpenAPI_backup_amf_info_parseFromJSON(backup_amf_info_local_nonprimitive); + + OpenAPI_list_add(backup_amf_infoList, backup_amf_infoItem); + } + } + + amf_non3_gpp_access_registration_modification_local_var = OpenAPI_amf_non3_gpp_access_registration_modification_create ( + guami_local_nonprim, + purge_flag ? purge_flag->valueint : 0, + pei ? ogs_strdup(pei->valuestring) : NULL, + ims_vo_ps ? ims_vo_ps_local_nonprim : NULL, + backup_amf_info ? backup_amf_infoList : NULL + ); + + return amf_non3_gpp_access_registration_modification_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/amf_non3_gpp_access_registration_modification.h b/lib/sbi/openapi/model/amf_non3_gpp_access_registration_modification.h new file mode 100644 index 0000000000..9eaea0fbbb --- /dev/null +++ b/lib/sbi/openapi/model/amf_non3_gpp_access_registration_modification.h @@ -0,0 +1,48 @@ +/* + * amf_non3_gpp_access_registration_modification.h + * + * + */ + +#ifndef _OpenAPI_amf_non3_gpp_access_registration_modification_H_ +#define _OpenAPI_amf_non3_gpp_access_registration_modification_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "backup_amf_info.h" +#include "guami.h" +#include "ims_vo_ps.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_amf_non3_gpp_access_registration_modification_s OpenAPI_amf_non3_gpp_access_registration_modification_t; +typedef struct OpenAPI_amf_non3_gpp_access_registration_modification_s { + struct OpenAPI_guami_s *guami; + int purge_flag; + char *pei; + struct OpenAPI_ims_vo_ps_s *ims_vo_ps; + OpenAPI_list_t *backup_amf_info; +} OpenAPI_amf_non3_gpp_access_registration_modification_t; + +OpenAPI_amf_non3_gpp_access_registration_modification_t *OpenAPI_amf_non3_gpp_access_registration_modification_create( + OpenAPI_guami_t *guami, + int purge_flag, + char *pei, + OpenAPI_ims_vo_ps_t *ims_vo_ps, + OpenAPI_list_t *backup_amf_info + ); +void OpenAPI_amf_non3_gpp_access_registration_modification_free(OpenAPI_amf_non3_gpp_access_registration_modification_t *amf_non3_gpp_access_registration_modification); +OpenAPI_amf_non3_gpp_access_registration_modification_t *OpenAPI_amf_non3_gpp_access_registration_modification_parseFromJSON(cJSON *amf_non3_gpp_access_registration_modificationJSON); +cJSON *OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON(OpenAPI_amf_non3_gpp_access_registration_modification_t *amf_non3_gpp_access_registration_modification); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_amf_non3_gpp_access_registration_modification_H_ */ + diff --git a/lib/sbi/openapi/model/amf_subscription_info.c b/lib/sbi/openapi/model/amf_subscription_info.c new file mode 100644 index 0000000000..66b86736c7 --- /dev/null +++ b/lib/sbi/openapi/model/amf_subscription_info.c @@ -0,0 +1,121 @@ + +#include +#include +#include +#include "amf_subscription_info.h" + +OpenAPI_amf_subscription_info_t *OpenAPI_amf_subscription_info_create( + char *amf_instance_id, + char *subscription_id, + char *subs_change_notify_correlation_id + ) +{ + OpenAPI_amf_subscription_info_t *amf_subscription_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_amf_subscription_info_t)); + if (!amf_subscription_info_local_var) { + return NULL; + } + amf_subscription_info_local_var->amf_instance_id = amf_instance_id; + amf_subscription_info_local_var->subscription_id = subscription_id; + amf_subscription_info_local_var->subs_change_notify_correlation_id = subs_change_notify_correlation_id; + + return amf_subscription_info_local_var; +} + +void OpenAPI_amf_subscription_info_free(OpenAPI_amf_subscription_info_t *amf_subscription_info) +{ + if (NULL == amf_subscription_info) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(amf_subscription_info->amf_instance_id); + ogs_free(amf_subscription_info->subscription_id); + ogs_free(amf_subscription_info->subs_change_notify_correlation_id); + ogs_free(amf_subscription_info); +} + +cJSON *OpenAPI_amf_subscription_info_convertToJSON(OpenAPI_amf_subscription_info_t *amf_subscription_info) +{ + cJSON *item = NULL; + + if (amf_subscription_info == NULL) { + ogs_error("OpenAPI_amf_subscription_info_convertToJSON() failed [AmfSubscriptionInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!amf_subscription_info->amf_instance_id) { + ogs_error("OpenAPI_amf_subscription_info_convertToJSON() failed [amf_instance_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "amfInstanceId", amf_subscription_info->amf_instance_id) == NULL) { + ogs_error("OpenAPI_amf_subscription_info_convertToJSON() failed [amf_instance_id]"); + goto end; + } + + if (!amf_subscription_info->subscription_id) { + ogs_error("OpenAPI_amf_subscription_info_convertToJSON() failed [subscription_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "subscriptionId", amf_subscription_info->subscription_id) == NULL) { + ogs_error("OpenAPI_amf_subscription_info_convertToJSON() failed [subscription_id]"); + goto end; + } + + if (amf_subscription_info->subs_change_notify_correlation_id) { + if (cJSON_AddStringToObject(item, "subsChangeNotifyCorrelationId", amf_subscription_info->subs_change_notify_correlation_id) == NULL) { + ogs_error("OpenAPI_amf_subscription_info_convertToJSON() failed [subs_change_notify_correlation_id]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_amf_subscription_info_t *OpenAPI_amf_subscription_info_parseFromJSON(cJSON *amf_subscription_infoJSON) +{ + OpenAPI_amf_subscription_info_t *amf_subscription_info_local_var = NULL; + cJSON *amf_instance_id = cJSON_GetObjectItemCaseSensitive(amf_subscription_infoJSON, "amfInstanceId"); + if (!amf_instance_id) { + ogs_error("OpenAPI_amf_subscription_info_parseFromJSON() failed [amf_instance_id]"); + goto end; + } + + + if (!cJSON_IsString(amf_instance_id)) { + ogs_error("OpenAPI_amf_subscription_info_parseFromJSON() failed [amf_instance_id]"); + goto end; + } + + cJSON *subscription_id = cJSON_GetObjectItemCaseSensitive(amf_subscription_infoJSON, "subscriptionId"); + if (!subscription_id) { + ogs_error("OpenAPI_amf_subscription_info_parseFromJSON() failed [subscription_id]"); + goto end; + } + + + if (!cJSON_IsString(subscription_id)) { + ogs_error("OpenAPI_amf_subscription_info_parseFromJSON() failed [subscription_id]"); + goto end; + } + + cJSON *subs_change_notify_correlation_id = cJSON_GetObjectItemCaseSensitive(amf_subscription_infoJSON, "subsChangeNotifyCorrelationId"); + + if (subs_change_notify_correlation_id) { + if (!cJSON_IsString(subs_change_notify_correlation_id)) { + ogs_error("OpenAPI_amf_subscription_info_parseFromJSON() failed [subs_change_notify_correlation_id]"); + goto end; + } + } + + amf_subscription_info_local_var = OpenAPI_amf_subscription_info_create ( + ogs_strdup(amf_instance_id->valuestring), + ogs_strdup(subscription_id->valuestring), + subs_change_notify_correlation_id ? ogs_strdup(subs_change_notify_correlation_id->valuestring) : NULL + ); + + return amf_subscription_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/amf_subscription_info.h b/lib/sbi/openapi/model/amf_subscription_info.h new file mode 100644 index 0000000000..ff3d9416cb --- /dev/null +++ b/lib/sbi/openapi/model/amf_subscription_info.h @@ -0,0 +1,41 @@ +/* + * amf_subscription_info.h + * + * + */ + +#ifndef _OpenAPI_amf_subscription_info_H_ +#define _OpenAPI_amf_subscription_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_amf_subscription_info_s OpenAPI_amf_subscription_info_t; +typedef struct OpenAPI_amf_subscription_info_s { + char *amf_instance_id; + char *subscription_id; + char *subs_change_notify_correlation_id; +} OpenAPI_amf_subscription_info_t; + +OpenAPI_amf_subscription_info_t *OpenAPI_amf_subscription_info_create( + char *amf_instance_id, + char *subscription_id, + char *subs_change_notify_correlation_id + ); +void OpenAPI_amf_subscription_info_free(OpenAPI_amf_subscription_info_t *amf_subscription_info); +OpenAPI_amf_subscription_info_t *OpenAPI_amf_subscription_info_parseFromJSON(cJSON *amf_subscription_infoJSON); +cJSON *OpenAPI_amf_subscription_info_convertToJSON(OpenAPI_amf_subscription_info_t *amf_subscription_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_amf_subscription_info_H_ */ + diff --git a/lib/sbi/openapi/model/an_node_type.c b/lib/sbi/openapi/model/an_node_type.c new file mode 100644 index 0000000000..7c13aebfdc --- /dev/null +++ b/lib/sbi/openapi/model/an_node_type.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "an_node_type.h" + +OpenAPI_an_node_type_t *OpenAPI_an_node_type_create( + ) +{ + 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; +} + +void OpenAPI_an_node_type_free(OpenAPI_an_node_type_t *an_node_type) +{ + if (NULL == an_node_type) { + return; + } + 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; +} + diff --git a/lib/sbi/openapi/model/an_node_type.h b/lib/sbi/openapi/model/an_node_type.h new file mode 100644 index 0000000000..096453bca2 --- /dev/null +++ b/lib/sbi/openapi/model/an_node_type.h @@ -0,0 +1,35 @@ +/* + * an_node_type.h + * + * + */ + +#ifndef _OpenAPI_an_node_type_H_ +#define _OpenAPI_an_node_type_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +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; + +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); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_an_node_type_H_ */ + diff --git a/lib/sbi/openapi/model/app_descriptor.c b/lib/sbi/openapi/model/app_descriptor.c new file mode 100644 index 0000000000..6e1e74141f --- /dev/null +++ b/lib/sbi/openapi/model/app_descriptor.c @@ -0,0 +1,91 @@ + +#include +#include +#include +#include "app_descriptor.h" + +OpenAPI_app_descriptor_t *OpenAPI_app_descriptor_create( + char *os_id, + char *app_id + ) +{ + OpenAPI_app_descriptor_t *app_descriptor_local_var = OpenAPI_malloc(sizeof(OpenAPI_app_descriptor_t)); + if (!app_descriptor_local_var) { + return NULL; + } + app_descriptor_local_var->os_id = os_id; + app_descriptor_local_var->app_id = app_id; + + return app_descriptor_local_var; +} + +void OpenAPI_app_descriptor_free(OpenAPI_app_descriptor_t *app_descriptor) +{ + if (NULL == app_descriptor) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(app_descriptor->os_id); + ogs_free(app_descriptor->app_id); + ogs_free(app_descriptor); +} + +cJSON *OpenAPI_app_descriptor_convertToJSON(OpenAPI_app_descriptor_t *app_descriptor) +{ + cJSON *item = NULL; + + if (app_descriptor == NULL) { + ogs_error("OpenAPI_app_descriptor_convertToJSON() failed [AppDescriptor]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (app_descriptor->os_id) { + if (cJSON_AddStringToObject(item, "osId", app_descriptor->os_id) == NULL) { + ogs_error("OpenAPI_app_descriptor_convertToJSON() failed [os_id]"); + goto end; + } + } + + if (app_descriptor->app_id) { + if (cJSON_AddStringToObject(item, "appId", app_descriptor->app_id) == NULL) { + ogs_error("OpenAPI_app_descriptor_convertToJSON() failed [app_id]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_app_descriptor_t *OpenAPI_app_descriptor_parseFromJSON(cJSON *app_descriptorJSON) +{ + OpenAPI_app_descriptor_t *app_descriptor_local_var = NULL; + cJSON *os_id = cJSON_GetObjectItemCaseSensitive(app_descriptorJSON, "osId"); + + if (os_id) { + if (!cJSON_IsString(os_id)) { + ogs_error("OpenAPI_app_descriptor_parseFromJSON() failed [os_id]"); + goto end; + } + } + + cJSON *app_id = cJSON_GetObjectItemCaseSensitive(app_descriptorJSON, "appId"); + + if (app_id) { + if (!cJSON_IsString(app_id)) { + ogs_error("OpenAPI_app_descriptor_parseFromJSON() failed [app_id]"); + goto end; + } + } + + app_descriptor_local_var = OpenAPI_app_descriptor_create ( + os_id ? ogs_strdup(os_id->valuestring) : NULL, + app_id ? ogs_strdup(app_id->valuestring) : NULL + ); + + return app_descriptor_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/app_descriptor.h b/lib/sbi/openapi/model/app_descriptor.h new file mode 100644 index 0000000000..78f8daa9e4 --- /dev/null +++ b/lib/sbi/openapi/model/app_descriptor.h @@ -0,0 +1,39 @@ +/* + * app_descriptor.h + * + * + */ + +#ifndef _OpenAPI_app_descriptor_H_ +#define _OpenAPI_app_descriptor_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_app_descriptor_s OpenAPI_app_descriptor_t; +typedef struct OpenAPI_app_descriptor_s { + char *os_id; + char *app_id; +} OpenAPI_app_descriptor_t; + +OpenAPI_app_descriptor_t *OpenAPI_app_descriptor_create( + char *os_id, + char *app_id + ); +void OpenAPI_app_descriptor_free(OpenAPI_app_descriptor_t *app_descriptor); +OpenAPI_app_descriptor_t *OpenAPI_app_descriptor_parseFromJSON(cJSON *app_descriptorJSON); +cJSON *OpenAPI_app_descriptor_convertToJSON(OpenAPI_app_descriptor_t *app_descriptor); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_app_descriptor_H_ */ + diff --git a/lib/sbi/openapi/model/app_port_id.c b/lib/sbi/openapi/model/app_port_id.c new file mode 100644 index 0000000000..055edf340c --- /dev/null +++ b/lib/sbi/openapi/model/app_port_id.c @@ -0,0 +1,89 @@ + +#include +#include +#include +#include "app_port_id.h" + +OpenAPI_app_port_id_t *OpenAPI_app_port_id_create( + int destination_port, + int originator_port + ) +{ + OpenAPI_app_port_id_t *app_port_id_local_var = OpenAPI_malloc(sizeof(OpenAPI_app_port_id_t)); + if (!app_port_id_local_var) { + return NULL; + } + app_port_id_local_var->destination_port = destination_port; + app_port_id_local_var->originator_port = originator_port; + + return app_port_id_local_var; +} + +void OpenAPI_app_port_id_free(OpenAPI_app_port_id_t *app_port_id) +{ + if (NULL == app_port_id) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(app_port_id); +} + +cJSON *OpenAPI_app_port_id_convertToJSON(OpenAPI_app_port_id_t *app_port_id) +{ + cJSON *item = NULL; + + if (app_port_id == NULL) { + ogs_error("OpenAPI_app_port_id_convertToJSON() failed [AppPortId]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (app_port_id->destination_port) { + if (cJSON_AddNumberToObject(item, "destinationPort", app_port_id->destination_port) == NULL) { + ogs_error("OpenAPI_app_port_id_convertToJSON() failed [destination_port]"); + goto end; + } + } + + if (app_port_id->originator_port) { + if (cJSON_AddNumberToObject(item, "originatorPort", app_port_id->originator_port) == NULL) { + ogs_error("OpenAPI_app_port_id_convertToJSON() failed [originator_port]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_app_port_id_t *OpenAPI_app_port_id_parseFromJSON(cJSON *app_port_idJSON) +{ + OpenAPI_app_port_id_t *app_port_id_local_var = NULL; + cJSON *destination_port = cJSON_GetObjectItemCaseSensitive(app_port_idJSON, "destinationPort"); + + if (destination_port) { + if (!cJSON_IsNumber(destination_port)) { + ogs_error("OpenAPI_app_port_id_parseFromJSON() failed [destination_port]"); + goto end; + } + } + + cJSON *originator_port = cJSON_GetObjectItemCaseSensitive(app_port_idJSON, "originatorPort"); + + if (originator_port) { + if (!cJSON_IsNumber(originator_port)) { + ogs_error("OpenAPI_app_port_id_parseFromJSON() failed [originator_port]"); + goto end; + } + } + + app_port_id_local_var = OpenAPI_app_port_id_create ( + destination_port ? destination_port->valuedouble : 0, + originator_port ? originator_port->valuedouble : 0 + ); + + return app_port_id_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/app_port_id.h b/lib/sbi/openapi/model/app_port_id.h new file mode 100644 index 0000000000..91717c4d8e --- /dev/null +++ b/lib/sbi/openapi/model/app_port_id.h @@ -0,0 +1,39 @@ +/* + * app_port_id.h + * + * + */ + +#ifndef _OpenAPI_app_port_id_H_ +#define _OpenAPI_app_port_id_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_app_port_id_s OpenAPI_app_port_id_t; +typedef struct OpenAPI_app_port_id_s { + int destination_port; + int originator_port; +} OpenAPI_app_port_id_t; + +OpenAPI_app_port_id_t *OpenAPI_app_port_id_create( + int destination_port, + int originator_port + ); +void OpenAPI_app_port_id_free(OpenAPI_app_port_id_t *app_port_id); +OpenAPI_app_port_id_t *OpenAPI_app_port_id_parseFromJSON(cJSON *app_port_idJSON); +cJSON *OpenAPI_app_port_id_convertToJSON(OpenAPI_app_port_id_t *app_port_id); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_app_port_id_H_ */ + diff --git a/lib/sbi/openapi/model/application_data_change_notif.c b/lib/sbi/openapi/model/application_data_change_notif.c new file mode 100644 index 0000000000..6c0d28a3ee --- /dev/null +++ b/lib/sbi/openapi/model/application_data_change_notif.c @@ -0,0 +1,172 @@ + +#include +#include +#include +#include "application_data_change_notif.h" + +OpenAPI_application_data_change_notif_t *OpenAPI_application_data_change_notif_create( + OpenAPI_iptv_config_data_t *iptv_config_data, + OpenAPI_pfd_change_notification_t *pfd_data, + OpenAPI_bdt_policy_data_t *bdt_policy_data, + char *res_uri, + OpenAPI_service_parameter_data_t *ser_param_data + ) +{ + OpenAPI_application_data_change_notif_t *application_data_change_notif_local_var = OpenAPI_malloc(sizeof(OpenAPI_application_data_change_notif_t)); + if (!application_data_change_notif_local_var) { + return NULL; + } + application_data_change_notif_local_var->iptv_config_data = iptv_config_data; + application_data_change_notif_local_var->pfd_data = pfd_data; + application_data_change_notif_local_var->bdt_policy_data = bdt_policy_data; + application_data_change_notif_local_var->res_uri = res_uri; + application_data_change_notif_local_var->ser_param_data = ser_param_data; + + return application_data_change_notif_local_var; +} + +void OpenAPI_application_data_change_notif_free(OpenAPI_application_data_change_notif_t *application_data_change_notif) +{ + if (NULL == application_data_change_notif) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_iptv_config_data_free(application_data_change_notif->iptv_config_data); + OpenAPI_pfd_change_notification_free(application_data_change_notif->pfd_data); + OpenAPI_bdt_policy_data_free(application_data_change_notif->bdt_policy_data); + ogs_free(application_data_change_notif->res_uri); + OpenAPI_service_parameter_data_free(application_data_change_notif->ser_param_data); + ogs_free(application_data_change_notif); +} + +cJSON *OpenAPI_application_data_change_notif_convertToJSON(OpenAPI_application_data_change_notif_t *application_data_change_notif) +{ + cJSON *item = NULL; + + if (application_data_change_notif == NULL) { + ogs_error("OpenAPI_application_data_change_notif_convertToJSON() failed [ApplicationDataChangeNotif]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (application_data_change_notif->iptv_config_data) { + cJSON *iptv_config_data_local_JSON = OpenAPI_iptv_config_data_convertToJSON(application_data_change_notif->iptv_config_data); + if (iptv_config_data_local_JSON == NULL) { + ogs_error("OpenAPI_application_data_change_notif_convertToJSON() failed [iptv_config_data]"); + goto end; + } + cJSON_AddItemToObject(item, "iptvConfigData", iptv_config_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_application_data_change_notif_convertToJSON() failed [iptv_config_data]"); + goto end; + } + } + + if (application_data_change_notif->pfd_data) { + cJSON *pfd_data_local_JSON = OpenAPI_pfd_change_notification_convertToJSON(application_data_change_notif->pfd_data); + if (pfd_data_local_JSON == NULL) { + ogs_error("OpenAPI_application_data_change_notif_convertToJSON() failed [pfd_data]"); + goto end; + } + cJSON_AddItemToObject(item, "pfdData", pfd_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_application_data_change_notif_convertToJSON() failed [pfd_data]"); + goto end; + } + } + + if (application_data_change_notif->bdt_policy_data) { + cJSON *bdt_policy_data_local_JSON = OpenAPI_bdt_policy_data_convertToJSON(application_data_change_notif->bdt_policy_data); + if (bdt_policy_data_local_JSON == NULL) { + ogs_error("OpenAPI_application_data_change_notif_convertToJSON() failed [bdt_policy_data]"); + goto end; + } + cJSON_AddItemToObject(item, "bdtPolicyData", bdt_policy_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_application_data_change_notif_convertToJSON() failed [bdt_policy_data]"); + goto end; + } + } + + if (!application_data_change_notif->res_uri) { + ogs_error("OpenAPI_application_data_change_notif_convertToJSON() failed [res_uri]"); + goto end; + } + if (cJSON_AddStringToObject(item, "resUri", application_data_change_notif->res_uri) == NULL) { + ogs_error("OpenAPI_application_data_change_notif_convertToJSON() failed [res_uri]"); + goto end; + } + + if (application_data_change_notif->ser_param_data) { + cJSON *ser_param_data_local_JSON = OpenAPI_service_parameter_data_convertToJSON(application_data_change_notif->ser_param_data); + if (ser_param_data_local_JSON == NULL) { + ogs_error("OpenAPI_application_data_change_notif_convertToJSON() failed [ser_param_data]"); + goto end; + } + cJSON_AddItemToObject(item, "serParamData", ser_param_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_application_data_change_notif_convertToJSON() failed [ser_param_data]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_application_data_change_notif_t *OpenAPI_application_data_change_notif_parseFromJSON(cJSON *application_data_change_notifJSON) +{ + OpenAPI_application_data_change_notif_t *application_data_change_notif_local_var = NULL; + cJSON *iptv_config_data = cJSON_GetObjectItemCaseSensitive(application_data_change_notifJSON, "iptvConfigData"); + + OpenAPI_iptv_config_data_t *iptv_config_data_local_nonprim = NULL; + if (iptv_config_data) { + iptv_config_data_local_nonprim = OpenAPI_iptv_config_data_parseFromJSON(iptv_config_data); + } + + cJSON *pfd_data = cJSON_GetObjectItemCaseSensitive(application_data_change_notifJSON, "pfdData"); + + OpenAPI_pfd_change_notification_t *pfd_data_local_nonprim = NULL; + if (pfd_data) { + pfd_data_local_nonprim = OpenAPI_pfd_change_notification_parseFromJSON(pfd_data); + } + + cJSON *bdt_policy_data = cJSON_GetObjectItemCaseSensitive(application_data_change_notifJSON, "bdtPolicyData"); + + OpenAPI_bdt_policy_data_t *bdt_policy_data_local_nonprim = NULL; + if (bdt_policy_data) { + bdt_policy_data_local_nonprim = OpenAPI_bdt_policy_data_parseFromJSON(bdt_policy_data); + } + + cJSON *res_uri = cJSON_GetObjectItemCaseSensitive(application_data_change_notifJSON, "resUri"); + if (!res_uri) { + ogs_error("OpenAPI_application_data_change_notif_parseFromJSON() failed [res_uri]"); + goto end; + } + + + if (!cJSON_IsString(res_uri)) { + ogs_error("OpenAPI_application_data_change_notif_parseFromJSON() failed [res_uri]"); + goto end; + } + + cJSON *ser_param_data = cJSON_GetObjectItemCaseSensitive(application_data_change_notifJSON, "serParamData"); + + OpenAPI_service_parameter_data_t *ser_param_data_local_nonprim = NULL; + if (ser_param_data) { + ser_param_data_local_nonprim = OpenAPI_service_parameter_data_parseFromJSON(ser_param_data); + } + + application_data_change_notif_local_var = OpenAPI_application_data_change_notif_create ( + iptv_config_data ? iptv_config_data_local_nonprim : NULL, + pfd_data ? pfd_data_local_nonprim : NULL, + bdt_policy_data ? bdt_policy_data_local_nonprim : NULL, + ogs_strdup(res_uri->valuestring), + ser_param_data ? ser_param_data_local_nonprim : NULL + ); + + return application_data_change_notif_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/application_data_change_notif.h b/lib/sbi/openapi/model/application_data_change_notif.h new file mode 100644 index 0000000000..6e1cb290a5 --- /dev/null +++ b/lib/sbi/openapi/model/application_data_change_notif.h @@ -0,0 +1,49 @@ +/* + * application_data_change_notif.h + * + * Contains changed application data for which notification was requested. + */ + +#ifndef _OpenAPI_application_data_change_notif_H_ +#define _OpenAPI_application_data_change_notif_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "bdt_policy_data.h" +#include "iptv_config_data.h" +#include "pfd_change_notification.h" +#include "service_parameter_data.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_application_data_change_notif_s OpenAPI_application_data_change_notif_t; +typedef struct OpenAPI_application_data_change_notif_s { + struct OpenAPI_iptv_config_data_s *iptv_config_data; + struct OpenAPI_pfd_change_notification_s *pfd_data; + struct OpenAPI_bdt_policy_data_s *bdt_policy_data; + char *res_uri; + struct OpenAPI_service_parameter_data_s *ser_param_data; +} OpenAPI_application_data_change_notif_t; + +OpenAPI_application_data_change_notif_t *OpenAPI_application_data_change_notif_create( + OpenAPI_iptv_config_data_t *iptv_config_data, + OpenAPI_pfd_change_notification_t *pfd_data, + OpenAPI_bdt_policy_data_t *bdt_policy_data, + char *res_uri, + OpenAPI_service_parameter_data_t *ser_param_data + ); +void OpenAPI_application_data_change_notif_free(OpenAPI_application_data_change_notif_t *application_data_change_notif); +OpenAPI_application_data_change_notif_t *OpenAPI_application_data_change_notif_parseFromJSON(cJSON *application_data_change_notifJSON); +cJSON *OpenAPI_application_data_change_notif_convertToJSON(OpenAPI_application_data_change_notif_t *application_data_change_notif); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_application_data_change_notif_H_ */ + diff --git a/lib/sbi/openapi/model/application_data_subs.c b/lib/sbi/openapi/model/application_data_subs.c new file mode 100644 index 0000000000..e7e32da642 --- /dev/null +++ b/lib/sbi/openapi/model/application_data_subs.c @@ -0,0 +1,166 @@ + +#include +#include +#include +#include "application_data_subs.h" + +OpenAPI_application_data_subs_t *OpenAPI_application_data_subs_create( + char *notification_uri, + OpenAPI_list_t *data_filters, + char *expiry, + char *supported_features + ) +{ + OpenAPI_application_data_subs_t *application_data_subs_local_var = OpenAPI_malloc(sizeof(OpenAPI_application_data_subs_t)); + if (!application_data_subs_local_var) { + return NULL; + } + application_data_subs_local_var->notification_uri = notification_uri; + application_data_subs_local_var->data_filters = data_filters; + application_data_subs_local_var->expiry = expiry; + application_data_subs_local_var->supported_features = supported_features; + + return application_data_subs_local_var; +} + +void OpenAPI_application_data_subs_free(OpenAPI_application_data_subs_t *application_data_subs) +{ + if (NULL == application_data_subs) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(application_data_subs->notification_uri); + OpenAPI_list_for_each(application_data_subs->data_filters, node) { + OpenAPI_data_filter_free(node->data); + } + OpenAPI_list_free(application_data_subs->data_filters); + ogs_free(application_data_subs->expiry); + ogs_free(application_data_subs->supported_features); + ogs_free(application_data_subs); +} + +cJSON *OpenAPI_application_data_subs_convertToJSON(OpenAPI_application_data_subs_t *application_data_subs) +{ + cJSON *item = NULL; + + if (application_data_subs == NULL) { + ogs_error("OpenAPI_application_data_subs_convertToJSON() failed [ApplicationDataSubs]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!application_data_subs->notification_uri) { + ogs_error("OpenAPI_application_data_subs_convertToJSON() failed [notification_uri]"); + goto end; + } + if (cJSON_AddStringToObject(item, "notificationUri", application_data_subs->notification_uri) == NULL) { + ogs_error("OpenAPI_application_data_subs_convertToJSON() failed [notification_uri]"); + goto end; + } + + if (application_data_subs->data_filters) { + cJSON *data_filtersList = cJSON_AddArrayToObject(item, "dataFilters"); + if (data_filtersList == NULL) { + ogs_error("OpenAPI_application_data_subs_convertToJSON() failed [data_filters]"); + goto end; + } + + OpenAPI_lnode_t *data_filters_node; + if (application_data_subs->data_filters) { + OpenAPI_list_for_each(application_data_subs->data_filters, data_filters_node) { + cJSON *itemLocal = OpenAPI_data_filter_convertToJSON(data_filters_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_application_data_subs_convertToJSON() failed [data_filters]"); + goto end; + } + cJSON_AddItemToArray(data_filtersList, itemLocal); + } + } + } + + if (application_data_subs->expiry) { + if (cJSON_AddStringToObject(item, "expiry", application_data_subs->expiry) == NULL) { + ogs_error("OpenAPI_application_data_subs_convertToJSON() failed [expiry]"); + goto end; + } + } + + if (application_data_subs->supported_features) { + if (cJSON_AddStringToObject(item, "supportedFeatures", application_data_subs->supported_features) == NULL) { + ogs_error("OpenAPI_application_data_subs_convertToJSON() failed [supported_features]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_application_data_subs_t *OpenAPI_application_data_subs_parseFromJSON(cJSON *application_data_subsJSON) +{ + OpenAPI_application_data_subs_t *application_data_subs_local_var = NULL; + cJSON *notification_uri = cJSON_GetObjectItemCaseSensitive(application_data_subsJSON, "notificationUri"); + if (!notification_uri) { + ogs_error("OpenAPI_application_data_subs_parseFromJSON() failed [notification_uri]"); + goto end; + } + + + if (!cJSON_IsString(notification_uri)) { + ogs_error("OpenAPI_application_data_subs_parseFromJSON() failed [notification_uri]"); + goto end; + } + + cJSON *data_filters = cJSON_GetObjectItemCaseSensitive(application_data_subsJSON, "dataFilters"); + + OpenAPI_list_t *data_filtersList; + if (data_filters) { + cJSON *data_filters_local_nonprimitive; + if (!cJSON_IsArray(data_filters)) { + ogs_error("OpenAPI_application_data_subs_parseFromJSON() failed [data_filters]"); + goto end; + } + + data_filtersList = OpenAPI_list_create(); + + cJSON_ArrayForEach(data_filters_local_nonprimitive, data_filters ) { + if (!cJSON_IsObject(data_filters_local_nonprimitive)) { + ogs_error("OpenAPI_application_data_subs_parseFromJSON() failed [data_filters]"); + goto end; + } + OpenAPI_data_filter_t *data_filtersItem = OpenAPI_data_filter_parseFromJSON(data_filters_local_nonprimitive); + + OpenAPI_list_add(data_filtersList, data_filtersItem); + } + } + + cJSON *expiry = cJSON_GetObjectItemCaseSensitive(application_data_subsJSON, "expiry"); + + if (expiry) { + if (!cJSON_IsString(expiry)) { + ogs_error("OpenAPI_application_data_subs_parseFromJSON() failed [expiry]"); + goto end; + } + } + + cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(application_data_subsJSON, "supportedFeatures"); + + if (supported_features) { + if (!cJSON_IsString(supported_features)) { + ogs_error("OpenAPI_application_data_subs_parseFromJSON() failed [supported_features]"); + goto end; + } + } + + application_data_subs_local_var = OpenAPI_application_data_subs_create ( + ogs_strdup(notification_uri->valuestring), + data_filters ? data_filtersList : NULL, + expiry ? ogs_strdup(expiry->valuestring) : NULL, + supported_features ? ogs_strdup(supported_features->valuestring) : NULL + ); + + return application_data_subs_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/application_data_subs.h b/lib/sbi/openapi/model/application_data_subs.h new file mode 100644 index 0000000000..6b86f44d9b --- /dev/null +++ b/lib/sbi/openapi/model/application_data_subs.h @@ -0,0 +1,44 @@ +/* + * application_data_subs.h + * + * Identifies a subscription to application data change notification. + */ + +#ifndef _OpenAPI_application_data_subs_H_ +#define _OpenAPI_application_data_subs_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "data_filter.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_application_data_subs_s OpenAPI_application_data_subs_t; +typedef struct OpenAPI_application_data_subs_s { + char *notification_uri; + OpenAPI_list_t *data_filters; + char *expiry; + char *supported_features; +} OpenAPI_application_data_subs_t; + +OpenAPI_application_data_subs_t *OpenAPI_application_data_subs_create( + char *notification_uri, + OpenAPI_list_t *data_filters, + char *expiry, + char *supported_features + ); +void OpenAPI_application_data_subs_free(OpenAPI_application_data_subs_t *application_data_subs); +OpenAPI_application_data_subs_t *OpenAPI_application_data_subs_parseFromJSON(cJSON *application_data_subsJSON); +cJSON *OpenAPI_application_data_subs_convertToJSON(OpenAPI_application_data_subs_t *application_data_subs); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_application_data_subs_H_ */ + diff --git a/lib/sbi/openapi/model/area.c b/lib/sbi/openapi/model/area.c new file mode 100644 index 0000000000..76edd9bc5f --- /dev/null +++ b/lib/sbi/openapi/model/area.c @@ -0,0 +1,114 @@ + +#include +#include +#include +#include "area.h" + +OpenAPI_area_t *OpenAPI_area_create( + OpenAPI_list_t *tacs, + char *area_code + ) +{ + OpenAPI_area_t *area_local_var = OpenAPI_malloc(sizeof(OpenAPI_area_t)); + if (!area_local_var) { + return NULL; + } + area_local_var->tacs = tacs; + area_local_var->area_code = area_code; + + return area_local_var; +} + +void OpenAPI_area_free(OpenAPI_area_t *area) +{ + if (NULL == area) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(area->tacs, node) { + ogs_free(node->data); + } + OpenAPI_list_free(area->tacs); + ogs_free(area->area_code); + ogs_free(area); +} + +cJSON *OpenAPI_area_convertToJSON(OpenAPI_area_t *area) +{ + cJSON *item = NULL; + + if (area == NULL) { + ogs_error("OpenAPI_area_convertToJSON() failed [Area]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (area->tacs) { + cJSON *tacs = cJSON_AddArrayToObject(item, "tacs"); + if (tacs == NULL) { + ogs_error("OpenAPI_area_convertToJSON() failed [tacs]"); + goto end; + } + + OpenAPI_lnode_t *tacs_node; + OpenAPI_list_for_each(area->tacs, tacs_node) { + if (cJSON_AddStringToObject(tacs, "", (char*)tacs_node->data) == NULL) { + ogs_error("OpenAPI_area_convertToJSON() failed [tacs]"); + goto end; + } + } + } + + if (area->area_code) { + if (cJSON_AddStringToObject(item, "areaCode", area->area_code) == NULL) { + ogs_error("OpenAPI_area_convertToJSON() failed [area_code]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_area_t *OpenAPI_area_parseFromJSON(cJSON *areaJSON) +{ + OpenAPI_area_t *area_local_var = NULL; + cJSON *tacs = cJSON_GetObjectItemCaseSensitive(areaJSON, "tacs"); + + OpenAPI_list_t *tacsList; + if (tacs) { + cJSON *tacs_local; + if (!cJSON_IsArray(tacs)) { + ogs_error("OpenAPI_area_parseFromJSON() failed [tacs]"); + goto end; + } + tacsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tacs_local, tacs) { + if (!cJSON_IsString(tacs_local)) { + ogs_error("OpenAPI_area_parseFromJSON() failed [tacs]"); + goto end; + } + OpenAPI_list_add(tacsList, ogs_strdup(tacs_local->valuestring)); + } + } + + cJSON *area_code = cJSON_GetObjectItemCaseSensitive(areaJSON, "areaCode"); + + if (area_code) { + if (!cJSON_IsString(area_code)) { + ogs_error("OpenAPI_area_parseFromJSON() failed [area_code]"); + goto end; + } + } + + area_local_var = OpenAPI_area_create ( + tacs ? tacsList : NULL, + area_code ? ogs_strdup(area_code->valuestring) : NULL + ); + + return area_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/area.h b/lib/sbi/openapi/model/area.h new file mode 100644 index 0000000000..f97e2dad5c --- /dev/null +++ b/lib/sbi/openapi/model/area.h @@ -0,0 +1,39 @@ +/* + * area.h + * + * + */ + +#ifndef _OpenAPI_area_H_ +#define _OpenAPI_area_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_area_s OpenAPI_area_t; +typedef struct OpenAPI_area_s { + OpenAPI_list_t *tacs; + char *area_code; +} OpenAPI_area_t; + +OpenAPI_area_t *OpenAPI_area_create( + OpenAPI_list_t *tacs, + char *area_code + ); +void OpenAPI_area_free(OpenAPI_area_t *area); +OpenAPI_area_t *OpenAPI_area_parseFromJSON(cJSON *areaJSON); +cJSON *OpenAPI_area_convertToJSON(OpenAPI_area_t *area); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_area_H_ */ + diff --git a/lib/sbi/openapi/model/arp.c b/lib/sbi/openapi/model/arp.c new file mode 100644 index 0000000000..fc346b1829 --- /dev/null +++ b/lib/sbi/openapi/model/arp.c @@ -0,0 +1,133 @@ + +#include +#include +#include +#include "arp.h" + +OpenAPI_arp_t *OpenAPI_arp_create( + int priority_level, + OpenAPI_preemption_capability_t *preempt_cap, + OpenAPI_preemption_vulnerability_t *preempt_vuln + ) +{ + OpenAPI_arp_t *arp_local_var = OpenAPI_malloc(sizeof(OpenAPI_arp_t)); + if (!arp_local_var) { + return NULL; + } + arp_local_var->priority_level = priority_level; + arp_local_var->preempt_cap = preempt_cap; + arp_local_var->preempt_vuln = preempt_vuln; + + return arp_local_var; +} + +void OpenAPI_arp_free(OpenAPI_arp_t *arp) +{ + if (NULL == arp) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_preemption_capability_free(arp->preempt_cap); + OpenAPI_preemption_vulnerability_free(arp->preempt_vuln); + ogs_free(arp); +} + +cJSON *OpenAPI_arp_convertToJSON(OpenAPI_arp_t *arp) +{ + cJSON *item = NULL; + + if (arp == NULL) { + ogs_error("OpenAPI_arp_convertToJSON() failed [Arp]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!arp->priority_level) { + ogs_error("OpenAPI_arp_convertToJSON() failed [priority_level]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "priorityLevel", arp->priority_level) == NULL) { + ogs_error("OpenAPI_arp_convertToJSON() failed [priority_level]"); + goto end; + } + + if (!arp->preempt_cap) { + ogs_error("OpenAPI_arp_convertToJSON() failed [preempt_cap]"); + goto end; + } + cJSON *preempt_cap_local_JSON = OpenAPI_preemption_capability_convertToJSON(arp->preempt_cap); + if (preempt_cap_local_JSON == NULL) { + ogs_error("OpenAPI_arp_convertToJSON() failed [preempt_cap]"); + goto end; + } + cJSON_AddItemToObject(item, "preemptCap", preempt_cap_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_arp_convertToJSON() failed [preempt_cap]"); + goto end; + } + + if (!arp->preempt_vuln) { + ogs_error("OpenAPI_arp_convertToJSON() failed [preempt_vuln]"); + goto end; + } + cJSON *preempt_vuln_local_JSON = OpenAPI_preemption_vulnerability_convertToJSON(arp->preempt_vuln); + if (preempt_vuln_local_JSON == NULL) { + ogs_error("OpenAPI_arp_convertToJSON() failed [preempt_vuln]"); + goto end; + } + cJSON_AddItemToObject(item, "preemptVuln", preempt_vuln_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_arp_convertToJSON() failed [preempt_vuln]"); + goto end; + } + +end: + return item; +} + +OpenAPI_arp_t *OpenAPI_arp_parseFromJSON(cJSON *arpJSON) +{ + OpenAPI_arp_t *arp_local_var = NULL; + cJSON *priority_level = cJSON_GetObjectItemCaseSensitive(arpJSON, "priorityLevel"); + if (!priority_level) { + ogs_error("OpenAPI_arp_parseFromJSON() failed [priority_level]"); + goto end; + } + + + if (!cJSON_IsNumber(priority_level)) { + ogs_error("OpenAPI_arp_parseFromJSON() failed [priority_level]"); + goto end; + } + + cJSON *preempt_cap = cJSON_GetObjectItemCaseSensitive(arpJSON, "preemptCap"); + if (!preempt_cap) { + ogs_error("OpenAPI_arp_parseFromJSON() failed [preempt_cap]"); + goto end; + } + + OpenAPI_preemption_capability_t *preempt_cap_local_nonprim = NULL; + + preempt_cap_local_nonprim = OpenAPI_preemption_capability_parseFromJSON(preempt_cap); + + cJSON *preempt_vuln = cJSON_GetObjectItemCaseSensitive(arpJSON, "preemptVuln"); + if (!preempt_vuln) { + ogs_error("OpenAPI_arp_parseFromJSON() failed [preempt_vuln]"); + goto end; + } + + OpenAPI_preemption_vulnerability_t *preempt_vuln_local_nonprim = NULL; + + preempt_vuln_local_nonprim = OpenAPI_preemption_vulnerability_parseFromJSON(preempt_vuln); + + arp_local_var = OpenAPI_arp_create ( + priority_level->valuedouble, + preempt_cap_local_nonprim, + preempt_vuln_local_nonprim + ); + + return arp_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/arp.h b/lib/sbi/openapi/model/arp.h new file mode 100644 index 0000000000..154d4bbe4f --- /dev/null +++ b/lib/sbi/openapi/model/arp.h @@ -0,0 +1,43 @@ +/* + * arp.h + * + * + */ + +#ifndef _OpenAPI_arp_H_ +#define _OpenAPI_arp_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "preemption_capability.h" +#include "preemption_vulnerability.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_arp_s OpenAPI_arp_t; +typedef struct OpenAPI_arp_s { + int priority_level; + struct OpenAPI_preemption_capability_s *preempt_cap; + struct OpenAPI_preemption_vulnerability_s *preempt_vuln; +} OpenAPI_arp_t; + +OpenAPI_arp_t *OpenAPI_arp_create( + int priority_level, + OpenAPI_preemption_capability_t *preempt_cap, + OpenAPI_preemption_vulnerability_t *preempt_vuln + ); +void OpenAPI_arp_free(OpenAPI_arp_t *arp); +OpenAPI_arp_t *OpenAPI_arp_parseFromJSON(cJSON *arpJSON); +cJSON *OpenAPI_arp_convertToJSON(OpenAPI_arp_t *arp); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_arp_H_ */ + diff --git a/lib/sbi/openapi/model/association_type.c b/lib/sbi/openapi/model/association_type.c new file mode 100644 index 0000000000..b9acc3c193 --- /dev/null +++ b/lib/sbi/openapi/model/association_type.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "association_type.h" + +OpenAPI_association_type_t *OpenAPI_association_type_create( + ) +{ + OpenAPI_association_type_t *association_type_local_var = OpenAPI_malloc(sizeof(OpenAPI_association_type_t)); + if (!association_type_local_var) { + return NULL; + } + + return association_type_local_var; +} + +void OpenAPI_association_type_free(OpenAPI_association_type_t *association_type) +{ + if (NULL == association_type) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(association_type); +} + +cJSON *OpenAPI_association_type_convertToJSON(OpenAPI_association_type_t *association_type) +{ + cJSON *item = NULL; + + if (association_type == NULL) { + ogs_error("OpenAPI_association_type_convertToJSON() failed [AssociationType]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_association_type_t *OpenAPI_association_type_parseFromJSON(cJSON *association_typeJSON) +{ + OpenAPI_association_type_t *association_type_local_var = NULL; + association_type_local_var = OpenAPI_association_type_create ( + ); + + return association_type_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/association_type.h b/lib/sbi/openapi/model/association_type.h new file mode 100644 index 0000000000..a5fdacf593 --- /dev/null +++ b/lib/sbi/openapi/model/association_type.h @@ -0,0 +1,35 @@ +/* + * association_type.h + * + * + */ + +#ifndef _OpenAPI_association_type_H_ +#define _OpenAPI_association_type_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_association_type_s OpenAPI_association_type_t; +typedef struct OpenAPI_association_type_s { +} OpenAPI_association_type_t; + +OpenAPI_association_type_t *OpenAPI_association_type_create( + ); +void OpenAPI_association_type_free(OpenAPI_association_type_t *association_type); +OpenAPI_association_type_t *OpenAPI_association_type_parseFromJSON(cJSON *association_typeJSON); +cJSON *OpenAPI_association_type_convertToJSON(OpenAPI_association_type_t *association_type); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_association_type_H_ */ + diff --git a/lib/sbi/openapi/model/atom.c b/lib/sbi/openapi/model/atom.c index 86e59d5137..8b3206b0ad 100644 --- a/lib/sbi/openapi/model/atom.c +++ b/lib/sbi/openapi/model/atom.c @@ -60,7 +60,7 @@ cJSON *OpenAPI_atom_convertToJSON(OpenAPI_atom_t *atom) goto end; } - if (atom->negative) { + if (atom->negative >= 0) { if (cJSON_AddBoolToObject(item, "negative", atom->negative) == NULL) { ogs_error("OpenAPI_atom_convertToJSON() failed [negative]"); goto end; diff --git a/lib/sbi/openapi/model/atsss_capability.c b/lib/sbi/openapi/model/atsss_capability.c index 02acaa933f..55482d17b4 100644 --- a/lib/sbi/openapi/model/atsss_capability.c +++ b/lib/sbi/openapi/model/atsss_capability.c @@ -38,14 +38,14 @@ cJSON *OpenAPI_atsss_capability_convertToJSON(OpenAPI_atsss_capability_t *atsss_ } item = cJSON_CreateObject(); - if (atsss_capability->atsss_ll) { + if (atsss_capability->atsss_ll >= 0) { if (cJSON_AddBoolToObject(item, "atsssLL", atsss_capability->atsss_ll) == NULL) { ogs_error("OpenAPI_atsss_capability_convertToJSON() failed [atsss_ll]"); goto end; } } - if (atsss_capability->mptcp) { + if (atsss_capability->mptcp >= 0) { if (cJSON_AddBoolToObject(item, "mptcp", atsss_capability->mptcp) == NULL) { ogs_error("OpenAPI_atsss_capability_convertToJSON() failed [mptcp]"); goto end; diff --git a/lib/sbi/openapi/model/ausf_info.h b/lib/sbi/openapi/model/ausf_info.h index f06693787f..caef626c8c 100644 --- a/lib/sbi/openapi/model/ausf_info.h +++ b/lib/sbi/openapi/model/ausf_info.h @@ -1,7 +1,7 @@ /* * ausf_info.h * - * + * Information of an AUSF NF Instance */ #ifndef _OpenAPI_ausf_info_H_ diff --git a/lib/sbi/openapi/model/auth_event.c b/lib/sbi/openapi/model/auth_event.c new file mode 100644 index 0000000000..f7bc3bffa7 --- /dev/null +++ b/lib/sbi/openapi/model/auth_event.c @@ -0,0 +1,172 @@ + +#include +#include +#include +#include "auth_event.h" + +OpenAPI_auth_event_t *OpenAPI_auth_event_create( + char *nf_instance_id, + int success, + char *time_stamp, + OpenAPI_auth_type_e auth_type, + char *serving_network_name + ) +{ + OpenAPI_auth_event_t *auth_event_local_var = OpenAPI_malloc(sizeof(OpenAPI_auth_event_t)); + if (!auth_event_local_var) { + return NULL; + } + auth_event_local_var->nf_instance_id = nf_instance_id; + auth_event_local_var->success = success; + 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; + + return auth_event_local_var; +} + +void OpenAPI_auth_event_free(OpenAPI_auth_event_t *auth_event) +{ + if (NULL == auth_event) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(auth_event->nf_instance_id); + ogs_free(auth_event->time_stamp); + ogs_free(auth_event->serving_network_name); + ogs_free(auth_event); +} + +cJSON *OpenAPI_auth_event_convertToJSON(OpenAPI_auth_event_t *auth_event) +{ + cJSON *item = NULL; + + if (auth_event == NULL) { + ogs_error("OpenAPI_auth_event_convertToJSON() failed [AuthEvent]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!auth_event->nf_instance_id) { + ogs_error("OpenAPI_auth_event_convertToJSON() failed [nf_instance_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "nfInstanceId", auth_event->nf_instance_id) == NULL) { + ogs_error("OpenAPI_auth_event_convertToJSON() failed [nf_instance_id]"); + goto end; + } + + if (cJSON_AddBoolToObject(item, "success", auth_event->success) == NULL) { + ogs_error("OpenAPI_auth_event_convertToJSON() failed [success]"); + goto end; + } + + if (!auth_event->time_stamp) { + ogs_error("OpenAPI_auth_event_convertToJSON() failed [time_stamp]"); + goto end; + } + if (cJSON_AddStringToObject(item, "timeStamp", auth_event->time_stamp) == NULL) { + ogs_error("OpenAPI_auth_event_convertToJSON() failed [time_stamp]"); + goto end; + } + + if (!auth_event->auth_type) { + ogs_error("OpenAPI_auth_event_convertToJSON() failed [auth_type]"); + goto end; + } + if (cJSON_AddStringToObject(item, "authType", OpenAPI_auth_type_ToString(auth_event->auth_type)) == NULL) { + ogs_error("OpenAPI_auth_event_convertToJSON() failed [auth_type]"); + goto end; + } + + if (!auth_event->serving_network_name) { + ogs_error("OpenAPI_auth_event_convertToJSON() failed [serving_network_name]"); + goto end; + } + if (cJSON_AddStringToObject(item, "servingNetworkName", auth_event->serving_network_name) == NULL) { + ogs_error("OpenAPI_auth_event_convertToJSON() failed [serving_network_name]"); + goto end; + } + +end: + return item; +} + +OpenAPI_auth_event_t *OpenAPI_auth_event_parseFromJSON(cJSON *auth_eventJSON) +{ + OpenAPI_auth_event_t *auth_event_local_var = NULL; + cJSON *nf_instance_id = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "nfInstanceId"); + if (!nf_instance_id) { + ogs_error("OpenAPI_auth_event_parseFromJSON() failed [nf_instance_id]"); + goto end; + } + + + if (!cJSON_IsString(nf_instance_id)) { + ogs_error("OpenAPI_auth_event_parseFromJSON() failed [nf_instance_id]"); + goto end; + } + + cJSON *success = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "success"); + if (!success) { + ogs_error("OpenAPI_auth_event_parseFromJSON() failed [success]"); + goto end; + } + + + if (!cJSON_IsBool(success)) { + ogs_error("OpenAPI_auth_event_parseFromJSON() failed [success]"); + goto end; + } + + cJSON *time_stamp = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "timeStamp"); + if (!time_stamp) { + ogs_error("OpenAPI_auth_event_parseFromJSON() failed [time_stamp]"); + goto end; + } + + + if (!cJSON_IsString(time_stamp)) { + ogs_error("OpenAPI_auth_event_parseFromJSON() failed [time_stamp]"); + goto end; + } + + cJSON *auth_type = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "authType"); + if (!auth_type) { + ogs_error("OpenAPI_auth_event_parseFromJSON() failed [auth_type]"); + goto end; + } + + OpenAPI_auth_type_e auth_typeVariable; + + if (!cJSON_IsString(auth_type)) { + ogs_error("OpenAPI_auth_event_parseFromJSON() failed [auth_type]"); + goto end; + } + auth_typeVariable = OpenAPI_auth_type_FromString(auth_type->valuestring); + + cJSON *serving_network_name = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "servingNetworkName"); + if (!serving_network_name) { + ogs_error("OpenAPI_auth_event_parseFromJSON() failed [serving_network_name]"); + goto end; + } + + + if (!cJSON_IsString(serving_network_name)) { + ogs_error("OpenAPI_auth_event_parseFromJSON() failed [serving_network_name]"); + goto end; + } + + 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) + ); + + return auth_event_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/auth_event.h b/lib/sbi/openapi/model/auth_event.h new file mode 100644 index 0000000000..6726bc5dec --- /dev/null +++ b/lib/sbi/openapi/model/auth_event.h @@ -0,0 +1,46 @@ +/* + * auth_event.h + * + * + */ + +#ifndef _OpenAPI_auth_event_H_ +#define _OpenAPI_auth_event_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "auth_type.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_auth_event_s OpenAPI_auth_event_t; +typedef struct OpenAPI_auth_event_s { + char *nf_instance_id; + int success; + char *time_stamp; + OpenAPI_auth_type_e auth_type; + char *serving_network_name; +} OpenAPI_auth_event_t; + +OpenAPI_auth_event_t *OpenAPI_auth_event_create( + char *nf_instance_id, + int success, + char *time_stamp, + OpenAPI_auth_type_e auth_type, + char *serving_network_name + ); +void OpenAPI_auth_event_free(OpenAPI_auth_event_t *auth_event); +OpenAPI_auth_event_t *OpenAPI_auth_event_parseFromJSON(cJSON *auth_eventJSON); +cJSON *OpenAPI_auth_event_convertToJSON(OpenAPI_auth_event_t *auth_event); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_auth_event_H_ */ + diff --git a/lib/sbi/openapi/model/auth_method.c b/lib/sbi/openapi/model/auth_method.c new file mode 100644 index 0000000000..e0d3224e92 --- /dev/null +++ b/lib/sbi/openapi/model/auth_method.c @@ -0,0 +1,30 @@ + +#include +#include +#include +#include "auth_method.h" + +char* OpenAPI_auth_method_ToString(OpenAPI_auth_method_e auth_method) +{ + const char *auth_methodArray[] = { "NULL", "5G_AKA", "EAP_AKA_PRIME", "EAP_TLS" }; + size_t sizeofArray = sizeof(auth_methodArray) / sizeof(auth_methodArray[0]); + if (auth_method < sizeofArray) + return (char *)auth_methodArray[auth_method]; + else + return (char *)"Unknown"; +} + +OpenAPI_auth_method_e OpenAPI_auth_method_FromString(char* auth_method) +{ + int stringToReturn = 0; + const char *auth_methodArray[] = { "NULL", "5G_AKA", "EAP_AKA_PRIME", "EAP_TLS" }; + size_t sizeofArray = sizeof(auth_methodArray) / sizeof(auth_methodArray[0]); + while (stringToReturn < sizeofArray) { + if (strcmp(auth_method, auth_methodArray[stringToReturn]) == 0) { + return stringToReturn; + } + stringToReturn++; + } + return 0; +} + diff --git a/lib/sbi/openapi/model/auth_method.h b/lib/sbi/openapi/model/auth_method.h new file mode 100644 index 0000000000..30076f08c3 --- /dev/null +++ b/lib/sbi/openapi/model/auth_method.h @@ -0,0 +1,31 @@ +/* + * auth_method.h + * + * + */ + +#ifndef _OpenAPI_auth_method_H_ +#define _OpenAPI_auth_method_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { OpenAPI_auth_method_NULL = 0, OpenAPI_auth_method_5G_AKA, OpenAPI_auth_method_EAP_AKA_PRIME, OpenAPI_auth_method_EAP_TLS } OpenAPI_auth_method_e; + +char* OpenAPI_auth_method_ToString(OpenAPI_auth_method_e auth_method); + +OpenAPI_auth_method_e OpenAPI_auth_method_FromString(char* auth_method); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_auth_method_H_ */ + diff --git a/lib/sbi/openapi/model/auth_result.c b/lib/sbi/openapi/model/auth_result.c new file mode 100644 index 0000000000..1f535d466a --- /dev/null +++ b/lib/sbi/openapi/model/auth_result.c @@ -0,0 +1,30 @@ + +#include +#include +#include +#include "auth_result.h" + +char* OpenAPI_auth_result_ToString(OpenAPI_auth_result_e auth_result) +{ + const char *auth_resultArray[] = { "NULL", "AUTHENTICATION_SUCCESS", "AUTHENTICATION_FAILURE", "AUTHENTICATION_ONGOING" }; + size_t sizeofArray = sizeof(auth_resultArray) / sizeof(auth_resultArray[0]); + if (auth_result < sizeofArray) + return (char *)auth_resultArray[auth_result]; + else + return (char *)"Unknown"; +} + +OpenAPI_auth_result_e OpenAPI_auth_result_FromString(char* auth_result) +{ + int stringToReturn = 0; + const char *auth_resultArray[] = { "NULL", "AUTHENTICATION_SUCCESS", "AUTHENTICATION_FAILURE", "AUTHENTICATION_ONGOING" }; + size_t sizeofArray = sizeof(auth_resultArray) / sizeof(auth_resultArray[0]); + while (stringToReturn < sizeofArray) { + if (strcmp(auth_result, auth_resultArray[stringToReturn]) == 0) { + return stringToReturn; + } + stringToReturn++; + } + return 0; +} + diff --git a/lib/sbi/openapi/model/auth_result.h b/lib/sbi/openapi/model/auth_result.h new file mode 100644 index 0000000000..2aec16e3fe --- /dev/null +++ b/lib/sbi/openapi/model/auth_result.h @@ -0,0 +1,31 @@ +/* + * auth_result.h + * + * + */ + +#ifndef _OpenAPI_auth_result_H_ +#define _OpenAPI_auth_result_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { OpenAPI_auth_result_NULL = 0, OpenAPI_auth_result_AUTHENTICATION_SUCCESS, OpenAPI_auth_result_AUTHENTICATION_FAILURE, OpenAPI_auth_result_AUTHENTICATION_ONGOING } OpenAPI_auth_result_e; + +char* OpenAPI_auth_result_ToString(OpenAPI_auth_result_e auth_result); + +OpenAPI_auth_result_e OpenAPI_auth_result_FromString(char* auth_result); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_auth_result_H_ */ + diff --git a/lib/sbi/openapi/model/auth_type.c b/lib/sbi/openapi/model/auth_type.c new file mode 100644 index 0000000000..c5f24e75e4 --- /dev/null +++ b/lib/sbi/openapi/model/auth_type.c @@ -0,0 +1,30 @@ + +#include +#include +#include +#include "auth_type.h" + +char* OpenAPI_auth_type_ToString(OpenAPI_auth_type_e auth_type) +{ + const char *auth_typeArray[] = { "NULL", "5G_AKA", "EAP_AKA_PRIME", "EAP_TLS" }; + size_t sizeofArray = sizeof(auth_typeArray) / sizeof(auth_typeArray[0]); + if (auth_type < sizeofArray) + return (char *)auth_typeArray[auth_type]; + else + return (char *)"Unknown"; +} + +OpenAPI_auth_type_e OpenAPI_auth_type_FromString(char* auth_type) +{ + int stringToReturn = 0; + const char *auth_typeArray[] = { "NULL", "5G_AKA", "EAP_AKA_PRIME", "EAP_TLS" }; + size_t sizeofArray = sizeof(auth_typeArray) / sizeof(auth_typeArray[0]); + while (stringToReturn < sizeofArray) { + if (strcmp(auth_type, auth_typeArray[stringToReturn]) == 0) { + return stringToReturn; + } + stringToReturn++; + } + return 0; +} + diff --git a/lib/sbi/openapi/model/auth_type.h b/lib/sbi/openapi/model/auth_type.h new file mode 100644 index 0000000000..0282679bff --- /dev/null +++ b/lib/sbi/openapi/model/auth_type.h @@ -0,0 +1,31 @@ +/* + * auth_type.h + * + * + */ + +#ifndef _OpenAPI_auth_type_H_ +#define _OpenAPI_auth_type_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { OpenAPI_auth_type_NULL = 0, OpenAPI_auth_type_5G_AKA, OpenAPI_auth_type_EAP_AKA_PRIME, OpenAPI_auth_type_EAP_TLS } OpenAPI_auth_type_e; + +char* OpenAPI_auth_type_ToString(OpenAPI_auth_type_e auth_type); + +OpenAPI_auth_type_e OpenAPI_auth_type_FromString(char* auth_type); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_auth_type_H_ */ + diff --git a/lib/sbi/openapi/model/authentication_info.c b/lib/sbi/openapi/model/authentication_info.c new file mode 100644 index 0000000000..887d56f202 --- /dev/null +++ b/lib/sbi/openapi/model/authentication_info.c @@ -0,0 +1,229 @@ + +#include +#include +#include +#include "authentication_info.h" + +OpenAPI_authentication_info_t *OpenAPI_authentication_info_create( + char *supi_or_suci, + char *serving_network_name, + OpenAPI_resynchronization_info_t *resynchronization_info, + char *pei, + OpenAPI_trace_data_t *trace_data, + char *udm_group_id, + char *routing_indicator, + char *cag_id + ) +{ + OpenAPI_authentication_info_t *authentication_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_authentication_info_t)); + if (!authentication_info_local_var) { + return NULL; + } + authentication_info_local_var->supi_or_suci = supi_or_suci; + authentication_info_local_var->serving_network_name = serving_network_name; + authentication_info_local_var->resynchronization_info = resynchronization_info; + authentication_info_local_var->pei = pei; + authentication_info_local_var->trace_data = trace_data; + authentication_info_local_var->udm_group_id = udm_group_id; + authentication_info_local_var->routing_indicator = routing_indicator; + authentication_info_local_var->cag_id = cag_id; + + return authentication_info_local_var; +} + +void OpenAPI_authentication_info_free(OpenAPI_authentication_info_t *authentication_info) +{ + if (NULL == authentication_info) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(authentication_info->supi_or_suci); + ogs_free(authentication_info->serving_network_name); + OpenAPI_resynchronization_info_free(authentication_info->resynchronization_info); + ogs_free(authentication_info->pei); + OpenAPI_trace_data_free(authentication_info->trace_data); + ogs_free(authentication_info->udm_group_id); + ogs_free(authentication_info->routing_indicator); + ogs_free(authentication_info->cag_id); + ogs_free(authentication_info); +} + +cJSON *OpenAPI_authentication_info_convertToJSON(OpenAPI_authentication_info_t *authentication_info) +{ + cJSON *item = NULL; + + if (authentication_info == NULL) { + ogs_error("OpenAPI_authentication_info_convertToJSON() failed [AuthenticationInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!authentication_info->supi_or_suci) { + ogs_error("OpenAPI_authentication_info_convertToJSON() failed [supi_or_suci]"); + goto end; + } + if (cJSON_AddStringToObject(item, "supiOrSuci", authentication_info->supi_or_suci) == NULL) { + ogs_error("OpenAPI_authentication_info_convertToJSON() failed [supi_or_suci]"); + goto end; + } + + if (!authentication_info->serving_network_name) { + ogs_error("OpenAPI_authentication_info_convertToJSON() failed [serving_network_name]"); + goto end; + } + if (cJSON_AddStringToObject(item, "servingNetworkName", authentication_info->serving_network_name) == NULL) { + ogs_error("OpenAPI_authentication_info_convertToJSON() failed [serving_network_name]"); + goto end; + } + + if (authentication_info->resynchronization_info) { + cJSON *resynchronization_info_local_JSON = OpenAPI_resynchronization_info_convertToJSON(authentication_info->resynchronization_info); + if (resynchronization_info_local_JSON == NULL) { + ogs_error("OpenAPI_authentication_info_convertToJSON() failed [resynchronization_info]"); + goto end; + } + cJSON_AddItemToObject(item, "resynchronizationInfo", resynchronization_info_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_authentication_info_convertToJSON() failed [resynchronization_info]"); + goto end; + } + } + + if (authentication_info->pei) { + if (cJSON_AddStringToObject(item, "pei", authentication_info->pei) == NULL) { + ogs_error("OpenAPI_authentication_info_convertToJSON() failed [pei]"); + goto end; + } + } + + if (authentication_info->trace_data) { + cJSON *trace_data_local_JSON = OpenAPI_trace_data_convertToJSON(authentication_info->trace_data); + if (trace_data_local_JSON == NULL) { + ogs_error("OpenAPI_authentication_info_convertToJSON() failed [trace_data]"); + goto end; + } + cJSON_AddItemToObject(item, "traceData", trace_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_authentication_info_convertToJSON() failed [trace_data]"); + goto end; + } + } + + if (authentication_info->udm_group_id) { + if (cJSON_AddStringToObject(item, "udmGroupId", authentication_info->udm_group_id) == NULL) { + ogs_error("OpenAPI_authentication_info_convertToJSON() failed [udm_group_id]"); + goto end; + } + } + + if (authentication_info->routing_indicator) { + if (cJSON_AddStringToObject(item, "routingIndicator", authentication_info->routing_indicator) == NULL) { + ogs_error("OpenAPI_authentication_info_convertToJSON() failed [routing_indicator]"); + goto end; + } + } + + if (authentication_info->cag_id) { + if (cJSON_AddStringToObject(item, "cagId", authentication_info->cag_id) == NULL) { + ogs_error("OpenAPI_authentication_info_convertToJSON() failed [cag_id]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_authentication_info_t *OpenAPI_authentication_info_parseFromJSON(cJSON *authentication_infoJSON) +{ + OpenAPI_authentication_info_t *authentication_info_local_var = NULL; + cJSON *supi_or_suci = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "supiOrSuci"); + if (!supi_or_suci) { + ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [supi_or_suci]"); + goto end; + } + + + if (!cJSON_IsString(supi_or_suci)) { + ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [supi_or_suci]"); + goto end; + } + + cJSON *serving_network_name = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "servingNetworkName"); + if (!serving_network_name) { + ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [serving_network_name]"); + goto end; + } + + + if (!cJSON_IsString(serving_network_name)) { + ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [serving_network_name]"); + goto end; + } + + cJSON *resynchronization_info = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "resynchronizationInfo"); + + OpenAPI_resynchronization_info_t *resynchronization_info_local_nonprim = NULL; + if (resynchronization_info) { + resynchronization_info_local_nonprim = OpenAPI_resynchronization_info_parseFromJSON(resynchronization_info); + } + + cJSON *pei = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "pei"); + + if (pei) { + if (!cJSON_IsString(pei)) { + ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [pei]"); + goto end; + } + } + + cJSON *trace_data = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "traceData"); + + OpenAPI_trace_data_t *trace_data_local_nonprim = NULL; + if (trace_data) { + trace_data_local_nonprim = OpenAPI_trace_data_parseFromJSON(trace_data); + } + + cJSON *udm_group_id = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "udmGroupId"); + + if (udm_group_id) { + if (!cJSON_IsString(udm_group_id)) { + ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [udm_group_id]"); + goto end; + } + } + + cJSON *routing_indicator = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "routingIndicator"); + + if (routing_indicator) { + if (!cJSON_IsString(routing_indicator)) { + ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [routing_indicator]"); + goto end; + } + } + + cJSON *cag_id = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "cagId"); + + if (cag_id) { + if (!cJSON_IsString(cag_id)) { + ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [cag_id]"); + goto end; + } + } + + authentication_info_local_var = OpenAPI_authentication_info_create ( + ogs_strdup(supi_or_suci->valuestring), + ogs_strdup(serving_network_name->valuestring), + resynchronization_info ? resynchronization_info_local_nonprim : NULL, + pei ? ogs_strdup(pei->valuestring) : NULL, + trace_data ? trace_data_local_nonprim : NULL, + udm_group_id ? ogs_strdup(udm_group_id->valuestring) : NULL, + routing_indicator ? ogs_strdup(routing_indicator->valuestring) : NULL, + cag_id ? ogs_strdup(cag_id->valuestring) : NULL + ); + + return authentication_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/authentication_info.h b/lib/sbi/openapi/model/authentication_info.h new file mode 100644 index 0000000000..5a46ea2e80 --- /dev/null +++ b/lib/sbi/openapi/model/authentication_info.h @@ -0,0 +1,53 @@ +/* + * authentication_info.h + * + * + */ + +#ifndef _OpenAPI_authentication_info_H_ +#define _OpenAPI_authentication_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "resynchronization_info.h" +#include "trace_data.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_authentication_info_s OpenAPI_authentication_info_t; +typedef struct OpenAPI_authentication_info_s { + char *supi_or_suci; + char *serving_network_name; + struct OpenAPI_resynchronization_info_s *resynchronization_info; + char *pei; + struct OpenAPI_trace_data_s *trace_data; + char *udm_group_id; + char *routing_indicator; + char *cag_id; +} OpenAPI_authentication_info_t; + +OpenAPI_authentication_info_t *OpenAPI_authentication_info_create( + char *supi_or_suci, + char *serving_network_name, + OpenAPI_resynchronization_info_t *resynchronization_info, + char *pei, + OpenAPI_trace_data_t *trace_data, + char *udm_group_id, + char *routing_indicator, + char *cag_id + ); +void OpenAPI_authentication_info_free(OpenAPI_authentication_info_t *authentication_info); +OpenAPI_authentication_info_t *OpenAPI_authentication_info_parseFromJSON(cJSON *authentication_infoJSON); +cJSON *OpenAPI_authentication_info_convertToJSON(OpenAPI_authentication_info_t *authentication_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_authentication_info_H_ */ + diff --git a/lib/sbi/openapi/model/authentication_info_request.c b/lib/sbi/openapi/model/authentication_info_request.c new file mode 100644 index 0000000000..82ece5bb6f --- /dev/null +++ b/lib/sbi/openapi/model/authentication_info_request.c @@ -0,0 +1,165 @@ + +#include +#include +#include +#include "authentication_info_request.h" + +OpenAPI_authentication_info_request_t *OpenAPI_authentication_info_request_create( + char *supported_features, + char *serving_network_name, + OpenAPI_resynchronization_info_t *resynchronization_info, + char *ausf_instance_id, + char *cag_id + ) +{ + OpenAPI_authentication_info_request_t *authentication_info_request_local_var = OpenAPI_malloc(sizeof(OpenAPI_authentication_info_request_t)); + if (!authentication_info_request_local_var) { + return NULL; + } + authentication_info_request_local_var->supported_features = supported_features; + 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; + + return authentication_info_request_local_var; +} + +void OpenAPI_authentication_info_request_free(OpenAPI_authentication_info_request_t *authentication_info_request) +{ + if (NULL == authentication_info_request) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(authentication_info_request->supported_features); + ogs_free(authentication_info_request->serving_network_name); + OpenAPI_resynchronization_info_free(authentication_info_request->resynchronization_info); + ogs_free(authentication_info_request->ausf_instance_id); + ogs_free(authentication_info_request->cag_id); + ogs_free(authentication_info_request); +} + +cJSON *OpenAPI_authentication_info_request_convertToJSON(OpenAPI_authentication_info_request_t *authentication_info_request) +{ + cJSON *item = NULL; + + if (authentication_info_request == NULL) { + ogs_error("OpenAPI_authentication_info_request_convertToJSON() failed [AuthenticationInfoRequest]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (authentication_info_request->supported_features) { + if (cJSON_AddStringToObject(item, "supportedFeatures", authentication_info_request->supported_features) == NULL) { + ogs_error("OpenAPI_authentication_info_request_convertToJSON() failed [supported_features]"); + goto end; + } + } + + if (!authentication_info_request->serving_network_name) { + ogs_error("OpenAPI_authentication_info_request_convertToJSON() failed [serving_network_name]"); + goto end; + } + if (cJSON_AddStringToObject(item, "servingNetworkName", authentication_info_request->serving_network_name) == NULL) { + ogs_error("OpenAPI_authentication_info_request_convertToJSON() failed [serving_network_name]"); + goto end; + } + + if (authentication_info_request->resynchronization_info) { + cJSON *resynchronization_info_local_JSON = OpenAPI_resynchronization_info_convertToJSON(authentication_info_request->resynchronization_info); + if (resynchronization_info_local_JSON == NULL) { + ogs_error("OpenAPI_authentication_info_request_convertToJSON() failed [resynchronization_info]"); + goto end; + } + cJSON_AddItemToObject(item, "resynchronizationInfo", resynchronization_info_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_authentication_info_request_convertToJSON() failed [resynchronization_info]"); + goto end; + } + } + + if (!authentication_info_request->ausf_instance_id) { + ogs_error("OpenAPI_authentication_info_request_convertToJSON() failed [ausf_instance_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "ausfInstanceId", authentication_info_request->ausf_instance_id) == NULL) { + ogs_error("OpenAPI_authentication_info_request_convertToJSON() failed [ausf_instance_id]"); + goto end; + } + + if (authentication_info_request->cag_id) { + if (cJSON_AddStringToObject(item, "cagId", authentication_info_request->cag_id) == NULL) { + ogs_error("OpenAPI_authentication_info_request_convertToJSON() failed [cag_id]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_authentication_info_request_t *OpenAPI_authentication_info_request_parseFromJSON(cJSON *authentication_info_requestJSON) +{ + OpenAPI_authentication_info_request_t *authentication_info_request_local_var = NULL; + cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "supportedFeatures"); + + if (supported_features) { + if (!cJSON_IsString(supported_features)) { + ogs_error("OpenAPI_authentication_info_request_parseFromJSON() failed [supported_features]"); + goto end; + } + } + + cJSON *serving_network_name = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "servingNetworkName"); + if (!serving_network_name) { + ogs_error("OpenAPI_authentication_info_request_parseFromJSON() failed [serving_network_name]"); + goto end; + } + + + if (!cJSON_IsString(serving_network_name)) { + ogs_error("OpenAPI_authentication_info_request_parseFromJSON() failed [serving_network_name]"); + goto end; + } + + cJSON *resynchronization_info = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "resynchronizationInfo"); + + OpenAPI_resynchronization_info_t *resynchronization_info_local_nonprim = NULL; + if (resynchronization_info) { + resynchronization_info_local_nonprim = OpenAPI_resynchronization_info_parseFromJSON(resynchronization_info); + } + + cJSON *ausf_instance_id = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "ausfInstanceId"); + if (!ausf_instance_id) { + ogs_error("OpenAPI_authentication_info_request_parseFromJSON() failed [ausf_instance_id]"); + goto end; + } + + + if (!cJSON_IsString(ausf_instance_id)) { + ogs_error("OpenAPI_authentication_info_request_parseFromJSON() failed [ausf_instance_id]"); + goto end; + } + + cJSON *cag_id = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "cagId"); + + if (cag_id) { + if (!cJSON_IsString(cag_id)) { + ogs_error("OpenAPI_authentication_info_request_parseFromJSON() failed [cag_id]"); + goto end; + } + } + + authentication_info_request_local_var = OpenAPI_authentication_info_request_create ( + supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + ogs_strdup(serving_network_name->valuestring), + resynchronization_info ? resynchronization_info_local_nonprim : NULL, + ogs_strdup(ausf_instance_id->valuestring), + cag_id ? ogs_strdup(cag_id->valuestring) : NULL + ); + + return authentication_info_request_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/authentication_info_request.h b/lib/sbi/openapi/model/authentication_info_request.h new file mode 100644 index 0000000000..d6927d1a74 --- /dev/null +++ b/lib/sbi/openapi/model/authentication_info_request.h @@ -0,0 +1,46 @@ +/* + * authentication_info_request.h + * + * + */ + +#ifndef _OpenAPI_authentication_info_request_H_ +#define _OpenAPI_authentication_info_request_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "resynchronization_info.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_authentication_info_request_s OpenAPI_authentication_info_request_t; +typedef struct OpenAPI_authentication_info_request_s { + char *supported_features; + char *serving_network_name; + struct OpenAPI_resynchronization_info_s *resynchronization_info; + char *ausf_instance_id; + char *cag_id; +} OpenAPI_authentication_info_request_t; + +OpenAPI_authentication_info_request_t *OpenAPI_authentication_info_request_create( + char *supported_features, + char *serving_network_name, + OpenAPI_resynchronization_info_t *resynchronization_info, + char *ausf_instance_id, + char *cag_id + ); +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); +cJSON *OpenAPI_authentication_info_request_convertToJSON(OpenAPI_authentication_info_request_t *authentication_info_request); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_authentication_info_request_H_ */ + diff --git a/lib/sbi/openapi/model/authentication_info_result.c b/lib/sbi/openapi/model/authentication_info_result.c new file mode 100644 index 0000000000..26a1ad3eac --- /dev/null +++ b/lib/sbi/openapi/model/authentication_info_result.c @@ -0,0 +1,141 @@ + +#include +#include +#include +#include "authentication_info_result.h" + +OpenAPI_authentication_info_result_t *OpenAPI_authentication_info_result_create( + OpenAPI_auth_type_e auth_type, + char *supported_features, + OpenAPI_authentication_vector_t *authentication_vector, + char *supi + ) +{ + OpenAPI_authentication_info_result_t *authentication_info_result_local_var = OpenAPI_malloc(sizeof(OpenAPI_authentication_info_result_t)); + if (!authentication_info_result_local_var) { + return NULL; + } + authentication_info_result_local_var->auth_type = auth_type; + authentication_info_result_local_var->supported_features = supported_features; + authentication_info_result_local_var->authentication_vector = authentication_vector; + authentication_info_result_local_var->supi = supi; + + return authentication_info_result_local_var; +} + +void OpenAPI_authentication_info_result_free(OpenAPI_authentication_info_result_t *authentication_info_result) +{ + if (NULL == authentication_info_result) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(authentication_info_result->supported_features); + OpenAPI_authentication_vector_free(authentication_info_result->authentication_vector); + ogs_free(authentication_info_result->supi); + ogs_free(authentication_info_result); +} + +cJSON *OpenAPI_authentication_info_result_convertToJSON(OpenAPI_authentication_info_result_t *authentication_info_result) +{ + cJSON *item = NULL; + + if (authentication_info_result == NULL) { + ogs_error("OpenAPI_authentication_info_result_convertToJSON() failed [AuthenticationInfoResult]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!authentication_info_result->auth_type) { + ogs_error("OpenAPI_authentication_info_result_convertToJSON() failed [auth_type]"); + goto end; + } + if (cJSON_AddStringToObject(item, "authType", OpenAPI_auth_type_ToString(authentication_info_result->auth_type)) == NULL) { + ogs_error("OpenAPI_authentication_info_result_convertToJSON() failed [auth_type]"); + goto end; + } + + if (authentication_info_result->supported_features) { + if (cJSON_AddStringToObject(item, "supportedFeatures", authentication_info_result->supported_features) == NULL) { + ogs_error("OpenAPI_authentication_info_result_convertToJSON() failed [supported_features]"); + goto end; + } + } + + if (authentication_info_result->authentication_vector) { + cJSON *authentication_vector_local_JSON = OpenAPI_authentication_vector_convertToJSON(authentication_info_result->authentication_vector); + if (authentication_vector_local_JSON == NULL) { + ogs_error("OpenAPI_authentication_info_result_convertToJSON() failed [authentication_vector]"); + goto end; + } + cJSON_AddItemToObject(item, "authenticationVector", authentication_vector_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_authentication_info_result_convertToJSON() failed [authentication_vector]"); + goto end; + } + } + + if (authentication_info_result->supi) { + if (cJSON_AddStringToObject(item, "supi", authentication_info_result->supi) == NULL) { + ogs_error("OpenAPI_authentication_info_result_convertToJSON() failed [supi]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_authentication_info_result_t *OpenAPI_authentication_info_result_parseFromJSON(cJSON *authentication_info_resultJSON) +{ + OpenAPI_authentication_info_result_t *authentication_info_result_local_var = NULL; + cJSON *auth_type = cJSON_GetObjectItemCaseSensitive(authentication_info_resultJSON, "authType"); + if (!auth_type) { + ogs_error("OpenAPI_authentication_info_result_parseFromJSON() failed [auth_type]"); + goto end; + } + + OpenAPI_auth_type_e auth_typeVariable; + + if (!cJSON_IsString(auth_type)) { + ogs_error("OpenAPI_authentication_info_result_parseFromJSON() failed [auth_type]"); + goto end; + } + auth_typeVariable = OpenAPI_auth_type_FromString(auth_type->valuestring); + + cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(authentication_info_resultJSON, "supportedFeatures"); + + if (supported_features) { + if (!cJSON_IsString(supported_features)) { + ogs_error("OpenAPI_authentication_info_result_parseFromJSON() failed [supported_features]"); + goto end; + } + } + + cJSON *authentication_vector = cJSON_GetObjectItemCaseSensitive(authentication_info_resultJSON, "authenticationVector"); + + OpenAPI_authentication_vector_t *authentication_vector_local_nonprim = NULL; + if (authentication_vector) { + authentication_vector_local_nonprim = OpenAPI_authentication_vector_parseFromJSON(authentication_vector); + } + + cJSON *supi = cJSON_GetObjectItemCaseSensitive(authentication_info_resultJSON, "supi"); + + if (supi) { + if (!cJSON_IsString(supi)) { + ogs_error("OpenAPI_authentication_info_result_parseFromJSON() failed [supi]"); + goto end; + } + } + + authentication_info_result_local_var = OpenAPI_authentication_info_result_create ( + auth_typeVariable, + supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + authentication_vector ? authentication_vector_local_nonprim : NULL, + supi ? ogs_strdup(supi->valuestring) : NULL + ); + + return authentication_info_result_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/authentication_info_result.h b/lib/sbi/openapi/model/authentication_info_result.h new file mode 100644 index 0000000000..a81d1b8056 --- /dev/null +++ b/lib/sbi/openapi/model/authentication_info_result.h @@ -0,0 +1,45 @@ +/* + * authentication_info_result.h + * + * + */ + +#ifndef _OpenAPI_authentication_info_result_H_ +#define _OpenAPI_authentication_info_result_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "auth_type.h" +#include "authentication_vector.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_authentication_info_result_s OpenAPI_authentication_info_result_t; +typedef struct OpenAPI_authentication_info_result_s { + OpenAPI_auth_type_e auth_type; + char *supported_features; + struct OpenAPI_authentication_vector_s *authentication_vector; + char *supi; +} OpenAPI_authentication_info_result_t; + +OpenAPI_authentication_info_result_t *OpenAPI_authentication_info_result_create( + OpenAPI_auth_type_e auth_type, + char *supported_features, + OpenAPI_authentication_vector_t *authentication_vector, + char *supi + ); +void OpenAPI_authentication_info_result_free(OpenAPI_authentication_info_result_t *authentication_info_result); +OpenAPI_authentication_info_result_t *OpenAPI_authentication_info_result_parseFromJSON(cJSON *authentication_info_resultJSON); +cJSON *OpenAPI_authentication_info_result_convertToJSON(OpenAPI_authentication_info_result_t *authentication_info_result); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_authentication_info_result_H_ */ + diff --git a/lib/sbi/openapi/model/authentication_subscription.c b/lib/sbi/openapi/model/authentication_subscription.c new file mode 100644 index 0000000000..b08bcdbda7 --- /dev/null +++ b/lib/sbi/openapi/model/authentication_subscription.c @@ -0,0 +1,240 @@ + +#include +#include +#include +#include "authentication_subscription.h" + +OpenAPI_authentication_subscription_t *OpenAPI_authentication_subscription_create( + OpenAPI_auth_method_e authentication_method, + char *enc_permanent_key, + char *protection_parameter_id, + OpenAPI_sequence_number_t *sequence_number, + char *authentication_management_field, + char *algorithm_id, + char *enc_opc_key, + char *enc_topc_key, + int vector_generation_in_hss + ) +{ + OpenAPI_authentication_subscription_t *authentication_subscription_local_var = OpenAPI_malloc(sizeof(OpenAPI_authentication_subscription_t)); + if (!authentication_subscription_local_var) { + return NULL; + } + authentication_subscription_local_var->authentication_method = authentication_method; + authentication_subscription_local_var->enc_permanent_key = enc_permanent_key; + authentication_subscription_local_var->protection_parameter_id = protection_parameter_id; + authentication_subscription_local_var->sequence_number = sequence_number; + authentication_subscription_local_var->authentication_management_field = authentication_management_field; + authentication_subscription_local_var->algorithm_id = algorithm_id; + 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; + + return authentication_subscription_local_var; +} + +void OpenAPI_authentication_subscription_free(OpenAPI_authentication_subscription_t *authentication_subscription) +{ + if (NULL == authentication_subscription) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(authentication_subscription->enc_permanent_key); + ogs_free(authentication_subscription->protection_parameter_id); + OpenAPI_sequence_number_free(authentication_subscription->sequence_number); + ogs_free(authentication_subscription->authentication_management_field); + ogs_free(authentication_subscription->algorithm_id); + ogs_free(authentication_subscription->enc_opc_key); + ogs_free(authentication_subscription->enc_topc_key); + ogs_free(authentication_subscription); +} + +cJSON *OpenAPI_authentication_subscription_convertToJSON(OpenAPI_authentication_subscription_t *authentication_subscription) +{ + cJSON *item = NULL; + + if (authentication_subscription == NULL) { + ogs_error("OpenAPI_authentication_subscription_convertToJSON() failed [AuthenticationSubscription]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!authentication_subscription->authentication_method) { + ogs_error("OpenAPI_authentication_subscription_convertToJSON() failed [authentication_method]"); + goto end; + } + if (cJSON_AddStringToObject(item, "authenticationMethod", OpenAPI_auth_method_ToString(authentication_subscription->authentication_method)) == NULL) { + ogs_error("OpenAPI_authentication_subscription_convertToJSON() failed [authentication_method]"); + goto end; + } + + if (authentication_subscription->enc_permanent_key) { + if (cJSON_AddStringToObject(item, "encPermanentKey", authentication_subscription->enc_permanent_key) == NULL) { + ogs_error("OpenAPI_authentication_subscription_convertToJSON() failed [enc_permanent_key]"); + goto end; + } + } + + if (authentication_subscription->protection_parameter_id) { + if (cJSON_AddStringToObject(item, "protectionParameterId", authentication_subscription->protection_parameter_id) == NULL) { + ogs_error("OpenAPI_authentication_subscription_convertToJSON() failed [protection_parameter_id]"); + goto end; + } + } + + if (authentication_subscription->sequence_number) { + cJSON *sequence_number_local_JSON = OpenAPI_sequence_number_convertToJSON(authentication_subscription->sequence_number); + if (sequence_number_local_JSON == NULL) { + ogs_error("OpenAPI_authentication_subscription_convertToJSON() failed [sequence_number]"); + goto end; + } + cJSON_AddItemToObject(item, "sequenceNumber", sequence_number_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_authentication_subscription_convertToJSON() failed [sequence_number]"); + goto end; + } + } + + if (authentication_subscription->authentication_management_field) { + if (cJSON_AddStringToObject(item, "authenticationManagementField", authentication_subscription->authentication_management_field) == NULL) { + ogs_error("OpenAPI_authentication_subscription_convertToJSON() failed [authentication_management_field]"); + goto end; + } + } + + if (authentication_subscription->algorithm_id) { + if (cJSON_AddStringToObject(item, "algorithmId", authentication_subscription->algorithm_id) == NULL) { + ogs_error("OpenAPI_authentication_subscription_convertToJSON() failed [algorithm_id]"); + goto end; + } + } + + if (authentication_subscription->enc_opc_key) { + if (cJSON_AddStringToObject(item, "encOpcKey", authentication_subscription->enc_opc_key) == NULL) { + ogs_error("OpenAPI_authentication_subscription_convertToJSON() failed [enc_opc_key]"); + goto end; + } + } + + if (authentication_subscription->enc_topc_key) { + if (cJSON_AddStringToObject(item, "encTopcKey", authentication_subscription->enc_topc_key) == NULL) { + ogs_error("OpenAPI_authentication_subscription_convertToJSON() failed [enc_topc_key]"); + goto end; + } + } + + if (authentication_subscription->vector_generation_in_hss >= 0) { + if (cJSON_AddBoolToObject(item, "vectorGenerationInHss", authentication_subscription->vector_generation_in_hss) == NULL) { + ogs_error("OpenAPI_authentication_subscription_convertToJSON() failed [vector_generation_in_hss]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_authentication_subscription_t *OpenAPI_authentication_subscription_parseFromJSON(cJSON *authentication_subscriptionJSON) +{ + OpenAPI_authentication_subscription_t *authentication_subscription_local_var = NULL; + cJSON *authentication_method = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "authenticationMethod"); + if (!authentication_method) { + ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [authentication_method]"); + goto end; + } + + OpenAPI_auth_method_e authentication_methodVariable; + + if (!cJSON_IsString(authentication_method)) { + ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [authentication_method]"); + goto end; + } + authentication_methodVariable = OpenAPI_auth_method_FromString(authentication_method->valuestring); + + cJSON *enc_permanent_key = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "encPermanentKey"); + + if (enc_permanent_key) { + if (!cJSON_IsString(enc_permanent_key)) { + ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [enc_permanent_key]"); + goto end; + } + } + + cJSON *protection_parameter_id = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "protectionParameterId"); + + if (protection_parameter_id) { + if (!cJSON_IsString(protection_parameter_id)) { + ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [protection_parameter_id]"); + goto end; + } + } + + cJSON *sequence_number = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "sequenceNumber"); + + OpenAPI_sequence_number_t *sequence_number_local_nonprim = NULL; + if (sequence_number) { + sequence_number_local_nonprim = OpenAPI_sequence_number_parseFromJSON(sequence_number); + } + + cJSON *authentication_management_field = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "authenticationManagementField"); + + if (authentication_management_field) { + if (!cJSON_IsString(authentication_management_field)) { + ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [authentication_management_field]"); + goto end; + } + } + + cJSON *algorithm_id = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "algorithmId"); + + if (algorithm_id) { + if (!cJSON_IsString(algorithm_id)) { + ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [algorithm_id]"); + goto end; + } + } + + cJSON *enc_opc_key = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "encOpcKey"); + + if (enc_opc_key) { + if (!cJSON_IsString(enc_opc_key)) { + ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [enc_opc_key]"); + goto end; + } + } + + cJSON *enc_topc_key = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "encTopcKey"); + + if (enc_topc_key) { + if (!cJSON_IsString(enc_topc_key)) { + ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [enc_topc_key]"); + goto end; + } + } + + cJSON *vector_generation_in_hss = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "vectorGenerationInHss"); + + if (vector_generation_in_hss) { + if (!cJSON_IsBool(vector_generation_in_hss)) { + ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [vector_generation_in_hss]"); + goto end; + } + } + + authentication_subscription_local_var = OpenAPI_authentication_subscription_create ( + authentication_methodVariable, + enc_permanent_key ? ogs_strdup(enc_permanent_key->valuestring) : NULL, + protection_parameter_id ? ogs_strdup(protection_parameter_id->valuestring) : NULL, + sequence_number ? sequence_number_local_nonprim : NULL, + authentication_management_field ? ogs_strdup(authentication_management_field->valuestring) : NULL, + algorithm_id ? ogs_strdup(algorithm_id->valuestring) : NULL, + enc_opc_key ? ogs_strdup(enc_opc_key->valuestring) : NULL, + enc_topc_key ? ogs_strdup(enc_topc_key->valuestring) : NULL, + vector_generation_in_hss ? vector_generation_in_hss->valueint : 0 + ); + + return authentication_subscription_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/authentication_subscription.h b/lib/sbi/openapi/model/authentication_subscription.h new file mode 100644 index 0000000000..3c613398c5 --- /dev/null +++ b/lib/sbi/openapi/model/authentication_subscription.h @@ -0,0 +1,55 @@ +/* + * authentication_subscription.h + * + * + */ + +#ifndef _OpenAPI_authentication_subscription_H_ +#define _OpenAPI_authentication_subscription_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "auth_method.h" +#include "sequence_number.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_authentication_subscription_s OpenAPI_authentication_subscription_t; +typedef struct OpenAPI_authentication_subscription_s { + OpenAPI_auth_method_e authentication_method; + char *enc_permanent_key; + char *protection_parameter_id; + struct OpenAPI_sequence_number_s *sequence_number; + char *authentication_management_field; + char *algorithm_id; + char *enc_opc_key; + char *enc_topc_key; + int vector_generation_in_hss; +} OpenAPI_authentication_subscription_t; + +OpenAPI_authentication_subscription_t *OpenAPI_authentication_subscription_create( + OpenAPI_auth_method_e authentication_method, + char *enc_permanent_key, + char *protection_parameter_id, + OpenAPI_sequence_number_t *sequence_number, + char *authentication_management_field, + char *algorithm_id, + char *enc_opc_key, + char *enc_topc_key, + int vector_generation_in_hss + ); +void OpenAPI_authentication_subscription_free(OpenAPI_authentication_subscription_t *authentication_subscription); +OpenAPI_authentication_subscription_t *OpenAPI_authentication_subscription_parseFromJSON(cJSON *authentication_subscriptionJSON); +cJSON *OpenAPI_authentication_subscription_convertToJSON(OpenAPI_authentication_subscription_t *authentication_subscription); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_authentication_subscription_H_ */ + diff --git a/lib/sbi/openapi/model/authentication_vector.c b/lib/sbi/openapi/model/authentication_vector.c new file mode 100644 index 0000000000..e0a2faa495 --- /dev/null +++ b/lib/sbi/openapi/model/authentication_vector.c @@ -0,0 +1,227 @@ + +#include +#include +#include +#include "authentication_vector.h" + +OpenAPI_authentication_vector_t *OpenAPI_authentication_vector_create( + OpenAPI_av_type_e av_type, + char *rand, + char *xres, + char *autn, + char *ck_prime, + char *ik_prime, + char *xres_star, + char *kausf + ) +{ + OpenAPI_authentication_vector_t *authentication_vector_local_var = OpenAPI_malloc(sizeof(OpenAPI_authentication_vector_t)); + if (!authentication_vector_local_var) { + return NULL; + } + authentication_vector_local_var->av_type = av_type; + authentication_vector_local_var->rand = rand; + authentication_vector_local_var->xres = xres; + authentication_vector_local_var->autn = autn; + authentication_vector_local_var->ck_prime = ck_prime; + authentication_vector_local_var->ik_prime = ik_prime; + authentication_vector_local_var->xres_star = xres_star; + authentication_vector_local_var->kausf = kausf; + + return authentication_vector_local_var; +} + +void OpenAPI_authentication_vector_free(OpenAPI_authentication_vector_t *authentication_vector) +{ + if (NULL == authentication_vector) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(authentication_vector->rand); + ogs_free(authentication_vector->xres); + ogs_free(authentication_vector->autn); + ogs_free(authentication_vector->ck_prime); + ogs_free(authentication_vector->ik_prime); + ogs_free(authentication_vector->xres_star); + ogs_free(authentication_vector->kausf); + ogs_free(authentication_vector); +} + +cJSON *OpenAPI_authentication_vector_convertToJSON(OpenAPI_authentication_vector_t *authentication_vector) +{ + cJSON *item = NULL; + + if (authentication_vector == NULL) { + ogs_error("OpenAPI_authentication_vector_convertToJSON() failed [AuthenticationVector]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!authentication_vector->av_type) { + ogs_error("OpenAPI_authentication_vector_convertToJSON() failed [av_type]"); + goto end; + } + if (cJSON_AddStringToObject(item, "avType", OpenAPI_av_type_ToString(authentication_vector->av_type)) == NULL) { + ogs_error("OpenAPI_authentication_vector_convertToJSON() failed [av_type]"); + goto end; + } + + if (!authentication_vector->rand) { + ogs_error("OpenAPI_authentication_vector_convertToJSON() failed [rand]"); + goto end; + } + if (cJSON_AddStringToObject(item, "rand", authentication_vector->rand) == NULL) { + ogs_error("OpenAPI_authentication_vector_convertToJSON() failed [rand]"); + goto end; + } + + if (authentication_vector->xres) { + if (cJSON_AddStringToObject(item, "xres", authentication_vector->xres) == NULL) { + ogs_error("OpenAPI_authentication_vector_convertToJSON() failed [xres]"); + goto end; + } + } + + if (!authentication_vector->autn) { + ogs_error("OpenAPI_authentication_vector_convertToJSON() failed [autn]"); + goto end; + } + if (cJSON_AddStringToObject(item, "autn", authentication_vector->autn) == NULL) { + ogs_error("OpenAPI_authentication_vector_convertToJSON() failed [autn]"); + goto end; + } + + if (authentication_vector->ck_prime) { + if (cJSON_AddStringToObject(item, "ckPrime", authentication_vector->ck_prime) == NULL) { + ogs_error("OpenAPI_authentication_vector_convertToJSON() failed [ck_prime]"); + goto end; + } + } + + if (authentication_vector->ik_prime) { + if (cJSON_AddStringToObject(item, "ikPrime", authentication_vector->ik_prime) == NULL) { + ogs_error("OpenAPI_authentication_vector_convertToJSON() failed [ik_prime]"); + goto end; + } + } + + if (authentication_vector->xres_star) { + if (cJSON_AddStringToObject(item, "xresStar", authentication_vector->xres_star) == NULL) { + ogs_error("OpenAPI_authentication_vector_convertToJSON() failed [xres_star]"); + goto end; + } + } + + if (authentication_vector->kausf) { + if (cJSON_AddStringToObject(item, "kausf", authentication_vector->kausf) == NULL) { + ogs_error("OpenAPI_authentication_vector_convertToJSON() failed [kausf]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_authentication_vector_t *OpenAPI_authentication_vector_parseFromJSON(cJSON *authentication_vectorJSON) +{ + OpenAPI_authentication_vector_t *authentication_vector_local_var = NULL; + cJSON *av_type = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "avType"); + if (!av_type) { + ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [av_type]"); + goto end; + } + + OpenAPI_av_type_e av_typeVariable; + + if (!cJSON_IsString(av_type)) { + ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [av_type]"); + goto end; + } + av_typeVariable = OpenAPI_av_type_FromString(av_type->valuestring); + + cJSON *rand = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "rand"); + if (!rand) { + ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [rand]"); + goto end; + } + + + if (!cJSON_IsString(rand)) { + ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [rand]"); + goto end; + } + + cJSON *xres = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "xres"); + + if (xres) { + if (!cJSON_IsString(xres)) { + ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [xres]"); + goto end; + } + } + + cJSON *autn = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "autn"); + if (!autn) { + ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [autn]"); + goto end; + } + + + if (!cJSON_IsString(autn)) { + ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [autn]"); + goto end; + } + + cJSON *ck_prime = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "ckPrime"); + + if (ck_prime) { + if (!cJSON_IsString(ck_prime)) { + ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [ck_prime]"); + goto end; + } + } + + cJSON *ik_prime = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "ikPrime"); + + if (ik_prime) { + if (!cJSON_IsString(ik_prime)) { + ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [ik_prime]"); + goto end; + } + } + + cJSON *xres_star = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "xresStar"); + + if (xres_star) { + if (!cJSON_IsString(xres_star)) { + ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [xres_star]"); + goto end; + } + } + + cJSON *kausf = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "kausf"); + + if (kausf) { + if (!cJSON_IsString(kausf)) { + ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [kausf]"); + goto end; + } + } + + authentication_vector_local_var = OpenAPI_authentication_vector_create ( + av_typeVariable, + ogs_strdup(rand->valuestring), + xres ? ogs_strdup(xres->valuestring) : NULL, + ogs_strdup(autn->valuestring), + ck_prime ? ogs_strdup(ck_prime->valuestring) : NULL, + ik_prime ? ogs_strdup(ik_prime->valuestring) : NULL, + xres_star ? ogs_strdup(xres_star->valuestring) : NULL, + kausf ? ogs_strdup(kausf->valuestring) : NULL + ); + + return authentication_vector_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/authentication_vector.h b/lib/sbi/openapi/model/authentication_vector.h new file mode 100644 index 0000000000..2c1420f9a7 --- /dev/null +++ b/lib/sbi/openapi/model/authentication_vector.h @@ -0,0 +1,54 @@ +/* + * authentication_vector.h + * + * + */ + +#ifndef _OpenAPI_authentication_vector_H_ +#define _OpenAPI_authentication_vector_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "av5_g_he_aka.h" +#include "av_eap_aka_prime.h" +#include "av_type.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_authentication_vector_s OpenAPI_authentication_vector_t; +typedef struct OpenAPI_authentication_vector_s { + OpenAPI_av_type_e av_type; + char *rand; + char *xres; + char *autn; + char *ck_prime; + char *ik_prime; + char *xres_star; + char *kausf; +} OpenAPI_authentication_vector_t; + +OpenAPI_authentication_vector_t *OpenAPI_authentication_vector_create( + OpenAPI_av_type_e av_type, + char *rand, + char *xres, + char *autn, + char *ck_prime, + char *ik_prime, + char *xres_star, + char *kausf + ); +void OpenAPI_authentication_vector_free(OpenAPI_authentication_vector_t *authentication_vector); +OpenAPI_authentication_vector_t *OpenAPI_authentication_vector_parseFromJSON(cJSON *authentication_vectorJSON); +cJSON *OpenAPI_authentication_vector_convertToJSON(OpenAPI_authentication_vector_t *authentication_vector); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_authentication_vector_H_ */ + diff --git a/lib/sbi/openapi/model/authorization_data.c b/lib/sbi/openapi/model/authorization_data.c new file mode 100644 index 0000000000..3edbf356bb --- /dev/null +++ b/lib/sbi/openapi/model/authorization_data.c @@ -0,0 +1,126 @@ + +#include +#include +#include +#include "authorization_data.h" + +OpenAPI_authorization_data_t *OpenAPI_authorization_data_create( + OpenAPI_list_t *authorization_data, + char *validity_time + ) +{ + OpenAPI_authorization_data_t *authorization_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_authorization_data_t)); + if (!authorization_data_local_var) { + return NULL; + } + authorization_data_local_var->authorization_data = authorization_data; + authorization_data_local_var->validity_time = validity_time; + + return authorization_data_local_var; +} + +void OpenAPI_authorization_data_free(OpenAPI_authorization_data_t *authorization_data) +{ + if (NULL == authorization_data) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(authorization_data->authorization_data, node) { + OpenAPI_user_identifier_free(node->data); + } + OpenAPI_list_free(authorization_data->authorization_data); + ogs_free(authorization_data->validity_time); + ogs_free(authorization_data); +} + +cJSON *OpenAPI_authorization_data_convertToJSON(OpenAPI_authorization_data_t *authorization_data) +{ + cJSON *item = NULL; + + if (authorization_data == NULL) { + ogs_error("OpenAPI_authorization_data_convertToJSON() failed [AuthorizationData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!authorization_data->authorization_data) { + ogs_error("OpenAPI_authorization_data_convertToJSON() failed [authorization_data]"); + goto end; + } + cJSON *authorization_dataList = cJSON_AddArrayToObject(item, "authorizationData"); + if (authorization_dataList == NULL) { + ogs_error("OpenAPI_authorization_data_convertToJSON() failed [authorization_data]"); + goto end; + } + + OpenAPI_lnode_t *authorization_data_node; + if (authorization_data->authorization_data) { + OpenAPI_list_for_each(authorization_data->authorization_data, authorization_data_node) { + cJSON *itemLocal = OpenAPI_user_identifier_convertToJSON(authorization_data_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_authorization_data_convertToJSON() failed [authorization_data]"); + goto end; + } + cJSON_AddItemToArray(authorization_dataList, itemLocal); + } + } + + if (authorization_data->validity_time) { + if (cJSON_AddStringToObject(item, "validityTime", authorization_data->validity_time) == NULL) { + ogs_error("OpenAPI_authorization_data_convertToJSON() failed [validity_time]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_authorization_data_t *OpenAPI_authorization_data_parseFromJSON(cJSON *authorization_dataJSON) +{ + OpenAPI_authorization_data_t *authorization_data_local_var = NULL; + cJSON *authorization_data = cJSON_GetObjectItemCaseSensitive(authorization_dataJSON, "authorizationData"); + if (!authorization_data) { + ogs_error("OpenAPI_authorization_data_parseFromJSON() failed [authorization_data]"); + goto end; + } + + OpenAPI_list_t *authorization_dataList; + + cJSON *authorization_data_local_nonprimitive; + if (!cJSON_IsArray(authorization_data)) { + ogs_error("OpenAPI_authorization_data_parseFromJSON() failed [authorization_data]"); + goto end; + } + + authorization_dataList = OpenAPI_list_create(); + + cJSON_ArrayForEach(authorization_data_local_nonprimitive, authorization_data ) { + if (!cJSON_IsObject(authorization_data_local_nonprimitive)) { + ogs_error("OpenAPI_authorization_data_parseFromJSON() failed [authorization_data]"); + goto end; + } + OpenAPI_user_identifier_t *authorization_dataItem = OpenAPI_user_identifier_parseFromJSON(authorization_data_local_nonprimitive); + + OpenAPI_list_add(authorization_dataList, authorization_dataItem); + } + + cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(authorization_dataJSON, "validityTime"); + + if (validity_time) { + if (!cJSON_IsString(validity_time)) { + ogs_error("OpenAPI_authorization_data_parseFromJSON() failed [validity_time]"); + goto end; + } + } + + authorization_data_local_var = OpenAPI_authorization_data_create ( + authorization_dataList, + validity_time ? ogs_strdup(validity_time->valuestring) : NULL + ); + + return authorization_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/authorization_data.h b/lib/sbi/openapi/model/authorization_data.h new file mode 100644 index 0000000000..c7330fdf50 --- /dev/null +++ b/lib/sbi/openapi/model/authorization_data.h @@ -0,0 +1,40 @@ +/* + * authorization_data.h + * + * + */ + +#ifndef _OpenAPI_authorization_data_H_ +#define _OpenAPI_authorization_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "user_identifier.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_authorization_data_s OpenAPI_authorization_data_t; +typedef struct OpenAPI_authorization_data_s { + OpenAPI_list_t *authorization_data; + char *validity_time; +} OpenAPI_authorization_data_t; + +OpenAPI_authorization_data_t *OpenAPI_authorization_data_create( + OpenAPI_list_t *authorization_data, + char *validity_time + ); +void OpenAPI_authorization_data_free(OpenAPI_authorization_data_t *authorization_data); +OpenAPI_authorization_data_t *OpenAPI_authorization_data_parseFromJSON(cJSON *authorization_dataJSON); +cJSON *OpenAPI_authorization_data_convertToJSON(OpenAPI_authorization_data_t *authorization_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_authorization_data_H_ */ + diff --git a/lib/sbi/openapi/model/av5_g_he_aka.c b/lib/sbi/openapi/model/av5_g_he_aka.c new file mode 100644 index 0000000000..961e2c9110 --- /dev/null +++ b/lib/sbi/openapi/model/av5_g_he_aka.c @@ -0,0 +1,167 @@ + +#include +#include +#include +#include "av5_g_he_aka.h" + +OpenAPI_av5_g_he_aka_t *OpenAPI_av5_g_he_aka_create( + OpenAPI_av_type_e av_type, + char *rand, + char *xres_star, + char *autn, + char *kausf + ) +{ + OpenAPI_av5_g_he_aka_t *av5_g_he_aka_local_var = OpenAPI_malloc(sizeof(OpenAPI_av5_g_he_aka_t)); + if (!av5_g_he_aka_local_var) { + return NULL; + } + av5_g_he_aka_local_var->av_type = av_type; + av5_g_he_aka_local_var->rand = rand; + av5_g_he_aka_local_var->xres_star = xres_star; + av5_g_he_aka_local_var->autn = autn; + av5_g_he_aka_local_var->kausf = kausf; + + return av5_g_he_aka_local_var; +} + +void OpenAPI_av5_g_he_aka_free(OpenAPI_av5_g_he_aka_t *av5_g_he_aka) +{ + if (NULL == av5_g_he_aka) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(av5_g_he_aka->rand); + ogs_free(av5_g_he_aka->xres_star); + ogs_free(av5_g_he_aka->autn); + ogs_free(av5_g_he_aka->kausf); + ogs_free(av5_g_he_aka); +} + +cJSON *OpenAPI_av5_g_he_aka_convertToJSON(OpenAPI_av5_g_he_aka_t *av5_g_he_aka) +{ + cJSON *item = NULL; + + if (av5_g_he_aka == NULL) { + ogs_error("OpenAPI_av5_g_he_aka_convertToJSON() failed [Av5GHeAka]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!av5_g_he_aka->av_type) { + ogs_error("OpenAPI_av5_g_he_aka_convertToJSON() failed [av_type]"); + goto end; + } + if (cJSON_AddStringToObject(item, "avType", OpenAPI_av_type_ToString(av5_g_he_aka->av_type)) == NULL) { + ogs_error("OpenAPI_av5_g_he_aka_convertToJSON() failed [av_type]"); + goto end; + } + + if (!av5_g_he_aka->rand) { + ogs_error("OpenAPI_av5_g_he_aka_convertToJSON() failed [rand]"); + goto end; + } + if (cJSON_AddStringToObject(item, "rand", av5_g_he_aka->rand) == NULL) { + ogs_error("OpenAPI_av5_g_he_aka_convertToJSON() failed [rand]"); + goto end; + } + + if (av5_g_he_aka->xres_star) { + if (cJSON_AddStringToObject(item, "xresStar", av5_g_he_aka->xres_star) == NULL) { + ogs_error("OpenAPI_av5_g_he_aka_convertToJSON() failed [xres_star]"); + goto end; + } + } + + if (!av5_g_he_aka->autn) { + ogs_error("OpenAPI_av5_g_he_aka_convertToJSON() failed [autn]"); + goto end; + } + if (cJSON_AddStringToObject(item, "autn", av5_g_he_aka->autn) == NULL) { + ogs_error("OpenAPI_av5_g_he_aka_convertToJSON() failed [autn]"); + goto end; + } + + if (av5_g_he_aka->kausf) { + if (cJSON_AddStringToObject(item, "kausf", av5_g_he_aka->kausf) == NULL) { + ogs_error("OpenAPI_av5_g_he_aka_convertToJSON() failed [kausf]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_av5_g_he_aka_t *OpenAPI_av5_g_he_aka_parseFromJSON(cJSON *av5_g_he_akaJSON) +{ + OpenAPI_av5_g_he_aka_t *av5_g_he_aka_local_var = NULL; + cJSON *av_type = cJSON_GetObjectItemCaseSensitive(av5_g_he_akaJSON, "avType"); + if (!av_type) { + ogs_error("OpenAPI_av5_g_he_aka_parseFromJSON() failed [av_type]"); + goto end; + } + + OpenAPI_av_type_e av_typeVariable; + + if (!cJSON_IsString(av_type)) { + ogs_error("OpenAPI_av5_g_he_aka_parseFromJSON() failed [av_type]"); + goto end; + } + av_typeVariable = OpenAPI_av_type_FromString(av_type->valuestring); + + cJSON *rand = cJSON_GetObjectItemCaseSensitive(av5_g_he_akaJSON, "rand"); + if (!rand) { + ogs_error("OpenAPI_av5_g_he_aka_parseFromJSON() failed [rand]"); + goto end; + } + + + if (!cJSON_IsString(rand)) { + ogs_error("OpenAPI_av5_g_he_aka_parseFromJSON() failed [rand]"); + goto end; + } + + cJSON *xres_star = cJSON_GetObjectItemCaseSensitive(av5_g_he_akaJSON, "xresStar"); + + if (xres_star) { + if (!cJSON_IsString(xres_star)) { + ogs_error("OpenAPI_av5_g_he_aka_parseFromJSON() failed [xres_star]"); + goto end; + } + } + + cJSON *autn = cJSON_GetObjectItemCaseSensitive(av5_g_he_akaJSON, "autn"); + if (!autn) { + ogs_error("OpenAPI_av5_g_he_aka_parseFromJSON() failed [autn]"); + goto end; + } + + + if (!cJSON_IsString(autn)) { + ogs_error("OpenAPI_av5_g_he_aka_parseFromJSON() failed [autn]"); + goto end; + } + + cJSON *kausf = cJSON_GetObjectItemCaseSensitive(av5_g_he_akaJSON, "kausf"); + + if (kausf) { + if (!cJSON_IsString(kausf)) { + ogs_error("OpenAPI_av5_g_he_aka_parseFromJSON() failed [kausf]"); + goto end; + } + } + + av5_g_he_aka_local_var = OpenAPI_av5_g_he_aka_create ( + av_typeVariable, + ogs_strdup(rand->valuestring), + xres_star ? ogs_strdup(xres_star->valuestring) : NULL, + ogs_strdup(autn->valuestring), + kausf ? ogs_strdup(kausf->valuestring) : NULL + ); + + return av5_g_he_aka_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/av5_g_he_aka.h b/lib/sbi/openapi/model/av5_g_he_aka.h new file mode 100644 index 0000000000..f81a315b1a --- /dev/null +++ b/lib/sbi/openapi/model/av5_g_he_aka.h @@ -0,0 +1,46 @@ +/* + * av5_g_he_aka.h + * + * + */ + +#ifndef _OpenAPI_av5_g_he_aka_H_ +#define _OpenAPI_av5_g_he_aka_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "av_type.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_av5_g_he_aka_s OpenAPI_av5_g_he_aka_t; +typedef struct OpenAPI_av5_g_he_aka_s { + OpenAPI_av_type_e av_type; + char *rand; + char *xres_star; + char *autn; + char *kausf; +} OpenAPI_av5_g_he_aka_t; + +OpenAPI_av5_g_he_aka_t *OpenAPI_av5_g_he_aka_create( + OpenAPI_av_type_e av_type, + char *rand, + char *xres_star, + char *autn, + char *kausf + ); +void OpenAPI_av5_g_he_aka_free(OpenAPI_av5_g_he_aka_t *av5_g_he_aka); +OpenAPI_av5_g_he_aka_t *OpenAPI_av5_g_he_aka_parseFromJSON(cJSON *av5_g_he_akaJSON); +cJSON *OpenAPI_av5_g_he_aka_convertToJSON(OpenAPI_av5_g_he_aka_t *av5_g_he_aka); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_av5_g_he_aka_H_ */ + diff --git a/lib/sbi/openapi/model/av5g_aka.c b/lib/sbi/openapi/model/av5g_aka.c new file mode 100644 index 0000000000..fd41f10378 --- /dev/null +++ b/lib/sbi/openapi/model/av5g_aka.c @@ -0,0 +1,126 @@ + +#include +#include +#include +#include "av5g_aka.h" + +OpenAPI_av5g_aka_t *OpenAPI_av5g_aka_create( + char *rand, + char *hxres_star, + char *autn + ) +{ + OpenAPI_av5g_aka_t *av5g_aka_local_var = OpenAPI_malloc(sizeof(OpenAPI_av5g_aka_t)); + if (!av5g_aka_local_var) { + return NULL; + } + av5g_aka_local_var->rand = rand; + av5g_aka_local_var->hxres_star = hxres_star; + av5g_aka_local_var->autn = autn; + + return av5g_aka_local_var; +} + +void OpenAPI_av5g_aka_free(OpenAPI_av5g_aka_t *av5g_aka) +{ + if (NULL == av5g_aka) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(av5g_aka->rand); + ogs_free(av5g_aka->hxres_star); + ogs_free(av5g_aka->autn); + ogs_free(av5g_aka); +} + +cJSON *OpenAPI_av5g_aka_convertToJSON(OpenAPI_av5g_aka_t *av5g_aka) +{ + cJSON *item = NULL; + + if (av5g_aka == NULL) { + ogs_error("OpenAPI_av5g_aka_convertToJSON() failed [Av5gAka]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!av5g_aka->rand) { + ogs_error("OpenAPI_av5g_aka_convertToJSON() failed [rand]"); + goto end; + } + if (cJSON_AddStringToObject(item, "rand", av5g_aka->rand) == NULL) { + ogs_error("OpenAPI_av5g_aka_convertToJSON() failed [rand]"); + goto end; + } + + if (!av5g_aka->hxres_star) { + ogs_error("OpenAPI_av5g_aka_convertToJSON() failed [hxres_star]"); + goto end; + } + if (cJSON_AddStringToObject(item, "hxresStar", av5g_aka->hxres_star) == NULL) { + ogs_error("OpenAPI_av5g_aka_convertToJSON() failed [hxres_star]"); + goto end; + } + + if (!av5g_aka->autn) { + ogs_error("OpenAPI_av5g_aka_convertToJSON() failed [autn]"); + goto end; + } + if (cJSON_AddStringToObject(item, "autn", av5g_aka->autn) == NULL) { + ogs_error("OpenAPI_av5g_aka_convertToJSON() failed [autn]"); + goto end; + } + +end: + return item; +} + +OpenAPI_av5g_aka_t *OpenAPI_av5g_aka_parseFromJSON(cJSON *av5g_akaJSON) +{ + OpenAPI_av5g_aka_t *av5g_aka_local_var = NULL; + cJSON *rand = cJSON_GetObjectItemCaseSensitive(av5g_akaJSON, "rand"); + if (!rand) { + ogs_error("OpenAPI_av5g_aka_parseFromJSON() failed [rand]"); + goto end; + } + + + if (!cJSON_IsString(rand)) { + ogs_error("OpenAPI_av5g_aka_parseFromJSON() failed [rand]"); + goto end; + } + + cJSON *hxres_star = cJSON_GetObjectItemCaseSensitive(av5g_akaJSON, "hxresStar"); + if (!hxres_star) { + ogs_error("OpenAPI_av5g_aka_parseFromJSON() failed [hxres_star]"); + goto end; + } + + + if (!cJSON_IsString(hxres_star)) { + ogs_error("OpenAPI_av5g_aka_parseFromJSON() failed [hxres_star]"); + goto end; + } + + cJSON *autn = cJSON_GetObjectItemCaseSensitive(av5g_akaJSON, "autn"); + if (!autn) { + ogs_error("OpenAPI_av5g_aka_parseFromJSON() failed [autn]"); + goto end; + } + + + if (!cJSON_IsString(autn)) { + ogs_error("OpenAPI_av5g_aka_parseFromJSON() failed [autn]"); + goto end; + } + + av5g_aka_local_var = OpenAPI_av5g_aka_create ( + ogs_strdup(rand->valuestring), + ogs_strdup(hxres_star->valuestring), + ogs_strdup(autn->valuestring) + ); + + return av5g_aka_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/av5g_aka.h b/lib/sbi/openapi/model/av5g_aka.h new file mode 100644 index 0000000000..0495df9dbf --- /dev/null +++ b/lib/sbi/openapi/model/av5g_aka.h @@ -0,0 +1,41 @@ +/* + * av5g_aka.h + * + * + */ + +#ifndef _OpenAPI_av5g_aka_H_ +#define _OpenAPI_av5g_aka_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_av5g_aka_s OpenAPI_av5g_aka_t; +typedef struct OpenAPI_av5g_aka_s { + char *rand; + char *hxres_star; + char *autn; +} OpenAPI_av5g_aka_t; + +OpenAPI_av5g_aka_t *OpenAPI_av5g_aka_create( + char *rand, + char *hxres_star, + char *autn + ); +void OpenAPI_av5g_aka_free(OpenAPI_av5g_aka_t *av5g_aka); +OpenAPI_av5g_aka_t *OpenAPI_av5g_aka_parseFromJSON(cJSON *av5g_akaJSON); +cJSON *OpenAPI_av5g_aka_convertToJSON(OpenAPI_av5g_aka_t *av5g_aka); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_av5g_aka_H_ */ + diff --git a/lib/sbi/openapi/model/av_eap_aka_prime.c b/lib/sbi/openapi/model/av_eap_aka_prime.c new file mode 100644 index 0000000000..09303d2858 --- /dev/null +++ b/lib/sbi/openapi/model/av_eap_aka_prime.c @@ -0,0 +1,187 @@ + +#include +#include +#include +#include "av_eap_aka_prime.h" + +OpenAPI_av_eap_aka_prime_t *OpenAPI_av_eap_aka_prime_create( + OpenAPI_av_type_e av_type, + char *rand, + char *xres, + char *autn, + char *ck_prime, + char *ik_prime + ) +{ + OpenAPI_av_eap_aka_prime_t *av_eap_aka_prime_local_var = OpenAPI_malloc(sizeof(OpenAPI_av_eap_aka_prime_t)); + if (!av_eap_aka_prime_local_var) { + return NULL; + } + av_eap_aka_prime_local_var->av_type = av_type; + av_eap_aka_prime_local_var->rand = rand; + av_eap_aka_prime_local_var->xres = xres; + av_eap_aka_prime_local_var->autn = autn; + av_eap_aka_prime_local_var->ck_prime = ck_prime; + av_eap_aka_prime_local_var->ik_prime = ik_prime; + + return av_eap_aka_prime_local_var; +} + +void OpenAPI_av_eap_aka_prime_free(OpenAPI_av_eap_aka_prime_t *av_eap_aka_prime) +{ + if (NULL == av_eap_aka_prime) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(av_eap_aka_prime->rand); + ogs_free(av_eap_aka_prime->xres); + ogs_free(av_eap_aka_prime->autn); + ogs_free(av_eap_aka_prime->ck_prime); + ogs_free(av_eap_aka_prime->ik_prime); + ogs_free(av_eap_aka_prime); +} + +cJSON *OpenAPI_av_eap_aka_prime_convertToJSON(OpenAPI_av_eap_aka_prime_t *av_eap_aka_prime) +{ + cJSON *item = NULL; + + if (av_eap_aka_prime == NULL) { + ogs_error("OpenAPI_av_eap_aka_prime_convertToJSON() failed [AvEapAkaPrime]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!av_eap_aka_prime->av_type) { + ogs_error("OpenAPI_av_eap_aka_prime_convertToJSON() failed [av_type]"); + goto end; + } + if (cJSON_AddStringToObject(item, "avType", OpenAPI_av_type_ToString(av_eap_aka_prime->av_type)) == NULL) { + ogs_error("OpenAPI_av_eap_aka_prime_convertToJSON() failed [av_type]"); + goto end; + } + + if (!av_eap_aka_prime->rand) { + ogs_error("OpenAPI_av_eap_aka_prime_convertToJSON() failed [rand]"); + goto end; + } + if (cJSON_AddStringToObject(item, "rand", av_eap_aka_prime->rand) == NULL) { + ogs_error("OpenAPI_av_eap_aka_prime_convertToJSON() failed [rand]"); + goto end; + } + + if (av_eap_aka_prime->xres) { + if (cJSON_AddStringToObject(item, "xres", av_eap_aka_prime->xres) == NULL) { + ogs_error("OpenAPI_av_eap_aka_prime_convertToJSON() failed [xres]"); + goto end; + } + } + + if (!av_eap_aka_prime->autn) { + ogs_error("OpenAPI_av_eap_aka_prime_convertToJSON() failed [autn]"); + goto end; + } + if (cJSON_AddStringToObject(item, "autn", av_eap_aka_prime->autn) == NULL) { + ogs_error("OpenAPI_av_eap_aka_prime_convertToJSON() failed [autn]"); + goto end; + } + + if (av_eap_aka_prime->ck_prime) { + if (cJSON_AddStringToObject(item, "ckPrime", av_eap_aka_prime->ck_prime) == NULL) { + ogs_error("OpenAPI_av_eap_aka_prime_convertToJSON() failed [ck_prime]"); + goto end; + } + } + + if (av_eap_aka_prime->ik_prime) { + if (cJSON_AddStringToObject(item, "ikPrime", av_eap_aka_prime->ik_prime) == NULL) { + ogs_error("OpenAPI_av_eap_aka_prime_convertToJSON() failed [ik_prime]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_av_eap_aka_prime_t *OpenAPI_av_eap_aka_prime_parseFromJSON(cJSON *av_eap_aka_primeJSON) +{ + OpenAPI_av_eap_aka_prime_t *av_eap_aka_prime_local_var = NULL; + cJSON *av_type = cJSON_GetObjectItemCaseSensitive(av_eap_aka_primeJSON, "avType"); + if (!av_type) { + ogs_error("OpenAPI_av_eap_aka_prime_parseFromJSON() failed [av_type]"); + goto end; + } + + OpenAPI_av_type_e av_typeVariable; + + if (!cJSON_IsString(av_type)) { + ogs_error("OpenAPI_av_eap_aka_prime_parseFromJSON() failed [av_type]"); + goto end; + } + av_typeVariable = OpenAPI_av_type_FromString(av_type->valuestring); + + cJSON *rand = cJSON_GetObjectItemCaseSensitive(av_eap_aka_primeJSON, "rand"); + if (!rand) { + ogs_error("OpenAPI_av_eap_aka_prime_parseFromJSON() failed [rand]"); + goto end; + } + + + if (!cJSON_IsString(rand)) { + ogs_error("OpenAPI_av_eap_aka_prime_parseFromJSON() failed [rand]"); + goto end; + } + + cJSON *xres = cJSON_GetObjectItemCaseSensitive(av_eap_aka_primeJSON, "xres"); + + if (xres) { + if (!cJSON_IsString(xres)) { + ogs_error("OpenAPI_av_eap_aka_prime_parseFromJSON() failed [xres]"); + goto end; + } + } + + cJSON *autn = cJSON_GetObjectItemCaseSensitive(av_eap_aka_primeJSON, "autn"); + if (!autn) { + ogs_error("OpenAPI_av_eap_aka_prime_parseFromJSON() failed [autn]"); + goto end; + } + + + if (!cJSON_IsString(autn)) { + ogs_error("OpenAPI_av_eap_aka_prime_parseFromJSON() failed [autn]"); + goto end; + } + + cJSON *ck_prime = cJSON_GetObjectItemCaseSensitive(av_eap_aka_primeJSON, "ckPrime"); + + if (ck_prime) { + if (!cJSON_IsString(ck_prime)) { + ogs_error("OpenAPI_av_eap_aka_prime_parseFromJSON() failed [ck_prime]"); + goto end; + } + } + + cJSON *ik_prime = cJSON_GetObjectItemCaseSensitive(av_eap_aka_primeJSON, "ikPrime"); + + if (ik_prime) { + if (!cJSON_IsString(ik_prime)) { + ogs_error("OpenAPI_av_eap_aka_prime_parseFromJSON() failed [ik_prime]"); + goto end; + } + } + + av_eap_aka_prime_local_var = OpenAPI_av_eap_aka_prime_create ( + av_typeVariable, + ogs_strdup(rand->valuestring), + xres ? ogs_strdup(xres->valuestring) : NULL, + ogs_strdup(autn->valuestring), + ck_prime ? ogs_strdup(ck_prime->valuestring) : NULL, + ik_prime ? ogs_strdup(ik_prime->valuestring) : NULL + ); + + return av_eap_aka_prime_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/av_eap_aka_prime.h b/lib/sbi/openapi/model/av_eap_aka_prime.h new file mode 100644 index 0000000000..baf6e74e37 --- /dev/null +++ b/lib/sbi/openapi/model/av_eap_aka_prime.h @@ -0,0 +1,48 @@ +/* + * av_eap_aka_prime.h + * + * + */ + +#ifndef _OpenAPI_av_eap_aka_prime_H_ +#define _OpenAPI_av_eap_aka_prime_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "av_type.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_av_eap_aka_prime_s OpenAPI_av_eap_aka_prime_t; +typedef struct OpenAPI_av_eap_aka_prime_s { + OpenAPI_av_type_e av_type; + char *rand; + char *xres; + char *autn; + char *ck_prime; + char *ik_prime; +} OpenAPI_av_eap_aka_prime_t; + +OpenAPI_av_eap_aka_prime_t *OpenAPI_av_eap_aka_prime_create( + OpenAPI_av_type_e av_type, + char *rand, + char *xres, + char *autn, + char *ck_prime, + char *ik_prime + ); +void OpenAPI_av_eap_aka_prime_free(OpenAPI_av_eap_aka_prime_t *av_eap_aka_prime); +OpenAPI_av_eap_aka_prime_t *OpenAPI_av_eap_aka_prime_parseFromJSON(cJSON *av_eap_aka_primeJSON); +cJSON *OpenAPI_av_eap_aka_prime_convertToJSON(OpenAPI_av_eap_aka_prime_t *av_eap_aka_prime); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_av_eap_aka_prime_H_ */ + diff --git a/lib/sbi/openapi/model/av_eps_aka.c b/lib/sbi/openapi/model/av_eps_aka.c new file mode 100644 index 0000000000..d4ea6cc36d --- /dev/null +++ b/lib/sbi/openapi/model/av_eps_aka.c @@ -0,0 +1,180 @@ + +#include +#include +#include +#include "av_eps_aka.h" + +OpenAPI_av_eps_aka_t *OpenAPI_av_eps_aka_create( + OpenAPI_hss_av_type_t *av_type, + char *rand, + char *xres, + char *autn, + char *kasme + ) +{ + OpenAPI_av_eps_aka_t *av_eps_aka_local_var = OpenAPI_malloc(sizeof(OpenAPI_av_eps_aka_t)); + if (!av_eps_aka_local_var) { + return NULL; + } + av_eps_aka_local_var->av_type = av_type; + av_eps_aka_local_var->rand = rand; + av_eps_aka_local_var->xres = xres; + av_eps_aka_local_var->autn = autn; + av_eps_aka_local_var->kasme = kasme; + + return av_eps_aka_local_var; +} + +void OpenAPI_av_eps_aka_free(OpenAPI_av_eps_aka_t *av_eps_aka) +{ + if (NULL == 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); + ogs_free(av_eps_aka->kasme); + ogs_free(av_eps_aka); +} + +cJSON *OpenAPI_av_eps_aka_convertToJSON(OpenAPI_av_eps_aka_t *av_eps_aka) +{ + cJSON *item = NULL; + + if (av_eps_aka == NULL) { + ogs_error("OpenAPI_av_eps_aka_convertToJSON() failed [AvEpsAka]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!av_eps_aka->av_type) { + 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) { + ogs_error("OpenAPI_av_eps_aka_convertToJSON() failed [av_type]"); + goto end; + } + + if (!av_eps_aka->rand) { + ogs_error("OpenAPI_av_eps_aka_convertToJSON() failed [rand]"); + goto end; + } + if (cJSON_AddStringToObject(item, "rand", av_eps_aka->rand) == NULL) { + ogs_error("OpenAPI_av_eps_aka_convertToJSON() failed [rand]"); + goto end; + } + + if (!av_eps_aka->xres) { + ogs_error("OpenAPI_av_eps_aka_convertToJSON() failed [xres]"); + goto end; + } + if (cJSON_AddStringToObject(item, "xres", av_eps_aka->xres) == NULL) { + ogs_error("OpenAPI_av_eps_aka_convertToJSON() failed [xres]"); + goto end; + } + + if (!av_eps_aka->autn) { + ogs_error("OpenAPI_av_eps_aka_convertToJSON() failed [autn]"); + goto end; + } + if (cJSON_AddStringToObject(item, "autn", av_eps_aka->autn) == NULL) { + ogs_error("OpenAPI_av_eps_aka_convertToJSON() failed [autn]"); + goto end; + } + + if (!av_eps_aka->kasme) { + ogs_error("OpenAPI_av_eps_aka_convertToJSON() failed [kasme]"); + goto end; + } + if (cJSON_AddStringToObject(item, "kasme", av_eps_aka->kasme) == NULL) { + ogs_error("OpenAPI_av_eps_aka_convertToJSON() failed [kasme]"); + goto end; + } + +end: + return item; +} + +OpenAPI_av_eps_aka_t *OpenAPI_av_eps_aka_parseFromJSON(cJSON *av_eps_akaJSON) +{ + OpenAPI_av_eps_aka_t *av_eps_aka_local_var = NULL; + cJSON *av_type = cJSON_GetObjectItemCaseSensitive(av_eps_akaJSON, "avType"); + if (!av_type) { + ogs_error("OpenAPI_av_eps_aka_parseFromJSON() failed [av_type]"); + goto end; + } + + OpenAPI_hss_av_type_t *av_type_local_nonprim = NULL; + + av_type_local_nonprim = OpenAPI_hss_av_type_parseFromJSON(av_type); + + cJSON *rand = cJSON_GetObjectItemCaseSensitive(av_eps_akaJSON, "rand"); + if (!rand) { + ogs_error("OpenAPI_av_eps_aka_parseFromJSON() failed [rand]"); + goto end; + } + + + if (!cJSON_IsString(rand)) { + ogs_error("OpenAPI_av_eps_aka_parseFromJSON() failed [rand]"); + goto end; + } + + cJSON *xres = cJSON_GetObjectItemCaseSensitive(av_eps_akaJSON, "xres"); + if (!xres) { + ogs_error("OpenAPI_av_eps_aka_parseFromJSON() failed [xres]"); + goto end; + } + + + if (!cJSON_IsString(xres)) { + ogs_error("OpenAPI_av_eps_aka_parseFromJSON() failed [xres]"); + goto end; + } + + cJSON *autn = cJSON_GetObjectItemCaseSensitive(av_eps_akaJSON, "autn"); + if (!autn) { + ogs_error("OpenAPI_av_eps_aka_parseFromJSON() failed [autn]"); + goto end; + } + + + if (!cJSON_IsString(autn)) { + ogs_error("OpenAPI_av_eps_aka_parseFromJSON() failed [autn]"); + goto end; + } + + cJSON *kasme = cJSON_GetObjectItemCaseSensitive(av_eps_akaJSON, "kasme"); + if (!kasme) { + ogs_error("OpenAPI_av_eps_aka_parseFromJSON() failed [kasme]"); + goto end; + } + + + if (!cJSON_IsString(kasme)) { + ogs_error("OpenAPI_av_eps_aka_parseFromJSON() failed [kasme]"); + goto end; + } + + av_eps_aka_local_var = OpenAPI_av_eps_aka_create ( + av_type_local_nonprim, + ogs_strdup(rand->valuestring), + ogs_strdup(xres->valuestring), + ogs_strdup(autn->valuestring), + ogs_strdup(kasme->valuestring) + ); + + return av_eps_aka_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/av_eps_aka.h b/lib/sbi/openapi/model/av_eps_aka.h new file mode 100644 index 0000000000..d55be36bdc --- /dev/null +++ b/lib/sbi/openapi/model/av_eps_aka.h @@ -0,0 +1,46 @@ +/* + * av_eps_aka.h + * + * + */ + +#ifndef _OpenAPI_av_eps_aka_H_ +#define _OpenAPI_av_eps_aka_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "hss_av_type.h" + +#ifdef __cplusplus +extern "C" { +#endif + +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; + char *rand; + char *xres; + char *autn; + char *kasme; +} OpenAPI_av_eps_aka_t; + +OpenAPI_av_eps_aka_t *OpenAPI_av_eps_aka_create( + OpenAPI_hss_av_type_t *av_type, + char *rand, + char *xres, + char *autn, + char *kasme + ); +void OpenAPI_av_eps_aka_free(OpenAPI_av_eps_aka_t *av_eps_aka); +OpenAPI_av_eps_aka_t *OpenAPI_av_eps_aka_parseFromJSON(cJSON *av_eps_akaJSON); +cJSON *OpenAPI_av_eps_aka_convertToJSON(OpenAPI_av_eps_aka_t *av_eps_aka); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_av_eps_aka_H_ */ + diff --git a/lib/sbi/openapi/model/av_ims_gba_eap_aka.c b/lib/sbi/openapi/model/av_ims_gba_eap_aka.c new file mode 100644 index 0000000000..7140f100eb --- /dev/null +++ b/lib/sbi/openapi/model/av_ims_gba_eap_aka.c @@ -0,0 +1,205 @@ + +#include +#include +#include +#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, + char *rand, + char *xres, + char *autn, + char *ck, + char *ik + ) +{ + OpenAPI_av_ims_gba_eap_aka_t *av_ims_gba_eap_aka_local_var = OpenAPI_malloc(sizeof(OpenAPI_av_ims_gba_eap_aka_t)); + if (!av_ims_gba_eap_aka_local_var) { + return NULL; + } + av_ims_gba_eap_aka_local_var->av_type = av_type; + av_ims_gba_eap_aka_local_var->rand = rand; + av_ims_gba_eap_aka_local_var->xres = xres; + av_ims_gba_eap_aka_local_var->autn = autn; + av_ims_gba_eap_aka_local_var->ck = ck; + av_ims_gba_eap_aka_local_var->ik = ik; + + return av_ims_gba_eap_aka_local_var; +} + +void OpenAPI_av_ims_gba_eap_aka_free(OpenAPI_av_ims_gba_eap_aka_t *av_ims_gba_eap_aka) +{ + if (NULL == av_ims_gba_eap_aka) { + 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); + ogs_free(av_ims_gba_eap_aka->ck); + ogs_free(av_ims_gba_eap_aka->ik); + ogs_free(av_ims_gba_eap_aka); +} + +cJSON *OpenAPI_av_ims_gba_eap_aka_convertToJSON(OpenAPI_av_ims_gba_eap_aka_t *av_ims_gba_eap_aka) +{ + cJSON *item = NULL; + + if (av_ims_gba_eap_aka == NULL) { + ogs_error("OpenAPI_av_ims_gba_eap_aka_convertToJSON() failed [AvImsGbaEapAka]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!av_ims_gba_eap_aka->av_type) { + 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) { + ogs_error("OpenAPI_av_ims_gba_eap_aka_convertToJSON() failed [av_type]"); + goto end; + } + + if (!av_ims_gba_eap_aka->rand) { + ogs_error("OpenAPI_av_ims_gba_eap_aka_convertToJSON() failed [rand]"); + goto end; + } + if (cJSON_AddStringToObject(item, "rand", av_ims_gba_eap_aka->rand) == NULL) { + ogs_error("OpenAPI_av_ims_gba_eap_aka_convertToJSON() failed [rand]"); + goto end; + } + + if (!av_ims_gba_eap_aka->xres) { + ogs_error("OpenAPI_av_ims_gba_eap_aka_convertToJSON() failed [xres]"); + goto end; + } + if (cJSON_AddStringToObject(item, "xres", av_ims_gba_eap_aka->xres) == NULL) { + ogs_error("OpenAPI_av_ims_gba_eap_aka_convertToJSON() failed [xres]"); + goto end; + } + + if (!av_ims_gba_eap_aka->autn) { + ogs_error("OpenAPI_av_ims_gba_eap_aka_convertToJSON() failed [autn]"); + goto end; + } + if (cJSON_AddStringToObject(item, "autn", av_ims_gba_eap_aka->autn) == NULL) { + ogs_error("OpenAPI_av_ims_gba_eap_aka_convertToJSON() failed [autn]"); + goto end; + } + + if (!av_ims_gba_eap_aka->ck) { + ogs_error("OpenAPI_av_ims_gba_eap_aka_convertToJSON() failed [ck]"); + goto end; + } + if (cJSON_AddStringToObject(item, "ck", av_ims_gba_eap_aka->ck) == NULL) { + ogs_error("OpenAPI_av_ims_gba_eap_aka_convertToJSON() failed [ck]"); + goto end; + } + + if (!av_ims_gba_eap_aka->ik) { + ogs_error("OpenAPI_av_ims_gba_eap_aka_convertToJSON() failed [ik]"); + goto end; + } + if (cJSON_AddStringToObject(item, "ik", av_ims_gba_eap_aka->ik) == NULL) { + ogs_error("OpenAPI_av_ims_gba_eap_aka_convertToJSON() failed [ik]"); + goto end; + } + +end: + return item; +} + +OpenAPI_av_ims_gba_eap_aka_t *OpenAPI_av_ims_gba_eap_aka_parseFromJSON(cJSON *av_ims_gba_eap_akaJSON) +{ + OpenAPI_av_ims_gba_eap_aka_t *av_ims_gba_eap_aka_local_var = NULL; + cJSON *av_type = cJSON_GetObjectItemCaseSensitive(av_ims_gba_eap_akaJSON, "avType"); + if (!av_type) { + ogs_error("OpenAPI_av_ims_gba_eap_aka_parseFromJSON() failed [av_type]"); + goto end; + } + + OpenAPI_hss_av_type_t *av_type_local_nonprim = NULL; + + av_type_local_nonprim = OpenAPI_hss_av_type_parseFromJSON(av_type); + + cJSON *rand = cJSON_GetObjectItemCaseSensitive(av_ims_gba_eap_akaJSON, "rand"); + if (!rand) { + ogs_error("OpenAPI_av_ims_gba_eap_aka_parseFromJSON() failed [rand]"); + goto end; + } + + + if (!cJSON_IsString(rand)) { + ogs_error("OpenAPI_av_ims_gba_eap_aka_parseFromJSON() failed [rand]"); + goto end; + } + + cJSON *xres = cJSON_GetObjectItemCaseSensitive(av_ims_gba_eap_akaJSON, "xres"); + if (!xres) { + ogs_error("OpenAPI_av_ims_gba_eap_aka_parseFromJSON() failed [xres]"); + goto end; + } + + + if (!cJSON_IsString(xres)) { + ogs_error("OpenAPI_av_ims_gba_eap_aka_parseFromJSON() failed [xres]"); + goto end; + } + + cJSON *autn = cJSON_GetObjectItemCaseSensitive(av_ims_gba_eap_akaJSON, "autn"); + if (!autn) { + ogs_error("OpenAPI_av_ims_gba_eap_aka_parseFromJSON() failed [autn]"); + goto end; + } + + + if (!cJSON_IsString(autn)) { + ogs_error("OpenAPI_av_ims_gba_eap_aka_parseFromJSON() failed [autn]"); + goto end; + } + + cJSON *ck = cJSON_GetObjectItemCaseSensitive(av_ims_gba_eap_akaJSON, "ck"); + if (!ck) { + ogs_error("OpenAPI_av_ims_gba_eap_aka_parseFromJSON() failed [ck]"); + goto end; + } + + + if (!cJSON_IsString(ck)) { + ogs_error("OpenAPI_av_ims_gba_eap_aka_parseFromJSON() failed [ck]"); + goto end; + } + + cJSON *ik = cJSON_GetObjectItemCaseSensitive(av_ims_gba_eap_akaJSON, "ik"); + if (!ik) { + ogs_error("OpenAPI_av_ims_gba_eap_aka_parseFromJSON() failed [ik]"); + goto end; + } + + + if (!cJSON_IsString(ik)) { + ogs_error("OpenAPI_av_ims_gba_eap_aka_parseFromJSON() failed [ik]"); + goto end; + } + + av_ims_gba_eap_aka_local_var = OpenAPI_av_ims_gba_eap_aka_create ( + av_type_local_nonprim, + ogs_strdup(rand->valuestring), + ogs_strdup(xres->valuestring), + ogs_strdup(autn->valuestring), + ogs_strdup(ck->valuestring), + ogs_strdup(ik->valuestring) + ); + + return av_ims_gba_eap_aka_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/av_ims_gba_eap_aka.h b/lib/sbi/openapi/model/av_ims_gba_eap_aka.h new file mode 100644 index 0000000000..e0dbefea56 --- /dev/null +++ b/lib/sbi/openapi/model/av_ims_gba_eap_aka.h @@ -0,0 +1,48 @@ +/* + * av_ims_gba_eap_aka.h + * + * + */ + +#ifndef _OpenAPI_av_ims_gba_eap_aka_H_ +#define _OpenAPI_av_ims_gba_eap_aka_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "hss_av_type.h" + +#ifdef __cplusplus +extern "C" { +#endif + +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; + char *rand; + char *xres; + char *autn; + char *ck; + char *ik; +} 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, + char *rand, + char *xres, + char *autn, + char *ck, + char *ik + ); +void OpenAPI_av_ims_gba_eap_aka_free(OpenAPI_av_ims_gba_eap_aka_t *av_ims_gba_eap_aka); +OpenAPI_av_ims_gba_eap_aka_t *OpenAPI_av_ims_gba_eap_aka_parseFromJSON(cJSON *av_ims_gba_eap_akaJSON); +cJSON *OpenAPI_av_ims_gba_eap_aka_convertToJSON(OpenAPI_av_ims_gba_eap_aka_t *av_ims_gba_eap_aka); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_av_ims_gba_eap_aka_H_ */ + diff --git a/lib/sbi/openapi/model/av_type.c b/lib/sbi/openapi/model/av_type.c new file mode 100644 index 0000000000..18cfeb4645 --- /dev/null +++ b/lib/sbi/openapi/model/av_type.c @@ -0,0 +1,30 @@ + +#include +#include +#include +#include "av_type.h" + +char* OpenAPI_av_type_ToString(OpenAPI_av_type_e av_type) +{ + const char *av_typeArray[] = { "NULL", "5G_HE_AKA", "EAP_AKA_PRIME" }; + size_t sizeofArray = sizeof(av_typeArray) / sizeof(av_typeArray[0]); + if (av_type < sizeofArray) + return (char *)av_typeArray[av_type]; + else + return (char *)"Unknown"; +} + +OpenAPI_av_type_e OpenAPI_av_type_FromString(char* av_type) +{ + int stringToReturn = 0; + const char *av_typeArray[] = { "NULL", "5G_HE_AKA", "EAP_AKA_PRIME" }; + size_t sizeofArray = sizeof(av_typeArray) / sizeof(av_typeArray[0]); + while (stringToReturn < sizeofArray) { + if (strcmp(av_type, av_typeArray[stringToReturn]) == 0) { + return stringToReturn; + } + stringToReturn++; + } + return 0; +} + diff --git a/lib/sbi/openapi/model/av_type.h b/lib/sbi/openapi/model/av_type.h new file mode 100644 index 0000000000..2f296f09a8 --- /dev/null +++ b/lib/sbi/openapi/model/av_type.h @@ -0,0 +1,31 @@ +/* + * av_type.h + * + * + */ + +#ifndef _OpenAPI_av_type_H_ +#define _OpenAPI_av_type_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { OpenAPI_av_type_NULL = 0, OpenAPI_av_type_5G_HE_AKA, OpenAPI_av_type_EAP_AKA_PRIME } OpenAPI_av_type_e; + +char* OpenAPI_av_type_ToString(OpenAPI_av_type_e av_type); + +OpenAPI_av_type_e OpenAPI_av_type_FromString(char* av_type); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_av_type_H_ */ + diff --git a/lib/sbi/openapi/model/backup_amf_info.c b/lib/sbi/openapi/model/backup_amf_info.c new file mode 100644 index 0000000000..12aa5a4ac4 --- /dev/null +++ b/lib/sbi/openapi/model/backup_amf_info.c @@ -0,0 +1,126 @@ + +#include +#include +#include +#include "backup_amf_info.h" + +OpenAPI_backup_amf_info_t *OpenAPI_backup_amf_info_create( + char *backup_amf, + OpenAPI_list_t *guami_list + ) +{ + OpenAPI_backup_amf_info_t *backup_amf_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_backup_amf_info_t)); + if (!backup_amf_info_local_var) { + return NULL; + } + backup_amf_info_local_var->backup_amf = backup_amf; + backup_amf_info_local_var->guami_list = guami_list; + + return backup_amf_info_local_var; +} + +void OpenAPI_backup_amf_info_free(OpenAPI_backup_amf_info_t *backup_amf_info) +{ + if (NULL == backup_amf_info) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(backup_amf_info->backup_amf); + OpenAPI_list_for_each(backup_amf_info->guami_list, node) { + OpenAPI_guami_free(node->data); + } + OpenAPI_list_free(backup_amf_info->guami_list); + ogs_free(backup_amf_info); +} + +cJSON *OpenAPI_backup_amf_info_convertToJSON(OpenAPI_backup_amf_info_t *backup_amf_info) +{ + cJSON *item = NULL; + + if (backup_amf_info == NULL) { + ogs_error("OpenAPI_backup_amf_info_convertToJSON() failed [BackupAmfInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!backup_amf_info->backup_amf) { + ogs_error("OpenAPI_backup_amf_info_convertToJSON() failed [backup_amf]"); + goto end; + } + if (cJSON_AddStringToObject(item, "backupAmf", backup_amf_info->backup_amf) == NULL) { + ogs_error("OpenAPI_backup_amf_info_convertToJSON() failed [backup_amf]"); + goto end; + } + + if (backup_amf_info->guami_list) { + cJSON *guami_listList = cJSON_AddArrayToObject(item, "guamiList"); + if (guami_listList == NULL) { + ogs_error("OpenAPI_backup_amf_info_convertToJSON() failed [guami_list]"); + goto end; + } + + OpenAPI_lnode_t *guami_list_node; + if (backup_amf_info->guami_list) { + OpenAPI_list_for_each(backup_amf_info->guami_list, guami_list_node) { + cJSON *itemLocal = OpenAPI_guami_convertToJSON(guami_list_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_backup_amf_info_convertToJSON() failed [guami_list]"); + goto end; + } + cJSON_AddItemToArray(guami_listList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_backup_amf_info_t *OpenAPI_backup_amf_info_parseFromJSON(cJSON *backup_amf_infoJSON) +{ + OpenAPI_backup_amf_info_t *backup_amf_info_local_var = NULL; + cJSON *backup_amf = cJSON_GetObjectItemCaseSensitive(backup_amf_infoJSON, "backupAmf"); + if (!backup_amf) { + ogs_error("OpenAPI_backup_amf_info_parseFromJSON() failed [backup_amf]"); + goto end; + } + + + if (!cJSON_IsString(backup_amf)) { + ogs_error("OpenAPI_backup_amf_info_parseFromJSON() failed [backup_amf]"); + goto end; + } + + cJSON *guami_list = cJSON_GetObjectItemCaseSensitive(backup_amf_infoJSON, "guamiList"); + + OpenAPI_list_t *guami_listList; + if (guami_list) { + cJSON *guami_list_local_nonprimitive; + if (!cJSON_IsArray(guami_list)) { + ogs_error("OpenAPI_backup_amf_info_parseFromJSON() failed [guami_list]"); + goto end; + } + + guami_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(guami_list_local_nonprimitive, guami_list ) { + if (!cJSON_IsObject(guami_list_local_nonprimitive)) { + ogs_error("OpenAPI_backup_amf_info_parseFromJSON() failed [guami_list]"); + goto end; + } + OpenAPI_guami_t *guami_listItem = OpenAPI_guami_parseFromJSON(guami_list_local_nonprimitive); + + OpenAPI_list_add(guami_listList, guami_listItem); + } + } + + backup_amf_info_local_var = OpenAPI_backup_amf_info_create ( + ogs_strdup(backup_amf->valuestring), + guami_list ? guami_listList : NULL + ); + + return backup_amf_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/backup_amf_info.h b/lib/sbi/openapi/model/backup_amf_info.h new file mode 100644 index 0000000000..0091c093c7 --- /dev/null +++ b/lib/sbi/openapi/model/backup_amf_info.h @@ -0,0 +1,40 @@ +/* + * backup_amf_info.h + * + * + */ + +#ifndef _OpenAPI_backup_amf_info_H_ +#define _OpenAPI_backup_amf_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "guami.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_backup_amf_info_s OpenAPI_backup_amf_info_t; +typedef struct OpenAPI_backup_amf_info_s { + char *backup_amf; + OpenAPI_list_t *guami_list; +} OpenAPI_backup_amf_info_t; + +OpenAPI_backup_amf_info_t *OpenAPI_backup_amf_info_create( + char *backup_amf, + OpenAPI_list_t *guami_list + ); +void OpenAPI_backup_amf_info_free(OpenAPI_backup_amf_info_t *backup_amf_info); +OpenAPI_backup_amf_info_t *OpenAPI_backup_amf_info_parseFromJSON(cJSON *backup_amf_infoJSON); +cJSON *OpenAPI_backup_amf_info_convertToJSON(OpenAPI_backup_amf_info_t *backup_amf_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_backup_amf_info_H_ */ + diff --git a/lib/sbi/openapi/model/battery_indication.c b/lib/sbi/openapi/model/battery_indication.c new file mode 100644 index 0000000000..d22b213361 --- /dev/null +++ b/lib/sbi/openapi/model/battery_indication.c @@ -0,0 +1,108 @@ + +#include +#include +#include +#include "battery_indication.h" + +OpenAPI_battery_indication_t *OpenAPI_battery_indication_create( + int battery_ind, + int replaceable_ind, + int rechargeable_ind + ) +{ + OpenAPI_battery_indication_t *battery_indication_local_var = OpenAPI_malloc(sizeof(OpenAPI_battery_indication_t)); + if (!battery_indication_local_var) { + return NULL; + } + battery_indication_local_var->battery_ind = battery_ind; + battery_indication_local_var->replaceable_ind = replaceable_ind; + battery_indication_local_var->rechargeable_ind = rechargeable_ind; + + return battery_indication_local_var; +} + +void OpenAPI_battery_indication_free(OpenAPI_battery_indication_t *battery_indication) +{ + if (NULL == battery_indication) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(battery_indication); +} + +cJSON *OpenAPI_battery_indication_convertToJSON(OpenAPI_battery_indication_t *battery_indication) +{ + cJSON *item = NULL; + + if (battery_indication == NULL) { + ogs_error("OpenAPI_battery_indication_convertToJSON() failed [BatteryIndication]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (battery_indication->battery_ind >= 0) { + if (cJSON_AddBoolToObject(item, "batteryInd", battery_indication->battery_ind) == NULL) { + ogs_error("OpenAPI_battery_indication_convertToJSON() failed [battery_ind]"); + goto end; + } + } + + if (battery_indication->replaceable_ind >= 0) { + if (cJSON_AddBoolToObject(item, "replaceableInd", battery_indication->replaceable_ind) == NULL) { + ogs_error("OpenAPI_battery_indication_convertToJSON() failed [replaceable_ind]"); + goto end; + } + } + + if (battery_indication->rechargeable_ind >= 0) { + if (cJSON_AddBoolToObject(item, "rechargeableInd", battery_indication->rechargeable_ind) == NULL) { + ogs_error("OpenAPI_battery_indication_convertToJSON() failed [rechargeable_ind]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_battery_indication_t *OpenAPI_battery_indication_parseFromJSON(cJSON *battery_indicationJSON) +{ + OpenAPI_battery_indication_t *battery_indication_local_var = NULL; + cJSON *battery_ind = cJSON_GetObjectItemCaseSensitive(battery_indicationJSON, "batteryInd"); + + if (battery_ind) { + if (!cJSON_IsBool(battery_ind)) { + ogs_error("OpenAPI_battery_indication_parseFromJSON() failed [battery_ind]"); + goto end; + } + } + + cJSON *replaceable_ind = cJSON_GetObjectItemCaseSensitive(battery_indicationJSON, "replaceableInd"); + + if (replaceable_ind) { + if (!cJSON_IsBool(replaceable_ind)) { + ogs_error("OpenAPI_battery_indication_parseFromJSON() failed [replaceable_ind]"); + goto end; + } + } + + cJSON *rechargeable_ind = cJSON_GetObjectItemCaseSensitive(battery_indicationJSON, "rechargeableInd"); + + if (rechargeable_ind) { + if (!cJSON_IsBool(rechargeable_ind)) { + ogs_error("OpenAPI_battery_indication_parseFromJSON() failed [rechargeable_ind]"); + goto end; + } + } + + battery_indication_local_var = OpenAPI_battery_indication_create ( + battery_ind ? battery_ind->valueint : 0, + replaceable_ind ? replaceable_ind->valueint : 0, + rechargeable_ind ? rechargeable_ind->valueint : 0 + ); + + return battery_indication_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/battery_indication.h b/lib/sbi/openapi/model/battery_indication.h new file mode 100644 index 0000000000..d57319dcd6 --- /dev/null +++ b/lib/sbi/openapi/model/battery_indication.h @@ -0,0 +1,41 @@ +/* + * battery_indication.h + * + * + */ + +#ifndef _OpenAPI_battery_indication_H_ +#define _OpenAPI_battery_indication_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_battery_indication_s OpenAPI_battery_indication_t; +typedef struct OpenAPI_battery_indication_s { + int battery_ind; + int replaceable_ind; + int rechargeable_ind; +} OpenAPI_battery_indication_t; + +OpenAPI_battery_indication_t *OpenAPI_battery_indication_create( + int battery_ind, + int replaceable_ind, + int rechargeable_ind + ); +void OpenAPI_battery_indication_free(OpenAPI_battery_indication_t *battery_indication); +OpenAPI_battery_indication_t *OpenAPI_battery_indication_parseFromJSON(cJSON *battery_indicationJSON); +cJSON *OpenAPI_battery_indication_convertToJSON(OpenAPI_battery_indication_t *battery_indication); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_battery_indication_H_ */ + diff --git a/lib/sbi/openapi/model/battery_indication_rm.c b/lib/sbi/openapi/model/battery_indication_rm.c new file mode 100644 index 0000000000..43af2a9a1b --- /dev/null +++ b/lib/sbi/openapi/model/battery_indication_rm.c @@ -0,0 +1,108 @@ + +#include +#include +#include +#include "battery_indication_rm.h" + +OpenAPI_battery_indication_rm_t *OpenAPI_battery_indication_rm_create( + int battery_ind, + int replaceable_ind, + int rechargeable_ind + ) +{ + OpenAPI_battery_indication_rm_t *battery_indication_rm_local_var = OpenAPI_malloc(sizeof(OpenAPI_battery_indication_rm_t)); + if (!battery_indication_rm_local_var) { + return NULL; + } + battery_indication_rm_local_var->battery_ind = battery_ind; + battery_indication_rm_local_var->replaceable_ind = replaceable_ind; + battery_indication_rm_local_var->rechargeable_ind = rechargeable_ind; + + return battery_indication_rm_local_var; +} + +void OpenAPI_battery_indication_rm_free(OpenAPI_battery_indication_rm_t *battery_indication_rm) +{ + if (NULL == battery_indication_rm) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(battery_indication_rm); +} + +cJSON *OpenAPI_battery_indication_rm_convertToJSON(OpenAPI_battery_indication_rm_t *battery_indication_rm) +{ + cJSON *item = NULL; + + if (battery_indication_rm == NULL) { + ogs_error("OpenAPI_battery_indication_rm_convertToJSON() failed [BatteryIndicationRm]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (battery_indication_rm->battery_ind >= 0) { + if (cJSON_AddBoolToObject(item, "batteryInd", battery_indication_rm->battery_ind) == NULL) { + ogs_error("OpenAPI_battery_indication_rm_convertToJSON() failed [battery_ind]"); + goto end; + } + } + + if (battery_indication_rm->replaceable_ind >= 0) { + if (cJSON_AddBoolToObject(item, "replaceableInd", battery_indication_rm->replaceable_ind) == NULL) { + ogs_error("OpenAPI_battery_indication_rm_convertToJSON() failed [replaceable_ind]"); + goto end; + } + } + + if (battery_indication_rm->rechargeable_ind >= 0) { + if (cJSON_AddBoolToObject(item, "rechargeableInd", battery_indication_rm->rechargeable_ind) == NULL) { + ogs_error("OpenAPI_battery_indication_rm_convertToJSON() failed [rechargeable_ind]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_battery_indication_rm_t *OpenAPI_battery_indication_rm_parseFromJSON(cJSON *battery_indication_rmJSON) +{ + OpenAPI_battery_indication_rm_t *battery_indication_rm_local_var = NULL; + cJSON *battery_ind = cJSON_GetObjectItemCaseSensitive(battery_indication_rmJSON, "batteryInd"); + + if (battery_ind) { + if (!cJSON_IsBool(battery_ind)) { + ogs_error("OpenAPI_battery_indication_rm_parseFromJSON() failed [battery_ind]"); + goto end; + } + } + + cJSON *replaceable_ind = cJSON_GetObjectItemCaseSensitive(battery_indication_rmJSON, "replaceableInd"); + + if (replaceable_ind) { + if (!cJSON_IsBool(replaceable_ind)) { + ogs_error("OpenAPI_battery_indication_rm_parseFromJSON() failed [replaceable_ind]"); + goto end; + } + } + + cJSON *rechargeable_ind = cJSON_GetObjectItemCaseSensitive(battery_indication_rmJSON, "rechargeableInd"); + + if (rechargeable_ind) { + if (!cJSON_IsBool(rechargeable_ind)) { + ogs_error("OpenAPI_battery_indication_rm_parseFromJSON() failed [rechargeable_ind]"); + goto end; + } + } + + battery_indication_rm_local_var = OpenAPI_battery_indication_rm_create ( + battery_ind ? battery_ind->valueint : 0, + replaceable_ind ? replaceable_ind->valueint : 0, + rechargeable_ind ? rechargeable_ind->valueint : 0 + ); + + return battery_indication_rm_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/battery_indication_rm.h b/lib/sbi/openapi/model/battery_indication_rm.h new file mode 100644 index 0000000000..8ebf8770b2 --- /dev/null +++ b/lib/sbi/openapi/model/battery_indication_rm.h @@ -0,0 +1,43 @@ +/* + * battery_indication_rm.h + * + * + */ + +#ifndef _OpenAPI_battery_indication_rm_H_ +#define _OpenAPI_battery_indication_rm_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "battery_indication.h" +#include "null_value.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_battery_indication_rm_s OpenAPI_battery_indication_rm_t; +typedef struct OpenAPI_battery_indication_rm_s { + int battery_ind; + int replaceable_ind; + int rechargeable_ind; +} OpenAPI_battery_indication_rm_t; + +OpenAPI_battery_indication_rm_t *OpenAPI_battery_indication_rm_create( + int battery_ind, + int replaceable_ind, + int rechargeable_ind + ); +void OpenAPI_battery_indication_rm_free(OpenAPI_battery_indication_rm_t *battery_indication_rm); +OpenAPI_battery_indication_rm_t *OpenAPI_battery_indication_rm_parseFromJSON(cJSON *battery_indication_rmJSON); +cJSON *OpenAPI_battery_indication_rm_convertToJSON(OpenAPI_battery_indication_rm_t *battery_indication_rm); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_battery_indication_rm_H_ */ + diff --git a/lib/sbi/openapi/model/bdt_data.c b/lib/sbi/openapi/model/bdt_data.c new file mode 100644 index 0000000000..d2280e16bd --- /dev/null +++ b/lib/sbi/openapi/model/bdt_data.c @@ -0,0 +1,236 @@ + +#include +#include +#include +#include "bdt_data.h" + +OpenAPI_bdt_data_t *OpenAPI_bdt_data_create( + char *asp_id, + OpenAPI_transfer_policy_t *trans_policy, + char *bdt_ref_id, + OpenAPI_network_area_info_2_t *nw_area_info, + int num_of_ues, + OpenAPI_usage_threshold_t *vol_per_ue, + char *dnn, + OpenAPI_snssai_t *snssai + ) +{ + OpenAPI_bdt_data_t *bdt_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_bdt_data_t)); + if (!bdt_data_local_var) { + return NULL; + } + bdt_data_local_var->asp_id = asp_id; + bdt_data_local_var->trans_policy = trans_policy; + bdt_data_local_var->bdt_ref_id = bdt_ref_id; + bdt_data_local_var->nw_area_info = nw_area_info; + bdt_data_local_var->num_of_ues = num_of_ues; + bdt_data_local_var->vol_per_ue = vol_per_ue; + bdt_data_local_var->dnn = dnn; + bdt_data_local_var->snssai = snssai; + + return bdt_data_local_var; +} + +void OpenAPI_bdt_data_free(OpenAPI_bdt_data_t *bdt_data) +{ + if (NULL == bdt_data) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(bdt_data->asp_id); + OpenAPI_transfer_policy_free(bdt_data->trans_policy); + ogs_free(bdt_data->bdt_ref_id); + OpenAPI_network_area_info_2_free(bdt_data->nw_area_info); + OpenAPI_usage_threshold_free(bdt_data->vol_per_ue); + ogs_free(bdt_data->dnn); + OpenAPI_snssai_free(bdt_data->snssai); + ogs_free(bdt_data); +} + +cJSON *OpenAPI_bdt_data_convertToJSON(OpenAPI_bdt_data_t *bdt_data) +{ + cJSON *item = NULL; + + if (bdt_data == NULL) { + ogs_error("OpenAPI_bdt_data_convertToJSON() failed [BdtData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!bdt_data->asp_id) { + ogs_error("OpenAPI_bdt_data_convertToJSON() failed [asp_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "aspId", bdt_data->asp_id) == NULL) { + ogs_error("OpenAPI_bdt_data_convertToJSON() failed [asp_id]"); + goto end; + } + + if (!bdt_data->trans_policy) { + ogs_error("OpenAPI_bdt_data_convertToJSON() failed [trans_policy]"); + goto end; + } + cJSON *trans_policy_local_JSON = OpenAPI_transfer_policy_convertToJSON(bdt_data->trans_policy); + if (trans_policy_local_JSON == NULL) { + ogs_error("OpenAPI_bdt_data_convertToJSON() failed [trans_policy]"); + goto end; + } + cJSON_AddItemToObject(item, "transPolicy", trans_policy_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_bdt_data_convertToJSON() failed [trans_policy]"); + goto end; + } + + if (bdt_data->bdt_ref_id) { + if (cJSON_AddStringToObject(item, "bdtRefId", bdt_data->bdt_ref_id) == NULL) { + ogs_error("OpenAPI_bdt_data_convertToJSON() failed [bdt_ref_id]"); + goto end; + } + } + + if (bdt_data->nw_area_info) { + cJSON *nw_area_info_local_JSON = OpenAPI_network_area_info_2_convertToJSON(bdt_data->nw_area_info); + if (nw_area_info_local_JSON == NULL) { + ogs_error("OpenAPI_bdt_data_convertToJSON() failed [nw_area_info]"); + goto end; + } + cJSON_AddItemToObject(item, "nwAreaInfo", nw_area_info_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_bdt_data_convertToJSON() failed [nw_area_info]"); + goto end; + } + } + + if (bdt_data->num_of_ues) { + if (cJSON_AddNumberToObject(item, "numOfUes", bdt_data->num_of_ues) == NULL) { + ogs_error("OpenAPI_bdt_data_convertToJSON() failed [num_of_ues]"); + goto end; + } + } + + if (bdt_data->vol_per_ue) { + cJSON *vol_per_ue_local_JSON = OpenAPI_usage_threshold_convertToJSON(bdt_data->vol_per_ue); + if (vol_per_ue_local_JSON == NULL) { + ogs_error("OpenAPI_bdt_data_convertToJSON() failed [vol_per_ue]"); + goto end; + } + cJSON_AddItemToObject(item, "volPerUe", vol_per_ue_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_bdt_data_convertToJSON() failed [vol_per_ue]"); + goto end; + } + } + + if (bdt_data->dnn) { + if (cJSON_AddStringToObject(item, "dnn", bdt_data->dnn) == NULL) { + ogs_error("OpenAPI_bdt_data_convertToJSON() failed [dnn]"); + goto end; + } + } + + if (bdt_data->snssai) { + cJSON *snssai_local_JSON = OpenAPI_snssai_convertToJSON(bdt_data->snssai); + if (snssai_local_JSON == NULL) { + ogs_error("OpenAPI_bdt_data_convertToJSON() failed [snssai]"); + goto end; + } + cJSON_AddItemToObject(item, "snssai", snssai_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_bdt_data_convertToJSON() failed [snssai]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_bdt_data_t *OpenAPI_bdt_data_parseFromJSON(cJSON *bdt_dataJSON) +{ + OpenAPI_bdt_data_t *bdt_data_local_var = NULL; + cJSON *asp_id = cJSON_GetObjectItemCaseSensitive(bdt_dataJSON, "aspId"); + if (!asp_id) { + ogs_error("OpenAPI_bdt_data_parseFromJSON() failed [asp_id]"); + goto end; + } + + + if (!cJSON_IsString(asp_id)) { + ogs_error("OpenAPI_bdt_data_parseFromJSON() failed [asp_id]"); + goto end; + } + + cJSON *trans_policy = cJSON_GetObjectItemCaseSensitive(bdt_dataJSON, "transPolicy"); + if (!trans_policy) { + ogs_error("OpenAPI_bdt_data_parseFromJSON() failed [trans_policy]"); + goto end; + } + + OpenAPI_transfer_policy_t *trans_policy_local_nonprim = NULL; + + trans_policy_local_nonprim = OpenAPI_transfer_policy_parseFromJSON(trans_policy); + + cJSON *bdt_ref_id = cJSON_GetObjectItemCaseSensitive(bdt_dataJSON, "bdtRefId"); + + if (bdt_ref_id) { + if (!cJSON_IsString(bdt_ref_id)) { + ogs_error("OpenAPI_bdt_data_parseFromJSON() failed [bdt_ref_id]"); + goto end; + } + } + + cJSON *nw_area_info = cJSON_GetObjectItemCaseSensitive(bdt_dataJSON, "nwAreaInfo"); + + OpenAPI_network_area_info_2_t *nw_area_info_local_nonprim = NULL; + if (nw_area_info) { + nw_area_info_local_nonprim = OpenAPI_network_area_info_2_parseFromJSON(nw_area_info); + } + + cJSON *num_of_ues = cJSON_GetObjectItemCaseSensitive(bdt_dataJSON, "numOfUes"); + + if (num_of_ues) { + if (!cJSON_IsNumber(num_of_ues)) { + ogs_error("OpenAPI_bdt_data_parseFromJSON() failed [num_of_ues]"); + goto end; + } + } + + cJSON *vol_per_ue = cJSON_GetObjectItemCaseSensitive(bdt_dataJSON, "volPerUe"); + + OpenAPI_usage_threshold_t *vol_per_ue_local_nonprim = NULL; + if (vol_per_ue) { + vol_per_ue_local_nonprim = OpenAPI_usage_threshold_parseFromJSON(vol_per_ue); + } + + cJSON *dnn = cJSON_GetObjectItemCaseSensitive(bdt_dataJSON, "dnn"); + + if (dnn) { + if (!cJSON_IsString(dnn)) { + ogs_error("OpenAPI_bdt_data_parseFromJSON() failed [dnn]"); + goto end; + } + } + + cJSON *snssai = cJSON_GetObjectItemCaseSensitive(bdt_dataJSON, "snssai"); + + OpenAPI_snssai_t *snssai_local_nonprim = NULL; + if (snssai) { + snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(snssai); + } + + bdt_data_local_var = OpenAPI_bdt_data_create ( + ogs_strdup(asp_id->valuestring), + trans_policy_local_nonprim, + bdt_ref_id ? ogs_strdup(bdt_ref_id->valuestring) : NULL, + nw_area_info ? nw_area_info_local_nonprim : NULL, + num_of_ues ? num_of_ues->valuedouble : 0, + vol_per_ue ? vol_per_ue_local_nonprim : NULL, + dnn ? ogs_strdup(dnn->valuestring) : NULL, + snssai ? snssai_local_nonprim : NULL + ); + + return bdt_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/bdt_data.h b/lib/sbi/openapi/model/bdt_data.h new file mode 100644 index 0000000000..f5b02bb348 --- /dev/null +++ b/lib/sbi/openapi/model/bdt_data.h @@ -0,0 +1,55 @@ +/* + * bdt_data.h + * + * Contains the background data transfer data. + */ + +#ifndef _OpenAPI_bdt_data_H_ +#define _OpenAPI_bdt_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "network_area_info_2.h" +#include "snssai.h" +#include "transfer_policy.h" +#include "usage_threshold.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_bdt_data_s OpenAPI_bdt_data_t; +typedef struct OpenAPI_bdt_data_s { + char *asp_id; + struct OpenAPI_transfer_policy_s *trans_policy; + char *bdt_ref_id; + struct OpenAPI_network_area_info_2_s *nw_area_info; + int num_of_ues; + struct OpenAPI_usage_threshold_s *vol_per_ue; + char *dnn; + struct OpenAPI_snssai_s *snssai; +} OpenAPI_bdt_data_t; + +OpenAPI_bdt_data_t *OpenAPI_bdt_data_create( + char *asp_id, + OpenAPI_transfer_policy_t *trans_policy, + char *bdt_ref_id, + OpenAPI_network_area_info_2_t *nw_area_info, + int num_of_ues, + OpenAPI_usage_threshold_t *vol_per_ue, + char *dnn, + OpenAPI_snssai_t *snssai + ); +void OpenAPI_bdt_data_free(OpenAPI_bdt_data_t *bdt_data); +OpenAPI_bdt_data_t *OpenAPI_bdt_data_parseFromJSON(cJSON *bdt_dataJSON); +cJSON *OpenAPI_bdt_data_convertToJSON(OpenAPI_bdt_data_t *bdt_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_bdt_data_H_ */ + diff --git a/lib/sbi/openapi/model/bdt_policy_data.c b/lib/sbi/openapi/model/bdt_policy_data.c new file mode 100644 index 0000000000..02556f0858 --- /dev/null +++ b/lib/sbi/openapi/model/bdt_policy_data.c @@ -0,0 +1,160 @@ + +#include +#include +#include +#include "bdt_policy_data.h" + +OpenAPI_bdt_policy_data_t *OpenAPI_bdt_policy_data_create( + char *inter_group_id, + char *supi, + char *bdt_ref_id, + char *dnn, + OpenAPI_snssai_t *snssai + ) +{ + OpenAPI_bdt_policy_data_t *bdt_policy_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_bdt_policy_data_t)); + if (!bdt_policy_data_local_var) { + return NULL; + } + bdt_policy_data_local_var->inter_group_id = inter_group_id; + bdt_policy_data_local_var->supi = supi; + bdt_policy_data_local_var->bdt_ref_id = bdt_ref_id; + bdt_policy_data_local_var->dnn = dnn; + bdt_policy_data_local_var->snssai = snssai; + + return bdt_policy_data_local_var; +} + +void OpenAPI_bdt_policy_data_free(OpenAPI_bdt_policy_data_t *bdt_policy_data) +{ + if (NULL == bdt_policy_data) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(bdt_policy_data->inter_group_id); + ogs_free(bdt_policy_data->supi); + ogs_free(bdt_policy_data->bdt_ref_id); + ogs_free(bdt_policy_data->dnn); + OpenAPI_snssai_free(bdt_policy_data->snssai); + ogs_free(bdt_policy_data); +} + +cJSON *OpenAPI_bdt_policy_data_convertToJSON(OpenAPI_bdt_policy_data_t *bdt_policy_data) +{ + cJSON *item = NULL; + + if (bdt_policy_data == NULL) { + ogs_error("OpenAPI_bdt_policy_data_convertToJSON() failed [BdtPolicyData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (bdt_policy_data->inter_group_id) { + if (cJSON_AddStringToObject(item, "interGroupId", bdt_policy_data->inter_group_id) == NULL) { + ogs_error("OpenAPI_bdt_policy_data_convertToJSON() failed [inter_group_id]"); + goto end; + } + } + + if (bdt_policy_data->supi) { + if (cJSON_AddStringToObject(item, "supi", bdt_policy_data->supi) == NULL) { + ogs_error("OpenAPI_bdt_policy_data_convertToJSON() failed [supi]"); + goto end; + } + } + + if (!bdt_policy_data->bdt_ref_id) { + ogs_error("OpenAPI_bdt_policy_data_convertToJSON() failed [bdt_ref_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "bdtRefId", bdt_policy_data->bdt_ref_id) == NULL) { + ogs_error("OpenAPI_bdt_policy_data_convertToJSON() failed [bdt_ref_id]"); + goto end; + } + + if (bdt_policy_data->dnn) { + if (cJSON_AddStringToObject(item, "dnn", bdt_policy_data->dnn) == NULL) { + ogs_error("OpenAPI_bdt_policy_data_convertToJSON() failed [dnn]"); + goto end; + } + } + + if (bdt_policy_data->snssai) { + cJSON *snssai_local_JSON = OpenAPI_snssai_convertToJSON(bdt_policy_data->snssai); + if (snssai_local_JSON == NULL) { + ogs_error("OpenAPI_bdt_policy_data_convertToJSON() failed [snssai]"); + goto end; + } + cJSON_AddItemToObject(item, "snssai", snssai_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_bdt_policy_data_convertToJSON() failed [snssai]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_bdt_policy_data_t *OpenAPI_bdt_policy_data_parseFromJSON(cJSON *bdt_policy_dataJSON) +{ + OpenAPI_bdt_policy_data_t *bdt_policy_data_local_var = NULL; + cJSON *inter_group_id = cJSON_GetObjectItemCaseSensitive(bdt_policy_dataJSON, "interGroupId"); + + if (inter_group_id) { + if (!cJSON_IsString(inter_group_id)) { + ogs_error("OpenAPI_bdt_policy_data_parseFromJSON() failed [inter_group_id]"); + goto end; + } + } + + cJSON *supi = cJSON_GetObjectItemCaseSensitive(bdt_policy_dataJSON, "supi"); + + if (supi) { + if (!cJSON_IsString(supi)) { + ogs_error("OpenAPI_bdt_policy_data_parseFromJSON() failed [supi]"); + goto end; + } + } + + cJSON *bdt_ref_id = cJSON_GetObjectItemCaseSensitive(bdt_policy_dataJSON, "bdtRefId"); + if (!bdt_ref_id) { + ogs_error("OpenAPI_bdt_policy_data_parseFromJSON() failed [bdt_ref_id]"); + goto end; + } + + + if (!cJSON_IsString(bdt_ref_id)) { + ogs_error("OpenAPI_bdt_policy_data_parseFromJSON() failed [bdt_ref_id]"); + goto end; + } + + cJSON *dnn = cJSON_GetObjectItemCaseSensitive(bdt_policy_dataJSON, "dnn"); + + if (dnn) { + if (!cJSON_IsString(dnn)) { + ogs_error("OpenAPI_bdt_policy_data_parseFromJSON() failed [dnn]"); + goto end; + } + } + + cJSON *snssai = cJSON_GetObjectItemCaseSensitive(bdt_policy_dataJSON, "snssai"); + + OpenAPI_snssai_t *snssai_local_nonprim = NULL; + if (snssai) { + snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(snssai); + } + + bdt_policy_data_local_var = OpenAPI_bdt_policy_data_create ( + inter_group_id ? ogs_strdup(inter_group_id->valuestring) : NULL, + supi ? ogs_strdup(supi->valuestring) : NULL, + ogs_strdup(bdt_ref_id->valuestring), + dnn ? ogs_strdup(dnn->valuestring) : NULL, + snssai ? snssai_local_nonprim : NULL + ); + + return bdt_policy_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/bdt_policy_data.h b/lib/sbi/openapi/model/bdt_policy_data.h new file mode 100644 index 0000000000..d3631c8a84 --- /dev/null +++ b/lib/sbi/openapi/model/bdt_policy_data.h @@ -0,0 +1,46 @@ +/* + * bdt_policy_data.h + * + * + */ + +#ifndef _OpenAPI_bdt_policy_data_H_ +#define _OpenAPI_bdt_policy_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "snssai.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_bdt_policy_data_s OpenAPI_bdt_policy_data_t; +typedef struct OpenAPI_bdt_policy_data_s { + char *inter_group_id; + char *supi; + char *bdt_ref_id; + char *dnn; + struct OpenAPI_snssai_s *snssai; +} OpenAPI_bdt_policy_data_t; + +OpenAPI_bdt_policy_data_t *OpenAPI_bdt_policy_data_create( + char *inter_group_id, + char *supi, + char *bdt_ref_id, + char *dnn, + OpenAPI_snssai_t *snssai + ); +void OpenAPI_bdt_policy_data_free(OpenAPI_bdt_policy_data_t *bdt_policy_data); +OpenAPI_bdt_policy_data_t *OpenAPI_bdt_policy_data_parseFromJSON(cJSON *bdt_policy_dataJSON); +cJSON *OpenAPI_bdt_policy_data_convertToJSON(OpenAPI_bdt_policy_data_t *bdt_policy_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_bdt_policy_data_H_ */ + diff --git a/lib/sbi/openapi/model/bdt_policy_data_patch.c b/lib/sbi/openapi/model/bdt_policy_data_patch.c new file mode 100644 index 0000000000..f23394314c --- /dev/null +++ b/lib/sbi/openapi/model/bdt_policy_data_patch.c @@ -0,0 +1,76 @@ + +#include +#include +#include +#include "bdt_policy_data_patch.h" + +OpenAPI_bdt_policy_data_patch_t *OpenAPI_bdt_policy_data_patch_create( + char *bdt_ref_id + ) +{ + OpenAPI_bdt_policy_data_patch_t *bdt_policy_data_patch_local_var = OpenAPI_malloc(sizeof(OpenAPI_bdt_policy_data_patch_t)); + if (!bdt_policy_data_patch_local_var) { + return NULL; + } + bdt_policy_data_patch_local_var->bdt_ref_id = bdt_ref_id; + + return bdt_policy_data_patch_local_var; +} + +void OpenAPI_bdt_policy_data_patch_free(OpenAPI_bdt_policy_data_patch_t *bdt_policy_data_patch) +{ + if (NULL == bdt_policy_data_patch) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(bdt_policy_data_patch->bdt_ref_id); + ogs_free(bdt_policy_data_patch); +} + +cJSON *OpenAPI_bdt_policy_data_patch_convertToJSON(OpenAPI_bdt_policy_data_patch_t *bdt_policy_data_patch) +{ + cJSON *item = NULL; + + if (bdt_policy_data_patch == NULL) { + ogs_error("OpenAPI_bdt_policy_data_patch_convertToJSON() failed [BdtPolicyDataPatch]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!bdt_policy_data_patch->bdt_ref_id) { + ogs_error("OpenAPI_bdt_policy_data_patch_convertToJSON() failed [bdt_ref_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "bdtRefId", bdt_policy_data_patch->bdt_ref_id) == NULL) { + ogs_error("OpenAPI_bdt_policy_data_patch_convertToJSON() failed [bdt_ref_id]"); + goto end; + } + +end: + return item; +} + +OpenAPI_bdt_policy_data_patch_t *OpenAPI_bdt_policy_data_patch_parseFromJSON(cJSON *bdt_policy_data_patchJSON) +{ + OpenAPI_bdt_policy_data_patch_t *bdt_policy_data_patch_local_var = NULL; + cJSON *bdt_ref_id = cJSON_GetObjectItemCaseSensitive(bdt_policy_data_patchJSON, "bdtRefId"); + if (!bdt_ref_id) { + ogs_error("OpenAPI_bdt_policy_data_patch_parseFromJSON() failed [bdt_ref_id]"); + goto end; + } + + + if (!cJSON_IsString(bdt_ref_id)) { + ogs_error("OpenAPI_bdt_policy_data_patch_parseFromJSON() failed [bdt_ref_id]"); + goto end; + } + + bdt_policy_data_patch_local_var = OpenAPI_bdt_policy_data_patch_create ( + ogs_strdup(bdt_ref_id->valuestring) + ); + + return bdt_policy_data_patch_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/bdt_policy_data_patch.h b/lib/sbi/openapi/model/bdt_policy_data_patch.h new file mode 100644 index 0000000000..f24327bf98 --- /dev/null +++ b/lib/sbi/openapi/model/bdt_policy_data_patch.h @@ -0,0 +1,37 @@ +/* + * bdt_policy_data_patch.h + * + * + */ + +#ifndef _OpenAPI_bdt_policy_data_patch_H_ +#define _OpenAPI_bdt_policy_data_patch_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_bdt_policy_data_patch_s OpenAPI_bdt_policy_data_patch_t; +typedef struct OpenAPI_bdt_policy_data_patch_s { + char *bdt_ref_id; +} OpenAPI_bdt_policy_data_patch_t; + +OpenAPI_bdt_policy_data_patch_t *OpenAPI_bdt_policy_data_patch_create( + char *bdt_ref_id + ); +void OpenAPI_bdt_policy_data_patch_free(OpenAPI_bdt_policy_data_patch_t *bdt_policy_data_patch); +OpenAPI_bdt_policy_data_patch_t *OpenAPI_bdt_policy_data_patch_parseFromJSON(cJSON *bdt_policy_data_patchJSON); +cJSON *OpenAPI_bdt_policy_data_patch_convertToJSON(OpenAPI_bdt_policy_data_patch_t *bdt_policy_data_patch); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_bdt_policy_data_patch_H_ */ + diff --git a/lib/sbi/openapi/model/bsf_info.h b/lib/sbi/openapi/model/bsf_info.h index 516d2bdfdc..2851fc7cd3 100644 --- a/lib/sbi/openapi/model/bsf_info.h +++ b/lib/sbi/openapi/model/bsf_info.h @@ -1,7 +1,7 @@ /* * bsf_info.h * - * + * Information of a BSF NF Instance */ #ifndef _OpenAPI_bsf_info_H_ diff --git a/lib/sbi/openapi/model/cag_ack_data.c b/lib/sbi/openapi/model/cag_ack_data.c new file mode 100644 index 0000000000..7d62ecdd21 --- /dev/null +++ b/lib/sbi/openapi/model/cag_ack_data.c @@ -0,0 +1,102 @@ + +#include +#include +#include +#include "cag_ack_data.h" + +OpenAPI_cag_ack_data_t *OpenAPI_cag_ack_data_create( + char *provisioning_time, + OpenAPI_ue_update_status_e ue_update_status + ) +{ + OpenAPI_cag_ack_data_t *cag_ack_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_cag_ack_data_t)); + if (!cag_ack_data_local_var) { + return NULL; + } + cag_ack_data_local_var->provisioning_time = provisioning_time; + cag_ack_data_local_var->ue_update_status = ue_update_status; + + return cag_ack_data_local_var; +} + +void OpenAPI_cag_ack_data_free(OpenAPI_cag_ack_data_t *cag_ack_data) +{ + if (NULL == cag_ack_data) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(cag_ack_data->provisioning_time); + ogs_free(cag_ack_data); +} + +cJSON *OpenAPI_cag_ack_data_convertToJSON(OpenAPI_cag_ack_data_t *cag_ack_data) +{ + cJSON *item = NULL; + + if (cag_ack_data == NULL) { + ogs_error("OpenAPI_cag_ack_data_convertToJSON() failed [CagAckData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!cag_ack_data->provisioning_time) { + ogs_error("OpenAPI_cag_ack_data_convertToJSON() failed [provisioning_time]"); + goto end; + } + if (cJSON_AddStringToObject(item, "provisioningTime", cag_ack_data->provisioning_time) == NULL) { + ogs_error("OpenAPI_cag_ack_data_convertToJSON() failed [provisioning_time]"); + goto end; + } + + if (!cag_ack_data->ue_update_status) { + ogs_error("OpenAPI_cag_ack_data_convertToJSON() failed [ue_update_status]"); + goto end; + } + if (cJSON_AddStringToObject(item, "ueUpdateStatus", OpenAPI_ue_update_status_ToString(cag_ack_data->ue_update_status)) == NULL) { + ogs_error("OpenAPI_cag_ack_data_convertToJSON() failed [ue_update_status]"); + goto end; + } + +end: + return item; +} + +OpenAPI_cag_ack_data_t *OpenAPI_cag_ack_data_parseFromJSON(cJSON *cag_ack_dataJSON) +{ + OpenAPI_cag_ack_data_t *cag_ack_data_local_var = NULL; + cJSON *provisioning_time = cJSON_GetObjectItemCaseSensitive(cag_ack_dataJSON, "provisioningTime"); + if (!provisioning_time) { + ogs_error("OpenAPI_cag_ack_data_parseFromJSON() failed [provisioning_time]"); + goto end; + } + + + if (!cJSON_IsString(provisioning_time)) { + ogs_error("OpenAPI_cag_ack_data_parseFromJSON() failed [provisioning_time]"); + goto end; + } + + cJSON *ue_update_status = cJSON_GetObjectItemCaseSensitive(cag_ack_dataJSON, "ueUpdateStatus"); + if (!ue_update_status) { + ogs_error("OpenAPI_cag_ack_data_parseFromJSON() failed [ue_update_status]"); + goto end; + } + + OpenAPI_ue_update_status_e ue_update_statusVariable; + + if (!cJSON_IsString(ue_update_status)) { + ogs_error("OpenAPI_cag_ack_data_parseFromJSON() failed [ue_update_status]"); + goto end; + } + ue_update_statusVariable = OpenAPI_ue_update_status_FromString(ue_update_status->valuestring); + + cag_ack_data_local_var = OpenAPI_cag_ack_data_create ( + ogs_strdup(provisioning_time->valuestring), + ue_update_statusVariable + ); + + return cag_ack_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/cag_ack_data.h b/lib/sbi/openapi/model/cag_ack_data.h new file mode 100644 index 0000000000..afc912e61f --- /dev/null +++ b/lib/sbi/openapi/model/cag_ack_data.h @@ -0,0 +1,40 @@ +/* + * cag_ack_data.h + * + * + */ + +#ifndef _OpenAPI_cag_ack_data_H_ +#define _OpenAPI_cag_ack_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "ue_update_status.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_cag_ack_data_s OpenAPI_cag_ack_data_t; +typedef struct OpenAPI_cag_ack_data_s { + char *provisioning_time; + OpenAPI_ue_update_status_e ue_update_status; +} OpenAPI_cag_ack_data_t; + +OpenAPI_cag_ack_data_t *OpenAPI_cag_ack_data_create( + char *provisioning_time, + OpenAPI_ue_update_status_e ue_update_status + ); +void OpenAPI_cag_ack_data_free(OpenAPI_cag_ack_data_t *cag_ack_data); +OpenAPI_cag_ack_data_t *OpenAPI_cag_ack_data_parseFromJSON(cJSON *cag_ack_dataJSON); +cJSON *OpenAPI_cag_ack_data_convertToJSON(OpenAPI_cag_ack_data_t *cag_ack_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_cag_ack_data_H_ */ + diff --git a/lib/sbi/openapi/model/cag_data.c b/lib/sbi/openapi/model/cag_data.c new file mode 100644 index 0000000000..9b2298af7a --- /dev/null +++ b/lib/sbi/openapi/model/cag_data.c @@ -0,0 +1,129 @@ + +#include +#include +#include +#include "cag_data.h" + +OpenAPI_cag_data_t *OpenAPI_cag_data_create( + OpenAPI_list_t* cag_infos, + char *provisioning_time + ) +{ + OpenAPI_cag_data_t *cag_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_cag_data_t)); + if (!cag_data_local_var) { + return NULL; + } + cag_data_local_var->cag_infos = cag_infos; + cag_data_local_var->provisioning_time = provisioning_time; + + return cag_data_local_var; +} + +void OpenAPI_cag_data_free(OpenAPI_cag_data_t *cag_data) +{ + if (NULL == cag_data) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(cag_data->cag_infos, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_cag_info_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(cag_data->cag_infos); + ogs_free(cag_data->provisioning_time); + ogs_free(cag_data); +} + +cJSON *OpenAPI_cag_data_convertToJSON(OpenAPI_cag_data_t *cag_data) +{ + cJSON *item = NULL; + + if (cag_data == NULL) { + ogs_error("OpenAPI_cag_data_convertToJSON() failed [CagData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!cag_data->cag_infos) { + ogs_error("OpenAPI_cag_data_convertToJSON() failed [cag_infos]"); + goto end; + } + cJSON *cag_infos = cJSON_AddObjectToObject(item, "cagInfos"); + if (cag_infos == NULL) { + ogs_error("OpenAPI_cag_data_convertToJSON() failed [cag_infos]"); + goto end; + } + cJSON *localMapObject = cag_infos; + OpenAPI_lnode_t *cag_infos_node; + if (cag_data->cag_infos) { + OpenAPI_list_for_each(cag_data->cag_infos, cag_infos_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)cag_infos_node->data; + cJSON *itemLocal = OpenAPI_cag_info_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_cag_data_convertToJSON() failed [cag_infos]"); + goto end; + } + cJSON_AddItemToObject(cag_infos, localKeyValue->key, itemLocal); + } + } + + if (cag_data->provisioning_time) { + if (cJSON_AddStringToObject(item, "provisioningTime", cag_data->provisioning_time) == NULL) { + ogs_error("OpenAPI_cag_data_convertToJSON() failed [provisioning_time]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_cag_data_t *OpenAPI_cag_data_parseFromJSON(cJSON *cag_dataJSON) +{ + OpenAPI_cag_data_t *cag_data_local_var = NULL; + cJSON *cag_infos = cJSON_GetObjectItemCaseSensitive(cag_dataJSON, "cagInfos"); + if (!cag_infos) { + ogs_error("OpenAPI_cag_data_parseFromJSON() failed [cag_infos]"); + goto end; + } + + OpenAPI_list_t *cag_infosList; + + cJSON *cag_infos_local_map; + if (!cJSON_IsObject(cag_infos)) { + ogs_error("OpenAPI_cag_data_parseFromJSON() failed [cag_infos]"); + goto end; + } + cag_infosList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(cag_infos_local_map, cag_infos) { + cJSON *localMapObject = cag_infos_local_map; + if (!cJSON_IsObject(cag_infos_local_map)) { + ogs_error("OpenAPI_cag_data_parseFromJSON() failed [cag_infos]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_cag_info_parseFromJSON(localMapObject)); + OpenAPI_list_add(cag_infosList, localMapKeyPair); + } + + cJSON *provisioning_time = cJSON_GetObjectItemCaseSensitive(cag_dataJSON, "provisioningTime"); + + if (provisioning_time) { + if (!cJSON_IsString(provisioning_time)) { + ogs_error("OpenAPI_cag_data_parseFromJSON() failed [provisioning_time]"); + goto end; + } + } + + cag_data_local_var = OpenAPI_cag_data_create ( + cag_infosList, + provisioning_time ? ogs_strdup(provisioning_time->valuestring) : NULL + ); + + return cag_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/cag_data.h b/lib/sbi/openapi/model/cag_data.h new file mode 100644 index 0000000000..d4004e95ac --- /dev/null +++ b/lib/sbi/openapi/model/cag_data.h @@ -0,0 +1,40 @@ +/* + * cag_data.h + * + * + */ + +#ifndef _OpenAPI_cag_data_H_ +#define _OpenAPI_cag_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "cag_info.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_cag_data_s OpenAPI_cag_data_t; +typedef struct OpenAPI_cag_data_s { + OpenAPI_list_t* cag_infos; + char *provisioning_time; +} OpenAPI_cag_data_t; + +OpenAPI_cag_data_t *OpenAPI_cag_data_create( + OpenAPI_list_t* cag_infos, + char *provisioning_time + ); +void OpenAPI_cag_data_free(OpenAPI_cag_data_t *cag_data); +OpenAPI_cag_data_t *OpenAPI_cag_data_parseFromJSON(cJSON *cag_dataJSON); +cJSON *OpenAPI_cag_data_convertToJSON(OpenAPI_cag_data_t *cag_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_cag_data_H_ */ + diff --git a/lib/sbi/openapi/model/cag_info.c b/lib/sbi/openapi/model/cag_info.c new file mode 100644 index 0000000000..ba31a5c8cc --- /dev/null +++ b/lib/sbi/openapi/model/cag_info.c @@ -0,0 +1,118 @@ + +#include +#include +#include +#include "cag_info.h" + +OpenAPI_cag_info_t *OpenAPI_cag_info_create( + OpenAPI_list_t *allowed_cag_list, + int cag_only_indicator + ) +{ + OpenAPI_cag_info_t *cag_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_cag_info_t)); + if (!cag_info_local_var) { + return NULL; + } + cag_info_local_var->allowed_cag_list = allowed_cag_list; + cag_info_local_var->cag_only_indicator = cag_only_indicator; + + return cag_info_local_var; +} + +void OpenAPI_cag_info_free(OpenAPI_cag_info_t *cag_info) +{ + if (NULL == cag_info) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(cag_info->allowed_cag_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(cag_info->allowed_cag_list); + ogs_free(cag_info); +} + +cJSON *OpenAPI_cag_info_convertToJSON(OpenAPI_cag_info_t *cag_info) +{ + cJSON *item = NULL; + + if (cag_info == NULL) { + ogs_error("OpenAPI_cag_info_convertToJSON() failed [CagInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!cag_info->allowed_cag_list) { + ogs_error("OpenAPI_cag_info_convertToJSON() failed [allowed_cag_list]"); + goto end; + } + cJSON *allowed_cag_list = cJSON_AddArrayToObject(item, "allowedCagList"); + if (allowed_cag_list == NULL) { + ogs_error("OpenAPI_cag_info_convertToJSON() failed [allowed_cag_list]"); + goto end; + } + + OpenAPI_lnode_t *allowed_cag_list_node; + OpenAPI_list_for_each(cag_info->allowed_cag_list, allowed_cag_list_node) { + if (cJSON_AddStringToObject(allowed_cag_list, "", (char*)allowed_cag_list_node->data) == NULL) { + ogs_error("OpenAPI_cag_info_convertToJSON() failed [allowed_cag_list]"); + goto end; + } + } + + if (cag_info->cag_only_indicator >= 0) { + if (cJSON_AddBoolToObject(item, "cagOnlyIndicator", cag_info->cag_only_indicator) == NULL) { + ogs_error("OpenAPI_cag_info_convertToJSON() failed [cag_only_indicator]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_cag_info_t *OpenAPI_cag_info_parseFromJSON(cJSON *cag_infoJSON) +{ + OpenAPI_cag_info_t *cag_info_local_var = NULL; + cJSON *allowed_cag_list = cJSON_GetObjectItemCaseSensitive(cag_infoJSON, "allowedCagList"); + if (!allowed_cag_list) { + ogs_error("OpenAPI_cag_info_parseFromJSON() failed [allowed_cag_list]"); + goto end; + } + + OpenAPI_list_t *allowed_cag_listList; + + cJSON *allowed_cag_list_local; + if (!cJSON_IsArray(allowed_cag_list)) { + ogs_error("OpenAPI_cag_info_parseFromJSON() failed [allowed_cag_list]"); + goto end; + } + allowed_cag_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_cag_list_local, allowed_cag_list) { + if (!cJSON_IsString(allowed_cag_list_local)) { + ogs_error("OpenAPI_cag_info_parseFromJSON() failed [allowed_cag_list]"); + goto end; + } + OpenAPI_list_add(allowed_cag_listList, ogs_strdup(allowed_cag_list_local->valuestring)); + } + + cJSON *cag_only_indicator = cJSON_GetObjectItemCaseSensitive(cag_infoJSON, "cagOnlyIndicator"); + + if (cag_only_indicator) { + if (!cJSON_IsBool(cag_only_indicator)) { + ogs_error("OpenAPI_cag_info_parseFromJSON() failed [cag_only_indicator]"); + goto end; + } + } + + cag_info_local_var = OpenAPI_cag_info_create ( + allowed_cag_listList, + cag_only_indicator ? cag_only_indicator->valueint : 0 + ); + + return cag_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/cag_info.h b/lib/sbi/openapi/model/cag_info.h new file mode 100644 index 0000000000..07878d60e7 --- /dev/null +++ b/lib/sbi/openapi/model/cag_info.h @@ -0,0 +1,39 @@ +/* + * cag_info.h + * + * + */ + +#ifndef _OpenAPI_cag_info_H_ +#define _OpenAPI_cag_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_cag_info_s OpenAPI_cag_info_t; +typedef struct OpenAPI_cag_info_s { + OpenAPI_list_t *allowed_cag_list; + int cag_only_indicator; +} OpenAPI_cag_info_t; + +OpenAPI_cag_info_t *OpenAPI_cag_info_create( + OpenAPI_list_t *allowed_cag_list, + int cag_only_indicator + ); +void OpenAPI_cag_info_free(OpenAPI_cag_info_t *cag_info); +OpenAPI_cag_info_t *OpenAPI_cag_info_parseFromJSON(cJSON *cag_infoJSON); +cJSON *OpenAPI_cag_info_convertToJSON(OpenAPI_cag_info_t *cag_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_cag_info_H_ */ + diff --git a/lib/sbi/openapi/model/charging_information.c b/lib/sbi/openapi/model/charging_information.c new file mode 100644 index 0000000000..a1b46996ab --- /dev/null +++ b/lib/sbi/openapi/model/charging_information.c @@ -0,0 +1,181 @@ + +#include +#include +#include +#include "charging_information.h" + +OpenAPI_charging_information_t *OpenAPI_charging_information_create( + char *primary_chf_address, + char *secondary_chf_address, + char *primary_chf_set_id, + char *primary_chf_instance_id, + char *secondary_chf_set_id, + char *secondary_chf_instance_id + ) +{ + OpenAPI_charging_information_t *charging_information_local_var = OpenAPI_malloc(sizeof(OpenAPI_charging_information_t)); + if (!charging_information_local_var) { + return NULL; + } + charging_information_local_var->primary_chf_address = primary_chf_address; + charging_information_local_var->secondary_chf_address = secondary_chf_address; + charging_information_local_var->primary_chf_set_id = primary_chf_set_id; + charging_information_local_var->primary_chf_instance_id = primary_chf_instance_id; + charging_information_local_var->secondary_chf_set_id = secondary_chf_set_id; + charging_information_local_var->secondary_chf_instance_id = secondary_chf_instance_id; + + return charging_information_local_var; +} + +void OpenAPI_charging_information_free(OpenAPI_charging_information_t *charging_information) +{ + if (NULL == charging_information) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(charging_information->primary_chf_address); + ogs_free(charging_information->secondary_chf_address); + ogs_free(charging_information->primary_chf_set_id); + ogs_free(charging_information->primary_chf_instance_id); + ogs_free(charging_information->secondary_chf_set_id); + ogs_free(charging_information->secondary_chf_instance_id); + ogs_free(charging_information); +} + +cJSON *OpenAPI_charging_information_convertToJSON(OpenAPI_charging_information_t *charging_information) +{ + cJSON *item = NULL; + + if (charging_information == NULL) { + ogs_error("OpenAPI_charging_information_convertToJSON() failed [ChargingInformation]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!charging_information->primary_chf_address) { + ogs_error("OpenAPI_charging_information_convertToJSON() failed [primary_chf_address]"); + goto end; + } + if (cJSON_AddStringToObject(item, "primaryChfAddress", charging_information->primary_chf_address) == NULL) { + ogs_error("OpenAPI_charging_information_convertToJSON() failed [primary_chf_address]"); + goto end; + } + + if (!charging_information->secondary_chf_address) { + ogs_error("OpenAPI_charging_information_convertToJSON() failed [secondary_chf_address]"); + goto end; + } + if (cJSON_AddStringToObject(item, "secondaryChfAddress", charging_information->secondary_chf_address) == NULL) { + ogs_error("OpenAPI_charging_information_convertToJSON() failed [secondary_chf_address]"); + goto end; + } + + if (charging_information->primary_chf_set_id) { + if (cJSON_AddStringToObject(item, "primaryChfSetId", charging_information->primary_chf_set_id) == NULL) { + ogs_error("OpenAPI_charging_information_convertToJSON() failed [primary_chf_set_id]"); + goto end; + } + } + + if (charging_information->primary_chf_instance_id) { + if (cJSON_AddStringToObject(item, "primaryChfInstanceId", charging_information->primary_chf_instance_id) == NULL) { + ogs_error("OpenAPI_charging_information_convertToJSON() failed [primary_chf_instance_id]"); + goto end; + } + } + + if (charging_information->secondary_chf_set_id) { + if (cJSON_AddStringToObject(item, "secondaryChfSetId", charging_information->secondary_chf_set_id) == NULL) { + ogs_error("OpenAPI_charging_information_convertToJSON() failed [secondary_chf_set_id]"); + goto end; + } + } + + if (charging_information->secondary_chf_instance_id) { + if (cJSON_AddStringToObject(item, "secondaryChfInstanceId", charging_information->secondary_chf_instance_id) == NULL) { + ogs_error("OpenAPI_charging_information_convertToJSON() failed [secondary_chf_instance_id]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_charging_information_t *OpenAPI_charging_information_parseFromJSON(cJSON *charging_informationJSON) +{ + OpenAPI_charging_information_t *charging_information_local_var = NULL; + cJSON *primary_chf_address = cJSON_GetObjectItemCaseSensitive(charging_informationJSON, "primaryChfAddress"); + if (!primary_chf_address) { + ogs_error("OpenAPI_charging_information_parseFromJSON() failed [primary_chf_address]"); + goto end; + } + + + if (!cJSON_IsString(primary_chf_address)) { + ogs_error("OpenAPI_charging_information_parseFromJSON() failed [primary_chf_address]"); + goto end; + } + + cJSON *secondary_chf_address = cJSON_GetObjectItemCaseSensitive(charging_informationJSON, "secondaryChfAddress"); + if (!secondary_chf_address) { + ogs_error("OpenAPI_charging_information_parseFromJSON() failed [secondary_chf_address]"); + goto end; + } + + + if (!cJSON_IsString(secondary_chf_address)) { + ogs_error("OpenAPI_charging_information_parseFromJSON() failed [secondary_chf_address]"); + goto end; + } + + cJSON *primary_chf_set_id = cJSON_GetObjectItemCaseSensitive(charging_informationJSON, "primaryChfSetId"); + + if (primary_chf_set_id) { + if (!cJSON_IsString(primary_chf_set_id)) { + ogs_error("OpenAPI_charging_information_parseFromJSON() failed [primary_chf_set_id]"); + goto end; + } + } + + cJSON *primary_chf_instance_id = cJSON_GetObjectItemCaseSensitive(charging_informationJSON, "primaryChfInstanceId"); + + if (primary_chf_instance_id) { + if (!cJSON_IsString(primary_chf_instance_id)) { + ogs_error("OpenAPI_charging_information_parseFromJSON() failed [primary_chf_instance_id]"); + goto end; + } + } + + cJSON *secondary_chf_set_id = cJSON_GetObjectItemCaseSensitive(charging_informationJSON, "secondaryChfSetId"); + + if (secondary_chf_set_id) { + if (!cJSON_IsString(secondary_chf_set_id)) { + ogs_error("OpenAPI_charging_information_parseFromJSON() failed [secondary_chf_set_id]"); + goto end; + } + } + + cJSON *secondary_chf_instance_id = cJSON_GetObjectItemCaseSensitive(charging_informationJSON, "secondaryChfInstanceId"); + + if (secondary_chf_instance_id) { + if (!cJSON_IsString(secondary_chf_instance_id)) { + ogs_error("OpenAPI_charging_information_parseFromJSON() failed [secondary_chf_instance_id]"); + goto end; + } + } + + charging_information_local_var = OpenAPI_charging_information_create ( + ogs_strdup(primary_chf_address->valuestring), + ogs_strdup(secondary_chf_address->valuestring), + primary_chf_set_id ? ogs_strdup(primary_chf_set_id->valuestring) : NULL, + primary_chf_instance_id ? ogs_strdup(primary_chf_instance_id->valuestring) : NULL, + secondary_chf_set_id ? ogs_strdup(secondary_chf_set_id->valuestring) : NULL, + secondary_chf_instance_id ? ogs_strdup(secondary_chf_instance_id->valuestring) : NULL + ); + + return charging_information_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/charging_information.h b/lib/sbi/openapi/model/charging_information.h new file mode 100644 index 0000000000..ef4dd5da65 --- /dev/null +++ b/lib/sbi/openapi/model/charging_information.h @@ -0,0 +1,47 @@ +/* + * charging_information.h + * + * + */ + +#ifndef _OpenAPI_charging_information_H_ +#define _OpenAPI_charging_information_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_charging_information_s OpenAPI_charging_information_t; +typedef struct OpenAPI_charging_information_s { + char *primary_chf_address; + char *secondary_chf_address; + char *primary_chf_set_id; + char *primary_chf_instance_id; + char *secondary_chf_set_id; + char *secondary_chf_instance_id; +} OpenAPI_charging_information_t; + +OpenAPI_charging_information_t *OpenAPI_charging_information_create( + char *primary_chf_address, + char *secondary_chf_address, + char *primary_chf_set_id, + char *primary_chf_instance_id, + char *secondary_chf_set_id, + char *secondary_chf_instance_id + ); +void OpenAPI_charging_information_free(OpenAPI_charging_information_t *charging_information); +OpenAPI_charging_information_t *OpenAPI_charging_information_parseFromJSON(cJSON *charging_informationJSON); +cJSON *OpenAPI_charging_information_convertToJSON(OpenAPI_charging_information_t *charging_information); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_charging_information_H_ */ + diff --git a/lib/sbi/openapi/model/chf_info.c b/lib/sbi/openapi/model/chf_info.c index 920f592df6..84aee413c9 100644 --- a/lib/sbi/openapi/model/chf_info.c +++ b/lib/sbi/openapi/model/chf_info.c @@ -7,7 +7,8 @@ OpenAPI_chf_info_t *OpenAPI_chf_info_create( OpenAPI_list_t *supi_range_list, OpenAPI_list_t *gpsi_range_list, - OpenAPI_list_t *plmn_range_list + OpenAPI_list_t *plmn_range_list, + char *group_id ) { OpenAPI_chf_info_t *chf_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_chf_info_t)); @@ -17,6 +18,7 @@ OpenAPI_chf_info_t *OpenAPI_chf_info_create( chf_info_local_var->supi_range_list = supi_range_list; chf_info_local_var->gpsi_range_list = gpsi_range_list; chf_info_local_var->plmn_range_list = plmn_range_list; + chf_info_local_var->group_id = group_id; return chf_info_local_var; } @@ -39,6 +41,7 @@ void OpenAPI_chf_info_free(OpenAPI_chf_info_t *chf_info) OpenAPI_plmn_range_free(node->data); } OpenAPI_list_free(chf_info->plmn_range_list); + ogs_free(chf_info->group_id); ogs_free(chf_info); } @@ -112,6 +115,13 @@ cJSON *OpenAPI_chf_info_convertToJSON(OpenAPI_chf_info_t *chf_info) } } + if (chf_info->group_id) { + if (cJSON_AddStringToObject(item, "groupId", chf_info->group_id) == NULL) { + ogs_error("OpenAPI_chf_info_convertToJSON() failed [group_id]"); + goto end; + } + } + end: return item; } @@ -188,10 +198,20 @@ OpenAPI_chf_info_t *OpenAPI_chf_info_parseFromJSON(cJSON *chf_infoJSON) } } + cJSON *group_id = cJSON_GetObjectItemCaseSensitive(chf_infoJSON, "groupId"); + + if (group_id) { + if (!cJSON_IsString(group_id)) { + ogs_error("OpenAPI_chf_info_parseFromJSON() failed [group_id]"); + goto end; + } + } + chf_info_local_var = OpenAPI_chf_info_create ( supi_range_list ? supi_range_listList : NULL, gpsi_range_list ? gpsi_range_listList : NULL, - plmn_range_list ? plmn_range_listList : NULL + plmn_range_list ? plmn_range_listList : NULL, + group_id ? ogs_strdup(group_id->valuestring) : NULL ); return chf_info_local_var; diff --git a/lib/sbi/openapi/model/chf_info.h b/lib/sbi/openapi/model/chf_info.h index 2570171378..7c84c7c450 100644 --- a/lib/sbi/openapi/model/chf_info.h +++ b/lib/sbi/openapi/model/chf_info.h @@ -1,7 +1,7 @@ /* * chf_info.h * - * + * Information of a CHF NF Instance */ #ifndef _OpenAPI_chf_info_H_ @@ -25,12 +25,14 @@ typedef struct OpenAPI_chf_info_s { OpenAPI_list_t *supi_range_list; OpenAPI_list_t *gpsi_range_list; OpenAPI_list_t *plmn_range_list; + char *group_id; } OpenAPI_chf_info_t; OpenAPI_chf_info_t *OpenAPI_chf_info_create( OpenAPI_list_t *supi_range_list, OpenAPI_list_t *gpsi_range_list, - OpenAPI_list_t *plmn_range_list + OpenAPI_list_t *plmn_range_list, + char *group_id ); void OpenAPI_chf_info_free(OpenAPI_chf_info_t *chf_info); OpenAPI_chf_info_t *OpenAPI_chf_info_parseFromJSON(cJSON *chf_infoJSON); diff --git a/lib/sbi/openapi/model/chf_service_info.h b/lib/sbi/openapi/model/chf_service_info.h index af8558b719..fa1fa0f74d 100644 --- a/lib/sbi/openapi/model/chf_service_info.h +++ b/lib/sbi/openapi/model/chf_service_info.h @@ -1,7 +1,7 @@ /* * chf_service_info.h * - * + * Information of primary and secondary CHF services */ #ifndef _OpenAPI_chf_service_info_H_ diff --git a/lib/sbi/openapi/model/civic_address.c b/lib/sbi/openapi/model/civic_address.c new file mode 100644 index 0000000000..2fee7ec37f --- /dev/null +++ b/lib/sbi/openapi/model/civic_address.c @@ -0,0 +1,671 @@ + +#include +#include +#include +#include "civic_address.h" + +OpenAPI_civic_address_t *OpenAPI_civic_address_create( + char *country, + char *a1, + char *a2, + char *a3, + char *a4, + char *a5, + char *a6, + char *prd, + char *pod, + char *sts, + char *hno, + char *hns, + char *lmk, + char *loc, + char *nam, + char *pc, + char *bld, + char *unit, + char *flr, + char *room, + char *plc, + char *pcn, + char *pobox, + char *addcode, + char *seat, + char *rd, + char *rdsec, + char *rdbr, + char *rdsubbr, + char *prm, + char *pom + ) +{ + OpenAPI_civic_address_t *civic_address_local_var = OpenAPI_malloc(sizeof(OpenAPI_civic_address_t)); + if (!civic_address_local_var) { + return NULL; + } + civic_address_local_var->country = country; + civic_address_local_var->a1 = a1; + civic_address_local_var->a2 = a2; + civic_address_local_var->a3 = a3; + civic_address_local_var->a4 = a4; + civic_address_local_var->a5 = a5; + civic_address_local_var->a6 = a6; + civic_address_local_var->prd = prd; + civic_address_local_var->pod = pod; + civic_address_local_var->sts = sts; + civic_address_local_var->hno = hno; + civic_address_local_var->hns = hns; + civic_address_local_var->lmk = lmk; + civic_address_local_var->loc = loc; + civic_address_local_var->nam = nam; + civic_address_local_var->pc = pc; + civic_address_local_var->bld = bld; + civic_address_local_var->unit = unit; + civic_address_local_var->flr = flr; + civic_address_local_var->room = room; + civic_address_local_var->plc = plc; + civic_address_local_var->pcn = pcn; + civic_address_local_var->pobox = pobox; + civic_address_local_var->addcode = addcode; + civic_address_local_var->seat = seat; + civic_address_local_var->rd = rd; + civic_address_local_var->rdsec = rdsec; + civic_address_local_var->rdbr = rdbr; + civic_address_local_var->rdsubbr = rdsubbr; + civic_address_local_var->prm = prm; + civic_address_local_var->pom = pom; + + return civic_address_local_var; +} + +void OpenAPI_civic_address_free(OpenAPI_civic_address_t *civic_address) +{ + if (NULL == civic_address) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(civic_address->country); + ogs_free(civic_address->a1); + ogs_free(civic_address->a2); + ogs_free(civic_address->a3); + ogs_free(civic_address->a4); + ogs_free(civic_address->a5); + ogs_free(civic_address->a6); + ogs_free(civic_address->prd); + ogs_free(civic_address->pod); + ogs_free(civic_address->sts); + ogs_free(civic_address->hno); + ogs_free(civic_address->hns); + ogs_free(civic_address->lmk); + ogs_free(civic_address->loc); + ogs_free(civic_address->nam); + ogs_free(civic_address->pc); + ogs_free(civic_address->bld); + ogs_free(civic_address->unit); + ogs_free(civic_address->flr); + ogs_free(civic_address->room); + ogs_free(civic_address->plc); + ogs_free(civic_address->pcn); + ogs_free(civic_address->pobox); + ogs_free(civic_address->addcode); + ogs_free(civic_address->seat); + ogs_free(civic_address->rd); + ogs_free(civic_address->rdsec); + ogs_free(civic_address->rdbr); + ogs_free(civic_address->rdsubbr); + ogs_free(civic_address->prm); + ogs_free(civic_address->pom); + ogs_free(civic_address); +} + +cJSON *OpenAPI_civic_address_convertToJSON(OpenAPI_civic_address_t *civic_address) +{ + cJSON *item = NULL; + + if (civic_address == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [CivicAddress]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (civic_address->country) { + if (cJSON_AddStringToObject(item, "country", civic_address->country) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [country]"); + goto end; + } + } + + if (civic_address->a1) { + if (cJSON_AddStringToObject(item, "A1", civic_address->a1) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [a1]"); + goto end; + } + } + + if (civic_address->a2) { + if (cJSON_AddStringToObject(item, "A2", civic_address->a2) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [a2]"); + goto end; + } + } + + if (civic_address->a3) { + if (cJSON_AddStringToObject(item, "A3", civic_address->a3) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [a3]"); + goto end; + } + } + + if (civic_address->a4) { + if (cJSON_AddStringToObject(item, "A4", civic_address->a4) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [a4]"); + goto end; + } + } + + if (civic_address->a5) { + if (cJSON_AddStringToObject(item, "A5", civic_address->a5) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [a5]"); + goto end; + } + } + + if (civic_address->a6) { + if (cJSON_AddStringToObject(item, "A6", civic_address->a6) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [a6]"); + goto end; + } + } + + if (civic_address->prd) { + if (cJSON_AddStringToObject(item, "PRD", civic_address->prd) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [prd]"); + goto end; + } + } + + if (civic_address->pod) { + if (cJSON_AddStringToObject(item, "POD", civic_address->pod) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [pod]"); + goto end; + } + } + + if (civic_address->sts) { + if (cJSON_AddStringToObject(item, "STS", civic_address->sts) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [sts]"); + goto end; + } + } + + if (civic_address->hno) { + if (cJSON_AddStringToObject(item, "HNO", civic_address->hno) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [hno]"); + goto end; + } + } + + if (civic_address->hns) { + if (cJSON_AddStringToObject(item, "HNS", civic_address->hns) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [hns]"); + goto end; + } + } + + if (civic_address->lmk) { + if (cJSON_AddStringToObject(item, "LMK", civic_address->lmk) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [lmk]"); + goto end; + } + } + + if (civic_address->loc) { + if (cJSON_AddStringToObject(item, "LOC", civic_address->loc) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [loc]"); + goto end; + } + } + + if (civic_address->nam) { + if (cJSON_AddStringToObject(item, "NAM", civic_address->nam) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [nam]"); + goto end; + } + } + + if (civic_address->pc) { + if (cJSON_AddStringToObject(item, "PC", civic_address->pc) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [pc]"); + goto end; + } + } + + if (civic_address->bld) { + if (cJSON_AddStringToObject(item, "BLD", civic_address->bld) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [bld]"); + goto end; + } + } + + if (civic_address->unit) { + if (cJSON_AddStringToObject(item, "UNIT", civic_address->unit) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [unit]"); + goto end; + } + } + + if (civic_address->flr) { + if (cJSON_AddStringToObject(item, "FLR", civic_address->flr) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [flr]"); + goto end; + } + } + + if (civic_address->room) { + if (cJSON_AddStringToObject(item, "ROOM", civic_address->room) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [room]"); + goto end; + } + } + + if (civic_address->plc) { + if (cJSON_AddStringToObject(item, "PLC", civic_address->plc) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [plc]"); + goto end; + } + } + + if (civic_address->pcn) { + if (cJSON_AddStringToObject(item, "PCN", civic_address->pcn) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [pcn]"); + goto end; + } + } + + if (civic_address->pobox) { + if (cJSON_AddStringToObject(item, "POBOX", civic_address->pobox) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [pobox]"); + goto end; + } + } + + if (civic_address->addcode) { + if (cJSON_AddStringToObject(item, "ADDCODE", civic_address->addcode) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [addcode]"); + goto end; + } + } + + if (civic_address->seat) { + if (cJSON_AddStringToObject(item, "SEAT", civic_address->seat) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [seat]"); + goto end; + } + } + + if (civic_address->rd) { + if (cJSON_AddStringToObject(item, "RD", civic_address->rd) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [rd]"); + goto end; + } + } + + if (civic_address->rdsec) { + if (cJSON_AddStringToObject(item, "RDSEC", civic_address->rdsec) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [rdsec]"); + goto end; + } + } + + if (civic_address->rdbr) { + if (cJSON_AddStringToObject(item, "RDBR", civic_address->rdbr) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [rdbr]"); + goto end; + } + } + + if (civic_address->rdsubbr) { + if (cJSON_AddStringToObject(item, "RDSUBBR", civic_address->rdsubbr) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [rdsubbr]"); + goto end; + } + } + + if (civic_address->prm) { + if (cJSON_AddStringToObject(item, "PRM", civic_address->prm) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [prm]"); + goto end; + } + } + + if (civic_address->pom) { + if (cJSON_AddStringToObject(item, "POM", civic_address->pom) == NULL) { + ogs_error("OpenAPI_civic_address_convertToJSON() failed [pom]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_civic_address_t *OpenAPI_civic_address_parseFromJSON(cJSON *civic_addressJSON) +{ + OpenAPI_civic_address_t *civic_address_local_var = NULL; + cJSON *country = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "country"); + + if (country) { + if (!cJSON_IsString(country)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [country]"); + goto end; + } + } + + cJSON *a1 = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "A1"); + + if (a1) { + if (!cJSON_IsString(a1)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [a1]"); + goto end; + } + } + + cJSON *a2 = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "A2"); + + if (a2) { + if (!cJSON_IsString(a2)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [a2]"); + goto end; + } + } + + cJSON *a3 = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "A3"); + + if (a3) { + if (!cJSON_IsString(a3)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [a3]"); + goto end; + } + } + + cJSON *a4 = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "A4"); + + if (a4) { + if (!cJSON_IsString(a4)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [a4]"); + goto end; + } + } + + cJSON *a5 = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "A5"); + + if (a5) { + if (!cJSON_IsString(a5)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [a5]"); + goto end; + } + } + + cJSON *a6 = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "A6"); + + if (a6) { + if (!cJSON_IsString(a6)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [a6]"); + goto end; + } + } + + cJSON *prd = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "PRD"); + + if (prd) { + if (!cJSON_IsString(prd)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [prd]"); + goto end; + } + } + + cJSON *pod = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "POD"); + + if (pod) { + if (!cJSON_IsString(pod)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [pod]"); + goto end; + } + } + + cJSON *sts = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "STS"); + + if (sts) { + if (!cJSON_IsString(sts)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [sts]"); + goto end; + } + } + + cJSON *hno = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "HNO"); + + if (hno) { + if (!cJSON_IsString(hno)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [hno]"); + goto end; + } + } + + cJSON *hns = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "HNS"); + + if (hns) { + if (!cJSON_IsString(hns)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [hns]"); + goto end; + } + } + + cJSON *lmk = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "LMK"); + + if (lmk) { + if (!cJSON_IsString(lmk)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [lmk]"); + goto end; + } + } + + cJSON *loc = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "LOC"); + + if (loc) { + if (!cJSON_IsString(loc)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [loc]"); + goto end; + } + } + + cJSON *nam = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "NAM"); + + if (nam) { + if (!cJSON_IsString(nam)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [nam]"); + goto end; + } + } + + cJSON *pc = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "PC"); + + if (pc) { + if (!cJSON_IsString(pc)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [pc]"); + goto end; + } + } + + cJSON *bld = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "BLD"); + + if (bld) { + if (!cJSON_IsString(bld)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [bld]"); + goto end; + } + } + + cJSON *unit = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "UNIT"); + + if (unit) { + if (!cJSON_IsString(unit)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [unit]"); + goto end; + } + } + + cJSON *flr = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "FLR"); + + if (flr) { + if (!cJSON_IsString(flr)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [flr]"); + goto end; + } + } + + cJSON *room = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "ROOM"); + + if (room) { + if (!cJSON_IsString(room)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [room]"); + goto end; + } + } + + cJSON *plc = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "PLC"); + + if (plc) { + if (!cJSON_IsString(plc)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [plc]"); + goto end; + } + } + + cJSON *pcn = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "PCN"); + + if (pcn) { + if (!cJSON_IsString(pcn)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [pcn]"); + goto end; + } + } + + cJSON *pobox = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "POBOX"); + + if (pobox) { + if (!cJSON_IsString(pobox)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [pobox]"); + goto end; + } + } + + cJSON *addcode = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "ADDCODE"); + + if (addcode) { + if (!cJSON_IsString(addcode)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [addcode]"); + goto end; + } + } + + cJSON *seat = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "SEAT"); + + if (seat) { + if (!cJSON_IsString(seat)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [seat]"); + goto end; + } + } + + cJSON *rd = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "RD"); + + if (rd) { + if (!cJSON_IsString(rd)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [rd]"); + goto end; + } + } + + cJSON *rdsec = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "RDSEC"); + + if (rdsec) { + if (!cJSON_IsString(rdsec)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [rdsec]"); + goto end; + } + } + + cJSON *rdbr = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "RDBR"); + + if (rdbr) { + if (!cJSON_IsString(rdbr)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [rdbr]"); + goto end; + } + } + + cJSON *rdsubbr = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "RDSUBBR"); + + if (rdsubbr) { + if (!cJSON_IsString(rdsubbr)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [rdsubbr]"); + goto end; + } + } + + cJSON *prm = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "PRM"); + + if (prm) { + if (!cJSON_IsString(prm)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [prm]"); + goto end; + } + } + + cJSON *pom = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "POM"); + + if (pom) { + if (!cJSON_IsString(pom)) { + ogs_error("OpenAPI_civic_address_parseFromJSON() failed [pom]"); + goto end; + } + } + + civic_address_local_var = OpenAPI_civic_address_create ( + country ? ogs_strdup(country->valuestring) : NULL, + a1 ? ogs_strdup(a1->valuestring) : NULL, + a2 ? ogs_strdup(a2->valuestring) : NULL, + a3 ? ogs_strdup(a3->valuestring) : NULL, + a4 ? ogs_strdup(a4->valuestring) : NULL, + a5 ? ogs_strdup(a5->valuestring) : NULL, + a6 ? ogs_strdup(a6->valuestring) : NULL, + prd ? ogs_strdup(prd->valuestring) : NULL, + pod ? ogs_strdup(pod->valuestring) : NULL, + sts ? ogs_strdup(sts->valuestring) : NULL, + hno ? ogs_strdup(hno->valuestring) : NULL, + hns ? ogs_strdup(hns->valuestring) : NULL, + lmk ? ogs_strdup(lmk->valuestring) : NULL, + loc ? ogs_strdup(loc->valuestring) : NULL, + nam ? ogs_strdup(nam->valuestring) : NULL, + pc ? ogs_strdup(pc->valuestring) : NULL, + bld ? ogs_strdup(bld->valuestring) : NULL, + unit ? ogs_strdup(unit->valuestring) : NULL, + flr ? ogs_strdup(flr->valuestring) : NULL, + room ? ogs_strdup(room->valuestring) : NULL, + plc ? ogs_strdup(plc->valuestring) : NULL, + pcn ? ogs_strdup(pcn->valuestring) : NULL, + pobox ? ogs_strdup(pobox->valuestring) : NULL, + addcode ? ogs_strdup(addcode->valuestring) : NULL, + seat ? ogs_strdup(seat->valuestring) : NULL, + rd ? ogs_strdup(rd->valuestring) : NULL, + rdsec ? ogs_strdup(rdsec->valuestring) : NULL, + rdbr ? ogs_strdup(rdbr->valuestring) : NULL, + rdsubbr ? ogs_strdup(rdsubbr->valuestring) : NULL, + prm ? ogs_strdup(prm->valuestring) : NULL, + pom ? ogs_strdup(pom->valuestring) : NULL + ); + + return civic_address_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/civic_address.h b/lib/sbi/openapi/model/civic_address.h new file mode 100644 index 0000000000..eaae249983 --- /dev/null +++ b/lib/sbi/openapi/model/civic_address.h @@ -0,0 +1,97 @@ +/* + * civic_address.h + * + * + */ + +#ifndef _OpenAPI_civic_address_H_ +#define _OpenAPI_civic_address_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_civic_address_s OpenAPI_civic_address_t; +typedef struct OpenAPI_civic_address_s { + char *country; + char *a1; + char *a2; + char *a3; + char *a4; + char *a5; + char *a6; + char *prd; + char *pod; + char *sts; + char *hno; + char *hns; + char *lmk; + char *loc; + char *nam; + char *pc; + char *bld; + char *unit; + char *flr; + char *room; + char *plc; + char *pcn; + char *pobox; + char *addcode; + char *seat; + char *rd; + char *rdsec; + char *rdbr; + char *rdsubbr; + char *prm; + char *pom; +} OpenAPI_civic_address_t; + +OpenAPI_civic_address_t *OpenAPI_civic_address_create( + char *country, + char *a1, + char *a2, + char *a3, + char *a4, + char *a5, + char *a6, + char *prd, + char *pod, + char *sts, + char *hno, + char *hns, + char *lmk, + char *loc, + char *nam, + char *pc, + char *bld, + char *unit, + char *flr, + char *room, + char *plc, + char *pcn, + char *pobox, + char *addcode, + char *seat, + char *rd, + char *rdsec, + char *rdbr, + char *rdsubbr, + char *prm, + char *pom + ); +void OpenAPI_civic_address_free(OpenAPI_civic_address_t *civic_address); +OpenAPI_civic_address_t *OpenAPI_civic_address_parseFromJSON(cJSON *civic_addressJSON); +cJSON *OpenAPI_civic_address_convertToJSON(OpenAPI_civic_address_t *civic_address); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_civic_address_H_ */ + diff --git a/lib/sbi/openapi/model/cm_info.c b/lib/sbi/openapi/model/cm_info.c new file mode 100644 index 0000000000..45b3e1c298 --- /dev/null +++ b/lib/sbi/openapi/model/cm_info.c @@ -0,0 +1,106 @@ + +#include +#include +#include +#include "cm_info.h" + +OpenAPI_cm_info_t *OpenAPI_cm_info_create( + OpenAPI_cm_state_t *cm_state, + OpenAPI_access_type_e access_type + ) +{ + OpenAPI_cm_info_t *cm_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_cm_info_t)); + if (!cm_info_local_var) { + return NULL; + } + cm_info_local_var->cm_state = cm_state; + cm_info_local_var->access_type = access_type; + + return cm_info_local_var; +} + +void OpenAPI_cm_info_free(OpenAPI_cm_info_t *cm_info) +{ + if (NULL == cm_info) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_cm_state_free(cm_info->cm_state); + ogs_free(cm_info); +} + +cJSON *OpenAPI_cm_info_convertToJSON(OpenAPI_cm_info_t *cm_info) +{ + cJSON *item = NULL; + + if (cm_info == NULL) { + ogs_error("OpenAPI_cm_info_convertToJSON() failed [CmInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!cm_info->cm_state) { + ogs_error("OpenAPI_cm_info_convertToJSON() failed [cm_state]"); + goto end; + } + cJSON *cm_state_local_JSON = OpenAPI_cm_state_convertToJSON(cm_info->cm_state); + if (cm_state_local_JSON == NULL) { + ogs_error("OpenAPI_cm_info_convertToJSON() failed [cm_state]"); + goto end; + } + cJSON_AddItemToObject(item, "cmState", cm_state_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_cm_info_convertToJSON() failed [cm_state]"); + goto end; + } + + if (!cm_info->access_type) { + ogs_error("OpenAPI_cm_info_convertToJSON() failed [access_type]"); + goto end; + } + if (cJSON_AddStringToObject(item, "accessType", OpenAPI_access_type_ToString(cm_info->access_type)) == NULL) { + ogs_error("OpenAPI_cm_info_convertToJSON() failed [access_type]"); + goto end; + } + +end: + return item; +} + +OpenAPI_cm_info_t *OpenAPI_cm_info_parseFromJSON(cJSON *cm_infoJSON) +{ + OpenAPI_cm_info_t *cm_info_local_var = NULL; + cJSON *cm_state = cJSON_GetObjectItemCaseSensitive(cm_infoJSON, "cmState"); + if (!cm_state) { + ogs_error("OpenAPI_cm_info_parseFromJSON() failed [cm_state]"); + goto end; + } + + OpenAPI_cm_state_t *cm_state_local_nonprim = NULL; + + cm_state_local_nonprim = OpenAPI_cm_state_parseFromJSON(cm_state); + + cJSON *access_type = cJSON_GetObjectItemCaseSensitive(cm_infoJSON, "accessType"); + if (!access_type) { + ogs_error("OpenAPI_cm_info_parseFromJSON() failed [access_type]"); + goto end; + } + + OpenAPI_access_type_e access_typeVariable; + + if (!cJSON_IsString(access_type)) { + ogs_error("OpenAPI_cm_info_parseFromJSON() failed [access_type]"); + goto end; + } + access_typeVariable = OpenAPI_access_type_FromString(access_type->valuestring); + + cm_info_local_var = OpenAPI_cm_info_create ( + cm_state_local_nonprim, + access_typeVariable + ); + + return cm_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/cm_info.h b/lib/sbi/openapi/model/cm_info.h new file mode 100644 index 0000000000..aa72ead8f7 --- /dev/null +++ b/lib/sbi/openapi/model/cm_info.h @@ -0,0 +1,41 @@ +/* + * cm_info.h + * + * + */ + +#ifndef _OpenAPI_cm_info_H_ +#define _OpenAPI_cm_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "access_type.h" +#include "cm_state.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_cm_info_s OpenAPI_cm_info_t; +typedef struct OpenAPI_cm_info_s { + struct OpenAPI_cm_state_s *cm_state; + OpenAPI_access_type_e access_type; +} OpenAPI_cm_info_t; + +OpenAPI_cm_info_t *OpenAPI_cm_info_create( + OpenAPI_cm_state_t *cm_state, + OpenAPI_access_type_e access_type + ); +void OpenAPI_cm_info_free(OpenAPI_cm_info_t *cm_info); +OpenAPI_cm_info_t *OpenAPI_cm_info_parseFromJSON(cJSON *cm_infoJSON); +cJSON *OpenAPI_cm_info_convertToJSON(OpenAPI_cm_info_t *cm_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_cm_info_H_ */ + diff --git a/lib/sbi/openapi/model/cm_info_report.c b/lib/sbi/openapi/model/cm_info_report.c new file mode 100644 index 0000000000..a8f610f689 --- /dev/null +++ b/lib/sbi/openapi/model/cm_info_report.c @@ -0,0 +1,156 @@ + +#include +#include +#include +#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; +} + diff --git a/lib/sbi/openapi/model/cm_info_report.h b/lib/sbi/openapi/model/cm_info_report.h new file mode 100644 index 0000000000..9adda09b8b --- /dev/null +++ b/lib/sbi/openapi/model/cm_info_report.h @@ -0,0 +1,40 @@ +/* + * cm_info_report.h + * + * + */ + +#ifndef _OpenAPI_cm_info_report_H_ +#define _OpenAPI_cm_info_report_H_ + +#include +#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); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_cm_info_report_H_ */ + diff --git a/lib/sbi/openapi/model/cm_state.c b/lib/sbi/openapi/model/cm_state.c new file mode 100644 index 0000000000..95061fe1d1 --- /dev/null +++ b/lib/sbi/openapi/model/cm_state.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "cm_state.h" + +OpenAPI_cm_state_t *OpenAPI_cm_state_create( + ) +{ + OpenAPI_cm_state_t *cm_state_local_var = OpenAPI_malloc(sizeof(OpenAPI_cm_state_t)); + if (!cm_state_local_var) { + return NULL; + } + + return cm_state_local_var; +} + +void OpenAPI_cm_state_free(OpenAPI_cm_state_t *cm_state) +{ + if (NULL == cm_state) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(cm_state); +} + +cJSON *OpenAPI_cm_state_convertToJSON(OpenAPI_cm_state_t *cm_state) +{ + cJSON *item = NULL; + + if (cm_state == NULL) { + ogs_error("OpenAPI_cm_state_convertToJSON() failed [CmState]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_cm_state_t *OpenAPI_cm_state_parseFromJSON(cJSON *cm_stateJSON) +{ + OpenAPI_cm_state_t *cm_state_local_var = NULL; + cm_state_local_var = OpenAPI_cm_state_create ( + ); + + return cm_state_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/cm_state.h b/lib/sbi/openapi/model/cm_state.h new file mode 100644 index 0000000000..20d356d273 --- /dev/null +++ b/lib/sbi/openapi/model/cm_state.h @@ -0,0 +1,35 @@ +/* + * cm_state.h + * + * + */ + +#ifndef _OpenAPI_cm_state_H_ +#define _OpenAPI_cm_state_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_cm_state_s OpenAPI_cm_state_t; +typedef struct OpenAPI_cm_state_s { +} OpenAPI_cm_state_t; + +OpenAPI_cm_state_t *OpenAPI_cm_state_create( + ); +void OpenAPI_cm_state_free(OpenAPI_cm_state_t *cm_state); +OpenAPI_cm_state_t *OpenAPI_cm_state_parseFromJSON(cJSON *cm_stateJSON); +cJSON *OpenAPI_cm_state_convertToJSON(OpenAPI_cm_state_t *cm_state); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_cm_state_H_ */ + diff --git a/lib/sbi/openapi/model/code_word_ind.c b/lib/sbi/openapi/model/code_word_ind.c new file mode 100644 index 0000000000..3a791da15a --- /dev/null +++ b/lib/sbi/openapi/model/code_word_ind.c @@ -0,0 +1,30 @@ + +#include +#include +#include +#include "code_word_ind.h" + +char* OpenAPI_code_word_ind_ToString(OpenAPI_code_word_ind_e code_word_ind) +{ + const char *code_word_indArray[] = { "NULL", "CODEWORD_CHECK_IN_UE", "CODEWORD_CHECK_IN_GMLC" }; + size_t sizeofArray = sizeof(code_word_indArray) / sizeof(code_word_indArray[0]); + if (code_word_ind < sizeofArray) + return (char *)code_word_indArray[code_word_ind]; + else + return (char *)"Unknown"; +} + +OpenAPI_code_word_ind_e OpenAPI_code_word_ind_FromString(char* code_word_ind) +{ + int stringToReturn = 0; + const char *code_word_indArray[] = { "NULL", "CODEWORD_CHECK_IN_UE", "CODEWORD_CHECK_IN_GMLC" }; + size_t sizeofArray = sizeof(code_word_indArray) / sizeof(code_word_indArray[0]); + while (stringToReturn < sizeofArray) { + if (strcmp(code_word_ind, code_word_indArray[stringToReturn]) == 0) { + return stringToReturn; + } + stringToReturn++; + } + return 0; +} + diff --git a/lib/sbi/openapi/model/code_word_ind.h b/lib/sbi/openapi/model/code_word_ind.h new file mode 100644 index 0000000000..9a433b722b --- /dev/null +++ b/lib/sbi/openapi/model/code_word_ind.h @@ -0,0 +1,31 @@ +/* + * code_word_ind.h + * + * + */ + +#ifndef _OpenAPI_code_word_ind_H_ +#define _OpenAPI_code_word_ind_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { OpenAPI_code_word_ind_NULL = 0, OpenAPI_code_word_ind_CODEWORD_CHECK_IN_UE, OpenAPI_code_word_ind_CODEWORD_CHECK_IN_GMLC } OpenAPI_code_word_ind_e; + +char* OpenAPI_code_word_ind_ToString(OpenAPI_code_word_ind_e code_word_ind); + +OpenAPI_code_word_ind_e OpenAPI_code_word_ind_FromString(char* code_word_ind); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_code_word_ind_H_ */ + diff --git a/lib/sbi/openapi/model/communication_characteristics.c b/lib/sbi/openapi/model/communication_characteristics.c new file mode 100644 index 0000000000..2e998350df --- /dev/null +++ b/lib/sbi/openapi/model/communication_characteristics.c @@ -0,0 +1,190 @@ + +#include +#include +#include +#include "communication_characteristics.h" + +OpenAPI_communication_characteristics_t *OpenAPI_communication_characteristics_create( + OpenAPI_pp_subs_reg_timer_t *pp_subs_reg_timer, + OpenAPI_pp_active_time_t *pp_active_time, + int pp_dl_packet_count, + OpenAPI_pp_dl_packet_count_ext_t *pp_dl_packet_count_ext, + OpenAPI_pp_maximum_response_time_t *pp_maximum_response_time, + OpenAPI_pp_maximum_latency_t *pp_maximum_latency + ) +{ + OpenAPI_communication_characteristics_t *communication_characteristics_local_var = OpenAPI_malloc(sizeof(OpenAPI_communication_characteristics_t)); + if (!communication_characteristics_local_var) { + return NULL; + } + communication_characteristics_local_var->pp_subs_reg_timer = pp_subs_reg_timer; + communication_characteristics_local_var->pp_active_time = pp_active_time; + communication_characteristics_local_var->pp_dl_packet_count = pp_dl_packet_count; + communication_characteristics_local_var->pp_dl_packet_count_ext = pp_dl_packet_count_ext; + communication_characteristics_local_var->pp_maximum_response_time = pp_maximum_response_time; + communication_characteristics_local_var->pp_maximum_latency = pp_maximum_latency; + + return communication_characteristics_local_var; +} + +void OpenAPI_communication_characteristics_free(OpenAPI_communication_characteristics_t *communication_characteristics) +{ + if (NULL == communication_characteristics) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_pp_subs_reg_timer_free(communication_characteristics->pp_subs_reg_timer); + OpenAPI_pp_active_time_free(communication_characteristics->pp_active_time); + OpenAPI_pp_dl_packet_count_ext_free(communication_characteristics->pp_dl_packet_count_ext); + OpenAPI_pp_maximum_response_time_free(communication_characteristics->pp_maximum_response_time); + OpenAPI_pp_maximum_latency_free(communication_characteristics->pp_maximum_latency); + ogs_free(communication_characteristics); +} + +cJSON *OpenAPI_communication_characteristics_convertToJSON(OpenAPI_communication_characteristics_t *communication_characteristics) +{ + cJSON *item = NULL; + + if (communication_characteristics == NULL) { + ogs_error("OpenAPI_communication_characteristics_convertToJSON() failed [CommunicationCharacteristics]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (communication_characteristics->pp_subs_reg_timer) { + cJSON *pp_subs_reg_timer_local_JSON = OpenAPI_pp_subs_reg_timer_convertToJSON(communication_characteristics->pp_subs_reg_timer); + if (pp_subs_reg_timer_local_JSON == NULL) { + ogs_error("OpenAPI_communication_characteristics_convertToJSON() failed [pp_subs_reg_timer]"); + goto end; + } + cJSON_AddItemToObject(item, "ppSubsRegTimer", pp_subs_reg_timer_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_communication_characteristics_convertToJSON() failed [pp_subs_reg_timer]"); + goto end; + } + } + + if (communication_characteristics->pp_active_time) { + cJSON *pp_active_time_local_JSON = OpenAPI_pp_active_time_convertToJSON(communication_characteristics->pp_active_time); + if (pp_active_time_local_JSON == NULL) { + ogs_error("OpenAPI_communication_characteristics_convertToJSON() failed [pp_active_time]"); + goto end; + } + cJSON_AddItemToObject(item, "ppActiveTime", pp_active_time_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_communication_characteristics_convertToJSON() failed [pp_active_time]"); + goto end; + } + } + + if (communication_characteristics->pp_dl_packet_count) { + if (cJSON_AddNumberToObject(item, "ppDlPacketCount", communication_characteristics->pp_dl_packet_count) == NULL) { + ogs_error("OpenAPI_communication_characteristics_convertToJSON() failed [pp_dl_packet_count]"); + goto end; + } + } + + if (communication_characteristics->pp_dl_packet_count_ext) { + cJSON *pp_dl_packet_count_ext_local_JSON = OpenAPI_pp_dl_packet_count_ext_convertToJSON(communication_characteristics->pp_dl_packet_count_ext); + if (pp_dl_packet_count_ext_local_JSON == NULL) { + ogs_error("OpenAPI_communication_characteristics_convertToJSON() failed [pp_dl_packet_count_ext]"); + goto end; + } + cJSON_AddItemToObject(item, "ppDlPacketCountExt", pp_dl_packet_count_ext_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_communication_characteristics_convertToJSON() failed [pp_dl_packet_count_ext]"); + goto end; + } + } + + if (communication_characteristics->pp_maximum_response_time) { + cJSON *pp_maximum_response_time_local_JSON = OpenAPI_pp_maximum_response_time_convertToJSON(communication_characteristics->pp_maximum_response_time); + if (pp_maximum_response_time_local_JSON == NULL) { + ogs_error("OpenAPI_communication_characteristics_convertToJSON() failed [pp_maximum_response_time]"); + goto end; + } + cJSON_AddItemToObject(item, "ppMaximumResponseTime", pp_maximum_response_time_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_communication_characteristics_convertToJSON() failed [pp_maximum_response_time]"); + goto end; + } + } + + if (communication_characteristics->pp_maximum_latency) { + cJSON *pp_maximum_latency_local_JSON = OpenAPI_pp_maximum_latency_convertToJSON(communication_characteristics->pp_maximum_latency); + if (pp_maximum_latency_local_JSON == NULL) { + ogs_error("OpenAPI_communication_characteristics_convertToJSON() failed [pp_maximum_latency]"); + goto end; + } + cJSON_AddItemToObject(item, "ppMaximumLatency", pp_maximum_latency_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_communication_characteristics_convertToJSON() failed [pp_maximum_latency]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_communication_characteristics_t *OpenAPI_communication_characteristics_parseFromJSON(cJSON *communication_characteristicsJSON) +{ + OpenAPI_communication_characteristics_t *communication_characteristics_local_var = NULL; + cJSON *pp_subs_reg_timer = cJSON_GetObjectItemCaseSensitive(communication_characteristicsJSON, "ppSubsRegTimer"); + + OpenAPI_pp_subs_reg_timer_t *pp_subs_reg_timer_local_nonprim = NULL; + if (pp_subs_reg_timer) { + pp_subs_reg_timer_local_nonprim = OpenAPI_pp_subs_reg_timer_parseFromJSON(pp_subs_reg_timer); + } + + cJSON *pp_active_time = cJSON_GetObjectItemCaseSensitive(communication_characteristicsJSON, "ppActiveTime"); + + OpenAPI_pp_active_time_t *pp_active_time_local_nonprim = NULL; + if (pp_active_time) { + pp_active_time_local_nonprim = OpenAPI_pp_active_time_parseFromJSON(pp_active_time); + } + + cJSON *pp_dl_packet_count = cJSON_GetObjectItemCaseSensitive(communication_characteristicsJSON, "ppDlPacketCount"); + + if (pp_dl_packet_count) { + if (!cJSON_IsNumber(pp_dl_packet_count)) { + ogs_error("OpenAPI_communication_characteristics_parseFromJSON() failed [pp_dl_packet_count]"); + goto end; + } + } + + cJSON *pp_dl_packet_count_ext = cJSON_GetObjectItemCaseSensitive(communication_characteristicsJSON, "ppDlPacketCountExt"); + + OpenAPI_pp_dl_packet_count_ext_t *pp_dl_packet_count_ext_local_nonprim = NULL; + if (pp_dl_packet_count_ext) { + pp_dl_packet_count_ext_local_nonprim = OpenAPI_pp_dl_packet_count_ext_parseFromJSON(pp_dl_packet_count_ext); + } + + cJSON *pp_maximum_response_time = cJSON_GetObjectItemCaseSensitive(communication_characteristicsJSON, "ppMaximumResponseTime"); + + OpenAPI_pp_maximum_response_time_t *pp_maximum_response_time_local_nonprim = NULL; + if (pp_maximum_response_time) { + pp_maximum_response_time_local_nonprim = OpenAPI_pp_maximum_response_time_parseFromJSON(pp_maximum_response_time); + } + + cJSON *pp_maximum_latency = cJSON_GetObjectItemCaseSensitive(communication_characteristicsJSON, "ppMaximumLatency"); + + OpenAPI_pp_maximum_latency_t *pp_maximum_latency_local_nonprim = NULL; + if (pp_maximum_latency) { + pp_maximum_latency_local_nonprim = OpenAPI_pp_maximum_latency_parseFromJSON(pp_maximum_latency); + } + + communication_characteristics_local_var = OpenAPI_communication_characteristics_create ( + pp_subs_reg_timer ? pp_subs_reg_timer_local_nonprim : NULL, + pp_active_time ? pp_active_time_local_nonprim : NULL, + pp_dl_packet_count ? pp_dl_packet_count->valuedouble : 0, + pp_dl_packet_count_ext ? pp_dl_packet_count_ext_local_nonprim : NULL, + pp_maximum_response_time ? pp_maximum_response_time_local_nonprim : NULL, + pp_maximum_latency ? pp_maximum_latency_local_nonprim : NULL + ); + + return communication_characteristics_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/communication_characteristics.h b/lib/sbi/openapi/model/communication_characteristics.h new file mode 100644 index 0000000000..58bfcb30dd --- /dev/null +++ b/lib/sbi/openapi/model/communication_characteristics.h @@ -0,0 +1,52 @@ +/* + * communication_characteristics.h + * + * + */ + +#ifndef _OpenAPI_communication_characteristics_H_ +#define _OpenAPI_communication_characteristics_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "pp_active_time.h" +#include "pp_dl_packet_count_ext.h" +#include "pp_maximum_latency.h" +#include "pp_maximum_response_time.h" +#include "pp_subs_reg_timer.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_communication_characteristics_s OpenAPI_communication_characteristics_t; +typedef struct OpenAPI_communication_characteristics_s { + struct OpenAPI_pp_subs_reg_timer_s *pp_subs_reg_timer; + struct OpenAPI_pp_active_time_s *pp_active_time; + int pp_dl_packet_count; + struct OpenAPI_pp_dl_packet_count_ext_s *pp_dl_packet_count_ext; + struct OpenAPI_pp_maximum_response_time_s *pp_maximum_response_time; + struct OpenAPI_pp_maximum_latency_s *pp_maximum_latency; +} OpenAPI_communication_characteristics_t; + +OpenAPI_communication_characteristics_t *OpenAPI_communication_characteristics_create( + OpenAPI_pp_subs_reg_timer_t *pp_subs_reg_timer, + OpenAPI_pp_active_time_t *pp_active_time, + int pp_dl_packet_count, + OpenAPI_pp_dl_packet_count_ext_t *pp_dl_packet_count_ext, + OpenAPI_pp_maximum_response_time_t *pp_maximum_response_time, + OpenAPI_pp_maximum_latency_t *pp_maximum_latency + ); +void OpenAPI_communication_characteristics_free(OpenAPI_communication_characteristics_t *communication_characteristics); +OpenAPI_communication_characteristics_t *OpenAPI_communication_characteristics_parseFromJSON(cJSON *communication_characteristicsJSON); +cJSON *OpenAPI_communication_characteristics_convertToJSON(OpenAPI_communication_characteristics_t *communication_characteristics); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_communication_characteristics_H_ */ + diff --git a/lib/sbi/openapi/model/configuration_parameters_eutra.c b/lib/sbi/openapi/model/configuration_parameters_eutra.c new file mode 100644 index 0000000000..093e782628 --- /dev/null +++ b/lib/sbi/openapi/model/configuration_parameters_eutra.c @@ -0,0 +1,251 @@ + +#include +#include +#include +#include "configuration_parameters_eutra.h" + +OpenAPI_configuration_parameters_eutra_t *OpenAPI_configuration_parameters_eutra_create( + OpenAPI_list_t *ser_to_layer2_ids, + OpenAPI_list_t *pppp_to_pdbs, + OpenAPI_list_t *ser_id_to_frequs, + OpenAPI_list_t *ser_id_to_ppprs + ) +{ + OpenAPI_configuration_parameters_eutra_t *configuration_parameters_eutra_local_var = OpenAPI_malloc(sizeof(OpenAPI_configuration_parameters_eutra_t)); + if (!configuration_parameters_eutra_local_var) { + return NULL; + } + configuration_parameters_eutra_local_var->ser_to_layer2_ids = ser_to_layer2_ids; + configuration_parameters_eutra_local_var->pppp_to_pdbs = pppp_to_pdbs; + configuration_parameters_eutra_local_var->ser_id_to_frequs = ser_id_to_frequs; + configuration_parameters_eutra_local_var->ser_id_to_ppprs = ser_id_to_ppprs; + + return configuration_parameters_eutra_local_var; +} + +void OpenAPI_configuration_parameters_eutra_free(OpenAPI_configuration_parameters_eutra_t *configuration_parameters_eutra) +{ + if (NULL == configuration_parameters_eutra) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(configuration_parameters_eutra->ser_to_layer2_ids, node) { + OpenAPI_service_id_to_layer2_id_free(node->data); + } + OpenAPI_list_free(configuration_parameters_eutra->ser_to_layer2_ids); + OpenAPI_list_for_each(configuration_parameters_eutra->pppp_to_pdbs, node) { + OpenAPI_pppp_to_pdb_free(node->data); + } + OpenAPI_list_free(configuration_parameters_eutra->pppp_to_pdbs); + OpenAPI_list_for_each(configuration_parameters_eutra->ser_id_to_frequs, node) { + OpenAPI_service_id_to_frequency_free(node->data); + } + OpenAPI_list_free(configuration_parameters_eutra->ser_id_to_frequs); + OpenAPI_list_for_each(configuration_parameters_eutra->ser_id_to_ppprs, node) { + OpenAPI_service_id_to_pppr_free(node->data); + } + OpenAPI_list_free(configuration_parameters_eutra->ser_id_to_ppprs); + ogs_free(configuration_parameters_eutra); +} + +cJSON *OpenAPI_configuration_parameters_eutra_convertToJSON(OpenAPI_configuration_parameters_eutra_t *configuration_parameters_eutra) +{ + cJSON *item = NULL; + + if (configuration_parameters_eutra == NULL) { + ogs_error("OpenAPI_configuration_parameters_eutra_convertToJSON() failed [ConfigurationParametersEutra]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (configuration_parameters_eutra->ser_to_layer2_ids) { + cJSON *ser_to_layer2_idsList = cJSON_AddArrayToObject(item, "serToLayer2Ids"); + if (ser_to_layer2_idsList == NULL) { + ogs_error("OpenAPI_configuration_parameters_eutra_convertToJSON() failed [ser_to_layer2_ids]"); + goto end; + } + + OpenAPI_lnode_t *ser_to_layer2_ids_node; + if (configuration_parameters_eutra->ser_to_layer2_ids) { + OpenAPI_list_for_each(configuration_parameters_eutra->ser_to_layer2_ids, ser_to_layer2_ids_node) { + cJSON *itemLocal = OpenAPI_service_id_to_layer2_id_convertToJSON(ser_to_layer2_ids_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_configuration_parameters_eutra_convertToJSON() failed [ser_to_layer2_ids]"); + goto end; + } + cJSON_AddItemToArray(ser_to_layer2_idsList, itemLocal); + } + } + } + + if (configuration_parameters_eutra->pppp_to_pdbs) { + cJSON *pppp_to_pdbsList = cJSON_AddArrayToObject(item, "ppppToPdbs"); + if (pppp_to_pdbsList == NULL) { + ogs_error("OpenAPI_configuration_parameters_eutra_convertToJSON() failed [pppp_to_pdbs]"); + goto end; + } + + OpenAPI_lnode_t *pppp_to_pdbs_node; + if (configuration_parameters_eutra->pppp_to_pdbs) { + OpenAPI_list_for_each(configuration_parameters_eutra->pppp_to_pdbs, pppp_to_pdbs_node) { + cJSON *itemLocal = OpenAPI_pppp_to_pdb_convertToJSON(pppp_to_pdbs_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_configuration_parameters_eutra_convertToJSON() failed [pppp_to_pdbs]"); + goto end; + } + cJSON_AddItemToArray(pppp_to_pdbsList, itemLocal); + } + } + } + + if (configuration_parameters_eutra->ser_id_to_frequs) { + cJSON *ser_id_to_frequsList = cJSON_AddArrayToObject(item, "serIdToFrequs"); + if (ser_id_to_frequsList == NULL) { + ogs_error("OpenAPI_configuration_parameters_eutra_convertToJSON() failed [ser_id_to_frequs]"); + goto end; + } + + OpenAPI_lnode_t *ser_id_to_frequs_node; + if (configuration_parameters_eutra->ser_id_to_frequs) { + OpenAPI_list_for_each(configuration_parameters_eutra->ser_id_to_frequs, ser_id_to_frequs_node) { + cJSON *itemLocal = OpenAPI_service_id_to_frequency_convertToJSON(ser_id_to_frequs_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_configuration_parameters_eutra_convertToJSON() failed [ser_id_to_frequs]"); + goto end; + } + cJSON_AddItemToArray(ser_id_to_frequsList, itemLocal); + } + } + } + + if (configuration_parameters_eutra->ser_id_to_ppprs) { + cJSON *ser_id_to_ppprsList = cJSON_AddArrayToObject(item, "serIdToPpprs"); + if (ser_id_to_ppprsList == NULL) { + ogs_error("OpenAPI_configuration_parameters_eutra_convertToJSON() failed [ser_id_to_ppprs]"); + goto end; + } + + OpenAPI_lnode_t *ser_id_to_ppprs_node; + if (configuration_parameters_eutra->ser_id_to_ppprs) { + OpenAPI_list_for_each(configuration_parameters_eutra->ser_id_to_ppprs, ser_id_to_ppprs_node) { + cJSON *itemLocal = OpenAPI_service_id_to_pppr_convertToJSON(ser_id_to_ppprs_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_configuration_parameters_eutra_convertToJSON() failed [ser_id_to_ppprs]"); + goto end; + } + cJSON_AddItemToArray(ser_id_to_ppprsList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_configuration_parameters_eutra_t *OpenAPI_configuration_parameters_eutra_parseFromJSON(cJSON *configuration_parameters_eutraJSON) +{ + OpenAPI_configuration_parameters_eutra_t *configuration_parameters_eutra_local_var = NULL; + cJSON *ser_to_layer2_ids = cJSON_GetObjectItemCaseSensitive(configuration_parameters_eutraJSON, "serToLayer2Ids"); + + OpenAPI_list_t *ser_to_layer2_idsList; + if (ser_to_layer2_ids) { + cJSON *ser_to_layer2_ids_local_nonprimitive; + if (!cJSON_IsArray(ser_to_layer2_ids)) { + ogs_error("OpenAPI_configuration_parameters_eutra_parseFromJSON() failed [ser_to_layer2_ids]"); + goto end; + } + + ser_to_layer2_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ser_to_layer2_ids_local_nonprimitive, ser_to_layer2_ids ) { + if (!cJSON_IsObject(ser_to_layer2_ids_local_nonprimitive)) { + ogs_error("OpenAPI_configuration_parameters_eutra_parseFromJSON() failed [ser_to_layer2_ids]"); + goto end; + } + OpenAPI_service_id_to_layer2_id_t *ser_to_layer2_idsItem = OpenAPI_service_id_to_layer2_id_parseFromJSON(ser_to_layer2_ids_local_nonprimitive); + + OpenAPI_list_add(ser_to_layer2_idsList, ser_to_layer2_idsItem); + } + } + + cJSON *pppp_to_pdbs = cJSON_GetObjectItemCaseSensitive(configuration_parameters_eutraJSON, "ppppToPdbs"); + + OpenAPI_list_t *pppp_to_pdbsList; + if (pppp_to_pdbs) { + cJSON *pppp_to_pdbs_local_nonprimitive; + if (!cJSON_IsArray(pppp_to_pdbs)) { + ogs_error("OpenAPI_configuration_parameters_eutra_parseFromJSON() failed [pppp_to_pdbs]"); + goto end; + } + + pppp_to_pdbsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pppp_to_pdbs_local_nonprimitive, pppp_to_pdbs ) { + if (!cJSON_IsObject(pppp_to_pdbs_local_nonprimitive)) { + ogs_error("OpenAPI_configuration_parameters_eutra_parseFromJSON() failed [pppp_to_pdbs]"); + goto end; + } + OpenAPI_pppp_to_pdb_t *pppp_to_pdbsItem = OpenAPI_pppp_to_pdb_parseFromJSON(pppp_to_pdbs_local_nonprimitive); + + OpenAPI_list_add(pppp_to_pdbsList, pppp_to_pdbsItem); + } + } + + cJSON *ser_id_to_frequs = cJSON_GetObjectItemCaseSensitive(configuration_parameters_eutraJSON, "serIdToFrequs"); + + OpenAPI_list_t *ser_id_to_frequsList; + if (ser_id_to_frequs) { + cJSON *ser_id_to_frequs_local_nonprimitive; + if (!cJSON_IsArray(ser_id_to_frequs)) { + ogs_error("OpenAPI_configuration_parameters_eutra_parseFromJSON() failed [ser_id_to_frequs]"); + goto end; + } + + ser_id_to_frequsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ser_id_to_frequs_local_nonprimitive, ser_id_to_frequs ) { + if (!cJSON_IsObject(ser_id_to_frequs_local_nonprimitive)) { + ogs_error("OpenAPI_configuration_parameters_eutra_parseFromJSON() failed [ser_id_to_frequs]"); + goto end; + } + OpenAPI_service_id_to_frequency_t *ser_id_to_frequsItem = OpenAPI_service_id_to_frequency_parseFromJSON(ser_id_to_frequs_local_nonprimitive); + + OpenAPI_list_add(ser_id_to_frequsList, ser_id_to_frequsItem); + } + } + + cJSON *ser_id_to_ppprs = cJSON_GetObjectItemCaseSensitive(configuration_parameters_eutraJSON, "serIdToPpprs"); + + OpenAPI_list_t *ser_id_to_ppprsList; + if (ser_id_to_ppprs) { + cJSON *ser_id_to_ppprs_local_nonprimitive; + if (!cJSON_IsArray(ser_id_to_ppprs)) { + ogs_error("OpenAPI_configuration_parameters_eutra_parseFromJSON() failed [ser_id_to_ppprs]"); + goto end; + } + + ser_id_to_ppprsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ser_id_to_ppprs_local_nonprimitive, ser_id_to_ppprs ) { + if (!cJSON_IsObject(ser_id_to_ppprs_local_nonprimitive)) { + ogs_error("OpenAPI_configuration_parameters_eutra_parseFromJSON() failed [ser_id_to_ppprs]"); + goto end; + } + OpenAPI_service_id_to_pppr_t *ser_id_to_ppprsItem = OpenAPI_service_id_to_pppr_parseFromJSON(ser_id_to_ppprs_local_nonprimitive); + + OpenAPI_list_add(ser_id_to_ppprsList, ser_id_to_ppprsItem); + } + } + + configuration_parameters_eutra_local_var = OpenAPI_configuration_parameters_eutra_create ( + ser_to_layer2_ids ? ser_to_layer2_idsList : NULL, + pppp_to_pdbs ? pppp_to_pdbsList : NULL, + ser_id_to_frequs ? ser_id_to_frequsList : NULL, + ser_id_to_ppprs ? ser_id_to_ppprsList : NULL + ); + + return configuration_parameters_eutra_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/configuration_parameters_eutra.h b/lib/sbi/openapi/model/configuration_parameters_eutra.h new file mode 100644 index 0000000000..afb1434965 --- /dev/null +++ b/lib/sbi/openapi/model/configuration_parameters_eutra.h @@ -0,0 +1,47 @@ +/* + * configuration_parameters_eutra.h + * + * + */ + +#ifndef _OpenAPI_configuration_parameters_eutra_H_ +#define _OpenAPI_configuration_parameters_eutra_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "pppp_to_pdb.h" +#include "service_id_to_frequency.h" +#include "service_id_to_layer2_id.h" +#include "service_id_to_pppr.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_configuration_parameters_eutra_s OpenAPI_configuration_parameters_eutra_t; +typedef struct OpenAPI_configuration_parameters_eutra_s { + OpenAPI_list_t *ser_to_layer2_ids; + OpenAPI_list_t *pppp_to_pdbs; + OpenAPI_list_t *ser_id_to_frequs; + OpenAPI_list_t *ser_id_to_ppprs; +} OpenAPI_configuration_parameters_eutra_t; + +OpenAPI_configuration_parameters_eutra_t *OpenAPI_configuration_parameters_eutra_create( + OpenAPI_list_t *ser_to_layer2_ids, + OpenAPI_list_t *pppp_to_pdbs, + OpenAPI_list_t *ser_id_to_frequs, + OpenAPI_list_t *ser_id_to_ppprs + ); +void OpenAPI_configuration_parameters_eutra_free(OpenAPI_configuration_parameters_eutra_t *configuration_parameters_eutra); +OpenAPI_configuration_parameters_eutra_t *OpenAPI_configuration_parameters_eutra_parseFromJSON(cJSON *configuration_parameters_eutraJSON); +cJSON *OpenAPI_configuration_parameters_eutra_convertToJSON(OpenAPI_configuration_parameters_eutra_t *configuration_parameters_eutra); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_configuration_parameters_eutra_H_ */ + diff --git a/lib/sbi/openapi/model/configuration_parameters_nr.c b/lib/sbi/openapi/model/configuration_parameters_nr.c new file mode 100644 index 0000000000..1ea1d6abd8 --- /dev/null +++ b/lib/sbi/openapi/model/configuration_parameters_nr.c @@ -0,0 +1,351 @@ + +#include +#include +#include +#include "configuration_parameters_nr.h" + +OpenAPI_configuration_parameters_nr_t *OpenAPI_configuration_parameters_nr_create( + OpenAPI_list_t *ser_to_bro_layer2_ids, + OpenAPI_list_t *ser_to_gro_layer2_ids, + OpenAPI_list_t *ser_to_def_layer2_ids, + OpenAPI_list_t *ser_id_to_frequs, + OpenAPI_list_t *pc5_qos_mappings, + OpenAPI_list_t *slrb_configs + ) +{ + OpenAPI_configuration_parameters_nr_t *configuration_parameters_nr_local_var = OpenAPI_malloc(sizeof(OpenAPI_configuration_parameters_nr_t)); + if (!configuration_parameters_nr_local_var) { + return NULL; + } + configuration_parameters_nr_local_var->ser_to_bro_layer2_ids = ser_to_bro_layer2_ids; + configuration_parameters_nr_local_var->ser_to_gro_layer2_ids = ser_to_gro_layer2_ids; + configuration_parameters_nr_local_var->ser_to_def_layer2_ids = ser_to_def_layer2_ids; + configuration_parameters_nr_local_var->ser_id_to_frequs = ser_id_to_frequs; + configuration_parameters_nr_local_var->pc5_qos_mappings = pc5_qos_mappings; + configuration_parameters_nr_local_var->slrb_configs = slrb_configs; + + return configuration_parameters_nr_local_var; +} + +void OpenAPI_configuration_parameters_nr_free(OpenAPI_configuration_parameters_nr_t *configuration_parameters_nr) +{ + if (NULL == configuration_parameters_nr) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(configuration_parameters_nr->ser_to_bro_layer2_ids, node) { + OpenAPI_service_id_to_layer2_id_free(node->data); + } + OpenAPI_list_free(configuration_parameters_nr->ser_to_bro_layer2_ids); + OpenAPI_list_for_each(configuration_parameters_nr->ser_to_gro_layer2_ids, node) { + OpenAPI_service_id_to_layer2_id_free(node->data); + } + OpenAPI_list_free(configuration_parameters_nr->ser_to_gro_layer2_ids); + OpenAPI_list_for_each(configuration_parameters_nr->ser_to_def_layer2_ids, node) { + OpenAPI_service_id_to_layer2_id_free(node->data); + } + OpenAPI_list_free(configuration_parameters_nr->ser_to_def_layer2_ids); + OpenAPI_list_for_each(configuration_parameters_nr->ser_id_to_frequs, node) { + OpenAPI_service_id_to_frequency_free(node->data); + } + OpenAPI_list_free(configuration_parameters_nr->ser_id_to_frequs); + OpenAPI_list_for_each(configuration_parameters_nr->pc5_qos_mappings, node) { + OpenAPI_pc5_qos_mapping_free(node->data); + } + OpenAPI_list_free(configuration_parameters_nr->pc5_qos_mappings); + OpenAPI_list_for_each(configuration_parameters_nr->slrb_configs, node) { + OpenAPI_slrb_configurations_free(node->data); + } + OpenAPI_list_free(configuration_parameters_nr->slrb_configs); + ogs_free(configuration_parameters_nr); +} + +cJSON *OpenAPI_configuration_parameters_nr_convertToJSON(OpenAPI_configuration_parameters_nr_t *configuration_parameters_nr) +{ + cJSON *item = NULL; + + if (configuration_parameters_nr == NULL) { + ogs_error("OpenAPI_configuration_parameters_nr_convertToJSON() failed [ConfigurationParametersNr]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (configuration_parameters_nr->ser_to_bro_layer2_ids) { + cJSON *ser_to_bro_layer2_idsList = cJSON_AddArrayToObject(item, "serToBroLayer2Ids"); + if (ser_to_bro_layer2_idsList == NULL) { + ogs_error("OpenAPI_configuration_parameters_nr_convertToJSON() failed [ser_to_bro_layer2_ids]"); + goto end; + } + + OpenAPI_lnode_t *ser_to_bro_layer2_ids_node; + if (configuration_parameters_nr->ser_to_bro_layer2_ids) { + OpenAPI_list_for_each(configuration_parameters_nr->ser_to_bro_layer2_ids, ser_to_bro_layer2_ids_node) { + cJSON *itemLocal = OpenAPI_service_id_to_layer2_id_convertToJSON(ser_to_bro_layer2_ids_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_configuration_parameters_nr_convertToJSON() failed [ser_to_bro_layer2_ids]"); + goto end; + } + cJSON_AddItemToArray(ser_to_bro_layer2_idsList, itemLocal); + } + } + } + + if (configuration_parameters_nr->ser_to_gro_layer2_ids) { + cJSON *ser_to_gro_layer2_idsList = cJSON_AddArrayToObject(item, "serToGroLayer2Ids"); + if (ser_to_gro_layer2_idsList == NULL) { + ogs_error("OpenAPI_configuration_parameters_nr_convertToJSON() failed [ser_to_gro_layer2_ids]"); + goto end; + } + + OpenAPI_lnode_t *ser_to_gro_layer2_ids_node; + if (configuration_parameters_nr->ser_to_gro_layer2_ids) { + OpenAPI_list_for_each(configuration_parameters_nr->ser_to_gro_layer2_ids, ser_to_gro_layer2_ids_node) { + cJSON *itemLocal = OpenAPI_service_id_to_layer2_id_convertToJSON(ser_to_gro_layer2_ids_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_configuration_parameters_nr_convertToJSON() failed [ser_to_gro_layer2_ids]"); + goto end; + } + cJSON_AddItemToArray(ser_to_gro_layer2_idsList, itemLocal); + } + } + } + + if (configuration_parameters_nr->ser_to_def_layer2_ids) { + cJSON *ser_to_def_layer2_idsList = cJSON_AddArrayToObject(item, "serToDefLayer2Ids"); + if (ser_to_def_layer2_idsList == NULL) { + ogs_error("OpenAPI_configuration_parameters_nr_convertToJSON() failed [ser_to_def_layer2_ids]"); + goto end; + } + + OpenAPI_lnode_t *ser_to_def_layer2_ids_node; + if (configuration_parameters_nr->ser_to_def_layer2_ids) { + OpenAPI_list_for_each(configuration_parameters_nr->ser_to_def_layer2_ids, ser_to_def_layer2_ids_node) { + cJSON *itemLocal = OpenAPI_service_id_to_layer2_id_convertToJSON(ser_to_def_layer2_ids_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_configuration_parameters_nr_convertToJSON() failed [ser_to_def_layer2_ids]"); + goto end; + } + cJSON_AddItemToArray(ser_to_def_layer2_idsList, itemLocal); + } + } + } + + if (configuration_parameters_nr->ser_id_to_frequs) { + cJSON *ser_id_to_frequsList = cJSON_AddArrayToObject(item, "serIdToFrequs"); + if (ser_id_to_frequsList == NULL) { + ogs_error("OpenAPI_configuration_parameters_nr_convertToJSON() failed [ser_id_to_frequs]"); + goto end; + } + + OpenAPI_lnode_t *ser_id_to_frequs_node; + if (configuration_parameters_nr->ser_id_to_frequs) { + OpenAPI_list_for_each(configuration_parameters_nr->ser_id_to_frequs, ser_id_to_frequs_node) { + cJSON *itemLocal = OpenAPI_service_id_to_frequency_convertToJSON(ser_id_to_frequs_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_configuration_parameters_nr_convertToJSON() failed [ser_id_to_frequs]"); + goto end; + } + cJSON_AddItemToArray(ser_id_to_frequsList, itemLocal); + } + } + } + + if (configuration_parameters_nr->pc5_qos_mappings) { + cJSON *pc5_qos_mappingsList = cJSON_AddArrayToObject(item, "pc5QosMappings"); + if (pc5_qos_mappingsList == NULL) { + ogs_error("OpenAPI_configuration_parameters_nr_convertToJSON() failed [pc5_qos_mappings]"); + goto end; + } + + OpenAPI_lnode_t *pc5_qos_mappings_node; + if (configuration_parameters_nr->pc5_qos_mappings) { + OpenAPI_list_for_each(configuration_parameters_nr->pc5_qos_mappings, pc5_qos_mappings_node) { + cJSON *itemLocal = OpenAPI_pc5_qos_mapping_convertToJSON(pc5_qos_mappings_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_configuration_parameters_nr_convertToJSON() failed [pc5_qos_mappings]"); + goto end; + } + cJSON_AddItemToArray(pc5_qos_mappingsList, itemLocal); + } + } + } + + if (configuration_parameters_nr->slrb_configs) { + cJSON *slrb_configsList = cJSON_AddArrayToObject(item, "slrbConfigs"); + if (slrb_configsList == NULL) { + ogs_error("OpenAPI_configuration_parameters_nr_convertToJSON() failed [slrb_configs]"); + goto end; + } + + OpenAPI_lnode_t *slrb_configs_node; + if (configuration_parameters_nr->slrb_configs) { + OpenAPI_list_for_each(configuration_parameters_nr->slrb_configs, slrb_configs_node) { + cJSON *itemLocal = OpenAPI_slrb_configurations_convertToJSON(slrb_configs_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_configuration_parameters_nr_convertToJSON() failed [slrb_configs]"); + goto end; + } + cJSON_AddItemToArray(slrb_configsList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_configuration_parameters_nr_t *OpenAPI_configuration_parameters_nr_parseFromJSON(cJSON *configuration_parameters_nrJSON) +{ + OpenAPI_configuration_parameters_nr_t *configuration_parameters_nr_local_var = NULL; + cJSON *ser_to_bro_layer2_ids = cJSON_GetObjectItemCaseSensitive(configuration_parameters_nrJSON, "serToBroLayer2Ids"); + + OpenAPI_list_t *ser_to_bro_layer2_idsList; + if (ser_to_bro_layer2_ids) { + cJSON *ser_to_bro_layer2_ids_local_nonprimitive; + if (!cJSON_IsArray(ser_to_bro_layer2_ids)) { + ogs_error("OpenAPI_configuration_parameters_nr_parseFromJSON() failed [ser_to_bro_layer2_ids]"); + goto end; + } + + ser_to_bro_layer2_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ser_to_bro_layer2_ids_local_nonprimitive, ser_to_bro_layer2_ids ) { + if (!cJSON_IsObject(ser_to_bro_layer2_ids_local_nonprimitive)) { + ogs_error("OpenAPI_configuration_parameters_nr_parseFromJSON() failed [ser_to_bro_layer2_ids]"); + goto end; + } + OpenAPI_service_id_to_layer2_id_t *ser_to_bro_layer2_idsItem = OpenAPI_service_id_to_layer2_id_parseFromJSON(ser_to_bro_layer2_ids_local_nonprimitive); + + OpenAPI_list_add(ser_to_bro_layer2_idsList, ser_to_bro_layer2_idsItem); + } + } + + cJSON *ser_to_gro_layer2_ids = cJSON_GetObjectItemCaseSensitive(configuration_parameters_nrJSON, "serToGroLayer2Ids"); + + OpenAPI_list_t *ser_to_gro_layer2_idsList; + if (ser_to_gro_layer2_ids) { + cJSON *ser_to_gro_layer2_ids_local_nonprimitive; + if (!cJSON_IsArray(ser_to_gro_layer2_ids)) { + ogs_error("OpenAPI_configuration_parameters_nr_parseFromJSON() failed [ser_to_gro_layer2_ids]"); + goto end; + } + + ser_to_gro_layer2_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ser_to_gro_layer2_ids_local_nonprimitive, ser_to_gro_layer2_ids ) { + if (!cJSON_IsObject(ser_to_gro_layer2_ids_local_nonprimitive)) { + ogs_error("OpenAPI_configuration_parameters_nr_parseFromJSON() failed [ser_to_gro_layer2_ids]"); + goto end; + } + OpenAPI_service_id_to_layer2_id_t *ser_to_gro_layer2_idsItem = OpenAPI_service_id_to_layer2_id_parseFromJSON(ser_to_gro_layer2_ids_local_nonprimitive); + + OpenAPI_list_add(ser_to_gro_layer2_idsList, ser_to_gro_layer2_idsItem); + } + } + + cJSON *ser_to_def_layer2_ids = cJSON_GetObjectItemCaseSensitive(configuration_parameters_nrJSON, "serToDefLayer2Ids"); + + OpenAPI_list_t *ser_to_def_layer2_idsList; + if (ser_to_def_layer2_ids) { + cJSON *ser_to_def_layer2_ids_local_nonprimitive; + if (!cJSON_IsArray(ser_to_def_layer2_ids)) { + ogs_error("OpenAPI_configuration_parameters_nr_parseFromJSON() failed [ser_to_def_layer2_ids]"); + goto end; + } + + ser_to_def_layer2_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ser_to_def_layer2_ids_local_nonprimitive, ser_to_def_layer2_ids ) { + if (!cJSON_IsObject(ser_to_def_layer2_ids_local_nonprimitive)) { + ogs_error("OpenAPI_configuration_parameters_nr_parseFromJSON() failed [ser_to_def_layer2_ids]"); + goto end; + } + OpenAPI_service_id_to_layer2_id_t *ser_to_def_layer2_idsItem = OpenAPI_service_id_to_layer2_id_parseFromJSON(ser_to_def_layer2_ids_local_nonprimitive); + + OpenAPI_list_add(ser_to_def_layer2_idsList, ser_to_def_layer2_idsItem); + } + } + + cJSON *ser_id_to_frequs = cJSON_GetObjectItemCaseSensitive(configuration_parameters_nrJSON, "serIdToFrequs"); + + OpenAPI_list_t *ser_id_to_frequsList; + if (ser_id_to_frequs) { + cJSON *ser_id_to_frequs_local_nonprimitive; + if (!cJSON_IsArray(ser_id_to_frequs)) { + ogs_error("OpenAPI_configuration_parameters_nr_parseFromJSON() failed [ser_id_to_frequs]"); + goto end; + } + + ser_id_to_frequsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ser_id_to_frequs_local_nonprimitive, ser_id_to_frequs ) { + if (!cJSON_IsObject(ser_id_to_frequs_local_nonprimitive)) { + ogs_error("OpenAPI_configuration_parameters_nr_parseFromJSON() failed [ser_id_to_frequs]"); + goto end; + } + OpenAPI_service_id_to_frequency_t *ser_id_to_frequsItem = OpenAPI_service_id_to_frequency_parseFromJSON(ser_id_to_frequs_local_nonprimitive); + + OpenAPI_list_add(ser_id_to_frequsList, ser_id_to_frequsItem); + } + } + + cJSON *pc5_qos_mappings = cJSON_GetObjectItemCaseSensitive(configuration_parameters_nrJSON, "pc5QosMappings"); + + OpenAPI_list_t *pc5_qos_mappingsList; + if (pc5_qos_mappings) { + cJSON *pc5_qos_mappings_local_nonprimitive; + if (!cJSON_IsArray(pc5_qos_mappings)) { + ogs_error("OpenAPI_configuration_parameters_nr_parseFromJSON() failed [pc5_qos_mappings]"); + goto end; + } + + pc5_qos_mappingsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pc5_qos_mappings_local_nonprimitive, pc5_qos_mappings ) { + if (!cJSON_IsObject(pc5_qos_mappings_local_nonprimitive)) { + ogs_error("OpenAPI_configuration_parameters_nr_parseFromJSON() failed [pc5_qos_mappings]"); + goto end; + } + OpenAPI_pc5_qos_mapping_t *pc5_qos_mappingsItem = OpenAPI_pc5_qos_mapping_parseFromJSON(pc5_qos_mappings_local_nonprimitive); + + OpenAPI_list_add(pc5_qos_mappingsList, pc5_qos_mappingsItem); + } + } + + cJSON *slrb_configs = cJSON_GetObjectItemCaseSensitive(configuration_parameters_nrJSON, "slrbConfigs"); + + OpenAPI_list_t *slrb_configsList; + if (slrb_configs) { + cJSON *slrb_configs_local_nonprimitive; + if (!cJSON_IsArray(slrb_configs)) { + ogs_error("OpenAPI_configuration_parameters_nr_parseFromJSON() failed [slrb_configs]"); + goto end; + } + + slrb_configsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(slrb_configs_local_nonprimitive, slrb_configs ) { + if (!cJSON_IsObject(slrb_configs_local_nonprimitive)) { + ogs_error("OpenAPI_configuration_parameters_nr_parseFromJSON() failed [slrb_configs]"); + goto end; + } + OpenAPI_slrb_configurations_t *slrb_configsItem = OpenAPI_slrb_configurations_parseFromJSON(slrb_configs_local_nonprimitive); + + OpenAPI_list_add(slrb_configsList, slrb_configsItem); + } + } + + configuration_parameters_nr_local_var = OpenAPI_configuration_parameters_nr_create ( + ser_to_bro_layer2_ids ? ser_to_bro_layer2_idsList : NULL, + ser_to_gro_layer2_ids ? ser_to_gro_layer2_idsList : NULL, + ser_to_def_layer2_ids ? ser_to_def_layer2_idsList : NULL, + ser_id_to_frequs ? ser_id_to_frequsList : NULL, + pc5_qos_mappings ? pc5_qos_mappingsList : NULL, + slrb_configs ? slrb_configsList : NULL + ); + + return configuration_parameters_nr_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/configuration_parameters_nr.h b/lib/sbi/openapi/model/configuration_parameters_nr.h new file mode 100644 index 0000000000..0c948465ee --- /dev/null +++ b/lib/sbi/openapi/model/configuration_parameters_nr.h @@ -0,0 +1,51 @@ +/* + * configuration_parameters_nr.h + * + * + */ + +#ifndef _OpenAPI_configuration_parameters_nr_H_ +#define _OpenAPI_configuration_parameters_nr_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "pc5_qos_mapping.h" +#include "service_id_to_frequency.h" +#include "service_id_to_layer2_id.h" +#include "slrb_configurations.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_configuration_parameters_nr_s OpenAPI_configuration_parameters_nr_t; +typedef struct OpenAPI_configuration_parameters_nr_s { + OpenAPI_list_t *ser_to_bro_layer2_ids; + OpenAPI_list_t *ser_to_gro_layer2_ids; + OpenAPI_list_t *ser_to_def_layer2_ids; + OpenAPI_list_t *ser_id_to_frequs; + OpenAPI_list_t *pc5_qos_mappings; + OpenAPI_list_t *slrb_configs; +} OpenAPI_configuration_parameters_nr_t; + +OpenAPI_configuration_parameters_nr_t *OpenAPI_configuration_parameters_nr_create( + OpenAPI_list_t *ser_to_bro_layer2_ids, + OpenAPI_list_t *ser_to_gro_layer2_ids, + OpenAPI_list_t *ser_to_def_layer2_ids, + OpenAPI_list_t *ser_id_to_frequs, + OpenAPI_list_t *pc5_qos_mappings, + OpenAPI_list_t *slrb_configs + ); +void OpenAPI_configuration_parameters_nr_free(OpenAPI_configuration_parameters_nr_t *configuration_parameters_nr); +OpenAPI_configuration_parameters_nr_t *OpenAPI_configuration_parameters_nr_parseFromJSON(cJSON *configuration_parameters_nrJSON); +cJSON *OpenAPI_configuration_parameters_nr_convertToJSON(OpenAPI_configuration_parameters_nr_t *configuration_parameters_nr); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_configuration_parameters_nr_H_ */ + diff --git a/lib/sbi/openapi/model/confirmation_data.c b/lib/sbi/openapi/model/confirmation_data.c new file mode 100644 index 0000000000..2a63a95f07 --- /dev/null +++ b/lib/sbi/openapi/model/confirmation_data.c @@ -0,0 +1,76 @@ + +#include +#include +#include +#include "confirmation_data.h" + +OpenAPI_confirmation_data_t *OpenAPI_confirmation_data_create( + char *res_star + ) +{ + OpenAPI_confirmation_data_t *confirmation_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_confirmation_data_t)); + if (!confirmation_data_local_var) { + return NULL; + } + confirmation_data_local_var->res_star = res_star; + + return confirmation_data_local_var; +} + +void OpenAPI_confirmation_data_free(OpenAPI_confirmation_data_t *confirmation_data) +{ + if (NULL == confirmation_data) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(confirmation_data->res_star); + ogs_free(confirmation_data); +} + +cJSON *OpenAPI_confirmation_data_convertToJSON(OpenAPI_confirmation_data_t *confirmation_data) +{ + cJSON *item = NULL; + + if (confirmation_data == NULL) { + ogs_error("OpenAPI_confirmation_data_convertToJSON() failed [ConfirmationData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!confirmation_data->res_star) { + ogs_error("OpenAPI_confirmation_data_convertToJSON() failed [res_star]"); + goto end; + } + if (cJSON_AddStringToObject(item, "resStar", confirmation_data->res_star) == NULL) { + ogs_error("OpenAPI_confirmation_data_convertToJSON() failed [res_star]"); + goto end; + } + +end: + return item; +} + +OpenAPI_confirmation_data_t *OpenAPI_confirmation_data_parseFromJSON(cJSON *confirmation_dataJSON) +{ + OpenAPI_confirmation_data_t *confirmation_data_local_var = NULL; + cJSON *res_star = cJSON_GetObjectItemCaseSensitive(confirmation_dataJSON, "resStar"); + if (!res_star) { + ogs_error("OpenAPI_confirmation_data_parseFromJSON() failed [res_star]"); + goto end; + } + + + if (!cJSON_IsString(res_star)) { + ogs_error("OpenAPI_confirmation_data_parseFromJSON() failed [res_star]"); + goto end; + } + + confirmation_data_local_var = OpenAPI_confirmation_data_create ( + ogs_strdup(res_star->valuestring) + ); + + return confirmation_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/confirmation_data.h b/lib/sbi/openapi/model/confirmation_data.h new file mode 100644 index 0000000000..7ccfab53f0 --- /dev/null +++ b/lib/sbi/openapi/model/confirmation_data.h @@ -0,0 +1,37 @@ +/* + * confirmation_data.h + * + * + */ + +#ifndef _OpenAPI_confirmation_data_H_ +#define _OpenAPI_confirmation_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_confirmation_data_s OpenAPI_confirmation_data_t; +typedef struct OpenAPI_confirmation_data_s { + char *res_star; +} OpenAPI_confirmation_data_t; + +OpenAPI_confirmation_data_t *OpenAPI_confirmation_data_create( + char *res_star + ); +void OpenAPI_confirmation_data_free(OpenAPI_confirmation_data_t *confirmation_data); +OpenAPI_confirmation_data_t *OpenAPI_confirmation_data_parseFromJSON(cJSON *confirmation_dataJSON); +cJSON *OpenAPI_confirmation_data_convertToJSON(OpenAPI_confirmation_data_t *confirmation_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_confirmation_data_H_ */ + diff --git a/lib/sbi/openapi/model/confirmation_data_response.c b/lib/sbi/openapi/model/confirmation_data_response.c new file mode 100644 index 0000000000..c157a84af3 --- /dev/null +++ b/lib/sbi/openapi/model/confirmation_data_response.c @@ -0,0 +1,117 @@ + +#include +#include +#include +#include "confirmation_data_response.h" + +OpenAPI_confirmation_data_response_t *OpenAPI_confirmation_data_response_create( + OpenAPI_auth_result_e auth_result, + char *supi, + char *kseaf + ) +{ + OpenAPI_confirmation_data_response_t *confirmation_data_response_local_var = OpenAPI_malloc(sizeof(OpenAPI_confirmation_data_response_t)); + if (!confirmation_data_response_local_var) { + return NULL; + } + confirmation_data_response_local_var->auth_result = auth_result; + confirmation_data_response_local_var->supi = supi; + confirmation_data_response_local_var->kseaf = kseaf; + + return confirmation_data_response_local_var; +} + +void OpenAPI_confirmation_data_response_free(OpenAPI_confirmation_data_response_t *confirmation_data_response) +{ + if (NULL == confirmation_data_response) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(confirmation_data_response->supi); + ogs_free(confirmation_data_response->kseaf); + ogs_free(confirmation_data_response); +} + +cJSON *OpenAPI_confirmation_data_response_convertToJSON(OpenAPI_confirmation_data_response_t *confirmation_data_response) +{ + cJSON *item = NULL; + + if (confirmation_data_response == NULL) { + ogs_error("OpenAPI_confirmation_data_response_convertToJSON() failed [ConfirmationDataResponse]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!confirmation_data_response->auth_result) { + ogs_error("OpenAPI_confirmation_data_response_convertToJSON() failed [auth_result]"); + goto end; + } + if (cJSON_AddStringToObject(item, "authResult", OpenAPI_auth_result_ToString(confirmation_data_response->auth_result)) == NULL) { + ogs_error("OpenAPI_confirmation_data_response_convertToJSON() failed [auth_result]"); + goto end; + } + + if (confirmation_data_response->supi) { + if (cJSON_AddStringToObject(item, "supi", confirmation_data_response->supi) == NULL) { + ogs_error("OpenAPI_confirmation_data_response_convertToJSON() failed [supi]"); + goto end; + } + } + + if (confirmation_data_response->kseaf) { + if (cJSON_AddStringToObject(item, "kseaf", confirmation_data_response->kseaf) == NULL) { + ogs_error("OpenAPI_confirmation_data_response_convertToJSON() failed [kseaf]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_confirmation_data_response_t *OpenAPI_confirmation_data_response_parseFromJSON(cJSON *confirmation_data_responseJSON) +{ + OpenAPI_confirmation_data_response_t *confirmation_data_response_local_var = NULL; + cJSON *auth_result = cJSON_GetObjectItemCaseSensitive(confirmation_data_responseJSON, "authResult"); + if (!auth_result) { + ogs_error("OpenAPI_confirmation_data_response_parseFromJSON() failed [auth_result]"); + goto end; + } + + OpenAPI_auth_result_e auth_resultVariable; + + if (!cJSON_IsString(auth_result)) { + ogs_error("OpenAPI_confirmation_data_response_parseFromJSON() failed [auth_result]"); + goto end; + } + auth_resultVariable = OpenAPI_auth_result_FromString(auth_result->valuestring); + + cJSON *supi = cJSON_GetObjectItemCaseSensitive(confirmation_data_responseJSON, "supi"); + + if (supi) { + if (!cJSON_IsString(supi)) { + ogs_error("OpenAPI_confirmation_data_response_parseFromJSON() failed [supi]"); + goto end; + } + } + + cJSON *kseaf = cJSON_GetObjectItemCaseSensitive(confirmation_data_responseJSON, "kseaf"); + + if (kseaf) { + if (!cJSON_IsString(kseaf)) { + ogs_error("OpenAPI_confirmation_data_response_parseFromJSON() failed [kseaf]"); + goto end; + } + } + + confirmation_data_response_local_var = OpenAPI_confirmation_data_response_create ( + auth_resultVariable, + supi ? ogs_strdup(supi->valuestring) : NULL, + kseaf ? ogs_strdup(kseaf->valuestring) : NULL + ); + + return confirmation_data_response_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/confirmation_data_response.h b/lib/sbi/openapi/model/confirmation_data_response.h new file mode 100644 index 0000000000..341ac77b34 --- /dev/null +++ b/lib/sbi/openapi/model/confirmation_data_response.h @@ -0,0 +1,42 @@ +/* + * confirmation_data_response.h + * + * + */ + +#ifndef _OpenAPI_confirmation_data_response_H_ +#define _OpenAPI_confirmation_data_response_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "auth_result.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_confirmation_data_response_s OpenAPI_confirmation_data_response_t; +typedef struct OpenAPI_confirmation_data_response_s { + OpenAPI_auth_result_e auth_result; + char *supi; + char *kseaf; +} OpenAPI_confirmation_data_response_t; + +OpenAPI_confirmation_data_response_t *OpenAPI_confirmation_data_response_create( + OpenAPI_auth_result_e auth_result, + char *supi, + char *kseaf + ); +void OpenAPI_confirmation_data_response_free(OpenAPI_confirmation_data_response_t *confirmation_data_response); +OpenAPI_confirmation_data_response_t *OpenAPI_confirmation_data_response_parseFromJSON(cJSON *confirmation_data_responseJSON); +cJSON *OpenAPI_confirmation_data_response_convertToJSON(OpenAPI_confirmation_data_response_t *confirmation_data_response); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_confirmation_data_response_H_ */ + diff --git a/lib/sbi/openapi/model/context_data_set_name.c b/lib/sbi/openapi/model/context_data_set_name.c new file mode 100644 index 0000000000..5d7de9f156 --- /dev/null +++ b/lib/sbi/openapi/model/context_data_set_name.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "context_data_set_name.h" + +OpenAPI_context_data_set_name_t *OpenAPI_context_data_set_name_create( + ) +{ + 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; +} + +void OpenAPI_context_data_set_name_free(OpenAPI_context_data_set_name_t *context_data_set_name) +{ + if (NULL == context_data_set_name) { + return; + } + 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; +} + diff --git a/lib/sbi/openapi/model/context_data_set_name.h b/lib/sbi/openapi/model/context_data_set_name.h new file mode 100644 index 0000000000..fabfcfc0a1 --- /dev/null +++ b/lib/sbi/openapi/model/context_data_set_name.h @@ -0,0 +1,35 @@ +/* + * context_data_set_name.h + * + * + */ + +#ifndef _OpenAPI_context_data_set_name_H_ +#define _OpenAPI_context_data_set_name_H_ + +#include +#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_data_set_name_s OpenAPI_context_data_set_name_t; +typedef struct OpenAPI_context_data_set_name_s { +} OpenAPI_context_data_set_name_t; + +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); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_context_data_set_name_H_ */ + diff --git a/lib/sbi/openapi/model/context_data_sets.c b/lib/sbi/openapi/model/context_data_sets.c new file mode 100644 index 0000000000..6f073dbec6 --- /dev/null +++ b/lib/sbi/openapi/model/context_data_sets.c @@ -0,0 +1,347 @@ + +#include +#include +#include +#include "context_data_sets.h" + +OpenAPI_context_data_sets_t *OpenAPI_context_data_sets_create( + OpenAPI_amf3_gpp_access_registration_t *amf3_gpp, + OpenAPI_amf_non3_gpp_access_registration_t *amf_non3_gpp, + OpenAPI_list_t *sdm_subscriptions, + OpenAPI_list_t *ee_subscriptions, + 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_context_data_sets_t *context_data_sets_local_var = OpenAPI_malloc(sizeof(OpenAPI_context_data_sets_t)); + if (!context_data_sets_local_var) { + return NULL; + } + context_data_sets_local_var->amf3_gpp = amf3_gpp; + context_data_sets_local_var->amf_non3_gpp = amf_non3_gpp; + context_data_sets_local_var->sdm_subscriptions = sdm_subscriptions; + context_data_sets_local_var->ee_subscriptions = ee_subscriptions; + context_data_sets_local_var->smsf3_gpp_access = smsf3_gpp_access; + 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; + + return context_data_sets_local_var; +} + +void OpenAPI_context_data_sets_free(OpenAPI_context_data_sets_t *context_data_sets) +{ + if (NULL == context_data_sets) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_amf3_gpp_access_registration_free(context_data_sets->amf3_gpp); + OpenAPI_amf_non3_gpp_access_registration_free(context_data_sets->amf_non3_gpp); + OpenAPI_list_for_each(context_data_sets->sdm_subscriptions, node) { + OpenAPI_sdm_subscription_free(node->data); + } + OpenAPI_list_free(context_data_sets->sdm_subscriptions); + OpenAPI_list_for_each(context_data_sets->ee_subscriptions, node) { + OpenAPI_ee_subscription_free(node->data); + } + OpenAPI_list_free(context_data_sets->ee_subscriptions); + OpenAPI_smsf_registration_free(context_data_sets->smsf3_gpp_access); + OpenAPI_smsf_registration_free(context_data_sets->smsf_non3_gpp_access); + OpenAPI_list_for_each(context_data_sets->subscription_data_subscriptions, node) { + OpenAPI_subscription_data_subscriptions_free(node->data); + } + OpenAPI_list_free(context_data_sets->subscription_data_subscriptions); + OpenAPI_list_for_each(context_data_sets->smf_registrations, node) { + OpenAPI_smf_registration_free(node->data); + } + OpenAPI_list_free(context_data_sets->smf_registrations); + ogs_free(context_data_sets); +} + +cJSON *OpenAPI_context_data_sets_convertToJSON(OpenAPI_context_data_sets_t *context_data_sets) +{ + cJSON *item = NULL; + + if (context_data_sets == NULL) { + ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [ContextDataSets]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (context_data_sets->amf3_gpp) { + cJSON *amf3_gpp_local_JSON = OpenAPI_amf3_gpp_access_registration_convertToJSON(context_data_sets->amf3_gpp); + if (amf3_gpp_local_JSON == NULL) { + ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [amf3_gpp]"); + goto end; + } + cJSON_AddItemToObject(item, "amf3Gpp", amf3_gpp_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [amf3_gpp]"); + goto end; + } + } + + if (context_data_sets->amf_non3_gpp) { + cJSON *amf_non3_gpp_local_JSON = OpenAPI_amf_non3_gpp_access_registration_convertToJSON(context_data_sets->amf_non3_gpp); + if (amf_non3_gpp_local_JSON == NULL) { + ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [amf_non3_gpp]"); + goto end; + } + cJSON_AddItemToObject(item, "amfNon3Gpp", amf_non3_gpp_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [amf_non3_gpp]"); + goto end; + } + } + + if (context_data_sets->sdm_subscriptions) { + cJSON *sdm_subscriptionsList = cJSON_AddArrayToObject(item, "sdmSubscriptions"); + if (sdm_subscriptionsList == NULL) { + ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [sdm_subscriptions]"); + goto end; + } + + OpenAPI_lnode_t *sdm_subscriptions_node; + if (context_data_sets->sdm_subscriptions) { + OpenAPI_list_for_each(context_data_sets->sdm_subscriptions, sdm_subscriptions_node) { + cJSON *itemLocal = OpenAPI_sdm_subscription_convertToJSON(sdm_subscriptions_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [sdm_subscriptions]"); + goto end; + } + cJSON_AddItemToArray(sdm_subscriptionsList, itemLocal); + } + } + } + + if (context_data_sets->ee_subscriptions) { + cJSON *ee_subscriptionsList = cJSON_AddArrayToObject(item, "eeSubscriptions"); + if (ee_subscriptionsList == NULL) { + ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [ee_subscriptions]"); + goto end; + } + + OpenAPI_lnode_t *ee_subscriptions_node; + if (context_data_sets->ee_subscriptions) { + OpenAPI_list_for_each(context_data_sets->ee_subscriptions, ee_subscriptions_node) { + cJSON *itemLocal = OpenAPI_ee_subscription_convertToJSON(ee_subscriptions_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [ee_subscriptions]"); + goto end; + } + cJSON_AddItemToArray(ee_subscriptionsList, itemLocal); + } + } + } + + if (context_data_sets->smsf3_gpp_access) { + cJSON *smsf3_gpp_access_local_JSON = OpenAPI_smsf_registration_convertToJSON(context_data_sets->smsf3_gpp_access); + if (smsf3_gpp_access_local_JSON == NULL) { + ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [smsf3_gpp_access]"); + goto end; + } + cJSON_AddItemToObject(item, "smsf3GppAccess", smsf3_gpp_access_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [smsf3_gpp_access]"); + goto end; + } + } + + if (context_data_sets->smsf_non3_gpp_access) { + cJSON *smsf_non3_gpp_access_local_JSON = OpenAPI_smsf_registration_convertToJSON(context_data_sets->smsf_non3_gpp_access); + if (smsf_non3_gpp_access_local_JSON == NULL) { + ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [smsf_non3_gpp_access]"); + goto end; + } + cJSON_AddItemToObject(item, "smsfNon3GppAccess", smsf_non3_gpp_access_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [smsf_non3_gpp_access]"); + goto end; + } + } + + if (context_data_sets->subscription_data_subscriptions) { + cJSON *subscription_data_subscriptionsList = cJSON_AddArrayToObject(item, "subscriptionDataSubscriptions"); + if (subscription_data_subscriptionsList == NULL) { + ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [subscription_data_subscriptions]"); + goto end; + } + + OpenAPI_lnode_t *subscription_data_subscriptions_node; + if (context_data_sets->subscription_data_subscriptions) { + OpenAPI_list_for_each(context_data_sets->subscription_data_subscriptions, subscription_data_subscriptions_node) { + cJSON *itemLocal = OpenAPI_subscription_data_subscriptions_convertToJSON(subscription_data_subscriptions_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [subscription_data_subscriptions]"); + goto end; + } + cJSON_AddItemToArray(subscription_data_subscriptionsList, itemLocal); + } + } + } + + if (context_data_sets->smf_registrations) { + cJSON *smf_registrationsList = cJSON_AddArrayToObject(item, "smfRegistrations"); + if (smf_registrationsList == NULL) { + ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [smf_registrations]"); + goto end; + } + + OpenAPI_lnode_t *smf_registrations_node; + if (context_data_sets->smf_registrations) { + OpenAPI_list_for_each(context_data_sets->smf_registrations, smf_registrations_node) { + cJSON *itemLocal = OpenAPI_smf_registration_convertToJSON(smf_registrations_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [smf_registrations]"); + goto end; + } + cJSON_AddItemToArray(smf_registrationsList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_context_data_sets_t *OpenAPI_context_data_sets_parseFromJSON(cJSON *context_data_setsJSON) +{ + OpenAPI_context_data_sets_t *context_data_sets_local_var = NULL; + cJSON *amf3_gpp = cJSON_GetObjectItemCaseSensitive(context_data_setsJSON, "amf3Gpp"); + + OpenAPI_amf3_gpp_access_registration_t *amf3_gpp_local_nonprim = NULL; + if (amf3_gpp) { + amf3_gpp_local_nonprim = OpenAPI_amf3_gpp_access_registration_parseFromJSON(amf3_gpp); + } + + cJSON *amf_non3_gpp = cJSON_GetObjectItemCaseSensitive(context_data_setsJSON, "amfNon3Gpp"); + + OpenAPI_amf_non3_gpp_access_registration_t *amf_non3_gpp_local_nonprim = NULL; + if (amf_non3_gpp) { + amf_non3_gpp_local_nonprim = OpenAPI_amf_non3_gpp_access_registration_parseFromJSON(amf_non3_gpp); + } + + cJSON *sdm_subscriptions = cJSON_GetObjectItemCaseSensitive(context_data_setsJSON, "sdmSubscriptions"); + + OpenAPI_list_t *sdm_subscriptionsList; + if (sdm_subscriptions) { + cJSON *sdm_subscriptions_local_nonprimitive; + if (!cJSON_IsArray(sdm_subscriptions)) { + ogs_error("OpenAPI_context_data_sets_parseFromJSON() failed [sdm_subscriptions]"); + goto end; + } + + sdm_subscriptionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(sdm_subscriptions_local_nonprimitive, sdm_subscriptions ) { + if (!cJSON_IsObject(sdm_subscriptions_local_nonprimitive)) { + ogs_error("OpenAPI_context_data_sets_parseFromJSON() failed [sdm_subscriptions]"); + goto end; + } + OpenAPI_sdm_subscription_t *sdm_subscriptionsItem = OpenAPI_sdm_subscription_parseFromJSON(sdm_subscriptions_local_nonprimitive); + + OpenAPI_list_add(sdm_subscriptionsList, sdm_subscriptionsItem); + } + } + + cJSON *ee_subscriptions = cJSON_GetObjectItemCaseSensitive(context_data_setsJSON, "eeSubscriptions"); + + OpenAPI_list_t *ee_subscriptionsList; + if (ee_subscriptions) { + cJSON *ee_subscriptions_local_nonprimitive; + if (!cJSON_IsArray(ee_subscriptions)) { + ogs_error("OpenAPI_context_data_sets_parseFromJSON() failed [ee_subscriptions]"); + goto end; + } + + ee_subscriptionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ee_subscriptions_local_nonprimitive, ee_subscriptions ) { + if (!cJSON_IsObject(ee_subscriptions_local_nonprimitive)) { + ogs_error("OpenAPI_context_data_sets_parseFromJSON() failed [ee_subscriptions]"); + goto end; + } + OpenAPI_ee_subscription_t *ee_subscriptionsItem = OpenAPI_ee_subscription_parseFromJSON(ee_subscriptions_local_nonprimitive); + + OpenAPI_list_add(ee_subscriptionsList, ee_subscriptionsItem); + } + } + + cJSON *smsf3_gpp_access = cJSON_GetObjectItemCaseSensitive(context_data_setsJSON, "smsf3GppAccess"); + + OpenAPI_smsf_registration_t *smsf3_gpp_access_local_nonprim = NULL; + if (smsf3_gpp_access) { + smsf3_gpp_access_local_nonprim = OpenAPI_smsf_registration_parseFromJSON(smsf3_gpp_access); + } + + cJSON *smsf_non3_gpp_access = cJSON_GetObjectItemCaseSensitive(context_data_setsJSON, "smsfNon3GppAccess"); + + OpenAPI_smsf_registration_t *smsf_non3_gpp_access_local_nonprim = NULL; + if (smsf_non3_gpp_access) { + smsf_non3_gpp_access_local_nonprim = OpenAPI_smsf_registration_parseFromJSON(smsf_non3_gpp_access); + } + + cJSON *subscription_data_subscriptions = cJSON_GetObjectItemCaseSensitive(context_data_setsJSON, "subscriptionDataSubscriptions"); + + OpenAPI_list_t *subscription_data_subscriptionsList; + if (subscription_data_subscriptions) { + cJSON *subscription_data_subscriptions_local_nonprimitive; + if (!cJSON_IsArray(subscription_data_subscriptions)) { + ogs_error("OpenAPI_context_data_sets_parseFromJSON() failed [subscription_data_subscriptions]"); + goto end; + } + + subscription_data_subscriptionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(subscription_data_subscriptions_local_nonprimitive, subscription_data_subscriptions ) { + if (!cJSON_IsObject(subscription_data_subscriptions_local_nonprimitive)) { + ogs_error("OpenAPI_context_data_sets_parseFromJSON() failed [subscription_data_subscriptions]"); + goto end; + } + OpenAPI_subscription_data_subscriptions_t *subscription_data_subscriptionsItem = OpenAPI_subscription_data_subscriptions_parseFromJSON(subscription_data_subscriptions_local_nonprimitive); + + OpenAPI_list_add(subscription_data_subscriptionsList, subscription_data_subscriptionsItem); + } + } + + cJSON *smf_registrations = cJSON_GetObjectItemCaseSensitive(context_data_setsJSON, "smfRegistrations"); + + OpenAPI_list_t *smf_registrationsList; + if (smf_registrations) { + cJSON *smf_registrations_local_nonprimitive; + if (!cJSON_IsArray(smf_registrations)) { + ogs_error("OpenAPI_context_data_sets_parseFromJSON() failed [smf_registrations]"); + goto end; + } + + smf_registrationsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(smf_registrations_local_nonprimitive, smf_registrations ) { + if (!cJSON_IsObject(smf_registrations_local_nonprimitive)) { + ogs_error("OpenAPI_context_data_sets_parseFromJSON() failed [smf_registrations]"); + goto end; + } + OpenAPI_smf_registration_t *smf_registrationsItem = OpenAPI_smf_registration_parseFromJSON(smf_registrations_local_nonprimitive); + + OpenAPI_list_add(smf_registrationsList, smf_registrationsItem); + } + } + + 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, + sdm_subscriptions ? sdm_subscriptionsList : NULL, + ee_subscriptions ? ee_subscriptionsList : NULL, + 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 + ); + + return context_data_sets_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/context_data_sets.h b/lib/sbi/openapi/model/context_data_sets.h new file mode 100644 index 0000000000..a4805d85a8 --- /dev/null +++ b/lib/sbi/openapi/model/context_data_sets.h @@ -0,0 +1,58 @@ +/* + * context_data_sets.h + * + * + */ + +#ifndef _OpenAPI_context_data_sets_H_ +#define _OpenAPI_context_data_sets_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "amf3_gpp_access_registration.h" +#include "amf_non3_gpp_access_registration.h" +#include "ee_subscription.h" +#include "sdm_subscription.h" +#include "smf_registration.h" +#include "smsf_registration.h" +#include "subscription_data_subscriptions.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_context_data_sets_s OpenAPI_context_data_sets_t; +typedef struct OpenAPI_context_data_sets_s { + struct OpenAPI_amf3_gpp_access_registration_s *amf3_gpp; + struct OpenAPI_amf_non3_gpp_access_registration_s *amf_non3_gpp; + OpenAPI_list_t *sdm_subscriptions; + OpenAPI_list_t *ee_subscriptions; + struct OpenAPI_smsf_registration_s *smsf3_gpp_access; + struct OpenAPI_smsf_registration_s *smsf_non3_gpp_access; + OpenAPI_list_t *subscription_data_subscriptions; + OpenAPI_list_t *smf_registrations; +} OpenAPI_context_data_sets_t; + +OpenAPI_context_data_sets_t *OpenAPI_context_data_sets_create( + OpenAPI_amf3_gpp_access_registration_t *amf3_gpp, + OpenAPI_amf_non3_gpp_access_registration_t *amf_non3_gpp, + OpenAPI_list_t *sdm_subscriptions, + OpenAPI_list_t *ee_subscriptions, + 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 + ); +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); +cJSON *OpenAPI_context_data_sets_convertToJSON(OpenAPI_context_data_sets_t *context_data_sets); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_context_data_sets_H_ */ + diff --git a/lib/sbi/openapi/model/core_network_type.c b/lib/sbi/openapi/model/core_network_type.c new file mode 100644 index 0000000000..8eb78d46a7 --- /dev/null +++ b/lib/sbi/openapi/model/core_network_type.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "core_network_type.h" + +OpenAPI_core_network_type_t *OpenAPI_core_network_type_create( + ) +{ + OpenAPI_core_network_type_t *core_network_type_local_var = OpenAPI_malloc(sizeof(OpenAPI_core_network_type_t)); + if (!core_network_type_local_var) { + return NULL; + } + + return core_network_type_local_var; +} + +void OpenAPI_core_network_type_free(OpenAPI_core_network_type_t *core_network_type) +{ + if (NULL == core_network_type) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(core_network_type); +} + +cJSON *OpenAPI_core_network_type_convertToJSON(OpenAPI_core_network_type_t *core_network_type) +{ + cJSON *item = NULL; + + if (core_network_type == NULL) { + ogs_error("OpenAPI_core_network_type_convertToJSON() failed [CoreNetworkType]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_core_network_type_t *OpenAPI_core_network_type_parseFromJSON(cJSON *core_network_typeJSON) +{ + OpenAPI_core_network_type_t *core_network_type_local_var = NULL; + core_network_type_local_var = OpenAPI_core_network_type_create ( + ); + + return core_network_type_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/core_network_type.h b/lib/sbi/openapi/model/core_network_type.h new file mode 100644 index 0000000000..22d27d780b --- /dev/null +++ b/lib/sbi/openapi/model/core_network_type.h @@ -0,0 +1,35 @@ +/* + * core_network_type.h + * + * + */ + +#ifndef _OpenAPI_core_network_type_H_ +#define _OpenAPI_core_network_type_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_core_network_type_s OpenAPI_core_network_type_t; +typedef struct OpenAPI_core_network_type_s { +} OpenAPI_core_network_type_t; + +OpenAPI_core_network_type_t *OpenAPI_core_network_type_create( + ); +void OpenAPI_core_network_type_free(OpenAPI_core_network_type_t *core_network_type); +OpenAPI_core_network_type_t *OpenAPI_core_network_type_parseFromJSON(cJSON *core_network_typeJSON); +cJSON *OpenAPI_core_network_type_convertToJSON(OpenAPI_core_network_type_t *core_network_type); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_core_network_type_H_ */ + diff --git a/lib/sbi/openapi/model/data_change_notify.c b/lib/sbi/openapi/model/data_change_notify.c new file mode 100644 index 0000000000..8dc9ab80d6 --- /dev/null +++ b/lib/sbi/openapi/model/data_change_notify.c @@ -0,0 +1,288 @@ + +#include +#include +#include +#include "data_change_notify.h" + +OpenAPI_data_change_notify_t *OpenAPI_data_change_notify_create( + OpenAPI_list_t *original_callback_reference, + char *ue_id, + OpenAPI_list_t *notify_items, + OpenAPI_sdm_subscription_t *sdm_subscription, + OpenAPI_list_t *additional_sdm_subscriptions, + OpenAPI_list_t *subscription_data_subscriptions + ) +{ + OpenAPI_data_change_notify_t *data_change_notify_local_var = OpenAPI_malloc(sizeof(OpenAPI_data_change_notify_t)); + if (!data_change_notify_local_var) { + return NULL; + } + data_change_notify_local_var->original_callback_reference = original_callback_reference; + data_change_notify_local_var->ue_id = ue_id; + data_change_notify_local_var->notify_items = notify_items; + data_change_notify_local_var->sdm_subscription = sdm_subscription; + data_change_notify_local_var->additional_sdm_subscriptions = additional_sdm_subscriptions; + data_change_notify_local_var->subscription_data_subscriptions = subscription_data_subscriptions; + + return data_change_notify_local_var; +} + +void OpenAPI_data_change_notify_free(OpenAPI_data_change_notify_t *data_change_notify) +{ + if (NULL == data_change_notify) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(data_change_notify->original_callback_reference, node) { + ogs_free(node->data); + } + OpenAPI_list_free(data_change_notify->original_callback_reference); + ogs_free(data_change_notify->ue_id); + OpenAPI_list_for_each(data_change_notify->notify_items, node) { + OpenAPI_notify_item_free(node->data); + } + OpenAPI_list_free(data_change_notify->notify_items); + OpenAPI_sdm_subscription_free(data_change_notify->sdm_subscription); + OpenAPI_list_for_each(data_change_notify->additional_sdm_subscriptions, node) { + OpenAPI_sdm_subscription_free(node->data); + } + OpenAPI_list_free(data_change_notify->additional_sdm_subscriptions); + OpenAPI_list_for_each(data_change_notify->subscription_data_subscriptions, node) { + OpenAPI_subscription_data_subscriptions_free(node->data); + } + OpenAPI_list_free(data_change_notify->subscription_data_subscriptions); + ogs_free(data_change_notify); +} + +cJSON *OpenAPI_data_change_notify_convertToJSON(OpenAPI_data_change_notify_t *data_change_notify) +{ + cJSON *item = NULL; + + if (data_change_notify == NULL) { + ogs_error("OpenAPI_data_change_notify_convertToJSON() failed [DataChangeNotify]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (data_change_notify->original_callback_reference) { + cJSON *original_callback_reference = cJSON_AddArrayToObject(item, "originalCallbackReference"); + if (original_callback_reference == NULL) { + ogs_error("OpenAPI_data_change_notify_convertToJSON() failed [original_callback_reference]"); + goto end; + } + + OpenAPI_lnode_t *original_callback_reference_node; + OpenAPI_list_for_each(data_change_notify->original_callback_reference, original_callback_reference_node) { + if (cJSON_AddStringToObject(original_callback_reference, "", (char*)original_callback_reference_node->data) == NULL) { + ogs_error("OpenAPI_data_change_notify_convertToJSON() failed [original_callback_reference]"); + goto end; + } + } + } + + if (data_change_notify->ue_id) { + if (cJSON_AddStringToObject(item, "ueId", data_change_notify->ue_id) == NULL) { + ogs_error("OpenAPI_data_change_notify_convertToJSON() failed [ue_id]"); + goto end; + } + } + + if (data_change_notify->notify_items) { + cJSON *notify_itemsList = cJSON_AddArrayToObject(item, "notifyItems"); + if (notify_itemsList == NULL) { + ogs_error("OpenAPI_data_change_notify_convertToJSON() failed [notify_items]"); + goto end; + } + + OpenAPI_lnode_t *notify_items_node; + if (data_change_notify->notify_items) { + OpenAPI_list_for_each(data_change_notify->notify_items, notify_items_node) { + cJSON *itemLocal = OpenAPI_notify_item_convertToJSON(notify_items_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_data_change_notify_convertToJSON() failed [notify_items]"); + goto end; + } + cJSON_AddItemToArray(notify_itemsList, itemLocal); + } + } + } + + if (data_change_notify->sdm_subscription) { + cJSON *sdm_subscription_local_JSON = OpenAPI_sdm_subscription_convertToJSON(data_change_notify->sdm_subscription); + if (sdm_subscription_local_JSON == NULL) { + ogs_error("OpenAPI_data_change_notify_convertToJSON() failed [sdm_subscription]"); + goto end; + } + cJSON_AddItemToObject(item, "sdmSubscription", sdm_subscription_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_data_change_notify_convertToJSON() failed [sdm_subscription]"); + goto end; + } + } + + if (data_change_notify->additional_sdm_subscriptions) { + cJSON *additional_sdm_subscriptionsList = cJSON_AddArrayToObject(item, "additionalSdmSubscriptions"); + if (additional_sdm_subscriptionsList == NULL) { + ogs_error("OpenAPI_data_change_notify_convertToJSON() failed [additional_sdm_subscriptions]"); + goto end; + } + + OpenAPI_lnode_t *additional_sdm_subscriptions_node; + if (data_change_notify->additional_sdm_subscriptions) { + OpenAPI_list_for_each(data_change_notify->additional_sdm_subscriptions, additional_sdm_subscriptions_node) { + cJSON *itemLocal = OpenAPI_sdm_subscription_convertToJSON(additional_sdm_subscriptions_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_data_change_notify_convertToJSON() failed [additional_sdm_subscriptions]"); + goto end; + } + cJSON_AddItemToArray(additional_sdm_subscriptionsList, itemLocal); + } + } + } + + if (data_change_notify->subscription_data_subscriptions) { + cJSON *subscription_data_subscriptionsList = cJSON_AddArrayToObject(item, "subscriptionDataSubscriptions"); + if (subscription_data_subscriptionsList == NULL) { + ogs_error("OpenAPI_data_change_notify_convertToJSON() failed [subscription_data_subscriptions]"); + goto end; + } + + OpenAPI_lnode_t *subscription_data_subscriptions_node; + if (data_change_notify->subscription_data_subscriptions) { + OpenAPI_list_for_each(data_change_notify->subscription_data_subscriptions, subscription_data_subscriptions_node) { + cJSON *itemLocal = OpenAPI_subscription_data_subscriptions_convertToJSON(subscription_data_subscriptions_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_data_change_notify_convertToJSON() failed [subscription_data_subscriptions]"); + goto end; + } + cJSON_AddItemToArray(subscription_data_subscriptionsList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_data_change_notify_t *OpenAPI_data_change_notify_parseFromJSON(cJSON *data_change_notifyJSON) +{ + OpenAPI_data_change_notify_t *data_change_notify_local_var = NULL; + cJSON *original_callback_reference = cJSON_GetObjectItemCaseSensitive(data_change_notifyJSON, "originalCallbackReference"); + + OpenAPI_list_t *original_callback_referenceList; + if (original_callback_reference) { + cJSON *original_callback_reference_local; + if (!cJSON_IsArray(original_callback_reference)) { + ogs_error("OpenAPI_data_change_notify_parseFromJSON() failed [original_callback_reference]"); + goto end; + } + original_callback_referenceList = OpenAPI_list_create(); + + cJSON_ArrayForEach(original_callback_reference_local, original_callback_reference) { + if (!cJSON_IsString(original_callback_reference_local)) { + ogs_error("OpenAPI_data_change_notify_parseFromJSON() failed [original_callback_reference]"); + goto end; + } + OpenAPI_list_add(original_callback_referenceList, ogs_strdup(original_callback_reference_local->valuestring)); + } + } + + cJSON *ue_id = cJSON_GetObjectItemCaseSensitive(data_change_notifyJSON, "ueId"); + + if (ue_id) { + if (!cJSON_IsString(ue_id)) { + ogs_error("OpenAPI_data_change_notify_parseFromJSON() failed [ue_id]"); + goto end; + } + } + + cJSON *notify_items = cJSON_GetObjectItemCaseSensitive(data_change_notifyJSON, "notifyItems"); + + OpenAPI_list_t *notify_itemsList; + if (notify_items) { + cJSON *notify_items_local_nonprimitive; + if (!cJSON_IsArray(notify_items)) { + ogs_error("OpenAPI_data_change_notify_parseFromJSON() failed [notify_items]"); + goto end; + } + + notify_itemsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(notify_items_local_nonprimitive, notify_items ) { + if (!cJSON_IsObject(notify_items_local_nonprimitive)) { + ogs_error("OpenAPI_data_change_notify_parseFromJSON() failed [notify_items]"); + goto end; + } + OpenAPI_notify_item_t *notify_itemsItem = OpenAPI_notify_item_parseFromJSON(notify_items_local_nonprimitive); + + OpenAPI_list_add(notify_itemsList, notify_itemsItem); + } + } + + cJSON *sdm_subscription = cJSON_GetObjectItemCaseSensitive(data_change_notifyJSON, "sdmSubscription"); + + OpenAPI_sdm_subscription_t *sdm_subscription_local_nonprim = NULL; + if (sdm_subscription) { + sdm_subscription_local_nonprim = OpenAPI_sdm_subscription_parseFromJSON(sdm_subscription); + } + + cJSON *additional_sdm_subscriptions = cJSON_GetObjectItemCaseSensitive(data_change_notifyJSON, "additionalSdmSubscriptions"); + + OpenAPI_list_t *additional_sdm_subscriptionsList; + if (additional_sdm_subscriptions) { + cJSON *additional_sdm_subscriptions_local_nonprimitive; + if (!cJSON_IsArray(additional_sdm_subscriptions)) { + ogs_error("OpenAPI_data_change_notify_parseFromJSON() failed [additional_sdm_subscriptions]"); + goto end; + } + + additional_sdm_subscriptionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(additional_sdm_subscriptions_local_nonprimitive, additional_sdm_subscriptions ) { + if (!cJSON_IsObject(additional_sdm_subscriptions_local_nonprimitive)) { + ogs_error("OpenAPI_data_change_notify_parseFromJSON() failed [additional_sdm_subscriptions]"); + goto end; + } + OpenAPI_sdm_subscription_t *additional_sdm_subscriptionsItem = OpenAPI_sdm_subscription_parseFromJSON(additional_sdm_subscriptions_local_nonprimitive); + + OpenAPI_list_add(additional_sdm_subscriptionsList, additional_sdm_subscriptionsItem); + } + } + + cJSON *subscription_data_subscriptions = cJSON_GetObjectItemCaseSensitive(data_change_notifyJSON, "subscriptionDataSubscriptions"); + + OpenAPI_list_t *subscription_data_subscriptionsList; + if (subscription_data_subscriptions) { + cJSON *subscription_data_subscriptions_local_nonprimitive; + if (!cJSON_IsArray(subscription_data_subscriptions)) { + ogs_error("OpenAPI_data_change_notify_parseFromJSON() failed [subscription_data_subscriptions]"); + goto end; + } + + subscription_data_subscriptionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(subscription_data_subscriptions_local_nonprimitive, subscription_data_subscriptions ) { + if (!cJSON_IsObject(subscription_data_subscriptions_local_nonprimitive)) { + ogs_error("OpenAPI_data_change_notify_parseFromJSON() failed [subscription_data_subscriptions]"); + goto end; + } + OpenAPI_subscription_data_subscriptions_t *subscription_data_subscriptionsItem = OpenAPI_subscription_data_subscriptions_parseFromJSON(subscription_data_subscriptions_local_nonprimitive); + + OpenAPI_list_add(subscription_data_subscriptionsList, subscription_data_subscriptionsItem); + } + } + + data_change_notify_local_var = OpenAPI_data_change_notify_create ( + original_callback_reference ? original_callback_referenceList : NULL, + ue_id ? ogs_strdup(ue_id->valuestring) : NULL, + notify_items ? notify_itemsList : NULL, + sdm_subscription ? sdm_subscription_local_nonprim : NULL, + additional_sdm_subscriptions ? additional_sdm_subscriptionsList : NULL, + subscription_data_subscriptions ? subscription_data_subscriptionsList : NULL + ); + + return data_change_notify_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/data_change_notify.h b/lib/sbi/openapi/model/data_change_notify.h new file mode 100644 index 0000000000..95b5b12c45 --- /dev/null +++ b/lib/sbi/openapi/model/data_change_notify.h @@ -0,0 +1,50 @@ +/* + * data_change_notify.h + * + * + */ + +#ifndef _OpenAPI_data_change_notify_H_ +#define _OpenAPI_data_change_notify_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "notify_item.h" +#include "sdm_subscription.h" +#include "subscription_data_subscriptions.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_data_change_notify_s OpenAPI_data_change_notify_t; +typedef struct OpenAPI_data_change_notify_s { + OpenAPI_list_t *original_callback_reference; + char *ue_id; + OpenAPI_list_t *notify_items; + struct OpenAPI_sdm_subscription_s *sdm_subscription; + OpenAPI_list_t *additional_sdm_subscriptions; + OpenAPI_list_t *subscription_data_subscriptions; +} OpenAPI_data_change_notify_t; + +OpenAPI_data_change_notify_t *OpenAPI_data_change_notify_create( + OpenAPI_list_t *original_callback_reference, + char *ue_id, + OpenAPI_list_t *notify_items, + OpenAPI_sdm_subscription_t *sdm_subscription, + OpenAPI_list_t *additional_sdm_subscriptions, + OpenAPI_list_t *subscription_data_subscriptions + ); +void OpenAPI_data_change_notify_free(OpenAPI_data_change_notify_t *data_change_notify); +OpenAPI_data_change_notify_t *OpenAPI_data_change_notify_parseFromJSON(cJSON *data_change_notifyJSON); +cJSON *OpenAPI_data_change_notify_convertToJSON(OpenAPI_data_change_notify_t *data_change_notify); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_data_change_notify_H_ */ + diff --git a/lib/sbi/openapi/model/data_filter.c b/lib/sbi/openapi/model/data_filter.c new file mode 100644 index 0000000000..9de34d0ab2 --- /dev/null +++ b/lib/sbi/openapi/model/data_filter.c @@ -0,0 +1,431 @@ + +#include +#include +#include +#include "data_filter.h" + +OpenAPI_data_filter_t *OpenAPI_data_filter_create( + OpenAPI_data_ind_t *data_ind, + OpenAPI_list_t *dnns, + OpenAPI_list_t *snssais, + OpenAPI_list_t *internal_group_ids, + OpenAPI_list_t *supis, + OpenAPI_list_t *app_ids, + OpenAPI_list_t *ue_ipv4s, + OpenAPI_list_t *ue_ipv6s, + OpenAPI_list_t *ue_macs + ) +{ + OpenAPI_data_filter_t *data_filter_local_var = OpenAPI_malloc(sizeof(OpenAPI_data_filter_t)); + if (!data_filter_local_var) { + return NULL; + } + data_filter_local_var->data_ind = data_ind; + data_filter_local_var->dnns = dnns; + data_filter_local_var->snssais = snssais; + data_filter_local_var->internal_group_ids = internal_group_ids; + data_filter_local_var->supis = supis; + data_filter_local_var->app_ids = app_ids; + data_filter_local_var->ue_ipv4s = ue_ipv4s; + data_filter_local_var->ue_ipv6s = ue_ipv6s; + data_filter_local_var->ue_macs = ue_macs; + + return data_filter_local_var; +} + +void OpenAPI_data_filter_free(OpenAPI_data_filter_t *data_filter) +{ + if (NULL == data_filter) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_data_ind_free(data_filter->data_ind); + OpenAPI_list_for_each(data_filter->dnns, node) { + ogs_free(node->data); + } + OpenAPI_list_free(data_filter->dnns); + OpenAPI_list_for_each(data_filter->snssais, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(data_filter->snssais); + OpenAPI_list_for_each(data_filter->internal_group_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(data_filter->internal_group_ids); + OpenAPI_list_for_each(data_filter->supis, node) { + ogs_free(node->data); + } + OpenAPI_list_free(data_filter->supis); + OpenAPI_list_for_each(data_filter->app_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(data_filter->app_ids); + OpenAPI_list_for_each(data_filter->ue_ipv4s, node) { + ogs_free(node->data); + } + OpenAPI_list_free(data_filter->ue_ipv4s); + OpenAPI_list_for_each(data_filter->ue_ipv6s, node) { + ogs_free(node->data); + } + OpenAPI_list_free(data_filter->ue_ipv6s); + OpenAPI_list_for_each(data_filter->ue_macs, node) { + ogs_free(node->data); + } + OpenAPI_list_free(data_filter->ue_macs); + ogs_free(data_filter); +} + +cJSON *OpenAPI_data_filter_convertToJSON(OpenAPI_data_filter_t *data_filter) +{ + cJSON *item = NULL; + + if (data_filter == NULL) { + ogs_error("OpenAPI_data_filter_convertToJSON() failed [DataFilter]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!data_filter->data_ind) { + ogs_error("OpenAPI_data_filter_convertToJSON() failed [data_ind]"); + goto end; + } + cJSON *data_ind_local_JSON = OpenAPI_data_ind_convertToJSON(data_filter->data_ind); + if (data_ind_local_JSON == NULL) { + ogs_error("OpenAPI_data_filter_convertToJSON() failed [data_ind]"); + goto end; + } + cJSON_AddItemToObject(item, "dataInd", data_ind_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_data_filter_convertToJSON() failed [data_ind]"); + goto end; + } + + if (data_filter->dnns) { + cJSON *dnns = cJSON_AddArrayToObject(item, "dnns"); + if (dnns == NULL) { + ogs_error("OpenAPI_data_filter_convertToJSON() failed [dnns]"); + goto end; + } + + OpenAPI_lnode_t *dnns_node; + OpenAPI_list_for_each(data_filter->dnns, dnns_node) { + if (cJSON_AddStringToObject(dnns, "", (char*)dnns_node->data) == NULL) { + ogs_error("OpenAPI_data_filter_convertToJSON() failed [dnns]"); + goto end; + } + } + } + + if (data_filter->snssais) { + cJSON *snssaisList = cJSON_AddArrayToObject(item, "snssais"); + if (snssaisList == NULL) { + ogs_error("OpenAPI_data_filter_convertToJSON() failed [snssais]"); + goto end; + } + + OpenAPI_lnode_t *snssais_node; + if (data_filter->snssais) { + OpenAPI_list_for_each(data_filter->snssais, snssais_node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(snssais_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_data_filter_convertToJSON() failed [snssais]"); + goto end; + } + cJSON_AddItemToArray(snssaisList, itemLocal); + } + } + } + + if (data_filter->internal_group_ids) { + cJSON *internal_group_ids = cJSON_AddArrayToObject(item, "internalGroupIds"); + if (internal_group_ids == NULL) { + ogs_error("OpenAPI_data_filter_convertToJSON() failed [internal_group_ids]"); + goto end; + } + + OpenAPI_lnode_t *internal_group_ids_node; + OpenAPI_list_for_each(data_filter->internal_group_ids, internal_group_ids_node) { + if (cJSON_AddStringToObject(internal_group_ids, "", (char*)internal_group_ids_node->data) == NULL) { + ogs_error("OpenAPI_data_filter_convertToJSON() failed [internal_group_ids]"); + goto end; + } + } + } + + if (data_filter->supis) { + cJSON *supis = cJSON_AddArrayToObject(item, "supis"); + if (supis == NULL) { + ogs_error("OpenAPI_data_filter_convertToJSON() failed [supis]"); + goto end; + } + + OpenAPI_lnode_t *supis_node; + OpenAPI_list_for_each(data_filter->supis, supis_node) { + if (cJSON_AddStringToObject(supis, "", (char*)supis_node->data) == NULL) { + ogs_error("OpenAPI_data_filter_convertToJSON() failed [supis]"); + goto end; + } + } + } + + if (data_filter->app_ids) { + cJSON *app_ids = cJSON_AddArrayToObject(item, "appIds"); + if (app_ids == NULL) { + ogs_error("OpenAPI_data_filter_convertToJSON() failed [app_ids]"); + goto end; + } + + OpenAPI_lnode_t *app_ids_node; + OpenAPI_list_for_each(data_filter->app_ids, app_ids_node) { + if (cJSON_AddStringToObject(app_ids, "", (char*)app_ids_node->data) == NULL) { + ogs_error("OpenAPI_data_filter_convertToJSON() failed [app_ids]"); + goto end; + } + } + } + + if (data_filter->ue_ipv4s) { + cJSON *ue_ipv4s = cJSON_AddArrayToObject(item, "ueIpv4s"); + if (ue_ipv4s == NULL) { + ogs_error("OpenAPI_data_filter_convertToJSON() failed [ue_ipv4s]"); + goto end; + } + + OpenAPI_lnode_t *ue_ipv4s_node; + OpenAPI_list_for_each(data_filter->ue_ipv4s, ue_ipv4s_node) { + if (cJSON_AddStringToObject(ue_ipv4s, "", (char*)ue_ipv4s_node->data) == NULL) { + ogs_error("OpenAPI_data_filter_convertToJSON() failed [ue_ipv4s]"); + goto end; + } + } + } + + if (data_filter->ue_ipv6s) { + cJSON *ue_ipv6s = cJSON_AddArrayToObject(item, "ueIpv6s"); + if (ue_ipv6s == NULL) { + ogs_error("OpenAPI_data_filter_convertToJSON() failed [ue_ipv6s]"); + goto end; + } + + OpenAPI_lnode_t *ue_ipv6s_node; + OpenAPI_list_for_each(data_filter->ue_ipv6s, ue_ipv6s_node) { + if (cJSON_AddStringToObject(ue_ipv6s, "", (char*)ue_ipv6s_node->data) == NULL) { + ogs_error("OpenAPI_data_filter_convertToJSON() failed [ue_ipv6s]"); + goto end; + } + } + } + + if (data_filter->ue_macs) { + cJSON *ue_macs = cJSON_AddArrayToObject(item, "ueMacs"); + if (ue_macs == NULL) { + ogs_error("OpenAPI_data_filter_convertToJSON() failed [ue_macs]"); + goto end; + } + + OpenAPI_lnode_t *ue_macs_node; + OpenAPI_list_for_each(data_filter->ue_macs, ue_macs_node) { + if (cJSON_AddStringToObject(ue_macs, "", (char*)ue_macs_node->data) == NULL) { + ogs_error("OpenAPI_data_filter_convertToJSON() failed [ue_macs]"); + goto end; + } + } + } + +end: + return item; +} + +OpenAPI_data_filter_t *OpenAPI_data_filter_parseFromJSON(cJSON *data_filterJSON) +{ + OpenAPI_data_filter_t *data_filter_local_var = NULL; + cJSON *data_ind = cJSON_GetObjectItemCaseSensitive(data_filterJSON, "dataInd"); + if (!data_ind) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [data_ind]"); + goto end; + } + + OpenAPI_data_ind_t *data_ind_local_nonprim = NULL; + + data_ind_local_nonprim = OpenAPI_data_ind_parseFromJSON(data_ind); + + cJSON *dnns = cJSON_GetObjectItemCaseSensitive(data_filterJSON, "dnns"); + + OpenAPI_list_t *dnnsList; + if (dnns) { + cJSON *dnns_local; + if (!cJSON_IsArray(dnns)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [dnns]"); + goto end; + } + dnnsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(dnns_local, dnns) { + if (!cJSON_IsString(dnns_local)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [dnns]"); + goto end; + } + OpenAPI_list_add(dnnsList, ogs_strdup(dnns_local->valuestring)); + } + } + + cJSON *snssais = cJSON_GetObjectItemCaseSensitive(data_filterJSON, "snssais"); + + OpenAPI_list_t *snssaisList; + if (snssais) { + cJSON *snssais_local_nonprimitive; + if (!cJSON_IsArray(snssais)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [snssais]"); + goto end; + } + + snssaisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(snssais_local_nonprimitive, snssais ) { + if (!cJSON_IsObject(snssais_local_nonprimitive)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [snssais]"); + goto end; + } + OpenAPI_snssai_t *snssaisItem = OpenAPI_snssai_parseFromJSON(snssais_local_nonprimitive); + + OpenAPI_list_add(snssaisList, snssaisItem); + } + } + + cJSON *internal_group_ids = cJSON_GetObjectItemCaseSensitive(data_filterJSON, "internalGroupIds"); + + OpenAPI_list_t *internal_group_idsList; + if (internal_group_ids) { + cJSON *internal_group_ids_local; + if (!cJSON_IsArray(internal_group_ids)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [internal_group_ids]"); + goto end; + } + internal_group_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(internal_group_ids_local, internal_group_ids) { + if (!cJSON_IsString(internal_group_ids_local)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [internal_group_ids]"); + goto end; + } + OpenAPI_list_add(internal_group_idsList, ogs_strdup(internal_group_ids_local->valuestring)); + } + } + + cJSON *supis = cJSON_GetObjectItemCaseSensitive(data_filterJSON, "supis"); + + OpenAPI_list_t *supisList; + if (supis) { + cJSON *supis_local; + if (!cJSON_IsArray(supis)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [supis]"); + goto end; + } + supisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(supis_local, supis) { + if (!cJSON_IsString(supis_local)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [supis]"); + goto end; + } + OpenAPI_list_add(supisList, ogs_strdup(supis_local->valuestring)); + } + } + + cJSON *app_ids = cJSON_GetObjectItemCaseSensitive(data_filterJSON, "appIds"); + + OpenAPI_list_t *app_idsList; + if (app_ids) { + cJSON *app_ids_local; + if (!cJSON_IsArray(app_ids)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [app_ids]"); + goto end; + } + app_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(app_ids_local, app_ids) { + if (!cJSON_IsString(app_ids_local)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [app_ids]"); + goto end; + } + OpenAPI_list_add(app_idsList, ogs_strdup(app_ids_local->valuestring)); + } + } + + cJSON *ue_ipv4s = cJSON_GetObjectItemCaseSensitive(data_filterJSON, "ueIpv4s"); + + OpenAPI_list_t *ue_ipv4sList; + if (ue_ipv4s) { + cJSON *ue_ipv4s_local; + if (!cJSON_IsArray(ue_ipv4s)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [ue_ipv4s]"); + goto end; + } + ue_ipv4sList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ue_ipv4s_local, ue_ipv4s) { + if (!cJSON_IsString(ue_ipv4s_local)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [ue_ipv4s]"); + goto end; + } + OpenAPI_list_add(ue_ipv4sList, ogs_strdup(ue_ipv4s_local->valuestring)); + } + } + + cJSON *ue_ipv6s = cJSON_GetObjectItemCaseSensitive(data_filterJSON, "ueIpv6s"); + + OpenAPI_list_t *ue_ipv6sList; + if (ue_ipv6s) { + cJSON *ue_ipv6s_local; + if (!cJSON_IsArray(ue_ipv6s)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [ue_ipv6s]"); + goto end; + } + ue_ipv6sList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ue_ipv6s_local, ue_ipv6s) { + if (!cJSON_IsString(ue_ipv6s_local)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [ue_ipv6s]"); + goto end; + } + OpenAPI_list_add(ue_ipv6sList, ogs_strdup(ue_ipv6s_local->valuestring)); + } + } + + cJSON *ue_macs = cJSON_GetObjectItemCaseSensitive(data_filterJSON, "ueMacs"); + + OpenAPI_list_t *ue_macsList; + if (ue_macs) { + cJSON *ue_macs_local; + if (!cJSON_IsArray(ue_macs)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [ue_macs]"); + goto end; + } + ue_macsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ue_macs_local, ue_macs) { + if (!cJSON_IsString(ue_macs_local)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [ue_macs]"); + goto end; + } + OpenAPI_list_add(ue_macsList, ogs_strdup(ue_macs_local->valuestring)); + } + } + + data_filter_local_var = OpenAPI_data_filter_create ( + data_ind_local_nonprim, + dnns ? dnnsList : NULL, + snssais ? snssaisList : NULL, + internal_group_ids ? internal_group_idsList : NULL, + supis ? supisList : NULL, + app_ids ? app_idsList : NULL, + ue_ipv4s ? ue_ipv4sList : NULL, + ue_ipv6s ? ue_ipv6sList : NULL, + ue_macs ? ue_macsList : NULL + ); + + return data_filter_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/data_filter.h b/lib/sbi/openapi/model/data_filter.h new file mode 100644 index 0000000000..13c6dddcd9 --- /dev/null +++ b/lib/sbi/openapi/model/data_filter.h @@ -0,0 +1,55 @@ +/* + * data_filter.h + * + * Identifies a data filter. + */ + +#ifndef _OpenAPI_data_filter_H_ +#define _OpenAPI_data_filter_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "data_ind.h" +#include "snssai.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_data_filter_s OpenAPI_data_filter_t; +typedef struct OpenAPI_data_filter_s { + struct OpenAPI_data_ind_s *data_ind; + OpenAPI_list_t *dnns; + OpenAPI_list_t *snssais; + OpenAPI_list_t *internal_group_ids; + OpenAPI_list_t *supis; + OpenAPI_list_t *app_ids; + OpenAPI_list_t *ue_ipv4s; + OpenAPI_list_t *ue_ipv6s; + OpenAPI_list_t *ue_macs; +} OpenAPI_data_filter_t; + +OpenAPI_data_filter_t *OpenAPI_data_filter_create( + OpenAPI_data_ind_t *data_ind, + OpenAPI_list_t *dnns, + OpenAPI_list_t *snssais, + OpenAPI_list_t *internal_group_ids, + OpenAPI_list_t *supis, + OpenAPI_list_t *app_ids, + OpenAPI_list_t *ue_ipv4s, + OpenAPI_list_t *ue_ipv6s, + OpenAPI_list_t *ue_macs + ); +void OpenAPI_data_filter_free(OpenAPI_data_filter_t *data_filter); +OpenAPI_data_filter_t *OpenAPI_data_filter_parseFromJSON(cJSON *data_filterJSON); +cJSON *OpenAPI_data_filter_convertToJSON(OpenAPI_data_filter_t *data_filter); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_data_filter_H_ */ + diff --git a/lib/sbi/openapi/model/data_ind.c b/lib/sbi/openapi/model/data_ind.c new file mode 100644 index 0000000000..6c6aa361d7 --- /dev/null +++ b/lib/sbi/openapi/model/data_ind.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "data_ind.h" + +OpenAPI_data_ind_t *OpenAPI_data_ind_create( + ) +{ + OpenAPI_data_ind_t *data_ind_local_var = OpenAPI_malloc(sizeof(OpenAPI_data_ind_t)); + if (!data_ind_local_var) { + return NULL; + } + + return data_ind_local_var; +} + +void OpenAPI_data_ind_free(OpenAPI_data_ind_t *data_ind) +{ + if (NULL == data_ind) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(data_ind); +} + +cJSON *OpenAPI_data_ind_convertToJSON(OpenAPI_data_ind_t *data_ind) +{ + cJSON *item = NULL; + + if (data_ind == NULL) { + ogs_error("OpenAPI_data_ind_convertToJSON() failed [DataInd]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_data_ind_t *OpenAPI_data_ind_parseFromJSON(cJSON *data_indJSON) +{ + OpenAPI_data_ind_t *data_ind_local_var = NULL; + data_ind_local_var = OpenAPI_data_ind_create ( + ); + + return data_ind_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/data_ind.h b/lib/sbi/openapi/model/data_ind.h new file mode 100644 index 0000000000..6ade1f1014 --- /dev/null +++ b/lib/sbi/openapi/model/data_ind.h @@ -0,0 +1,35 @@ +/* + * data_ind.h + * + * Possible values are - PFD - IPTV - BDT - SVC_PARAM + */ + +#ifndef _OpenAPI_data_ind_H_ +#define _OpenAPI_data_ind_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_data_ind_s OpenAPI_data_ind_t; +typedef struct OpenAPI_data_ind_s { +} OpenAPI_data_ind_t; + +OpenAPI_data_ind_t *OpenAPI_data_ind_create( + ); +void OpenAPI_data_ind_free(OpenAPI_data_ind_t *data_ind); +OpenAPI_data_ind_t *OpenAPI_data_ind_parseFromJSON(cJSON *data_indJSON); +cJSON *OpenAPI_data_ind_convertToJSON(OpenAPI_data_ind_t *data_ind); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_data_ind_H_ */ + diff --git a/lib/sbi/openapi/model/data_set_id.h b/lib/sbi/openapi/model/data_set_id.h index b96d461698..c0a4bfd445 100644 --- a/lib/sbi/openapi/model/data_set_id.h +++ b/lib/sbi/openapi/model/data_set_id.h @@ -1,7 +1,7 @@ /* * data_set_id.h * - * + * Types of data sets stored in UDR */ #ifndef _OpenAPI_data_set_id_H_ diff --git a/lib/sbi/openapi/model/data_set_name.c b/lib/sbi/openapi/model/data_set_name.c new file mode 100644 index 0000000000..d477ad5396 --- /dev/null +++ b/lib/sbi/openapi/model/data_set_name.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "data_set_name.h" + +OpenAPI_data_set_name_t *OpenAPI_data_set_name_create( + ) +{ + 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; +} + +void OpenAPI_data_set_name_free(OpenAPI_data_set_name_t *data_set_name) +{ + if (NULL == data_set_name) { + return; + } + 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; +} + diff --git a/lib/sbi/openapi/model/data_set_name.h b/lib/sbi/openapi/model/data_set_name.h new file mode 100644 index 0000000000..89318bd3b4 --- /dev/null +++ b/lib/sbi/openapi/model/data_set_name.h @@ -0,0 +1,35 @@ +/* + * data_set_name.h + * + * + */ + +#ifndef _OpenAPI_data_set_name_H_ +#define _OpenAPI_data_set_name_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +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; + +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); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_data_set_name_H_ */ + diff --git a/lib/sbi/openapi/model/datalink_reporting_configuration.c b/lib/sbi/openapi/model/datalink_reporting_configuration.c new file mode 100644 index 0000000000..67865a93f0 --- /dev/null +++ b/lib/sbi/openapi/model/datalink_reporting_configuration.c @@ -0,0 +1,195 @@ + +#include +#include +#include +#include "datalink_reporting_configuration.h" + +OpenAPI_datalink_reporting_configuration_t *OpenAPI_datalink_reporting_configuration_create( + OpenAPI_list_t *ddd_traffic_des, + char *dnn, + OpenAPI_snssai_t *slice, + OpenAPI_list_t *ddd_status_list + ) +{ + OpenAPI_datalink_reporting_configuration_t *datalink_reporting_configuration_local_var = OpenAPI_malloc(sizeof(OpenAPI_datalink_reporting_configuration_t)); + if (!datalink_reporting_configuration_local_var) { + return NULL; + } + datalink_reporting_configuration_local_var->ddd_traffic_des = ddd_traffic_des; + datalink_reporting_configuration_local_var->dnn = dnn; + datalink_reporting_configuration_local_var->slice = slice; + datalink_reporting_configuration_local_var->ddd_status_list = ddd_status_list; + + return datalink_reporting_configuration_local_var; +} + +void OpenAPI_datalink_reporting_configuration_free(OpenAPI_datalink_reporting_configuration_t *datalink_reporting_configuration) +{ + if (NULL == datalink_reporting_configuration) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(datalink_reporting_configuration->ddd_traffic_des, node) { + OpenAPI_ddd_traffic_descriptor_free(node->data); + } + 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); +} + +cJSON *OpenAPI_datalink_reporting_configuration_convertToJSON(OpenAPI_datalink_reporting_configuration_t *datalink_reporting_configuration) +{ + cJSON *item = NULL; + + if (datalink_reporting_configuration == NULL) { + ogs_error("OpenAPI_datalink_reporting_configuration_convertToJSON() failed [DatalinkReportingConfiguration]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (datalink_reporting_configuration->ddd_traffic_des) { + cJSON *ddd_traffic_desList = cJSON_AddArrayToObject(item, "dddTrafficDes"); + if (ddd_traffic_desList == NULL) { + ogs_error("OpenAPI_datalink_reporting_configuration_convertToJSON() failed [ddd_traffic_des]"); + goto end; + } + + OpenAPI_lnode_t *ddd_traffic_des_node; + if (datalink_reporting_configuration->ddd_traffic_des) { + OpenAPI_list_for_each(datalink_reporting_configuration->ddd_traffic_des, ddd_traffic_des_node) { + cJSON *itemLocal = OpenAPI_ddd_traffic_descriptor_convertToJSON(ddd_traffic_des_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_datalink_reporting_configuration_convertToJSON() failed [ddd_traffic_des]"); + goto end; + } + cJSON_AddItemToArray(ddd_traffic_desList, itemLocal); + } + } + } + + if (datalink_reporting_configuration->dnn) { + if (cJSON_AddStringToObject(item, "dnn", datalink_reporting_configuration->dnn) == NULL) { + ogs_error("OpenAPI_datalink_reporting_configuration_convertToJSON() failed [dnn]"); + goto end; + } + } + + if (datalink_reporting_configuration->slice) { + cJSON *slice_local_JSON = OpenAPI_snssai_convertToJSON(datalink_reporting_configuration->slice); + if (slice_local_JSON == NULL) { + ogs_error("OpenAPI_datalink_reporting_configuration_convertToJSON() failed [slice]"); + goto end; + } + cJSON_AddItemToObject(item, "slice", slice_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_datalink_reporting_configuration_convertToJSON() failed [slice]"); + goto end; + } + } + + if (datalink_reporting_configuration->ddd_status_list) { + cJSON *ddd_status_listList = cJSON_AddArrayToObject(item, "dddStatusList"); + if (ddd_status_listList == 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); + } + } + } + +end: + return item; +} + +OpenAPI_datalink_reporting_configuration_t *OpenAPI_datalink_reporting_configuration_parseFromJSON(cJSON *datalink_reporting_configurationJSON) +{ + OpenAPI_datalink_reporting_configuration_t *datalink_reporting_configuration_local_var = NULL; + cJSON *ddd_traffic_des = cJSON_GetObjectItemCaseSensitive(datalink_reporting_configurationJSON, "dddTrafficDes"); + + OpenAPI_list_t *ddd_traffic_desList; + if (ddd_traffic_des) { + cJSON *ddd_traffic_des_local_nonprimitive; + if (!cJSON_IsArray(ddd_traffic_des)) { + ogs_error("OpenAPI_datalink_reporting_configuration_parseFromJSON() failed [ddd_traffic_des]"); + goto end; + } + + ddd_traffic_desList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ddd_traffic_des_local_nonprimitive, ddd_traffic_des ) { + if (!cJSON_IsObject(ddd_traffic_des_local_nonprimitive)) { + ogs_error("OpenAPI_datalink_reporting_configuration_parseFromJSON() failed [ddd_traffic_des]"); + goto end; + } + OpenAPI_ddd_traffic_descriptor_t *ddd_traffic_desItem = OpenAPI_ddd_traffic_descriptor_parseFromJSON(ddd_traffic_des_local_nonprimitive); + + OpenAPI_list_add(ddd_traffic_desList, ddd_traffic_desItem); + } + } + + cJSON *dnn = cJSON_GetObjectItemCaseSensitive(datalink_reporting_configurationJSON, "dnn"); + + if (dnn) { + if (!cJSON_IsString(dnn)) { + ogs_error("OpenAPI_datalink_reporting_configuration_parseFromJSON() failed [dnn]"); + goto end; + } + } + + cJSON *slice = cJSON_GetObjectItemCaseSensitive(datalink_reporting_configurationJSON, "slice"); + + OpenAPI_snssai_t *slice_local_nonprim = NULL; + if (slice) { + slice_local_nonprim = OpenAPI_snssai_parseFromJSON(slice); + } + + cJSON *ddd_status_list = cJSON_GetObjectItemCaseSensitive(datalink_reporting_configurationJSON, "dddStatusList"); + + OpenAPI_list_t *ddd_status_listList; + if (ddd_status_list) { + cJSON *ddd_status_list_local_nonprimitive; + if (!cJSON_IsArray(ddd_status_list)) { + ogs_error("OpenAPI_datalink_reporting_configuration_parseFromJSON() failed [ddd_status_list]"); + goto end; + } + + ddd_status_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ddd_status_list_local_nonprimitive, ddd_status_list ) { + if (!cJSON_IsObject(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); + } + } + + datalink_reporting_configuration_local_var = OpenAPI_datalink_reporting_configuration_create ( + ddd_traffic_des ? ddd_traffic_desList : NULL, + dnn ? ogs_strdup(dnn->valuestring) : NULL, + slice ? slice_local_nonprim : NULL, + ddd_status_list ? ddd_status_listList : NULL + ); + + return datalink_reporting_configuration_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/datalink_reporting_configuration.h b/lib/sbi/openapi/model/datalink_reporting_configuration.h new file mode 100644 index 0000000000..d55ffe459b --- /dev/null +++ b/lib/sbi/openapi/model/datalink_reporting_configuration.h @@ -0,0 +1,46 @@ +/* + * datalink_reporting_configuration.h + * + * + */ + +#ifndef _OpenAPI_datalink_reporting_configuration_H_ +#define _OpenAPI_datalink_reporting_configuration_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "ddd_traffic_descriptor.h" +#include "dl_data_delivery_status.h" +#include "snssai.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_datalink_reporting_configuration_s OpenAPI_datalink_reporting_configuration_t; +typedef struct OpenAPI_datalink_reporting_configuration_s { + OpenAPI_list_t *ddd_traffic_des; + char *dnn; + struct OpenAPI_snssai_s *slice; + OpenAPI_list_t *ddd_status_list; +} OpenAPI_datalink_reporting_configuration_t; + +OpenAPI_datalink_reporting_configuration_t *OpenAPI_datalink_reporting_configuration_create( + OpenAPI_list_t *ddd_traffic_des, + char *dnn, + OpenAPI_snssai_t *slice, + OpenAPI_list_t *ddd_status_list + ); +void OpenAPI_datalink_reporting_configuration_free(OpenAPI_datalink_reporting_configuration_t *datalink_reporting_configuration); +OpenAPI_datalink_reporting_configuration_t *OpenAPI_datalink_reporting_configuration_parseFromJSON(cJSON *datalink_reporting_configurationJSON); +cJSON *OpenAPI_datalink_reporting_configuration_convertToJSON(OpenAPI_datalink_reporting_configuration_t *datalink_reporting_configuration); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_datalink_reporting_configuration_H_ */ + diff --git a/lib/sbi/openapi/model/ddd_traffic_descriptor.c b/lib/sbi/openapi/model/ddd_traffic_descriptor.c new file mode 100644 index 0000000000..ec58d90e07 --- /dev/null +++ b/lib/sbi/openapi/model/ddd_traffic_descriptor.c @@ -0,0 +1,130 @@ + +#include +#include +#include +#include "ddd_traffic_descriptor.h" + +OpenAPI_ddd_traffic_descriptor_t *OpenAPI_ddd_traffic_descriptor_create( + char *ipv4_addr, + char *ipv6_addr, + int port_number, + char *mac_addr + ) +{ + OpenAPI_ddd_traffic_descriptor_t *ddd_traffic_descriptor_local_var = OpenAPI_malloc(sizeof(OpenAPI_ddd_traffic_descriptor_t)); + if (!ddd_traffic_descriptor_local_var) { + return NULL; + } + ddd_traffic_descriptor_local_var->ipv4_addr = ipv4_addr; + ddd_traffic_descriptor_local_var->ipv6_addr = ipv6_addr; + ddd_traffic_descriptor_local_var->port_number = port_number; + ddd_traffic_descriptor_local_var->mac_addr = mac_addr; + + return ddd_traffic_descriptor_local_var; +} + +void OpenAPI_ddd_traffic_descriptor_free(OpenAPI_ddd_traffic_descriptor_t *ddd_traffic_descriptor) +{ + if (NULL == ddd_traffic_descriptor) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(ddd_traffic_descriptor->ipv4_addr); + ogs_free(ddd_traffic_descriptor->ipv6_addr); + ogs_free(ddd_traffic_descriptor->mac_addr); + ogs_free(ddd_traffic_descriptor); +} + +cJSON *OpenAPI_ddd_traffic_descriptor_convertToJSON(OpenAPI_ddd_traffic_descriptor_t *ddd_traffic_descriptor) +{ + cJSON *item = NULL; + + if (ddd_traffic_descriptor == NULL) { + ogs_error("OpenAPI_ddd_traffic_descriptor_convertToJSON() failed [DddTrafficDescriptor]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (ddd_traffic_descriptor->ipv4_addr) { + if (cJSON_AddStringToObject(item, "ipv4Addr", ddd_traffic_descriptor->ipv4_addr) == NULL) { + ogs_error("OpenAPI_ddd_traffic_descriptor_convertToJSON() failed [ipv4_addr]"); + goto end; + } + } + + if (ddd_traffic_descriptor->ipv6_addr) { + if (cJSON_AddStringToObject(item, "ipv6Addr", ddd_traffic_descriptor->ipv6_addr) == NULL) { + ogs_error("OpenAPI_ddd_traffic_descriptor_convertToJSON() failed [ipv6_addr]"); + goto end; + } + } + + if (ddd_traffic_descriptor->port_number) { + if (cJSON_AddNumberToObject(item, "portNumber", ddd_traffic_descriptor->port_number) == NULL) { + ogs_error("OpenAPI_ddd_traffic_descriptor_convertToJSON() failed [port_number]"); + goto end; + } + } + + if (ddd_traffic_descriptor->mac_addr) { + if (cJSON_AddStringToObject(item, "macAddr", ddd_traffic_descriptor->mac_addr) == NULL) { + ogs_error("OpenAPI_ddd_traffic_descriptor_convertToJSON() failed [mac_addr]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_ddd_traffic_descriptor_t *OpenAPI_ddd_traffic_descriptor_parseFromJSON(cJSON *ddd_traffic_descriptorJSON) +{ + OpenAPI_ddd_traffic_descriptor_t *ddd_traffic_descriptor_local_var = NULL; + cJSON *ipv4_addr = cJSON_GetObjectItemCaseSensitive(ddd_traffic_descriptorJSON, "ipv4Addr"); + + if (ipv4_addr) { + if (!cJSON_IsString(ipv4_addr)) { + ogs_error("OpenAPI_ddd_traffic_descriptor_parseFromJSON() failed [ipv4_addr]"); + goto end; + } + } + + cJSON *ipv6_addr = cJSON_GetObjectItemCaseSensitive(ddd_traffic_descriptorJSON, "ipv6Addr"); + + if (ipv6_addr) { + if (!cJSON_IsString(ipv6_addr)) { + ogs_error("OpenAPI_ddd_traffic_descriptor_parseFromJSON() failed [ipv6_addr]"); + goto end; + } + } + + cJSON *port_number = cJSON_GetObjectItemCaseSensitive(ddd_traffic_descriptorJSON, "portNumber"); + + if (port_number) { + if (!cJSON_IsNumber(port_number)) { + ogs_error("OpenAPI_ddd_traffic_descriptor_parseFromJSON() failed [port_number]"); + goto end; + } + } + + cJSON *mac_addr = cJSON_GetObjectItemCaseSensitive(ddd_traffic_descriptorJSON, "macAddr"); + + if (mac_addr) { + if (!cJSON_IsString(mac_addr)) { + ogs_error("OpenAPI_ddd_traffic_descriptor_parseFromJSON() failed [mac_addr]"); + goto end; + } + } + + ddd_traffic_descriptor_local_var = OpenAPI_ddd_traffic_descriptor_create ( + ipv4_addr ? ogs_strdup(ipv4_addr->valuestring) : NULL, + ipv6_addr ? ogs_strdup(ipv6_addr->valuestring) : NULL, + port_number ? port_number->valuedouble : 0, + mac_addr ? ogs_strdup(mac_addr->valuestring) : NULL + ); + + return ddd_traffic_descriptor_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/ddd_traffic_descriptor.h b/lib/sbi/openapi/model/ddd_traffic_descriptor.h new file mode 100644 index 0000000000..4b29ee0c49 --- /dev/null +++ b/lib/sbi/openapi/model/ddd_traffic_descriptor.h @@ -0,0 +1,43 @@ +/* + * ddd_traffic_descriptor.h + * + * + */ + +#ifndef _OpenAPI_ddd_traffic_descriptor_H_ +#define _OpenAPI_ddd_traffic_descriptor_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_ddd_traffic_descriptor_s OpenAPI_ddd_traffic_descriptor_t; +typedef struct OpenAPI_ddd_traffic_descriptor_s { + char *ipv4_addr; + char *ipv6_addr; + int port_number; + char *mac_addr; +} OpenAPI_ddd_traffic_descriptor_t; + +OpenAPI_ddd_traffic_descriptor_t *OpenAPI_ddd_traffic_descriptor_create( + char *ipv4_addr, + char *ipv6_addr, + int port_number, + char *mac_addr + ); +void OpenAPI_ddd_traffic_descriptor_free(OpenAPI_ddd_traffic_descriptor_t *ddd_traffic_descriptor); +OpenAPI_ddd_traffic_descriptor_t *OpenAPI_ddd_traffic_descriptor_parseFromJSON(cJSON *ddd_traffic_descriptorJSON); +cJSON *OpenAPI_ddd_traffic_descriptor_convertToJSON(OpenAPI_ddd_traffic_descriptor_t *ddd_traffic_descriptor); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_ddd_traffic_descriptor_H_ */ + diff --git a/lib/sbi/openapi/model/default_notification_subscription.c b/lib/sbi/openapi/model/default_notification_subscription.c index e0b105be7a..ac04328fee 100644 --- a/lib/sbi/openapi/model/default_notification_subscription.c +++ b/lib/sbi/openapi/model/default_notification_subscription.c @@ -8,7 +8,8 @@ OpenAPI_default_notification_subscription_t *OpenAPI_default_notification_subscr OpenAPI_notification_type_e notification_type, char *callback_uri, OpenAPI_n1_message_class_e n1_message_class, - OpenAPI_n2_information_class_t *n2_information_class + OpenAPI_n2_information_class_t *n2_information_class, + OpenAPI_list_t *versions ) { OpenAPI_default_notification_subscription_t *default_notification_subscription_local_var = OpenAPI_malloc(sizeof(OpenAPI_default_notification_subscription_t)); @@ -19,6 +20,7 @@ OpenAPI_default_notification_subscription_t *OpenAPI_default_notification_subscr default_notification_subscription_local_var->callback_uri = callback_uri; 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; return default_notification_subscription_local_var; } @@ -31,6 +33,10 @@ void OpenAPI_default_notification_subscription_free(OpenAPI_default_notification OpenAPI_lnode_t *node; ogs_free(default_notification_subscription->callback_uri); OpenAPI_n2_information_class_free(default_notification_subscription->n2_information_class); + OpenAPI_list_for_each(default_notification_subscription->versions, node) { + ogs_free(node->data); + } + OpenAPI_list_free(default_notification_subscription->versions); ogs_free(default_notification_subscription); } @@ -82,6 +88,22 @@ cJSON *OpenAPI_default_notification_subscription_convertToJSON(OpenAPI_default_n } } + if (default_notification_subscription->versions) { + cJSON *versions = cJSON_AddArrayToObject(item, "versions"); + if (versions == NULL) { + ogs_error("OpenAPI_default_notification_subscription_convertToJSON() failed [versions]"); + goto end; + } + + OpenAPI_lnode_t *versions_node; + OpenAPI_list_for_each(default_notification_subscription->versions, versions_node) { + if (cJSON_AddStringToObject(versions, "", (char*)versions_node->data) == NULL) { + ogs_error("OpenAPI_default_notification_subscription_convertToJSON() failed [versions]"); + goto end; + } + } + } + end: return item; } @@ -133,11 +155,32 @@ OpenAPI_default_notification_subscription_t *OpenAPI_default_notification_subscr n2_information_class_local_nonprim = OpenAPI_n2_information_class_parseFromJSON(n2_information_class); } + cJSON *versions = cJSON_GetObjectItemCaseSensitive(default_notification_subscriptionJSON, "versions"); + + OpenAPI_list_t *versionsList; + if (versions) { + cJSON *versions_local; + if (!cJSON_IsArray(versions)) { + ogs_error("OpenAPI_default_notification_subscription_parseFromJSON() failed [versions]"); + goto end; + } + versionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(versions_local, versions) { + if (!cJSON_IsString(versions_local)) { + ogs_error("OpenAPI_default_notification_subscription_parseFromJSON() failed [versions]"); + goto end; + } + OpenAPI_list_add(versionsList, ogs_strdup(versions_local->valuestring)); + } + } + 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_class_local_nonprim : NULL + n2_information_class ? n2_information_class_local_nonprim : NULL, + versions ? versionsList : NULL ); return default_notification_subscription_local_var; diff --git a/lib/sbi/openapi/model/default_notification_subscription.h b/lib/sbi/openapi/model/default_notification_subscription.h index 12e460c1e9..0a223ef0fa 100644 --- a/lib/sbi/openapi/model/default_notification_subscription.h +++ b/lib/sbi/openapi/model/default_notification_subscription.h @@ -1,7 +1,7 @@ /* * default_notification_subscription.h * - * + * Data structure for specifying the notifications the NF service subscribes by default along with callback URI */ #ifndef _OpenAPI_default_notification_subscription_H_ @@ -26,13 +26,15 @@ typedef struct OpenAPI_default_notification_subscription_s { char *callback_uri; OpenAPI_n1_message_class_e n1_message_class; struct OpenAPI_n2_information_class_s *n2_information_class; + OpenAPI_list_t *versions; } OpenAPI_default_notification_subscription_t; OpenAPI_default_notification_subscription_t *OpenAPI_default_notification_subscription_create( OpenAPI_notification_type_e notification_type, char *callback_uri, OpenAPI_n1_message_class_e n1_message_class, - OpenAPI_n2_information_class_t *n2_information_class + OpenAPI_n2_information_class_t *n2_information_class, + OpenAPI_list_t *versions ); 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); diff --git a/lib/sbi/openapi/model/deregistration_data.c b/lib/sbi/openapi/model/deregistration_data.c new file mode 100644 index 0000000000..c66d1ee65c --- /dev/null +++ b/lib/sbi/openapi/model/deregistration_data.c @@ -0,0 +1,145 @@ + +#include +#include +#include +#include "deregistration_data.h" + +OpenAPI_deregistration_data_t *OpenAPI_deregistration_data_create( + OpenAPI_deregistration_reason_t *dereg_reason, + OpenAPI_access_type_e access_type, + int pdu_session_id, + char *new_smf_instance_id + ) +{ + OpenAPI_deregistration_data_t *deregistration_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_deregistration_data_t)); + if (!deregistration_data_local_var) { + return NULL; + } + deregistration_data_local_var->dereg_reason = dereg_reason; + deregistration_data_local_var->access_type = access_type; + deregistration_data_local_var->pdu_session_id = pdu_session_id; + deregistration_data_local_var->new_smf_instance_id = new_smf_instance_id; + + return deregistration_data_local_var; +} + +void OpenAPI_deregistration_data_free(OpenAPI_deregistration_data_t *deregistration_data) +{ + if (NULL == deregistration_data) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_deregistration_reason_free(deregistration_data->dereg_reason); + ogs_free(deregistration_data->new_smf_instance_id); + ogs_free(deregistration_data); +} + +cJSON *OpenAPI_deregistration_data_convertToJSON(OpenAPI_deregistration_data_t *deregistration_data) +{ + cJSON *item = NULL; + + if (deregistration_data == NULL) { + ogs_error("OpenAPI_deregistration_data_convertToJSON() failed [DeregistrationData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!deregistration_data->dereg_reason) { + ogs_error("OpenAPI_deregistration_data_convertToJSON() failed [dereg_reason]"); + goto end; + } + cJSON *dereg_reason_local_JSON = OpenAPI_deregistration_reason_convertToJSON(deregistration_data->dereg_reason); + if (dereg_reason_local_JSON == NULL) { + ogs_error("OpenAPI_deregistration_data_convertToJSON() failed [dereg_reason]"); + goto end; + } + cJSON_AddItemToObject(item, "deregReason", dereg_reason_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_deregistration_data_convertToJSON() failed [dereg_reason]"); + 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->pdu_session_id) { + if (cJSON_AddNumberToObject(item, "pduSessionId", deregistration_data->pdu_session_id) == NULL) { + ogs_error("OpenAPI_deregistration_data_convertToJSON() failed [pdu_session_id]"); + goto end; + } + } + + if (deregistration_data->new_smf_instance_id) { + if (cJSON_AddStringToObject(item, "newSmfInstanceId", deregistration_data->new_smf_instance_id) == NULL) { + ogs_error("OpenAPI_deregistration_data_convertToJSON() failed [new_smf_instance_id]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_deregistration_data_t *OpenAPI_deregistration_data_parseFromJSON(cJSON *deregistration_dataJSON) +{ + OpenAPI_deregistration_data_t *deregistration_data_local_var = NULL; + cJSON *dereg_reason = cJSON_GetObjectItemCaseSensitive(deregistration_dataJSON, "deregReason"); + if (!dereg_reason) { + ogs_error("OpenAPI_deregistration_data_parseFromJSON() failed [dereg_reason]"); + goto end; + } + + OpenAPI_deregistration_reason_t *dereg_reason_local_nonprim = NULL; + + 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; + } + access_typeVariable = OpenAPI_access_type_FromString(access_type->valuestring); + + cJSON *pdu_session_id = cJSON_GetObjectItemCaseSensitive(deregistration_dataJSON, "pduSessionId"); + + if (pdu_session_id) { + if (!cJSON_IsNumber(pdu_session_id)) { + ogs_error("OpenAPI_deregistration_data_parseFromJSON() failed [pdu_session_id]"); + goto end; + } + } + + cJSON *new_smf_instance_id = cJSON_GetObjectItemCaseSensitive(deregistration_dataJSON, "newSmfInstanceId"); + + if (new_smf_instance_id) { + if (!cJSON_IsString(new_smf_instance_id)) { + ogs_error("OpenAPI_deregistration_data_parseFromJSON() failed [new_smf_instance_id]"); + goto end; + } + } + + deregistration_data_local_var = OpenAPI_deregistration_data_create ( + dereg_reason_local_nonprim, + access_typeVariable, + pdu_session_id ? pdu_session_id->valuedouble : 0, + new_smf_instance_id ? ogs_strdup(new_smf_instance_id->valuestring) : NULL + ); + + return deregistration_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/deregistration_data.h b/lib/sbi/openapi/model/deregistration_data.h new file mode 100644 index 0000000000..098c3b5431 --- /dev/null +++ b/lib/sbi/openapi/model/deregistration_data.h @@ -0,0 +1,45 @@ +/* + * deregistration_data.h + * + * + */ + +#ifndef _OpenAPI_deregistration_data_H_ +#define _OpenAPI_deregistration_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "access_type.h" +#include "deregistration_reason.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_deregistration_data_s OpenAPI_deregistration_data_t; +typedef struct OpenAPI_deregistration_data_s { + struct OpenAPI_deregistration_reason_s *dereg_reason; + OpenAPI_access_type_e access_type; + int pdu_session_id; + char *new_smf_instance_id; +} OpenAPI_deregistration_data_t; + +OpenAPI_deregistration_data_t *OpenAPI_deregistration_data_create( + OpenAPI_deregistration_reason_t *dereg_reason, + OpenAPI_access_type_e access_type, + int pdu_session_id, + char *new_smf_instance_id + ); +void OpenAPI_deregistration_data_free(OpenAPI_deregistration_data_t *deregistration_data); +OpenAPI_deregistration_data_t *OpenAPI_deregistration_data_parseFromJSON(cJSON *deregistration_dataJSON); +cJSON *OpenAPI_deregistration_data_convertToJSON(OpenAPI_deregistration_data_t *deregistration_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_deregistration_data_H_ */ + diff --git a/lib/sbi/openapi/model/deregistration_reason.c b/lib/sbi/openapi/model/deregistration_reason.c new file mode 100644 index 0000000000..1559c66603 --- /dev/null +++ b/lib/sbi/openapi/model/deregistration_reason.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "deregistration_reason.h" + +OpenAPI_deregistration_reason_t *OpenAPI_deregistration_reason_create( + ) +{ + OpenAPI_deregistration_reason_t *deregistration_reason_local_var = OpenAPI_malloc(sizeof(OpenAPI_deregistration_reason_t)); + if (!deregistration_reason_local_var) { + return NULL; + } + + return deregistration_reason_local_var; +} + +void OpenAPI_deregistration_reason_free(OpenAPI_deregistration_reason_t *deregistration_reason) +{ + if (NULL == deregistration_reason) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(deregistration_reason); +} + +cJSON *OpenAPI_deregistration_reason_convertToJSON(OpenAPI_deregistration_reason_t *deregistration_reason) +{ + cJSON *item = NULL; + + if (deregistration_reason == NULL) { + ogs_error("OpenAPI_deregistration_reason_convertToJSON() failed [DeregistrationReason]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_deregistration_reason_t *OpenAPI_deregistration_reason_parseFromJSON(cJSON *deregistration_reasonJSON) +{ + OpenAPI_deregistration_reason_t *deregistration_reason_local_var = NULL; + deregistration_reason_local_var = OpenAPI_deregistration_reason_create ( + ); + + return deregistration_reason_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/deregistration_reason.h b/lib/sbi/openapi/model/deregistration_reason.h new file mode 100644 index 0000000000..fded1f76d8 --- /dev/null +++ b/lib/sbi/openapi/model/deregistration_reason.h @@ -0,0 +1,35 @@ +/* + * deregistration_reason.h + * + * + */ + +#ifndef _OpenAPI_deregistration_reason_H_ +#define _OpenAPI_deregistration_reason_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_deregistration_reason_s OpenAPI_deregistration_reason_t; +typedef struct OpenAPI_deregistration_reason_s { +} OpenAPI_deregistration_reason_t; + +OpenAPI_deregistration_reason_t *OpenAPI_deregistration_reason_create( + ); +void OpenAPI_deregistration_reason_free(OpenAPI_deregistration_reason_t *deregistration_reason); +OpenAPI_deregistration_reason_t *OpenAPI_deregistration_reason_parseFromJSON(cJSON *deregistration_reasonJSON); +cJSON *OpenAPI_deregistration_reason_convertToJSON(OpenAPI_deregistration_reason_t *deregistration_reason); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_deregistration_reason_H_ */ + diff --git a/lib/sbi/openapi/model/dl_data_delivery_status.c b/lib/sbi/openapi/model/dl_data_delivery_status.c new file mode 100644 index 0000000000..0e0be9330a --- /dev/null +++ b/lib/sbi/openapi/model/dl_data_delivery_status.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "dl_data_delivery_status.h" + +OpenAPI_dl_data_delivery_status_t *OpenAPI_dl_data_delivery_status_create( + ) +{ + 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; +} + +void OpenAPI_dl_data_delivery_status_free(OpenAPI_dl_data_delivery_status_t *dl_data_delivery_status) +{ + if (NULL == dl_data_delivery_status) { + return; + } + 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; +} + diff --git a/lib/sbi/openapi/model/dl_data_delivery_status.h b/lib/sbi/openapi/model/dl_data_delivery_status.h new file mode 100644 index 0000000000..2f8401e31e --- /dev/null +++ b/lib/sbi/openapi/model/dl_data_delivery_status.h @@ -0,0 +1,35 @@ +/* + * 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_ +#define _OpenAPI_dl_data_delivery_status_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +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; + +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); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_dl_data_delivery_status_H_ */ + diff --git a/lib/sbi/openapi/model/dnai_change_type.c b/lib/sbi/openapi/model/dnai_change_type.c new file mode 100644 index 0000000000..73a597bcf3 --- /dev/null +++ b/lib/sbi/openapi/model/dnai_change_type.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "dnai_change_type.h" + +OpenAPI_dnai_change_type_t *OpenAPI_dnai_change_type_create( + ) +{ + OpenAPI_dnai_change_type_t *dnai_change_type_local_var = OpenAPI_malloc(sizeof(OpenAPI_dnai_change_type_t)); + if (!dnai_change_type_local_var) { + return NULL; + } + + return dnai_change_type_local_var; +} + +void OpenAPI_dnai_change_type_free(OpenAPI_dnai_change_type_t *dnai_change_type) +{ + if (NULL == dnai_change_type) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(dnai_change_type); +} + +cJSON *OpenAPI_dnai_change_type_convertToJSON(OpenAPI_dnai_change_type_t *dnai_change_type) +{ + cJSON *item = NULL; + + if (dnai_change_type == NULL) { + ogs_error("OpenAPI_dnai_change_type_convertToJSON() failed [DnaiChangeType]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_dnai_change_type_t *OpenAPI_dnai_change_type_parseFromJSON(cJSON *dnai_change_typeJSON) +{ + OpenAPI_dnai_change_type_t *dnai_change_type_local_var = NULL; + dnai_change_type_local_var = OpenAPI_dnai_change_type_create ( + ); + + return dnai_change_type_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/dnai_change_type.h b/lib/sbi/openapi/model/dnai_change_type.h new file mode 100644 index 0000000000..50eda7c122 --- /dev/null +++ b/lib/sbi/openapi/model/dnai_change_type.h @@ -0,0 +1,35 @@ +/* + * dnai_change_type.h + * + * Possible values are - EARLY: Early notification of UP path reconfiguration. - EARLY_LATE: Early and late notification of UP path reconfiguration. This value shall only be present in the subscription to the DNAI change event. - LATE: Late notification of UP path reconfiguration. + */ + +#ifndef _OpenAPI_dnai_change_type_H_ +#define _OpenAPI_dnai_change_type_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_dnai_change_type_s OpenAPI_dnai_change_type_t; +typedef struct OpenAPI_dnai_change_type_s { +} OpenAPI_dnai_change_type_t; + +OpenAPI_dnai_change_type_t *OpenAPI_dnai_change_type_create( + ); +void OpenAPI_dnai_change_type_free(OpenAPI_dnai_change_type_t *dnai_change_type); +OpenAPI_dnai_change_type_t *OpenAPI_dnai_change_type_parseFromJSON(cJSON *dnai_change_typeJSON); +cJSON *OpenAPI_dnai_change_type_convertToJSON(OpenAPI_dnai_change_type_t *dnai_change_type); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_dnai_change_type_H_ */ + diff --git a/lib/sbi/openapi/model/dnn_configuration.c b/lib/sbi/openapi/model/dnn_configuration.c new file mode 100644 index 0000000000..a3432d7f70 --- /dev/null +++ b/lib/sbi/openapi/model/dnn_configuration.c @@ -0,0 +1,516 @@ + +#include +#include +#include +#include "dnn_configuration.h" + +OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_create( + OpenAPI_pdu_session_types_t *pdu_session_types, + OpenAPI_ssc_modes_t *ssc_modes, + int iwk_eps_ind, + OpenAPI_subscribed_default_qos_t *_5g_qos_profile, + OpenAPI_ambr_t *session_ambr, + char *_3gpp_charging_characteristics, + 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 + ) +{ + OpenAPI_dnn_configuration_t *dnn_configuration_local_var = OpenAPI_malloc(sizeof(OpenAPI_dnn_configuration_t)); + if (!dnn_configuration_local_var) { + return NULL; + } + dnn_configuration_local_var->pdu_session_types = pdu_session_types; + dnn_configuration_local_var->ssc_modes = ssc_modes; + dnn_configuration_local_var->iwk_eps_ind = iwk_eps_ind; + dnn_configuration_local_var->_5g_qos_profile = _5g_qos_profile; + dnn_configuration_local_var->session_ambr = session_ambr; + dnn_configuration_local_var->_3gpp_charging_characteristics = _3gpp_charging_characteristics; + 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; + dnn_configuration_local_var->acs_info = acs_info; + 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; + + return dnn_configuration_local_var; +} + +void OpenAPI_dnn_configuration_free(OpenAPI_dnn_configuration_t *dnn_configuration) +{ + if (NULL == dnn_configuration) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_pdu_session_types_free(dnn_configuration->pdu_session_types); + OpenAPI_ssc_modes_free(dnn_configuration->ssc_modes); + OpenAPI_subscribed_default_qos_free(dnn_configuration->_5g_qos_profile); + OpenAPI_ambr_free(dnn_configuration->session_ambr); + ogs_free(dnn_configuration->_3gpp_charging_characteristics); + OpenAPI_list_for_each(dnn_configuration->static_ip_address, node) { + OpenAPI_ip_address_free(node->data); + } + OpenAPI_list_free(dnn_configuration->static_ip_address); + OpenAPI_up_security_free(dnn_configuration->up_security); + ogs_free(dnn_configuration->nidd_nef_id); + OpenAPI_nidd_information_free(dnn_configuration->nidd_info); + OpenAPI_acs_info_free(dnn_configuration->acs_info); + OpenAPI_list_for_each(dnn_configuration->ipv4_frame_route_list, node) { + OpenAPI_frame_route_info_free(node->data); + } + OpenAPI_list_free(dnn_configuration->ipv4_frame_route_list); + OpenAPI_list_for_each(dnn_configuration->ipv6_frame_route_list, node) { + OpenAPI_frame_route_info_free(node->data); + } + OpenAPI_list_free(dnn_configuration->ipv6_frame_route_list); + ogs_free(dnn_configuration); +} + +cJSON *OpenAPI_dnn_configuration_convertToJSON(OpenAPI_dnn_configuration_t *dnn_configuration) +{ + cJSON *item = NULL; + + if (dnn_configuration == NULL) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [DnnConfiguration]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!dnn_configuration->pdu_session_types) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [pdu_session_types]"); + goto end; + } + cJSON *pdu_session_types_local_JSON = OpenAPI_pdu_session_types_convertToJSON(dnn_configuration->pdu_session_types); + if (pdu_session_types_local_JSON == NULL) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [pdu_session_types]"); + goto end; + } + cJSON_AddItemToObject(item, "pduSessionTypes", pdu_session_types_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [pdu_session_types]"); + goto end; + } + + if (!dnn_configuration->ssc_modes) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [ssc_modes]"); + goto end; + } + cJSON *ssc_modes_local_JSON = OpenAPI_ssc_modes_convertToJSON(dnn_configuration->ssc_modes); + if (ssc_modes_local_JSON == NULL) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [ssc_modes]"); + goto end; + } + cJSON_AddItemToObject(item, "sscModes", ssc_modes_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [ssc_modes]"); + goto end; + } + + if (dnn_configuration->iwk_eps_ind >= 0) { + if (cJSON_AddBoolToObject(item, "iwkEpsInd", dnn_configuration->iwk_eps_ind) == NULL) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [iwk_eps_ind]"); + goto end; + } + } + + if (dnn_configuration->_5g_qos_profile) { + cJSON *_5g_qos_profile_local_JSON = OpenAPI_subscribed_default_qos_convertToJSON(dnn_configuration->_5g_qos_profile); + if (_5g_qos_profile_local_JSON == NULL) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [_5g_qos_profile]"); + goto end; + } + cJSON_AddItemToObject(item, "5gQosProfile", _5g_qos_profile_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [_5g_qos_profile]"); + goto end; + } + } + + if (dnn_configuration->session_ambr) { + cJSON *session_ambr_local_JSON = OpenAPI_ambr_convertToJSON(dnn_configuration->session_ambr); + if (session_ambr_local_JSON == NULL) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [session_ambr]"); + goto end; + } + cJSON_AddItemToObject(item, "sessionAmbr", session_ambr_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [session_ambr]"); + goto end; + } + } + + if (dnn_configuration->_3gpp_charging_characteristics) { + if (cJSON_AddStringToObject(item, "3gppChargingCharacteristics", dnn_configuration->_3gpp_charging_characteristics) == NULL) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [_3gpp_charging_characteristics]"); + goto end; + } + } + + if (dnn_configuration->static_ip_address) { + cJSON *static_ip_addressList = cJSON_AddArrayToObject(item, "staticIpAddress"); + if (static_ip_addressList == NULL) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [static_ip_address]"); + goto end; + } + + OpenAPI_lnode_t *static_ip_address_node; + if (dnn_configuration->static_ip_address) { + OpenAPI_list_for_each(dnn_configuration->static_ip_address, static_ip_address_node) { + cJSON *itemLocal = OpenAPI_ip_address_convertToJSON(static_ip_address_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [static_ip_address]"); + goto end; + } + cJSON_AddItemToArray(static_ip_addressList, itemLocal); + } + } + } + + if (dnn_configuration->up_security) { + cJSON *up_security_local_JSON = OpenAPI_up_security_convertToJSON(dnn_configuration->up_security); + if (up_security_local_JSON == NULL) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [up_security]"); + goto end; + } + cJSON_AddItemToObject(item, "upSecurity", up_security_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [up_security]"); + goto end; + } + } + + if (dnn_configuration->pdu_session_continuity_ind) { + if (cJSON_AddStringToObject(item, "pduSessionContinuityInd", OpenAPI_pdu_session_continuity_ind_ToString(dnn_configuration->pdu_session_continuity_ind)) == NULL) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [pdu_session_continuity_ind]"); + goto end; + } + } + + if (dnn_configuration->invoke_nef_selection >= 0) { + 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]"); + goto end; + } + } + + if (dnn_configuration->nidd_info) { + cJSON *nidd_info_local_JSON = OpenAPI_nidd_information_convertToJSON(dnn_configuration->nidd_info); + if (nidd_info_local_JSON == NULL) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [nidd_info]"); + goto end; + } + cJSON_AddItemToObject(item, "niddInfo", nidd_info_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [nidd_info]"); + goto end; + } + } + + if (dnn_configuration->redundant_session_allowed >= 0) { + if (cJSON_AddBoolToObject(item, "redundantSessionAllowed", dnn_configuration->redundant_session_allowed) == NULL) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [redundant_session_allowed]"); + goto end; + } + } + + if (dnn_configuration->acs_info) { + cJSON *acs_info_local_JSON = OpenAPI_acs_info_convertToJSON(dnn_configuration->acs_info); + if (acs_info_local_JSON == NULL) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [acs_info]"); + goto end; + } + cJSON_AddItemToObject(item, "acsInfo", acs_info_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [acs_info]"); + goto end; + } + } + + if (dnn_configuration->ipv4_frame_route_list) { + cJSON *ipv4_frame_route_listList = cJSON_AddArrayToObject(item, "ipv4FrameRouteList"); + if (ipv4_frame_route_listList == NULL) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [ipv4_frame_route_list]"); + goto end; + } + + OpenAPI_lnode_t *ipv4_frame_route_list_node; + if (dnn_configuration->ipv4_frame_route_list) { + OpenAPI_list_for_each(dnn_configuration->ipv4_frame_route_list, ipv4_frame_route_list_node) { + cJSON *itemLocal = OpenAPI_frame_route_info_convertToJSON(ipv4_frame_route_list_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [ipv4_frame_route_list]"); + goto end; + } + cJSON_AddItemToArray(ipv4_frame_route_listList, itemLocal); + } + } + } + + if (dnn_configuration->ipv6_frame_route_list) { + cJSON *ipv6_frame_route_listList = cJSON_AddArrayToObject(item, "ipv6FrameRouteList"); + if (ipv6_frame_route_listList == NULL) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [ipv6_frame_route_list]"); + goto end; + } + + OpenAPI_lnode_t *ipv6_frame_route_list_node; + if (dnn_configuration->ipv6_frame_route_list) { + OpenAPI_list_for_each(dnn_configuration->ipv6_frame_route_list, ipv6_frame_route_list_node) { + cJSON *itemLocal = OpenAPI_frame_route_info_convertToJSON(ipv6_frame_route_list_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [ipv6_frame_route_list]"); + goto end; + } + cJSON_AddItemToArray(ipv6_frame_route_listList, itemLocal); + } + } + } + + if (dnn_configuration->atsss_allowed >= 0) { + if (cJSON_AddBoolToObject(item, "atsssAllowed", dnn_configuration->atsss_allowed) == NULL) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [atsss_allowed]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_parseFromJSON(cJSON *dnn_configurationJSON) +{ + OpenAPI_dnn_configuration_t *dnn_configuration_local_var = NULL; + cJSON *pdu_session_types = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "pduSessionTypes"); + if (!pdu_session_types) { + ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [pdu_session_types]"); + goto end; + } + + OpenAPI_pdu_session_types_t *pdu_session_types_local_nonprim = NULL; + + pdu_session_types_local_nonprim = OpenAPI_pdu_session_types_parseFromJSON(pdu_session_types); + + cJSON *ssc_modes = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "sscModes"); + if (!ssc_modes) { + ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [ssc_modes]"); + goto end; + } + + OpenAPI_ssc_modes_t *ssc_modes_local_nonprim = NULL; + + ssc_modes_local_nonprim = OpenAPI_ssc_modes_parseFromJSON(ssc_modes); + + cJSON *iwk_eps_ind = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "iwkEpsInd"); + + if (iwk_eps_ind) { + if (!cJSON_IsBool(iwk_eps_ind)) { + ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [iwk_eps_ind]"); + goto end; + } + } + + cJSON *_5g_qos_profile = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "5gQosProfile"); + + OpenAPI_subscribed_default_qos_t *_5g_qos_profile_local_nonprim = NULL; + if (_5g_qos_profile) { + _5g_qos_profile_local_nonprim = OpenAPI_subscribed_default_qos_parseFromJSON(_5g_qos_profile); + } + + cJSON *session_ambr = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "sessionAmbr"); + + OpenAPI_ambr_t *session_ambr_local_nonprim = NULL; + if (session_ambr) { + session_ambr_local_nonprim = OpenAPI_ambr_parseFromJSON(session_ambr); + } + + cJSON *_3gpp_charging_characteristics = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "3gppChargingCharacteristics"); + + if (_3gpp_charging_characteristics) { + if (!cJSON_IsString(_3gpp_charging_characteristics)) { + ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [_3gpp_charging_characteristics]"); + goto end; + } + } + + cJSON *static_ip_address = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "staticIpAddress"); + + OpenAPI_list_t *static_ip_addressList; + if (static_ip_address) { + cJSON *static_ip_address_local_nonprimitive; + if (!cJSON_IsArray(static_ip_address)) { + ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [static_ip_address]"); + goto end; + } + + static_ip_addressList = OpenAPI_list_create(); + + cJSON_ArrayForEach(static_ip_address_local_nonprimitive, static_ip_address ) { + if (!cJSON_IsObject(static_ip_address_local_nonprimitive)) { + ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [static_ip_address]"); + goto end; + } + OpenAPI_ip_address_t *static_ip_addressItem = OpenAPI_ip_address_parseFromJSON(static_ip_address_local_nonprimitive); + + OpenAPI_list_add(static_ip_addressList, static_ip_addressItem); + } + } + + cJSON *up_security = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "upSecurity"); + + OpenAPI_up_security_t *up_security_local_nonprim = NULL; + if (up_security) { + up_security_local_nonprim = OpenAPI_up_security_parseFromJSON(up_security); + } + + cJSON *pdu_session_continuity_ind = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "pduSessionContinuityInd"); + + OpenAPI_pdu_session_continuity_ind_e pdu_session_continuity_indVariable; + if (pdu_session_continuity_ind) { + if (!cJSON_IsString(pdu_session_continuity_ind)) { + ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [pdu_session_continuity_ind]"); + goto end; + } + 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) { + if (!cJSON_IsString(nidd_nef_id)) { + ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [nidd_nef_id]"); + goto end; + } + } + + cJSON *nidd_info = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "niddInfo"); + + OpenAPI_nidd_information_t *nidd_info_local_nonprim = NULL; + if (nidd_info) { + nidd_info_local_nonprim = OpenAPI_nidd_information_parseFromJSON(nidd_info); + } + + cJSON *redundant_session_allowed = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "redundantSessionAllowed"); + + if (redundant_session_allowed) { + if (!cJSON_IsBool(redundant_session_allowed)) { + ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [redundant_session_allowed]"); + goto end; + } + } + + cJSON *acs_info = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "acsInfo"); + + OpenAPI_acs_info_t *acs_info_local_nonprim = NULL; + if (acs_info) { + acs_info_local_nonprim = OpenAPI_acs_info_parseFromJSON(acs_info); + } + + cJSON *ipv4_frame_route_list = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "ipv4FrameRouteList"); + + OpenAPI_list_t *ipv4_frame_route_listList; + if (ipv4_frame_route_list) { + cJSON *ipv4_frame_route_list_local_nonprimitive; + if (!cJSON_IsArray(ipv4_frame_route_list)) { + ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [ipv4_frame_route_list]"); + goto end; + } + + ipv4_frame_route_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv4_frame_route_list_local_nonprimitive, ipv4_frame_route_list ) { + if (!cJSON_IsObject(ipv4_frame_route_list_local_nonprimitive)) { + ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [ipv4_frame_route_list]"); + goto end; + } + OpenAPI_frame_route_info_t *ipv4_frame_route_listItem = OpenAPI_frame_route_info_parseFromJSON(ipv4_frame_route_list_local_nonprimitive); + + OpenAPI_list_add(ipv4_frame_route_listList, ipv4_frame_route_listItem); + } + } + + cJSON *ipv6_frame_route_list = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "ipv6FrameRouteList"); + + OpenAPI_list_t *ipv6_frame_route_listList; + if (ipv6_frame_route_list) { + cJSON *ipv6_frame_route_list_local_nonprimitive; + if (!cJSON_IsArray(ipv6_frame_route_list)) { + ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [ipv6_frame_route_list]"); + goto end; + } + + ipv6_frame_route_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv6_frame_route_list_local_nonprimitive, ipv6_frame_route_list ) { + if (!cJSON_IsObject(ipv6_frame_route_list_local_nonprimitive)) { + ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [ipv6_frame_route_list]"); + goto end; + } + OpenAPI_frame_route_info_t *ipv6_frame_route_listItem = OpenAPI_frame_route_info_parseFromJSON(ipv6_frame_route_list_local_nonprimitive); + + OpenAPI_list_add(ipv6_frame_route_listList, ipv6_frame_route_listItem); + } + } + + cJSON *atsss_allowed = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "atsssAllowed"); + + if (atsss_allowed) { + if (!cJSON_IsBool(atsss_allowed)) { + ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [atsss_allowed]"); + goto end; + } + } + + dnn_configuration_local_var = OpenAPI_dnn_configuration_create ( + pdu_session_types_local_nonprim, + ssc_modes_local_nonprim, + iwk_eps_ind ? iwk_eps_ind->valueint : 0, + _5g_qos_profile ? _5g_qos_profile_local_nonprim : NULL, + session_ambr ? session_ambr_local_nonprim : NULL, + _3gpp_charging_characteristics ? ogs_strdup(_3gpp_charging_characteristics->valuestring) : NULL, + 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 + ); + + return dnn_configuration_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/dnn_configuration.h b/lib/sbi/openapi/model/dnn_configuration.h new file mode 100644 index 0000000000..c871b9e416 --- /dev/null +++ b/lib/sbi/openapi/model/dnn_configuration.h @@ -0,0 +1,79 @@ +/* + * dnn_configuration.h + * + * + */ + +#ifndef _OpenAPI_dnn_configuration_H_ +#define _OpenAPI_dnn_configuration_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "acs_info.h" +#include "ambr.h" +#include "frame_route_info.h" +#include "ip_address.h" +#include "nidd_information.h" +#include "pdu_session_continuity_ind.h" +#include "pdu_session_types.h" +#include "ssc_modes.h" +#include "subscribed_default_qos.h" +#include "up_security.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_dnn_configuration_s OpenAPI_dnn_configuration_t; +typedef struct OpenAPI_dnn_configuration_s { + struct OpenAPI_pdu_session_types_s *pdu_session_types; + struct OpenAPI_ssc_modes_s *ssc_modes; + int iwk_eps_ind; + struct OpenAPI_subscribed_default_qos_s *_5g_qos_profile; + struct OpenAPI_ambr_s *session_ambr; + char *_3gpp_charging_characteristics; + 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; + struct OpenAPI_acs_info_s *acs_info; + OpenAPI_list_t *ipv4_frame_route_list; + OpenAPI_list_t *ipv6_frame_route_list; + int atsss_allowed; +} OpenAPI_dnn_configuration_t; + +OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_create( + OpenAPI_pdu_session_types_t *pdu_session_types, + OpenAPI_ssc_modes_t *ssc_modes, + int iwk_eps_ind, + OpenAPI_subscribed_default_qos_t *_5g_qos_profile, + OpenAPI_ambr_t *session_ambr, + char *_3gpp_charging_characteristics, + 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 + ); +void OpenAPI_dnn_configuration_free(OpenAPI_dnn_configuration_t *dnn_configuration); +OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_parseFromJSON(cJSON *dnn_configurationJSON); +cJSON *OpenAPI_dnn_configuration_convertToJSON(OpenAPI_dnn_configuration_t *dnn_configuration); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_dnn_configuration_H_ */ + diff --git a/lib/sbi/openapi/model/dnn_info.c b/lib/sbi/openapi/model/dnn_info.c new file mode 100644 index 0000000000..4915276688 --- /dev/null +++ b/lib/sbi/openapi/model/dnn_info.c @@ -0,0 +1,152 @@ + +#include +#include +#include +#include "dnn_info.h" + +OpenAPI_dnn_info_t *OpenAPI_dnn_info_create( + char *dnn, + int default_dnn_indicator, + int lbo_roaming_allowed, + int iwk_eps_ind, + int dnn_barred + ) +{ + OpenAPI_dnn_info_t *dnn_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_dnn_info_t)); + if (!dnn_info_local_var) { + return NULL; + } + dnn_info_local_var->dnn = dnn; + dnn_info_local_var->default_dnn_indicator = default_dnn_indicator; + 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; + + return dnn_info_local_var; +} + +void OpenAPI_dnn_info_free(OpenAPI_dnn_info_t *dnn_info) +{ + if (NULL == dnn_info) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(dnn_info->dnn); + ogs_free(dnn_info); +} + +cJSON *OpenAPI_dnn_info_convertToJSON(OpenAPI_dnn_info_t *dnn_info) +{ + cJSON *item = NULL; + + if (dnn_info == NULL) { + ogs_error("OpenAPI_dnn_info_convertToJSON() failed [DnnInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!dnn_info->dnn) { + ogs_error("OpenAPI_dnn_info_convertToJSON() failed [dnn]"); + goto end; + } + if (cJSON_AddStringToObject(item, "dnn", dnn_info->dnn) == NULL) { + ogs_error("OpenAPI_dnn_info_convertToJSON() failed [dnn]"); + goto end; + } + + if (dnn_info->default_dnn_indicator >= 0) { + if (cJSON_AddBoolToObject(item, "defaultDnnIndicator", dnn_info->default_dnn_indicator) == NULL) { + ogs_error("OpenAPI_dnn_info_convertToJSON() failed [default_dnn_indicator]"); + goto end; + } + } + + if (dnn_info->lbo_roaming_allowed >= 0) { + if (cJSON_AddBoolToObject(item, "lboRoamingAllowed", dnn_info->lbo_roaming_allowed) == NULL) { + ogs_error("OpenAPI_dnn_info_convertToJSON() failed [lbo_roaming_allowed]"); + goto end; + } + } + + if (dnn_info->iwk_eps_ind >= 0) { + if (cJSON_AddBoolToObject(item, "iwkEpsInd", dnn_info->iwk_eps_ind) == NULL) { + ogs_error("OpenAPI_dnn_info_convertToJSON() failed [iwk_eps_ind]"); + goto end; + } + } + + if (dnn_info->dnn_barred >= 0) { + if (cJSON_AddBoolToObject(item, "dnnBarred", dnn_info->dnn_barred) == NULL) { + ogs_error("OpenAPI_dnn_info_convertToJSON() failed [dnn_barred]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_dnn_info_t *OpenAPI_dnn_info_parseFromJSON(cJSON *dnn_infoJSON) +{ + OpenAPI_dnn_info_t *dnn_info_local_var = NULL; + cJSON *dnn = cJSON_GetObjectItemCaseSensitive(dnn_infoJSON, "dnn"); + if (!dnn) { + ogs_error("OpenAPI_dnn_info_parseFromJSON() failed [dnn]"); + goto end; + } + + + if (!cJSON_IsString(dnn)) { + ogs_error("OpenAPI_dnn_info_parseFromJSON() failed [dnn]"); + goto end; + } + + cJSON *default_dnn_indicator = cJSON_GetObjectItemCaseSensitive(dnn_infoJSON, "defaultDnnIndicator"); + + if (default_dnn_indicator) { + if (!cJSON_IsBool(default_dnn_indicator)) { + ogs_error("OpenAPI_dnn_info_parseFromJSON() failed [default_dnn_indicator]"); + goto end; + } + } + + cJSON *lbo_roaming_allowed = cJSON_GetObjectItemCaseSensitive(dnn_infoJSON, "lboRoamingAllowed"); + + if (lbo_roaming_allowed) { + if (!cJSON_IsBool(lbo_roaming_allowed)) { + ogs_error("OpenAPI_dnn_info_parseFromJSON() failed [lbo_roaming_allowed]"); + goto end; + } + } + + cJSON *iwk_eps_ind = cJSON_GetObjectItemCaseSensitive(dnn_infoJSON, "iwkEpsInd"); + + if (iwk_eps_ind) { + if (!cJSON_IsBool(iwk_eps_ind)) { + ogs_error("OpenAPI_dnn_info_parseFromJSON() failed [iwk_eps_ind]"); + goto end; + } + } + + cJSON *dnn_barred = cJSON_GetObjectItemCaseSensitive(dnn_infoJSON, "dnnBarred"); + + if (dnn_barred) { + if (!cJSON_IsBool(dnn_barred)) { + ogs_error("OpenAPI_dnn_info_parseFromJSON() failed [dnn_barred]"); + 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 + ); + + return dnn_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/dnn_info.h b/lib/sbi/openapi/model/dnn_info.h new file mode 100644 index 0000000000..b3523ad0fe --- /dev/null +++ b/lib/sbi/openapi/model/dnn_info.h @@ -0,0 +1,45 @@ +/* + * dnn_info.h + * + * + */ + +#ifndef _OpenAPI_dnn_info_H_ +#define _OpenAPI_dnn_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_dnn_info_s OpenAPI_dnn_info_t; +typedef struct OpenAPI_dnn_info_s { + char *dnn; + int default_dnn_indicator; + int lbo_roaming_allowed; + int iwk_eps_ind; + int dnn_barred; +} OpenAPI_dnn_info_t; + +OpenAPI_dnn_info_t *OpenAPI_dnn_info_create( + char *dnn, + int default_dnn_indicator, + int lbo_roaming_allowed, + int iwk_eps_ind, + int dnn_barred + ); +void OpenAPI_dnn_info_free(OpenAPI_dnn_info_t *dnn_info); +OpenAPI_dnn_info_t *OpenAPI_dnn_info_parseFromJSON(cJSON *dnn_infoJSON); +cJSON *OpenAPI_dnn_info_convertToJSON(OpenAPI_dnn_info_t *dnn_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_dnn_info_H_ */ + diff --git a/lib/sbi/openapi/model/dnn_route_selection_descriptor.c b/lib/sbi/openapi/model/dnn_route_selection_descriptor.c new file mode 100644 index 0000000000..33c05cb31a --- /dev/null +++ b/lib/sbi/openapi/model/dnn_route_selection_descriptor.c @@ -0,0 +1,176 @@ + +#include +#include +#include +#include "dnn_route_selection_descriptor.h" + +OpenAPI_dnn_route_selection_descriptor_t *OpenAPI_dnn_route_selection_descriptor_create( + char *dnn, + OpenAPI_list_t *ssc_modes, + OpenAPI_list_t *pdu_sess_types + ) +{ + OpenAPI_dnn_route_selection_descriptor_t *dnn_route_selection_descriptor_local_var = OpenAPI_malloc(sizeof(OpenAPI_dnn_route_selection_descriptor_t)); + if (!dnn_route_selection_descriptor_local_var) { + return NULL; + } + dnn_route_selection_descriptor_local_var->dnn = dnn; + dnn_route_selection_descriptor_local_var->ssc_modes = ssc_modes; + dnn_route_selection_descriptor_local_var->pdu_sess_types = pdu_sess_types; + + return dnn_route_selection_descriptor_local_var; +} + +void OpenAPI_dnn_route_selection_descriptor_free(OpenAPI_dnn_route_selection_descriptor_t *dnn_route_selection_descriptor) +{ + if (NULL == dnn_route_selection_descriptor) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(dnn_route_selection_descriptor->dnn); + OpenAPI_list_for_each(dnn_route_selection_descriptor->ssc_modes, node) { + OpenAPI_ssc_mode_free(node->data); + } + OpenAPI_list_free(dnn_route_selection_descriptor->ssc_modes); + OpenAPI_list_for_each(dnn_route_selection_descriptor->pdu_sess_types, node) { + OpenAPI_pdu_session_type_free(node->data); + } + OpenAPI_list_free(dnn_route_selection_descriptor->pdu_sess_types); + ogs_free(dnn_route_selection_descriptor); +} + +cJSON *OpenAPI_dnn_route_selection_descriptor_convertToJSON(OpenAPI_dnn_route_selection_descriptor_t *dnn_route_selection_descriptor) +{ + cJSON *item = NULL; + + if (dnn_route_selection_descriptor == NULL) { + ogs_error("OpenAPI_dnn_route_selection_descriptor_convertToJSON() failed [DnnRouteSelectionDescriptor]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!dnn_route_selection_descriptor->dnn) { + ogs_error("OpenAPI_dnn_route_selection_descriptor_convertToJSON() failed [dnn]"); + goto end; + } + if (cJSON_AddStringToObject(item, "dnn", dnn_route_selection_descriptor->dnn) == NULL) { + ogs_error("OpenAPI_dnn_route_selection_descriptor_convertToJSON() failed [dnn]"); + goto end; + } + + if (dnn_route_selection_descriptor->ssc_modes) { + cJSON *ssc_modesList = cJSON_AddArrayToObject(item, "sscModes"); + if (ssc_modesList == NULL) { + ogs_error("OpenAPI_dnn_route_selection_descriptor_convertToJSON() failed [ssc_modes]"); + goto end; + } + + OpenAPI_lnode_t *ssc_modes_node; + if (dnn_route_selection_descriptor->ssc_modes) { + OpenAPI_list_for_each(dnn_route_selection_descriptor->ssc_modes, ssc_modes_node) { + cJSON *itemLocal = OpenAPI_ssc_mode_convertToJSON(ssc_modes_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_dnn_route_selection_descriptor_convertToJSON() failed [ssc_modes]"); + goto end; + } + cJSON_AddItemToArray(ssc_modesList, itemLocal); + } + } + } + + if (dnn_route_selection_descriptor->pdu_sess_types) { + cJSON *pdu_sess_typesList = cJSON_AddArrayToObject(item, "pduSessTypes"); + if (pdu_sess_typesList == NULL) { + ogs_error("OpenAPI_dnn_route_selection_descriptor_convertToJSON() failed [pdu_sess_types]"); + goto end; + } + + OpenAPI_lnode_t *pdu_sess_types_node; + if (dnn_route_selection_descriptor->pdu_sess_types) { + OpenAPI_list_for_each(dnn_route_selection_descriptor->pdu_sess_types, pdu_sess_types_node) { + cJSON *itemLocal = OpenAPI_pdu_session_type_convertToJSON(pdu_sess_types_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_dnn_route_selection_descriptor_convertToJSON() failed [pdu_sess_types]"); + goto end; + } + cJSON_AddItemToArray(pdu_sess_typesList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_dnn_route_selection_descriptor_t *OpenAPI_dnn_route_selection_descriptor_parseFromJSON(cJSON *dnn_route_selection_descriptorJSON) +{ + OpenAPI_dnn_route_selection_descriptor_t *dnn_route_selection_descriptor_local_var = NULL; + cJSON *dnn = cJSON_GetObjectItemCaseSensitive(dnn_route_selection_descriptorJSON, "dnn"); + if (!dnn) { + ogs_error("OpenAPI_dnn_route_selection_descriptor_parseFromJSON() failed [dnn]"); + goto end; + } + + + if (!cJSON_IsString(dnn)) { + ogs_error("OpenAPI_dnn_route_selection_descriptor_parseFromJSON() failed [dnn]"); + goto end; + } + + cJSON *ssc_modes = cJSON_GetObjectItemCaseSensitive(dnn_route_selection_descriptorJSON, "sscModes"); + + OpenAPI_list_t *ssc_modesList; + if (ssc_modes) { + cJSON *ssc_modes_local_nonprimitive; + if (!cJSON_IsArray(ssc_modes)) { + ogs_error("OpenAPI_dnn_route_selection_descriptor_parseFromJSON() failed [ssc_modes]"); + goto end; + } + + ssc_modesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ssc_modes_local_nonprimitive, ssc_modes ) { + if (!cJSON_IsObject(ssc_modes_local_nonprimitive)) { + ogs_error("OpenAPI_dnn_route_selection_descriptor_parseFromJSON() failed [ssc_modes]"); + goto end; + } + OpenAPI_ssc_mode_t *ssc_modesItem = OpenAPI_ssc_mode_parseFromJSON(ssc_modes_local_nonprimitive); + + OpenAPI_list_add(ssc_modesList, ssc_modesItem); + } + } + + cJSON *pdu_sess_types = cJSON_GetObjectItemCaseSensitive(dnn_route_selection_descriptorJSON, "pduSessTypes"); + + OpenAPI_list_t *pdu_sess_typesList; + if (pdu_sess_types) { + cJSON *pdu_sess_types_local_nonprimitive; + if (!cJSON_IsArray(pdu_sess_types)) { + ogs_error("OpenAPI_dnn_route_selection_descriptor_parseFromJSON() failed [pdu_sess_types]"); + goto end; + } + + pdu_sess_typesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pdu_sess_types_local_nonprimitive, pdu_sess_types ) { + if (!cJSON_IsObject(pdu_sess_types_local_nonprimitive)) { + ogs_error("OpenAPI_dnn_route_selection_descriptor_parseFromJSON() failed [pdu_sess_types]"); + goto end; + } + OpenAPI_pdu_session_type_t *pdu_sess_typesItem = OpenAPI_pdu_session_type_parseFromJSON(pdu_sess_types_local_nonprimitive); + + OpenAPI_list_add(pdu_sess_typesList, pdu_sess_typesItem); + } + } + + dnn_route_selection_descriptor_local_var = OpenAPI_dnn_route_selection_descriptor_create ( + ogs_strdup(dnn->valuestring), + ssc_modes ? ssc_modesList : NULL, + pdu_sess_types ? pdu_sess_typesList : NULL + ); + + return dnn_route_selection_descriptor_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/dnn_route_selection_descriptor.h b/lib/sbi/openapi/model/dnn_route_selection_descriptor.h new file mode 100644 index 0000000000..a307bdbf95 --- /dev/null +++ b/lib/sbi/openapi/model/dnn_route_selection_descriptor.h @@ -0,0 +1,43 @@ +/* + * dnn_route_selection_descriptor.h + * + * Contains the route selector parameters (PDU session types and SSC modes) per DNN + */ + +#ifndef _OpenAPI_dnn_route_selection_descriptor_H_ +#define _OpenAPI_dnn_route_selection_descriptor_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "pdu_session_type.h" +#include "ssc_mode.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_dnn_route_selection_descriptor_s OpenAPI_dnn_route_selection_descriptor_t; +typedef struct OpenAPI_dnn_route_selection_descriptor_s { + char *dnn; + OpenAPI_list_t *ssc_modes; + OpenAPI_list_t *pdu_sess_types; +} OpenAPI_dnn_route_selection_descriptor_t; + +OpenAPI_dnn_route_selection_descriptor_t *OpenAPI_dnn_route_selection_descriptor_create( + char *dnn, + OpenAPI_list_t *ssc_modes, + OpenAPI_list_t *pdu_sess_types + ); +void OpenAPI_dnn_route_selection_descriptor_free(OpenAPI_dnn_route_selection_descriptor_t *dnn_route_selection_descriptor); +OpenAPI_dnn_route_selection_descriptor_t *OpenAPI_dnn_route_selection_descriptor_parseFromJSON(cJSON *dnn_route_selection_descriptorJSON); +cJSON *OpenAPI_dnn_route_selection_descriptor_convertToJSON(OpenAPI_dnn_route_selection_descriptor_t *dnn_route_selection_descriptor); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_dnn_route_selection_descriptor_H_ */ + diff --git a/lib/sbi/openapi/model/dnn_smf_info_item.h b/lib/sbi/openapi/model/dnn_smf_info_item.h index 9c36b78593..95e69546db 100644 --- a/lib/sbi/openapi/model/dnn_smf_info_item.h +++ b/lib/sbi/openapi/model/dnn_smf_info_item.h @@ -1,7 +1,7 @@ /* * dnn_smf_info_item.h * - * + * Set of parameters supported by SMF for a given DNN */ #ifndef _OpenAPI_dnn_smf_info_item_H_ diff --git a/lib/sbi/openapi/model/dnn_upf_info_item.c b/lib/sbi/openapi/model/dnn_upf_info_item.c index c31b62bd35..5dd47820f6 100644 --- a/lib/sbi/openapi/model/dnn_upf_info_item.c +++ b/lib/sbi/openapi/model/dnn_upf_info_item.c @@ -7,7 +7,9 @@ OpenAPI_dnn_upf_info_item_t *OpenAPI_dnn_upf_info_item_create( char *dnn, OpenAPI_list_t *dnai_list, - OpenAPI_list_t *pdu_session_types + OpenAPI_list_t *pdu_session_types, + OpenAPI_list_t *ipv4_address_ranges, + OpenAPI_list_t *ipv6_prefix_ranges ) { OpenAPI_dnn_upf_info_item_t *dnn_upf_info_item_local_var = OpenAPI_malloc(sizeof(OpenAPI_dnn_upf_info_item_t)); @@ -17,6 +19,8 @@ OpenAPI_dnn_upf_info_item_t *OpenAPI_dnn_upf_info_item_create( dnn_upf_info_item_local_var->dnn = dnn; dnn_upf_info_item_local_var->dnai_list = dnai_list; dnn_upf_info_item_local_var->pdu_session_types = pdu_session_types; + dnn_upf_info_item_local_var->ipv4_address_ranges = ipv4_address_ranges; + dnn_upf_info_item_local_var->ipv6_prefix_ranges = ipv6_prefix_ranges; return dnn_upf_info_item_local_var; } @@ -36,6 +40,14 @@ void OpenAPI_dnn_upf_info_item_free(OpenAPI_dnn_upf_info_item_t *dnn_upf_info_it OpenAPI_pdu_session_type_free(node->data); } OpenAPI_list_free(dnn_upf_info_item->pdu_session_types); + OpenAPI_list_for_each(dnn_upf_info_item->ipv4_address_ranges, node) { + OpenAPI_ipv4_address_range_free(node->data); + } + OpenAPI_list_free(dnn_upf_info_item->ipv4_address_ranges); + OpenAPI_list_for_each(dnn_upf_info_item->ipv6_prefix_ranges, node) { + OpenAPI_ipv6_prefix_range_free(node->data); + } + OpenAPI_list_free(dnn_upf_info_item->ipv6_prefix_ranges); ogs_free(dnn_upf_info_item); } @@ -94,6 +106,46 @@ cJSON *OpenAPI_dnn_upf_info_item_convertToJSON(OpenAPI_dnn_upf_info_item_t *dnn_ } } + if (dnn_upf_info_item->ipv4_address_ranges) { + cJSON *ipv4_address_rangesList = cJSON_AddArrayToObject(item, "ipv4AddressRanges"); + if (ipv4_address_rangesList == NULL) { + ogs_error("OpenAPI_dnn_upf_info_item_convertToJSON() failed [ipv4_address_ranges]"); + goto end; + } + + OpenAPI_lnode_t *ipv4_address_ranges_node; + if (dnn_upf_info_item->ipv4_address_ranges) { + OpenAPI_list_for_each(dnn_upf_info_item->ipv4_address_ranges, ipv4_address_ranges_node) { + cJSON *itemLocal = OpenAPI_ipv4_address_range_convertToJSON(ipv4_address_ranges_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_dnn_upf_info_item_convertToJSON() failed [ipv4_address_ranges]"); + goto end; + } + cJSON_AddItemToArray(ipv4_address_rangesList, itemLocal); + } + } + } + + if (dnn_upf_info_item->ipv6_prefix_ranges) { + cJSON *ipv6_prefix_rangesList = cJSON_AddArrayToObject(item, "ipv6PrefixRanges"); + if (ipv6_prefix_rangesList == NULL) { + ogs_error("OpenAPI_dnn_upf_info_item_convertToJSON() failed [ipv6_prefix_ranges]"); + goto end; + } + + OpenAPI_lnode_t *ipv6_prefix_ranges_node; + if (dnn_upf_info_item->ipv6_prefix_ranges) { + OpenAPI_list_for_each(dnn_upf_info_item->ipv6_prefix_ranges, ipv6_prefix_ranges_node) { + cJSON *itemLocal = OpenAPI_ipv6_prefix_range_convertToJSON(ipv6_prefix_ranges_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_dnn_upf_info_item_convertToJSON() failed [ipv6_prefix_ranges]"); + goto end; + } + cJSON_AddItemToArray(ipv6_prefix_rangesList, itemLocal); + } + } + } + end: return item; } @@ -156,10 +208,58 @@ OpenAPI_dnn_upf_info_item_t *OpenAPI_dnn_upf_info_item_parseFromJSON(cJSON *dnn_ } } + cJSON *ipv4_address_ranges = cJSON_GetObjectItemCaseSensitive(dnn_upf_info_itemJSON, "ipv4AddressRanges"); + + OpenAPI_list_t *ipv4_address_rangesList; + if (ipv4_address_ranges) { + cJSON *ipv4_address_ranges_local_nonprimitive; + if (!cJSON_IsArray(ipv4_address_ranges)) { + ogs_error("OpenAPI_dnn_upf_info_item_parseFromJSON() failed [ipv4_address_ranges]"); + goto end; + } + + ipv4_address_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv4_address_ranges_local_nonprimitive, ipv4_address_ranges ) { + if (!cJSON_IsObject(ipv4_address_ranges_local_nonprimitive)) { + ogs_error("OpenAPI_dnn_upf_info_item_parseFromJSON() failed [ipv4_address_ranges]"); + goto end; + } + OpenAPI_ipv4_address_range_t *ipv4_address_rangesItem = OpenAPI_ipv4_address_range_parseFromJSON(ipv4_address_ranges_local_nonprimitive); + + OpenAPI_list_add(ipv4_address_rangesList, ipv4_address_rangesItem); + } + } + + cJSON *ipv6_prefix_ranges = cJSON_GetObjectItemCaseSensitive(dnn_upf_info_itemJSON, "ipv6PrefixRanges"); + + OpenAPI_list_t *ipv6_prefix_rangesList; + if (ipv6_prefix_ranges) { + cJSON *ipv6_prefix_ranges_local_nonprimitive; + if (!cJSON_IsArray(ipv6_prefix_ranges)) { + ogs_error("OpenAPI_dnn_upf_info_item_parseFromJSON() failed [ipv6_prefix_ranges]"); + goto end; + } + + ipv6_prefix_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv6_prefix_ranges_local_nonprimitive, ipv6_prefix_ranges ) { + if (!cJSON_IsObject(ipv6_prefix_ranges_local_nonprimitive)) { + ogs_error("OpenAPI_dnn_upf_info_item_parseFromJSON() failed [ipv6_prefix_ranges]"); + goto end; + } + OpenAPI_ipv6_prefix_range_t *ipv6_prefix_rangesItem = OpenAPI_ipv6_prefix_range_parseFromJSON(ipv6_prefix_ranges_local_nonprimitive); + + OpenAPI_list_add(ipv6_prefix_rangesList, ipv6_prefix_rangesItem); + } + } + dnn_upf_info_item_local_var = OpenAPI_dnn_upf_info_item_create ( ogs_strdup(dnn->valuestring), dnai_list ? dnai_listList : NULL, - pdu_session_types ? pdu_session_typesList : NULL + pdu_session_types ? pdu_session_typesList : NULL, + ipv4_address_ranges ? ipv4_address_rangesList : NULL, + ipv6_prefix_ranges ? ipv6_prefix_rangesList : NULL ); return dnn_upf_info_item_local_var; diff --git a/lib/sbi/openapi/model/dnn_upf_info_item.h b/lib/sbi/openapi/model/dnn_upf_info_item.h index f09e1fa34b..756ae68cf2 100644 --- a/lib/sbi/openapi/model/dnn_upf_info_item.h +++ b/lib/sbi/openapi/model/dnn_upf_info_item.h @@ -1,7 +1,7 @@ /* * dnn_upf_info_item.h * - * + * Set of parameters supported by UPF for a given DNN */ #ifndef _OpenAPI_dnn_upf_info_item_H_ @@ -12,6 +12,8 @@ #include "../include/list.h" #include "../include/keyValuePair.h" #include "../include/binary.h" +#include "ipv4_address_range.h" +#include "ipv6_prefix_range.h" #include "pdu_session_type.h" #ifdef __cplusplus @@ -23,12 +25,16 @@ typedef struct OpenAPI_dnn_upf_info_item_s { char *dnn; OpenAPI_list_t *dnai_list; OpenAPI_list_t *pdu_session_types; + OpenAPI_list_t *ipv4_address_ranges; + OpenAPI_list_t *ipv6_prefix_ranges; } OpenAPI_dnn_upf_info_item_t; OpenAPI_dnn_upf_info_item_t *OpenAPI_dnn_upf_info_item_create( char *dnn, OpenAPI_list_t *dnai_list, - OpenAPI_list_t *pdu_session_types + OpenAPI_list_t *pdu_session_types, + OpenAPI_list_t *ipv4_address_ranges, + OpenAPI_list_t *ipv6_prefix_ranges ); void OpenAPI_dnn_upf_info_item_free(OpenAPI_dnn_upf_info_item_t *dnn_upf_info_item); OpenAPI_dnn_upf_info_item_t *OpenAPI_dnn_upf_info_item_parseFromJSON(cJSON *dnn_upf_info_itemJSON); diff --git a/lib/sbi/openapi/model/domain_name_protocol.c b/lib/sbi/openapi/model/domain_name_protocol.c new file mode 100644 index 0000000000..d7e322449f --- /dev/null +++ b/lib/sbi/openapi/model/domain_name_protocol.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "domain_name_protocol.h" + +OpenAPI_domain_name_protocol_t *OpenAPI_domain_name_protocol_create( + ) +{ + OpenAPI_domain_name_protocol_t *domain_name_protocol_local_var = OpenAPI_malloc(sizeof(OpenAPI_domain_name_protocol_t)); + if (!domain_name_protocol_local_var) { + return NULL; + } + + return domain_name_protocol_local_var; +} + +void OpenAPI_domain_name_protocol_free(OpenAPI_domain_name_protocol_t *domain_name_protocol) +{ + if (NULL == domain_name_protocol) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(domain_name_protocol); +} + +cJSON *OpenAPI_domain_name_protocol_convertToJSON(OpenAPI_domain_name_protocol_t *domain_name_protocol) +{ + cJSON *item = NULL; + + if (domain_name_protocol == NULL) { + ogs_error("OpenAPI_domain_name_protocol_convertToJSON() failed [DomainNameProtocol]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_domain_name_protocol_t *OpenAPI_domain_name_protocol_parseFromJSON(cJSON *domain_name_protocolJSON) +{ + OpenAPI_domain_name_protocol_t *domain_name_protocol_local_var = NULL; + domain_name_protocol_local_var = OpenAPI_domain_name_protocol_create ( + ); + + return domain_name_protocol_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/domain_name_protocol.h b/lib/sbi/openapi/model/domain_name_protocol.h new file mode 100644 index 0000000000..1d0d7f53c2 --- /dev/null +++ b/lib/sbi/openapi/model/domain_name_protocol.h @@ -0,0 +1,35 @@ +/* + * domain_name_protocol.h + * + * Possible values are - DNS_QNAME: Identifies the DNS protocol and the question name in DNS query. - TLS_SNI: Identifies the Server Name Indication in TLS ClientHello message. - TLS_SAN: Identifies the Subject Alternative Name in TLS ServerCertificate message. - TLS_SCN: Identifies the Subject Common Name in TLS ServerCertificate message. + */ + +#ifndef _OpenAPI_domain_name_protocol_H_ +#define _OpenAPI_domain_name_protocol_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_domain_name_protocol_s OpenAPI_domain_name_protocol_t; +typedef struct OpenAPI_domain_name_protocol_s { +} OpenAPI_domain_name_protocol_t; + +OpenAPI_domain_name_protocol_t *OpenAPI_domain_name_protocol_create( + ); +void OpenAPI_domain_name_protocol_free(OpenAPI_domain_name_protocol_t *domain_name_protocol); +OpenAPI_domain_name_protocol_t *OpenAPI_domain_name_protocol_parseFromJSON(cJSON *domain_name_protocolJSON); +cJSON *OpenAPI_domain_name_protocol_convertToJSON(OpenAPI_domain_name_protocol_t *domain_name_protocol); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_domain_name_protocol_H_ */ + diff --git a/lib/sbi/openapi/model/eap_session.c b/lib/sbi/openapi/model/eap_session.c new file mode 100644 index 0000000000..c5c162bb54 --- /dev/null +++ b/lib/sbi/openapi/model/eap_session.c @@ -0,0 +1,190 @@ + +#include +#include +#include +#include "eap_session.h" + +OpenAPI_eap_session_t *OpenAPI_eap_session_create( + char *eap_payload, + char *k_seaf, + OpenAPI_list_t* _links, + OpenAPI_auth_result_e auth_result, + char *supi + ) +{ + OpenAPI_eap_session_t *eap_session_local_var = OpenAPI_malloc(sizeof(OpenAPI_eap_session_t)); + if (!eap_session_local_var) { + return NULL; + } + eap_session_local_var->eap_payload = eap_payload; + eap_session_local_var->k_seaf = k_seaf; + eap_session_local_var->_links = _links; + eap_session_local_var->auth_result = auth_result; + eap_session_local_var->supi = supi; + + return eap_session_local_var; +} + +void OpenAPI_eap_session_free(OpenAPI_eap_session_t *eap_session) +{ + if (NULL == eap_session) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(eap_session->eap_payload); + ogs_free(eap_session->k_seaf); + OpenAPI_list_for_each(eap_session->_links, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_links_value_schema_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(eap_session->_links); + ogs_free(eap_session->supi); + ogs_free(eap_session); +} + +cJSON *OpenAPI_eap_session_convertToJSON(OpenAPI_eap_session_t *eap_session) +{ + cJSON *item = NULL; + + if (eap_session == NULL) { + ogs_error("OpenAPI_eap_session_convertToJSON() failed [EapSession]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!eap_session->eap_payload) { + ogs_error("OpenAPI_eap_session_convertToJSON() failed [eap_payload]"); + goto end; + } + if (cJSON_AddStringToObject(item, "eapPayload", eap_session->eap_payload) == NULL) { + ogs_error("OpenAPI_eap_session_convertToJSON() failed [eap_payload]"); + goto end; + } + + if (eap_session->k_seaf) { + if (cJSON_AddStringToObject(item, "kSeaf", eap_session->k_seaf) == NULL) { + ogs_error("OpenAPI_eap_session_convertToJSON() failed [k_seaf]"); + goto end; + } + } + + if (eap_session->_links) { + cJSON *_links = cJSON_AddObjectToObject(item, "_links"); + if (_links == NULL) { + ogs_error("OpenAPI_eap_session_convertToJSON() failed [_links]"); + goto end; + } + cJSON *localMapObject = _links; + OpenAPI_lnode_t *_links_node; + if (eap_session->_links) { + OpenAPI_list_for_each(eap_session->_links, _links_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)_links_node->data; + cJSON *itemLocal = OpenAPI_links_value_schema_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_eap_session_convertToJSON() failed [_links]"); + goto end; + } + cJSON_AddItemToObject(_links, localKeyValue->key, itemLocal); + } + } + } + + if (eap_session->auth_result) { + if (cJSON_AddStringToObject(item, "authResult", OpenAPI_auth_result_ToString(eap_session->auth_result)) == NULL) { + ogs_error("OpenAPI_eap_session_convertToJSON() failed [auth_result]"); + goto end; + } + } + + if (eap_session->supi) { + if (cJSON_AddStringToObject(item, "supi", eap_session->supi) == NULL) { + ogs_error("OpenAPI_eap_session_convertToJSON() failed [supi]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_eap_session_t *OpenAPI_eap_session_parseFromJSON(cJSON *eap_sessionJSON) +{ + OpenAPI_eap_session_t *eap_session_local_var = NULL; + cJSON *eap_payload = cJSON_GetObjectItemCaseSensitive(eap_sessionJSON, "eapPayload"); + if (!eap_payload) { + ogs_error("OpenAPI_eap_session_parseFromJSON() failed [eap_payload]"); + goto end; + } + + + if (!cJSON_IsString(eap_payload)) { + ogs_error("OpenAPI_eap_session_parseFromJSON() failed [eap_payload]"); + goto end; + } + + cJSON *k_seaf = cJSON_GetObjectItemCaseSensitive(eap_sessionJSON, "kSeaf"); + + if (k_seaf) { + if (!cJSON_IsString(k_seaf)) { + ogs_error("OpenAPI_eap_session_parseFromJSON() failed [k_seaf]"); + goto end; + } + } + + cJSON *_links = cJSON_GetObjectItemCaseSensitive(eap_sessionJSON, "_links"); + + OpenAPI_list_t *_linksList; + if (_links) { + cJSON *_links_local_map; + if (!cJSON_IsObject(_links)) { + ogs_error("OpenAPI_eap_session_parseFromJSON() failed [_links]"); + goto end; + } + _linksList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(_links_local_map, _links) { + cJSON *localMapObject = _links_local_map; + if (!cJSON_IsObject(_links_local_map)) { + ogs_error("OpenAPI_eap_session_parseFromJSON() failed [_links]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_links_value_schema_parseFromJSON(localMapObject)); + OpenAPI_list_add(_linksList, localMapKeyPair); + } + } + + cJSON *auth_result = cJSON_GetObjectItemCaseSensitive(eap_sessionJSON, "authResult"); + + OpenAPI_auth_result_e auth_resultVariable; + if (auth_result) { + if (!cJSON_IsString(auth_result)) { + ogs_error("OpenAPI_eap_session_parseFromJSON() failed [auth_result]"); + goto end; + } + auth_resultVariable = OpenAPI_auth_result_FromString(auth_result->valuestring); + } + + cJSON *supi = cJSON_GetObjectItemCaseSensitive(eap_sessionJSON, "supi"); + + if (supi) { + if (!cJSON_IsString(supi)) { + ogs_error("OpenAPI_eap_session_parseFromJSON() failed [supi]"); + goto end; + } + } + + eap_session_local_var = OpenAPI_eap_session_create ( + ogs_strdup(eap_payload->valuestring), + k_seaf ? ogs_strdup(k_seaf->valuestring) : NULL, + _links ? _linksList : NULL, + auth_result ? auth_resultVariable : 0, + supi ? ogs_strdup(supi->valuestring) : NULL + ); + + return eap_session_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/eap_session.h b/lib/sbi/openapi/model/eap_session.h new file mode 100644 index 0000000000..24e49dd16f --- /dev/null +++ b/lib/sbi/openapi/model/eap_session.h @@ -0,0 +1,47 @@ +/* + * eap_session.h + * + * + */ + +#ifndef _OpenAPI_eap_session_H_ +#define _OpenAPI_eap_session_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "auth_result.h" +#include "links_value_schema.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_eap_session_s OpenAPI_eap_session_t; +typedef struct OpenAPI_eap_session_s { + char *eap_payload; + char *k_seaf; + OpenAPI_list_t* _links; + OpenAPI_auth_result_e auth_result; + char *supi; +} OpenAPI_eap_session_t; + +OpenAPI_eap_session_t *OpenAPI_eap_session_create( + char *eap_payload, + char *k_seaf, + OpenAPI_list_t* _links, + OpenAPI_auth_result_e auth_result, + char *supi + ); +void OpenAPI_eap_session_free(OpenAPI_eap_session_t *eap_session); +OpenAPI_eap_session_t *OpenAPI_eap_session_parseFromJSON(cJSON *eap_sessionJSON); +cJSON *OpenAPI_eap_session_convertToJSON(OpenAPI_eap_session_t *eap_session); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_eap_session_H_ */ + diff --git a/lib/sbi/openapi/model/ec_restriction.c b/lib/sbi/openapi/model/ec_restriction.c new file mode 100644 index 0000000000..17574f9e0e --- /dev/null +++ b/lib/sbi/openapi/model/ec_restriction.c @@ -0,0 +1,150 @@ + +#include +#include +#include +#include "ec_restriction.h" + +OpenAPI_ec_restriction_t *OpenAPI_ec_restriction_create( + char *af_instance_id, + int reference_id, + OpenAPI_list_t *plmn_ec_infos + ) +{ + OpenAPI_ec_restriction_t *ec_restriction_local_var = OpenAPI_malloc(sizeof(OpenAPI_ec_restriction_t)); + if (!ec_restriction_local_var) { + return NULL; + } + 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; + + return ec_restriction_local_var; +} + +void OpenAPI_ec_restriction_free(OpenAPI_ec_restriction_t *ec_restriction) +{ + if (NULL == ec_restriction) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(ec_restriction->af_instance_id); + OpenAPI_list_for_each(ec_restriction->plmn_ec_infos, node) { + OpenAPI_plmn_ec_info_free(node->data); + } + OpenAPI_list_free(ec_restriction->plmn_ec_infos); + ogs_free(ec_restriction); +} + +cJSON *OpenAPI_ec_restriction_convertToJSON(OpenAPI_ec_restriction_t *ec_restriction) +{ + cJSON *item = NULL; + + if (ec_restriction == NULL) { + ogs_error("OpenAPI_ec_restriction_convertToJSON() failed [EcRestriction]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!ec_restriction->af_instance_id) { + ogs_error("OpenAPI_ec_restriction_convertToJSON() failed [af_instance_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "afInstanceId", ec_restriction->af_instance_id) == NULL) { + ogs_error("OpenAPI_ec_restriction_convertToJSON() failed [af_instance_id]"); + goto end; + } + + if (!ec_restriction->reference_id) { + ogs_error("OpenAPI_ec_restriction_convertToJSON() failed [reference_id]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "referenceId", ec_restriction->reference_id) == NULL) { + ogs_error("OpenAPI_ec_restriction_convertToJSON() failed [reference_id]"); + goto end; + } + + if (ec_restriction->plmn_ec_infos) { + cJSON *plmn_ec_infosList = cJSON_AddArrayToObject(item, "plmnEcInfos"); + if (plmn_ec_infosList == NULL) { + ogs_error("OpenAPI_ec_restriction_convertToJSON() failed [plmn_ec_infos]"); + goto end; + } + + OpenAPI_lnode_t *plmn_ec_infos_node; + if (ec_restriction->plmn_ec_infos) { + OpenAPI_list_for_each(ec_restriction->plmn_ec_infos, plmn_ec_infos_node) { + cJSON *itemLocal = OpenAPI_plmn_ec_info_convertToJSON(plmn_ec_infos_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ec_restriction_convertToJSON() failed [plmn_ec_infos]"); + goto end; + } + cJSON_AddItemToArray(plmn_ec_infosList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_ec_restriction_t *OpenAPI_ec_restriction_parseFromJSON(cJSON *ec_restrictionJSON) +{ + OpenAPI_ec_restriction_t *ec_restriction_local_var = NULL; + cJSON *af_instance_id = cJSON_GetObjectItemCaseSensitive(ec_restrictionJSON, "afInstanceId"); + if (!af_instance_id) { + ogs_error("OpenAPI_ec_restriction_parseFromJSON() failed [af_instance_id]"); + goto end; + } + + + if (!cJSON_IsString(af_instance_id)) { + ogs_error("OpenAPI_ec_restriction_parseFromJSON() failed [af_instance_id]"); + goto end; + } + + cJSON *reference_id = cJSON_GetObjectItemCaseSensitive(ec_restrictionJSON, "referenceId"); + if (!reference_id) { + ogs_error("OpenAPI_ec_restriction_parseFromJSON() failed [reference_id]"); + goto end; + } + + + if (!cJSON_IsNumber(reference_id)) { + ogs_error("OpenAPI_ec_restriction_parseFromJSON() failed [reference_id]"); + goto end; + } + + cJSON *plmn_ec_infos = cJSON_GetObjectItemCaseSensitive(ec_restrictionJSON, "plmnEcInfos"); + + OpenAPI_list_t *plmn_ec_infosList; + if (plmn_ec_infos) { + cJSON *plmn_ec_infos_local_nonprimitive; + if (!cJSON_IsArray(plmn_ec_infos)) { + ogs_error("OpenAPI_ec_restriction_parseFromJSON() failed [plmn_ec_infos]"); + goto end; + } + + plmn_ec_infosList = OpenAPI_list_create(); + + cJSON_ArrayForEach(plmn_ec_infos_local_nonprimitive, plmn_ec_infos ) { + if (!cJSON_IsObject(plmn_ec_infos_local_nonprimitive)) { + ogs_error("OpenAPI_ec_restriction_parseFromJSON() failed [plmn_ec_infos]"); + goto end; + } + OpenAPI_plmn_ec_info_t *plmn_ec_infosItem = OpenAPI_plmn_ec_info_parseFromJSON(plmn_ec_infos_local_nonprimitive); + + OpenAPI_list_add(plmn_ec_infosList, plmn_ec_infosItem); + } + } + + ec_restriction_local_var = OpenAPI_ec_restriction_create ( + ogs_strdup(af_instance_id->valuestring), + reference_id->valuedouble, + plmn_ec_infos ? plmn_ec_infosList : NULL + ); + + return ec_restriction_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/ec_restriction.h b/lib/sbi/openapi/model/ec_restriction.h new file mode 100644 index 0000000000..16b4cd0232 --- /dev/null +++ b/lib/sbi/openapi/model/ec_restriction.h @@ -0,0 +1,42 @@ +/* + * ec_restriction.h + * + * + */ + +#ifndef _OpenAPI_ec_restriction_H_ +#define _OpenAPI_ec_restriction_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "plmn_ec_info.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_ec_restriction_s OpenAPI_ec_restriction_t; +typedef struct OpenAPI_ec_restriction_s { + char *af_instance_id; + int reference_id; + OpenAPI_list_t *plmn_ec_infos; +} 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 + ); +void OpenAPI_ec_restriction_free(OpenAPI_ec_restriction_t *ec_restriction); +OpenAPI_ec_restriction_t *OpenAPI_ec_restriction_parseFromJSON(cJSON *ec_restrictionJSON); +cJSON *OpenAPI_ec_restriction_convertToJSON(OpenAPI_ec_restriction_t *ec_restriction); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_ec_restriction_H_ */ + diff --git a/lib/sbi/openapi/model/ec_restriction_data.c b/lib/sbi/openapi/model/ec_restriction_data.c new file mode 100644 index 0000000000..73e1cbc454 --- /dev/null +++ b/lib/sbi/openapi/model/ec_restriction_data.c @@ -0,0 +1,89 @@ + +#include +#include +#include +#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 >= 0) { + 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 >= 0) { + 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; +} + diff --git a/lib/sbi/openapi/model/ec_restriction_data.h b/lib/sbi/openapi/model/ec_restriction_data.h new file mode 100644 index 0000000000..3781b5f7b1 --- /dev/null +++ b/lib/sbi/openapi/model/ec_restriction_data.h @@ -0,0 +1,39 @@ +/* + * ec_restriction_data.h + * + * + */ + +#ifndef _OpenAPI_ec_restriction_data_H_ +#define _OpenAPI_ec_restriction_data_H_ + +#include +#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); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_ec_restriction_data_H_ */ + diff --git a/lib/sbi/openapi/model/ecgi.c b/lib/sbi/openapi/model/ecgi.c new file mode 100644 index 0000000000..4c974321c1 --- /dev/null +++ b/lib/sbi/openapi/model/ecgi.c @@ -0,0 +1,125 @@ + +#include +#include +#include +#include "ecgi.h" + +OpenAPI_ecgi_t *OpenAPI_ecgi_create( + OpenAPI_plmn_id_t *plmn_id, + char *eutra_cell_id, + char *nid + ) +{ + OpenAPI_ecgi_t *ecgi_local_var = OpenAPI_malloc(sizeof(OpenAPI_ecgi_t)); + if (!ecgi_local_var) { + return NULL; + } + ecgi_local_var->plmn_id = plmn_id; + ecgi_local_var->eutra_cell_id = eutra_cell_id; + ecgi_local_var->nid = nid; + + return ecgi_local_var; +} + +void OpenAPI_ecgi_free(OpenAPI_ecgi_t *ecgi) +{ + if (NULL == ecgi) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_plmn_id_free(ecgi->plmn_id); + ogs_free(ecgi->eutra_cell_id); + ogs_free(ecgi->nid); + ogs_free(ecgi); +} + +cJSON *OpenAPI_ecgi_convertToJSON(OpenAPI_ecgi_t *ecgi) +{ + cJSON *item = NULL; + + if (ecgi == NULL) { + ogs_error("OpenAPI_ecgi_convertToJSON() failed [Ecgi]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!ecgi->plmn_id) { + ogs_error("OpenAPI_ecgi_convertToJSON() failed [plmn_id]"); + goto end; + } + cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_convertToJSON(ecgi->plmn_id); + if (plmn_id_local_JSON == NULL) { + ogs_error("OpenAPI_ecgi_convertToJSON() failed [plmn_id]"); + goto end; + } + cJSON_AddItemToObject(item, "plmnId", plmn_id_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_ecgi_convertToJSON() failed [plmn_id]"); + goto end; + } + + if (!ecgi->eutra_cell_id) { + ogs_error("OpenAPI_ecgi_convertToJSON() failed [eutra_cell_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "eutraCellId", ecgi->eutra_cell_id) == NULL) { + ogs_error("OpenAPI_ecgi_convertToJSON() failed [eutra_cell_id]"); + goto end; + } + + if (ecgi->nid) { + if (cJSON_AddStringToObject(item, "nid", ecgi->nid) == NULL) { + ogs_error("OpenAPI_ecgi_convertToJSON() failed [nid]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_ecgi_t *OpenAPI_ecgi_parseFromJSON(cJSON *ecgiJSON) +{ + OpenAPI_ecgi_t *ecgi_local_var = NULL; + cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(ecgiJSON, "plmnId"); + if (!plmn_id) { + ogs_error("OpenAPI_ecgi_parseFromJSON() failed [plmn_id]"); + goto end; + } + + OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + + plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); + + cJSON *eutra_cell_id = cJSON_GetObjectItemCaseSensitive(ecgiJSON, "eutraCellId"); + if (!eutra_cell_id) { + ogs_error("OpenAPI_ecgi_parseFromJSON() failed [eutra_cell_id]"); + goto end; + } + + + if (!cJSON_IsString(eutra_cell_id)) { + ogs_error("OpenAPI_ecgi_parseFromJSON() failed [eutra_cell_id]"); + goto end; + } + + cJSON *nid = cJSON_GetObjectItemCaseSensitive(ecgiJSON, "nid"); + + if (nid) { + if (!cJSON_IsString(nid)) { + ogs_error("OpenAPI_ecgi_parseFromJSON() failed [nid]"); + goto end; + } + } + + ecgi_local_var = OpenAPI_ecgi_create ( + plmn_id_local_nonprim, + ogs_strdup(eutra_cell_id->valuestring), + nid ? ogs_strdup(nid->valuestring) : NULL + ); + + return ecgi_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/ecgi.h b/lib/sbi/openapi/model/ecgi.h new file mode 100644 index 0000000000..8d6fc88d47 --- /dev/null +++ b/lib/sbi/openapi/model/ecgi.h @@ -0,0 +1,42 @@ +/* + * ecgi.h + * + * + */ + +#ifndef _OpenAPI_ecgi_H_ +#define _OpenAPI_ecgi_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "plmn_id.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_ecgi_s OpenAPI_ecgi_t; +typedef struct OpenAPI_ecgi_s { + struct OpenAPI_plmn_id_s *plmn_id; + char *eutra_cell_id; + char *nid; +} OpenAPI_ecgi_t; + +OpenAPI_ecgi_t *OpenAPI_ecgi_create( + OpenAPI_plmn_id_t *plmn_id, + char *eutra_cell_id, + char *nid + ); +void OpenAPI_ecgi_free(OpenAPI_ecgi_t *ecgi); +OpenAPI_ecgi_t *OpenAPI_ecgi_parseFromJSON(cJSON *ecgiJSON); +cJSON *OpenAPI_ecgi_convertToJSON(OpenAPI_ecgi_t *ecgi); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_ecgi_H_ */ + diff --git a/lib/sbi/openapi/model/edrx_parameters.c b/lib/sbi/openapi/model/edrx_parameters.c new file mode 100644 index 0000000000..2749a14494 --- /dev/null +++ b/lib/sbi/openapi/model/edrx_parameters.c @@ -0,0 +1,105 @@ + +#include +#include +#include +#include "edrx_parameters.h" + +OpenAPI_edrx_parameters_t *OpenAPI_edrx_parameters_create( + OpenAPI_rat_type_t *rat_type, + char *edrx_value + ) +{ + OpenAPI_edrx_parameters_t *edrx_parameters_local_var = OpenAPI_malloc(sizeof(OpenAPI_edrx_parameters_t)); + if (!edrx_parameters_local_var) { + return NULL; + } + edrx_parameters_local_var->rat_type = rat_type; + edrx_parameters_local_var->edrx_value = edrx_value; + + return edrx_parameters_local_var; +} + +void OpenAPI_edrx_parameters_free(OpenAPI_edrx_parameters_t *edrx_parameters) +{ + if (NULL == edrx_parameters) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_rat_type_free(edrx_parameters->rat_type); + ogs_free(edrx_parameters->edrx_value); + ogs_free(edrx_parameters); +} + +cJSON *OpenAPI_edrx_parameters_convertToJSON(OpenAPI_edrx_parameters_t *edrx_parameters) +{ + cJSON *item = NULL; + + if (edrx_parameters == NULL) { + ogs_error("OpenAPI_edrx_parameters_convertToJSON() failed [EdrxParameters]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!edrx_parameters->rat_type) { + ogs_error("OpenAPI_edrx_parameters_convertToJSON() failed [rat_type]"); + goto end; + } + cJSON *rat_type_local_JSON = OpenAPI_rat_type_convertToJSON(edrx_parameters->rat_type); + if (rat_type_local_JSON == NULL) { + ogs_error("OpenAPI_edrx_parameters_convertToJSON() failed [rat_type]"); + goto end; + } + cJSON_AddItemToObject(item, "ratType", rat_type_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_edrx_parameters_convertToJSON() failed [rat_type]"); + goto end; + } + + if (!edrx_parameters->edrx_value) { + ogs_error("OpenAPI_edrx_parameters_convertToJSON() failed [edrx_value]"); + goto end; + } + if (cJSON_AddStringToObject(item, "edrxValue", edrx_parameters->edrx_value) == NULL) { + ogs_error("OpenAPI_edrx_parameters_convertToJSON() failed [edrx_value]"); + goto end; + } + +end: + return item; +} + +OpenAPI_edrx_parameters_t *OpenAPI_edrx_parameters_parseFromJSON(cJSON *edrx_parametersJSON) +{ + OpenAPI_edrx_parameters_t *edrx_parameters_local_var = NULL; + cJSON *rat_type = cJSON_GetObjectItemCaseSensitive(edrx_parametersJSON, "ratType"); + if (!rat_type) { + ogs_error("OpenAPI_edrx_parameters_parseFromJSON() failed [rat_type]"); + goto end; + } + + OpenAPI_rat_type_t *rat_type_local_nonprim = NULL; + + rat_type_local_nonprim = OpenAPI_rat_type_parseFromJSON(rat_type); + + cJSON *edrx_value = cJSON_GetObjectItemCaseSensitive(edrx_parametersJSON, "edrxValue"); + if (!edrx_value) { + ogs_error("OpenAPI_edrx_parameters_parseFromJSON() failed [edrx_value]"); + goto end; + } + + + if (!cJSON_IsString(edrx_value)) { + ogs_error("OpenAPI_edrx_parameters_parseFromJSON() failed [edrx_value]"); + goto end; + } + + edrx_parameters_local_var = OpenAPI_edrx_parameters_create ( + rat_type_local_nonprim, + ogs_strdup(edrx_value->valuestring) + ); + + return edrx_parameters_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/edrx_parameters.h b/lib/sbi/openapi/model/edrx_parameters.h new file mode 100644 index 0000000000..d3b1b88047 --- /dev/null +++ b/lib/sbi/openapi/model/edrx_parameters.h @@ -0,0 +1,40 @@ +/* + * edrx_parameters.h + * + * + */ + +#ifndef _OpenAPI_edrx_parameters_H_ +#define _OpenAPI_edrx_parameters_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "rat_type.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_edrx_parameters_s OpenAPI_edrx_parameters_t; +typedef struct OpenAPI_edrx_parameters_s { + struct OpenAPI_rat_type_s *rat_type; + char *edrx_value; +} OpenAPI_edrx_parameters_t; + +OpenAPI_edrx_parameters_t *OpenAPI_edrx_parameters_create( + OpenAPI_rat_type_t *rat_type, + char *edrx_value + ); +void OpenAPI_edrx_parameters_free(OpenAPI_edrx_parameters_t *edrx_parameters); +OpenAPI_edrx_parameters_t *OpenAPI_edrx_parameters_parseFromJSON(cJSON *edrx_parametersJSON); +cJSON *OpenAPI_edrx_parameters_convertToJSON(OpenAPI_edrx_parameters_t *edrx_parameters); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_edrx_parameters_H_ */ + diff --git a/lib/sbi/openapi/model/ee_profile_data.c b/lib/sbi/openapi/model/ee_profile_data.c new file mode 100644 index 0000000000..1f3c014bce --- /dev/null +++ b/lib/sbi/openapi/model/ee_profile_data.c @@ -0,0 +1,121 @@ + +#include +#include +#include +#include "ee_profile_data.h" + +OpenAPI_ee_profile_data_t *OpenAPI_ee_profile_data_create( + OpenAPI_list_t *restricted_event_types, + char *supported_features + ) +{ + OpenAPI_ee_profile_data_t *ee_profile_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_ee_profile_data_t)); + if (!ee_profile_data_local_var) { + return NULL; + } + ee_profile_data_local_var->restricted_event_types = restricted_event_types; + ee_profile_data_local_var->supported_features = supported_features; + + return ee_profile_data_local_var; +} + +void OpenAPI_ee_profile_data_free(OpenAPI_ee_profile_data_t *ee_profile_data) +{ + if (NULL == ee_profile_data) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(ee_profile_data->restricted_event_types, node) { + OpenAPI_event_type_free(node->data); + } + OpenAPI_list_free(ee_profile_data->restricted_event_types); + ogs_free(ee_profile_data->supported_features); + ogs_free(ee_profile_data); +} + +cJSON *OpenAPI_ee_profile_data_convertToJSON(OpenAPI_ee_profile_data_t *ee_profile_data) +{ + cJSON *item = NULL; + + if (ee_profile_data == NULL) { + ogs_error("OpenAPI_ee_profile_data_convertToJSON() failed [EeProfileData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (ee_profile_data->restricted_event_types) { + cJSON *restricted_event_typesList = cJSON_AddArrayToObject(item, "restrictedEventTypes"); + if (restricted_event_typesList == NULL) { + ogs_error("OpenAPI_ee_profile_data_convertToJSON() failed [restricted_event_types]"); + goto end; + } + + OpenAPI_lnode_t *restricted_event_types_node; + if (ee_profile_data->restricted_event_types) { + OpenAPI_list_for_each(ee_profile_data->restricted_event_types, restricted_event_types_node) { + cJSON *itemLocal = OpenAPI_event_type_convertToJSON(restricted_event_types_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ee_profile_data_convertToJSON() failed [restricted_event_types]"); + goto end; + } + cJSON_AddItemToArray(restricted_event_typesList, itemLocal); + } + } + } + + if (ee_profile_data->supported_features) { + if (cJSON_AddStringToObject(item, "supportedFeatures", ee_profile_data->supported_features) == NULL) { + ogs_error("OpenAPI_ee_profile_data_convertToJSON() failed [supported_features]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_ee_profile_data_t *OpenAPI_ee_profile_data_parseFromJSON(cJSON *ee_profile_dataJSON) +{ + OpenAPI_ee_profile_data_t *ee_profile_data_local_var = NULL; + cJSON *restricted_event_types = cJSON_GetObjectItemCaseSensitive(ee_profile_dataJSON, "restrictedEventTypes"); + + OpenAPI_list_t *restricted_event_typesList; + if (restricted_event_types) { + cJSON *restricted_event_types_local_nonprimitive; + if (!cJSON_IsArray(restricted_event_types)) { + ogs_error("OpenAPI_ee_profile_data_parseFromJSON() failed [restricted_event_types]"); + goto end; + } + + restricted_event_typesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(restricted_event_types_local_nonprimitive, restricted_event_types ) { + if (!cJSON_IsObject(restricted_event_types_local_nonprimitive)) { + ogs_error("OpenAPI_ee_profile_data_parseFromJSON() failed [restricted_event_types]"); + goto end; + } + OpenAPI_event_type_t *restricted_event_typesItem = OpenAPI_event_type_parseFromJSON(restricted_event_types_local_nonprimitive); + + OpenAPI_list_add(restricted_event_typesList, restricted_event_typesItem); + } + } + + cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(ee_profile_dataJSON, "supportedFeatures"); + + if (supported_features) { + if (!cJSON_IsString(supported_features)) { + ogs_error("OpenAPI_ee_profile_data_parseFromJSON() failed [supported_features]"); + goto end; + } + } + + ee_profile_data_local_var = OpenAPI_ee_profile_data_create ( + restricted_event_types ? restricted_event_typesList : NULL, + supported_features ? ogs_strdup(supported_features->valuestring) : NULL + ); + + return ee_profile_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/ee_profile_data.h b/lib/sbi/openapi/model/ee_profile_data.h new file mode 100644 index 0000000000..3a440e76e5 --- /dev/null +++ b/lib/sbi/openapi/model/ee_profile_data.h @@ -0,0 +1,40 @@ +/* + * ee_profile_data.h + * + * + */ + +#ifndef _OpenAPI_ee_profile_data_H_ +#define _OpenAPI_ee_profile_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "event_type.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_ee_profile_data_s OpenAPI_ee_profile_data_t; +typedef struct OpenAPI_ee_profile_data_s { + OpenAPI_list_t *restricted_event_types; + char *supported_features; +} OpenAPI_ee_profile_data_t; + +OpenAPI_ee_profile_data_t *OpenAPI_ee_profile_data_create( + OpenAPI_list_t *restricted_event_types, + char *supported_features + ); +void OpenAPI_ee_profile_data_free(OpenAPI_ee_profile_data_t *ee_profile_data); +OpenAPI_ee_profile_data_t *OpenAPI_ee_profile_data_parseFromJSON(cJSON *ee_profile_dataJSON); +cJSON *OpenAPI_ee_profile_data_convertToJSON(OpenAPI_ee_profile_data_t *ee_profile_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_ee_profile_data_H_ */ + diff --git a/lib/sbi/openapi/model/ee_subscription.c b/lib/sbi/openapi/model/ee_subscription.c new file mode 100644 index 0000000000..551bf39981 --- /dev/null +++ b/lib/sbi/openapi/model/ee_subscription.c @@ -0,0 +1,198 @@ + +#include +#include +#include +#include "ee_subscription.h" + +OpenAPI_ee_subscription_t *OpenAPI_ee_subscription_create( + char *callback_reference, + OpenAPI_list_t* monitoring_configurations, + OpenAPI_reporting_options_t *reporting_options, + char *supported_features, + char *subscription_id + ) +{ + OpenAPI_ee_subscription_t *ee_subscription_local_var = OpenAPI_malloc(sizeof(OpenAPI_ee_subscription_t)); + if (!ee_subscription_local_var) { + return NULL; + } + ee_subscription_local_var->callback_reference = callback_reference; + ee_subscription_local_var->monitoring_configurations = monitoring_configurations; + ee_subscription_local_var->reporting_options = reporting_options; + ee_subscription_local_var->supported_features = supported_features; + ee_subscription_local_var->subscription_id = subscription_id; + + return ee_subscription_local_var; +} + +void OpenAPI_ee_subscription_free(OpenAPI_ee_subscription_t *ee_subscription) +{ + if (NULL == ee_subscription) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(ee_subscription->callback_reference); + OpenAPI_list_for_each(ee_subscription->monitoring_configurations, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_monitoring_configuration_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(ee_subscription->monitoring_configurations); + OpenAPI_reporting_options_free(ee_subscription->reporting_options); + ogs_free(ee_subscription->supported_features); + ogs_free(ee_subscription->subscription_id); + ogs_free(ee_subscription); +} + +cJSON *OpenAPI_ee_subscription_convertToJSON(OpenAPI_ee_subscription_t *ee_subscription) +{ + cJSON *item = NULL; + + if (ee_subscription == NULL) { + ogs_error("OpenAPI_ee_subscription_convertToJSON() failed [EeSubscription]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!ee_subscription->callback_reference) { + ogs_error("OpenAPI_ee_subscription_convertToJSON() failed [callback_reference]"); + goto end; + } + if (cJSON_AddStringToObject(item, "callbackReference", ee_subscription->callback_reference) == NULL) { + ogs_error("OpenAPI_ee_subscription_convertToJSON() failed [callback_reference]"); + goto end; + } + + if (!ee_subscription->monitoring_configurations) { + ogs_error("OpenAPI_ee_subscription_convertToJSON() failed [monitoring_configurations]"); + goto end; + } + cJSON *monitoring_configurations = cJSON_AddObjectToObject(item, "monitoringConfigurations"); + if (monitoring_configurations == NULL) { + ogs_error("OpenAPI_ee_subscription_convertToJSON() failed [monitoring_configurations]"); + goto end; + } + cJSON *localMapObject = monitoring_configurations; + OpenAPI_lnode_t *monitoring_configurations_node; + if (ee_subscription->monitoring_configurations) { + OpenAPI_list_for_each(ee_subscription->monitoring_configurations, monitoring_configurations_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)monitoring_configurations_node->data; + cJSON *itemLocal = OpenAPI_monitoring_configuration_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ee_subscription_convertToJSON() failed [monitoring_configurations]"); + goto end; + } + cJSON_AddItemToObject(monitoring_configurations, localKeyValue->key, itemLocal); + } + } + + if (ee_subscription->reporting_options) { + cJSON *reporting_options_local_JSON = OpenAPI_reporting_options_convertToJSON(ee_subscription->reporting_options); + if (reporting_options_local_JSON == NULL) { + ogs_error("OpenAPI_ee_subscription_convertToJSON() failed [reporting_options]"); + goto end; + } + cJSON_AddItemToObject(item, "reportingOptions", reporting_options_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_ee_subscription_convertToJSON() failed [reporting_options]"); + goto end; + } + } + + if (ee_subscription->supported_features) { + if (cJSON_AddStringToObject(item, "supportedFeatures", ee_subscription->supported_features) == NULL) { + ogs_error("OpenAPI_ee_subscription_convertToJSON() failed [supported_features]"); + goto end; + } + } + + if (ee_subscription->subscription_id) { + if (cJSON_AddStringToObject(item, "subscriptionId", ee_subscription->subscription_id) == NULL) { + ogs_error("OpenAPI_ee_subscription_convertToJSON() failed [subscription_id]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_ee_subscription_t *OpenAPI_ee_subscription_parseFromJSON(cJSON *ee_subscriptionJSON) +{ + OpenAPI_ee_subscription_t *ee_subscription_local_var = NULL; + cJSON *callback_reference = cJSON_GetObjectItemCaseSensitive(ee_subscriptionJSON, "callbackReference"); + if (!callback_reference) { + ogs_error("OpenAPI_ee_subscription_parseFromJSON() failed [callback_reference]"); + goto end; + } + + + if (!cJSON_IsString(callback_reference)) { + ogs_error("OpenAPI_ee_subscription_parseFromJSON() failed [callback_reference]"); + goto end; + } + + cJSON *monitoring_configurations = cJSON_GetObjectItemCaseSensitive(ee_subscriptionJSON, "monitoringConfigurations"); + if (!monitoring_configurations) { + ogs_error("OpenAPI_ee_subscription_parseFromJSON() failed [monitoring_configurations]"); + goto end; + } + + OpenAPI_list_t *monitoring_configurationsList; + + cJSON *monitoring_configurations_local_map; + if (!cJSON_IsObject(monitoring_configurations)) { + ogs_error("OpenAPI_ee_subscription_parseFromJSON() failed [monitoring_configurations]"); + goto end; + } + monitoring_configurationsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(monitoring_configurations_local_map, monitoring_configurations) { + cJSON *localMapObject = monitoring_configurations_local_map; + if (!cJSON_IsObject(monitoring_configurations_local_map)) { + ogs_error("OpenAPI_ee_subscription_parseFromJSON() failed [monitoring_configurations]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_monitoring_configuration_parseFromJSON(localMapObject)); + OpenAPI_list_add(monitoring_configurationsList, localMapKeyPair); + } + + cJSON *reporting_options = cJSON_GetObjectItemCaseSensitive(ee_subscriptionJSON, "reportingOptions"); + + OpenAPI_reporting_options_t *reporting_options_local_nonprim = NULL; + if (reporting_options) { + reporting_options_local_nonprim = OpenAPI_reporting_options_parseFromJSON(reporting_options); + } + + cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(ee_subscriptionJSON, "supportedFeatures"); + + if (supported_features) { + if (!cJSON_IsString(supported_features)) { + ogs_error("OpenAPI_ee_subscription_parseFromJSON() failed [supported_features]"); + goto end; + } + } + + cJSON *subscription_id = cJSON_GetObjectItemCaseSensitive(ee_subscriptionJSON, "subscriptionId"); + + if (subscription_id) { + if (!cJSON_IsString(subscription_id)) { + ogs_error("OpenAPI_ee_subscription_parseFromJSON() failed [subscription_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 + ); + + return ee_subscription_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/ee_subscription.h b/lib/sbi/openapi/model/ee_subscription.h new file mode 100644 index 0000000000..1154e7f5ba --- /dev/null +++ b/lib/sbi/openapi/model/ee_subscription.h @@ -0,0 +1,47 @@ +/* + * ee_subscription.h + * + * + */ + +#ifndef _OpenAPI_ee_subscription_H_ +#define _OpenAPI_ee_subscription_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "monitoring_configuration.h" +#include "reporting_options.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_ee_subscription_s OpenAPI_ee_subscription_t; +typedef struct OpenAPI_ee_subscription_s { + char *callback_reference; + OpenAPI_list_t* monitoring_configurations; + struct OpenAPI_reporting_options_s *reporting_options; + char *supported_features; + char *subscription_id; +} OpenAPI_ee_subscription_t; + +OpenAPI_ee_subscription_t *OpenAPI_ee_subscription_create( + char *callback_reference, + OpenAPI_list_t* monitoring_configurations, + OpenAPI_reporting_options_t *reporting_options, + char *supported_features, + char *subscription_id + ); +void OpenAPI_ee_subscription_free(OpenAPI_ee_subscription_t *ee_subscription); +OpenAPI_ee_subscription_t *OpenAPI_ee_subscription_parseFromJSON(cJSON *ee_subscriptionJSON); +cJSON *OpenAPI_ee_subscription_convertToJSON(OpenAPI_ee_subscription_t *ee_subscription); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_ee_subscription_H_ */ + diff --git a/lib/sbi/openapi/model/ellipsoid_arc.c b/lib/sbi/openapi/model/ellipsoid_arc.c new file mode 100644 index 0000000000..ea3a06d8ef --- /dev/null +++ b/lib/sbi/openapi/model/ellipsoid_arc.c @@ -0,0 +1,229 @@ + +#include +#include +#include +#include "ellipsoid_arc.h" + +OpenAPI_ellipsoid_arc_t *OpenAPI_ellipsoid_arc_create( + OpenAPI_supported_gad_shapes_t *shape, + OpenAPI_geographical_coordinates_t *point, + int inner_radius, + float uncertainty_radius, + int offset_angle, + int included_angle, + int confidence + ) +{ + OpenAPI_ellipsoid_arc_t *ellipsoid_arc_local_var = OpenAPI_malloc(sizeof(OpenAPI_ellipsoid_arc_t)); + if (!ellipsoid_arc_local_var) { + return NULL; + } + ellipsoid_arc_local_var->shape = shape; + ellipsoid_arc_local_var->point = point; + ellipsoid_arc_local_var->inner_radius = inner_radius; + ellipsoid_arc_local_var->uncertainty_radius = uncertainty_radius; + ellipsoid_arc_local_var->offset_angle = offset_angle; + ellipsoid_arc_local_var->included_angle = included_angle; + ellipsoid_arc_local_var->confidence = confidence; + + return ellipsoid_arc_local_var; +} + +void OpenAPI_ellipsoid_arc_free(OpenAPI_ellipsoid_arc_t *ellipsoid_arc) +{ + if (NULL == ellipsoid_arc) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_supported_gad_shapes_free(ellipsoid_arc->shape); + OpenAPI_geographical_coordinates_free(ellipsoid_arc->point); + ogs_free(ellipsoid_arc); +} + +cJSON *OpenAPI_ellipsoid_arc_convertToJSON(OpenAPI_ellipsoid_arc_t *ellipsoid_arc) +{ + cJSON *item = NULL; + + if (ellipsoid_arc == NULL) { + ogs_error("OpenAPI_ellipsoid_arc_convertToJSON() failed [EllipsoidArc]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!ellipsoid_arc->shape) { + ogs_error("OpenAPI_ellipsoid_arc_convertToJSON() failed [shape]"); + goto end; + } + cJSON *shape_local_JSON = OpenAPI_supported_gad_shapes_convertToJSON(ellipsoid_arc->shape); + if (shape_local_JSON == NULL) { + ogs_error("OpenAPI_ellipsoid_arc_convertToJSON() failed [shape]"); + goto end; + } + cJSON_AddItemToObject(item, "shape", shape_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_ellipsoid_arc_convertToJSON() failed [shape]"); + goto end; + } + + if (!ellipsoid_arc->point) { + ogs_error("OpenAPI_ellipsoid_arc_convertToJSON() failed [point]"); + goto end; + } + cJSON *point_local_JSON = OpenAPI_geographical_coordinates_convertToJSON(ellipsoid_arc->point); + if (point_local_JSON == NULL) { + ogs_error("OpenAPI_ellipsoid_arc_convertToJSON() failed [point]"); + goto end; + } + cJSON_AddItemToObject(item, "point", point_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_ellipsoid_arc_convertToJSON() failed [point]"); + goto end; + } + + if (!ellipsoid_arc->inner_radius) { + ogs_error("OpenAPI_ellipsoid_arc_convertToJSON() failed [inner_radius]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "innerRadius", ellipsoid_arc->inner_radius) == NULL) { + ogs_error("OpenAPI_ellipsoid_arc_convertToJSON() failed [inner_radius]"); + goto end; + } + + if (!ellipsoid_arc->uncertainty_radius) { + ogs_error("OpenAPI_ellipsoid_arc_convertToJSON() failed [uncertainty_radius]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "uncertaintyRadius", ellipsoid_arc->uncertainty_radius) == NULL) { + ogs_error("OpenAPI_ellipsoid_arc_convertToJSON() failed [uncertainty_radius]"); + goto end; + } + + if (!ellipsoid_arc->offset_angle) { + ogs_error("OpenAPI_ellipsoid_arc_convertToJSON() failed [offset_angle]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "offsetAngle", ellipsoid_arc->offset_angle) == NULL) { + ogs_error("OpenAPI_ellipsoid_arc_convertToJSON() failed [offset_angle]"); + goto end; + } + + if (!ellipsoid_arc->included_angle) { + ogs_error("OpenAPI_ellipsoid_arc_convertToJSON() failed [included_angle]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "includedAngle", ellipsoid_arc->included_angle) == NULL) { + ogs_error("OpenAPI_ellipsoid_arc_convertToJSON() failed [included_angle]"); + goto end; + } + + if (!ellipsoid_arc->confidence) { + ogs_error("OpenAPI_ellipsoid_arc_convertToJSON() failed [confidence]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "confidence", ellipsoid_arc->confidence) == NULL) { + ogs_error("OpenAPI_ellipsoid_arc_convertToJSON() failed [confidence]"); + goto end; + } + +end: + return item; +} + +OpenAPI_ellipsoid_arc_t *OpenAPI_ellipsoid_arc_parseFromJSON(cJSON *ellipsoid_arcJSON) +{ + OpenAPI_ellipsoid_arc_t *ellipsoid_arc_local_var = NULL; + cJSON *shape = cJSON_GetObjectItemCaseSensitive(ellipsoid_arcJSON, "shape"); + if (!shape) { + ogs_error("OpenAPI_ellipsoid_arc_parseFromJSON() failed [shape]"); + goto end; + } + + OpenAPI_supported_gad_shapes_t *shape_local_nonprim = NULL; + + shape_local_nonprim = OpenAPI_supported_gad_shapes_parseFromJSON(shape); + + cJSON *point = cJSON_GetObjectItemCaseSensitive(ellipsoid_arcJSON, "point"); + if (!point) { + ogs_error("OpenAPI_ellipsoid_arc_parseFromJSON() failed [point]"); + goto end; + } + + OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; + + point_local_nonprim = OpenAPI_geographical_coordinates_parseFromJSON(point); + + cJSON *inner_radius = cJSON_GetObjectItemCaseSensitive(ellipsoid_arcJSON, "innerRadius"); + if (!inner_radius) { + ogs_error("OpenAPI_ellipsoid_arc_parseFromJSON() failed [inner_radius]"); + goto end; + } + + + if (!cJSON_IsNumber(inner_radius)) { + ogs_error("OpenAPI_ellipsoid_arc_parseFromJSON() failed [inner_radius]"); + goto end; + } + + cJSON *uncertainty_radius = cJSON_GetObjectItemCaseSensitive(ellipsoid_arcJSON, "uncertaintyRadius"); + if (!uncertainty_radius) { + ogs_error("OpenAPI_ellipsoid_arc_parseFromJSON() failed [uncertainty_radius]"); + goto end; + } + + + if (!cJSON_IsNumber(uncertainty_radius)) { + ogs_error("OpenAPI_ellipsoid_arc_parseFromJSON() failed [uncertainty_radius]"); + goto end; + } + + cJSON *offset_angle = cJSON_GetObjectItemCaseSensitive(ellipsoid_arcJSON, "offsetAngle"); + if (!offset_angle) { + ogs_error("OpenAPI_ellipsoid_arc_parseFromJSON() failed [offset_angle]"); + goto end; + } + + + if (!cJSON_IsNumber(offset_angle)) { + ogs_error("OpenAPI_ellipsoid_arc_parseFromJSON() failed [offset_angle]"); + goto end; + } + + cJSON *included_angle = cJSON_GetObjectItemCaseSensitive(ellipsoid_arcJSON, "includedAngle"); + if (!included_angle) { + ogs_error("OpenAPI_ellipsoid_arc_parseFromJSON() failed [included_angle]"); + goto end; + } + + + if (!cJSON_IsNumber(included_angle)) { + ogs_error("OpenAPI_ellipsoid_arc_parseFromJSON() failed [included_angle]"); + goto end; + } + + cJSON *confidence = cJSON_GetObjectItemCaseSensitive(ellipsoid_arcJSON, "confidence"); + if (!confidence) { + ogs_error("OpenAPI_ellipsoid_arc_parseFromJSON() failed [confidence]"); + goto end; + } + + + if (!cJSON_IsNumber(confidence)) { + ogs_error("OpenAPI_ellipsoid_arc_parseFromJSON() failed [confidence]"); + goto end; + } + + ellipsoid_arc_local_var = OpenAPI_ellipsoid_arc_create ( + shape_local_nonprim, + point_local_nonprim, + inner_radius->valuedouble, + uncertainty_radius->valuedouble, + offset_angle->valuedouble, + included_angle->valuedouble, + confidence->valuedouble + ); + + return ellipsoid_arc_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/ellipsoid_arc.h b/lib/sbi/openapi/model/ellipsoid_arc.h new file mode 100644 index 0000000000..027651b756 --- /dev/null +++ b/lib/sbi/openapi/model/ellipsoid_arc.h @@ -0,0 +1,53 @@ +/* + * ellipsoid_arc.h + * + * + */ + +#ifndef _OpenAPI_ellipsoid_arc_H_ +#define _OpenAPI_ellipsoid_arc_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "ellipsoid_arc_all_of.h" +#include "gad_shape.h" +#include "geographical_coordinates.h" +#include "supported_gad_shapes.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_ellipsoid_arc_s OpenAPI_ellipsoid_arc_t; +typedef struct OpenAPI_ellipsoid_arc_s { + struct OpenAPI_supported_gad_shapes_s *shape; + struct OpenAPI_geographical_coordinates_s *point; + int inner_radius; + float uncertainty_radius; + int offset_angle; + int included_angle; + int confidence; +} OpenAPI_ellipsoid_arc_t; + +OpenAPI_ellipsoid_arc_t *OpenAPI_ellipsoid_arc_create( + OpenAPI_supported_gad_shapes_t *shape, + OpenAPI_geographical_coordinates_t *point, + int inner_radius, + float uncertainty_radius, + int offset_angle, + int included_angle, + int confidence + ); +void OpenAPI_ellipsoid_arc_free(OpenAPI_ellipsoid_arc_t *ellipsoid_arc); +OpenAPI_ellipsoid_arc_t *OpenAPI_ellipsoid_arc_parseFromJSON(cJSON *ellipsoid_arcJSON); +cJSON *OpenAPI_ellipsoid_arc_convertToJSON(OpenAPI_ellipsoid_arc_t *ellipsoid_arc); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_ellipsoid_arc_H_ */ + diff --git a/lib/sbi/openapi/model/ellipsoid_arc_all_of.c b/lib/sbi/openapi/model/ellipsoid_arc_all_of.c new file mode 100644 index 0000000000..d313c54a75 --- /dev/null +++ b/lib/sbi/openapi/model/ellipsoid_arc_all_of.c @@ -0,0 +1,200 @@ + +#include +#include +#include +#include "ellipsoid_arc_all_of.h" + +OpenAPI_ellipsoid_arc_all_of_t *OpenAPI_ellipsoid_arc_all_of_create( + OpenAPI_geographical_coordinates_t *point, + int inner_radius, + float uncertainty_radius, + int offset_angle, + int included_angle, + int confidence + ) +{ + OpenAPI_ellipsoid_arc_all_of_t *ellipsoid_arc_all_of_local_var = OpenAPI_malloc(sizeof(OpenAPI_ellipsoid_arc_all_of_t)); + if (!ellipsoid_arc_all_of_local_var) { + return NULL; + } + ellipsoid_arc_all_of_local_var->point = point; + ellipsoid_arc_all_of_local_var->inner_radius = inner_radius; + ellipsoid_arc_all_of_local_var->uncertainty_radius = uncertainty_radius; + ellipsoid_arc_all_of_local_var->offset_angle = offset_angle; + ellipsoid_arc_all_of_local_var->included_angle = included_angle; + ellipsoid_arc_all_of_local_var->confidence = confidence; + + return ellipsoid_arc_all_of_local_var; +} + +void OpenAPI_ellipsoid_arc_all_of_free(OpenAPI_ellipsoid_arc_all_of_t *ellipsoid_arc_all_of) +{ + if (NULL == ellipsoid_arc_all_of) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_geographical_coordinates_free(ellipsoid_arc_all_of->point); + ogs_free(ellipsoid_arc_all_of); +} + +cJSON *OpenAPI_ellipsoid_arc_all_of_convertToJSON(OpenAPI_ellipsoid_arc_all_of_t *ellipsoid_arc_all_of) +{ + cJSON *item = NULL; + + if (ellipsoid_arc_all_of == NULL) { + ogs_error("OpenAPI_ellipsoid_arc_all_of_convertToJSON() failed [EllipsoidArc_allOf]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!ellipsoid_arc_all_of->point) { + ogs_error("OpenAPI_ellipsoid_arc_all_of_convertToJSON() failed [point]"); + goto end; + } + cJSON *point_local_JSON = OpenAPI_geographical_coordinates_convertToJSON(ellipsoid_arc_all_of->point); + if (point_local_JSON == NULL) { + ogs_error("OpenAPI_ellipsoid_arc_all_of_convertToJSON() failed [point]"); + goto end; + } + cJSON_AddItemToObject(item, "point", point_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_ellipsoid_arc_all_of_convertToJSON() failed [point]"); + goto end; + } + + if (!ellipsoid_arc_all_of->inner_radius) { + ogs_error("OpenAPI_ellipsoid_arc_all_of_convertToJSON() failed [inner_radius]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "innerRadius", ellipsoid_arc_all_of->inner_radius) == NULL) { + ogs_error("OpenAPI_ellipsoid_arc_all_of_convertToJSON() failed [inner_radius]"); + goto end; + } + + if (!ellipsoid_arc_all_of->uncertainty_radius) { + ogs_error("OpenAPI_ellipsoid_arc_all_of_convertToJSON() failed [uncertainty_radius]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "uncertaintyRadius", ellipsoid_arc_all_of->uncertainty_radius) == NULL) { + ogs_error("OpenAPI_ellipsoid_arc_all_of_convertToJSON() failed [uncertainty_radius]"); + goto end; + } + + if (!ellipsoid_arc_all_of->offset_angle) { + ogs_error("OpenAPI_ellipsoid_arc_all_of_convertToJSON() failed [offset_angle]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "offsetAngle", ellipsoid_arc_all_of->offset_angle) == NULL) { + ogs_error("OpenAPI_ellipsoid_arc_all_of_convertToJSON() failed [offset_angle]"); + goto end; + } + + if (!ellipsoid_arc_all_of->included_angle) { + ogs_error("OpenAPI_ellipsoid_arc_all_of_convertToJSON() failed [included_angle]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "includedAngle", ellipsoid_arc_all_of->included_angle) == NULL) { + ogs_error("OpenAPI_ellipsoid_arc_all_of_convertToJSON() failed [included_angle]"); + goto end; + } + + if (!ellipsoid_arc_all_of->confidence) { + ogs_error("OpenAPI_ellipsoid_arc_all_of_convertToJSON() failed [confidence]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "confidence", ellipsoid_arc_all_of->confidence) == NULL) { + ogs_error("OpenAPI_ellipsoid_arc_all_of_convertToJSON() failed [confidence]"); + goto end; + } + +end: + return item; +} + +OpenAPI_ellipsoid_arc_all_of_t *OpenAPI_ellipsoid_arc_all_of_parseFromJSON(cJSON *ellipsoid_arc_all_ofJSON) +{ + OpenAPI_ellipsoid_arc_all_of_t *ellipsoid_arc_all_of_local_var = NULL; + cJSON *point = cJSON_GetObjectItemCaseSensitive(ellipsoid_arc_all_ofJSON, "point"); + if (!point) { + ogs_error("OpenAPI_ellipsoid_arc_all_of_parseFromJSON() failed [point]"); + goto end; + } + + OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; + + point_local_nonprim = OpenAPI_geographical_coordinates_parseFromJSON(point); + + cJSON *inner_radius = cJSON_GetObjectItemCaseSensitive(ellipsoid_arc_all_ofJSON, "innerRadius"); + if (!inner_radius) { + ogs_error("OpenAPI_ellipsoid_arc_all_of_parseFromJSON() failed [inner_radius]"); + goto end; + } + + + if (!cJSON_IsNumber(inner_radius)) { + ogs_error("OpenAPI_ellipsoid_arc_all_of_parseFromJSON() failed [inner_radius]"); + goto end; + } + + cJSON *uncertainty_radius = cJSON_GetObjectItemCaseSensitive(ellipsoid_arc_all_ofJSON, "uncertaintyRadius"); + if (!uncertainty_radius) { + ogs_error("OpenAPI_ellipsoid_arc_all_of_parseFromJSON() failed [uncertainty_radius]"); + goto end; + } + + + if (!cJSON_IsNumber(uncertainty_radius)) { + ogs_error("OpenAPI_ellipsoid_arc_all_of_parseFromJSON() failed [uncertainty_radius]"); + goto end; + } + + cJSON *offset_angle = cJSON_GetObjectItemCaseSensitive(ellipsoid_arc_all_ofJSON, "offsetAngle"); + if (!offset_angle) { + ogs_error("OpenAPI_ellipsoid_arc_all_of_parseFromJSON() failed [offset_angle]"); + goto end; + } + + + if (!cJSON_IsNumber(offset_angle)) { + ogs_error("OpenAPI_ellipsoid_arc_all_of_parseFromJSON() failed [offset_angle]"); + goto end; + } + + cJSON *included_angle = cJSON_GetObjectItemCaseSensitive(ellipsoid_arc_all_ofJSON, "includedAngle"); + if (!included_angle) { + ogs_error("OpenAPI_ellipsoid_arc_all_of_parseFromJSON() failed [included_angle]"); + goto end; + } + + + if (!cJSON_IsNumber(included_angle)) { + ogs_error("OpenAPI_ellipsoid_arc_all_of_parseFromJSON() failed [included_angle]"); + goto end; + } + + cJSON *confidence = cJSON_GetObjectItemCaseSensitive(ellipsoid_arc_all_ofJSON, "confidence"); + if (!confidence) { + ogs_error("OpenAPI_ellipsoid_arc_all_of_parseFromJSON() failed [confidence]"); + goto end; + } + + + if (!cJSON_IsNumber(confidence)) { + ogs_error("OpenAPI_ellipsoid_arc_all_of_parseFromJSON() failed [confidence]"); + goto end; + } + + ellipsoid_arc_all_of_local_var = OpenAPI_ellipsoid_arc_all_of_create ( + point_local_nonprim, + inner_radius->valuedouble, + uncertainty_radius->valuedouble, + offset_angle->valuedouble, + included_angle->valuedouble, + confidence->valuedouble + ); + + return ellipsoid_arc_all_of_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/ellipsoid_arc_all_of.h b/lib/sbi/openapi/model/ellipsoid_arc_all_of.h new file mode 100644 index 0000000000..8ab2ff1dae --- /dev/null +++ b/lib/sbi/openapi/model/ellipsoid_arc_all_of.h @@ -0,0 +1,48 @@ +/* + * ellipsoid_arc_all_of.h + * + * + */ + +#ifndef _OpenAPI_ellipsoid_arc_all_of_H_ +#define _OpenAPI_ellipsoid_arc_all_of_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "geographical_coordinates.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_ellipsoid_arc_all_of_s OpenAPI_ellipsoid_arc_all_of_t; +typedef struct OpenAPI_ellipsoid_arc_all_of_s { + struct OpenAPI_geographical_coordinates_s *point; + int inner_radius; + float uncertainty_radius; + int offset_angle; + int included_angle; + int confidence; +} OpenAPI_ellipsoid_arc_all_of_t; + +OpenAPI_ellipsoid_arc_all_of_t *OpenAPI_ellipsoid_arc_all_of_create( + OpenAPI_geographical_coordinates_t *point, + int inner_radius, + float uncertainty_radius, + int offset_angle, + int included_angle, + int confidence + ); +void OpenAPI_ellipsoid_arc_all_of_free(OpenAPI_ellipsoid_arc_all_of_t *ellipsoid_arc_all_of); +OpenAPI_ellipsoid_arc_all_of_t *OpenAPI_ellipsoid_arc_all_of_parseFromJSON(cJSON *ellipsoid_arc_all_ofJSON); +cJSON *OpenAPI_ellipsoid_arc_all_of_convertToJSON(OpenAPI_ellipsoid_arc_all_of_t *ellipsoid_arc_all_of); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_ellipsoid_arc_all_of_H_ */ + diff --git a/lib/sbi/openapi/model/emergency_info.c b/lib/sbi/openapi/model/emergency_info.c new file mode 100644 index 0000000000..2769d34938 --- /dev/null +++ b/lib/sbi/openapi/model/emergency_info.c @@ -0,0 +1,115 @@ + +#include +#include +#include +#include "emergency_info.h" + +OpenAPI_emergency_info_t *OpenAPI_emergency_info_create( + char *pgw_fqdn, + OpenAPI_ip_address_t *pgw_ip_address, + char *smf_instance_id + ) +{ + OpenAPI_emergency_info_t *emergency_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_emergency_info_t)); + if (!emergency_info_local_var) { + return NULL; + } + 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; + + return emergency_info_local_var; +} + +void OpenAPI_emergency_info_free(OpenAPI_emergency_info_t *emergency_info) +{ + if (NULL == emergency_info) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(emergency_info->pgw_fqdn); + OpenAPI_ip_address_free(emergency_info->pgw_ip_address); + ogs_free(emergency_info->smf_instance_id); + ogs_free(emergency_info); +} + +cJSON *OpenAPI_emergency_info_convertToJSON(OpenAPI_emergency_info_t *emergency_info) +{ + cJSON *item = NULL; + + if (emergency_info == NULL) { + ogs_error("OpenAPI_emergency_info_convertToJSON() failed [EmergencyInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (emergency_info->pgw_fqdn) { + if (cJSON_AddStringToObject(item, "pgwFqdn", emergency_info->pgw_fqdn) == NULL) { + ogs_error("OpenAPI_emergency_info_convertToJSON() failed [pgw_fqdn]"); + goto end; + } + } + + if (emergency_info->pgw_ip_address) { + cJSON *pgw_ip_address_local_JSON = OpenAPI_ip_address_convertToJSON(emergency_info->pgw_ip_address); + if (pgw_ip_address_local_JSON == NULL) { + ogs_error("OpenAPI_emergency_info_convertToJSON() failed [pgw_ip_address]"); + goto end; + } + cJSON_AddItemToObject(item, "pgwIpAddress", pgw_ip_address_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_emergency_info_convertToJSON() failed [pgw_ip_address]"); + goto end; + } + } + + if (emergency_info->smf_instance_id) { + if (cJSON_AddStringToObject(item, "smfInstanceId", emergency_info->smf_instance_id) == NULL) { + ogs_error("OpenAPI_emergency_info_convertToJSON() failed [smf_instance_id]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_emergency_info_t *OpenAPI_emergency_info_parseFromJSON(cJSON *emergency_infoJSON) +{ + OpenAPI_emergency_info_t *emergency_info_local_var = NULL; + cJSON *pgw_fqdn = cJSON_GetObjectItemCaseSensitive(emergency_infoJSON, "pgwFqdn"); + + if (pgw_fqdn) { + if (!cJSON_IsString(pgw_fqdn)) { + ogs_error("OpenAPI_emergency_info_parseFromJSON() failed [pgw_fqdn]"); + goto end; + } + } + + cJSON *pgw_ip_address = cJSON_GetObjectItemCaseSensitive(emergency_infoJSON, "pgwIpAddress"); + + OpenAPI_ip_address_t *pgw_ip_address_local_nonprim = NULL; + if (pgw_ip_address) { + pgw_ip_address_local_nonprim = OpenAPI_ip_address_parseFromJSON(pgw_ip_address); + } + + cJSON *smf_instance_id = cJSON_GetObjectItemCaseSensitive(emergency_infoJSON, "smfInstanceId"); + + if (smf_instance_id) { + if (!cJSON_IsString(smf_instance_id)) { + ogs_error("OpenAPI_emergency_info_parseFromJSON() failed [smf_instance_id]"); + 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 + ); + + return emergency_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/emergency_info.h b/lib/sbi/openapi/model/emergency_info.h new file mode 100644 index 0000000000..15ad44126f --- /dev/null +++ b/lib/sbi/openapi/model/emergency_info.h @@ -0,0 +1,42 @@ +/* + * emergency_info.h + * + * + */ + +#ifndef _OpenAPI_emergency_info_H_ +#define _OpenAPI_emergency_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "ip_address.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_emergency_info_s OpenAPI_emergency_info_t; +typedef struct OpenAPI_emergency_info_s { + char *pgw_fqdn; + struct OpenAPI_ip_address_s *pgw_ip_address; + char *smf_instance_id; +} 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 + ); +void OpenAPI_emergency_info_free(OpenAPI_emergency_info_t *emergency_info); +OpenAPI_emergency_info_t *OpenAPI_emergency_info_parseFromJSON(cJSON *emergency_infoJSON); +cJSON *OpenAPI_emergency_info_convertToJSON(OpenAPI_emergency_info_t *emergency_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_emergency_info_H_ */ + diff --git a/lib/sbi/openapi/model/enhanced_coverage_restriction_data.c b/lib/sbi/openapi/model/enhanced_coverage_restriction_data.c new file mode 100644 index 0000000000..883ba3d9e2 --- /dev/null +++ b/lib/sbi/openapi/model/enhanced_coverage_restriction_data.c @@ -0,0 +1,101 @@ + +#include +#include +#include +#include "enhanced_coverage_restriction_data.h" + +OpenAPI_enhanced_coverage_restriction_data_t *OpenAPI_enhanced_coverage_restriction_data_create( + OpenAPI_list_t *plmn_ec_info_list + ) +{ + OpenAPI_enhanced_coverage_restriction_data_t *enhanced_coverage_restriction_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_enhanced_coverage_restriction_data_t)); + if (!enhanced_coverage_restriction_data_local_var) { + return NULL; + } + enhanced_coverage_restriction_data_local_var->plmn_ec_info_list = plmn_ec_info_list; + + return enhanced_coverage_restriction_data_local_var; +} + +void OpenAPI_enhanced_coverage_restriction_data_free(OpenAPI_enhanced_coverage_restriction_data_t *enhanced_coverage_restriction_data) +{ + if (NULL == enhanced_coverage_restriction_data) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(enhanced_coverage_restriction_data->plmn_ec_info_list, node) { + OpenAPI_plmn_ec_info_free(node->data); + } + OpenAPI_list_free(enhanced_coverage_restriction_data->plmn_ec_info_list); + ogs_free(enhanced_coverage_restriction_data); +} + +cJSON *OpenAPI_enhanced_coverage_restriction_data_convertToJSON(OpenAPI_enhanced_coverage_restriction_data_t *enhanced_coverage_restriction_data) +{ + cJSON *item = NULL; + + if (enhanced_coverage_restriction_data == NULL) { + ogs_error("OpenAPI_enhanced_coverage_restriction_data_convertToJSON() failed [EnhancedCoverageRestrictionData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (enhanced_coverage_restriction_data->plmn_ec_info_list) { + cJSON *plmn_ec_info_listList = cJSON_AddArrayToObject(item, "plmnEcInfoList"); + if (plmn_ec_info_listList == NULL) { + ogs_error("OpenAPI_enhanced_coverage_restriction_data_convertToJSON() failed [plmn_ec_info_list]"); + goto end; + } + + OpenAPI_lnode_t *plmn_ec_info_list_node; + if (enhanced_coverage_restriction_data->plmn_ec_info_list) { + OpenAPI_list_for_each(enhanced_coverage_restriction_data->plmn_ec_info_list, plmn_ec_info_list_node) { + cJSON *itemLocal = OpenAPI_plmn_ec_info_convertToJSON(plmn_ec_info_list_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_enhanced_coverage_restriction_data_convertToJSON() failed [plmn_ec_info_list]"); + goto end; + } + cJSON_AddItemToArray(plmn_ec_info_listList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_enhanced_coverage_restriction_data_t *OpenAPI_enhanced_coverage_restriction_data_parseFromJSON(cJSON *enhanced_coverage_restriction_dataJSON) +{ + OpenAPI_enhanced_coverage_restriction_data_t *enhanced_coverage_restriction_data_local_var = NULL; + cJSON *plmn_ec_info_list = cJSON_GetObjectItemCaseSensitive(enhanced_coverage_restriction_dataJSON, "plmnEcInfoList"); + + OpenAPI_list_t *plmn_ec_info_listList; + if (plmn_ec_info_list) { + cJSON *plmn_ec_info_list_local_nonprimitive; + if (!cJSON_IsArray(plmn_ec_info_list)) { + ogs_error("OpenAPI_enhanced_coverage_restriction_data_parseFromJSON() failed [plmn_ec_info_list]"); + goto end; + } + + plmn_ec_info_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(plmn_ec_info_list_local_nonprimitive, plmn_ec_info_list ) { + if (!cJSON_IsObject(plmn_ec_info_list_local_nonprimitive)) { + ogs_error("OpenAPI_enhanced_coverage_restriction_data_parseFromJSON() failed [plmn_ec_info_list]"); + goto end; + } + OpenAPI_plmn_ec_info_t *plmn_ec_info_listItem = OpenAPI_plmn_ec_info_parseFromJSON(plmn_ec_info_list_local_nonprimitive); + + OpenAPI_list_add(plmn_ec_info_listList, plmn_ec_info_listItem); + } + } + + enhanced_coverage_restriction_data_local_var = OpenAPI_enhanced_coverage_restriction_data_create ( + plmn_ec_info_list ? plmn_ec_info_listList : NULL + ); + + return enhanced_coverage_restriction_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/enhanced_coverage_restriction_data.h b/lib/sbi/openapi/model/enhanced_coverage_restriction_data.h new file mode 100644 index 0000000000..4496d5fd4a --- /dev/null +++ b/lib/sbi/openapi/model/enhanced_coverage_restriction_data.h @@ -0,0 +1,38 @@ +/* + * enhanced_coverage_restriction_data.h + * + * + */ + +#ifndef _OpenAPI_enhanced_coverage_restriction_data_H_ +#define _OpenAPI_enhanced_coverage_restriction_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "plmn_ec_info.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_enhanced_coverage_restriction_data_s OpenAPI_enhanced_coverage_restriction_data_t; +typedef struct OpenAPI_enhanced_coverage_restriction_data_s { + OpenAPI_list_t *plmn_ec_info_list; +} OpenAPI_enhanced_coverage_restriction_data_t; + +OpenAPI_enhanced_coverage_restriction_data_t *OpenAPI_enhanced_coverage_restriction_data_create( + OpenAPI_list_t *plmn_ec_info_list + ); +void OpenAPI_enhanced_coverage_restriction_data_free(OpenAPI_enhanced_coverage_restriction_data_t *enhanced_coverage_restriction_data); +OpenAPI_enhanced_coverage_restriction_data_t *OpenAPI_enhanced_coverage_restriction_data_parseFromJSON(cJSON *enhanced_coverage_restriction_dataJSON); +cJSON *OpenAPI_enhanced_coverage_restriction_data_convertToJSON(OpenAPI_enhanced_coverage_restriction_data_t *enhanced_coverage_restriction_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_enhanced_coverage_restriction_data_H_ */ + diff --git a/lib/sbi/openapi/model/eps_interworking_info.c b/lib/sbi/openapi/model/eps_interworking_info.c new file mode 100644 index 0000000000..e977060dba --- /dev/null +++ b/lib/sbi/openapi/model/eps_interworking_info.c @@ -0,0 +1,104 @@ + +#include +#include +#include +#include "eps_interworking_info.h" + +OpenAPI_eps_interworking_info_t *OpenAPI_eps_interworking_info_create( + OpenAPI_list_t* eps_iwk_pgws + ) +{ + OpenAPI_eps_interworking_info_t *eps_interworking_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_eps_interworking_info_t)); + if (!eps_interworking_info_local_var) { + return NULL; + } + eps_interworking_info_local_var->eps_iwk_pgws = eps_iwk_pgws; + + return eps_interworking_info_local_var; +} + +void OpenAPI_eps_interworking_info_free(OpenAPI_eps_interworking_info_t *eps_interworking_info) +{ + if (NULL == eps_interworking_info) { + return; + } + 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); + ogs_free(localKeyValue); + } + OpenAPI_list_free(eps_interworking_info->eps_iwk_pgws); + ogs_free(eps_interworking_info); +} + +cJSON *OpenAPI_eps_interworking_info_convertToJSON(OpenAPI_eps_interworking_info_t *eps_interworking_info) +{ + cJSON *item = NULL; + + if (eps_interworking_info == NULL) { + ogs_error("OpenAPI_eps_interworking_info_convertToJSON() failed [EpsInterworkingInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (eps_interworking_info->eps_iwk_pgws) { + cJSON *eps_iwk_pgws = cJSON_AddObjectToObject(item, "epsIwkPgws"); + if (eps_iwk_pgws == NULL) { + ogs_error("OpenAPI_eps_interworking_info_convertToJSON() failed [eps_iwk_pgws]"); + goto end; + } + cJSON *localMapObject = eps_iwk_pgws; + OpenAPI_lnode_t *eps_iwk_pgws_node; + 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); + if (itemLocal == NULL) { + ogs_error("OpenAPI_eps_interworking_info_convertToJSON() failed [eps_iwk_pgws]"); + goto end; + } + cJSON_AddItemToObject(eps_iwk_pgws, localKeyValue->key, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_eps_interworking_info_t *OpenAPI_eps_interworking_info_parseFromJSON(cJSON *eps_interworking_infoJSON) +{ + OpenAPI_eps_interworking_info_t *eps_interworking_info_local_var = NULL; + cJSON *eps_iwk_pgws = cJSON_GetObjectItemCaseSensitive(eps_interworking_infoJSON, "epsIwkPgws"); + + OpenAPI_list_t *eps_iwk_pgwsList; + if (eps_iwk_pgws) { + cJSON *eps_iwk_pgws_local_map; + if (!cJSON_IsObject(eps_iwk_pgws)) { + ogs_error("OpenAPI_eps_interworking_info_parseFromJSON() failed [eps_iwk_pgws]"); + goto end; + } + eps_iwk_pgwsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(eps_iwk_pgws_local_map, eps_iwk_pgws) { + cJSON *localMapObject = eps_iwk_pgws_local_map; + if (!cJSON_IsObject(eps_iwk_pgws_local_map)) { + ogs_error("OpenAPI_eps_interworking_info_parseFromJSON() failed [eps_iwk_pgws]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_object_parseFromJSON(localMapObject)); + OpenAPI_list_add(eps_iwk_pgwsList, localMapKeyPair); + } + } + + eps_interworking_info_local_var = OpenAPI_eps_interworking_info_create ( + eps_iwk_pgws ? eps_iwk_pgwsList : NULL + ); + + return eps_interworking_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/eps_interworking_info.h b/lib/sbi/openapi/model/eps_interworking_info.h new file mode 100644 index 0000000000..852a434ec2 --- /dev/null +++ b/lib/sbi/openapi/model/eps_interworking_info.h @@ -0,0 +1,38 @@ +/* + * eps_interworking_info.h + * + * + */ + +#ifndef _OpenAPI_eps_interworking_info_H_ +#define _OpenAPI_eps_interworking_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "object.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_eps_interworking_info_s OpenAPI_eps_interworking_info_t; +typedef struct OpenAPI_eps_interworking_info_s { + OpenAPI_list_t* eps_iwk_pgws; +} OpenAPI_eps_interworking_info_t; + +OpenAPI_eps_interworking_info_t *OpenAPI_eps_interworking_info_create( + OpenAPI_list_t* eps_iwk_pgws + ); +void OpenAPI_eps_interworking_info_free(OpenAPI_eps_interworking_info_t *eps_interworking_info); +OpenAPI_eps_interworking_info_t *OpenAPI_eps_interworking_info_parseFromJSON(cJSON *eps_interworking_infoJSON); +cJSON *OpenAPI_eps_interworking_info_convertToJSON(OpenAPI_eps_interworking_info_t *eps_interworking_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_eps_interworking_info_H_ */ + diff --git a/lib/sbi/openapi/model/eps_iwk_pgw.c b/lib/sbi/openapi/model/eps_iwk_pgw.c new file mode 100644 index 0000000000..e5a4dffbf7 --- /dev/null +++ b/lib/sbi/openapi/model/eps_iwk_pgw.c @@ -0,0 +1,101 @@ + +#include +#include +#include +#include "eps_iwk_pgw.h" + +OpenAPI_eps_iwk_pgw_t *OpenAPI_eps_iwk_pgw_create( + char *pgw_fqdn, + char *smf_instance_id + ) +{ + OpenAPI_eps_iwk_pgw_t *eps_iwk_pgw_local_var = OpenAPI_malloc(sizeof(OpenAPI_eps_iwk_pgw_t)); + if (!eps_iwk_pgw_local_var) { + return NULL; + } + eps_iwk_pgw_local_var->pgw_fqdn = pgw_fqdn; + eps_iwk_pgw_local_var->smf_instance_id = smf_instance_id; + + return eps_iwk_pgw_local_var; +} + +void OpenAPI_eps_iwk_pgw_free(OpenAPI_eps_iwk_pgw_t *eps_iwk_pgw) +{ + if (NULL == eps_iwk_pgw) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(eps_iwk_pgw->pgw_fqdn); + ogs_free(eps_iwk_pgw->smf_instance_id); + ogs_free(eps_iwk_pgw); +} + +cJSON *OpenAPI_eps_iwk_pgw_convertToJSON(OpenAPI_eps_iwk_pgw_t *eps_iwk_pgw) +{ + cJSON *item = NULL; + + if (eps_iwk_pgw == NULL) { + ogs_error("OpenAPI_eps_iwk_pgw_convertToJSON() failed [EpsIwkPgw]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!eps_iwk_pgw->pgw_fqdn) { + ogs_error("OpenAPI_eps_iwk_pgw_convertToJSON() failed [pgw_fqdn]"); + goto end; + } + if (cJSON_AddStringToObject(item, "pgwFqdn", eps_iwk_pgw->pgw_fqdn) == NULL) { + ogs_error("OpenAPI_eps_iwk_pgw_convertToJSON() failed [pgw_fqdn]"); + goto end; + } + + if (!eps_iwk_pgw->smf_instance_id) { + ogs_error("OpenAPI_eps_iwk_pgw_convertToJSON() failed [smf_instance_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "smfInstanceId", eps_iwk_pgw->smf_instance_id) == NULL) { + ogs_error("OpenAPI_eps_iwk_pgw_convertToJSON() failed [smf_instance_id]"); + goto end; + } + +end: + return item; +} + +OpenAPI_eps_iwk_pgw_t *OpenAPI_eps_iwk_pgw_parseFromJSON(cJSON *eps_iwk_pgwJSON) +{ + OpenAPI_eps_iwk_pgw_t *eps_iwk_pgw_local_var = NULL; + cJSON *pgw_fqdn = cJSON_GetObjectItemCaseSensitive(eps_iwk_pgwJSON, "pgwFqdn"); + if (!pgw_fqdn) { + ogs_error("OpenAPI_eps_iwk_pgw_parseFromJSON() failed [pgw_fqdn]"); + goto end; + } + + + if (!cJSON_IsString(pgw_fqdn)) { + ogs_error("OpenAPI_eps_iwk_pgw_parseFromJSON() failed [pgw_fqdn]"); + goto end; + } + + cJSON *smf_instance_id = cJSON_GetObjectItemCaseSensitive(eps_iwk_pgwJSON, "smfInstanceId"); + if (!smf_instance_id) { + ogs_error("OpenAPI_eps_iwk_pgw_parseFromJSON() failed [smf_instance_id]"); + goto end; + } + + + if (!cJSON_IsString(smf_instance_id)) { + ogs_error("OpenAPI_eps_iwk_pgw_parseFromJSON() failed [smf_instance_id]"); + goto end; + } + + eps_iwk_pgw_local_var = OpenAPI_eps_iwk_pgw_create ( + ogs_strdup(pgw_fqdn->valuestring), + ogs_strdup(smf_instance_id->valuestring) + ); + + return eps_iwk_pgw_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/eps_iwk_pgw.h b/lib/sbi/openapi/model/eps_iwk_pgw.h new file mode 100644 index 0000000000..adcf96dadd --- /dev/null +++ b/lib/sbi/openapi/model/eps_iwk_pgw.h @@ -0,0 +1,39 @@ +/* + * eps_iwk_pgw.h + * + * + */ + +#ifndef _OpenAPI_eps_iwk_pgw_H_ +#define _OpenAPI_eps_iwk_pgw_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_eps_iwk_pgw_s OpenAPI_eps_iwk_pgw_t; +typedef struct OpenAPI_eps_iwk_pgw_s { + char *pgw_fqdn; + char *smf_instance_id; +} OpenAPI_eps_iwk_pgw_t; + +OpenAPI_eps_iwk_pgw_t *OpenAPI_eps_iwk_pgw_create( + char *pgw_fqdn, + char *smf_instance_id + ); +void OpenAPI_eps_iwk_pgw_free(OpenAPI_eps_iwk_pgw_t *eps_iwk_pgw); +OpenAPI_eps_iwk_pgw_t *OpenAPI_eps_iwk_pgw_parseFromJSON(cJSON *eps_iwk_pgwJSON); +cJSON *OpenAPI_eps_iwk_pgw_convertToJSON(OpenAPI_eps_iwk_pgw_t *eps_iwk_pgw); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_eps_iwk_pgw_H_ */ + diff --git a/lib/sbi/openapi/model/eth_flow_description.c b/lib/sbi/openapi/model/eth_flow_description.c new file mode 100644 index 0000000000..62fd59b866 --- /dev/null +++ b/lib/sbi/openapi/model/eth_flow_description.c @@ -0,0 +1,243 @@ + +#include +#include +#include +#include "eth_flow_description.h" + +OpenAPI_eth_flow_description_t *OpenAPI_eth_flow_description_create( + char *dest_mac_addr, + char *eth_type, + char *f_desc, + OpenAPI_flow_direction_t *f_dir, + char *source_mac_addr, + OpenAPI_list_t *vlan_tags, + char *src_mac_addr_end, + char *dest_mac_addr_end + ) +{ + OpenAPI_eth_flow_description_t *eth_flow_description_local_var = OpenAPI_malloc(sizeof(OpenAPI_eth_flow_description_t)); + if (!eth_flow_description_local_var) { + return NULL; + } + eth_flow_description_local_var->dest_mac_addr = dest_mac_addr; + eth_flow_description_local_var->eth_type = eth_type; + eth_flow_description_local_var->f_desc = f_desc; + eth_flow_description_local_var->f_dir = f_dir; + eth_flow_description_local_var->source_mac_addr = source_mac_addr; + eth_flow_description_local_var->vlan_tags = vlan_tags; + eth_flow_description_local_var->src_mac_addr_end = src_mac_addr_end; + eth_flow_description_local_var->dest_mac_addr_end = dest_mac_addr_end; + + return eth_flow_description_local_var; +} + +void OpenAPI_eth_flow_description_free(OpenAPI_eth_flow_description_t *eth_flow_description) +{ + if (NULL == eth_flow_description) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(eth_flow_description->dest_mac_addr); + ogs_free(eth_flow_description->eth_type); + ogs_free(eth_flow_description->f_desc); + OpenAPI_flow_direction_free(eth_flow_description->f_dir); + ogs_free(eth_flow_description->source_mac_addr); + OpenAPI_list_for_each(eth_flow_description->vlan_tags, node) { + ogs_free(node->data); + } + OpenAPI_list_free(eth_flow_description->vlan_tags); + ogs_free(eth_flow_description->src_mac_addr_end); + ogs_free(eth_flow_description->dest_mac_addr_end); + ogs_free(eth_flow_description); +} + +cJSON *OpenAPI_eth_flow_description_convertToJSON(OpenAPI_eth_flow_description_t *eth_flow_description) +{ + cJSON *item = NULL; + + if (eth_flow_description == NULL) { + ogs_error("OpenAPI_eth_flow_description_convertToJSON() failed [EthFlowDescription]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (eth_flow_description->dest_mac_addr) { + if (cJSON_AddStringToObject(item, "destMacAddr", eth_flow_description->dest_mac_addr) == NULL) { + ogs_error("OpenAPI_eth_flow_description_convertToJSON() failed [dest_mac_addr]"); + goto end; + } + } + + if (!eth_flow_description->eth_type) { + ogs_error("OpenAPI_eth_flow_description_convertToJSON() failed [eth_type]"); + goto end; + } + if (cJSON_AddStringToObject(item, "ethType", eth_flow_description->eth_type) == NULL) { + ogs_error("OpenAPI_eth_flow_description_convertToJSON() failed [eth_type]"); + goto end; + } + + if (eth_flow_description->f_desc) { + if (cJSON_AddStringToObject(item, "fDesc", eth_flow_description->f_desc) == NULL) { + ogs_error("OpenAPI_eth_flow_description_convertToJSON() failed [f_desc]"); + goto end; + } + } + + if (eth_flow_description->f_dir) { + cJSON *f_dir_local_JSON = OpenAPI_flow_direction_convertToJSON(eth_flow_description->f_dir); + if (f_dir_local_JSON == NULL) { + ogs_error("OpenAPI_eth_flow_description_convertToJSON() failed [f_dir]"); + goto end; + } + cJSON_AddItemToObject(item, "fDir", f_dir_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_eth_flow_description_convertToJSON() failed [f_dir]"); + goto end; + } + } + + if (eth_flow_description->source_mac_addr) { + if (cJSON_AddStringToObject(item, "sourceMacAddr", eth_flow_description->source_mac_addr) == NULL) { + ogs_error("OpenAPI_eth_flow_description_convertToJSON() failed [source_mac_addr]"); + goto end; + } + } + + if (eth_flow_description->vlan_tags) { + cJSON *vlan_tags = cJSON_AddArrayToObject(item, "vlanTags"); + if (vlan_tags == NULL) { + ogs_error("OpenAPI_eth_flow_description_convertToJSON() failed [vlan_tags]"); + goto end; + } + + OpenAPI_lnode_t *vlan_tags_node; + OpenAPI_list_for_each(eth_flow_description->vlan_tags, vlan_tags_node) { + if (cJSON_AddStringToObject(vlan_tags, "", (char*)vlan_tags_node->data) == NULL) { + ogs_error("OpenAPI_eth_flow_description_convertToJSON() failed [vlan_tags]"); + goto end; + } + } + } + + if (eth_flow_description->src_mac_addr_end) { + if (cJSON_AddStringToObject(item, "srcMacAddrEnd", eth_flow_description->src_mac_addr_end) == NULL) { + ogs_error("OpenAPI_eth_flow_description_convertToJSON() failed [src_mac_addr_end]"); + goto end; + } + } + + if (eth_flow_description->dest_mac_addr_end) { + if (cJSON_AddStringToObject(item, "destMacAddrEnd", eth_flow_description->dest_mac_addr_end) == NULL) { + ogs_error("OpenAPI_eth_flow_description_convertToJSON() failed [dest_mac_addr_end]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_eth_flow_description_t *OpenAPI_eth_flow_description_parseFromJSON(cJSON *eth_flow_descriptionJSON) +{ + OpenAPI_eth_flow_description_t *eth_flow_description_local_var = NULL; + cJSON *dest_mac_addr = cJSON_GetObjectItemCaseSensitive(eth_flow_descriptionJSON, "destMacAddr"); + + if (dest_mac_addr) { + if (!cJSON_IsString(dest_mac_addr)) { + ogs_error("OpenAPI_eth_flow_description_parseFromJSON() failed [dest_mac_addr]"); + goto end; + } + } + + cJSON *eth_type = cJSON_GetObjectItemCaseSensitive(eth_flow_descriptionJSON, "ethType"); + if (!eth_type) { + ogs_error("OpenAPI_eth_flow_description_parseFromJSON() failed [eth_type]"); + goto end; + } + + + if (!cJSON_IsString(eth_type)) { + ogs_error("OpenAPI_eth_flow_description_parseFromJSON() failed [eth_type]"); + goto end; + } + + cJSON *f_desc = cJSON_GetObjectItemCaseSensitive(eth_flow_descriptionJSON, "fDesc"); + + if (f_desc) { + if (!cJSON_IsString(f_desc)) { + ogs_error("OpenAPI_eth_flow_description_parseFromJSON() failed [f_desc]"); + goto end; + } + } + + cJSON *f_dir = cJSON_GetObjectItemCaseSensitive(eth_flow_descriptionJSON, "fDir"); + + OpenAPI_flow_direction_t *f_dir_local_nonprim = NULL; + if (f_dir) { + f_dir_local_nonprim = OpenAPI_flow_direction_parseFromJSON(f_dir); + } + + cJSON *source_mac_addr = cJSON_GetObjectItemCaseSensitive(eth_flow_descriptionJSON, "sourceMacAddr"); + + if (source_mac_addr) { + if (!cJSON_IsString(source_mac_addr)) { + ogs_error("OpenAPI_eth_flow_description_parseFromJSON() failed [source_mac_addr]"); + goto end; + } + } + + cJSON *vlan_tags = cJSON_GetObjectItemCaseSensitive(eth_flow_descriptionJSON, "vlanTags"); + + OpenAPI_list_t *vlan_tagsList; + if (vlan_tags) { + cJSON *vlan_tags_local; + if (!cJSON_IsArray(vlan_tags)) { + ogs_error("OpenAPI_eth_flow_description_parseFromJSON() failed [vlan_tags]"); + goto end; + } + vlan_tagsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(vlan_tags_local, vlan_tags) { + if (!cJSON_IsString(vlan_tags_local)) { + ogs_error("OpenAPI_eth_flow_description_parseFromJSON() failed [vlan_tags]"); + goto end; + } + OpenAPI_list_add(vlan_tagsList, ogs_strdup(vlan_tags_local->valuestring)); + } + } + + cJSON *src_mac_addr_end = cJSON_GetObjectItemCaseSensitive(eth_flow_descriptionJSON, "srcMacAddrEnd"); + + if (src_mac_addr_end) { + if (!cJSON_IsString(src_mac_addr_end)) { + ogs_error("OpenAPI_eth_flow_description_parseFromJSON() failed [src_mac_addr_end]"); + goto end; + } + } + + cJSON *dest_mac_addr_end = cJSON_GetObjectItemCaseSensitive(eth_flow_descriptionJSON, "destMacAddrEnd"); + + if (dest_mac_addr_end) { + if (!cJSON_IsString(dest_mac_addr_end)) { + ogs_error("OpenAPI_eth_flow_description_parseFromJSON() failed [dest_mac_addr_end]"); + goto end; + } + } + + eth_flow_description_local_var = OpenAPI_eth_flow_description_create ( + dest_mac_addr ? ogs_strdup(dest_mac_addr->valuestring) : NULL, + ogs_strdup(eth_type->valuestring), + f_desc ? ogs_strdup(f_desc->valuestring) : NULL, + f_dir ? f_dir_local_nonprim : NULL, + source_mac_addr ? ogs_strdup(source_mac_addr->valuestring) : NULL, + vlan_tags ? vlan_tagsList : NULL, + src_mac_addr_end ? ogs_strdup(src_mac_addr_end->valuestring) : NULL, + dest_mac_addr_end ? ogs_strdup(dest_mac_addr_end->valuestring) : NULL + ); + + return eth_flow_description_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/eth_flow_description.h b/lib/sbi/openapi/model/eth_flow_description.h new file mode 100644 index 0000000000..3f1711d1f9 --- /dev/null +++ b/lib/sbi/openapi/model/eth_flow_description.h @@ -0,0 +1,52 @@ +/* + * eth_flow_description.h + * + * Identifies an Ethernet flow + */ + +#ifndef _OpenAPI_eth_flow_description_H_ +#define _OpenAPI_eth_flow_description_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "flow_direction.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_eth_flow_description_s OpenAPI_eth_flow_description_t; +typedef struct OpenAPI_eth_flow_description_s { + char *dest_mac_addr; + char *eth_type; + char *f_desc; + struct OpenAPI_flow_direction_s *f_dir; + char *source_mac_addr; + OpenAPI_list_t *vlan_tags; + char *src_mac_addr_end; + char *dest_mac_addr_end; +} OpenAPI_eth_flow_description_t; + +OpenAPI_eth_flow_description_t *OpenAPI_eth_flow_description_create( + char *dest_mac_addr, + char *eth_type, + char *f_desc, + OpenAPI_flow_direction_t *f_dir, + char *source_mac_addr, + OpenAPI_list_t *vlan_tags, + char *src_mac_addr_end, + char *dest_mac_addr_end + ); +void OpenAPI_eth_flow_description_free(OpenAPI_eth_flow_description_t *eth_flow_description); +OpenAPI_eth_flow_description_t *OpenAPI_eth_flow_description_parseFromJSON(cJSON *eth_flow_descriptionJSON); +cJSON *OpenAPI_eth_flow_description_convertToJSON(OpenAPI_eth_flow_description_t *eth_flow_description); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_eth_flow_description_H_ */ + diff --git a/lib/sbi/openapi/model/eutra_location.c b/lib/sbi/openapi/model/eutra_location.c new file mode 100644 index 0000000000..6b5f22af23 --- /dev/null +++ b/lib/sbi/openapi/model/eutra_location.c @@ -0,0 +1,255 @@ + +#include +#include +#include +#include "eutra_location.h" + +OpenAPI_eutra_location_t *OpenAPI_eutra_location_create( + OpenAPI_tai_t *tai, + OpenAPI_ecgi_t *ecgi, + int ignore_ecgi, + int age_of_location_information, + char *ue_location_timestamp, + char *geographical_information, + char *geodetic_information, + OpenAPI_global_ran_node_id_t *global_ngenb_id, + OpenAPI_global_ran_node_id_t *global_e_nb_id + ) +{ + OpenAPI_eutra_location_t *eutra_location_local_var = OpenAPI_malloc(sizeof(OpenAPI_eutra_location_t)); + if (!eutra_location_local_var) { + return NULL; + } + eutra_location_local_var->tai = tai; + eutra_location_local_var->ecgi = ecgi; + eutra_location_local_var->ignore_ecgi = ignore_ecgi; + eutra_location_local_var->age_of_location_information = age_of_location_information; + eutra_location_local_var->ue_location_timestamp = ue_location_timestamp; + eutra_location_local_var->geographical_information = geographical_information; + eutra_location_local_var->geodetic_information = geodetic_information; + eutra_location_local_var->global_ngenb_id = global_ngenb_id; + eutra_location_local_var->global_e_nb_id = global_e_nb_id; + + return eutra_location_local_var; +} + +void OpenAPI_eutra_location_free(OpenAPI_eutra_location_t *eutra_location) +{ + if (NULL == eutra_location) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_tai_free(eutra_location->tai); + OpenAPI_ecgi_free(eutra_location->ecgi); + ogs_free(eutra_location->ue_location_timestamp); + ogs_free(eutra_location->geographical_information); + ogs_free(eutra_location->geodetic_information); + OpenAPI_global_ran_node_id_free(eutra_location->global_ngenb_id); + OpenAPI_global_ran_node_id_free(eutra_location->global_e_nb_id); + ogs_free(eutra_location); +} + +cJSON *OpenAPI_eutra_location_convertToJSON(OpenAPI_eutra_location_t *eutra_location) +{ + cJSON *item = NULL; + + if (eutra_location == NULL) { + ogs_error("OpenAPI_eutra_location_convertToJSON() failed [EutraLocation]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!eutra_location->tai) { + ogs_error("OpenAPI_eutra_location_convertToJSON() failed [tai]"); + goto end; + } + cJSON *tai_local_JSON = OpenAPI_tai_convertToJSON(eutra_location->tai); + if (tai_local_JSON == NULL) { + ogs_error("OpenAPI_eutra_location_convertToJSON() failed [tai]"); + goto end; + } + cJSON_AddItemToObject(item, "tai", tai_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_eutra_location_convertToJSON() failed [tai]"); + goto end; + } + + if (!eutra_location->ecgi) { + ogs_error("OpenAPI_eutra_location_convertToJSON() failed [ecgi]"); + goto end; + } + cJSON *ecgi_local_JSON = OpenAPI_ecgi_convertToJSON(eutra_location->ecgi); + if (ecgi_local_JSON == NULL) { + ogs_error("OpenAPI_eutra_location_convertToJSON() failed [ecgi]"); + goto end; + } + cJSON_AddItemToObject(item, "ecgi", ecgi_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_eutra_location_convertToJSON() failed [ecgi]"); + goto end; + } + + if (eutra_location->ignore_ecgi >= 0) { + if (cJSON_AddBoolToObject(item, "ignoreEcgi", eutra_location->ignore_ecgi) == NULL) { + ogs_error("OpenAPI_eutra_location_convertToJSON() failed [ignore_ecgi]"); + goto end; + } + } + + if (eutra_location->age_of_location_information) { + if (cJSON_AddNumberToObject(item, "ageOfLocationInformation", eutra_location->age_of_location_information) == NULL) { + ogs_error("OpenAPI_eutra_location_convertToJSON() failed [age_of_location_information]"); + goto end; + } + } + + if (eutra_location->ue_location_timestamp) { + if (cJSON_AddStringToObject(item, "ueLocationTimestamp", eutra_location->ue_location_timestamp) == NULL) { + ogs_error("OpenAPI_eutra_location_convertToJSON() failed [ue_location_timestamp]"); + goto end; + } + } + + if (eutra_location->geographical_information) { + if (cJSON_AddStringToObject(item, "geographicalInformation", eutra_location->geographical_information) == NULL) { + ogs_error("OpenAPI_eutra_location_convertToJSON() failed [geographical_information]"); + goto end; + } + } + + if (eutra_location->geodetic_information) { + if (cJSON_AddStringToObject(item, "geodeticInformation", eutra_location->geodetic_information) == NULL) { + ogs_error("OpenAPI_eutra_location_convertToJSON() failed [geodetic_information]"); + goto end; + } + } + + if (eutra_location->global_ngenb_id) { + cJSON *global_ngenb_id_local_JSON = OpenAPI_global_ran_node_id_convertToJSON(eutra_location->global_ngenb_id); + if (global_ngenb_id_local_JSON == NULL) { + ogs_error("OpenAPI_eutra_location_convertToJSON() failed [global_ngenb_id]"); + goto end; + } + cJSON_AddItemToObject(item, "globalNgenbId", global_ngenb_id_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_eutra_location_convertToJSON() failed [global_ngenb_id]"); + goto end; + } + } + + if (eutra_location->global_e_nb_id) { + cJSON *global_e_nb_id_local_JSON = OpenAPI_global_ran_node_id_convertToJSON(eutra_location->global_e_nb_id); + if (global_e_nb_id_local_JSON == NULL) { + ogs_error("OpenAPI_eutra_location_convertToJSON() failed [global_e_nb_id]"); + goto end; + } + cJSON_AddItemToObject(item, "globalENbId", global_e_nb_id_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_eutra_location_convertToJSON() failed [global_e_nb_id]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_eutra_location_t *OpenAPI_eutra_location_parseFromJSON(cJSON *eutra_locationJSON) +{ + OpenAPI_eutra_location_t *eutra_location_local_var = NULL; + cJSON *tai = cJSON_GetObjectItemCaseSensitive(eutra_locationJSON, "tai"); + if (!tai) { + ogs_error("OpenAPI_eutra_location_parseFromJSON() failed [tai]"); + goto end; + } + + OpenAPI_tai_t *tai_local_nonprim = NULL; + + tai_local_nonprim = OpenAPI_tai_parseFromJSON(tai); + + cJSON *ecgi = cJSON_GetObjectItemCaseSensitive(eutra_locationJSON, "ecgi"); + if (!ecgi) { + ogs_error("OpenAPI_eutra_location_parseFromJSON() failed [ecgi]"); + goto end; + } + + OpenAPI_ecgi_t *ecgi_local_nonprim = NULL; + + ecgi_local_nonprim = OpenAPI_ecgi_parseFromJSON(ecgi); + + cJSON *ignore_ecgi = cJSON_GetObjectItemCaseSensitive(eutra_locationJSON, "ignoreEcgi"); + + if (ignore_ecgi) { + if (!cJSON_IsBool(ignore_ecgi)) { + ogs_error("OpenAPI_eutra_location_parseFromJSON() failed [ignore_ecgi]"); + goto end; + } + } + + cJSON *age_of_location_information = cJSON_GetObjectItemCaseSensitive(eutra_locationJSON, "ageOfLocationInformation"); + + if (age_of_location_information) { + if (!cJSON_IsNumber(age_of_location_information)) { + ogs_error("OpenAPI_eutra_location_parseFromJSON() failed [age_of_location_information]"); + goto end; + } + } + + cJSON *ue_location_timestamp = cJSON_GetObjectItemCaseSensitive(eutra_locationJSON, "ueLocationTimestamp"); + + if (ue_location_timestamp) { + if (!cJSON_IsString(ue_location_timestamp)) { + ogs_error("OpenAPI_eutra_location_parseFromJSON() failed [ue_location_timestamp]"); + goto end; + } + } + + cJSON *geographical_information = cJSON_GetObjectItemCaseSensitive(eutra_locationJSON, "geographicalInformation"); + + if (geographical_information) { + if (!cJSON_IsString(geographical_information)) { + ogs_error("OpenAPI_eutra_location_parseFromJSON() failed [geographical_information]"); + goto end; + } + } + + cJSON *geodetic_information = cJSON_GetObjectItemCaseSensitive(eutra_locationJSON, "geodeticInformation"); + + if (geodetic_information) { + if (!cJSON_IsString(geodetic_information)) { + ogs_error("OpenAPI_eutra_location_parseFromJSON() failed [geodetic_information]"); + goto end; + } + } + + cJSON *global_ngenb_id = cJSON_GetObjectItemCaseSensitive(eutra_locationJSON, "globalNgenbId"); + + OpenAPI_global_ran_node_id_t *global_ngenb_id_local_nonprim = NULL; + if (global_ngenb_id) { + global_ngenb_id_local_nonprim = OpenAPI_global_ran_node_id_parseFromJSON(global_ngenb_id); + } + + cJSON *global_e_nb_id = cJSON_GetObjectItemCaseSensitive(eutra_locationJSON, "globalENbId"); + + OpenAPI_global_ran_node_id_t *global_e_nb_id_local_nonprim = NULL; + if (global_e_nb_id) { + global_e_nb_id_local_nonprim = OpenAPI_global_ran_node_id_parseFromJSON(global_e_nb_id); + } + + eutra_location_local_var = OpenAPI_eutra_location_create ( + tai_local_nonprim, + ecgi_local_nonprim, + ignore_ecgi ? ignore_ecgi->valueint : 0, + age_of_location_information ? age_of_location_information->valuedouble : 0, + ue_location_timestamp ? ogs_strdup(ue_location_timestamp->valuestring) : NULL, + geographical_information ? ogs_strdup(geographical_information->valuestring) : NULL, + geodetic_information ? ogs_strdup(geodetic_information->valuestring) : NULL, + global_ngenb_id ? global_ngenb_id_local_nonprim : NULL, + global_e_nb_id ? global_e_nb_id_local_nonprim : NULL + ); + + return eutra_location_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/eutra_location.h b/lib/sbi/openapi/model/eutra_location.h new file mode 100644 index 0000000000..79b72769e9 --- /dev/null +++ b/lib/sbi/openapi/model/eutra_location.h @@ -0,0 +1,56 @@ +/* + * eutra_location.h + * + * + */ + +#ifndef _OpenAPI_eutra_location_H_ +#define _OpenAPI_eutra_location_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "ecgi.h" +#include "global_ran_node_id.h" +#include "tai.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_eutra_location_s OpenAPI_eutra_location_t; +typedef struct OpenAPI_eutra_location_s { + struct OpenAPI_tai_s *tai; + struct OpenAPI_ecgi_s *ecgi; + int ignore_ecgi; + int age_of_location_information; + char *ue_location_timestamp; + char *geographical_information; + char *geodetic_information; + struct OpenAPI_global_ran_node_id_s *global_ngenb_id; + struct OpenAPI_global_ran_node_id_s *global_e_nb_id; +} OpenAPI_eutra_location_t; + +OpenAPI_eutra_location_t *OpenAPI_eutra_location_create( + OpenAPI_tai_t *tai, + OpenAPI_ecgi_t *ecgi, + int ignore_ecgi, + int age_of_location_information, + char *ue_location_timestamp, + char *geographical_information, + char *geodetic_information, + OpenAPI_global_ran_node_id_t *global_ngenb_id, + OpenAPI_global_ran_node_id_t *global_e_nb_id + ); +void OpenAPI_eutra_location_free(OpenAPI_eutra_location_t *eutra_location); +OpenAPI_eutra_location_t *OpenAPI_eutra_location_parseFromJSON(cJSON *eutra_locationJSON); +cJSON *OpenAPI_eutra_location_convertToJSON(OpenAPI_eutra_location_t *eutra_location); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_eutra_location_H_ */ + diff --git a/lib/sbi/openapi/model/event_report_mode.c b/lib/sbi/openapi/model/event_report_mode.c new file mode 100644 index 0000000000..88d5c937c6 --- /dev/null +++ b/lib/sbi/openapi/model/event_report_mode.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "event_report_mode.h" + +OpenAPI_event_report_mode_t *OpenAPI_event_report_mode_create( + ) +{ + OpenAPI_event_report_mode_t *event_report_mode_local_var = OpenAPI_malloc(sizeof(OpenAPI_event_report_mode_t)); + if (!event_report_mode_local_var) { + return NULL; + } + + return event_report_mode_local_var; +} + +void OpenAPI_event_report_mode_free(OpenAPI_event_report_mode_t *event_report_mode) +{ + if (NULL == event_report_mode) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(event_report_mode); +} + +cJSON *OpenAPI_event_report_mode_convertToJSON(OpenAPI_event_report_mode_t *event_report_mode) +{ + cJSON *item = NULL; + + if (event_report_mode == NULL) { + ogs_error("OpenAPI_event_report_mode_convertToJSON() failed [EventReportMode]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_event_report_mode_t *OpenAPI_event_report_mode_parseFromJSON(cJSON *event_report_modeJSON) +{ + OpenAPI_event_report_mode_t *event_report_mode_local_var = NULL; + event_report_mode_local_var = OpenAPI_event_report_mode_create ( + ); + + return event_report_mode_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/event_report_mode.h b/lib/sbi/openapi/model/event_report_mode.h new file mode 100644 index 0000000000..eb86f42890 --- /dev/null +++ b/lib/sbi/openapi/model/event_report_mode.h @@ -0,0 +1,35 @@ +/* + * event_report_mode.h + * + * + */ + +#ifndef _OpenAPI_event_report_mode_H_ +#define _OpenAPI_event_report_mode_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_event_report_mode_s OpenAPI_event_report_mode_t; +typedef struct OpenAPI_event_report_mode_s { +} OpenAPI_event_report_mode_t; + +OpenAPI_event_report_mode_t *OpenAPI_event_report_mode_create( + ); +void OpenAPI_event_report_mode_free(OpenAPI_event_report_mode_t *event_report_mode); +OpenAPI_event_report_mode_t *OpenAPI_event_report_mode_parseFromJSON(cJSON *event_report_modeJSON); +cJSON *OpenAPI_event_report_mode_convertToJSON(OpenAPI_event_report_mode_t *event_report_mode); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_event_report_mode_H_ */ + diff --git a/lib/sbi/openapi/model/event_type.c b/lib/sbi/openapi/model/event_type.c new file mode 100644 index 0000000000..4c8e683b4a --- /dev/null +++ b/lib/sbi/openapi/model/event_type.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "event_type.h" + +OpenAPI_event_type_t *OpenAPI_event_type_create( + ) +{ + OpenAPI_event_type_t *event_type_local_var = OpenAPI_malloc(sizeof(OpenAPI_event_type_t)); + if (!event_type_local_var) { + return NULL; + } + + return event_type_local_var; +} + +void OpenAPI_event_type_free(OpenAPI_event_type_t *event_type) +{ + if (NULL == event_type) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(event_type); +} + +cJSON *OpenAPI_event_type_convertToJSON(OpenAPI_event_type_t *event_type) +{ + cJSON *item = NULL; + + if (event_type == NULL) { + ogs_error("OpenAPI_event_type_convertToJSON() failed [EventType]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_event_type_t *OpenAPI_event_type_parseFromJSON(cJSON *event_typeJSON) +{ + OpenAPI_event_type_t *event_type_local_var = NULL; + event_type_local_var = OpenAPI_event_type_create ( + ); + + return event_type_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/event_type.h b/lib/sbi/openapi/model/event_type.h new file mode 100644 index 0000000000..f0dfba92a8 --- /dev/null +++ b/lib/sbi/openapi/model/event_type.h @@ -0,0 +1,35 @@ +/* + * event_type.h + * + * + */ + +#ifndef _OpenAPI_event_type_H_ +#define _OpenAPI_event_type_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_event_type_s OpenAPI_event_type_t; +typedef struct OpenAPI_event_type_s { +} OpenAPI_event_type_t; + +OpenAPI_event_type_t *OpenAPI_event_type_create( + ); +void OpenAPI_event_type_free(OpenAPI_event_type_t *event_type); +OpenAPI_event_type_t *OpenAPI_event_type_parseFromJSON(cJSON *event_typeJSON); +cJSON *OpenAPI_event_type_convertToJSON(OpenAPI_event_type_t *event_type); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_event_type_H_ */ + diff --git a/lib/sbi/openapi/model/expected_ue_behaviour.c b/lib/sbi/openapi/model/expected_ue_behaviour.c new file mode 100644 index 0000000000..2006af4fec --- /dev/null +++ b/lib/sbi/openapi/model/expected_ue_behaviour.c @@ -0,0 +1,328 @@ + +#include +#include +#include +#include "expected_ue_behaviour.h" + +OpenAPI_expected_ue_behaviour_t *OpenAPI_expected_ue_behaviour_create( + char *af_instance_id, + int reference_id, + OpenAPI_stationary_indication_rm_t *stationary_indication, + int communication_duration_time, + OpenAPI_scheduled_communication_type_rm_t *scheduled_communication_type, + int periodic_time, + OpenAPI_scheduled_communication_time_rm_t *scheduled_communication_time, + OpenAPI_list_t *expected_umts, + OpenAPI_traffic_profile_rm_t *traffic_profile, + OpenAPI_battery_indication_rm_t *battery_indication, + char *validity_time + ) +{ + OpenAPI_expected_ue_behaviour_t *expected_ue_behaviour_local_var = OpenAPI_malloc(sizeof(OpenAPI_expected_ue_behaviour_t)); + if (!expected_ue_behaviour_local_var) { + return NULL; + } + expected_ue_behaviour_local_var->af_instance_id = af_instance_id; + expected_ue_behaviour_local_var->reference_id = reference_id; + expected_ue_behaviour_local_var->stationary_indication = stationary_indication; + expected_ue_behaviour_local_var->communication_duration_time = communication_duration_time; + expected_ue_behaviour_local_var->scheduled_communication_type = scheduled_communication_type; + expected_ue_behaviour_local_var->periodic_time = periodic_time; + expected_ue_behaviour_local_var->scheduled_communication_time = scheduled_communication_time; + expected_ue_behaviour_local_var->expected_umts = expected_umts; + 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; + + return expected_ue_behaviour_local_var; +} + +void OpenAPI_expected_ue_behaviour_free(OpenAPI_expected_ue_behaviour_t *expected_ue_behaviour) +{ + if (NULL == expected_ue_behaviour) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(expected_ue_behaviour->af_instance_id); + OpenAPI_stationary_indication_rm_free(expected_ue_behaviour->stationary_indication); + OpenAPI_scheduled_communication_type_rm_free(expected_ue_behaviour->scheduled_communication_type); + OpenAPI_scheduled_communication_time_rm_free(expected_ue_behaviour->scheduled_communication_time); + OpenAPI_list_for_each(expected_ue_behaviour->expected_umts, node) { + OpenAPI_location_area_free(node->data); + } + OpenAPI_list_free(expected_ue_behaviour->expected_umts); + 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); +} + +cJSON *OpenAPI_expected_ue_behaviour_convertToJSON(OpenAPI_expected_ue_behaviour_t *expected_ue_behaviour) +{ + cJSON *item = NULL; + + if (expected_ue_behaviour == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_convertToJSON() failed [ExpectedUeBehaviour]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!expected_ue_behaviour->af_instance_id) { + ogs_error("OpenAPI_expected_ue_behaviour_convertToJSON() failed [af_instance_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "afInstanceId", expected_ue_behaviour->af_instance_id) == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_convertToJSON() failed [af_instance_id]"); + goto end; + } + + if (!expected_ue_behaviour->reference_id) { + ogs_error("OpenAPI_expected_ue_behaviour_convertToJSON() failed [reference_id]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "referenceId", expected_ue_behaviour->reference_id) == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_convertToJSON() failed [reference_id]"); + goto end; + } + + if (expected_ue_behaviour->stationary_indication) { + cJSON *stationary_indication_local_JSON = OpenAPI_stationary_indication_rm_convertToJSON(expected_ue_behaviour->stationary_indication); + if (stationary_indication_local_JSON == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_convertToJSON() failed [stationary_indication]"); + goto end; + } + cJSON_AddItemToObject(item, "stationaryIndication", stationary_indication_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_convertToJSON() failed [stationary_indication]"); + goto end; + } + } + + if (expected_ue_behaviour->communication_duration_time) { + if (cJSON_AddNumberToObject(item, "communicationDurationTime", expected_ue_behaviour->communication_duration_time) == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_convertToJSON() failed [communication_duration_time]"); + goto end; + } + } + + if (expected_ue_behaviour->scheduled_communication_type) { + cJSON *scheduled_communication_type_local_JSON = OpenAPI_scheduled_communication_type_rm_convertToJSON(expected_ue_behaviour->scheduled_communication_type); + if (scheduled_communication_type_local_JSON == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_convertToJSON() failed [scheduled_communication_type]"); + goto end; + } + cJSON_AddItemToObject(item, "scheduledCommunicationType", scheduled_communication_type_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_convertToJSON() failed [scheduled_communication_type]"); + goto end; + } + } + + if (expected_ue_behaviour->periodic_time) { + if (cJSON_AddNumberToObject(item, "periodicTime", expected_ue_behaviour->periodic_time) == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_convertToJSON() failed [periodic_time]"); + goto end; + } + } + + if (expected_ue_behaviour->scheduled_communication_time) { + cJSON *scheduled_communication_time_local_JSON = OpenAPI_scheduled_communication_time_rm_convertToJSON(expected_ue_behaviour->scheduled_communication_time); + if (scheduled_communication_time_local_JSON == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_convertToJSON() failed [scheduled_communication_time]"); + goto end; + } + cJSON_AddItemToObject(item, "scheduledCommunicationTime", scheduled_communication_time_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_convertToJSON() failed [scheduled_communication_time]"); + goto end; + } + } + + if (expected_ue_behaviour->expected_umts) { + cJSON *expected_umtsList = cJSON_AddArrayToObject(item, "expectedUmts"); + if (expected_umtsList == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_convertToJSON() failed [expected_umts]"); + goto end; + } + + OpenAPI_lnode_t *expected_umts_node; + if (expected_ue_behaviour->expected_umts) { + OpenAPI_list_for_each(expected_ue_behaviour->expected_umts, expected_umts_node) { + cJSON *itemLocal = OpenAPI_location_area_convertToJSON(expected_umts_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_convertToJSON() failed [expected_umts]"); + goto end; + } + cJSON_AddItemToArray(expected_umtsList, itemLocal); + } + } + } + + if (expected_ue_behaviour->traffic_profile) { + cJSON *traffic_profile_local_JSON = OpenAPI_traffic_profile_rm_convertToJSON(expected_ue_behaviour->traffic_profile); + if (traffic_profile_local_JSON == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_convertToJSON() failed [traffic_profile]"); + goto end; + } + cJSON_AddItemToObject(item, "trafficProfile", traffic_profile_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_convertToJSON() failed [traffic_profile]"); + goto end; + } + } + + if (expected_ue_behaviour->battery_indication) { + cJSON *battery_indication_local_JSON = OpenAPI_battery_indication_rm_convertToJSON(expected_ue_behaviour->battery_indication); + if (battery_indication_local_JSON == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_convertToJSON() failed [battery_indication]"); + goto end; + } + cJSON_AddItemToObject(item, "batteryIndication", battery_indication_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_convertToJSON() failed [battery_indication]"); + goto end; + } + } + + if (expected_ue_behaviour->validity_time) { + if (cJSON_AddStringToObject(item, "validityTime", expected_ue_behaviour->validity_time) == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_convertToJSON() failed [validity_time]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_expected_ue_behaviour_t *OpenAPI_expected_ue_behaviour_parseFromJSON(cJSON *expected_ue_behaviourJSON) +{ + OpenAPI_expected_ue_behaviour_t *expected_ue_behaviour_local_var = NULL; + cJSON *af_instance_id = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "afInstanceId"); + if (!af_instance_id) { + ogs_error("OpenAPI_expected_ue_behaviour_parseFromJSON() failed [af_instance_id]"); + goto end; + } + + + if (!cJSON_IsString(af_instance_id)) { + ogs_error("OpenAPI_expected_ue_behaviour_parseFromJSON() failed [af_instance_id]"); + goto end; + } + + cJSON *reference_id = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "referenceId"); + if (!reference_id) { + ogs_error("OpenAPI_expected_ue_behaviour_parseFromJSON() failed [reference_id]"); + goto end; + } + + + if (!cJSON_IsNumber(reference_id)) { + ogs_error("OpenAPI_expected_ue_behaviour_parseFromJSON() failed [reference_id]"); + goto end; + } + + cJSON *stationary_indication = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "stationaryIndication"); + + OpenAPI_stationary_indication_rm_t *stationary_indication_local_nonprim = NULL; + if (stationary_indication) { + stationary_indication_local_nonprim = OpenAPI_stationary_indication_rm_parseFromJSON(stationary_indication); + } + + cJSON *communication_duration_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "communicationDurationTime"); + + if (communication_duration_time) { + if (!cJSON_IsNumber(communication_duration_time)) { + ogs_error("OpenAPI_expected_ue_behaviour_parseFromJSON() failed [communication_duration_time]"); + goto end; + } + } + + cJSON *scheduled_communication_type = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "scheduledCommunicationType"); + + OpenAPI_scheduled_communication_type_rm_t *scheduled_communication_type_local_nonprim = NULL; + if (scheduled_communication_type) { + scheduled_communication_type_local_nonprim = OpenAPI_scheduled_communication_type_rm_parseFromJSON(scheduled_communication_type); + } + + cJSON *periodic_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "periodicTime"); + + if (periodic_time) { + if (!cJSON_IsNumber(periodic_time)) { + ogs_error("OpenAPI_expected_ue_behaviour_parseFromJSON() failed [periodic_time]"); + goto end; + } + } + + cJSON *scheduled_communication_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "scheduledCommunicationTime"); + + OpenAPI_scheduled_communication_time_rm_t *scheduled_communication_time_local_nonprim = NULL; + if (scheduled_communication_time) { + scheduled_communication_time_local_nonprim = OpenAPI_scheduled_communication_time_rm_parseFromJSON(scheduled_communication_time); + } + + cJSON *expected_umts = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "expectedUmts"); + + OpenAPI_list_t *expected_umtsList; + if (expected_umts) { + cJSON *expected_umts_local_nonprimitive; + if (!cJSON_IsArray(expected_umts)) { + ogs_error("OpenAPI_expected_ue_behaviour_parseFromJSON() failed [expected_umts]"); + goto end; + } + + expected_umtsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(expected_umts_local_nonprimitive, expected_umts ) { + if (!cJSON_IsObject(expected_umts_local_nonprimitive)) { + ogs_error("OpenAPI_expected_ue_behaviour_parseFromJSON() failed [expected_umts]"); + goto end; + } + OpenAPI_location_area_t *expected_umtsItem = OpenAPI_location_area_parseFromJSON(expected_umts_local_nonprimitive); + + OpenAPI_list_add(expected_umtsList, expected_umtsItem); + } + } + + cJSON *traffic_profile = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "trafficProfile"); + + OpenAPI_traffic_profile_rm_t *traffic_profile_local_nonprim = NULL; + if (traffic_profile) { + traffic_profile_local_nonprim = OpenAPI_traffic_profile_rm_parseFromJSON(traffic_profile); + } + + cJSON *battery_indication = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "batteryIndication"); + + OpenAPI_battery_indication_rm_t *battery_indication_local_nonprim = NULL; + if (battery_indication) { + battery_indication_local_nonprim = OpenAPI_battery_indication_rm_parseFromJSON(battery_indication); + } + + cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "validityTime"); + + if (validity_time) { + if (!cJSON_IsString(validity_time)) { + ogs_error("OpenAPI_expected_ue_behaviour_parseFromJSON() failed [validity_time]"); + goto end; + } + } + + expected_ue_behaviour_local_var = OpenAPI_expected_ue_behaviour_create ( + ogs_strdup(af_instance_id->valuestring), + reference_id->valuedouble, + stationary_indication ? stationary_indication_local_nonprim : NULL, + communication_duration_time ? communication_duration_time->valuedouble : 0, + scheduled_communication_type ? scheduled_communication_type_local_nonprim : NULL, + periodic_time ? periodic_time->valuedouble : 0, + scheduled_communication_time ? scheduled_communication_time_local_nonprim : NULL, + 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 + ); + + return expected_ue_behaviour_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/expected_ue_behaviour.h b/lib/sbi/openapi/model/expected_ue_behaviour.h new file mode 100644 index 0000000000..8e3d754cf3 --- /dev/null +++ b/lib/sbi/openapi/model/expected_ue_behaviour.h @@ -0,0 +1,63 @@ +/* + * expected_ue_behaviour.h + * + * + */ + +#ifndef _OpenAPI_expected_ue_behaviour_H_ +#define _OpenAPI_expected_ue_behaviour_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "battery_indication_rm.h" +#include "location_area.h" +#include "scheduled_communication_time_rm.h" +#include "scheduled_communication_type_rm.h" +#include "stationary_indication_rm.h" +#include "traffic_profile_rm.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_expected_ue_behaviour_s OpenAPI_expected_ue_behaviour_t; +typedef struct OpenAPI_expected_ue_behaviour_s { + char *af_instance_id; + int reference_id; + struct OpenAPI_stationary_indication_rm_s *stationary_indication; + int communication_duration_time; + struct OpenAPI_scheduled_communication_type_rm_s *scheduled_communication_type; + int periodic_time; + struct OpenAPI_scheduled_communication_time_rm_s *scheduled_communication_time; + OpenAPI_list_t *expected_umts; + struct OpenAPI_traffic_profile_rm_s *traffic_profile; + struct OpenAPI_battery_indication_rm_s *battery_indication; + char *validity_time; +} OpenAPI_expected_ue_behaviour_t; + +OpenAPI_expected_ue_behaviour_t *OpenAPI_expected_ue_behaviour_create( + char *af_instance_id, + int reference_id, + OpenAPI_stationary_indication_rm_t *stationary_indication, + int communication_duration_time, + OpenAPI_scheduled_communication_type_rm_t *scheduled_communication_type, + int periodic_time, + OpenAPI_scheduled_communication_time_rm_t *scheduled_communication_time, + OpenAPI_list_t *expected_umts, + OpenAPI_traffic_profile_rm_t *traffic_profile, + OpenAPI_battery_indication_rm_t *battery_indication, + char *validity_time + ); +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); +cJSON *OpenAPI_expected_ue_behaviour_convertToJSON(OpenAPI_expected_ue_behaviour_t *expected_ue_behaviour); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_expected_ue_behaviour_H_ */ + diff --git a/lib/sbi/openapi/model/expected_ue_behaviour_data.c b/lib/sbi/openapi/model/expected_ue_behaviour_data.c new file mode 100644 index 0000000000..e3741631ce --- /dev/null +++ b/lib/sbi/openapi/model/expected_ue_behaviour_data.c @@ -0,0 +1,279 @@ + +#include +#include +#include +#include "expected_ue_behaviour_data.h" + +OpenAPI_expected_ue_behaviour_data_t *OpenAPI_expected_ue_behaviour_data_create( + OpenAPI_stationary_indication_t *stationary_indication, + int communication_duration_time, + int periodic_time, + OpenAPI_scheduled_communication_time_t *scheduled_communication_time, + OpenAPI_scheduled_communication_type_t *scheduled_communication_type, + OpenAPI_list_t *expected_umts, + OpenAPI_traffic_profile_t *traffic_profile, + OpenAPI_battery_indication_t *battery_indication, + char *validity_time + ) +{ + OpenAPI_expected_ue_behaviour_data_t *expected_ue_behaviour_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_expected_ue_behaviour_data_t)); + if (!expected_ue_behaviour_data_local_var) { + return NULL; + } + expected_ue_behaviour_data_local_var->stationary_indication = stationary_indication; + expected_ue_behaviour_data_local_var->communication_duration_time = communication_duration_time; + expected_ue_behaviour_data_local_var->periodic_time = periodic_time; + expected_ue_behaviour_data_local_var->scheduled_communication_time = scheduled_communication_time; + expected_ue_behaviour_data_local_var->scheduled_communication_type = scheduled_communication_type; + expected_ue_behaviour_data_local_var->expected_umts = expected_umts; + expected_ue_behaviour_data_local_var->traffic_profile = traffic_profile; + expected_ue_behaviour_data_local_var->battery_indication = battery_indication; + expected_ue_behaviour_data_local_var->validity_time = validity_time; + + return expected_ue_behaviour_data_local_var; +} + +void OpenAPI_expected_ue_behaviour_data_free(OpenAPI_expected_ue_behaviour_data_t *expected_ue_behaviour_data) +{ + if (NULL == expected_ue_behaviour_data) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_stationary_indication_free(expected_ue_behaviour_data->stationary_indication); + OpenAPI_scheduled_communication_time_free(expected_ue_behaviour_data->scheduled_communication_time); + OpenAPI_scheduled_communication_type_free(expected_ue_behaviour_data->scheduled_communication_type); + OpenAPI_list_for_each(expected_ue_behaviour_data->expected_umts, node) { + OpenAPI_location_area_free(node->data); + } + OpenAPI_list_free(expected_ue_behaviour_data->expected_umts); + OpenAPI_traffic_profile_free(expected_ue_behaviour_data->traffic_profile); + OpenAPI_battery_indication_free(expected_ue_behaviour_data->battery_indication); + ogs_free(expected_ue_behaviour_data->validity_time); + ogs_free(expected_ue_behaviour_data); +} + +cJSON *OpenAPI_expected_ue_behaviour_data_convertToJSON(OpenAPI_expected_ue_behaviour_data_t *expected_ue_behaviour_data) +{ + cJSON *item = NULL; + + if (expected_ue_behaviour_data == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_data_convertToJSON() failed [ExpectedUeBehaviourData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (expected_ue_behaviour_data->stationary_indication) { + cJSON *stationary_indication_local_JSON = OpenAPI_stationary_indication_convertToJSON(expected_ue_behaviour_data->stationary_indication); + if (stationary_indication_local_JSON == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_data_convertToJSON() failed [stationary_indication]"); + goto end; + } + cJSON_AddItemToObject(item, "stationaryIndication", stationary_indication_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_data_convertToJSON() failed [stationary_indication]"); + goto end; + } + } + + if (expected_ue_behaviour_data->communication_duration_time) { + if (cJSON_AddNumberToObject(item, "communicationDurationTime", expected_ue_behaviour_data->communication_duration_time) == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_data_convertToJSON() failed [communication_duration_time]"); + goto end; + } + } + + if (expected_ue_behaviour_data->periodic_time) { + if (cJSON_AddNumberToObject(item, "periodicTime", expected_ue_behaviour_data->periodic_time) == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_data_convertToJSON() failed [periodic_time]"); + goto end; + } + } + + if (expected_ue_behaviour_data->scheduled_communication_time) { + cJSON *scheduled_communication_time_local_JSON = OpenAPI_scheduled_communication_time_convertToJSON(expected_ue_behaviour_data->scheduled_communication_time); + if (scheduled_communication_time_local_JSON == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_data_convertToJSON() failed [scheduled_communication_time]"); + goto end; + } + cJSON_AddItemToObject(item, "scheduledCommunicationTime", scheduled_communication_time_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_data_convertToJSON() failed [scheduled_communication_time]"); + goto end; + } + } + + if (expected_ue_behaviour_data->scheduled_communication_type) { + cJSON *scheduled_communication_type_local_JSON = OpenAPI_scheduled_communication_type_convertToJSON(expected_ue_behaviour_data->scheduled_communication_type); + if (scheduled_communication_type_local_JSON == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_data_convertToJSON() failed [scheduled_communication_type]"); + goto end; + } + cJSON_AddItemToObject(item, "scheduledCommunicationType", scheduled_communication_type_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_data_convertToJSON() failed [scheduled_communication_type]"); + goto end; + } + } + + if (expected_ue_behaviour_data->expected_umts) { + cJSON *expected_umtsList = cJSON_AddArrayToObject(item, "expectedUmts"); + if (expected_umtsList == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_data_convertToJSON() failed [expected_umts]"); + goto end; + } + + OpenAPI_lnode_t *expected_umts_node; + if (expected_ue_behaviour_data->expected_umts) { + OpenAPI_list_for_each(expected_ue_behaviour_data->expected_umts, expected_umts_node) { + cJSON *itemLocal = OpenAPI_location_area_convertToJSON(expected_umts_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_data_convertToJSON() failed [expected_umts]"); + goto end; + } + cJSON_AddItemToArray(expected_umtsList, itemLocal); + } + } + } + + if (expected_ue_behaviour_data->traffic_profile) { + cJSON *traffic_profile_local_JSON = OpenAPI_traffic_profile_convertToJSON(expected_ue_behaviour_data->traffic_profile); + if (traffic_profile_local_JSON == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_data_convertToJSON() failed [traffic_profile]"); + goto end; + } + cJSON_AddItemToObject(item, "trafficProfile", traffic_profile_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_data_convertToJSON() failed [traffic_profile]"); + goto end; + } + } + + if (expected_ue_behaviour_data->battery_indication) { + cJSON *battery_indication_local_JSON = OpenAPI_battery_indication_convertToJSON(expected_ue_behaviour_data->battery_indication); + if (battery_indication_local_JSON == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_data_convertToJSON() failed [battery_indication]"); + goto end; + } + cJSON_AddItemToObject(item, "batteryIndication", battery_indication_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_data_convertToJSON() failed [battery_indication]"); + goto end; + } + } + + if (expected_ue_behaviour_data->validity_time) { + if (cJSON_AddStringToObject(item, "validityTime", expected_ue_behaviour_data->validity_time) == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_data_convertToJSON() failed [validity_time]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_expected_ue_behaviour_data_t *OpenAPI_expected_ue_behaviour_data_parseFromJSON(cJSON *expected_ue_behaviour_dataJSON) +{ + OpenAPI_expected_ue_behaviour_data_t *expected_ue_behaviour_data_local_var = NULL; + cJSON *stationary_indication = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_dataJSON, "stationaryIndication"); + + OpenAPI_stationary_indication_t *stationary_indication_local_nonprim = NULL; + if (stationary_indication) { + stationary_indication_local_nonprim = OpenAPI_stationary_indication_parseFromJSON(stationary_indication); + } + + cJSON *communication_duration_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_dataJSON, "communicationDurationTime"); + + if (communication_duration_time) { + if (!cJSON_IsNumber(communication_duration_time)) { + ogs_error("OpenAPI_expected_ue_behaviour_data_parseFromJSON() failed [communication_duration_time]"); + goto end; + } + } + + cJSON *periodic_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_dataJSON, "periodicTime"); + + if (periodic_time) { + if (!cJSON_IsNumber(periodic_time)) { + ogs_error("OpenAPI_expected_ue_behaviour_data_parseFromJSON() failed [periodic_time]"); + goto end; + } + } + + cJSON *scheduled_communication_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_dataJSON, "scheduledCommunicationTime"); + + OpenAPI_scheduled_communication_time_t *scheduled_communication_time_local_nonprim = NULL; + if (scheduled_communication_time) { + scheduled_communication_time_local_nonprim = OpenAPI_scheduled_communication_time_parseFromJSON(scheduled_communication_time); + } + + cJSON *scheduled_communication_type = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_dataJSON, "scheduledCommunicationType"); + + OpenAPI_scheduled_communication_type_t *scheduled_communication_type_local_nonprim = NULL; + if (scheduled_communication_type) { + scheduled_communication_type_local_nonprim = OpenAPI_scheduled_communication_type_parseFromJSON(scheduled_communication_type); + } + + cJSON *expected_umts = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_dataJSON, "expectedUmts"); + + OpenAPI_list_t *expected_umtsList; + if (expected_umts) { + cJSON *expected_umts_local_nonprimitive; + if (!cJSON_IsArray(expected_umts)) { + ogs_error("OpenAPI_expected_ue_behaviour_data_parseFromJSON() failed [expected_umts]"); + goto end; + } + + expected_umtsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(expected_umts_local_nonprimitive, expected_umts ) { + if (!cJSON_IsObject(expected_umts_local_nonprimitive)) { + ogs_error("OpenAPI_expected_ue_behaviour_data_parseFromJSON() failed [expected_umts]"); + goto end; + } + OpenAPI_location_area_t *expected_umtsItem = OpenAPI_location_area_parseFromJSON(expected_umts_local_nonprimitive); + + OpenAPI_list_add(expected_umtsList, expected_umtsItem); + } + } + + cJSON *traffic_profile = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_dataJSON, "trafficProfile"); + + OpenAPI_traffic_profile_t *traffic_profile_local_nonprim = NULL; + if (traffic_profile) { + traffic_profile_local_nonprim = OpenAPI_traffic_profile_parseFromJSON(traffic_profile); + } + + cJSON *battery_indication = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_dataJSON, "batteryIndication"); + + OpenAPI_battery_indication_t *battery_indication_local_nonprim = NULL; + if (battery_indication) { + battery_indication_local_nonprim = OpenAPI_battery_indication_parseFromJSON(battery_indication); + } + + cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_dataJSON, "validityTime"); + + if (validity_time) { + if (!cJSON_IsString(validity_time)) { + ogs_error("OpenAPI_expected_ue_behaviour_data_parseFromJSON() failed [validity_time]"); + goto end; + } + } + + expected_ue_behaviour_data_local_var = OpenAPI_expected_ue_behaviour_data_create ( + stationary_indication ? stationary_indication_local_nonprim : NULL, + communication_duration_time ? communication_duration_time->valuedouble : 0, + periodic_time ? periodic_time->valuedouble : 0, + scheduled_communication_time ? scheduled_communication_time_local_nonprim : NULL, + scheduled_communication_type ? scheduled_communication_type_local_nonprim : NULL, + 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 + ); + + return expected_ue_behaviour_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/expected_ue_behaviour_data.h b/lib/sbi/openapi/model/expected_ue_behaviour_data.h new file mode 100644 index 0000000000..387be2091e --- /dev/null +++ b/lib/sbi/openapi/model/expected_ue_behaviour_data.h @@ -0,0 +1,59 @@ +/* + * expected_ue_behaviour_data.h + * + * + */ + +#ifndef _OpenAPI_expected_ue_behaviour_data_H_ +#define _OpenAPI_expected_ue_behaviour_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "battery_indication.h" +#include "location_area.h" +#include "scheduled_communication_time.h" +#include "scheduled_communication_type.h" +#include "stationary_indication.h" +#include "traffic_profile.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_expected_ue_behaviour_data_s OpenAPI_expected_ue_behaviour_data_t; +typedef struct OpenAPI_expected_ue_behaviour_data_s { + struct OpenAPI_stationary_indication_s *stationary_indication; + int communication_duration_time; + int periodic_time; + struct OpenAPI_scheduled_communication_time_s *scheduled_communication_time; + struct OpenAPI_scheduled_communication_type_s *scheduled_communication_type; + OpenAPI_list_t *expected_umts; + struct OpenAPI_traffic_profile_s *traffic_profile; + struct OpenAPI_battery_indication_s *battery_indication; + char *validity_time; +} OpenAPI_expected_ue_behaviour_data_t; + +OpenAPI_expected_ue_behaviour_data_t *OpenAPI_expected_ue_behaviour_data_create( + OpenAPI_stationary_indication_t *stationary_indication, + int communication_duration_time, + int periodic_time, + OpenAPI_scheduled_communication_time_t *scheduled_communication_time, + OpenAPI_scheduled_communication_type_t *scheduled_communication_type, + OpenAPI_list_t *expected_umts, + OpenAPI_traffic_profile_t *traffic_profile, + OpenAPI_battery_indication_t *battery_indication, + char *validity_time + ); +void OpenAPI_expected_ue_behaviour_data_free(OpenAPI_expected_ue_behaviour_data_t *expected_ue_behaviour_data); +OpenAPI_expected_ue_behaviour_data_t *OpenAPI_expected_ue_behaviour_data_parseFromJSON(cJSON *expected_ue_behaviour_dataJSON); +cJSON *OpenAPI_expected_ue_behaviour_data_convertToJSON(OpenAPI_expected_ue_behaviour_data_t *expected_ue_behaviour_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_expected_ue_behaviour_data_H_ */ + diff --git a/lib/sbi/openapi/model/exposure_data_change_notification.c b/lib/sbi/openapi/model/exposure_data_change_notification.c new file mode 100644 index 0000000000..778f68fb58 --- /dev/null +++ b/lib/sbi/openapi/model/exposure_data_change_notification.c @@ -0,0 +1,188 @@ + +#include +#include +#include +#include "exposure_data_change_notification.h" + +OpenAPI_exposure_data_change_notification_t *OpenAPI_exposure_data_change_notification_create( + char *ue_id, + OpenAPI_access_and_mobility_data_t *access_and_mobility_data, + OpenAPI_list_t *pdu_session_management_data, + OpenAPI_list_t *del_resources + ) +{ + OpenAPI_exposure_data_change_notification_t *exposure_data_change_notification_local_var = OpenAPI_malloc(sizeof(OpenAPI_exposure_data_change_notification_t)); + if (!exposure_data_change_notification_local_var) { + return NULL; + } + exposure_data_change_notification_local_var->ue_id = ue_id; + exposure_data_change_notification_local_var->access_and_mobility_data = access_and_mobility_data; + exposure_data_change_notification_local_var->pdu_session_management_data = pdu_session_management_data; + exposure_data_change_notification_local_var->del_resources = del_resources; + + return exposure_data_change_notification_local_var; +} + +void OpenAPI_exposure_data_change_notification_free(OpenAPI_exposure_data_change_notification_t *exposure_data_change_notification) +{ + if (NULL == exposure_data_change_notification) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(exposure_data_change_notification->ue_id); + OpenAPI_access_and_mobility_data_free(exposure_data_change_notification->access_and_mobility_data); + OpenAPI_list_for_each(exposure_data_change_notification->pdu_session_management_data, node) { + OpenAPI_pdu_session_management_data_free(node->data); + } + OpenAPI_list_free(exposure_data_change_notification->pdu_session_management_data); + OpenAPI_list_for_each(exposure_data_change_notification->del_resources, node) { + ogs_free(node->data); + } + OpenAPI_list_free(exposure_data_change_notification->del_resources); + ogs_free(exposure_data_change_notification); +} + +cJSON *OpenAPI_exposure_data_change_notification_convertToJSON(OpenAPI_exposure_data_change_notification_t *exposure_data_change_notification) +{ + cJSON *item = NULL; + + if (exposure_data_change_notification == NULL) { + ogs_error("OpenAPI_exposure_data_change_notification_convertToJSON() failed [ExposureDataChangeNotification]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (exposure_data_change_notification->ue_id) { + if (cJSON_AddStringToObject(item, "ueId", exposure_data_change_notification->ue_id) == NULL) { + ogs_error("OpenAPI_exposure_data_change_notification_convertToJSON() failed [ue_id]"); + goto end; + } + } + + if (exposure_data_change_notification->access_and_mobility_data) { + cJSON *access_and_mobility_data_local_JSON = OpenAPI_access_and_mobility_data_convertToJSON(exposure_data_change_notification->access_and_mobility_data); + if (access_and_mobility_data_local_JSON == NULL) { + ogs_error("OpenAPI_exposure_data_change_notification_convertToJSON() failed [access_and_mobility_data]"); + goto end; + } + cJSON_AddItemToObject(item, "accessAndMobilityData", access_and_mobility_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_exposure_data_change_notification_convertToJSON() failed [access_and_mobility_data]"); + goto end; + } + } + + if (exposure_data_change_notification->pdu_session_management_data) { + cJSON *pdu_session_management_dataList = cJSON_AddArrayToObject(item, "pduSessionManagementData"); + if (pdu_session_management_dataList == NULL) { + ogs_error("OpenAPI_exposure_data_change_notification_convertToJSON() failed [pdu_session_management_data]"); + goto end; + } + + OpenAPI_lnode_t *pdu_session_management_data_node; + if (exposure_data_change_notification->pdu_session_management_data) { + OpenAPI_list_for_each(exposure_data_change_notification->pdu_session_management_data, pdu_session_management_data_node) { + cJSON *itemLocal = OpenAPI_pdu_session_management_data_convertToJSON(pdu_session_management_data_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_exposure_data_change_notification_convertToJSON() failed [pdu_session_management_data]"); + goto end; + } + cJSON_AddItemToArray(pdu_session_management_dataList, itemLocal); + } + } + } + + if (exposure_data_change_notification->del_resources) { + cJSON *del_resources = cJSON_AddArrayToObject(item, "delResources"); + if (del_resources == NULL) { + ogs_error("OpenAPI_exposure_data_change_notification_convertToJSON() failed [del_resources]"); + goto end; + } + + OpenAPI_lnode_t *del_resources_node; + OpenAPI_list_for_each(exposure_data_change_notification->del_resources, del_resources_node) { + if (cJSON_AddStringToObject(del_resources, "", (char*)del_resources_node->data) == NULL) { + ogs_error("OpenAPI_exposure_data_change_notification_convertToJSON() failed [del_resources]"); + goto end; + } + } + } + +end: + return item; +} + +OpenAPI_exposure_data_change_notification_t *OpenAPI_exposure_data_change_notification_parseFromJSON(cJSON *exposure_data_change_notificationJSON) +{ + OpenAPI_exposure_data_change_notification_t *exposure_data_change_notification_local_var = NULL; + cJSON *ue_id = cJSON_GetObjectItemCaseSensitive(exposure_data_change_notificationJSON, "ueId"); + + if (ue_id) { + if (!cJSON_IsString(ue_id)) { + ogs_error("OpenAPI_exposure_data_change_notification_parseFromJSON() failed [ue_id]"); + goto end; + } + } + + cJSON *access_and_mobility_data = cJSON_GetObjectItemCaseSensitive(exposure_data_change_notificationJSON, "accessAndMobilityData"); + + OpenAPI_access_and_mobility_data_t *access_and_mobility_data_local_nonprim = NULL; + if (access_and_mobility_data) { + access_and_mobility_data_local_nonprim = OpenAPI_access_and_mobility_data_parseFromJSON(access_and_mobility_data); + } + + cJSON *pdu_session_management_data = cJSON_GetObjectItemCaseSensitive(exposure_data_change_notificationJSON, "pduSessionManagementData"); + + OpenAPI_list_t *pdu_session_management_dataList; + if (pdu_session_management_data) { + cJSON *pdu_session_management_data_local_nonprimitive; + if (!cJSON_IsArray(pdu_session_management_data)) { + ogs_error("OpenAPI_exposure_data_change_notification_parseFromJSON() failed [pdu_session_management_data]"); + goto end; + } + + pdu_session_management_dataList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pdu_session_management_data_local_nonprimitive, pdu_session_management_data ) { + if (!cJSON_IsObject(pdu_session_management_data_local_nonprimitive)) { + ogs_error("OpenAPI_exposure_data_change_notification_parseFromJSON() failed [pdu_session_management_data]"); + goto end; + } + OpenAPI_pdu_session_management_data_t *pdu_session_management_dataItem = OpenAPI_pdu_session_management_data_parseFromJSON(pdu_session_management_data_local_nonprimitive); + + OpenAPI_list_add(pdu_session_management_dataList, pdu_session_management_dataItem); + } + } + + cJSON *del_resources = cJSON_GetObjectItemCaseSensitive(exposure_data_change_notificationJSON, "delResources"); + + OpenAPI_list_t *del_resourcesList; + if (del_resources) { + cJSON *del_resources_local; + if (!cJSON_IsArray(del_resources)) { + ogs_error("OpenAPI_exposure_data_change_notification_parseFromJSON() failed [del_resources]"); + goto end; + } + del_resourcesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(del_resources_local, del_resources) { + if (!cJSON_IsString(del_resources_local)) { + ogs_error("OpenAPI_exposure_data_change_notification_parseFromJSON() failed [del_resources]"); + goto end; + } + OpenAPI_list_add(del_resourcesList, ogs_strdup(del_resources_local->valuestring)); + } + } + + exposure_data_change_notification_local_var = OpenAPI_exposure_data_change_notification_create ( + ue_id ? ogs_strdup(ue_id->valuestring) : NULL, + access_and_mobility_data ? access_and_mobility_data_local_nonprim : NULL, + pdu_session_management_data ? pdu_session_management_dataList : NULL, + del_resources ? del_resourcesList : NULL + ); + + return exposure_data_change_notification_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/exposure_data_change_notification.h b/lib/sbi/openapi/model/exposure_data_change_notification.h new file mode 100644 index 0000000000..7c68969654 --- /dev/null +++ b/lib/sbi/openapi/model/exposure_data_change_notification.h @@ -0,0 +1,45 @@ +/* + * exposure_data_change_notification.h + * + * + */ + +#ifndef _OpenAPI_exposure_data_change_notification_H_ +#define _OpenAPI_exposure_data_change_notification_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "access_and_mobility_data.h" +#include "pdu_session_management_data.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_exposure_data_change_notification_s OpenAPI_exposure_data_change_notification_t; +typedef struct OpenAPI_exposure_data_change_notification_s { + char *ue_id; + struct OpenAPI_access_and_mobility_data_s *access_and_mobility_data; + OpenAPI_list_t *pdu_session_management_data; + OpenAPI_list_t *del_resources; +} OpenAPI_exposure_data_change_notification_t; + +OpenAPI_exposure_data_change_notification_t *OpenAPI_exposure_data_change_notification_create( + char *ue_id, + OpenAPI_access_and_mobility_data_t *access_and_mobility_data, + OpenAPI_list_t *pdu_session_management_data, + OpenAPI_list_t *del_resources + ); +void OpenAPI_exposure_data_change_notification_free(OpenAPI_exposure_data_change_notification_t *exposure_data_change_notification); +OpenAPI_exposure_data_change_notification_t *OpenAPI_exposure_data_change_notification_parseFromJSON(cJSON *exposure_data_change_notificationJSON); +cJSON *OpenAPI_exposure_data_change_notification_convertToJSON(OpenAPI_exposure_data_change_notification_t *exposure_data_change_notification); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_exposure_data_change_notification_H_ */ + diff --git a/lib/sbi/openapi/model/exposure_data_subscription.c b/lib/sbi/openapi/model/exposure_data_subscription.c new file mode 100644 index 0000000000..6ea852b470 --- /dev/null +++ b/lib/sbi/openapi/model/exposure_data_subscription.c @@ -0,0 +1,164 @@ + +#include +#include +#include +#include "exposure_data_subscription.h" + +OpenAPI_exposure_data_subscription_t *OpenAPI_exposure_data_subscription_create( + char *notification_uri, + OpenAPI_list_t *monitored_resource_uris, + char *expiry, + char *supported_features + ) +{ + OpenAPI_exposure_data_subscription_t *exposure_data_subscription_local_var = OpenAPI_malloc(sizeof(OpenAPI_exposure_data_subscription_t)); + if (!exposure_data_subscription_local_var) { + return NULL; + } + exposure_data_subscription_local_var->notification_uri = notification_uri; + exposure_data_subscription_local_var->monitored_resource_uris = monitored_resource_uris; + exposure_data_subscription_local_var->expiry = expiry; + exposure_data_subscription_local_var->supported_features = supported_features; + + return exposure_data_subscription_local_var; +} + +void OpenAPI_exposure_data_subscription_free(OpenAPI_exposure_data_subscription_t *exposure_data_subscription) +{ + if (NULL == exposure_data_subscription) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(exposure_data_subscription->notification_uri); + OpenAPI_list_for_each(exposure_data_subscription->monitored_resource_uris, node) { + ogs_free(node->data); + } + OpenAPI_list_free(exposure_data_subscription->monitored_resource_uris); + ogs_free(exposure_data_subscription->expiry); + ogs_free(exposure_data_subscription->supported_features); + ogs_free(exposure_data_subscription); +} + +cJSON *OpenAPI_exposure_data_subscription_convertToJSON(OpenAPI_exposure_data_subscription_t *exposure_data_subscription) +{ + cJSON *item = NULL; + + if (exposure_data_subscription == NULL) { + ogs_error("OpenAPI_exposure_data_subscription_convertToJSON() failed [ExposureDataSubscription]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!exposure_data_subscription->notification_uri) { + ogs_error("OpenAPI_exposure_data_subscription_convertToJSON() failed [notification_uri]"); + goto end; + } + if (cJSON_AddStringToObject(item, "notificationUri", exposure_data_subscription->notification_uri) == NULL) { + ogs_error("OpenAPI_exposure_data_subscription_convertToJSON() failed [notification_uri]"); + goto end; + } + + if (!exposure_data_subscription->monitored_resource_uris) { + ogs_error("OpenAPI_exposure_data_subscription_convertToJSON() failed [monitored_resource_uris]"); + goto end; + } + cJSON *monitored_resource_uris = cJSON_AddArrayToObject(item, "monitoredResourceUris"); + if (monitored_resource_uris == NULL) { + ogs_error("OpenAPI_exposure_data_subscription_convertToJSON() failed [monitored_resource_uris]"); + goto end; + } + + OpenAPI_lnode_t *monitored_resource_uris_node; + OpenAPI_list_for_each(exposure_data_subscription->monitored_resource_uris, monitored_resource_uris_node) { + if (cJSON_AddStringToObject(monitored_resource_uris, "", (char*)monitored_resource_uris_node->data) == NULL) { + ogs_error("OpenAPI_exposure_data_subscription_convertToJSON() failed [monitored_resource_uris]"); + goto end; + } + } + + if (exposure_data_subscription->expiry) { + if (cJSON_AddStringToObject(item, "expiry", exposure_data_subscription->expiry) == NULL) { + ogs_error("OpenAPI_exposure_data_subscription_convertToJSON() failed [expiry]"); + goto end; + } + } + + if (exposure_data_subscription->supported_features) { + if (cJSON_AddStringToObject(item, "supportedFeatures", exposure_data_subscription->supported_features) == NULL) { + ogs_error("OpenAPI_exposure_data_subscription_convertToJSON() failed [supported_features]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_exposure_data_subscription_t *OpenAPI_exposure_data_subscription_parseFromJSON(cJSON *exposure_data_subscriptionJSON) +{ + OpenAPI_exposure_data_subscription_t *exposure_data_subscription_local_var = NULL; + cJSON *notification_uri = cJSON_GetObjectItemCaseSensitive(exposure_data_subscriptionJSON, "notificationUri"); + if (!notification_uri) { + ogs_error("OpenAPI_exposure_data_subscription_parseFromJSON() failed [notification_uri]"); + goto end; + } + + + if (!cJSON_IsString(notification_uri)) { + ogs_error("OpenAPI_exposure_data_subscription_parseFromJSON() failed [notification_uri]"); + goto end; + } + + cJSON *monitored_resource_uris = cJSON_GetObjectItemCaseSensitive(exposure_data_subscriptionJSON, "monitoredResourceUris"); + if (!monitored_resource_uris) { + ogs_error("OpenAPI_exposure_data_subscription_parseFromJSON() failed [monitored_resource_uris]"); + goto end; + } + + OpenAPI_list_t *monitored_resource_urisList; + + cJSON *monitored_resource_uris_local; + if (!cJSON_IsArray(monitored_resource_uris)) { + ogs_error("OpenAPI_exposure_data_subscription_parseFromJSON() failed [monitored_resource_uris]"); + goto end; + } + monitored_resource_urisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(monitored_resource_uris_local, monitored_resource_uris) { + if (!cJSON_IsString(monitored_resource_uris_local)) { + ogs_error("OpenAPI_exposure_data_subscription_parseFromJSON() failed [monitored_resource_uris]"); + goto end; + } + OpenAPI_list_add(monitored_resource_urisList, ogs_strdup(monitored_resource_uris_local->valuestring)); + } + + cJSON *expiry = cJSON_GetObjectItemCaseSensitive(exposure_data_subscriptionJSON, "expiry"); + + if (expiry) { + if (!cJSON_IsString(expiry)) { + ogs_error("OpenAPI_exposure_data_subscription_parseFromJSON() failed [expiry]"); + goto end; + } + } + + cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(exposure_data_subscriptionJSON, "supportedFeatures"); + + if (supported_features) { + if (!cJSON_IsString(supported_features)) { + ogs_error("OpenAPI_exposure_data_subscription_parseFromJSON() failed [supported_features]"); + goto end; + } + } + + exposure_data_subscription_local_var = OpenAPI_exposure_data_subscription_create ( + ogs_strdup(notification_uri->valuestring), + monitored_resource_urisList, + expiry ? ogs_strdup(expiry->valuestring) : NULL, + supported_features ? ogs_strdup(supported_features->valuestring) : NULL + ); + + return exposure_data_subscription_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/exposure_data_subscription.h b/lib/sbi/openapi/model/exposure_data_subscription.h new file mode 100644 index 0000000000..35dc2f76eb --- /dev/null +++ b/lib/sbi/openapi/model/exposure_data_subscription.h @@ -0,0 +1,43 @@ +/* + * exposure_data_subscription.h + * + * + */ + +#ifndef _OpenAPI_exposure_data_subscription_H_ +#define _OpenAPI_exposure_data_subscription_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_exposure_data_subscription_s OpenAPI_exposure_data_subscription_t; +typedef struct OpenAPI_exposure_data_subscription_s { + char *notification_uri; + OpenAPI_list_t *monitored_resource_uris; + char *expiry; + char *supported_features; +} OpenAPI_exposure_data_subscription_t; + +OpenAPI_exposure_data_subscription_t *OpenAPI_exposure_data_subscription_create( + char *notification_uri, + OpenAPI_list_t *monitored_resource_uris, + char *expiry, + char *supported_features + ); +void OpenAPI_exposure_data_subscription_free(OpenAPI_exposure_data_subscription_t *exposure_data_subscription); +OpenAPI_exposure_data_subscription_t *OpenAPI_exposure_data_subscription_parseFromJSON(cJSON *exposure_data_subscriptionJSON); +cJSON *OpenAPI_exposure_data_subscription_convertToJSON(OpenAPI_exposure_data_subscription_t *exposure_data_subscription); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_exposure_data_subscription_H_ */ + diff --git a/lib/sbi/openapi/model/external_client_type.c b/lib/sbi/openapi/model/external_client_type.c new file mode 100644 index 0000000000..5830fd2344 --- /dev/null +++ b/lib/sbi/openapi/model/external_client_type.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "external_client_type.h" + +OpenAPI_external_client_type_t *OpenAPI_external_client_type_create( + ) +{ + OpenAPI_external_client_type_t *external_client_type_local_var = OpenAPI_malloc(sizeof(OpenAPI_external_client_type_t)); + if (!external_client_type_local_var) { + return NULL; + } + + return external_client_type_local_var; +} + +void OpenAPI_external_client_type_free(OpenAPI_external_client_type_t *external_client_type) +{ + if (NULL == external_client_type) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(external_client_type); +} + +cJSON *OpenAPI_external_client_type_convertToJSON(OpenAPI_external_client_type_t *external_client_type) +{ + cJSON *item = NULL; + + if (external_client_type == NULL) { + ogs_error("OpenAPI_external_client_type_convertToJSON() failed [ExternalClientType]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_external_client_type_t *OpenAPI_external_client_type_parseFromJSON(cJSON *external_client_typeJSON) +{ + OpenAPI_external_client_type_t *external_client_type_local_var = NULL; + external_client_type_local_var = OpenAPI_external_client_type_create ( + ); + + return external_client_type_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/external_client_type.h b/lib/sbi/openapi/model/external_client_type.h new file mode 100644 index 0000000000..5ace4bd33c --- /dev/null +++ b/lib/sbi/openapi/model/external_client_type.h @@ -0,0 +1,35 @@ +/* + * external_client_type.h + * + * + */ + +#ifndef _OpenAPI_external_client_type_H_ +#define _OpenAPI_external_client_type_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_external_client_type_s OpenAPI_external_client_type_t; +typedef struct OpenAPI_external_client_type_s { +} OpenAPI_external_client_type_t; + +OpenAPI_external_client_type_t *OpenAPI_external_client_type_create( + ); +void OpenAPI_external_client_type_free(OpenAPI_external_client_type_t *external_client_type); +OpenAPI_external_client_type_t *OpenAPI_external_client_type_parseFromJSON(cJSON *external_client_typeJSON); +cJSON *OpenAPI_external_client_type_convertToJSON(OpenAPI_external_client_type_t *external_client_type); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_external_client_type_H_ */ + diff --git a/lib/sbi/openapi/model/external_unrelated_class.c b/lib/sbi/openapi/model/external_unrelated_class.c new file mode 100644 index 0000000000..5a9af18c5b --- /dev/null +++ b/lib/sbi/openapi/model/external_unrelated_class.c @@ -0,0 +1,201 @@ + +#include +#include +#include +#include "external_unrelated_class.h" + +OpenAPI_external_unrelated_class_t *OpenAPI_external_unrelated_class_create( + OpenAPI_list_t *lcs_client_externals, + OpenAPI_list_t *af_externals, + OpenAPI_list_t *lcs_client_group_externals + ) +{ + OpenAPI_external_unrelated_class_t *external_unrelated_class_local_var = OpenAPI_malloc(sizeof(OpenAPI_external_unrelated_class_t)); + if (!external_unrelated_class_local_var) { + return NULL; + } + external_unrelated_class_local_var->lcs_client_externals = lcs_client_externals; + external_unrelated_class_local_var->af_externals = af_externals; + external_unrelated_class_local_var->lcs_client_group_externals = lcs_client_group_externals; + + return external_unrelated_class_local_var; +} + +void OpenAPI_external_unrelated_class_free(OpenAPI_external_unrelated_class_t *external_unrelated_class) +{ + if (NULL == external_unrelated_class) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(external_unrelated_class->lcs_client_externals, node) { + OpenAPI_lcs_client_external_free(node->data); + } + OpenAPI_list_free(external_unrelated_class->lcs_client_externals); + OpenAPI_list_for_each(external_unrelated_class->af_externals, node) { + OpenAPI_af_external_free(node->data); + } + OpenAPI_list_free(external_unrelated_class->af_externals); + OpenAPI_list_for_each(external_unrelated_class->lcs_client_group_externals, node) { + OpenAPI_lcs_client_group_external_free(node->data); + } + OpenAPI_list_free(external_unrelated_class->lcs_client_group_externals); + ogs_free(external_unrelated_class); +} + +cJSON *OpenAPI_external_unrelated_class_convertToJSON(OpenAPI_external_unrelated_class_t *external_unrelated_class) +{ + cJSON *item = NULL; + + if (external_unrelated_class == NULL) { + ogs_error("OpenAPI_external_unrelated_class_convertToJSON() failed [ExternalUnrelatedClass]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (external_unrelated_class->lcs_client_externals) { + cJSON *lcs_client_externalsList = cJSON_AddArrayToObject(item, "lcsClientExternals"); + if (lcs_client_externalsList == NULL) { + ogs_error("OpenAPI_external_unrelated_class_convertToJSON() failed [lcs_client_externals]"); + goto end; + } + + OpenAPI_lnode_t *lcs_client_externals_node; + if (external_unrelated_class->lcs_client_externals) { + OpenAPI_list_for_each(external_unrelated_class->lcs_client_externals, lcs_client_externals_node) { + cJSON *itemLocal = OpenAPI_lcs_client_external_convertToJSON(lcs_client_externals_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_external_unrelated_class_convertToJSON() failed [lcs_client_externals]"); + goto end; + } + cJSON_AddItemToArray(lcs_client_externalsList, itemLocal); + } + } + } + + if (external_unrelated_class->af_externals) { + cJSON *af_externalsList = cJSON_AddArrayToObject(item, "afExternals"); + if (af_externalsList == NULL) { + ogs_error("OpenAPI_external_unrelated_class_convertToJSON() failed [af_externals]"); + goto end; + } + + OpenAPI_lnode_t *af_externals_node; + if (external_unrelated_class->af_externals) { + OpenAPI_list_for_each(external_unrelated_class->af_externals, af_externals_node) { + cJSON *itemLocal = OpenAPI_af_external_convertToJSON(af_externals_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_external_unrelated_class_convertToJSON() failed [af_externals]"); + goto end; + } + cJSON_AddItemToArray(af_externalsList, itemLocal); + } + } + } + + if (external_unrelated_class->lcs_client_group_externals) { + cJSON *lcs_client_group_externalsList = cJSON_AddArrayToObject(item, "lcsClientGroupExternals"); + if (lcs_client_group_externalsList == NULL) { + ogs_error("OpenAPI_external_unrelated_class_convertToJSON() failed [lcs_client_group_externals]"); + goto end; + } + + OpenAPI_lnode_t *lcs_client_group_externals_node; + if (external_unrelated_class->lcs_client_group_externals) { + OpenAPI_list_for_each(external_unrelated_class->lcs_client_group_externals, lcs_client_group_externals_node) { + cJSON *itemLocal = OpenAPI_lcs_client_group_external_convertToJSON(lcs_client_group_externals_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_external_unrelated_class_convertToJSON() failed [lcs_client_group_externals]"); + goto end; + } + cJSON_AddItemToArray(lcs_client_group_externalsList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_external_unrelated_class_t *OpenAPI_external_unrelated_class_parseFromJSON(cJSON *external_unrelated_classJSON) +{ + OpenAPI_external_unrelated_class_t *external_unrelated_class_local_var = NULL; + cJSON *lcs_client_externals = cJSON_GetObjectItemCaseSensitive(external_unrelated_classJSON, "lcsClientExternals"); + + OpenAPI_list_t *lcs_client_externalsList; + if (lcs_client_externals) { + cJSON *lcs_client_externals_local_nonprimitive; + if (!cJSON_IsArray(lcs_client_externals)) { + ogs_error("OpenAPI_external_unrelated_class_parseFromJSON() failed [lcs_client_externals]"); + goto end; + } + + lcs_client_externalsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(lcs_client_externals_local_nonprimitive, lcs_client_externals ) { + if (!cJSON_IsObject(lcs_client_externals_local_nonprimitive)) { + ogs_error("OpenAPI_external_unrelated_class_parseFromJSON() failed [lcs_client_externals]"); + goto end; + } + OpenAPI_lcs_client_external_t *lcs_client_externalsItem = OpenAPI_lcs_client_external_parseFromJSON(lcs_client_externals_local_nonprimitive); + + OpenAPI_list_add(lcs_client_externalsList, lcs_client_externalsItem); + } + } + + cJSON *af_externals = cJSON_GetObjectItemCaseSensitive(external_unrelated_classJSON, "afExternals"); + + OpenAPI_list_t *af_externalsList; + if (af_externals) { + cJSON *af_externals_local_nonprimitive; + if (!cJSON_IsArray(af_externals)) { + ogs_error("OpenAPI_external_unrelated_class_parseFromJSON() failed [af_externals]"); + goto end; + } + + af_externalsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(af_externals_local_nonprimitive, af_externals ) { + if (!cJSON_IsObject(af_externals_local_nonprimitive)) { + ogs_error("OpenAPI_external_unrelated_class_parseFromJSON() failed [af_externals]"); + goto end; + } + OpenAPI_af_external_t *af_externalsItem = OpenAPI_af_external_parseFromJSON(af_externals_local_nonprimitive); + + OpenAPI_list_add(af_externalsList, af_externalsItem); + } + } + + cJSON *lcs_client_group_externals = cJSON_GetObjectItemCaseSensitive(external_unrelated_classJSON, "lcsClientGroupExternals"); + + OpenAPI_list_t *lcs_client_group_externalsList; + if (lcs_client_group_externals) { + cJSON *lcs_client_group_externals_local_nonprimitive; + if (!cJSON_IsArray(lcs_client_group_externals)) { + ogs_error("OpenAPI_external_unrelated_class_parseFromJSON() failed [lcs_client_group_externals]"); + goto end; + } + + lcs_client_group_externalsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(lcs_client_group_externals_local_nonprimitive, lcs_client_group_externals ) { + if (!cJSON_IsObject(lcs_client_group_externals_local_nonprimitive)) { + ogs_error("OpenAPI_external_unrelated_class_parseFromJSON() failed [lcs_client_group_externals]"); + goto end; + } + OpenAPI_lcs_client_group_external_t *lcs_client_group_externalsItem = OpenAPI_lcs_client_group_external_parseFromJSON(lcs_client_group_externals_local_nonprimitive); + + OpenAPI_list_add(lcs_client_group_externalsList, lcs_client_group_externalsItem); + } + } + + external_unrelated_class_local_var = OpenAPI_external_unrelated_class_create ( + lcs_client_externals ? lcs_client_externalsList : NULL, + af_externals ? af_externalsList : NULL, + lcs_client_group_externals ? lcs_client_group_externalsList : NULL + ); + + return external_unrelated_class_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/external_unrelated_class.h b/lib/sbi/openapi/model/external_unrelated_class.h new file mode 100644 index 0000000000..a7696c3467 --- /dev/null +++ b/lib/sbi/openapi/model/external_unrelated_class.h @@ -0,0 +1,44 @@ +/* + * external_unrelated_class.h + * + * + */ + +#ifndef _OpenAPI_external_unrelated_class_H_ +#define _OpenAPI_external_unrelated_class_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "af_external.h" +#include "lcs_client_external.h" +#include "lcs_client_group_external.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_external_unrelated_class_s OpenAPI_external_unrelated_class_t; +typedef struct OpenAPI_external_unrelated_class_s { + OpenAPI_list_t *lcs_client_externals; + OpenAPI_list_t *af_externals; + OpenAPI_list_t *lcs_client_group_externals; +} OpenAPI_external_unrelated_class_t; + +OpenAPI_external_unrelated_class_t *OpenAPI_external_unrelated_class_create( + OpenAPI_list_t *lcs_client_externals, + OpenAPI_list_t *af_externals, + OpenAPI_list_t *lcs_client_group_externals + ); +void OpenAPI_external_unrelated_class_free(OpenAPI_external_unrelated_class_t *external_unrelated_class); +OpenAPI_external_unrelated_class_t *OpenAPI_external_unrelated_class_parseFromJSON(cJSON *external_unrelated_classJSON); +cJSON *OpenAPI_external_unrelated_class_convertToJSON(OpenAPI_external_unrelated_class_t *external_unrelated_class); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_external_unrelated_class_H_ */ + diff --git a/lib/sbi/openapi/model/flow_direction.c b/lib/sbi/openapi/model/flow_direction.c new file mode 100644 index 0000000000..ba35074e1b --- /dev/null +++ b/lib/sbi/openapi/model/flow_direction.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "flow_direction.h" + +OpenAPI_flow_direction_t *OpenAPI_flow_direction_create( + ) +{ + OpenAPI_flow_direction_t *flow_direction_local_var = OpenAPI_malloc(sizeof(OpenAPI_flow_direction_t)); + if (!flow_direction_local_var) { + return NULL; + } + + return flow_direction_local_var; +} + +void OpenAPI_flow_direction_free(OpenAPI_flow_direction_t *flow_direction) +{ + if (NULL == flow_direction) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(flow_direction); +} + +cJSON *OpenAPI_flow_direction_convertToJSON(OpenAPI_flow_direction_t *flow_direction) +{ + cJSON *item = NULL; + + if (flow_direction == NULL) { + ogs_error("OpenAPI_flow_direction_convertToJSON() failed [FlowDirection]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_flow_direction_t *OpenAPI_flow_direction_parseFromJSON(cJSON *flow_directionJSON) +{ + OpenAPI_flow_direction_t *flow_direction_local_var = NULL; + flow_direction_local_var = OpenAPI_flow_direction_create ( + ); + + return flow_direction_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/flow_direction.h b/lib/sbi/openapi/model/flow_direction.h new file mode 100644 index 0000000000..8a52ff43cc --- /dev/null +++ b/lib/sbi/openapi/model/flow_direction.h @@ -0,0 +1,35 @@ +/* + * flow_direction.h + * + * Possible values are - DOWNLINK: The corresponding filter applies for traffic to the UE. - UPLINK: The corresponding filter applies for traffic from the UE. - BIDIRECTIONAL: The corresponding filter applies for traffic both to and from the UE. - UNSPECIFIED: The corresponding filter applies for traffic to the UE (downlink), but has no specific direction declared. The service data flow detection shall apply the filter for uplink traffic as if the filter was bidirectional. The PCF shall not use the value UNSPECIFIED in filters created by the network in NW-initiated procedures. The PCF shall only include the value UNSPECIFIED in filters in UE-initiated procedures if the same value is received from the SMF. + */ + +#ifndef _OpenAPI_flow_direction_H_ +#define _OpenAPI_flow_direction_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_flow_direction_s OpenAPI_flow_direction_t; +typedef struct OpenAPI_flow_direction_s { +} OpenAPI_flow_direction_t; + +OpenAPI_flow_direction_t *OpenAPI_flow_direction_create( + ); +void OpenAPI_flow_direction_free(OpenAPI_flow_direction_t *flow_direction); +OpenAPI_flow_direction_t *OpenAPI_flow_direction_parseFromJSON(cJSON *flow_directionJSON); +cJSON *OpenAPI_flow_direction_convertToJSON(OpenAPI_flow_direction_t *flow_direction); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_flow_direction_H_ */ + diff --git a/lib/sbi/openapi/model/flow_info.c b/lib/sbi/openapi/model/flow_info.c new file mode 100644 index 0000000000..097151e881 --- /dev/null +++ b/lib/sbi/openapi/model/flow_info.c @@ -0,0 +1,118 @@ + +#include +#include +#include +#include "flow_info.h" + +OpenAPI_flow_info_t *OpenAPI_flow_info_create( + int flow_id, + OpenAPI_list_t *flow_descriptions + ) +{ + OpenAPI_flow_info_t *flow_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_flow_info_t)); + if (!flow_info_local_var) { + return NULL; + } + flow_info_local_var->flow_id = flow_id; + flow_info_local_var->flow_descriptions = flow_descriptions; + + return flow_info_local_var; +} + +void OpenAPI_flow_info_free(OpenAPI_flow_info_t *flow_info) +{ + if (NULL == flow_info) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(flow_info->flow_descriptions, node) { + ogs_free(node->data); + } + OpenAPI_list_free(flow_info->flow_descriptions); + ogs_free(flow_info); +} + +cJSON *OpenAPI_flow_info_convertToJSON(OpenAPI_flow_info_t *flow_info) +{ + cJSON *item = NULL; + + if (flow_info == NULL) { + ogs_error("OpenAPI_flow_info_convertToJSON() failed [FlowInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!flow_info->flow_id) { + ogs_error("OpenAPI_flow_info_convertToJSON() failed [flow_id]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "flowId", flow_info->flow_id) == NULL) { + ogs_error("OpenAPI_flow_info_convertToJSON() failed [flow_id]"); + goto end; + } + + if (flow_info->flow_descriptions) { + cJSON *flow_descriptions = cJSON_AddArrayToObject(item, "flowDescriptions"); + if (flow_descriptions == NULL) { + ogs_error("OpenAPI_flow_info_convertToJSON() failed [flow_descriptions]"); + goto end; + } + + OpenAPI_lnode_t *flow_descriptions_node; + OpenAPI_list_for_each(flow_info->flow_descriptions, flow_descriptions_node) { + if (cJSON_AddStringToObject(flow_descriptions, "", (char*)flow_descriptions_node->data) == NULL) { + ogs_error("OpenAPI_flow_info_convertToJSON() failed [flow_descriptions]"); + goto end; + } + } + } + +end: + return item; +} + +OpenAPI_flow_info_t *OpenAPI_flow_info_parseFromJSON(cJSON *flow_infoJSON) +{ + OpenAPI_flow_info_t *flow_info_local_var = NULL; + cJSON *flow_id = cJSON_GetObjectItemCaseSensitive(flow_infoJSON, "flowId"); + if (!flow_id) { + ogs_error("OpenAPI_flow_info_parseFromJSON() failed [flow_id]"); + goto end; + } + + + if (!cJSON_IsNumber(flow_id)) { + ogs_error("OpenAPI_flow_info_parseFromJSON() failed [flow_id]"); + goto end; + } + + cJSON *flow_descriptions = cJSON_GetObjectItemCaseSensitive(flow_infoJSON, "flowDescriptions"); + + OpenAPI_list_t *flow_descriptionsList; + if (flow_descriptions) { + cJSON *flow_descriptions_local; + if (!cJSON_IsArray(flow_descriptions)) { + ogs_error("OpenAPI_flow_info_parseFromJSON() failed [flow_descriptions]"); + goto end; + } + flow_descriptionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(flow_descriptions_local, flow_descriptions) { + if (!cJSON_IsString(flow_descriptions_local)) { + ogs_error("OpenAPI_flow_info_parseFromJSON() failed [flow_descriptions]"); + goto end; + } + OpenAPI_list_add(flow_descriptionsList, ogs_strdup(flow_descriptions_local->valuestring)); + } + } + + flow_info_local_var = OpenAPI_flow_info_create ( + flow_id->valuedouble, + flow_descriptions ? flow_descriptionsList : NULL + ); + + return flow_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/flow_info.h b/lib/sbi/openapi/model/flow_info.h new file mode 100644 index 0000000000..72a343e589 --- /dev/null +++ b/lib/sbi/openapi/model/flow_info.h @@ -0,0 +1,39 @@ +/* + * flow_info.h + * + * + */ + +#ifndef _OpenAPI_flow_info_H_ +#define _OpenAPI_flow_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_flow_info_s OpenAPI_flow_info_t; +typedef struct OpenAPI_flow_info_s { + int flow_id; + OpenAPI_list_t *flow_descriptions; +} OpenAPI_flow_info_t; + +OpenAPI_flow_info_t *OpenAPI_flow_info_create( + int flow_id, + OpenAPI_list_t *flow_descriptions + ); +void OpenAPI_flow_info_free(OpenAPI_flow_info_t *flow_info); +OpenAPI_flow_info_t *OpenAPI_flow_info_parseFromJSON(cJSON *flow_infoJSON); +cJSON *OpenAPI_flow_info_convertToJSON(OpenAPI_flow_info_t *flow_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_flow_info_H_ */ + diff --git a/lib/sbi/openapi/model/frame_route_info.c b/lib/sbi/openapi/model/frame_route_info.c new file mode 100644 index 0000000000..57d3310690 --- /dev/null +++ b/lib/sbi/openapi/model/frame_route_info.c @@ -0,0 +1,91 @@ + +#include +#include +#include +#include "frame_route_info.h" + +OpenAPI_frame_route_info_t *OpenAPI_frame_route_info_create( + char *ipv4_mask, + char *ipv6_prefix + ) +{ + OpenAPI_frame_route_info_t *frame_route_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_frame_route_info_t)); + if (!frame_route_info_local_var) { + return NULL; + } + frame_route_info_local_var->ipv4_mask = ipv4_mask; + frame_route_info_local_var->ipv6_prefix = ipv6_prefix; + + return frame_route_info_local_var; +} + +void OpenAPI_frame_route_info_free(OpenAPI_frame_route_info_t *frame_route_info) +{ + if (NULL == frame_route_info) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(frame_route_info->ipv4_mask); + ogs_free(frame_route_info->ipv6_prefix); + ogs_free(frame_route_info); +} + +cJSON *OpenAPI_frame_route_info_convertToJSON(OpenAPI_frame_route_info_t *frame_route_info) +{ + cJSON *item = NULL; + + if (frame_route_info == NULL) { + ogs_error("OpenAPI_frame_route_info_convertToJSON() failed [FrameRouteInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (frame_route_info->ipv4_mask) { + if (cJSON_AddStringToObject(item, "ipv4Mask", frame_route_info->ipv4_mask) == NULL) { + ogs_error("OpenAPI_frame_route_info_convertToJSON() failed [ipv4_mask]"); + goto end; + } + } + + if (frame_route_info->ipv6_prefix) { + if (cJSON_AddStringToObject(item, "ipv6Prefix", frame_route_info->ipv6_prefix) == NULL) { + ogs_error("OpenAPI_frame_route_info_convertToJSON() failed [ipv6_prefix]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_frame_route_info_t *OpenAPI_frame_route_info_parseFromJSON(cJSON *frame_route_infoJSON) +{ + OpenAPI_frame_route_info_t *frame_route_info_local_var = NULL; + cJSON *ipv4_mask = cJSON_GetObjectItemCaseSensitive(frame_route_infoJSON, "ipv4Mask"); + + if (ipv4_mask) { + if (!cJSON_IsString(ipv4_mask)) { + ogs_error("OpenAPI_frame_route_info_parseFromJSON() failed [ipv4_mask]"); + goto end; + } + } + + cJSON *ipv6_prefix = cJSON_GetObjectItemCaseSensitive(frame_route_infoJSON, "ipv6Prefix"); + + if (ipv6_prefix) { + if (!cJSON_IsString(ipv6_prefix)) { + ogs_error("OpenAPI_frame_route_info_parseFromJSON() failed [ipv6_prefix]"); + goto end; + } + } + + frame_route_info_local_var = OpenAPI_frame_route_info_create ( + ipv4_mask ? ogs_strdup(ipv4_mask->valuestring) : NULL, + ipv6_prefix ? ogs_strdup(ipv6_prefix->valuestring) : NULL + ); + + return frame_route_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/frame_route_info.h b/lib/sbi/openapi/model/frame_route_info.h new file mode 100644 index 0000000000..cecb47cef7 --- /dev/null +++ b/lib/sbi/openapi/model/frame_route_info.h @@ -0,0 +1,39 @@ +/* + * frame_route_info.h + * + * + */ + +#ifndef _OpenAPI_frame_route_info_H_ +#define _OpenAPI_frame_route_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_frame_route_info_s OpenAPI_frame_route_info_t; +typedef struct OpenAPI_frame_route_info_s { + char *ipv4_mask; + char *ipv6_prefix; +} OpenAPI_frame_route_info_t; + +OpenAPI_frame_route_info_t *OpenAPI_frame_route_info_create( + char *ipv4_mask, + char *ipv6_prefix + ); +void OpenAPI_frame_route_info_free(OpenAPI_frame_route_info_t *frame_route_info); +OpenAPI_frame_route_info_t *OpenAPI_frame_route_info_parseFromJSON(cJSON *frame_route_infoJSON); +cJSON *OpenAPI_frame_route_info_convertToJSON(OpenAPI_frame_route_info_t *frame_route_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_frame_route_info_H_ */ + diff --git a/lib/sbi/openapi/model/g_nb_id.c b/lib/sbi/openapi/model/g_nb_id.c new file mode 100644 index 0000000000..c9e6cde391 --- /dev/null +++ b/lib/sbi/openapi/model/g_nb_id.c @@ -0,0 +1,100 @@ + +#include +#include +#include +#include "g_nb_id.h" + +OpenAPI_g_nb_id_t *OpenAPI_g_nb_id_create( + int bit_length, + char *g_nb_value + ) +{ + OpenAPI_g_nb_id_t *g_nb_id_local_var = OpenAPI_malloc(sizeof(OpenAPI_g_nb_id_t)); + if (!g_nb_id_local_var) { + return NULL; + } + g_nb_id_local_var->bit_length = bit_length; + g_nb_id_local_var->g_nb_value = g_nb_value; + + return g_nb_id_local_var; +} + +void OpenAPI_g_nb_id_free(OpenAPI_g_nb_id_t *g_nb_id) +{ + if (NULL == g_nb_id) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(g_nb_id->g_nb_value); + ogs_free(g_nb_id); +} + +cJSON *OpenAPI_g_nb_id_convertToJSON(OpenAPI_g_nb_id_t *g_nb_id) +{ + cJSON *item = NULL; + + if (g_nb_id == NULL) { + ogs_error("OpenAPI_g_nb_id_convertToJSON() failed [GNbId]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!g_nb_id->bit_length) { + ogs_error("OpenAPI_g_nb_id_convertToJSON() failed [bit_length]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "bitLength", g_nb_id->bit_length) == NULL) { + ogs_error("OpenAPI_g_nb_id_convertToJSON() failed [bit_length]"); + goto end; + } + + if (!g_nb_id->g_nb_value) { + ogs_error("OpenAPI_g_nb_id_convertToJSON() failed [g_nb_value]"); + goto end; + } + if (cJSON_AddStringToObject(item, "gNBValue", g_nb_id->g_nb_value) == NULL) { + ogs_error("OpenAPI_g_nb_id_convertToJSON() failed [g_nb_value]"); + goto end; + } + +end: + return item; +} + +OpenAPI_g_nb_id_t *OpenAPI_g_nb_id_parseFromJSON(cJSON *g_nb_idJSON) +{ + OpenAPI_g_nb_id_t *g_nb_id_local_var = NULL; + cJSON *bit_length = cJSON_GetObjectItemCaseSensitive(g_nb_idJSON, "bitLength"); + if (!bit_length) { + ogs_error("OpenAPI_g_nb_id_parseFromJSON() failed [bit_length]"); + goto end; + } + + + if (!cJSON_IsNumber(bit_length)) { + ogs_error("OpenAPI_g_nb_id_parseFromJSON() failed [bit_length]"); + goto end; + } + + cJSON *g_nb_value = cJSON_GetObjectItemCaseSensitive(g_nb_idJSON, "gNBValue"); + if (!g_nb_value) { + ogs_error("OpenAPI_g_nb_id_parseFromJSON() failed [g_nb_value]"); + goto end; + } + + + if (!cJSON_IsString(g_nb_value)) { + ogs_error("OpenAPI_g_nb_id_parseFromJSON() failed [g_nb_value]"); + goto end; + } + + g_nb_id_local_var = OpenAPI_g_nb_id_create ( + bit_length->valuedouble, + ogs_strdup(g_nb_value->valuestring) + ); + + return g_nb_id_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/g_nb_id.h b/lib/sbi/openapi/model/g_nb_id.h new file mode 100644 index 0000000000..c2cf49018f --- /dev/null +++ b/lib/sbi/openapi/model/g_nb_id.h @@ -0,0 +1,39 @@ +/* + * g_nb_id.h + * + * + */ + +#ifndef _OpenAPI_g_nb_id_H_ +#define _OpenAPI_g_nb_id_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_g_nb_id_s OpenAPI_g_nb_id_t; +typedef struct OpenAPI_g_nb_id_s { + int bit_length; + char *g_nb_value; +} OpenAPI_g_nb_id_t; + +OpenAPI_g_nb_id_t *OpenAPI_g_nb_id_create( + int bit_length, + char *g_nb_value + ); +void OpenAPI_g_nb_id_free(OpenAPI_g_nb_id_t *g_nb_id); +OpenAPI_g_nb_id_t *OpenAPI_g_nb_id_parseFromJSON(cJSON *g_nb_idJSON); +cJSON *OpenAPI_g_nb_id_convertToJSON(OpenAPI_g_nb_id_t *g_nb_id); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_g_nb_id_H_ */ + diff --git a/lib/sbi/openapi/model/gad_shape.c b/lib/sbi/openapi/model/gad_shape.c new file mode 100644 index 0000000000..9429e8d0ae --- /dev/null +++ b/lib/sbi/openapi/model/gad_shape.c @@ -0,0 +1,80 @@ + +#include +#include +#include +#include "gad_shape.h" + +OpenAPI_gad_shape_t *OpenAPI_gad_shape_create( + OpenAPI_supported_gad_shapes_t *shape + ) +{ + OpenAPI_gad_shape_t *gad_shape_local_var = OpenAPI_malloc(sizeof(OpenAPI_gad_shape_t)); + if (!gad_shape_local_var) { + return NULL; + } + gad_shape_local_var->shape = shape; + + return gad_shape_local_var; +} + +void OpenAPI_gad_shape_free(OpenAPI_gad_shape_t *gad_shape) +{ + if (NULL == gad_shape) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_supported_gad_shapes_free(gad_shape->shape); + ogs_free(gad_shape); +} + +cJSON *OpenAPI_gad_shape_convertToJSON(OpenAPI_gad_shape_t *gad_shape) +{ + cJSON *item = NULL; + + if (gad_shape == NULL) { + ogs_error("OpenAPI_gad_shape_convertToJSON() failed [GADShape]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!gad_shape->shape) { + ogs_error("OpenAPI_gad_shape_convertToJSON() failed [shape]"); + goto end; + } + cJSON *shape_local_JSON = OpenAPI_supported_gad_shapes_convertToJSON(gad_shape->shape); + if (shape_local_JSON == NULL) { + ogs_error("OpenAPI_gad_shape_convertToJSON() failed [shape]"); + goto end; + } + cJSON_AddItemToObject(item, "shape", shape_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_gad_shape_convertToJSON() failed [shape]"); + goto end; + } + +end: + return item; +} + +OpenAPI_gad_shape_t *OpenAPI_gad_shape_parseFromJSON(cJSON *gad_shapeJSON) +{ + OpenAPI_gad_shape_t *gad_shape_local_var = NULL; + cJSON *shape = cJSON_GetObjectItemCaseSensitive(gad_shapeJSON, "shape"); + if (!shape) { + ogs_error("OpenAPI_gad_shape_parseFromJSON() failed [shape]"); + goto end; + } + + OpenAPI_supported_gad_shapes_t *shape_local_nonprim = NULL; + + shape_local_nonprim = OpenAPI_supported_gad_shapes_parseFromJSON(shape); + + gad_shape_local_var = OpenAPI_gad_shape_create ( + shape_local_nonprim + ); + + return gad_shape_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/gad_shape.h b/lib/sbi/openapi/model/gad_shape.h new file mode 100644 index 0000000000..d235c7f239 --- /dev/null +++ b/lib/sbi/openapi/model/gad_shape.h @@ -0,0 +1,38 @@ +/* + * gad_shape.h + * + * + */ + +#ifndef _OpenAPI_gad_shape_H_ +#define _OpenAPI_gad_shape_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "supported_gad_shapes.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_gad_shape_s OpenAPI_gad_shape_t; +typedef struct OpenAPI_gad_shape_s { + struct OpenAPI_supported_gad_shapes_s *shape; +} OpenAPI_gad_shape_t; + +OpenAPI_gad_shape_t *OpenAPI_gad_shape_create( + OpenAPI_supported_gad_shapes_t *shape + ); +void OpenAPI_gad_shape_free(OpenAPI_gad_shape_t *gad_shape); +OpenAPI_gad_shape_t *OpenAPI_gad_shape_parseFromJSON(cJSON *gad_shapeJSON); +cJSON *OpenAPI_gad_shape_convertToJSON(OpenAPI_gad_shape_t *gad_shape); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_gad_shape_H_ */ + diff --git a/lib/sbi/openapi/model/geographic_area.c b/lib/sbi/openapi/model/geographic_area.c new file mode 100644 index 0000000000..14a310c633 --- /dev/null +++ b/lib/sbi/openapi/model/geographic_area.c @@ -0,0 +1,385 @@ + +#include +#include +#include +#include "geographic_area.h" + +OpenAPI_geographic_area_t *OpenAPI_geographic_area_create( + OpenAPI_supported_gad_shapes_t *shape, + OpenAPI_geographical_coordinates_t *point, + float uncertainty, + OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse, + int confidence, + OpenAPI_list_t *point_list, + double altitude, + float uncertainty_altitude, + int inner_radius, + float uncertainty_radius, + int offset_angle, + int included_angle + ) +{ + OpenAPI_geographic_area_t *geographic_area_local_var = OpenAPI_malloc(sizeof(OpenAPI_geographic_area_t)); + if (!geographic_area_local_var) { + return NULL; + } + geographic_area_local_var->shape = shape; + geographic_area_local_var->point = point; + geographic_area_local_var->uncertainty = uncertainty; + geographic_area_local_var->uncertainty_ellipse = uncertainty_ellipse; + geographic_area_local_var->confidence = confidence; + geographic_area_local_var->point_list = point_list; + geographic_area_local_var->altitude = altitude; + geographic_area_local_var->uncertainty_altitude = uncertainty_altitude; + geographic_area_local_var->inner_radius = inner_radius; + geographic_area_local_var->uncertainty_radius = uncertainty_radius; + geographic_area_local_var->offset_angle = offset_angle; + geographic_area_local_var->included_angle = included_angle; + + return geographic_area_local_var; +} + +void OpenAPI_geographic_area_free(OpenAPI_geographic_area_t *geographic_area) +{ + if (NULL == geographic_area) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_supported_gad_shapes_free(geographic_area->shape); + OpenAPI_geographical_coordinates_free(geographic_area->point); + OpenAPI_uncertainty_ellipse_free(geographic_area->uncertainty_ellipse); + OpenAPI_list_for_each(geographic_area->point_list, node) { + OpenAPI_geographical_coordinates_free(node->data); + } + OpenAPI_list_free(geographic_area->point_list); + ogs_free(geographic_area); +} + +cJSON *OpenAPI_geographic_area_convertToJSON(OpenAPI_geographic_area_t *geographic_area) +{ + cJSON *item = NULL; + + if (geographic_area == NULL) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [GeographicArea]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!geographic_area->shape) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [shape]"); + goto end; + } + cJSON *shape_local_JSON = OpenAPI_supported_gad_shapes_convertToJSON(geographic_area->shape); + if (shape_local_JSON == NULL) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [shape]"); + goto end; + } + cJSON_AddItemToObject(item, "shape", shape_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [shape]"); + goto end; + } + + if (!geographic_area->point) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [point]"); + goto end; + } + cJSON *point_local_JSON = OpenAPI_geographical_coordinates_convertToJSON(geographic_area->point); + if (point_local_JSON == NULL) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [point]"); + goto end; + } + cJSON_AddItemToObject(item, "point", point_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [point]"); + goto end; + } + + if (!geographic_area->uncertainty) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [uncertainty]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "uncertainty", geographic_area->uncertainty) == NULL) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [uncertainty]"); + goto end; + } + + if (!geographic_area->uncertainty_ellipse) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [uncertainty_ellipse]"); + goto end; + } + cJSON *uncertainty_ellipse_local_JSON = OpenAPI_uncertainty_ellipse_convertToJSON(geographic_area->uncertainty_ellipse); + if (uncertainty_ellipse_local_JSON == NULL) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [uncertainty_ellipse]"); + goto end; + } + cJSON_AddItemToObject(item, "uncertaintyEllipse", uncertainty_ellipse_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [uncertainty_ellipse]"); + goto end; + } + + if (!geographic_area->confidence) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [confidence]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "confidence", geographic_area->confidence) == NULL) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [confidence]"); + goto end; + } + + if (!geographic_area->point_list) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [point_list]"); + goto end; + } + cJSON *point_listList = cJSON_AddArrayToObject(item, "pointList"); + if (point_listList == NULL) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [point_list]"); + goto end; + } + + OpenAPI_lnode_t *point_list_node; + if (geographic_area->point_list) { + OpenAPI_list_for_each(geographic_area->point_list, point_list_node) { + cJSON *itemLocal = OpenAPI_geographical_coordinates_convertToJSON(point_list_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [point_list]"); + goto end; + } + cJSON_AddItemToArray(point_listList, itemLocal); + } + } + + if (!geographic_area->altitude) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [altitude]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "altitude", geographic_area->altitude) == NULL) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [altitude]"); + goto end; + } + + if (!geographic_area->uncertainty_altitude) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [uncertainty_altitude]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "uncertaintyAltitude", geographic_area->uncertainty_altitude) == NULL) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [uncertainty_altitude]"); + goto end; + } + + if (!geographic_area->inner_radius) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [inner_radius]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "innerRadius", geographic_area->inner_radius) == NULL) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [inner_radius]"); + goto end; + } + + if (!geographic_area->uncertainty_radius) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [uncertainty_radius]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "uncertaintyRadius", geographic_area->uncertainty_radius) == NULL) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [uncertainty_radius]"); + goto end; + } + + if (!geographic_area->offset_angle) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [offset_angle]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "offsetAngle", geographic_area->offset_angle) == NULL) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [offset_angle]"); + goto end; + } + + if (!geographic_area->included_angle) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [included_angle]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "includedAngle", geographic_area->included_angle) == NULL) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [included_angle]"); + goto end; + } + +end: + return item; +} + +OpenAPI_geographic_area_t *OpenAPI_geographic_area_parseFromJSON(cJSON *geographic_areaJSON) +{ + OpenAPI_geographic_area_t *geographic_area_local_var = NULL; + cJSON *shape = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "shape"); + if (!shape) { + ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [shape]"); + goto end; + } + + OpenAPI_supported_gad_shapes_t *shape_local_nonprim = NULL; + + shape_local_nonprim = OpenAPI_supported_gad_shapes_parseFromJSON(shape); + + cJSON *point = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "point"); + if (!point) { + ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [point]"); + goto end; + } + + OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; + + point_local_nonprim = OpenAPI_geographical_coordinates_parseFromJSON(point); + + cJSON *uncertainty = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "uncertainty"); + if (!uncertainty) { + ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [uncertainty]"); + goto end; + } + + + if (!cJSON_IsNumber(uncertainty)) { + ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [uncertainty]"); + goto end; + } + + cJSON *uncertainty_ellipse = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "uncertaintyEllipse"); + if (!uncertainty_ellipse) { + ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [uncertainty_ellipse]"); + goto end; + } + + OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse_local_nonprim = NULL; + + uncertainty_ellipse_local_nonprim = OpenAPI_uncertainty_ellipse_parseFromJSON(uncertainty_ellipse); + + cJSON *confidence = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "confidence"); + if (!confidence) { + ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [confidence]"); + goto end; + } + + + if (!cJSON_IsNumber(confidence)) { + ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [confidence]"); + goto end; + } + + cJSON *point_list = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "pointList"); + if (!point_list) { + ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [point_list]"); + goto end; + } + + OpenAPI_list_t *point_listList; + + cJSON *point_list_local_nonprimitive; + if (!cJSON_IsArray(point_list)) { + ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [point_list]"); + goto end; + } + + point_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(point_list_local_nonprimitive, point_list ) { + if (!cJSON_IsObject(point_list_local_nonprimitive)) { + ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [point_list]"); + goto end; + } + OpenAPI_geographical_coordinates_t *point_listItem = OpenAPI_geographical_coordinates_parseFromJSON(point_list_local_nonprimitive); + + OpenAPI_list_add(point_listList, point_listItem); + } + + cJSON *altitude = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "altitude"); + if (!altitude) { + ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [altitude]"); + goto end; + } + + + if (!cJSON_IsNumber(altitude)) { + ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [altitude]"); + goto end; + } + + cJSON *uncertainty_altitude = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "uncertaintyAltitude"); + if (!uncertainty_altitude) { + ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [uncertainty_altitude]"); + goto end; + } + + + if (!cJSON_IsNumber(uncertainty_altitude)) { + ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [uncertainty_altitude]"); + goto end; + } + + cJSON *inner_radius = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "innerRadius"); + if (!inner_radius) { + ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [inner_radius]"); + goto end; + } + + + if (!cJSON_IsNumber(inner_radius)) { + ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [inner_radius]"); + goto end; + } + + cJSON *uncertainty_radius = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "uncertaintyRadius"); + if (!uncertainty_radius) { + ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [uncertainty_radius]"); + goto end; + } + + + if (!cJSON_IsNumber(uncertainty_radius)) { + ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [uncertainty_radius]"); + goto end; + } + + cJSON *offset_angle = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "offsetAngle"); + if (!offset_angle) { + ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [offset_angle]"); + goto end; + } + + + if (!cJSON_IsNumber(offset_angle)) { + ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [offset_angle]"); + goto end; + } + + cJSON *included_angle = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "includedAngle"); + if (!included_angle) { + ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [included_angle]"); + goto end; + } + + + if (!cJSON_IsNumber(included_angle)) { + ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [included_angle]"); + goto end; + } + + geographic_area_local_var = OpenAPI_geographic_area_create ( + shape_local_nonprim, + point_local_nonprim, + uncertainty->valuedouble, + uncertainty_ellipse_local_nonprim, + confidence->valuedouble, + point_listList, + altitude->valuedouble, + uncertainty_altitude->valuedouble, + inner_radius->valuedouble, + uncertainty_radius->valuedouble, + offset_angle->valuedouble, + included_angle->valuedouble + ); + + return geographic_area_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/geographic_area.h b/lib/sbi/openapi/model/geographic_area.h new file mode 100644 index 0000000000..8f2a420904 --- /dev/null +++ b/lib/sbi/openapi/model/geographic_area.h @@ -0,0 +1,69 @@ +/* + * geographic_area.h + * + * + */ + +#ifndef _OpenAPI_geographic_area_H_ +#define _OpenAPI_geographic_area_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "ellipsoid_arc.h" +#include "geographical_coordinates.h" +#include "point.h" +#include "point_altitude.h" +#include "point_altitude_uncertainty.h" +#include "point_uncertainty_circle.h" +#include "point_uncertainty_ellipse.h" +#include "polygon.h" +#include "supported_gad_shapes.h" +#include "uncertainty_ellipse.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_geographic_area_s OpenAPI_geographic_area_t; +typedef struct OpenAPI_geographic_area_s { + struct OpenAPI_supported_gad_shapes_s *shape; + struct OpenAPI_geographical_coordinates_s *point; + float uncertainty; + struct OpenAPI_uncertainty_ellipse_s *uncertainty_ellipse; + int confidence; + OpenAPI_list_t *point_list; + double altitude; + float uncertainty_altitude; + int inner_radius; + float uncertainty_radius; + int offset_angle; + int included_angle; +} OpenAPI_geographic_area_t; + +OpenAPI_geographic_area_t *OpenAPI_geographic_area_create( + OpenAPI_supported_gad_shapes_t *shape, + OpenAPI_geographical_coordinates_t *point, + float uncertainty, + OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse, + int confidence, + OpenAPI_list_t *point_list, + double altitude, + float uncertainty_altitude, + int inner_radius, + float uncertainty_radius, + int offset_angle, + int included_angle + ); +void OpenAPI_geographic_area_free(OpenAPI_geographic_area_t *geographic_area); +OpenAPI_geographic_area_t *OpenAPI_geographic_area_parseFromJSON(cJSON *geographic_areaJSON); +cJSON *OpenAPI_geographic_area_convertToJSON(OpenAPI_geographic_area_t *geographic_area); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_geographic_area_H_ */ + diff --git a/lib/sbi/openapi/model/geographical_coordinates.c b/lib/sbi/openapi/model/geographical_coordinates.c new file mode 100644 index 0000000000..830adb23e8 --- /dev/null +++ b/lib/sbi/openapi/model/geographical_coordinates.c @@ -0,0 +1,99 @@ + +#include +#include +#include +#include "geographical_coordinates.h" + +OpenAPI_geographical_coordinates_t *OpenAPI_geographical_coordinates_create( + double lon, + double lat + ) +{ + OpenAPI_geographical_coordinates_t *geographical_coordinates_local_var = OpenAPI_malloc(sizeof(OpenAPI_geographical_coordinates_t)); + if (!geographical_coordinates_local_var) { + return NULL; + } + geographical_coordinates_local_var->lon = lon; + geographical_coordinates_local_var->lat = lat; + + return geographical_coordinates_local_var; +} + +void OpenAPI_geographical_coordinates_free(OpenAPI_geographical_coordinates_t *geographical_coordinates) +{ + if (NULL == geographical_coordinates) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(geographical_coordinates); +} + +cJSON *OpenAPI_geographical_coordinates_convertToJSON(OpenAPI_geographical_coordinates_t *geographical_coordinates) +{ + cJSON *item = NULL; + + if (geographical_coordinates == NULL) { + ogs_error("OpenAPI_geographical_coordinates_convertToJSON() failed [GeographicalCoordinates]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!geographical_coordinates->lon) { + ogs_error("OpenAPI_geographical_coordinates_convertToJSON() failed [lon]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "lon", geographical_coordinates->lon) == NULL) { + ogs_error("OpenAPI_geographical_coordinates_convertToJSON() failed [lon]"); + goto end; + } + + if (!geographical_coordinates->lat) { + ogs_error("OpenAPI_geographical_coordinates_convertToJSON() failed [lat]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "lat", geographical_coordinates->lat) == NULL) { + ogs_error("OpenAPI_geographical_coordinates_convertToJSON() failed [lat]"); + goto end; + } + +end: + return item; +} + +OpenAPI_geographical_coordinates_t *OpenAPI_geographical_coordinates_parseFromJSON(cJSON *geographical_coordinatesJSON) +{ + OpenAPI_geographical_coordinates_t *geographical_coordinates_local_var = NULL; + cJSON *lon = cJSON_GetObjectItemCaseSensitive(geographical_coordinatesJSON, "lon"); + if (!lon) { + ogs_error("OpenAPI_geographical_coordinates_parseFromJSON() failed [lon]"); + goto end; + } + + + if (!cJSON_IsNumber(lon)) { + ogs_error("OpenAPI_geographical_coordinates_parseFromJSON() failed [lon]"); + goto end; + } + + cJSON *lat = cJSON_GetObjectItemCaseSensitive(geographical_coordinatesJSON, "lat"); + if (!lat) { + ogs_error("OpenAPI_geographical_coordinates_parseFromJSON() failed [lat]"); + goto end; + } + + + if (!cJSON_IsNumber(lat)) { + ogs_error("OpenAPI_geographical_coordinates_parseFromJSON() failed [lat]"); + goto end; + } + + geographical_coordinates_local_var = OpenAPI_geographical_coordinates_create ( + lon->valuedouble, + lat->valuedouble + ); + + return geographical_coordinates_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/geographical_coordinates.h b/lib/sbi/openapi/model/geographical_coordinates.h new file mode 100644 index 0000000000..b01f3bbc38 --- /dev/null +++ b/lib/sbi/openapi/model/geographical_coordinates.h @@ -0,0 +1,39 @@ +/* + * geographical_coordinates.h + * + * + */ + +#ifndef _OpenAPI_geographical_coordinates_H_ +#define _OpenAPI_geographical_coordinates_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_geographical_coordinates_s OpenAPI_geographical_coordinates_t; +typedef struct OpenAPI_geographical_coordinates_s { + double lon; + double lat; +} OpenAPI_geographical_coordinates_t; + +OpenAPI_geographical_coordinates_t *OpenAPI_geographical_coordinates_create( + double lon, + double lat + ); +void OpenAPI_geographical_coordinates_free(OpenAPI_geographical_coordinates_t *geographical_coordinates); +OpenAPI_geographical_coordinates_t *OpenAPI_geographical_coordinates_parseFromJSON(cJSON *geographical_coordinatesJSON); +cJSON *OpenAPI_geographical_coordinates_convertToJSON(OpenAPI_geographical_coordinates_t *geographical_coordinates); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_geographical_coordinates_H_ */ + diff --git a/lib/sbi/openapi/model/global_ran_node_id.c b/lib/sbi/openapi/model/global_ran_node_id.c new file mode 100644 index 0000000000..4037e1ee82 --- /dev/null +++ b/lib/sbi/openapi/model/global_ran_node_id.c @@ -0,0 +1,184 @@ + +#include +#include +#include +#include "global_ran_node_id.h" + +OpenAPI_global_ran_node_id_t *OpenAPI_global_ran_node_id_create( + OpenAPI_plmn_id_t *plmn_id, + char *n3_iwf_id, + OpenAPI_g_nb_id_t *g_nb_id, + char *nge_nb_id, + char *nid, + char *e_nb_id + ) +{ + OpenAPI_global_ran_node_id_t *global_ran_node_id_local_var = OpenAPI_malloc(sizeof(OpenAPI_global_ran_node_id_t)); + if (!global_ran_node_id_local_var) { + return NULL; + } + global_ran_node_id_local_var->plmn_id = plmn_id; + 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->nid = nid; + global_ran_node_id_local_var->e_nb_id = e_nb_id; + + return global_ran_node_id_local_var; +} + +void OpenAPI_global_ran_node_id_free(OpenAPI_global_ran_node_id_t *global_ran_node_id) +{ + if (NULL == global_ran_node_id) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_plmn_id_free(global_ran_node_id->plmn_id); + 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->nid); + ogs_free(global_ran_node_id->e_nb_id); + ogs_free(global_ran_node_id); +} + +cJSON *OpenAPI_global_ran_node_id_convertToJSON(OpenAPI_global_ran_node_id_t *global_ran_node_id) +{ + cJSON *item = NULL; + + if (global_ran_node_id == NULL) { + ogs_error("OpenAPI_global_ran_node_id_convertToJSON() failed [GlobalRanNodeId]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!global_ran_node_id->plmn_id) { + ogs_error("OpenAPI_global_ran_node_id_convertToJSON() failed [plmn_id]"); + goto end; + } + cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_convertToJSON(global_ran_node_id->plmn_id); + if (plmn_id_local_JSON == NULL) { + ogs_error("OpenAPI_global_ran_node_id_convertToJSON() failed [plmn_id]"); + goto end; + } + cJSON_AddItemToObject(item, "plmnId", plmn_id_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_global_ran_node_id_convertToJSON() failed [plmn_id]"); + goto end; + } + + if (global_ran_node_id->n3_iwf_id) { + if (cJSON_AddStringToObject(item, "n3IwfId", global_ran_node_id->n3_iwf_id) == NULL) { + ogs_error("OpenAPI_global_ran_node_id_convertToJSON() failed [n3_iwf_id]"); + goto end; + } + } + + if (global_ran_node_id->g_nb_id) { + cJSON *g_nb_id_local_JSON = OpenAPI_g_nb_id_convertToJSON(global_ran_node_id->g_nb_id); + if (g_nb_id_local_JSON == NULL) { + ogs_error("OpenAPI_global_ran_node_id_convertToJSON() failed [g_nb_id]"); + goto end; + } + cJSON_AddItemToObject(item, "gNbId", g_nb_id_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_global_ran_node_id_convertToJSON() failed [g_nb_id]"); + goto end; + } + } + + if (global_ran_node_id->nge_nb_id) { + if (cJSON_AddStringToObject(item, "ngeNbId", global_ran_node_id->nge_nb_id) == NULL) { + ogs_error("OpenAPI_global_ran_node_id_convertToJSON() failed [nge_nb_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]"); + goto end; + } + } + + if (global_ran_node_id->e_nb_id) { + if (cJSON_AddStringToObject(item, "eNbId", global_ran_node_id->e_nb_id) == NULL) { + ogs_error("OpenAPI_global_ran_node_id_convertToJSON() failed [e_nb_id]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_global_ran_node_id_t *OpenAPI_global_ran_node_id_parseFromJSON(cJSON *global_ran_node_idJSON) +{ + OpenAPI_global_ran_node_id_t *global_ran_node_id_local_var = NULL; + cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_idJSON, "plmnId"); + if (!plmn_id) { + ogs_error("OpenAPI_global_ran_node_id_parseFromJSON() failed [plmn_id]"); + goto end; + } + + OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + + plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); + + cJSON *n3_iwf_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_idJSON, "n3IwfId"); + + if (n3_iwf_id) { + if (!cJSON_IsString(n3_iwf_id)) { + ogs_error("OpenAPI_global_ran_node_id_parseFromJSON() failed [n3_iwf_id]"); + goto end; + } + } + + cJSON *g_nb_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_idJSON, "gNbId"); + + OpenAPI_g_nb_id_t *g_nb_id_local_nonprim = NULL; + if (g_nb_id) { + g_nb_id_local_nonprim = OpenAPI_g_nb_id_parseFromJSON(g_nb_id); + } + + cJSON *nge_nb_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_idJSON, "ngeNbId"); + + if (nge_nb_id) { + if (!cJSON_IsString(nge_nb_id)) { + ogs_error("OpenAPI_global_ran_node_id_parseFromJSON() failed [nge_nb_id]"); + goto end; + } + } + + cJSON *nid = cJSON_GetObjectItemCaseSensitive(global_ran_node_idJSON, "nid"); + + if (nid) { + if (!cJSON_IsString(nid)) { + ogs_error("OpenAPI_global_ran_node_id_parseFromJSON() failed [nid]"); + goto end; + } + } + + cJSON *e_nb_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_idJSON, "eNbId"); + + if (e_nb_id) { + if (!cJSON_IsString(e_nb_id)) { + ogs_error("OpenAPI_global_ran_node_id_parseFromJSON() failed [e_nb_id]"); + goto end; + } + } + + global_ran_node_id_local_var = OpenAPI_global_ran_node_id_create ( + plmn_id_local_nonprim, + 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, + nid ? ogs_strdup(nid->valuestring) : NULL, + e_nb_id ? ogs_strdup(e_nb_id->valuestring) : NULL + ); + + return global_ran_node_id_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/global_ran_node_id.h b/lib/sbi/openapi/model/global_ran_node_id.h new file mode 100644 index 0000000000..0102e4d7b3 --- /dev/null +++ b/lib/sbi/openapi/model/global_ran_node_id.h @@ -0,0 +1,49 @@ +/* + * global_ran_node_id.h + * + * + */ + +#ifndef _OpenAPI_global_ran_node_id_H_ +#define _OpenAPI_global_ran_node_id_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "g_nb_id.h" +#include "plmn_id.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_global_ran_node_id_s OpenAPI_global_ran_node_id_t; +typedef struct OpenAPI_global_ran_node_id_s { + struct OpenAPI_plmn_id_s *plmn_id; + char *n3_iwf_id; + struct OpenAPI_g_nb_id_s *g_nb_id; + char *nge_nb_id; + char *nid; + char *e_nb_id; +} OpenAPI_global_ran_node_id_t; + +OpenAPI_global_ran_node_id_t *OpenAPI_global_ran_node_id_create( + OpenAPI_plmn_id_t *plmn_id, + char *n3_iwf_id, + OpenAPI_g_nb_id_t *g_nb_id, + char *nge_nb_id, + char *nid, + char *e_nb_id + ); +void OpenAPI_global_ran_node_id_free(OpenAPI_global_ran_node_id_t *global_ran_node_id); +OpenAPI_global_ran_node_id_t *OpenAPI_global_ran_node_id_parseFromJSON(cJSON *global_ran_node_idJSON); +cJSON *OpenAPI_global_ran_node_id_convertToJSON(OpenAPI_global_ran_node_id_t *global_ran_node_id); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_global_ran_node_id_H_ */ + diff --git a/lib/sbi/openapi/model/gmlc_info.c b/lib/sbi/openapi/model/gmlc_info.c new file mode 100644 index 0000000000..1ca7c8a7c2 --- /dev/null +++ b/lib/sbi/openapi/model/gmlc_info.c @@ -0,0 +1,101 @@ + +#include +#include +#include +#include "gmlc_info.h" + +OpenAPI_gmlc_info_t *OpenAPI_gmlc_info_create( + OpenAPI_list_t *serving_client_types + ) +{ + OpenAPI_gmlc_info_t *gmlc_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_gmlc_info_t)); + if (!gmlc_info_local_var) { + return NULL; + } + gmlc_info_local_var->serving_client_types = serving_client_types; + + return gmlc_info_local_var; +} + +void OpenAPI_gmlc_info_free(OpenAPI_gmlc_info_t *gmlc_info) +{ + if (NULL == gmlc_info) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(gmlc_info->serving_client_types, node) { + OpenAPI_external_client_type_free(node->data); + } + OpenAPI_list_free(gmlc_info->serving_client_types); + ogs_free(gmlc_info); +} + +cJSON *OpenAPI_gmlc_info_convertToJSON(OpenAPI_gmlc_info_t *gmlc_info) +{ + cJSON *item = NULL; + + if (gmlc_info == NULL) { + ogs_error("OpenAPI_gmlc_info_convertToJSON() failed [GmlcInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (gmlc_info->serving_client_types) { + cJSON *serving_client_typesList = cJSON_AddArrayToObject(item, "servingClientTypes"); + if (serving_client_typesList == NULL) { + ogs_error("OpenAPI_gmlc_info_convertToJSON() failed [serving_client_types]"); + goto end; + } + + OpenAPI_lnode_t *serving_client_types_node; + if (gmlc_info->serving_client_types) { + OpenAPI_list_for_each(gmlc_info->serving_client_types, serving_client_types_node) { + cJSON *itemLocal = OpenAPI_external_client_type_convertToJSON(serving_client_types_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_gmlc_info_convertToJSON() failed [serving_client_types]"); + goto end; + } + cJSON_AddItemToArray(serving_client_typesList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_gmlc_info_t *OpenAPI_gmlc_info_parseFromJSON(cJSON *gmlc_infoJSON) +{ + OpenAPI_gmlc_info_t *gmlc_info_local_var = NULL; + cJSON *serving_client_types = cJSON_GetObjectItemCaseSensitive(gmlc_infoJSON, "servingClientTypes"); + + OpenAPI_list_t *serving_client_typesList; + if (serving_client_types) { + cJSON *serving_client_types_local_nonprimitive; + if (!cJSON_IsArray(serving_client_types)) { + ogs_error("OpenAPI_gmlc_info_parseFromJSON() failed [serving_client_types]"); + goto end; + } + + serving_client_typesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(serving_client_types_local_nonprimitive, serving_client_types ) { + if (!cJSON_IsObject(serving_client_types_local_nonprimitive)) { + ogs_error("OpenAPI_gmlc_info_parseFromJSON() failed [serving_client_types]"); + goto end; + } + OpenAPI_external_client_type_t *serving_client_typesItem = OpenAPI_external_client_type_parseFromJSON(serving_client_types_local_nonprimitive); + + OpenAPI_list_add(serving_client_typesList, serving_client_typesItem); + } + } + + gmlc_info_local_var = OpenAPI_gmlc_info_create ( + serving_client_types ? serving_client_typesList : NULL + ); + + return gmlc_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/gmlc_info.h b/lib/sbi/openapi/model/gmlc_info.h new file mode 100644 index 0000000000..e9452010df --- /dev/null +++ b/lib/sbi/openapi/model/gmlc_info.h @@ -0,0 +1,38 @@ +/* + * gmlc_info.h + * + * + */ + +#ifndef _OpenAPI_gmlc_info_H_ +#define _OpenAPI_gmlc_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "external_client_type.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_gmlc_info_s OpenAPI_gmlc_info_t; +typedef struct OpenAPI_gmlc_info_s { + OpenAPI_list_t *serving_client_types; +} OpenAPI_gmlc_info_t; + +OpenAPI_gmlc_info_t *OpenAPI_gmlc_info_create( + OpenAPI_list_t *serving_client_types + ); +void OpenAPI_gmlc_info_free(OpenAPI_gmlc_info_t *gmlc_info); +OpenAPI_gmlc_info_t *OpenAPI_gmlc_info_parseFromJSON(cJSON *gmlc_infoJSON); +cJSON *OpenAPI_gmlc_info_convertToJSON(OpenAPI_gmlc_info_t *gmlc_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_gmlc_info_H_ */ + diff --git a/lib/sbi/openapi/model/group_identifiers.c b/lib/sbi/openapi/model/group_identifiers.c new file mode 100644 index 0000000000..99bdb89fb9 --- /dev/null +++ b/lib/sbi/openapi/model/group_identifiers.c @@ -0,0 +1,141 @@ + +#include +#include +#include +#include "group_identifiers.h" + +OpenAPI_group_identifiers_t *OpenAPI_group_identifiers_create( + char *ext_group_id, + char *int_group_id, + OpenAPI_list_t *ue_id_list + ) +{ + OpenAPI_group_identifiers_t *group_identifiers_local_var = OpenAPI_malloc(sizeof(OpenAPI_group_identifiers_t)); + if (!group_identifiers_local_var) { + return NULL; + } + group_identifiers_local_var->ext_group_id = ext_group_id; + group_identifiers_local_var->int_group_id = int_group_id; + group_identifiers_local_var->ue_id_list = ue_id_list; + + return group_identifiers_local_var; +} + +void OpenAPI_group_identifiers_free(OpenAPI_group_identifiers_t *group_identifiers) +{ + if (NULL == group_identifiers) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(group_identifiers->ext_group_id); + ogs_free(group_identifiers->int_group_id); + OpenAPI_list_for_each(group_identifiers->ue_id_list, node) { + OpenAPI_ue_id_free(node->data); + } + OpenAPI_list_free(group_identifiers->ue_id_list); + ogs_free(group_identifiers); +} + +cJSON *OpenAPI_group_identifiers_convertToJSON(OpenAPI_group_identifiers_t *group_identifiers) +{ + cJSON *item = NULL; + + if (group_identifiers == NULL) { + ogs_error("OpenAPI_group_identifiers_convertToJSON() failed [GroupIdentifiers]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (group_identifiers->ext_group_id) { + if (cJSON_AddStringToObject(item, "extGroupId", group_identifiers->ext_group_id) == NULL) { + ogs_error("OpenAPI_group_identifiers_convertToJSON() failed [ext_group_id]"); + goto end; + } + } + + if (group_identifiers->int_group_id) { + if (cJSON_AddStringToObject(item, "intGroupId", group_identifiers->int_group_id) == NULL) { + ogs_error("OpenAPI_group_identifiers_convertToJSON() failed [int_group_id]"); + goto end; + } + } + + if (group_identifiers->ue_id_list) { + cJSON *ue_id_listList = cJSON_AddArrayToObject(item, "ueIdList"); + if (ue_id_listList == NULL) { + ogs_error("OpenAPI_group_identifiers_convertToJSON() failed [ue_id_list]"); + goto end; + } + + OpenAPI_lnode_t *ue_id_list_node; + if (group_identifiers->ue_id_list) { + OpenAPI_list_for_each(group_identifiers->ue_id_list, ue_id_list_node) { + cJSON *itemLocal = OpenAPI_ue_id_convertToJSON(ue_id_list_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_group_identifiers_convertToJSON() failed [ue_id_list]"); + goto end; + } + cJSON_AddItemToArray(ue_id_listList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_group_identifiers_t *OpenAPI_group_identifiers_parseFromJSON(cJSON *group_identifiersJSON) +{ + OpenAPI_group_identifiers_t *group_identifiers_local_var = NULL; + cJSON *ext_group_id = cJSON_GetObjectItemCaseSensitive(group_identifiersJSON, "extGroupId"); + + if (ext_group_id) { + if (!cJSON_IsString(ext_group_id)) { + ogs_error("OpenAPI_group_identifiers_parseFromJSON() failed [ext_group_id]"); + goto end; + } + } + + cJSON *int_group_id = cJSON_GetObjectItemCaseSensitive(group_identifiersJSON, "intGroupId"); + + if (int_group_id) { + if (!cJSON_IsString(int_group_id)) { + ogs_error("OpenAPI_group_identifiers_parseFromJSON() failed [int_group_id]"); + goto end; + } + } + + cJSON *ue_id_list = cJSON_GetObjectItemCaseSensitive(group_identifiersJSON, "ueIdList"); + + OpenAPI_list_t *ue_id_listList; + if (ue_id_list) { + cJSON *ue_id_list_local_nonprimitive; + if (!cJSON_IsArray(ue_id_list)) { + ogs_error("OpenAPI_group_identifiers_parseFromJSON() failed [ue_id_list]"); + goto end; + } + + ue_id_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ue_id_list_local_nonprimitive, ue_id_list ) { + if (!cJSON_IsObject(ue_id_list_local_nonprimitive)) { + ogs_error("OpenAPI_group_identifiers_parseFromJSON() failed [ue_id_list]"); + goto end; + } + OpenAPI_ue_id_t *ue_id_listItem = OpenAPI_ue_id_parseFromJSON(ue_id_list_local_nonprimitive); + + OpenAPI_list_add(ue_id_listList, ue_id_listItem); + } + } + + group_identifiers_local_var = OpenAPI_group_identifiers_create ( + ext_group_id ? ogs_strdup(ext_group_id->valuestring) : NULL, + int_group_id ? ogs_strdup(int_group_id->valuestring) : NULL, + ue_id_list ? ue_id_listList : NULL + ); + + return group_identifiers_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/group_identifiers.h b/lib/sbi/openapi/model/group_identifiers.h new file mode 100644 index 0000000000..e12d13dace --- /dev/null +++ b/lib/sbi/openapi/model/group_identifiers.h @@ -0,0 +1,42 @@ +/* + * group_identifiers.h + * + * + */ + +#ifndef _OpenAPI_group_identifiers_H_ +#define _OpenAPI_group_identifiers_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "ue_id.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_group_identifiers_s OpenAPI_group_identifiers_t; +typedef struct OpenAPI_group_identifiers_s { + char *ext_group_id; + char *int_group_id; + OpenAPI_list_t *ue_id_list; +} OpenAPI_group_identifiers_t; + +OpenAPI_group_identifiers_t *OpenAPI_group_identifiers_create( + char *ext_group_id, + char *int_group_id, + OpenAPI_list_t *ue_id_list + ); +void OpenAPI_group_identifiers_free(OpenAPI_group_identifiers_t *group_identifiers); +OpenAPI_group_identifiers_t *OpenAPI_group_identifiers_parseFromJSON(cJSON *group_identifiersJSON); +cJSON *OpenAPI_group_identifiers_convertToJSON(OpenAPI_group_identifiers_t *group_identifiers); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_group_identifiers_H_ */ + diff --git a/lib/sbi/openapi/model/guami_list_cond.h b/lib/sbi/openapi/model/guami_list_cond.h index 75f9946e10..fe9663ac4f 100644 --- a/lib/sbi/openapi/model/guami_list_cond.h +++ b/lib/sbi/openapi/model/guami_list_cond.h @@ -1,7 +1,7 @@ /* * guami_list_cond.h * - * + * Subscription to a set of AMFs, based on their GUAMIs */ #ifndef _OpenAPI_guami_list_cond_H_ diff --git a/lib/sbi/openapi/model/hfc_node_id.c b/lib/sbi/openapi/model/hfc_node_id.c new file mode 100644 index 0000000000..d94bf3443a --- /dev/null +++ b/lib/sbi/openapi/model/hfc_node_id.c @@ -0,0 +1,76 @@ + +#include +#include +#include +#include "hfc_node_id.h" + +OpenAPI_hfc_node_id_t *OpenAPI_hfc_node_id_create( + char *hfc_n_id + ) +{ + OpenAPI_hfc_node_id_t *hfc_node_id_local_var = OpenAPI_malloc(sizeof(OpenAPI_hfc_node_id_t)); + if (!hfc_node_id_local_var) { + return NULL; + } + hfc_node_id_local_var->hfc_n_id = hfc_n_id; + + return hfc_node_id_local_var; +} + +void OpenAPI_hfc_node_id_free(OpenAPI_hfc_node_id_t *hfc_node_id) +{ + if (NULL == hfc_node_id) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(hfc_node_id->hfc_n_id); + ogs_free(hfc_node_id); +} + +cJSON *OpenAPI_hfc_node_id_convertToJSON(OpenAPI_hfc_node_id_t *hfc_node_id) +{ + cJSON *item = NULL; + + if (hfc_node_id == NULL) { + ogs_error("OpenAPI_hfc_node_id_convertToJSON() failed [HfcNodeId]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!hfc_node_id->hfc_n_id) { + ogs_error("OpenAPI_hfc_node_id_convertToJSON() failed [hfc_n_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "hfcNId", hfc_node_id->hfc_n_id) == NULL) { + ogs_error("OpenAPI_hfc_node_id_convertToJSON() failed [hfc_n_id]"); + goto end; + } + +end: + return item; +} + +OpenAPI_hfc_node_id_t *OpenAPI_hfc_node_id_parseFromJSON(cJSON *hfc_node_idJSON) +{ + OpenAPI_hfc_node_id_t *hfc_node_id_local_var = NULL; + cJSON *hfc_n_id = cJSON_GetObjectItemCaseSensitive(hfc_node_idJSON, "hfcNId"); + if (!hfc_n_id) { + ogs_error("OpenAPI_hfc_node_id_parseFromJSON() failed [hfc_n_id]"); + goto end; + } + + + if (!cJSON_IsString(hfc_n_id)) { + ogs_error("OpenAPI_hfc_node_id_parseFromJSON() failed [hfc_n_id]"); + goto end; + } + + hfc_node_id_local_var = OpenAPI_hfc_node_id_create ( + ogs_strdup(hfc_n_id->valuestring) + ); + + return hfc_node_id_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/hfc_node_id.h b/lib/sbi/openapi/model/hfc_node_id.h new file mode 100644 index 0000000000..ced8a1d36e --- /dev/null +++ b/lib/sbi/openapi/model/hfc_node_id.h @@ -0,0 +1,37 @@ +/* + * hfc_node_id.h + * + * + */ + +#ifndef _OpenAPI_hfc_node_id_H_ +#define _OpenAPI_hfc_node_id_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_hfc_node_id_s OpenAPI_hfc_node_id_t; +typedef struct OpenAPI_hfc_node_id_s { + char *hfc_n_id; +} OpenAPI_hfc_node_id_t; + +OpenAPI_hfc_node_id_t *OpenAPI_hfc_node_id_create( + char *hfc_n_id + ); +void OpenAPI_hfc_node_id_free(OpenAPI_hfc_node_id_t *hfc_node_id); +OpenAPI_hfc_node_id_t *OpenAPI_hfc_node_id_parseFromJSON(cJSON *hfc_node_idJSON); +cJSON *OpenAPI_hfc_node_id_convertToJSON(OpenAPI_hfc_node_id_t *hfc_node_id); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_hfc_node_id_H_ */ + diff --git a/lib/sbi/openapi/model/hss_auth_type.c b/lib/sbi/openapi/model/hss_auth_type.c new file mode 100644 index 0000000000..901230a902 --- /dev/null +++ b/lib/sbi/openapi/model/hss_auth_type.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "hss_auth_type.h" + +OpenAPI_hss_auth_type_t *OpenAPI_hss_auth_type_create( + ) +{ + OpenAPI_hss_auth_type_t *hss_auth_type_local_var = OpenAPI_malloc(sizeof(OpenAPI_hss_auth_type_t)); + if (!hss_auth_type_local_var) { + return NULL; + } + + return hss_auth_type_local_var; +} + +void OpenAPI_hss_auth_type_free(OpenAPI_hss_auth_type_t *hss_auth_type) +{ + if (NULL == hss_auth_type) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(hss_auth_type); +} + +cJSON *OpenAPI_hss_auth_type_convertToJSON(OpenAPI_hss_auth_type_t *hss_auth_type) +{ + cJSON *item = NULL; + + if (hss_auth_type == NULL) { + ogs_error("OpenAPI_hss_auth_type_convertToJSON() failed [HssAuthType]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_hss_auth_type_t *OpenAPI_hss_auth_type_parseFromJSON(cJSON *hss_auth_typeJSON) +{ + OpenAPI_hss_auth_type_t *hss_auth_type_local_var = NULL; + hss_auth_type_local_var = OpenAPI_hss_auth_type_create ( + ); + + return hss_auth_type_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/hss_auth_type.h b/lib/sbi/openapi/model/hss_auth_type.h new file mode 100644 index 0000000000..1ef7a243e1 --- /dev/null +++ b/lib/sbi/openapi/model/hss_auth_type.h @@ -0,0 +1,35 @@ +/* + * hss_auth_type.h + * + * + */ + +#ifndef _OpenAPI_hss_auth_type_H_ +#define _OpenAPI_hss_auth_type_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_hss_auth_type_s OpenAPI_hss_auth_type_t; +typedef struct OpenAPI_hss_auth_type_s { +} OpenAPI_hss_auth_type_t; + +OpenAPI_hss_auth_type_t *OpenAPI_hss_auth_type_create( + ); +void OpenAPI_hss_auth_type_free(OpenAPI_hss_auth_type_t *hss_auth_type); +OpenAPI_hss_auth_type_t *OpenAPI_hss_auth_type_parseFromJSON(cJSON *hss_auth_typeJSON); +cJSON *OpenAPI_hss_auth_type_convertToJSON(OpenAPI_hss_auth_type_t *hss_auth_type); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_hss_auth_type_H_ */ + diff --git a/lib/sbi/openapi/model/hss_authentication_info_request.c b/lib/sbi/openapi/model/hss_authentication_info_request.c new file mode 100644 index 0000000000..4456016662 --- /dev/null +++ b/lib/sbi/openapi/model/hss_authentication_info_request.c @@ -0,0 +1,172 @@ + +#include +#include +#include +#include "hss_authentication_info_request.h" + +OpenAPI_hss_authentication_info_request_t *OpenAPI_hss_authentication_info_request_create( + char *supported_features, + OpenAPI_hss_auth_type_t *hss_auth_type, + int num_of_requested_vectors, + OpenAPI_plmn_id_t *serving_network_id, + OpenAPI_resynchronization_info_t *resynchronization_info + ) +{ + OpenAPI_hss_authentication_info_request_t *hss_authentication_info_request_local_var = OpenAPI_malloc(sizeof(OpenAPI_hss_authentication_info_request_t)); + if (!hss_authentication_info_request_local_var) { + return NULL; + } + hss_authentication_info_request_local_var->supported_features = supported_features; + hss_authentication_info_request_local_var->hss_auth_type = hss_auth_type; + hss_authentication_info_request_local_var->num_of_requested_vectors = num_of_requested_vectors; + hss_authentication_info_request_local_var->serving_network_id = serving_network_id; + hss_authentication_info_request_local_var->resynchronization_info = resynchronization_info; + + return hss_authentication_info_request_local_var; +} + +void OpenAPI_hss_authentication_info_request_free(OpenAPI_hss_authentication_info_request_t *hss_authentication_info_request) +{ + if (NULL == hss_authentication_info_request) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(hss_authentication_info_request->supported_features); + OpenAPI_hss_auth_type_free(hss_authentication_info_request->hss_auth_type); + OpenAPI_plmn_id_free(hss_authentication_info_request->serving_network_id); + OpenAPI_resynchronization_info_free(hss_authentication_info_request->resynchronization_info); + ogs_free(hss_authentication_info_request); +} + +cJSON *OpenAPI_hss_authentication_info_request_convertToJSON(OpenAPI_hss_authentication_info_request_t *hss_authentication_info_request) +{ + cJSON *item = NULL; + + if (hss_authentication_info_request == NULL) { + ogs_error("OpenAPI_hss_authentication_info_request_convertToJSON() failed [HssAuthenticationInfoRequest]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (hss_authentication_info_request->supported_features) { + if (cJSON_AddStringToObject(item, "supportedFeatures", hss_authentication_info_request->supported_features) == NULL) { + ogs_error("OpenAPI_hss_authentication_info_request_convertToJSON() failed [supported_features]"); + goto end; + } + } + + if (!hss_authentication_info_request->hss_auth_type) { + ogs_error("OpenAPI_hss_authentication_info_request_convertToJSON() failed [hss_auth_type]"); + goto end; + } + cJSON *hss_auth_type_local_JSON = OpenAPI_hss_auth_type_convertToJSON(hss_authentication_info_request->hss_auth_type); + if (hss_auth_type_local_JSON == NULL) { + ogs_error("OpenAPI_hss_authentication_info_request_convertToJSON() failed [hss_auth_type]"); + goto end; + } + cJSON_AddItemToObject(item, "hssAuthType", hss_auth_type_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_hss_authentication_info_request_convertToJSON() failed [hss_auth_type]"); + goto end; + } + + if (!hss_authentication_info_request->num_of_requested_vectors) { + ogs_error("OpenAPI_hss_authentication_info_request_convertToJSON() failed [num_of_requested_vectors]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "numOfRequestedVectors", hss_authentication_info_request->num_of_requested_vectors) == NULL) { + ogs_error("OpenAPI_hss_authentication_info_request_convertToJSON() failed [num_of_requested_vectors]"); + goto end; + } + + if (hss_authentication_info_request->serving_network_id) { + cJSON *serving_network_id_local_JSON = OpenAPI_plmn_id_convertToJSON(hss_authentication_info_request->serving_network_id); + if (serving_network_id_local_JSON == NULL) { + ogs_error("OpenAPI_hss_authentication_info_request_convertToJSON() failed [serving_network_id]"); + goto end; + } + cJSON_AddItemToObject(item, "servingNetworkId", serving_network_id_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_hss_authentication_info_request_convertToJSON() failed [serving_network_id]"); + goto end; + } + } + + if (hss_authentication_info_request->resynchronization_info) { + cJSON *resynchronization_info_local_JSON = OpenAPI_resynchronization_info_convertToJSON(hss_authentication_info_request->resynchronization_info); + if (resynchronization_info_local_JSON == NULL) { + ogs_error("OpenAPI_hss_authentication_info_request_convertToJSON() failed [resynchronization_info]"); + goto end; + } + cJSON_AddItemToObject(item, "resynchronizationInfo", resynchronization_info_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_hss_authentication_info_request_convertToJSON() failed [resynchronization_info]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_hss_authentication_info_request_t *OpenAPI_hss_authentication_info_request_parseFromJSON(cJSON *hss_authentication_info_requestJSON) +{ + OpenAPI_hss_authentication_info_request_t *hss_authentication_info_request_local_var = NULL; + cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(hss_authentication_info_requestJSON, "supportedFeatures"); + + if (supported_features) { + if (!cJSON_IsString(supported_features)) { + ogs_error("OpenAPI_hss_authentication_info_request_parseFromJSON() failed [supported_features]"); + goto end; + } + } + + cJSON *hss_auth_type = cJSON_GetObjectItemCaseSensitive(hss_authentication_info_requestJSON, "hssAuthType"); + if (!hss_auth_type) { + ogs_error("OpenAPI_hss_authentication_info_request_parseFromJSON() failed [hss_auth_type]"); + goto end; + } + + OpenAPI_hss_auth_type_t *hss_auth_type_local_nonprim = NULL; + + hss_auth_type_local_nonprim = OpenAPI_hss_auth_type_parseFromJSON(hss_auth_type); + + cJSON *num_of_requested_vectors = cJSON_GetObjectItemCaseSensitive(hss_authentication_info_requestJSON, "numOfRequestedVectors"); + if (!num_of_requested_vectors) { + ogs_error("OpenAPI_hss_authentication_info_request_parseFromJSON() failed [num_of_requested_vectors]"); + goto end; + } + + + if (!cJSON_IsNumber(num_of_requested_vectors)) { + ogs_error("OpenAPI_hss_authentication_info_request_parseFromJSON() failed [num_of_requested_vectors]"); + goto end; + } + + cJSON *serving_network_id = cJSON_GetObjectItemCaseSensitive(hss_authentication_info_requestJSON, "servingNetworkId"); + + OpenAPI_plmn_id_t *serving_network_id_local_nonprim = NULL; + if (serving_network_id) { + serving_network_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(serving_network_id); + } + + cJSON *resynchronization_info = cJSON_GetObjectItemCaseSensitive(hss_authentication_info_requestJSON, "resynchronizationInfo"); + + OpenAPI_resynchronization_info_t *resynchronization_info_local_nonprim = NULL; + if (resynchronization_info) { + resynchronization_info_local_nonprim = OpenAPI_resynchronization_info_parseFromJSON(resynchronization_info); + } + + hss_authentication_info_request_local_var = OpenAPI_hss_authentication_info_request_create ( + supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + hss_auth_type_local_nonprim, + num_of_requested_vectors->valuedouble, + serving_network_id ? serving_network_id_local_nonprim : NULL, + resynchronization_info ? resynchronization_info_local_nonprim : NULL + ); + + return hss_authentication_info_request_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/hss_authentication_info_request.h b/lib/sbi/openapi/model/hss_authentication_info_request.h new file mode 100644 index 0000000000..f62492efb3 --- /dev/null +++ b/lib/sbi/openapi/model/hss_authentication_info_request.h @@ -0,0 +1,48 @@ +/* + * hss_authentication_info_request.h + * + * + */ + +#ifndef _OpenAPI_hss_authentication_info_request_H_ +#define _OpenAPI_hss_authentication_info_request_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "hss_auth_type.h" +#include "plmn_id.h" +#include "resynchronization_info.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_hss_authentication_info_request_s OpenAPI_hss_authentication_info_request_t; +typedef struct OpenAPI_hss_authentication_info_request_s { + char *supported_features; + struct OpenAPI_hss_auth_type_s *hss_auth_type; + int num_of_requested_vectors; + struct OpenAPI_plmn_id_s *serving_network_id; + struct OpenAPI_resynchronization_info_s *resynchronization_info; +} OpenAPI_hss_authentication_info_request_t; + +OpenAPI_hss_authentication_info_request_t *OpenAPI_hss_authentication_info_request_create( + char *supported_features, + OpenAPI_hss_auth_type_t *hss_auth_type, + int num_of_requested_vectors, + OpenAPI_plmn_id_t *serving_network_id, + OpenAPI_resynchronization_info_t *resynchronization_info + ); +void OpenAPI_hss_authentication_info_request_free(OpenAPI_hss_authentication_info_request_t *hss_authentication_info_request); +OpenAPI_hss_authentication_info_request_t *OpenAPI_hss_authentication_info_request_parseFromJSON(cJSON *hss_authentication_info_requestJSON); +cJSON *OpenAPI_hss_authentication_info_request_convertToJSON(OpenAPI_hss_authentication_info_request_t *hss_authentication_info_request); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_hss_authentication_info_request_H_ */ + diff --git a/lib/sbi/openapi/model/hss_authentication_info_result.c b/lib/sbi/openapi/model/hss_authentication_info_result.c new file mode 100644 index 0000000000..92dfe4bc12 --- /dev/null +++ b/lib/sbi/openapi/model/hss_authentication_info_result.c @@ -0,0 +1,100 @@ + +#include +#include +#include +#include "hss_authentication_info_result.h" + +OpenAPI_hss_authentication_info_result_t *OpenAPI_hss_authentication_info_result_create( + char *supported_features, + OpenAPI_hss_authentication_vectors_t *hss_authentication_vectors + ) +{ + OpenAPI_hss_authentication_info_result_t *hss_authentication_info_result_local_var = OpenAPI_malloc(sizeof(OpenAPI_hss_authentication_info_result_t)); + if (!hss_authentication_info_result_local_var) { + return NULL; + } + hss_authentication_info_result_local_var->supported_features = supported_features; + hss_authentication_info_result_local_var->hss_authentication_vectors = hss_authentication_vectors; + + return hss_authentication_info_result_local_var; +} + +void OpenAPI_hss_authentication_info_result_free(OpenAPI_hss_authentication_info_result_t *hss_authentication_info_result) +{ + if (NULL == hss_authentication_info_result) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(hss_authentication_info_result->supported_features); + OpenAPI_hss_authentication_vectors_free(hss_authentication_info_result->hss_authentication_vectors); + ogs_free(hss_authentication_info_result); +} + +cJSON *OpenAPI_hss_authentication_info_result_convertToJSON(OpenAPI_hss_authentication_info_result_t *hss_authentication_info_result) +{ + cJSON *item = NULL; + + if (hss_authentication_info_result == NULL) { + ogs_error("OpenAPI_hss_authentication_info_result_convertToJSON() failed [HssAuthenticationInfoResult]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (hss_authentication_info_result->supported_features) { + if (cJSON_AddStringToObject(item, "supportedFeatures", hss_authentication_info_result->supported_features) == NULL) { + ogs_error("OpenAPI_hss_authentication_info_result_convertToJSON() failed [supported_features]"); + goto end; + } + } + + if (!hss_authentication_info_result->hss_authentication_vectors) { + ogs_error("OpenAPI_hss_authentication_info_result_convertToJSON() failed [hss_authentication_vectors]"); + goto end; + } + cJSON *hss_authentication_vectors_local_JSON = OpenAPI_hss_authentication_vectors_convertToJSON(hss_authentication_info_result->hss_authentication_vectors); + if (hss_authentication_vectors_local_JSON == NULL) { + ogs_error("OpenAPI_hss_authentication_info_result_convertToJSON() failed [hss_authentication_vectors]"); + goto end; + } + cJSON_AddItemToObject(item, "hssAuthenticationVectors", hss_authentication_vectors_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_hss_authentication_info_result_convertToJSON() failed [hss_authentication_vectors]"); + goto end; + } + +end: + return item; +} + +OpenAPI_hss_authentication_info_result_t *OpenAPI_hss_authentication_info_result_parseFromJSON(cJSON *hss_authentication_info_resultJSON) +{ + OpenAPI_hss_authentication_info_result_t *hss_authentication_info_result_local_var = NULL; + cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(hss_authentication_info_resultJSON, "supportedFeatures"); + + if (supported_features) { + if (!cJSON_IsString(supported_features)) { + ogs_error("OpenAPI_hss_authentication_info_result_parseFromJSON() failed [supported_features]"); + goto end; + } + } + + cJSON *hss_authentication_vectors = cJSON_GetObjectItemCaseSensitive(hss_authentication_info_resultJSON, "hssAuthenticationVectors"); + if (!hss_authentication_vectors) { + ogs_error("OpenAPI_hss_authentication_info_result_parseFromJSON() failed [hss_authentication_vectors]"); + goto end; + } + + OpenAPI_hss_authentication_vectors_t *hss_authentication_vectors_local_nonprim = NULL; + + hss_authentication_vectors_local_nonprim = OpenAPI_hss_authentication_vectors_parseFromJSON(hss_authentication_vectors); + + hss_authentication_info_result_local_var = OpenAPI_hss_authentication_info_result_create ( + supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + hss_authentication_vectors_local_nonprim + ); + + return hss_authentication_info_result_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/hss_authentication_info_result.h b/lib/sbi/openapi/model/hss_authentication_info_result.h new file mode 100644 index 0000000000..9e25a3d7d6 --- /dev/null +++ b/lib/sbi/openapi/model/hss_authentication_info_result.h @@ -0,0 +1,40 @@ +/* + * hss_authentication_info_result.h + * + * + */ + +#ifndef _OpenAPI_hss_authentication_info_result_H_ +#define _OpenAPI_hss_authentication_info_result_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "hss_authentication_vectors.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_hss_authentication_info_result_s OpenAPI_hss_authentication_info_result_t; +typedef struct OpenAPI_hss_authentication_info_result_s { + char *supported_features; + struct OpenAPI_hss_authentication_vectors_s *hss_authentication_vectors; +} OpenAPI_hss_authentication_info_result_t; + +OpenAPI_hss_authentication_info_result_t *OpenAPI_hss_authentication_info_result_create( + char *supported_features, + OpenAPI_hss_authentication_vectors_t *hss_authentication_vectors + ); +void OpenAPI_hss_authentication_info_result_free(OpenAPI_hss_authentication_info_result_t *hss_authentication_info_result); +OpenAPI_hss_authentication_info_result_t *OpenAPI_hss_authentication_info_result_parseFromJSON(cJSON *hss_authentication_info_resultJSON); +cJSON *OpenAPI_hss_authentication_info_result_convertToJSON(OpenAPI_hss_authentication_info_result_t *hss_authentication_info_result); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_hss_authentication_info_result_H_ */ + diff --git a/lib/sbi/openapi/model/hss_authentication_vectors.c b/lib/sbi/openapi/model/hss_authentication_vectors.c new file mode 100644 index 0000000000..b491e29191 --- /dev/null +++ b/lib/sbi/openapi/model/hss_authentication_vectors.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "hss_authentication_vectors.h" + +OpenAPI_hss_authentication_vectors_t *OpenAPI_hss_authentication_vectors_create( + ) +{ + OpenAPI_hss_authentication_vectors_t *hss_authentication_vectors_local_var = OpenAPI_malloc(sizeof(OpenAPI_hss_authentication_vectors_t)); + if (!hss_authentication_vectors_local_var) { + return NULL; + } + + return hss_authentication_vectors_local_var; +} + +void OpenAPI_hss_authentication_vectors_free(OpenAPI_hss_authentication_vectors_t *hss_authentication_vectors) +{ + if (NULL == hss_authentication_vectors) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(hss_authentication_vectors); +} + +cJSON *OpenAPI_hss_authentication_vectors_convertToJSON(OpenAPI_hss_authentication_vectors_t *hss_authentication_vectors) +{ + cJSON *item = NULL; + + if (hss_authentication_vectors == NULL) { + ogs_error("OpenAPI_hss_authentication_vectors_convertToJSON() failed [HssAuthenticationVectors]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_hss_authentication_vectors_t *OpenAPI_hss_authentication_vectors_parseFromJSON(cJSON *hss_authentication_vectorsJSON) +{ + OpenAPI_hss_authentication_vectors_t *hss_authentication_vectors_local_var = NULL; + hss_authentication_vectors_local_var = OpenAPI_hss_authentication_vectors_create ( + ); + + return hss_authentication_vectors_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/hss_authentication_vectors.h b/lib/sbi/openapi/model/hss_authentication_vectors.h new file mode 100644 index 0000000000..d28a357e76 --- /dev/null +++ b/lib/sbi/openapi/model/hss_authentication_vectors.h @@ -0,0 +1,35 @@ +/* + * hss_authentication_vectors.h + * + * + */ + +#ifndef _OpenAPI_hss_authentication_vectors_H_ +#define _OpenAPI_hss_authentication_vectors_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_hss_authentication_vectors_s OpenAPI_hss_authentication_vectors_t; +typedef struct OpenAPI_hss_authentication_vectors_s { +} OpenAPI_hss_authentication_vectors_t; + +OpenAPI_hss_authentication_vectors_t *OpenAPI_hss_authentication_vectors_create( + ); +void OpenAPI_hss_authentication_vectors_free(OpenAPI_hss_authentication_vectors_t *hss_authentication_vectors); +OpenAPI_hss_authentication_vectors_t *OpenAPI_hss_authentication_vectors_parseFromJSON(cJSON *hss_authentication_vectorsJSON); +cJSON *OpenAPI_hss_authentication_vectors_convertToJSON(OpenAPI_hss_authentication_vectors_t *hss_authentication_vectors); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_hss_authentication_vectors_H_ */ + diff --git a/lib/sbi/openapi/model/hss_av_type.c b/lib/sbi/openapi/model/hss_av_type.c new file mode 100644 index 0000000000..a57f7d93a3 --- /dev/null +++ b/lib/sbi/openapi/model/hss_av_type.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "hss_av_type.h" + +OpenAPI_hss_av_type_t *OpenAPI_hss_av_type_create( + ) +{ + OpenAPI_hss_av_type_t *hss_av_type_local_var = OpenAPI_malloc(sizeof(OpenAPI_hss_av_type_t)); + if (!hss_av_type_local_var) { + return NULL; + } + + return hss_av_type_local_var; +} + +void OpenAPI_hss_av_type_free(OpenAPI_hss_av_type_t *hss_av_type) +{ + if (NULL == hss_av_type) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(hss_av_type); +} + +cJSON *OpenAPI_hss_av_type_convertToJSON(OpenAPI_hss_av_type_t *hss_av_type) +{ + cJSON *item = NULL; + + if (hss_av_type == NULL) { + ogs_error("OpenAPI_hss_av_type_convertToJSON() failed [HssAvType]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_hss_av_type_t *OpenAPI_hss_av_type_parseFromJSON(cJSON *hss_av_typeJSON) +{ + OpenAPI_hss_av_type_t *hss_av_type_local_var = NULL; + hss_av_type_local_var = OpenAPI_hss_av_type_create ( + ); + + return hss_av_type_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/hss_av_type.h b/lib/sbi/openapi/model/hss_av_type.h new file mode 100644 index 0000000000..ebd17eca3e --- /dev/null +++ b/lib/sbi/openapi/model/hss_av_type.h @@ -0,0 +1,35 @@ +/* + * hss_av_type.h + * + * + */ + +#ifndef _OpenAPI_hss_av_type_H_ +#define _OpenAPI_hss_av_type_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_hss_av_type_s OpenAPI_hss_av_type_t; +typedef struct OpenAPI_hss_av_type_s { +} OpenAPI_hss_av_type_t; + +OpenAPI_hss_av_type_t *OpenAPI_hss_av_type_create( + ); +void OpenAPI_hss_av_type_free(OpenAPI_hss_av_type_t *hss_av_type); +OpenAPI_hss_av_type_t *OpenAPI_hss_av_type_parseFromJSON(cJSON *hss_av_typeJSON); +cJSON *OpenAPI_hss_av_type_convertToJSON(OpenAPI_hss_av_type_t *hss_av_type); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_hss_av_type_H_ */ + diff --git a/lib/sbi/openapi/model/hss_info.c b/lib/sbi/openapi/model/hss_info.c new file mode 100644 index 0000000000..3aa52a50b0 --- /dev/null +++ b/lib/sbi/openapi/model/hss_info.c @@ -0,0 +1,121 @@ + +#include +#include +#include +#include "hss_info.h" + +OpenAPI_hss_info_t *OpenAPI_hss_info_create( + char *group_id, + OpenAPI_list_t *ims_ranges + ) +{ + OpenAPI_hss_info_t *hss_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_hss_info_t)); + if (!hss_info_local_var) { + return NULL; + } + hss_info_local_var->group_id = group_id; + hss_info_local_var->ims_ranges = ims_ranges; + + return hss_info_local_var; +} + +void OpenAPI_hss_info_free(OpenAPI_hss_info_t *hss_info) +{ + if (NULL == hss_info) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(hss_info->group_id); + OpenAPI_list_for_each(hss_info->ims_ranges, node) { + OpenAPI_imsi_range_free(node->data); + } + OpenAPI_list_free(hss_info->ims_ranges); + ogs_free(hss_info); +} + +cJSON *OpenAPI_hss_info_convertToJSON(OpenAPI_hss_info_t *hss_info) +{ + cJSON *item = NULL; + + if (hss_info == NULL) { + ogs_error("OpenAPI_hss_info_convertToJSON() failed [HssInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (hss_info->group_id) { + if (cJSON_AddStringToObject(item, "groupId", hss_info->group_id) == NULL) { + ogs_error("OpenAPI_hss_info_convertToJSON() failed [group_id]"); + goto end; + } + } + + if (hss_info->ims_ranges) { + cJSON *ims_rangesList = cJSON_AddArrayToObject(item, "imsRanges"); + if (ims_rangesList == NULL) { + ogs_error("OpenAPI_hss_info_convertToJSON() failed [ims_ranges]"); + goto end; + } + + OpenAPI_lnode_t *ims_ranges_node; + if (hss_info->ims_ranges) { + OpenAPI_list_for_each(hss_info->ims_ranges, ims_ranges_node) { + cJSON *itemLocal = OpenAPI_imsi_range_convertToJSON(ims_ranges_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_hss_info_convertToJSON() failed [ims_ranges]"); + goto end; + } + cJSON_AddItemToArray(ims_rangesList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_hss_info_t *OpenAPI_hss_info_parseFromJSON(cJSON *hss_infoJSON) +{ + OpenAPI_hss_info_t *hss_info_local_var = NULL; + cJSON *group_id = cJSON_GetObjectItemCaseSensitive(hss_infoJSON, "groupId"); + + if (group_id) { + if (!cJSON_IsString(group_id)) { + ogs_error("OpenAPI_hss_info_parseFromJSON() failed [group_id]"); + goto end; + } + } + + cJSON *ims_ranges = cJSON_GetObjectItemCaseSensitive(hss_infoJSON, "imsRanges"); + + OpenAPI_list_t *ims_rangesList; + if (ims_ranges) { + cJSON *ims_ranges_local_nonprimitive; + if (!cJSON_IsArray(ims_ranges)) { + ogs_error("OpenAPI_hss_info_parseFromJSON() failed [ims_ranges]"); + goto end; + } + + ims_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ims_ranges_local_nonprimitive, ims_ranges ) { + if (!cJSON_IsObject(ims_ranges_local_nonprimitive)) { + ogs_error("OpenAPI_hss_info_parseFromJSON() failed [ims_ranges]"); + goto end; + } + OpenAPI_imsi_range_t *ims_rangesItem = OpenAPI_imsi_range_parseFromJSON(ims_ranges_local_nonprimitive); + + OpenAPI_list_add(ims_rangesList, ims_rangesItem); + } + } + + hss_info_local_var = OpenAPI_hss_info_create ( + group_id ? ogs_strdup(group_id->valuestring) : NULL, + ims_ranges ? ims_rangesList : NULL + ); + + return hss_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/hss_info.h b/lib/sbi/openapi/model/hss_info.h new file mode 100644 index 0000000000..3160ef7418 --- /dev/null +++ b/lib/sbi/openapi/model/hss_info.h @@ -0,0 +1,40 @@ +/* + * hss_info.h + * + * Information of an HSS NF Instance + */ + +#ifndef _OpenAPI_hss_info_H_ +#define _OpenAPI_hss_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "imsi_range.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_hss_info_s OpenAPI_hss_info_t; +typedef struct OpenAPI_hss_info_s { + char *group_id; + OpenAPI_list_t *ims_ranges; +} OpenAPI_hss_info_t; + +OpenAPI_hss_info_t *OpenAPI_hss_info_create( + char *group_id, + OpenAPI_list_t *ims_ranges + ); +void OpenAPI_hss_info_free(OpenAPI_hss_info_t *hss_info); +OpenAPI_hss_info_t *OpenAPI_hss_info_parseFromJSON(cJSON *hss_infoJSON); +cJSON *OpenAPI_hss_info_convertToJSON(OpenAPI_hss_info_t *hss_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_hss_info_H_ */ + diff --git a/lib/sbi/openapi/model/id_translation_result.c b/lib/sbi/openapi/model/id_translation_result.c new file mode 100644 index 0000000000..eade38c08d --- /dev/null +++ b/lib/sbi/openapi/model/id_translation_result.c @@ -0,0 +1,116 @@ + +#include +#include +#include +#include "id_translation_result.h" + +OpenAPI_id_translation_result_t *OpenAPI_id_translation_result_create( + char *supported_features, + char *supi, + char *gpsi + ) +{ + OpenAPI_id_translation_result_t *id_translation_result_local_var = OpenAPI_malloc(sizeof(OpenAPI_id_translation_result_t)); + if (!id_translation_result_local_var) { + return NULL; + } + id_translation_result_local_var->supported_features = supported_features; + id_translation_result_local_var->supi = supi; + id_translation_result_local_var->gpsi = gpsi; + + return id_translation_result_local_var; +} + +void OpenAPI_id_translation_result_free(OpenAPI_id_translation_result_t *id_translation_result) +{ + if (NULL == id_translation_result) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(id_translation_result->supported_features); + ogs_free(id_translation_result->supi); + ogs_free(id_translation_result->gpsi); + ogs_free(id_translation_result); +} + +cJSON *OpenAPI_id_translation_result_convertToJSON(OpenAPI_id_translation_result_t *id_translation_result) +{ + cJSON *item = NULL; + + if (id_translation_result == NULL) { + ogs_error("OpenAPI_id_translation_result_convertToJSON() failed [IdTranslationResult]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (id_translation_result->supported_features) { + if (cJSON_AddStringToObject(item, "supportedFeatures", id_translation_result->supported_features) == NULL) { + ogs_error("OpenAPI_id_translation_result_convertToJSON() failed [supported_features]"); + goto end; + } + } + + if (!id_translation_result->supi) { + ogs_error("OpenAPI_id_translation_result_convertToJSON() failed [supi]"); + goto end; + } + if (cJSON_AddStringToObject(item, "supi", id_translation_result->supi) == NULL) { + ogs_error("OpenAPI_id_translation_result_convertToJSON() failed [supi]"); + goto end; + } + + if (id_translation_result->gpsi) { + if (cJSON_AddStringToObject(item, "gpsi", id_translation_result->gpsi) == NULL) { + ogs_error("OpenAPI_id_translation_result_convertToJSON() failed [gpsi]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_id_translation_result_t *OpenAPI_id_translation_result_parseFromJSON(cJSON *id_translation_resultJSON) +{ + OpenAPI_id_translation_result_t *id_translation_result_local_var = NULL; + cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(id_translation_resultJSON, "supportedFeatures"); + + if (supported_features) { + if (!cJSON_IsString(supported_features)) { + ogs_error("OpenAPI_id_translation_result_parseFromJSON() failed [supported_features]"); + goto end; + } + } + + cJSON *supi = cJSON_GetObjectItemCaseSensitive(id_translation_resultJSON, "supi"); + if (!supi) { + ogs_error("OpenAPI_id_translation_result_parseFromJSON() failed [supi]"); + goto end; + } + + + if (!cJSON_IsString(supi)) { + ogs_error("OpenAPI_id_translation_result_parseFromJSON() failed [supi]"); + goto end; + } + + cJSON *gpsi = cJSON_GetObjectItemCaseSensitive(id_translation_resultJSON, "gpsi"); + + if (gpsi) { + if (!cJSON_IsString(gpsi)) { + ogs_error("OpenAPI_id_translation_result_parseFromJSON() failed [gpsi]"); + goto end; + } + } + + id_translation_result_local_var = OpenAPI_id_translation_result_create ( + supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + ogs_strdup(supi->valuestring), + gpsi ? ogs_strdup(gpsi->valuestring) : NULL + ); + + return id_translation_result_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/id_translation_result.h b/lib/sbi/openapi/model/id_translation_result.h new file mode 100644 index 0000000000..96312164e2 --- /dev/null +++ b/lib/sbi/openapi/model/id_translation_result.h @@ -0,0 +1,41 @@ +/* + * id_translation_result.h + * + * + */ + +#ifndef _OpenAPI_id_translation_result_H_ +#define _OpenAPI_id_translation_result_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_id_translation_result_s OpenAPI_id_translation_result_t; +typedef struct OpenAPI_id_translation_result_s { + char *supported_features; + char *supi; + char *gpsi; +} OpenAPI_id_translation_result_t; + +OpenAPI_id_translation_result_t *OpenAPI_id_translation_result_create( + char *supported_features, + char *supi, + char *gpsi + ); +void OpenAPI_id_translation_result_free(OpenAPI_id_translation_result_t *id_translation_result); +OpenAPI_id_translation_result_t *OpenAPI_id_translation_result_parseFromJSON(cJSON *id_translation_resultJSON); +cJSON *OpenAPI_id_translation_result_convertToJSON(OpenAPI_id_translation_result_t *id_translation_result); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_id_translation_result_H_ */ + diff --git a/lib/sbi/openapi/model/identity_data.c b/lib/sbi/openapi/model/identity_data.c new file mode 100644 index 0000000000..d31f13248c --- /dev/null +++ b/lib/sbi/openapi/model/identity_data.c @@ -0,0 +1,137 @@ + +#include +#include +#include +#include "identity_data.h" + +OpenAPI_identity_data_t *OpenAPI_identity_data_create( + OpenAPI_list_t *supi_list, + OpenAPI_list_t *gpsi_list + ) +{ + OpenAPI_identity_data_t *identity_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_identity_data_t)); + if (!identity_data_local_var) { + return NULL; + } + identity_data_local_var->supi_list = supi_list; + identity_data_local_var->gpsi_list = gpsi_list; + + return identity_data_local_var; +} + +void OpenAPI_identity_data_free(OpenAPI_identity_data_t *identity_data) +{ + if (NULL == identity_data) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(identity_data->supi_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(identity_data->supi_list); + OpenAPI_list_for_each(identity_data->gpsi_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(identity_data->gpsi_list); + ogs_free(identity_data); +} + +cJSON *OpenAPI_identity_data_convertToJSON(OpenAPI_identity_data_t *identity_data) +{ + cJSON *item = NULL; + + if (identity_data == NULL) { + ogs_error("OpenAPI_identity_data_convertToJSON() failed [IdentityData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (identity_data->supi_list) { + cJSON *supi_list = cJSON_AddArrayToObject(item, "supiList"); + if (supi_list == NULL) { + ogs_error("OpenAPI_identity_data_convertToJSON() failed [supi_list]"); + goto end; + } + + OpenAPI_lnode_t *supi_list_node; + OpenAPI_list_for_each(identity_data->supi_list, supi_list_node) { + if (cJSON_AddStringToObject(supi_list, "", (char*)supi_list_node->data) == NULL) { + ogs_error("OpenAPI_identity_data_convertToJSON() failed [supi_list]"); + goto end; + } + } + } + + if (identity_data->gpsi_list) { + cJSON *gpsi_list = cJSON_AddArrayToObject(item, "gpsiList"); + if (gpsi_list == NULL) { + ogs_error("OpenAPI_identity_data_convertToJSON() failed [gpsi_list]"); + goto end; + } + + OpenAPI_lnode_t *gpsi_list_node; + OpenAPI_list_for_each(identity_data->gpsi_list, gpsi_list_node) { + if (cJSON_AddStringToObject(gpsi_list, "", (char*)gpsi_list_node->data) == NULL) { + ogs_error("OpenAPI_identity_data_convertToJSON() failed [gpsi_list]"); + goto end; + } + } + } + +end: + return item; +} + +OpenAPI_identity_data_t *OpenAPI_identity_data_parseFromJSON(cJSON *identity_dataJSON) +{ + OpenAPI_identity_data_t *identity_data_local_var = NULL; + cJSON *supi_list = cJSON_GetObjectItemCaseSensitive(identity_dataJSON, "supiList"); + + OpenAPI_list_t *supi_listList; + if (supi_list) { + cJSON *supi_list_local; + if (!cJSON_IsArray(supi_list)) { + ogs_error("OpenAPI_identity_data_parseFromJSON() failed [supi_list]"); + goto end; + } + supi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(supi_list_local, supi_list) { + if (!cJSON_IsString(supi_list_local)) { + ogs_error("OpenAPI_identity_data_parseFromJSON() failed [supi_list]"); + goto end; + } + OpenAPI_list_add(supi_listList, ogs_strdup(supi_list_local->valuestring)); + } + } + + cJSON *gpsi_list = cJSON_GetObjectItemCaseSensitive(identity_dataJSON, "gpsiList"); + + OpenAPI_list_t *gpsi_listList; + if (gpsi_list) { + cJSON *gpsi_list_local; + if (!cJSON_IsArray(gpsi_list)) { + ogs_error("OpenAPI_identity_data_parseFromJSON() failed [gpsi_list]"); + goto end; + } + gpsi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(gpsi_list_local, gpsi_list) { + if (!cJSON_IsString(gpsi_list_local)) { + ogs_error("OpenAPI_identity_data_parseFromJSON() failed [gpsi_list]"); + goto end; + } + OpenAPI_list_add(gpsi_listList, ogs_strdup(gpsi_list_local->valuestring)); + } + } + + identity_data_local_var = OpenAPI_identity_data_create ( + supi_list ? supi_listList : NULL, + gpsi_list ? gpsi_listList : NULL + ); + + return identity_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/identity_data.h b/lib/sbi/openapi/model/identity_data.h new file mode 100644 index 0000000000..270c4a7360 --- /dev/null +++ b/lib/sbi/openapi/model/identity_data.h @@ -0,0 +1,39 @@ +/* + * identity_data.h + * + * + */ + +#ifndef _OpenAPI_identity_data_H_ +#define _OpenAPI_identity_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_identity_data_s OpenAPI_identity_data_t; +typedef struct OpenAPI_identity_data_s { + OpenAPI_list_t *supi_list; + OpenAPI_list_t *gpsi_list; +} OpenAPI_identity_data_t; + +OpenAPI_identity_data_t *OpenAPI_identity_data_create( + OpenAPI_list_t *supi_list, + OpenAPI_list_t *gpsi_list + ); +void OpenAPI_identity_data_free(OpenAPI_identity_data_t *identity_data); +OpenAPI_identity_data_t *OpenAPI_identity_data_parseFromJSON(cJSON *identity_dataJSON); +cJSON *OpenAPI_identity_data_convertToJSON(OpenAPI_identity_data_t *identity_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_identity_data_H_ */ + diff --git a/lib/sbi/openapi/model/identity_range.h b/lib/sbi/openapi/model/identity_range.h index 07e445a9e1..69585da599 100644 --- a/lib/sbi/openapi/model/identity_range.h +++ b/lib/sbi/openapi/model/identity_range.h @@ -1,7 +1,7 @@ /* * identity_range.h * - * + * A range of GPSIs (subscriber identities), either based on a numeric range, or based on regular-expression matching */ #ifndef _OpenAPI_identity_range_H_ diff --git a/lib/sbi/openapi/model/ims_vo_ps.c b/lib/sbi/openapi/model/ims_vo_ps.c new file mode 100644 index 0000000000..6ae635158e --- /dev/null +++ b/lib/sbi/openapi/model/ims_vo_ps.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "ims_vo_ps.h" + +OpenAPI_ims_vo_ps_t *OpenAPI_ims_vo_ps_create( + ) +{ + OpenAPI_ims_vo_ps_t *ims_vo_ps_local_var = OpenAPI_malloc(sizeof(OpenAPI_ims_vo_ps_t)); + if (!ims_vo_ps_local_var) { + return NULL; + } + + return ims_vo_ps_local_var; +} + +void OpenAPI_ims_vo_ps_free(OpenAPI_ims_vo_ps_t *ims_vo_ps) +{ + if (NULL == ims_vo_ps) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(ims_vo_ps); +} + +cJSON *OpenAPI_ims_vo_ps_convertToJSON(OpenAPI_ims_vo_ps_t *ims_vo_ps) +{ + cJSON *item = NULL; + + if (ims_vo_ps == NULL) { + ogs_error("OpenAPI_ims_vo_ps_convertToJSON() failed [ImsVoPs]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_ims_vo_ps_t *OpenAPI_ims_vo_ps_parseFromJSON(cJSON *ims_vo_psJSON) +{ + OpenAPI_ims_vo_ps_t *ims_vo_ps_local_var = NULL; + ims_vo_ps_local_var = OpenAPI_ims_vo_ps_create ( + ); + + return ims_vo_ps_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/ims_vo_ps.h b/lib/sbi/openapi/model/ims_vo_ps.h new file mode 100644 index 0000000000..857fb61bb1 --- /dev/null +++ b/lib/sbi/openapi/model/ims_vo_ps.h @@ -0,0 +1,35 @@ +/* + * ims_vo_ps.h + * + * + */ + +#ifndef _OpenAPI_ims_vo_ps_H_ +#define _OpenAPI_ims_vo_ps_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_ims_vo_ps_s OpenAPI_ims_vo_ps_t; +typedef struct OpenAPI_ims_vo_ps_s { +} OpenAPI_ims_vo_ps_t; + +OpenAPI_ims_vo_ps_t *OpenAPI_ims_vo_ps_create( + ); +void OpenAPI_ims_vo_ps_free(OpenAPI_ims_vo_ps_t *ims_vo_ps); +OpenAPI_ims_vo_ps_t *OpenAPI_ims_vo_ps_parseFromJSON(cJSON *ims_vo_psJSON); +cJSON *OpenAPI_ims_vo_ps_convertToJSON(OpenAPI_ims_vo_ps_t *ims_vo_ps); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_ims_vo_ps_H_ */ + diff --git a/lib/sbi/openapi/model/imsi_range.c b/lib/sbi/openapi/model/imsi_range.c new file mode 100644 index 0000000000..630a3c67f1 --- /dev/null +++ b/lib/sbi/openapi/model/imsi_range.c @@ -0,0 +1,111 @@ + +#include +#include +#include +#include "imsi_range.h" + +OpenAPI_imsi_range_t *OpenAPI_imsi_range_create( + char *start, + char *end, + char *pattern + ) +{ + OpenAPI_imsi_range_t *imsi_range_local_var = OpenAPI_malloc(sizeof(OpenAPI_imsi_range_t)); + if (!imsi_range_local_var) { + return NULL; + } + imsi_range_local_var->start = start; + imsi_range_local_var->end = end; + imsi_range_local_var->pattern = pattern; + + return imsi_range_local_var; +} + +void OpenAPI_imsi_range_free(OpenAPI_imsi_range_t *imsi_range) +{ + if (NULL == imsi_range) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(imsi_range->start); + ogs_free(imsi_range->end); + ogs_free(imsi_range->pattern); + ogs_free(imsi_range); +} + +cJSON *OpenAPI_imsi_range_convertToJSON(OpenAPI_imsi_range_t *imsi_range) +{ + cJSON *item = NULL; + + if (imsi_range == NULL) { + ogs_error("OpenAPI_imsi_range_convertToJSON() failed [ImsiRange]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (imsi_range->start) { + if (cJSON_AddStringToObject(item, "start", imsi_range->start) == NULL) { + ogs_error("OpenAPI_imsi_range_convertToJSON() failed [start]"); + goto end; + } + } + + if (imsi_range->end) { + if (cJSON_AddStringToObject(item, "end", imsi_range->end) == NULL) { + ogs_error("OpenAPI_imsi_range_convertToJSON() failed [end]"); + goto end; + } + } + + if (imsi_range->pattern) { + if (cJSON_AddStringToObject(item, "pattern", imsi_range->pattern) == NULL) { + ogs_error("OpenAPI_imsi_range_convertToJSON() failed [pattern]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_imsi_range_t *OpenAPI_imsi_range_parseFromJSON(cJSON *imsi_rangeJSON) +{ + OpenAPI_imsi_range_t *imsi_range_local_var = NULL; + cJSON *start = cJSON_GetObjectItemCaseSensitive(imsi_rangeJSON, "start"); + + if (start) { + if (!cJSON_IsString(start)) { + ogs_error("OpenAPI_imsi_range_parseFromJSON() failed [start]"); + goto end; + } + } + + cJSON *end = cJSON_GetObjectItemCaseSensitive(imsi_rangeJSON, "end"); + + if (end) { + if (!cJSON_IsString(end)) { + ogs_error("OpenAPI_imsi_range_parseFromJSON() failed [end]"); + goto end; + } + } + + cJSON *pattern = cJSON_GetObjectItemCaseSensitive(imsi_rangeJSON, "pattern"); + + if (pattern) { + if (!cJSON_IsString(pattern)) { + ogs_error("OpenAPI_imsi_range_parseFromJSON() failed [pattern]"); + goto end; + } + } + + imsi_range_local_var = OpenAPI_imsi_range_create ( + start ? ogs_strdup(start->valuestring) : NULL, + end ? ogs_strdup(end->valuestring) : NULL, + pattern ? ogs_strdup(pattern->valuestring) : NULL + ); + + return imsi_range_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/imsi_range.h b/lib/sbi/openapi/model/imsi_range.h new file mode 100644 index 0000000000..5046441411 --- /dev/null +++ b/lib/sbi/openapi/model/imsi_range.h @@ -0,0 +1,41 @@ +/* + * imsi_range.h + * + * A range of IMSIs (subscriber identities), either based on a numeric range, or based on regular-expression matching + */ + +#ifndef _OpenAPI_imsi_range_H_ +#define _OpenAPI_imsi_range_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_imsi_range_s OpenAPI_imsi_range_t; +typedef struct OpenAPI_imsi_range_s { + char *start; + char *end; + char *pattern; +} OpenAPI_imsi_range_t; + +OpenAPI_imsi_range_t *OpenAPI_imsi_range_create( + char *start, + char *end, + char *pattern + ); +void OpenAPI_imsi_range_free(OpenAPI_imsi_range_t *imsi_range); +OpenAPI_imsi_range_t *OpenAPI_imsi_range_parseFromJSON(cJSON *imsi_rangeJSON); +cJSON *OpenAPI_imsi_range_convertToJSON(OpenAPI_imsi_range_t *imsi_range); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_imsi_range_H_ */ + diff --git a/lib/sbi/openapi/model/interface_upf_info_item.h b/lib/sbi/openapi/model/interface_upf_info_item.h index 0d5d3d72b7..cde685afb3 100644 --- a/lib/sbi/openapi/model/interface_upf_info_item.h +++ b/lib/sbi/openapi/model/interface_upf_info_item.h @@ -1,7 +1,7 @@ /* * interface_upf_info_item.h * - * + * Information of a given IP interface of an UPF */ #ifndef _OpenAPI_interface_upf_info_item_H_ diff --git a/lib/sbi/openapi/model/internal_group_id_range.c b/lib/sbi/openapi/model/internal_group_id_range.c new file mode 100644 index 0000000000..fc342fe477 --- /dev/null +++ b/lib/sbi/openapi/model/internal_group_id_range.c @@ -0,0 +1,111 @@ + +#include +#include +#include +#include "internal_group_id_range.h" + +OpenAPI_internal_group_id_range_t *OpenAPI_internal_group_id_range_create( + char *start, + char *end, + char *pattern + ) +{ + OpenAPI_internal_group_id_range_t *internal_group_id_range_local_var = OpenAPI_malloc(sizeof(OpenAPI_internal_group_id_range_t)); + if (!internal_group_id_range_local_var) { + return NULL; + } + internal_group_id_range_local_var->start = start; + internal_group_id_range_local_var->end = end; + internal_group_id_range_local_var->pattern = pattern; + + return internal_group_id_range_local_var; +} + +void OpenAPI_internal_group_id_range_free(OpenAPI_internal_group_id_range_t *internal_group_id_range) +{ + if (NULL == internal_group_id_range) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(internal_group_id_range->start); + ogs_free(internal_group_id_range->end); + ogs_free(internal_group_id_range->pattern); + ogs_free(internal_group_id_range); +} + +cJSON *OpenAPI_internal_group_id_range_convertToJSON(OpenAPI_internal_group_id_range_t *internal_group_id_range) +{ + cJSON *item = NULL; + + if (internal_group_id_range == NULL) { + ogs_error("OpenAPI_internal_group_id_range_convertToJSON() failed [InternalGroupIdRange]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (internal_group_id_range->start) { + if (cJSON_AddStringToObject(item, "start", internal_group_id_range->start) == NULL) { + ogs_error("OpenAPI_internal_group_id_range_convertToJSON() failed [start]"); + goto end; + } + } + + if (internal_group_id_range->end) { + if (cJSON_AddStringToObject(item, "end", internal_group_id_range->end) == NULL) { + ogs_error("OpenAPI_internal_group_id_range_convertToJSON() failed [end]"); + goto end; + } + } + + if (internal_group_id_range->pattern) { + if (cJSON_AddStringToObject(item, "pattern", internal_group_id_range->pattern) == NULL) { + ogs_error("OpenAPI_internal_group_id_range_convertToJSON() failed [pattern]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_internal_group_id_range_t *OpenAPI_internal_group_id_range_parseFromJSON(cJSON *internal_group_id_rangeJSON) +{ + OpenAPI_internal_group_id_range_t *internal_group_id_range_local_var = NULL; + cJSON *start = cJSON_GetObjectItemCaseSensitive(internal_group_id_rangeJSON, "start"); + + if (start) { + if (!cJSON_IsString(start)) { + ogs_error("OpenAPI_internal_group_id_range_parseFromJSON() failed [start]"); + goto end; + } + } + + cJSON *end = cJSON_GetObjectItemCaseSensitive(internal_group_id_rangeJSON, "end"); + + if (end) { + if (!cJSON_IsString(end)) { + ogs_error("OpenAPI_internal_group_id_range_parseFromJSON() failed [end]"); + goto end; + } + } + + cJSON *pattern = cJSON_GetObjectItemCaseSensitive(internal_group_id_rangeJSON, "pattern"); + + if (pattern) { + if (!cJSON_IsString(pattern)) { + ogs_error("OpenAPI_internal_group_id_range_parseFromJSON() failed [pattern]"); + goto end; + } + } + + internal_group_id_range_local_var = OpenAPI_internal_group_id_range_create ( + start ? ogs_strdup(start->valuestring) : NULL, + end ? ogs_strdup(end->valuestring) : NULL, + pattern ? ogs_strdup(pattern->valuestring) : NULL + ); + + return internal_group_id_range_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/internal_group_id_range.h b/lib/sbi/openapi/model/internal_group_id_range.h new file mode 100644 index 0000000000..f4839e6796 --- /dev/null +++ b/lib/sbi/openapi/model/internal_group_id_range.h @@ -0,0 +1,41 @@ +/* + * internal_group_id_range.h + * + * A range of Group IDs (internal group identities), either based on a numeric range, or based on regular-expression matching + */ + +#ifndef _OpenAPI_internal_group_id_range_H_ +#define _OpenAPI_internal_group_id_range_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_internal_group_id_range_s OpenAPI_internal_group_id_range_t; +typedef struct OpenAPI_internal_group_id_range_s { + char *start; + char *end; + char *pattern; +} OpenAPI_internal_group_id_range_t; + +OpenAPI_internal_group_id_range_t *OpenAPI_internal_group_id_range_create( + char *start, + char *end, + char *pattern + ); +void OpenAPI_internal_group_id_range_free(OpenAPI_internal_group_id_range_t *internal_group_id_range); +OpenAPI_internal_group_id_range_t *OpenAPI_internal_group_id_range_parseFromJSON(cJSON *internal_group_id_rangeJSON); +cJSON *OpenAPI_internal_group_id_range_convertToJSON(OpenAPI_internal_group_id_range_t *internal_group_id_range); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_internal_group_id_range_H_ */ + diff --git a/lib/sbi/openapi/model/ip_address.c b/lib/sbi/openapi/model/ip_address.c new file mode 100644 index 0000000000..52843c362f --- /dev/null +++ b/lib/sbi/openapi/model/ip_address.c @@ -0,0 +1,111 @@ + +#include +#include +#include +#include "ip_address.h" + +OpenAPI_ip_address_t *OpenAPI_ip_address_create( + char *ipv4_addr, + char *ipv6_addr, + char *ipv6_prefix + ) +{ + OpenAPI_ip_address_t *ip_address_local_var = OpenAPI_malloc(sizeof(OpenAPI_ip_address_t)); + if (!ip_address_local_var) { + return NULL; + } + ip_address_local_var->ipv4_addr = ipv4_addr; + ip_address_local_var->ipv6_addr = ipv6_addr; + ip_address_local_var->ipv6_prefix = ipv6_prefix; + + return ip_address_local_var; +} + +void OpenAPI_ip_address_free(OpenAPI_ip_address_t *ip_address) +{ + if (NULL == ip_address) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(ip_address->ipv4_addr); + ogs_free(ip_address->ipv6_addr); + ogs_free(ip_address->ipv6_prefix); + ogs_free(ip_address); +} + +cJSON *OpenAPI_ip_address_convertToJSON(OpenAPI_ip_address_t *ip_address) +{ + cJSON *item = NULL; + + if (ip_address == NULL) { + ogs_error("OpenAPI_ip_address_convertToJSON() failed [IpAddress]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (ip_address->ipv4_addr) { + if (cJSON_AddStringToObject(item, "ipv4Addr", ip_address->ipv4_addr) == NULL) { + ogs_error("OpenAPI_ip_address_convertToJSON() failed [ipv4_addr]"); + goto end; + } + } + + if (ip_address->ipv6_addr) { + if (cJSON_AddStringToObject(item, "ipv6Addr", ip_address->ipv6_addr) == NULL) { + ogs_error("OpenAPI_ip_address_convertToJSON() failed [ipv6_addr]"); + goto end; + } + } + + if (ip_address->ipv6_prefix) { + if (cJSON_AddStringToObject(item, "ipv6Prefix", ip_address->ipv6_prefix) == NULL) { + ogs_error("OpenAPI_ip_address_convertToJSON() failed [ipv6_prefix]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_ip_address_t *OpenAPI_ip_address_parseFromJSON(cJSON *ip_addressJSON) +{ + OpenAPI_ip_address_t *ip_address_local_var = NULL; + cJSON *ipv4_addr = cJSON_GetObjectItemCaseSensitive(ip_addressJSON, "ipv4Addr"); + + if (ipv4_addr) { + if (!cJSON_IsString(ipv4_addr)) { + ogs_error("OpenAPI_ip_address_parseFromJSON() failed [ipv4_addr]"); + goto end; + } + } + + cJSON *ipv6_addr = cJSON_GetObjectItemCaseSensitive(ip_addressJSON, "ipv6Addr"); + + if (ipv6_addr) { + if (!cJSON_IsString(ipv6_addr)) { + ogs_error("OpenAPI_ip_address_parseFromJSON() failed [ipv6_addr]"); + goto end; + } + } + + cJSON *ipv6_prefix = cJSON_GetObjectItemCaseSensitive(ip_addressJSON, "ipv6Prefix"); + + if (ipv6_prefix) { + if (!cJSON_IsString(ipv6_prefix)) { + ogs_error("OpenAPI_ip_address_parseFromJSON() failed [ipv6_prefix]"); + goto end; + } + } + + ip_address_local_var = OpenAPI_ip_address_create ( + ipv4_addr ? ogs_strdup(ipv4_addr->valuestring) : NULL, + ipv6_addr ? ogs_strdup(ipv6_addr->valuestring) : NULL, + ipv6_prefix ? ogs_strdup(ipv6_prefix->valuestring) : NULL + ); + + return ip_address_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/ip_address.h b/lib/sbi/openapi/model/ip_address.h new file mode 100644 index 0000000000..510d314bd3 --- /dev/null +++ b/lib/sbi/openapi/model/ip_address.h @@ -0,0 +1,41 @@ +/* + * ip_address.h + * + * + */ + +#ifndef _OpenAPI_ip_address_H_ +#define _OpenAPI_ip_address_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_ip_address_s OpenAPI_ip_address_t; +typedef struct OpenAPI_ip_address_s { + char *ipv4_addr; + char *ipv6_addr; + char *ipv6_prefix; +} OpenAPI_ip_address_t; + +OpenAPI_ip_address_t *OpenAPI_ip_address_create( + char *ipv4_addr, + char *ipv6_addr, + char *ipv6_prefix + ); +void OpenAPI_ip_address_free(OpenAPI_ip_address_t *ip_address); +OpenAPI_ip_address_t *OpenAPI_ip_address_parseFromJSON(cJSON *ip_addressJSON); +cJSON *OpenAPI_ip_address_convertToJSON(OpenAPI_ip_address_t *ip_address); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_ip_address_H_ */ + diff --git a/lib/sbi/openapi/model/ip_end_point.c b/lib/sbi/openapi/model/ip_end_point.c index 1feb470e34..ddb0b12bde 100644 --- a/lib/sbi/openapi/model/ip_end_point.c +++ b/lib/sbi/openapi/model/ip_end_point.c @@ -7,7 +7,7 @@ OpenAPI_ip_end_point_t *OpenAPI_ip_end_point_create( char *ipv4_address, char *ipv6_address, - OpenAPI_transport_protocol_e transport, + OpenAPI_transport_protocol_t *transport, int port ) { @@ -31,6 +31,7 @@ void OpenAPI_ip_end_point_free(OpenAPI_ip_end_point_t *ip_end_point) OpenAPI_lnode_t *node; ogs_free(ip_end_point->ipv4_address); ogs_free(ip_end_point->ipv6_address); + OpenAPI_transport_protocol_free(ip_end_point->transport); ogs_free(ip_end_point); } @@ -59,7 +60,13 @@ cJSON *OpenAPI_ip_end_point_convertToJSON(OpenAPI_ip_end_point_t *ip_end_point) } if (ip_end_point->transport) { - if (cJSON_AddStringToObject(item, "transport", OpenAPI_transport_protocol_ToString(ip_end_point->transport)) == NULL) { + cJSON *transport_local_JSON = OpenAPI_transport_protocol_convertToJSON(ip_end_point->transport); + if (transport_local_JSON == NULL) { + ogs_error("OpenAPI_ip_end_point_convertToJSON() failed [transport]"); + goto end; + } + cJSON_AddItemToObject(item, "transport", transport_local_JSON); + if (item->child == NULL) { ogs_error("OpenAPI_ip_end_point_convertToJSON() failed [transport]"); goto end; } @@ -99,13 +106,9 @@ OpenAPI_ip_end_point_t *OpenAPI_ip_end_point_parseFromJSON(cJSON *ip_end_pointJS cJSON *transport = cJSON_GetObjectItemCaseSensitive(ip_end_pointJSON, "transport"); - OpenAPI_transport_protocol_e transportVariable; + OpenAPI_transport_protocol_t *transport_local_nonprim = NULL; if (transport) { - if (!cJSON_IsString(transport)) { - ogs_error("OpenAPI_ip_end_point_parseFromJSON() failed [transport]"); - goto end; - } - transportVariable = OpenAPI_transport_protocol_FromString(transport->valuestring); + transport_local_nonprim = OpenAPI_transport_protocol_parseFromJSON(transport); } cJSON *port = cJSON_GetObjectItemCaseSensitive(ip_end_pointJSON, "port"); @@ -120,7 +123,7 @@ OpenAPI_ip_end_point_t *OpenAPI_ip_end_point_parseFromJSON(cJSON *ip_end_pointJS ip_end_point_local_var = OpenAPI_ip_end_point_create ( ipv4_address ? ogs_strdup(ipv4_address->valuestring) : NULL, ipv6_address ? ogs_strdup(ipv6_address->valuestring) : NULL, - transport ? transportVariable : 0, + transport ? transport_local_nonprim : NULL, port ? port->valuedouble : 0 ); diff --git a/lib/sbi/openapi/model/ip_end_point.h b/lib/sbi/openapi/model/ip_end_point.h index f6773e65d3..c02681478f 100644 --- a/lib/sbi/openapi/model/ip_end_point.h +++ b/lib/sbi/openapi/model/ip_end_point.h @@ -1,7 +1,7 @@ /* * ip_end_point.h * - * + * IP addressing information of a given NFService; it consists on, e.g. IP address, TCP port, transport protocol... */ #ifndef _OpenAPI_ip_end_point_H_ @@ -22,14 +22,14 @@ typedef struct OpenAPI_ip_end_point_s OpenAPI_ip_end_point_t; typedef struct OpenAPI_ip_end_point_s { char *ipv4_address; char *ipv6_address; - OpenAPI_transport_protocol_e transport; + struct OpenAPI_transport_protocol_s *transport; int port; } OpenAPI_ip_end_point_t; OpenAPI_ip_end_point_t *OpenAPI_ip_end_point_create( char *ipv4_address, char *ipv6_address, - OpenAPI_transport_protocol_e transport, + OpenAPI_transport_protocol_t *transport, int port ); void OpenAPI_ip_end_point_free(OpenAPI_ip_end_point_t *ip_end_point); diff --git a/lib/sbi/openapi/model/iptv_config_data.c b/lib/sbi/openapi/model/iptv_config_data.c new file mode 100644 index 0000000000..7bbb422125 --- /dev/null +++ b/lib/sbi/openapi/model/iptv_config_data.c @@ -0,0 +1,243 @@ + +#include +#include +#include +#include "iptv_config_data.h" + +OpenAPI_iptv_config_data_t *OpenAPI_iptv_config_data_create( + char *supi, + char *inter_group_id, + char *dnn, + OpenAPI_snssai_t *snssai, + char *af_app_id, + OpenAPI_list_t* multi_acc_ctrls, + char *supp_feat + ) +{ + OpenAPI_iptv_config_data_t *iptv_config_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_iptv_config_data_t)); + if (!iptv_config_data_local_var) { + return NULL; + } + iptv_config_data_local_var->supi = supi; + iptv_config_data_local_var->inter_group_id = inter_group_id; + iptv_config_data_local_var->dnn = dnn; + iptv_config_data_local_var->snssai = snssai; + iptv_config_data_local_var->af_app_id = af_app_id; + iptv_config_data_local_var->multi_acc_ctrls = multi_acc_ctrls; + iptv_config_data_local_var->supp_feat = supp_feat; + + return iptv_config_data_local_var; +} + +void OpenAPI_iptv_config_data_free(OpenAPI_iptv_config_data_t *iptv_config_data) +{ + if (NULL == iptv_config_data) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(iptv_config_data->supi); + ogs_free(iptv_config_data->inter_group_id); + ogs_free(iptv_config_data->dnn); + OpenAPI_snssai_free(iptv_config_data->snssai); + ogs_free(iptv_config_data->af_app_id); + OpenAPI_list_for_each(iptv_config_data->multi_acc_ctrls, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_multicast_access_control_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(iptv_config_data->multi_acc_ctrls); + ogs_free(iptv_config_data->supp_feat); + ogs_free(iptv_config_data); +} + +cJSON *OpenAPI_iptv_config_data_convertToJSON(OpenAPI_iptv_config_data_t *iptv_config_data) +{ + cJSON *item = NULL; + + if (iptv_config_data == NULL) { + ogs_error("OpenAPI_iptv_config_data_convertToJSON() failed [IptvConfigData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (iptv_config_data->supi) { + if (cJSON_AddStringToObject(item, "supi", iptv_config_data->supi) == NULL) { + ogs_error("OpenAPI_iptv_config_data_convertToJSON() failed [supi]"); + goto end; + } + } + + if (iptv_config_data->inter_group_id) { + if (cJSON_AddStringToObject(item, "interGroupId", iptv_config_data->inter_group_id) == NULL) { + ogs_error("OpenAPI_iptv_config_data_convertToJSON() failed [inter_group_id]"); + goto end; + } + } + + if (iptv_config_data->dnn) { + if (cJSON_AddStringToObject(item, "dnn", iptv_config_data->dnn) == NULL) { + ogs_error("OpenAPI_iptv_config_data_convertToJSON() failed [dnn]"); + goto end; + } + } + + if (iptv_config_data->snssai) { + cJSON *snssai_local_JSON = OpenAPI_snssai_convertToJSON(iptv_config_data->snssai); + if (snssai_local_JSON == NULL) { + ogs_error("OpenAPI_iptv_config_data_convertToJSON() failed [snssai]"); + goto end; + } + cJSON_AddItemToObject(item, "snssai", snssai_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_iptv_config_data_convertToJSON() failed [snssai]"); + goto end; + } + } + + if (!iptv_config_data->af_app_id) { + ogs_error("OpenAPI_iptv_config_data_convertToJSON() failed [af_app_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "afAppId", iptv_config_data->af_app_id) == NULL) { + ogs_error("OpenAPI_iptv_config_data_convertToJSON() failed [af_app_id]"); + goto end; + } + + if (!iptv_config_data->multi_acc_ctrls) { + ogs_error("OpenAPI_iptv_config_data_convertToJSON() failed [multi_acc_ctrls]"); + goto end; + } + cJSON *multi_acc_ctrls = cJSON_AddObjectToObject(item, "multiAccCtrls"); + if (multi_acc_ctrls == NULL) { + ogs_error("OpenAPI_iptv_config_data_convertToJSON() failed [multi_acc_ctrls]"); + goto end; + } + cJSON *localMapObject = multi_acc_ctrls; + OpenAPI_lnode_t *multi_acc_ctrls_node; + if (iptv_config_data->multi_acc_ctrls) { + OpenAPI_list_for_each(iptv_config_data->multi_acc_ctrls, multi_acc_ctrls_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)multi_acc_ctrls_node->data; + cJSON *itemLocal = OpenAPI_multicast_access_control_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_iptv_config_data_convertToJSON() failed [multi_acc_ctrls]"); + goto end; + } + cJSON_AddItemToObject(multi_acc_ctrls, localKeyValue->key, itemLocal); + } + } + + if (!iptv_config_data->supp_feat) { + ogs_error("OpenAPI_iptv_config_data_convertToJSON() failed [supp_feat]"); + goto end; + } + if (cJSON_AddStringToObject(item, "suppFeat", iptv_config_data->supp_feat) == NULL) { + ogs_error("OpenAPI_iptv_config_data_convertToJSON() failed [supp_feat]"); + goto end; + } + +end: + return item; +} + +OpenAPI_iptv_config_data_t *OpenAPI_iptv_config_data_parseFromJSON(cJSON *iptv_config_dataJSON) +{ + OpenAPI_iptv_config_data_t *iptv_config_data_local_var = NULL; + cJSON *supi = cJSON_GetObjectItemCaseSensitive(iptv_config_dataJSON, "supi"); + + if (supi) { + if (!cJSON_IsString(supi)) { + ogs_error("OpenAPI_iptv_config_data_parseFromJSON() failed [supi]"); + goto end; + } + } + + cJSON *inter_group_id = cJSON_GetObjectItemCaseSensitive(iptv_config_dataJSON, "interGroupId"); + + if (inter_group_id) { + if (!cJSON_IsString(inter_group_id)) { + ogs_error("OpenAPI_iptv_config_data_parseFromJSON() failed [inter_group_id]"); + goto end; + } + } + + cJSON *dnn = cJSON_GetObjectItemCaseSensitive(iptv_config_dataJSON, "dnn"); + + if (dnn) { + if (!cJSON_IsString(dnn)) { + ogs_error("OpenAPI_iptv_config_data_parseFromJSON() failed [dnn]"); + goto end; + } + } + + cJSON *snssai = cJSON_GetObjectItemCaseSensitive(iptv_config_dataJSON, "snssai"); + + OpenAPI_snssai_t *snssai_local_nonprim = NULL; + if (snssai) { + snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(snssai); + } + + cJSON *af_app_id = cJSON_GetObjectItemCaseSensitive(iptv_config_dataJSON, "afAppId"); + if (!af_app_id) { + ogs_error("OpenAPI_iptv_config_data_parseFromJSON() failed [af_app_id]"); + goto end; + } + + + if (!cJSON_IsString(af_app_id)) { + ogs_error("OpenAPI_iptv_config_data_parseFromJSON() failed [af_app_id]"); + goto end; + } + + cJSON *multi_acc_ctrls = cJSON_GetObjectItemCaseSensitive(iptv_config_dataJSON, "multiAccCtrls"); + if (!multi_acc_ctrls) { + ogs_error("OpenAPI_iptv_config_data_parseFromJSON() failed [multi_acc_ctrls]"); + goto end; + } + + OpenAPI_list_t *multi_acc_ctrlsList; + + cJSON *multi_acc_ctrls_local_map; + if (!cJSON_IsObject(multi_acc_ctrls)) { + ogs_error("OpenAPI_iptv_config_data_parseFromJSON() failed [multi_acc_ctrls]"); + goto end; + } + multi_acc_ctrlsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(multi_acc_ctrls_local_map, multi_acc_ctrls) { + cJSON *localMapObject = multi_acc_ctrls_local_map; + if (!cJSON_IsObject(multi_acc_ctrls_local_map)) { + ogs_error("OpenAPI_iptv_config_data_parseFromJSON() failed [multi_acc_ctrls]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_multicast_access_control_parseFromJSON(localMapObject)); + OpenAPI_list_add(multi_acc_ctrlsList, localMapKeyPair); + } + + cJSON *supp_feat = cJSON_GetObjectItemCaseSensitive(iptv_config_dataJSON, "suppFeat"); + if (!supp_feat) { + ogs_error("OpenAPI_iptv_config_data_parseFromJSON() failed [supp_feat]"); + goto end; + } + + + if (!cJSON_IsString(supp_feat)) { + ogs_error("OpenAPI_iptv_config_data_parseFromJSON() failed [supp_feat]"); + goto end; + } + + iptv_config_data_local_var = OpenAPI_iptv_config_data_create ( + supi ? ogs_strdup(supi->valuestring) : NULL, + inter_group_id ? ogs_strdup(inter_group_id->valuestring) : NULL, + dnn ? ogs_strdup(dnn->valuestring) : NULL, + snssai ? snssai_local_nonprim : NULL, + ogs_strdup(af_app_id->valuestring), + multi_acc_ctrlsList, + ogs_strdup(supp_feat->valuestring) + ); + + return iptv_config_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/iptv_config_data.h b/lib/sbi/openapi/model/iptv_config_data.h new file mode 100644 index 0000000000..15f827a684 --- /dev/null +++ b/lib/sbi/openapi/model/iptv_config_data.h @@ -0,0 +1,51 @@ +/* + * iptv_config_data.h + * + * + */ + +#ifndef _OpenAPI_iptv_config_data_H_ +#define _OpenAPI_iptv_config_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "multicast_access_control.h" +#include "snssai.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_iptv_config_data_s OpenAPI_iptv_config_data_t; +typedef struct OpenAPI_iptv_config_data_s { + char *supi; + char *inter_group_id; + char *dnn; + struct OpenAPI_snssai_s *snssai; + char *af_app_id; + OpenAPI_list_t* multi_acc_ctrls; + char *supp_feat; +} OpenAPI_iptv_config_data_t; + +OpenAPI_iptv_config_data_t *OpenAPI_iptv_config_data_create( + char *supi, + char *inter_group_id, + char *dnn, + OpenAPI_snssai_t *snssai, + char *af_app_id, + OpenAPI_list_t* multi_acc_ctrls, + char *supp_feat + ); +void OpenAPI_iptv_config_data_free(OpenAPI_iptv_config_data_t *iptv_config_data); +OpenAPI_iptv_config_data_t *OpenAPI_iptv_config_data_parseFromJSON(cJSON *iptv_config_dataJSON); +cJSON *OpenAPI_iptv_config_data_convertToJSON(OpenAPI_iptv_config_data_t *iptv_config_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_iptv_config_data_H_ */ + diff --git a/lib/sbi/openapi/model/iptv_config_data_patch.c b/lib/sbi/openapi/model/iptv_config_data_patch.c new file mode 100644 index 0000000000..6ece43ba4b --- /dev/null +++ b/lib/sbi/openapi/model/iptv_config_data_patch.c @@ -0,0 +1,104 @@ + +#include +#include +#include +#include "iptv_config_data_patch.h" + +OpenAPI_iptv_config_data_patch_t *OpenAPI_iptv_config_data_patch_create( + OpenAPI_list_t* multi_acc_ctrls + ) +{ + OpenAPI_iptv_config_data_patch_t *iptv_config_data_patch_local_var = OpenAPI_malloc(sizeof(OpenAPI_iptv_config_data_patch_t)); + if (!iptv_config_data_patch_local_var) { + return NULL; + } + iptv_config_data_patch_local_var->multi_acc_ctrls = multi_acc_ctrls; + + return iptv_config_data_patch_local_var; +} + +void OpenAPI_iptv_config_data_patch_free(OpenAPI_iptv_config_data_patch_t *iptv_config_data_patch) +{ + if (NULL == iptv_config_data_patch) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(iptv_config_data_patch->multi_acc_ctrls, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_multicast_access_control_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(iptv_config_data_patch->multi_acc_ctrls); + ogs_free(iptv_config_data_patch); +} + +cJSON *OpenAPI_iptv_config_data_patch_convertToJSON(OpenAPI_iptv_config_data_patch_t *iptv_config_data_patch) +{ + cJSON *item = NULL; + + if (iptv_config_data_patch == NULL) { + ogs_error("OpenAPI_iptv_config_data_patch_convertToJSON() failed [IptvConfigDataPatch]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (iptv_config_data_patch->multi_acc_ctrls) { + cJSON *multi_acc_ctrls = cJSON_AddObjectToObject(item, "multiAccCtrls"); + if (multi_acc_ctrls == NULL) { + ogs_error("OpenAPI_iptv_config_data_patch_convertToJSON() failed [multi_acc_ctrls]"); + goto end; + } + cJSON *localMapObject = multi_acc_ctrls; + OpenAPI_lnode_t *multi_acc_ctrls_node; + if (iptv_config_data_patch->multi_acc_ctrls) { + OpenAPI_list_for_each(iptv_config_data_patch->multi_acc_ctrls, multi_acc_ctrls_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)multi_acc_ctrls_node->data; + cJSON *itemLocal = OpenAPI_multicast_access_control_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_iptv_config_data_patch_convertToJSON() failed [multi_acc_ctrls]"); + goto end; + } + cJSON_AddItemToObject(multi_acc_ctrls, localKeyValue->key, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_iptv_config_data_patch_t *OpenAPI_iptv_config_data_patch_parseFromJSON(cJSON *iptv_config_data_patchJSON) +{ + OpenAPI_iptv_config_data_patch_t *iptv_config_data_patch_local_var = NULL; + cJSON *multi_acc_ctrls = cJSON_GetObjectItemCaseSensitive(iptv_config_data_patchJSON, "multiAccCtrls"); + + OpenAPI_list_t *multi_acc_ctrlsList; + if (multi_acc_ctrls) { + cJSON *multi_acc_ctrls_local_map; + if (!cJSON_IsObject(multi_acc_ctrls)) { + ogs_error("OpenAPI_iptv_config_data_patch_parseFromJSON() failed [multi_acc_ctrls]"); + goto end; + } + multi_acc_ctrlsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(multi_acc_ctrls_local_map, multi_acc_ctrls) { + cJSON *localMapObject = multi_acc_ctrls_local_map; + if (!cJSON_IsObject(multi_acc_ctrls_local_map)) { + ogs_error("OpenAPI_iptv_config_data_patch_parseFromJSON() failed [multi_acc_ctrls]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_multicast_access_control_parseFromJSON(localMapObject)); + OpenAPI_list_add(multi_acc_ctrlsList, localMapKeyPair); + } + } + + iptv_config_data_patch_local_var = OpenAPI_iptv_config_data_patch_create ( + multi_acc_ctrls ? multi_acc_ctrlsList : NULL + ); + + return iptv_config_data_patch_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/iptv_config_data_patch.h b/lib/sbi/openapi/model/iptv_config_data_patch.h new file mode 100644 index 0000000000..776c6e89f3 --- /dev/null +++ b/lib/sbi/openapi/model/iptv_config_data_patch.h @@ -0,0 +1,38 @@ +/* + * iptv_config_data_patch.h + * + * + */ + +#ifndef _OpenAPI_iptv_config_data_patch_H_ +#define _OpenAPI_iptv_config_data_patch_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "multicast_access_control.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_iptv_config_data_patch_s OpenAPI_iptv_config_data_patch_t; +typedef struct OpenAPI_iptv_config_data_patch_s { + OpenAPI_list_t* multi_acc_ctrls; +} OpenAPI_iptv_config_data_patch_t; + +OpenAPI_iptv_config_data_patch_t *OpenAPI_iptv_config_data_patch_create( + OpenAPI_list_t* multi_acc_ctrls + ); +void OpenAPI_iptv_config_data_patch_free(OpenAPI_iptv_config_data_patch_t *iptv_config_data_patch); +OpenAPI_iptv_config_data_patch_t *OpenAPI_iptv_config_data_patch_parseFromJSON(cJSON *iptv_config_data_patchJSON); +cJSON *OpenAPI_iptv_config_data_patch_convertToJSON(OpenAPI_iptv_config_data_patch_t *iptv_config_data_patch); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_iptv_config_data_patch_H_ */ + diff --git a/lib/sbi/openapi/model/ipv4_address_range.h b/lib/sbi/openapi/model/ipv4_address_range.h index c3cf991dbb..eb2ae14828 100644 --- a/lib/sbi/openapi/model/ipv4_address_range.h +++ b/lib/sbi/openapi/model/ipv4_address_range.h @@ -1,7 +1,7 @@ /* * ipv4_address_range.h * - * + * Range of IPv4 addresses */ #ifndef _OpenAPI_ipv4_address_range_H_ diff --git a/lib/sbi/openapi/model/ipv6_prefix_range.h b/lib/sbi/openapi/model/ipv6_prefix_range.h index 7366cdbd61..fc774a5c06 100644 --- a/lib/sbi/openapi/model/ipv6_prefix_range.h +++ b/lib/sbi/openapi/model/ipv6_prefix_range.h @@ -1,7 +1,7 @@ /* * ipv6_prefix_range.h * - * + * Range of IPv6 prefixes */ #ifndef _OpenAPI_ipv6_prefix_range_H_ diff --git a/lib/sbi/openapi/model/lcs_client_class.c b/lib/sbi/openapi/model/lcs_client_class.c new file mode 100644 index 0000000000..3be75752b5 --- /dev/null +++ b/lib/sbi/openapi/model/lcs_client_class.c @@ -0,0 +1,30 @@ + +#include +#include +#include +#include "lcs_client_class.h" + +char* OpenAPI_lcs_client_class_ToString(OpenAPI_lcs_client_class_e lcs_client_class) +{ + const char *lcs_client_classArray[] = { "NULL", "BROADCAST_SERVICE", "OM_IN_HPLMN", "OM_IN_VPLMN", "ANONYMOUS_LOCATION_SERVICE", "SPECIFIC_SERVICE" }; + size_t sizeofArray = sizeof(lcs_client_classArray) / sizeof(lcs_client_classArray[0]); + if (lcs_client_class < sizeofArray) + return (char *)lcs_client_classArray[lcs_client_class]; + else + return (char *)"Unknown"; +} + +OpenAPI_lcs_client_class_e OpenAPI_lcs_client_class_FromString(char* lcs_client_class) +{ + int stringToReturn = 0; + const char *lcs_client_classArray[] = { "NULL", "BROADCAST_SERVICE", "OM_IN_HPLMN", "OM_IN_VPLMN", "ANONYMOUS_LOCATION_SERVICE", "SPECIFIC_SERVICE" }; + size_t sizeofArray = sizeof(lcs_client_classArray) / sizeof(lcs_client_classArray[0]); + while (stringToReturn < sizeofArray) { + if (strcmp(lcs_client_class, lcs_client_classArray[stringToReturn]) == 0) { + return stringToReturn; + } + stringToReturn++; + } + return 0; +} + diff --git a/lib/sbi/openapi/model/lcs_client_class.h b/lib/sbi/openapi/model/lcs_client_class.h new file mode 100644 index 0000000000..b27cb17e07 --- /dev/null +++ b/lib/sbi/openapi/model/lcs_client_class.h @@ -0,0 +1,31 @@ +/* + * lcs_client_class.h + * + * + */ + +#ifndef _OpenAPI_lcs_client_class_H_ +#define _OpenAPI_lcs_client_class_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { OpenAPI_lcs_client_class_NULL = 0, OpenAPI_lcs_client_class_BROADCAST_SERVICE, OpenAPI_lcs_client_class_OM_IN_HPLMN, OpenAPI_lcs_client_class_OM_IN_VPLMN, OpenAPI_lcs_client_class_ANONYMOUS_LOCATION_SERVICE, OpenAPI_lcs_client_class_SPECIFIC_SERVICE } OpenAPI_lcs_client_class_e; + +char* OpenAPI_lcs_client_class_ToString(OpenAPI_lcs_client_class_e lcs_client_class); + +OpenAPI_lcs_client_class_e OpenAPI_lcs_client_class_FromString(char* lcs_client_class); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_lcs_client_class_H_ */ + diff --git a/lib/sbi/openapi/model/lcs_client_external.c b/lib/sbi/openapi/model/lcs_client_external.c new file mode 100644 index 0000000000..3f6f61e47d --- /dev/null +++ b/lib/sbi/openapi/model/lcs_client_external.c @@ -0,0 +1,146 @@ + +#include +#include +#include +#include "lcs_client_external.h" + +OpenAPI_lcs_client_external_t *OpenAPI_lcs_client_external_create( + OpenAPI_list_t *allowed_geographic_area, + OpenAPI_privacy_check_related_action_e privacy_check_related_action, + OpenAPI_valid_time_period_t *valid_time_period + ) +{ + OpenAPI_lcs_client_external_t *lcs_client_external_local_var = OpenAPI_malloc(sizeof(OpenAPI_lcs_client_external_t)); + if (!lcs_client_external_local_var) { + return NULL; + } + lcs_client_external_local_var->allowed_geographic_area = allowed_geographic_area; + lcs_client_external_local_var->privacy_check_related_action = privacy_check_related_action; + lcs_client_external_local_var->valid_time_period = valid_time_period; + + return lcs_client_external_local_var; +} + +void OpenAPI_lcs_client_external_free(OpenAPI_lcs_client_external_t *lcs_client_external) +{ + if (NULL == lcs_client_external) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(lcs_client_external->allowed_geographic_area, node) { + OpenAPI_geographic_area_free(node->data); + } + OpenAPI_list_free(lcs_client_external->allowed_geographic_area); + OpenAPI_valid_time_period_free(lcs_client_external->valid_time_period); + ogs_free(lcs_client_external); +} + +cJSON *OpenAPI_lcs_client_external_convertToJSON(OpenAPI_lcs_client_external_t *lcs_client_external) +{ + cJSON *item = NULL; + + if (lcs_client_external == NULL) { + ogs_error("OpenAPI_lcs_client_external_convertToJSON() failed [LcsClientExternal]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (lcs_client_external->allowed_geographic_area) { + cJSON *allowed_geographic_areaList = cJSON_AddArrayToObject(item, "allowedGeographicArea"); + if (allowed_geographic_areaList == NULL) { + ogs_error("OpenAPI_lcs_client_external_convertToJSON() failed [allowed_geographic_area]"); + goto end; + } + + OpenAPI_lnode_t *allowed_geographic_area_node; + if (lcs_client_external->allowed_geographic_area) { + OpenAPI_list_for_each(lcs_client_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_lcs_client_external_convertToJSON() failed [allowed_geographic_area]"); + goto end; + } + cJSON_AddItemToArray(allowed_geographic_areaList, itemLocal); + } + } + } + + if (lcs_client_external->privacy_check_related_action) { + if (cJSON_AddStringToObject(item, "privacyCheckRelatedAction", OpenAPI_privacy_check_related_action_ToString(lcs_client_external->privacy_check_related_action)) == NULL) { + ogs_error("OpenAPI_lcs_client_external_convertToJSON() failed [privacy_check_related_action]"); + goto end; + } + } + + if (lcs_client_external->valid_time_period) { + cJSON *valid_time_period_local_JSON = OpenAPI_valid_time_period_convertToJSON(lcs_client_external->valid_time_period); + if (valid_time_period_local_JSON == NULL) { + ogs_error("OpenAPI_lcs_client_external_convertToJSON() failed [valid_time_period]"); + goto end; + } + cJSON_AddItemToObject(item, "validTimePeriod", valid_time_period_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_lcs_client_external_convertToJSON() failed [valid_time_period]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_lcs_client_external_t *OpenAPI_lcs_client_external_parseFromJSON(cJSON *lcs_client_externalJSON) +{ + OpenAPI_lcs_client_external_t *lcs_client_external_local_var = NULL; + cJSON *allowed_geographic_area = cJSON_GetObjectItemCaseSensitive(lcs_client_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_lcs_client_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_lcs_client_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(lcs_client_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_lcs_client_external_parseFromJSON() failed [privacy_check_related_action]"); + goto end; + } + privacy_check_related_actionVariable = OpenAPI_privacy_check_related_action_FromString(privacy_check_related_action->valuestring); + } + + cJSON *valid_time_period = cJSON_GetObjectItemCaseSensitive(lcs_client_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); + } + + lcs_client_external_local_var = OpenAPI_lcs_client_external_create ( + allowed_geographic_area ? allowed_geographic_areaList : NULL, + privacy_check_related_action ? privacy_check_related_actionVariable : 0, + valid_time_period ? valid_time_period_local_nonprim : NULL + ); + + return lcs_client_external_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/lcs_client_external.h b/lib/sbi/openapi/model/lcs_client_external.h new file mode 100644 index 0000000000..72507ff45e --- /dev/null +++ b/lib/sbi/openapi/model/lcs_client_external.h @@ -0,0 +1,44 @@ +/* + * lcs_client_external.h + * + * + */ + +#ifndef _OpenAPI_lcs_client_external_H_ +#define _OpenAPI_lcs_client_external_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "geographic_area.h" +#include "privacy_check_related_action.h" +#include "valid_time_period.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_lcs_client_external_s OpenAPI_lcs_client_external_t; +typedef struct OpenAPI_lcs_client_external_s { + OpenAPI_list_t *allowed_geographic_area; + OpenAPI_privacy_check_related_action_e privacy_check_related_action; + struct OpenAPI_valid_time_period_s *valid_time_period; +} OpenAPI_lcs_client_external_t; + +OpenAPI_lcs_client_external_t *OpenAPI_lcs_client_external_create( + OpenAPI_list_t *allowed_geographic_area, + OpenAPI_privacy_check_related_action_e privacy_check_related_action, + OpenAPI_valid_time_period_t *valid_time_period + ); +void OpenAPI_lcs_client_external_free(OpenAPI_lcs_client_external_t *lcs_client_external); +OpenAPI_lcs_client_external_t *OpenAPI_lcs_client_external_parseFromJSON(cJSON *lcs_client_externalJSON); +cJSON *OpenAPI_lcs_client_external_convertToJSON(OpenAPI_lcs_client_external_t *lcs_client_external); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_lcs_client_external_H_ */ + diff --git a/lib/sbi/openapi/model/lcs_client_group_external.c b/lib/sbi/openapi/model/lcs_client_group_external.c new file mode 100644 index 0000000000..4027d0a036 --- /dev/null +++ b/lib/sbi/openapi/model/lcs_client_group_external.c @@ -0,0 +1,166 @@ + +#include +#include +#include +#include "lcs_client_group_external.h" + +OpenAPI_lcs_client_group_external_t *OpenAPI_lcs_client_group_external_create( + char *lcs_client_group_id, + OpenAPI_list_t *allowed_geographic_area, + OpenAPI_privacy_check_related_action_e privacy_check_related_action, + OpenAPI_valid_time_period_t *valid_time_period + ) +{ + OpenAPI_lcs_client_group_external_t *lcs_client_group_external_local_var = OpenAPI_malloc(sizeof(OpenAPI_lcs_client_group_external_t)); + if (!lcs_client_group_external_local_var) { + return NULL; + } + lcs_client_group_external_local_var->lcs_client_group_id = lcs_client_group_id; + lcs_client_group_external_local_var->allowed_geographic_area = allowed_geographic_area; + lcs_client_group_external_local_var->privacy_check_related_action = privacy_check_related_action; + lcs_client_group_external_local_var->valid_time_period = valid_time_period; + + return lcs_client_group_external_local_var; +} + +void OpenAPI_lcs_client_group_external_free(OpenAPI_lcs_client_group_external_t *lcs_client_group_external) +{ + if (NULL == lcs_client_group_external) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(lcs_client_group_external->lcs_client_group_id); + OpenAPI_list_for_each(lcs_client_group_external->allowed_geographic_area, node) { + OpenAPI_geographic_area_free(node->data); + } + OpenAPI_list_free(lcs_client_group_external->allowed_geographic_area); + OpenAPI_valid_time_period_free(lcs_client_group_external->valid_time_period); + ogs_free(lcs_client_group_external); +} + +cJSON *OpenAPI_lcs_client_group_external_convertToJSON(OpenAPI_lcs_client_group_external_t *lcs_client_group_external) +{ + cJSON *item = NULL; + + if (lcs_client_group_external == NULL) { + ogs_error("OpenAPI_lcs_client_group_external_convertToJSON() failed [LcsClientGroupExternal]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (lcs_client_group_external->lcs_client_group_id) { + if (cJSON_AddStringToObject(item, "lcsClientGroupId", lcs_client_group_external->lcs_client_group_id) == NULL) { + ogs_error("OpenAPI_lcs_client_group_external_convertToJSON() failed [lcs_client_group_id]"); + goto end; + } + } + + if (lcs_client_group_external->allowed_geographic_area) { + cJSON *allowed_geographic_areaList = cJSON_AddArrayToObject(item, "allowedGeographicArea"); + if (allowed_geographic_areaList == NULL) { + ogs_error("OpenAPI_lcs_client_group_external_convertToJSON() failed [allowed_geographic_area]"); + goto end; + } + + OpenAPI_lnode_t *allowed_geographic_area_node; + if (lcs_client_group_external->allowed_geographic_area) { + OpenAPI_list_for_each(lcs_client_group_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_lcs_client_group_external_convertToJSON() failed [allowed_geographic_area]"); + goto end; + } + cJSON_AddItemToArray(allowed_geographic_areaList, itemLocal); + } + } + } + + if (lcs_client_group_external->privacy_check_related_action) { + if (cJSON_AddStringToObject(item, "privacyCheckRelatedAction", OpenAPI_privacy_check_related_action_ToString(lcs_client_group_external->privacy_check_related_action)) == NULL) { + ogs_error("OpenAPI_lcs_client_group_external_convertToJSON() failed [privacy_check_related_action]"); + goto end; + } + } + + if (lcs_client_group_external->valid_time_period) { + cJSON *valid_time_period_local_JSON = OpenAPI_valid_time_period_convertToJSON(lcs_client_group_external->valid_time_period); + if (valid_time_period_local_JSON == NULL) { + ogs_error("OpenAPI_lcs_client_group_external_convertToJSON() failed [valid_time_period]"); + goto end; + } + cJSON_AddItemToObject(item, "validTimePeriod", valid_time_period_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_lcs_client_group_external_convertToJSON() failed [valid_time_period]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_lcs_client_group_external_t *OpenAPI_lcs_client_group_external_parseFromJSON(cJSON *lcs_client_group_externalJSON) +{ + OpenAPI_lcs_client_group_external_t *lcs_client_group_external_local_var = NULL; + cJSON *lcs_client_group_id = cJSON_GetObjectItemCaseSensitive(lcs_client_group_externalJSON, "lcsClientGroupId"); + + if (lcs_client_group_id) { + if (!cJSON_IsString(lcs_client_group_id)) { + ogs_error("OpenAPI_lcs_client_group_external_parseFromJSON() failed [lcs_client_group_id]"); + goto end; + } + } + + cJSON *allowed_geographic_area = cJSON_GetObjectItemCaseSensitive(lcs_client_group_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_lcs_client_group_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_lcs_client_group_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(lcs_client_group_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_lcs_client_group_external_parseFromJSON() failed [privacy_check_related_action]"); + goto end; + } + privacy_check_related_actionVariable = OpenAPI_privacy_check_related_action_FromString(privacy_check_related_action->valuestring); + } + + cJSON *valid_time_period = cJSON_GetObjectItemCaseSensitive(lcs_client_group_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); + } + + lcs_client_group_external_local_var = OpenAPI_lcs_client_group_external_create ( + lcs_client_group_id ? ogs_strdup(lcs_client_group_id->valuestring) : NULL, + allowed_geographic_area ? allowed_geographic_areaList : NULL, + privacy_check_related_action ? privacy_check_related_actionVariable : 0, + valid_time_period ? valid_time_period_local_nonprim : NULL + ); + + return lcs_client_group_external_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/lcs_client_group_external.h b/lib/sbi/openapi/model/lcs_client_group_external.h new file mode 100644 index 0000000000..61d947c15f --- /dev/null +++ b/lib/sbi/openapi/model/lcs_client_group_external.h @@ -0,0 +1,46 @@ +/* + * lcs_client_group_external.h + * + * + */ + +#ifndef _OpenAPI_lcs_client_group_external_H_ +#define _OpenAPI_lcs_client_group_external_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "geographic_area.h" +#include "privacy_check_related_action.h" +#include "valid_time_period.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_lcs_client_group_external_s OpenAPI_lcs_client_group_external_t; +typedef struct OpenAPI_lcs_client_group_external_s { + char *lcs_client_group_id; + OpenAPI_list_t *allowed_geographic_area; + OpenAPI_privacy_check_related_action_e privacy_check_related_action; + struct OpenAPI_valid_time_period_s *valid_time_period; +} OpenAPI_lcs_client_group_external_t; + +OpenAPI_lcs_client_group_external_t *OpenAPI_lcs_client_group_external_create( + char *lcs_client_group_id, + OpenAPI_list_t *allowed_geographic_area, + OpenAPI_privacy_check_related_action_e privacy_check_related_action, + OpenAPI_valid_time_period_t *valid_time_period + ); +void OpenAPI_lcs_client_group_external_free(OpenAPI_lcs_client_group_external_t *lcs_client_group_external); +OpenAPI_lcs_client_group_external_t *OpenAPI_lcs_client_group_external_parseFromJSON(cJSON *lcs_client_group_externalJSON); +cJSON *OpenAPI_lcs_client_group_external_convertToJSON(OpenAPI_lcs_client_group_external_t *lcs_client_group_external); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_lcs_client_group_external_H_ */ + diff --git a/lib/sbi/openapi/model/lcs_client_non_external.c b/lib/sbi/openapi/model/lcs_client_non_external.c new file mode 100644 index 0000000000..d62bedcca4 --- /dev/null +++ b/lib/sbi/openapi/model/lcs_client_non_external.c @@ -0,0 +1,192 @@ + +#include +#include +#include +#include "lcs_client_non_external.h" + +OpenAPI_lcs_client_non_external_t *OpenAPI_lcs_client_non_external_create( + char *lcs_client_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_lcs_client_non_external_t *lcs_client_non_external_local_var = OpenAPI_malloc(sizeof(OpenAPI_lcs_client_non_external_t)); + if (!lcs_client_non_external_local_var) { + return NULL; + } + lcs_client_non_external_local_var->lcs_client_id = lcs_client_id; + lcs_client_non_external_local_var->allowed_geographic_area = allowed_geographic_area; + lcs_client_non_external_local_var->privacy_check_related_action = privacy_check_related_action; + lcs_client_non_external_local_var->code_word_ind = code_word_ind; + lcs_client_non_external_local_var->valid_time_period = valid_time_period; + + return lcs_client_non_external_local_var; +} + +void OpenAPI_lcs_client_non_external_free(OpenAPI_lcs_client_non_external_t *lcs_client_non_external) +{ + if (NULL == lcs_client_non_external) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(lcs_client_non_external->lcs_client_id); + OpenAPI_list_for_each(lcs_client_non_external->allowed_geographic_area, node) { + OpenAPI_geographic_area_free(node->data); + } + OpenAPI_list_free(lcs_client_non_external->allowed_geographic_area); + OpenAPI_valid_time_period_free(lcs_client_non_external->valid_time_period); + ogs_free(lcs_client_non_external); +} + +cJSON *OpenAPI_lcs_client_non_external_convertToJSON(OpenAPI_lcs_client_non_external_t *lcs_client_non_external) +{ + cJSON *item = NULL; + + if (lcs_client_non_external == NULL) { + ogs_error("OpenAPI_lcs_client_non_external_convertToJSON() failed [LcsClientNonExternal]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!lcs_client_non_external->lcs_client_id) { + ogs_error("OpenAPI_lcs_client_non_external_convertToJSON() failed [lcs_client_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "lcsClientId", lcs_client_non_external->lcs_client_id) == NULL) { + ogs_error("OpenAPI_lcs_client_non_external_convertToJSON() failed [lcs_client_id]"); + goto end; + } + + if (lcs_client_non_external->allowed_geographic_area) { + cJSON *allowed_geographic_areaList = cJSON_AddArrayToObject(item, "allowedGeographicArea"); + if (allowed_geographic_areaList == NULL) { + ogs_error("OpenAPI_lcs_client_non_external_convertToJSON() failed [allowed_geographic_area]"); + goto end; + } + + OpenAPI_lnode_t *allowed_geographic_area_node; + if (lcs_client_non_external->allowed_geographic_area) { + OpenAPI_list_for_each(lcs_client_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_lcs_client_non_external_convertToJSON() failed [allowed_geographic_area]"); + goto end; + } + cJSON_AddItemToArray(allowed_geographic_areaList, itemLocal); + } + } + } + + if (lcs_client_non_external->privacy_check_related_action) { + if (cJSON_AddStringToObject(item, "privacyCheckRelatedAction", OpenAPI_privacy_check_related_action_ToString(lcs_client_non_external->privacy_check_related_action)) == NULL) { + ogs_error("OpenAPI_lcs_client_non_external_convertToJSON() failed [privacy_check_related_action]"); + goto end; + } + } + + if (lcs_client_non_external->code_word_ind) { + if (cJSON_AddStringToObject(item, "codeWordInd", OpenAPI_code_word_ind_ToString(lcs_client_non_external->code_word_ind)) == NULL) { + ogs_error("OpenAPI_lcs_client_non_external_convertToJSON() failed [code_word_ind]"); + goto end; + } + } + + if (lcs_client_non_external->valid_time_period) { + cJSON *valid_time_period_local_JSON = OpenAPI_valid_time_period_convertToJSON(lcs_client_non_external->valid_time_period); + if (valid_time_period_local_JSON == NULL) { + ogs_error("OpenAPI_lcs_client_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_lcs_client_non_external_convertToJSON() failed [valid_time_period]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_lcs_client_non_external_t *OpenAPI_lcs_client_non_external_parseFromJSON(cJSON *lcs_client_non_externalJSON) +{ + OpenAPI_lcs_client_non_external_t *lcs_client_non_external_local_var = NULL; + cJSON *lcs_client_id = cJSON_GetObjectItemCaseSensitive(lcs_client_non_externalJSON, "lcsClientId"); + if (!lcs_client_id) { + ogs_error("OpenAPI_lcs_client_non_external_parseFromJSON() failed [lcs_client_id]"); + goto end; + } + + + if (!cJSON_IsString(lcs_client_id)) { + ogs_error("OpenAPI_lcs_client_non_external_parseFromJSON() failed [lcs_client_id]"); + goto end; + } + + cJSON *allowed_geographic_area = cJSON_GetObjectItemCaseSensitive(lcs_client_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_lcs_client_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_lcs_client_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(lcs_client_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_lcs_client_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(lcs_client_non_externalJSON, "codeWordInd"); + + OpenAPI_code_word_ind_e code_word_indVariable; + if (code_word_ind) { + if (!cJSON_IsString(code_word_ind)) { + ogs_error("OpenAPI_lcs_client_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(lcs_client_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); + } + + lcs_client_non_external_local_var = OpenAPI_lcs_client_non_external_create ( + ogs_strdup(lcs_client_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 lcs_client_non_external_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/lcs_client_non_external.h b/lib/sbi/openapi/model/lcs_client_non_external.h new file mode 100644 index 0000000000..fc17ae8b49 --- /dev/null +++ b/lib/sbi/openapi/model/lcs_client_non_external.h @@ -0,0 +1,49 @@ +/* + * lcs_client_non_external.h + * + * + */ + +#ifndef _OpenAPI_lcs_client_non_external_H_ +#define _OpenAPI_lcs_client_non_external_H_ + +#include +#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_lcs_client_non_external_s OpenAPI_lcs_client_non_external_t; +typedef struct OpenAPI_lcs_client_non_external_s { + char *lcs_client_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_lcs_client_non_external_t; + +OpenAPI_lcs_client_non_external_t *OpenAPI_lcs_client_non_external_create( + char *lcs_client_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_lcs_client_non_external_free(OpenAPI_lcs_client_non_external_t *lcs_client_non_external); +OpenAPI_lcs_client_non_external_t *OpenAPI_lcs_client_non_external_parseFromJSON(cJSON *lcs_client_non_externalJSON); +cJSON *OpenAPI_lcs_client_non_external_convertToJSON(OpenAPI_lcs_client_non_external_t *lcs_client_non_external); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_lcs_client_non_external_H_ */ + diff --git a/lib/sbi/openapi/model/lcs_mo_data.c b/lib/sbi/openapi/model/lcs_mo_data.c new file mode 100644 index 0000000000..b584efe362 --- /dev/null +++ b/lib/sbi/openapi/model/lcs_mo_data.c @@ -0,0 +1,97 @@ + +#include +#include +#include +#include "lcs_mo_data.h" + +OpenAPI_lcs_mo_data_t *OpenAPI_lcs_mo_data_create( + OpenAPI_list_t *allowed_service_classes + ) +{ + OpenAPI_lcs_mo_data_t *lcs_mo_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_lcs_mo_data_t)); + if (!lcs_mo_data_local_var) { + return NULL; + } + lcs_mo_data_local_var->allowed_service_classes = allowed_service_classes; + + return lcs_mo_data_local_var; +} + +void OpenAPI_lcs_mo_data_free(OpenAPI_lcs_mo_data_t *lcs_mo_data) +{ + if (NULL == lcs_mo_data) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_free(lcs_mo_data->allowed_service_classes); + ogs_free(lcs_mo_data); +} + +cJSON *OpenAPI_lcs_mo_data_convertToJSON(OpenAPI_lcs_mo_data_t *lcs_mo_data) +{ + cJSON *item = NULL; + + if (lcs_mo_data == NULL) { + ogs_error("OpenAPI_lcs_mo_data_convertToJSON() failed [LcsMoData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!lcs_mo_data->allowed_service_classes) { + ogs_error("OpenAPI_lcs_mo_data_convertToJSON() failed [allowed_service_classes]"); + goto end; + } + cJSON *allowed_service_classes = cJSON_AddArrayToObject(item, "allowedServiceClasses"); + if (allowed_service_classes == NULL) { + ogs_error("OpenAPI_lcs_mo_data_convertToJSON() failed [allowed_service_classes]"); + goto end; + } + OpenAPI_lnode_t *allowed_service_classes_node; + OpenAPI_list_for_each(lcs_mo_data->allowed_service_classes, allowed_service_classes_node) { + if (cJSON_AddStringToObject(allowed_service_classes, "", OpenAPI_lcs_mo_service_class_ToString((OpenAPI_lcs_mo_service_class_e)allowed_service_classes_node->data)) == NULL) { + ogs_error("OpenAPI_lcs_mo_data_convertToJSON() failed [allowed_service_classes]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_lcs_mo_data_t *OpenAPI_lcs_mo_data_parseFromJSON(cJSON *lcs_mo_dataJSON) +{ + OpenAPI_lcs_mo_data_t *lcs_mo_data_local_var = NULL; + cJSON *allowed_service_classes = cJSON_GetObjectItemCaseSensitive(lcs_mo_dataJSON, "allowedServiceClasses"); + if (!allowed_service_classes) { + ogs_error("OpenAPI_lcs_mo_data_parseFromJSON() failed [allowed_service_classes]"); + goto end; + } + + OpenAPI_list_t *allowed_service_classesList; + + cJSON *allowed_service_classes_local_nonprimitive; + if (!cJSON_IsArray(allowed_service_classes)) { + ogs_error("OpenAPI_lcs_mo_data_parseFromJSON() failed [allowed_service_classes]"); + goto end; + } + + allowed_service_classesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_service_classes_local_nonprimitive, allowed_service_classes ) { + if (!cJSON_IsString(allowed_service_classes_local_nonprimitive)) { + ogs_error("OpenAPI_lcs_mo_data_parseFromJSON() failed [allowed_service_classes]"); + goto end; + } + + OpenAPI_list_add(allowed_service_classesList, (void *)OpenAPI_lcs_mo_service_class_FromString(allowed_service_classes_local_nonprimitive->valuestring)); + } + + lcs_mo_data_local_var = OpenAPI_lcs_mo_data_create ( + allowed_service_classesList + ); + + return lcs_mo_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/lcs_mo_data.h b/lib/sbi/openapi/model/lcs_mo_data.h new file mode 100644 index 0000000000..ce286b6ae9 --- /dev/null +++ b/lib/sbi/openapi/model/lcs_mo_data.h @@ -0,0 +1,38 @@ +/* + * lcs_mo_data.h + * + * + */ + +#ifndef _OpenAPI_lcs_mo_data_H_ +#define _OpenAPI_lcs_mo_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "lcs_mo_service_class.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_lcs_mo_data_s OpenAPI_lcs_mo_data_t; +typedef struct OpenAPI_lcs_mo_data_s { + OpenAPI_list_t *allowed_service_classes; +} OpenAPI_lcs_mo_data_t; + +OpenAPI_lcs_mo_data_t *OpenAPI_lcs_mo_data_create( + OpenAPI_list_t *allowed_service_classes + ); +void OpenAPI_lcs_mo_data_free(OpenAPI_lcs_mo_data_t *lcs_mo_data); +OpenAPI_lcs_mo_data_t *OpenAPI_lcs_mo_data_parseFromJSON(cJSON *lcs_mo_dataJSON); +cJSON *OpenAPI_lcs_mo_data_convertToJSON(OpenAPI_lcs_mo_data_t *lcs_mo_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_lcs_mo_data_H_ */ + diff --git a/lib/sbi/openapi/model/lcs_mo_service_class.c b/lib/sbi/openapi/model/lcs_mo_service_class.c new file mode 100644 index 0000000000..64f66297c3 --- /dev/null +++ b/lib/sbi/openapi/model/lcs_mo_service_class.c @@ -0,0 +1,30 @@ + +#include +#include +#include +#include "lcs_mo_service_class.h" + +char* OpenAPI_lcs_mo_service_class_ToString(OpenAPI_lcs_mo_service_class_e lcs_mo_service_class) +{ + const char *lcs_mo_service_classArray[] = { "NULL", "BASIC_SELF_LOCATION", "AUTONOMOUS_SELF_LOCATION", "TRANSFER_TO_THIRD_PARTY" }; + size_t sizeofArray = sizeof(lcs_mo_service_classArray) / sizeof(lcs_mo_service_classArray[0]); + if (lcs_mo_service_class < sizeofArray) + return (char *)lcs_mo_service_classArray[lcs_mo_service_class]; + else + return (char *)"Unknown"; +} + +OpenAPI_lcs_mo_service_class_e OpenAPI_lcs_mo_service_class_FromString(char* lcs_mo_service_class) +{ + int stringToReturn = 0; + const char *lcs_mo_service_classArray[] = { "NULL", "BASIC_SELF_LOCATION", "AUTONOMOUS_SELF_LOCATION", "TRANSFER_TO_THIRD_PARTY" }; + size_t sizeofArray = sizeof(lcs_mo_service_classArray) / sizeof(lcs_mo_service_classArray[0]); + while (stringToReturn < sizeofArray) { + if (strcmp(lcs_mo_service_class, lcs_mo_service_classArray[stringToReturn]) == 0) { + return stringToReturn; + } + stringToReturn++; + } + return 0; +} + diff --git a/lib/sbi/openapi/model/lcs_mo_service_class.h b/lib/sbi/openapi/model/lcs_mo_service_class.h new file mode 100644 index 0000000000..3241dc60f8 --- /dev/null +++ b/lib/sbi/openapi/model/lcs_mo_service_class.h @@ -0,0 +1,31 @@ +/* + * lcs_mo_service_class.h + * + * + */ + +#ifndef _OpenAPI_lcs_mo_service_class_H_ +#define _OpenAPI_lcs_mo_service_class_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { OpenAPI_lcs_mo_service_class_NULL = 0, OpenAPI_lcs_mo_service_class_BASIC_SELF_LOCATION, OpenAPI_lcs_mo_service_class_AUTONOMOUS_SELF_LOCATION, OpenAPI_lcs_mo_service_class_TRANSFER_TO_THIRD_PARTY } OpenAPI_lcs_mo_service_class_e; + +char* OpenAPI_lcs_mo_service_class_ToString(OpenAPI_lcs_mo_service_class_e lcs_mo_service_class); + +OpenAPI_lcs_mo_service_class_e OpenAPI_lcs_mo_service_class_FromString(char* lcs_mo_service_class); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_lcs_mo_service_class_H_ */ + diff --git a/lib/sbi/openapi/model/lcs_privacy.c b/lib/sbi/openapi/model/lcs_privacy.c new file mode 100644 index 0000000000..661ee802a9 --- /dev/null +++ b/lib/sbi/openapi/model/lcs_privacy.c @@ -0,0 +1,114 @@ + +#include +#include +#include +#include "lcs_privacy.h" + +OpenAPI_lcs_privacy_t *OpenAPI_lcs_privacy_create( + char *af_instance_id, + int reference_id, + OpenAPI_lpi_t *lpi + ) +{ + OpenAPI_lcs_privacy_t *lcs_privacy_local_var = OpenAPI_malloc(sizeof(OpenAPI_lcs_privacy_t)); + if (!lcs_privacy_local_var) { + return NULL; + } + lcs_privacy_local_var->af_instance_id = af_instance_id; + lcs_privacy_local_var->reference_id = reference_id; + lcs_privacy_local_var->lpi = lpi; + + return lcs_privacy_local_var; +} + +void OpenAPI_lcs_privacy_free(OpenAPI_lcs_privacy_t *lcs_privacy) +{ + if (NULL == lcs_privacy) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(lcs_privacy->af_instance_id); + OpenAPI_lpi_free(lcs_privacy->lpi); + ogs_free(lcs_privacy); +} + +cJSON *OpenAPI_lcs_privacy_convertToJSON(OpenAPI_lcs_privacy_t *lcs_privacy) +{ + cJSON *item = NULL; + + if (lcs_privacy == NULL) { + ogs_error("OpenAPI_lcs_privacy_convertToJSON() failed [LcsPrivacy]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (lcs_privacy->af_instance_id) { + if (cJSON_AddStringToObject(item, "afInstanceId", lcs_privacy->af_instance_id) == NULL) { + ogs_error("OpenAPI_lcs_privacy_convertToJSON() failed [af_instance_id]"); + goto end; + } + } + + if (lcs_privacy->reference_id) { + if (cJSON_AddNumberToObject(item, "referenceId", lcs_privacy->reference_id) == NULL) { + ogs_error("OpenAPI_lcs_privacy_convertToJSON() failed [reference_id]"); + goto end; + } + } + + if (lcs_privacy->lpi) { + cJSON *lpi_local_JSON = OpenAPI_lpi_convertToJSON(lcs_privacy->lpi); + if (lpi_local_JSON == NULL) { + ogs_error("OpenAPI_lcs_privacy_convertToJSON() failed [lpi]"); + goto end; + } + cJSON_AddItemToObject(item, "lpi", lpi_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_lcs_privacy_convertToJSON() failed [lpi]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_lcs_privacy_t *OpenAPI_lcs_privacy_parseFromJSON(cJSON *lcs_privacyJSON) +{ + OpenAPI_lcs_privacy_t *lcs_privacy_local_var = NULL; + cJSON *af_instance_id = cJSON_GetObjectItemCaseSensitive(lcs_privacyJSON, "afInstanceId"); + + if (af_instance_id) { + if (!cJSON_IsString(af_instance_id)) { + ogs_error("OpenAPI_lcs_privacy_parseFromJSON() failed [af_instance_id]"); + goto end; + } + } + + cJSON *reference_id = cJSON_GetObjectItemCaseSensitive(lcs_privacyJSON, "referenceId"); + + if (reference_id) { + if (!cJSON_IsNumber(reference_id)) { + ogs_error("OpenAPI_lcs_privacy_parseFromJSON() failed [reference_id]"); + goto end; + } + } + + cJSON *lpi = cJSON_GetObjectItemCaseSensitive(lcs_privacyJSON, "lpi"); + + OpenAPI_lpi_t *lpi_local_nonprim = NULL; + if (lpi) { + lpi_local_nonprim = OpenAPI_lpi_parseFromJSON(lpi); + } + + lcs_privacy_local_var = OpenAPI_lcs_privacy_create ( + af_instance_id ? ogs_strdup(af_instance_id->valuestring) : NULL, + reference_id ? reference_id->valuedouble : 0, + lpi ? lpi_local_nonprim : NULL + ); + + return lcs_privacy_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/lcs_privacy.h b/lib/sbi/openapi/model/lcs_privacy.h new file mode 100644 index 0000000000..9ae3709256 --- /dev/null +++ b/lib/sbi/openapi/model/lcs_privacy.h @@ -0,0 +1,42 @@ +/* + * lcs_privacy.h + * + * + */ + +#ifndef _OpenAPI_lcs_privacy_H_ +#define _OpenAPI_lcs_privacy_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "lpi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_lcs_privacy_s OpenAPI_lcs_privacy_t; +typedef struct OpenAPI_lcs_privacy_s { + char *af_instance_id; + int reference_id; + struct OpenAPI_lpi_s *lpi; +} OpenAPI_lcs_privacy_t; + +OpenAPI_lcs_privacy_t *OpenAPI_lcs_privacy_create( + char *af_instance_id, + int reference_id, + OpenAPI_lpi_t *lpi + ); +void OpenAPI_lcs_privacy_free(OpenAPI_lcs_privacy_t *lcs_privacy); +OpenAPI_lcs_privacy_t *OpenAPI_lcs_privacy_parseFromJSON(cJSON *lcs_privacyJSON); +cJSON *OpenAPI_lcs_privacy_convertToJSON(OpenAPI_lcs_privacy_t *lcs_privacy); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_lcs_privacy_H_ */ + diff --git a/lib/sbi/openapi/model/lcs_privacy_data.c b/lib/sbi/openapi/model/lcs_privacy_data.c new file mode 100644 index 0000000000..a5df55c573 --- /dev/null +++ b/lib/sbi/openapi/model/lcs_privacy_data.c @@ -0,0 +1,175 @@ + +#include +#include +#include +#include "lcs_privacy_data.h" + +OpenAPI_lcs_privacy_data_t *OpenAPI_lcs_privacy_data_create( + OpenAPI_lpi_t *lpi, + OpenAPI_list_t *unrelated_classes, + OpenAPI_list_t *plmn_operator_classes + ) +{ + OpenAPI_lcs_privacy_data_t *lcs_privacy_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_lcs_privacy_data_t)); + if (!lcs_privacy_data_local_var) { + return NULL; + } + lcs_privacy_data_local_var->lpi = lpi; + lcs_privacy_data_local_var->unrelated_classes = unrelated_classes; + lcs_privacy_data_local_var->plmn_operator_classes = plmn_operator_classes; + + return lcs_privacy_data_local_var; +} + +void OpenAPI_lcs_privacy_data_free(OpenAPI_lcs_privacy_data_t *lcs_privacy_data) +{ + if (NULL == lcs_privacy_data) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_lpi_free(lcs_privacy_data->lpi); + OpenAPI_list_for_each(lcs_privacy_data->unrelated_classes, node) { + OpenAPI_unrelated_class_free(node->data); + } + OpenAPI_list_free(lcs_privacy_data->unrelated_classes); + OpenAPI_list_for_each(lcs_privacy_data->plmn_operator_classes, node) { + OpenAPI_plmn_operator_class_free(node->data); + } + OpenAPI_list_free(lcs_privacy_data->plmn_operator_classes); + ogs_free(lcs_privacy_data); +} + +cJSON *OpenAPI_lcs_privacy_data_convertToJSON(OpenAPI_lcs_privacy_data_t *lcs_privacy_data) +{ + cJSON *item = NULL; + + if (lcs_privacy_data == NULL) { + ogs_error("OpenAPI_lcs_privacy_data_convertToJSON() failed [LcsPrivacyData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (lcs_privacy_data->lpi) { + cJSON *lpi_local_JSON = OpenAPI_lpi_convertToJSON(lcs_privacy_data->lpi); + if (lpi_local_JSON == NULL) { + ogs_error("OpenAPI_lcs_privacy_data_convertToJSON() failed [lpi]"); + goto end; + } + cJSON_AddItemToObject(item, "lpi", lpi_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_lcs_privacy_data_convertToJSON() failed [lpi]"); + goto end; + } + } + + if (lcs_privacy_data->unrelated_classes) { + cJSON *unrelated_classesList = cJSON_AddArrayToObject(item, "unrelatedClasses"); + if (unrelated_classesList == NULL) { + ogs_error("OpenAPI_lcs_privacy_data_convertToJSON() failed [unrelated_classes]"); + goto end; + } + + OpenAPI_lnode_t *unrelated_classes_node; + if (lcs_privacy_data->unrelated_classes) { + OpenAPI_list_for_each(lcs_privacy_data->unrelated_classes, unrelated_classes_node) { + cJSON *itemLocal = OpenAPI_unrelated_class_convertToJSON(unrelated_classes_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_lcs_privacy_data_convertToJSON() failed [unrelated_classes]"); + goto end; + } + cJSON_AddItemToArray(unrelated_classesList, itemLocal); + } + } + } + + if (lcs_privacy_data->plmn_operator_classes) { + cJSON *plmn_operator_classesList = cJSON_AddArrayToObject(item, "plmnOperatorClasses"); + if (plmn_operator_classesList == NULL) { + ogs_error("OpenAPI_lcs_privacy_data_convertToJSON() failed [plmn_operator_classes]"); + goto end; + } + + OpenAPI_lnode_t *plmn_operator_classes_node; + if (lcs_privacy_data->plmn_operator_classes) { + OpenAPI_list_for_each(lcs_privacy_data->plmn_operator_classes, plmn_operator_classes_node) { + cJSON *itemLocal = OpenAPI_plmn_operator_class_convertToJSON(plmn_operator_classes_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_lcs_privacy_data_convertToJSON() failed [plmn_operator_classes]"); + goto end; + } + cJSON_AddItemToArray(plmn_operator_classesList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_lcs_privacy_data_t *OpenAPI_lcs_privacy_data_parseFromJSON(cJSON *lcs_privacy_dataJSON) +{ + OpenAPI_lcs_privacy_data_t *lcs_privacy_data_local_var = NULL; + cJSON *lpi = cJSON_GetObjectItemCaseSensitive(lcs_privacy_dataJSON, "lpi"); + + OpenAPI_lpi_t *lpi_local_nonprim = NULL; + if (lpi) { + lpi_local_nonprim = OpenAPI_lpi_parseFromJSON(lpi); + } + + cJSON *unrelated_classes = cJSON_GetObjectItemCaseSensitive(lcs_privacy_dataJSON, "unrelatedClasses"); + + OpenAPI_list_t *unrelated_classesList; + if (unrelated_classes) { + cJSON *unrelated_classes_local_nonprimitive; + if (!cJSON_IsArray(unrelated_classes)) { + ogs_error("OpenAPI_lcs_privacy_data_parseFromJSON() failed [unrelated_classes]"); + goto end; + } + + unrelated_classesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(unrelated_classes_local_nonprimitive, unrelated_classes ) { + if (!cJSON_IsObject(unrelated_classes_local_nonprimitive)) { + ogs_error("OpenAPI_lcs_privacy_data_parseFromJSON() failed [unrelated_classes]"); + goto end; + } + OpenAPI_unrelated_class_t *unrelated_classesItem = OpenAPI_unrelated_class_parseFromJSON(unrelated_classes_local_nonprimitive); + + OpenAPI_list_add(unrelated_classesList, unrelated_classesItem); + } + } + + cJSON *plmn_operator_classes = cJSON_GetObjectItemCaseSensitive(lcs_privacy_dataJSON, "plmnOperatorClasses"); + + OpenAPI_list_t *plmn_operator_classesList; + if (plmn_operator_classes) { + cJSON *plmn_operator_classes_local_nonprimitive; + if (!cJSON_IsArray(plmn_operator_classes)) { + ogs_error("OpenAPI_lcs_privacy_data_parseFromJSON() failed [plmn_operator_classes]"); + goto end; + } + + plmn_operator_classesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(plmn_operator_classes_local_nonprimitive, plmn_operator_classes ) { + if (!cJSON_IsObject(plmn_operator_classes_local_nonprimitive)) { + ogs_error("OpenAPI_lcs_privacy_data_parseFromJSON() failed [plmn_operator_classes]"); + goto end; + } + OpenAPI_plmn_operator_class_t *plmn_operator_classesItem = OpenAPI_plmn_operator_class_parseFromJSON(plmn_operator_classes_local_nonprimitive); + + OpenAPI_list_add(plmn_operator_classesList, plmn_operator_classesItem); + } + } + + lcs_privacy_data_local_var = OpenAPI_lcs_privacy_data_create ( + lpi ? lpi_local_nonprim : NULL, + unrelated_classes ? unrelated_classesList : NULL, + plmn_operator_classes ? plmn_operator_classesList : NULL + ); + + return lcs_privacy_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/lcs_privacy_data.h b/lib/sbi/openapi/model/lcs_privacy_data.h new file mode 100644 index 0000000000..5b9c678b33 --- /dev/null +++ b/lib/sbi/openapi/model/lcs_privacy_data.h @@ -0,0 +1,44 @@ +/* + * lcs_privacy_data.h + * + * + */ + +#ifndef _OpenAPI_lcs_privacy_data_H_ +#define _OpenAPI_lcs_privacy_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "lpi.h" +#include "plmn_operator_class.h" +#include "unrelated_class.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_lcs_privacy_data_s OpenAPI_lcs_privacy_data_t; +typedef struct OpenAPI_lcs_privacy_data_s { + struct OpenAPI_lpi_s *lpi; + OpenAPI_list_t *unrelated_classes; + OpenAPI_list_t *plmn_operator_classes; +} OpenAPI_lcs_privacy_data_t; + +OpenAPI_lcs_privacy_data_t *OpenAPI_lcs_privacy_data_create( + OpenAPI_lpi_t *lpi, + OpenAPI_list_t *unrelated_classes, + OpenAPI_list_t *plmn_operator_classes + ); +void OpenAPI_lcs_privacy_data_free(OpenAPI_lcs_privacy_data_t *lcs_privacy_data); +OpenAPI_lcs_privacy_data_t *OpenAPI_lcs_privacy_data_parseFromJSON(cJSON *lcs_privacy_dataJSON); +cJSON *OpenAPI_lcs_privacy_data_convertToJSON(OpenAPI_lcs_privacy_data_t *lcs_privacy_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_lcs_privacy_data_H_ */ + diff --git a/lib/sbi/openapi/model/limit_id_to_monitoring_key.c b/lib/sbi/openapi/model/limit_id_to_monitoring_key.c new file mode 100644 index 0000000000..c36b578c20 --- /dev/null +++ b/lib/sbi/openapi/model/limit_id_to_monitoring_key.c @@ -0,0 +1,119 @@ + +#include +#include +#include +#include "limit_id_to_monitoring_key.h" + +OpenAPI_limit_id_to_monitoring_key_t *OpenAPI_limit_id_to_monitoring_key_create( + char *limit_id, + OpenAPI_list_t *monkey + ) +{ + OpenAPI_limit_id_to_monitoring_key_t *limit_id_to_monitoring_key_local_var = OpenAPI_malloc(sizeof(OpenAPI_limit_id_to_monitoring_key_t)); + if (!limit_id_to_monitoring_key_local_var) { + return NULL; + } + limit_id_to_monitoring_key_local_var->limit_id = limit_id; + limit_id_to_monitoring_key_local_var->monkey = monkey; + + return limit_id_to_monitoring_key_local_var; +} + +void OpenAPI_limit_id_to_monitoring_key_free(OpenAPI_limit_id_to_monitoring_key_t *limit_id_to_monitoring_key) +{ + if (NULL == limit_id_to_monitoring_key) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(limit_id_to_monitoring_key->limit_id); + OpenAPI_list_for_each(limit_id_to_monitoring_key->monkey, node) { + ogs_free(node->data); + } + OpenAPI_list_free(limit_id_to_monitoring_key->monkey); + ogs_free(limit_id_to_monitoring_key); +} + +cJSON *OpenAPI_limit_id_to_monitoring_key_convertToJSON(OpenAPI_limit_id_to_monitoring_key_t *limit_id_to_monitoring_key) +{ + cJSON *item = NULL; + + if (limit_id_to_monitoring_key == NULL) { + ogs_error("OpenAPI_limit_id_to_monitoring_key_convertToJSON() failed [LimitIdToMonitoringKey]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!limit_id_to_monitoring_key->limit_id) { + ogs_error("OpenAPI_limit_id_to_monitoring_key_convertToJSON() failed [limit_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "limitId", limit_id_to_monitoring_key->limit_id) == NULL) { + ogs_error("OpenAPI_limit_id_to_monitoring_key_convertToJSON() failed [limit_id]"); + goto end; + } + + if (limit_id_to_monitoring_key->monkey) { + cJSON *monkey = cJSON_AddArrayToObject(item, "monkey"); + if (monkey == NULL) { + ogs_error("OpenAPI_limit_id_to_monitoring_key_convertToJSON() failed [monkey]"); + goto end; + } + + OpenAPI_lnode_t *monkey_node; + OpenAPI_list_for_each(limit_id_to_monitoring_key->monkey, monkey_node) { + if (cJSON_AddStringToObject(monkey, "", (char*)monkey_node->data) == NULL) { + ogs_error("OpenAPI_limit_id_to_monitoring_key_convertToJSON() failed [monkey]"); + goto end; + } + } + } + +end: + return item; +} + +OpenAPI_limit_id_to_monitoring_key_t *OpenAPI_limit_id_to_monitoring_key_parseFromJSON(cJSON *limit_id_to_monitoring_keyJSON) +{ + OpenAPI_limit_id_to_monitoring_key_t *limit_id_to_monitoring_key_local_var = NULL; + cJSON *limit_id = cJSON_GetObjectItemCaseSensitive(limit_id_to_monitoring_keyJSON, "limitId"); + if (!limit_id) { + ogs_error("OpenAPI_limit_id_to_monitoring_key_parseFromJSON() failed [limit_id]"); + goto end; + } + + + if (!cJSON_IsString(limit_id)) { + ogs_error("OpenAPI_limit_id_to_monitoring_key_parseFromJSON() failed [limit_id]"); + goto end; + } + + cJSON *monkey = cJSON_GetObjectItemCaseSensitive(limit_id_to_monitoring_keyJSON, "monkey"); + + OpenAPI_list_t *monkeyList; + if (monkey) { + cJSON *monkey_local; + if (!cJSON_IsArray(monkey)) { + ogs_error("OpenAPI_limit_id_to_monitoring_key_parseFromJSON() failed [monkey]"); + goto end; + } + monkeyList = OpenAPI_list_create(); + + cJSON_ArrayForEach(monkey_local, monkey) { + if (!cJSON_IsString(monkey_local)) { + ogs_error("OpenAPI_limit_id_to_monitoring_key_parseFromJSON() failed [monkey]"); + goto end; + } + OpenAPI_list_add(monkeyList, ogs_strdup(monkey_local->valuestring)); + } + } + + limit_id_to_monitoring_key_local_var = OpenAPI_limit_id_to_monitoring_key_create ( + ogs_strdup(limit_id->valuestring), + monkey ? monkeyList : NULL + ); + + return limit_id_to_monitoring_key_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/limit_id_to_monitoring_key.h b/lib/sbi/openapi/model/limit_id_to_monitoring_key.h new file mode 100644 index 0000000000..09057a9899 --- /dev/null +++ b/lib/sbi/openapi/model/limit_id_to_monitoring_key.h @@ -0,0 +1,39 @@ +/* + * limit_id_to_monitoring_key.h + * + * Contains the limit identifier and the corresponding monitoring key for a given S-NSSAI and DNN. + */ + +#ifndef _OpenAPI_limit_id_to_monitoring_key_H_ +#define _OpenAPI_limit_id_to_monitoring_key_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_limit_id_to_monitoring_key_s OpenAPI_limit_id_to_monitoring_key_t; +typedef struct OpenAPI_limit_id_to_monitoring_key_s { + char *limit_id; + OpenAPI_list_t *monkey; +} OpenAPI_limit_id_to_monitoring_key_t; + +OpenAPI_limit_id_to_monitoring_key_t *OpenAPI_limit_id_to_monitoring_key_create( + char *limit_id, + OpenAPI_list_t *monkey + ); +void OpenAPI_limit_id_to_monitoring_key_free(OpenAPI_limit_id_to_monitoring_key_t *limit_id_to_monitoring_key); +OpenAPI_limit_id_to_monitoring_key_t *OpenAPI_limit_id_to_monitoring_key_parseFromJSON(cJSON *limit_id_to_monitoring_keyJSON); +cJSON *OpenAPI_limit_id_to_monitoring_key_convertToJSON(OpenAPI_limit_id_to_monitoring_key_t *limit_id_to_monitoring_key); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_limit_id_to_monitoring_key_H_ */ + diff --git a/lib/sbi/openapi/model/lmf_info.c b/lib/sbi/openapi/model/lmf_info.c new file mode 100644 index 0000000000..0da10a5c82 --- /dev/null +++ b/lib/sbi/openapi/model/lmf_info.c @@ -0,0 +1,262 @@ + +#include +#include +#include +#include "lmf_info.h" + +OpenAPI_lmf_info_t *OpenAPI_lmf_info_create( + OpenAPI_list_t *serving_client_types, + char *lmf_id, + OpenAPI_list_t *serving_access_types, + OpenAPI_list_t *serving_an_node_types, + OpenAPI_list_t *serving_rat_types + ) +{ + OpenAPI_lmf_info_t *lmf_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_lmf_info_t)); + if (!lmf_info_local_var) { + return NULL; + } + lmf_info_local_var->serving_client_types = serving_client_types; + lmf_info_local_var->lmf_id = lmf_id; + lmf_info_local_var->serving_access_types = serving_access_types; + lmf_info_local_var->serving_an_node_types = serving_an_node_types; + lmf_info_local_var->serving_rat_types = serving_rat_types; + + return lmf_info_local_var; +} + +void OpenAPI_lmf_info_free(OpenAPI_lmf_info_t *lmf_info) +{ + if (NULL == lmf_info) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(lmf_info->serving_client_types, node) { + OpenAPI_external_client_type_free(node->data); + } + OpenAPI_list_free(lmf_info->serving_client_types); + ogs_free(lmf_info->lmf_id); + OpenAPI_list_free(lmf_info->serving_access_types); + OpenAPI_list_for_each(lmf_info->serving_an_node_types, node) { + OpenAPI_an_node_type_free(node->data); + } + OpenAPI_list_free(lmf_info->serving_an_node_types); + OpenAPI_list_for_each(lmf_info->serving_rat_types, node) { + OpenAPI_rat_type_free(node->data); + } + OpenAPI_list_free(lmf_info->serving_rat_types); + ogs_free(lmf_info); +} + +cJSON *OpenAPI_lmf_info_convertToJSON(OpenAPI_lmf_info_t *lmf_info) +{ + cJSON *item = NULL; + + if (lmf_info == NULL) { + ogs_error("OpenAPI_lmf_info_convertToJSON() failed [LmfInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (lmf_info->serving_client_types) { + cJSON *serving_client_typesList = cJSON_AddArrayToObject(item, "servingClientTypes"); + if (serving_client_typesList == NULL) { + ogs_error("OpenAPI_lmf_info_convertToJSON() failed [serving_client_types]"); + goto end; + } + + OpenAPI_lnode_t *serving_client_types_node; + if (lmf_info->serving_client_types) { + OpenAPI_list_for_each(lmf_info->serving_client_types, serving_client_types_node) { + cJSON *itemLocal = OpenAPI_external_client_type_convertToJSON(serving_client_types_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_lmf_info_convertToJSON() failed [serving_client_types]"); + goto end; + } + cJSON_AddItemToArray(serving_client_typesList, itemLocal); + } + } + } + + if (lmf_info->lmf_id) { + if (cJSON_AddStringToObject(item, "lmfId", lmf_info->lmf_id) == NULL) { + ogs_error("OpenAPI_lmf_info_convertToJSON() failed [lmf_id]"); + goto end; + } + } + + if (lmf_info->serving_access_types) { + cJSON *serving_access_types = cJSON_AddArrayToObject(item, "servingAccessTypes"); + if (serving_access_types == NULL) { + ogs_error("OpenAPI_lmf_info_convertToJSON() failed [serving_access_types]"); + goto end; + } + OpenAPI_lnode_t *serving_access_types_node; + OpenAPI_list_for_each(lmf_info->serving_access_types, serving_access_types_node) { + if (cJSON_AddStringToObject(serving_access_types, "", OpenAPI_access_type_ToString((OpenAPI_access_type_e)serving_access_types_node->data)) == NULL) { + ogs_error("OpenAPI_lmf_info_convertToJSON() failed [serving_access_types]"); + goto end; + } + } + } + + if (lmf_info->serving_an_node_types) { + cJSON *serving_an_node_typesList = cJSON_AddArrayToObject(item, "servingAnNodeTypes"); + if (serving_an_node_typesList == NULL) { + ogs_error("OpenAPI_lmf_info_convertToJSON() failed [serving_an_node_types]"); + goto end; + } + + OpenAPI_lnode_t *serving_an_node_types_node; + if (lmf_info->serving_an_node_types) { + OpenAPI_list_for_each(lmf_info->serving_an_node_types, serving_an_node_types_node) { + cJSON *itemLocal = OpenAPI_an_node_type_convertToJSON(serving_an_node_types_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_lmf_info_convertToJSON() failed [serving_an_node_types]"); + goto end; + } + cJSON_AddItemToArray(serving_an_node_typesList, itemLocal); + } + } + } + + if (lmf_info->serving_rat_types) { + cJSON *serving_rat_typesList = cJSON_AddArrayToObject(item, "servingRatTypes"); + if (serving_rat_typesList == NULL) { + ogs_error("OpenAPI_lmf_info_convertToJSON() failed [serving_rat_types]"); + goto end; + } + + OpenAPI_lnode_t *serving_rat_types_node; + if (lmf_info->serving_rat_types) { + OpenAPI_list_for_each(lmf_info->serving_rat_types, serving_rat_types_node) { + cJSON *itemLocal = OpenAPI_rat_type_convertToJSON(serving_rat_types_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_lmf_info_convertToJSON() failed [serving_rat_types]"); + goto end; + } + cJSON_AddItemToArray(serving_rat_typesList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_lmf_info_t *OpenAPI_lmf_info_parseFromJSON(cJSON *lmf_infoJSON) +{ + OpenAPI_lmf_info_t *lmf_info_local_var = NULL; + cJSON *serving_client_types = cJSON_GetObjectItemCaseSensitive(lmf_infoJSON, "servingClientTypes"); + + OpenAPI_list_t *serving_client_typesList; + if (serving_client_types) { + cJSON *serving_client_types_local_nonprimitive; + if (!cJSON_IsArray(serving_client_types)) { + ogs_error("OpenAPI_lmf_info_parseFromJSON() failed [serving_client_types]"); + goto end; + } + + serving_client_typesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(serving_client_types_local_nonprimitive, serving_client_types ) { + if (!cJSON_IsObject(serving_client_types_local_nonprimitive)) { + ogs_error("OpenAPI_lmf_info_parseFromJSON() failed [serving_client_types]"); + goto end; + } + OpenAPI_external_client_type_t *serving_client_typesItem = OpenAPI_external_client_type_parseFromJSON(serving_client_types_local_nonprimitive); + + OpenAPI_list_add(serving_client_typesList, serving_client_typesItem); + } + } + + cJSON *lmf_id = cJSON_GetObjectItemCaseSensitive(lmf_infoJSON, "lmfId"); + + if (lmf_id) { + if (!cJSON_IsString(lmf_id)) { + ogs_error("OpenAPI_lmf_info_parseFromJSON() failed [lmf_id]"); + goto end; + } + } + + cJSON *serving_access_types = cJSON_GetObjectItemCaseSensitive(lmf_infoJSON, "servingAccessTypes"); + + OpenAPI_list_t *serving_access_typesList; + if (serving_access_types) { + cJSON *serving_access_types_local_nonprimitive; + if (!cJSON_IsArray(serving_access_types)) { + ogs_error("OpenAPI_lmf_info_parseFromJSON() failed [serving_access_types]"); + goto end; + } + + serving_access_typesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(serving_access_types_local_nonprimitive, serving_access_types ) { + if (!cJSON_IsString(serving_access_types_local_nonprimitive)) { + ogs_error("OpenAPI_lmf_info_parseFromJSON() failed [serving_access_types]"); + goto end; + } + + OpenAPI_list_add(serving_access_typesList, (void *)OpenAPI_access_type_FromString(serving_access_types_local_nonprimitive->valuestring)); + } + } + + cJSON *serving_an_node_types = cJSON_GetObjectItemCaseSensitive(lmf_infoJSON, "servingAnNodeTypes"); + + OpenAPI_list_t *serving_an_node_typesList; + if (serving_an_node_types) { + cJSON *serving_an_node_types_local_nonprimitive; + if (!cJSON_IsArray(serving_an_node_types)) { + ogs_error("OpenAPI_lmf_info_parseFromJSON() failed [serving_an_node_types]"); + goto end; + } + + serving_an_node_typesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(serving_an_node_types_local_nonprimitive, serving_an_node_types ) { + if (!cJSON_IsObject(serving_an_node_types_local_nonprimitive)) { + ogs_error("OpenAPI_lmf_info_parseFromJSON() failed [serving_an_node_types]"); + goto end; + } + OpenAPI_an_node_type_t *serving_an_node_typesItem = OpenAPI_an_node_type_parseFromJSON(serving_an_node_types_local_nonprimitive); + + OpenAPI_list_add(serving_an_node_typesList, serving_an_node_typesItem); + } + } + + cJSON *serving_rat_types = cJSON_GetObjectItemCaseSensitive(lmf_infoJSON, "servingRatTypes"); + + OpenAPI_list_t *serving_rat_typesList; + if (serving_rat_types) { + cJSON *serving_rat_types_local_nonprimitive; + if (!cJSON_IsArray(serving_rat_types)) { + ogs_error("OpenAPI_lmf_info_parseFromJSON() failed [serving_rat_types]"); + goto end; + } + + serving_rat_typesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(serving_rat_types_local_nonprimitive, serving_rat_types ) { + if (!cJSON_IsObject(serving_rat_types_local_nonprimitive)) { + ogs_error("OpenAPI_lmf_info_parseFromJSON() failed [serving_rat_types]"); + goto end; + } + OpenAPI_rat_type_t *serving_rat_typesItem = OpenAPI_rat_type_parseFromJSON(serving_rat_types_local_nonprimitive); + + OpenAPI_list_add(serving_rat_typesList, serving_rat_typesItem); + } + } + + lmf_info_local_var = OpenAPI_lmf_info_create ( + serving_client_types ? serving_client_typesList : NULL, + lmf_id ? ogs_strdup(lmf_id->valuestring) : NULL, + serving_access_types ? serving_access_typesList : NULL, + serving_an_node_types ? serving_an_node_typesList : NULL, + serving_rat_types ? serving_rat_typesList : NULL + ); + + return lmf_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/lmf_info.h b/lib/sbi/openapi/model/lmf_info.h new file mode 100644 index 0000000000..13d979c55f --- /dev/null +++ b/lib/sbi/openapi/model/lmf_info.h @@ -0,0 +1,49 @@ +/* + * lmf_info.h + * + * + */ + +#ifndef _OpenAPI_lmf_info_H_ +#define _OpenAPI_lmf_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "access_type.h" +#include "an_node_type.h" +#include "external_client_type.h" +#include "rat_type.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_lmf_info_s OpenAPI_lmf_info_t; +typedef struct OpenAPI_lmf_info_s { + OpenAPI_list_t *serving_client_types; + char *lmf_id; + OpenAPI_list_t *serving_access_types; + OpenAPI_list_t *serving_an_node_types; + OpenAPI_list_t *serving_rat_types; +} OpenAPI_lmf_info_t; + +OpenAPI_lmf_info_t *OpenAPI_lmf_info_create( + OpenAPI_list_t *serving_client_types, + char *lmf_id, + OpenAPI_list_t *serving_access_types, + OpenAPI_list_t *serving_an_node_types, + OpenAPI_list_t *serving_rat_types + ); +void OpenAPI_lmf_info_free(OpenAPI_lmf_info_t *lmf_info); +OpenAPI_lmf_info_t *OpenAPI_lmf_info_parseFromJSON(cJSON *lmf_infoJSON); +cJSON *OpenAPI_lmf_info_convertToJSON(OpenAPI_lmf_info_t *lmf_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_lmf_info_H_ */ + diff --git a/lib/sbi/openapi/model/location_accuracy.c b/lib/sbi/openapi/model/location_accuracy.c new file mode 100644 index 0000000000..f012744d69 --- /dev/null +++ b/lib/sbi/openapi/model/location_accuracy.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "location_accuracy.h" + +OpenAPI_location_accuracy_t *OpenAPI_location_accuracy_create( + ) +{ + OpenAPI_location_accuracy_t *location_accuracy_local_var = OpenAPI_malloc(sizeof(OpenAPI_location_accuracy_t)); + if (!location_accuracy_local_var) { + return NULL; + } + + return location_accuracy_local_var; +} + +void OpenAPI_location_accuracy_free(OpenAPI_location_accuracy_t *location_accuracy) +{ + if (NULL == location_accuracy) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(location_accuracy); +} + +cJSON *OpenAPI_location_accuracy_convertToJSON(OpenAPI_location_accuracy_t *location_accuracy) +{ + cJSON *item = NULL; + + if (location_accuracy == NULL) { + ogs_error("OpenAPI_location_accuracy_convertToJSON() failed [LocationAccuracy]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_location_accuracy_t *OpenAPI_location_accuracy_parseFromJSON(cJSON *location_accuracyJSON) +{ + OpenAPI_location_accuracy_t *location_accuracy_local_var = NULL; + location_accuracy_local_var = OpenAPI_location_accuracy_create ( + ); + + return location_accuracy_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/location_accuracy.h b/lib/sbi/openapi/model/location_accuracy.h new file mode 100644 index 0000000000..2cf9fb91fe --- /dev/null +++ b/lib/sbi/openapi/model/location_accuracy.h @@ -0,0 +1,35 @@ +/* + * location_accuracy.h + * + * + */ + +#ifndef _OpenAPI_location_accuracy_H_ +#define _OpenAPI_location_accuracy_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_location_accuracy_s OpenAPI_location_accuracy_t; +typedef struct OpenAPI_location_accuracy_s { +} OpenAPI_location_accuracy_t; + +OpenAPI_location_accuracy_t *OpenAPI_location_accuracy_create( + ); +void OpenAPI_location_accuracy_free(OpenAPI_location_accuracy_t *location_accuracy); +OpenAPI_location_accuracy_t *OpenAPI_location_accuracy_parseFromJSON(cJSON *location_accuracyJSON); +cJSON *OpenAPI_location_accuracy_convertToJSON(OpenAPI_location_accuracy_t *location_accuracy); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_location_accuracy_H_ */ + diff --git a/lib/sbi/openapi/model/location_area.c b/lib/sbi/openapi/model/location_area.c new file mode 100644 index 0000000000..96aa0930f9 --- /dev/null +++ b/lib/sbi/openapi/model/location_area.c @@ -0,0 +1,175 @@ + +#include +#include +#include +#include "location_area.h" + +OpenAPI_location_area_t *OpenAPI_location_area_create( + OpenAPI_list_t *geographic_areas, + OpenAPI_list_t *civic_addresses, + OpenAPI_network_area_info_t *nw_area_info + ) +{ + OpenAPI_location_area_t *location_area_local_var = OpenAPI_malloc(sizeof(OpenAPI_location_area_t)); + if (!location_area_local_var) { + return NULL; + } + location_area_local_var->geographic_areas = geographic_areas; + location_area_local_var->civic_addresses = civic_addresses; + location_area_local_var->nw_area_info = nw_area_info; + + return location_area_local_var; +} + +void OpenAPI_location_area_free(OpenAPI_location_area_t *location_area) +{ + if (NULL == location_area) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(location_area->geographic_areas, node) { + OpenAPI_geographic_area_free(node->data); + } + OpenAPI_list_free(location_area->geographic_areas); + OpenAPI_list_for_each(location_area->civic_addresses, node) { + OpenAPI_civic_address_free(node->data); + } + OpenAPI_list_free(location_area->civic_addresses); + OpenAPI_network_area_info_free(location_area->nw_area_info); + ogs_free(location_area); +} + +cJSON *OpenAPI_location_area_convertToJSON(OpenAPI_location_area_t *location_area) +{ + cJSON *item = NULL; + + if (location_area == NULL) { + ogs_error("OpenAPI_location_area_convertToJSON() failed [LocationArea]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (location_area->geographic_areas) { + cJSON *geographic_areasList = cJSON_AddArrayToObject(item, "geographicAreas"); + if (geographic_areasList == NULL) { + ogs_error("OpenAPI_location_area_convertToJSON() failed [geographic_areas]"); + goto end; + } + + OpenAPI_lnode_t *geographic_areas_node; + if (location_area->geographic_areas) { + OpenAPI_list_for_each(location_area->geographic_areas, geographic_areas_node) { + cJSON *itemLocal = OpenAPI_geographic_area_convertToJSON(geographic_areas_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_location_area_convertToJSON() failed [geographic_areas]"); + goto end; + } + cJSON_AddItemToArray(geographic_areasList, itemLocal); + } + } + } + + if (location_area->civic_addresses) { + cJSON *civic_addressesList = cJSON_AddArrayToObject(item, "civicAddresses"); + if (civic_addressesList == NULL) { + ogs_error("OpenAPI_location_area_convertToJSON() failed [civic_addresses]"); + goto end; + } + + OpenAPI_lnode_t *civic_addresses_node; + if (location_area->civic_addresses) { + OpenAPI_list_for_each(location_area->civic_addresses, civic_addresses_node) { + cJSON *itemLocal = OpenAPI_civic_address_convertToJSON(civic_addresses_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_location_area_convertToJSON() failed [civic_addresses]"); + goto end; + } + cJSON_AddItemToArray(civic_addressesList, itemLocal); + } + } + } + + if (location_area->nw_area_info) { + cJSON *nw_area_info_local_JSON = OpenAPI_network_area_info_convertToJSON(location_area->nw_area_info); + if (nw_area_info_local_JSON == NULL) { + ogs_error("OpenAPI_location_area_convertToJSON() failed [nw_area_info]"); + goto end; + } + cJSON_AddItemToObject(item, "nwAreaInfo", nw_area_info_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_location_area_convertToJSON() failed [nw_area_info]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_location_area_t *OpenAPI_location_area_parseFromJSON(cJSON *location_areaJSON) +{ + OpenAPI_location_area_t *location_area_local_var = NULL; + cJSON *geographic_areas = cJSON_GetObjectItemCaseSensitive(location_areaJSON, "geographicAreas"); + + OpenAPI_list_t *geographic_areasList; + if (geographic_areas) { + cJSON *geographic_areas_local_nonprimitive; + if (!cJSON_IsArray(geographic_areas)) { + ogs_error("OpenAPI_location_area_parseFromJSON() failed [geographic_areas]"); + goto end; + } + + geographic_areasList = OpenAPI_list_create(); + + cJSON_ArrayForEach(geographic_areas_local_nonprimitive, geographic_areas ) { + if (!cJSON_IsObject(geographic_areas_local_nonprimitive)) { + ogs_error("OpenAPI_location_area_parseFromJSON() failed [geographic_areas]"); + goto end; + } + OpenAPI_geographic_area_t *geographic_areasItem = OpenAPI_geographic_area_parseFromJSON(geographic_areas_local_nonprimitive); + + OpenAPI_list_add(geographic_areasList, geographic_areasItem); + } + } + + cJSON *civic_addresses = cJSON_GetObjectItemCaseSensitive(location_areaJSON, "civicAddresses"); + + OpenAPI_list_t *civic_addressesList; + if (civic_addresses) { + cJSON *civic_addresses_local_nonprimitive; + if (!cJSON_IsArray(civic_addresses)) { + ogs_error("OpenAPI_location_area_parseFromJSON() failed [civic_addresses]"); + goto end; + } + + civic_addressesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(civic_addresses_local_nonprimitive, civic_addresses ) { + if (!cJSON_IsObject(civic_addresses_local_nonprimitive)) { + ogs_error("OpenAPI_location_area_parseFromJSON() failed [civic_addresses]"); + goto end; + } + OpenAPI_civic_address_t *civic_addressesItem = OpenAPI_civic_address_parseFromJSON(civic_addresses_local_nonprimitive); + + OpenAPI_list_add(civic_addressesList, civic_addressesItem); + } + } + + cJSON *nw_area_info = cJSON_GetObjectItemCaseSensitive(location_areaJSON, "nwAreaInfo"); + + OpenAPI_network_area_info_t *nw_area_info_local_nonprim = NULL; + if (nw_area_info) { + nw_area_info_local_nonprim = OpenAPI_network_area_info_parseFromJSON(nw_area_info); + } + + location_area_local_var = OpenAPI_location_area_create ( + geographic_areas ? geographic_areasList : NULL, + civic_addresses ? civic_addressesList : NULL, + nw_area_info ? nw_area_info_local_nonprim : NULL + ); + + return location_area_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/location_area.h b/lib/sbi/openapi/model/location_area.h new file mode 100644 index 0000000000..51b9f61579 --- /dev/null +++ b/lib/sbi/openapi/model/location_area.h @@ -0,0 +1,44 @@ +/* + * location_area.h + * + * + */ + +#ifndef _OpenAPI_location_area_H_ +#define _OpenAPI_location_area_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "civic_address.h" +#include "geographic_area.h" +#include "network_area_info.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_location_area_s OpenAPI_location_area_t; +typedef struct OpenAPI_location_area_s { + OpenAPI_list_t *geographic_areas; + OpenAPI_list_t *civic_addresses; + struct OpenAPI_network_area_info_s *nw_area_info; +} OpenAPI_location_area_t; + +OpenAPI_location_area_t *OpenAPI_location_area_create( + OpenAPI_list_t *geographic_areas, + OpenAPI_list_t *civic_addresses, + OpenAPI_network_area_info_t *nw_area_info + ); +void OpenAPI_location_area_free(OpenAPI_location_area_t *location_area); +OpenAPI_location_area_t *OpenAPI_location_area_parseFromJSON(cJSON *location_areaJSON); +cJSON *OpenAPI_location_area_convertToJSON(OpenAPI_location_area_t *location_area); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_location_area_H_ */ + diff --git a/lib/sbi/openapi/model/location_info.c b/lib/sbi/openapi/model/location_info.c new file mode 100644 index 0000000000..d3b2797cb0 --- /dev/null +++ b/lib/sbi/openapi/model/location_info.c @@ -0,0 +1,166 @@ + +#include +#include +#include +#include "location_info.h" + +OpenAPI_location_info_t *OpenAPI_location_info_create( + char *supi, + char *gpsi, + OpenAPI_list_t *registration_location_info_list, + char *supported_features + ) +{ + OpenAPI_location_info_t *location_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_location_info_t)); + if (!location_info_local_var) { + return NULL; + } + location_info_local_var->supi = supi; + location_info_local_var->gpsi = gpsi; + location_info_local_var->registration_location_info_list = registration_location_info_list; + location_info_local_var->supported_features = supported_features; + + return location_info_local_var; +} + +void OpenAPI_location_info_free(OpenAPI_location_info_t *location_info) +{ + if (NULL == location_info) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(location_info->supi); + ogs_free(location_info->gpsi); + OpenAPI_list_for_each(location_info->registration_location_info_list, node) { + OpenAPI_object_free(node->data); + } + OpenAPI_list_free(location_info->registration_location_info_list); + ogs_free(location_info->supported_features); + ogs_free(location_info); +} + +cJSON *OpenAPI_location_info_convertToJSON(OpenAPI_location_info_t *location_info) +{ + cJSON *item = NULL; + + if (location_info == NULL) { + ogs_error("OpenAPI_location_info_convertToJSON() failed [LocationInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (location_info->supi) { + if (cJSON_AddStringToObject(item, "supi", location_info->supi) == NULL) { + ogs_error("OpenAPI_location_info_convertToJSON() failed [supi]"); + goto end; + } + } + + if (location_info->gpsi) { + if (cJSON_AddStringToObject(item, "gpsi", location_info->gpsi) == NULL) { + ogs_error("OpenAPI_location_info_convertToJSON() failed [gpsi]"); + goto end; + } + } + + if (!location_info->registration_location_info_list) { + ogs_error("OpenAPI_location_info_convertToJSON() failed [registration_location_info_list]"); + goto end; + } + cJSON *registration_location_info_listList = cJSON_AddArrayToObject(item, "registrationLocationInfoList"); + if (registration_location_info_listList == NULL) { + ogs_error("OpenAPI_location_info_convertToJSON() failed [registration_location_info_list]"); + goto end; + } + + OpenAPI_lnode_t *registration_location_info_list_node; + if (location_info->registration_location_info_list) { + OpenAPI_list_for_each(location_info->registration_location_info_list, registration_location_info_list_node) { + cJSON *itemLocal = OpenAPI_object_convertToJSON(registration_location_info_list_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_location_info_convertToJSON() failed [registration_location_info_list]"); + goto end; + } + cJSON_AddItemToArray(registration_location_info_listList, itemLocal); + } + } + + if (location_info->supported_features) { + if (cJSON_AddStringToObject(item, "supportedFeatures", location_info->supported_features) == NULL) { + ogs_error("OpenAPI_location_info_convertToJSON() failed [supported_features]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_location_info_t *OpenAPI_location_info_parseFromJSON(cJSON *location_infoJSON) +{ + OpenAPI_location_info_t *location_info_local_var = NULL; + cJSON *supi = cJSON_GetObjectItemCaseSensitive(location_infoJSON, "supi"); + + if (supi) { + if (!cJSON_IsString(supi)) { + ogs_error("OpenAPI_location_info_parseFromJSON() failed [supi]"); + goto end; + } + } + + cJSON *gpsi = cJSON_GetObjectItemCaseSensitive(location_infoJSON, "gpsi"); + + if (gpsi) { + if (!cJSON_IsString(gpsi)) { + ogs_error("OpenAPI_location_info_parseFromJSON() failed [gpsi]"); + goto end; + } + } + + cJSON *registration_location_info_list = cJSON_GetObjectItemCaseSensitive(location_infoJSON, "registrationLocationInfoList"); + if (!registration_location_info_list) { + ogs_error("OpenAPI_location_info_parseFromJSON() failed [registration_location_info_list]"); + goto end; + } + + OpenAPI_list_t *registration_location_info_listList; + + cJSON *registration_location_info_list_local_nonprimitive; + if (!cJSON_IsArray(registration_location_info_list)) { + ogs_error("OpenAPI_location_info_parseFromJSON() failed [registration_location_info_list]"); + goto end; + } + + registration_location_info_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(registration_location_info_list_local_nonprimitive, registration_location_info_list ) { + if (!cJSON_IsObject(registration_location_info_list_local_nonprimitive)) { + ogs_error("OpenAPI_location_info_parseFromJSON() failed [registration_location_info_list]"); + goto end; + } + OpenAPI_object_t *registration_location_info_listItem = OpenAPI_object_parseFromJSON(registration_location_info_list_local_nonprimitive); + + OpenAPI_list_add(registration_location_info_listList, registration_location_info_listItem); + } + + cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(location_infoJSON, "supportedFeatures"); + + if (supported_features) { + if (!cJSON_IsString(supported_features)) { + ogs_error("OpenAPI_location_info_parseFromJSON() failed [supported_features]"); + goto end; + } + } + + location_info_local_var = OpenAPI_location_info_create ( + supi ? ogs_strdup(supi->valuestring) : NULL, + gpsi ? ogs_strdup(gpsi->valuestring) : NULL, + registration_location_info_listList, + supported_features ? ogs_strdup(supported_features->valuestring) : NULL + ); + + return location_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/location_info.h b/lib/sbi/openapi/model/location_info.h new file mode 100644 index 0000000000..5ec6776c3b --- /dev/null +++ b/lib/sbi/openapi/model/location_info.h @@ -0,0 +1,44 @@ +/* + * location_info.h + * + * + */ + +#ifndef _OpenAPI_location_info_H_ +#define _OpenAPI_location_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "object.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_location_info_s OpenAPI_location_info_t; +typedef struct OpenAPI_location_info_s { + char *supi; + char *gpsi; + OpenAPI_list_t *registration_location_info_list; + char *supported_features; +} OpenAPI_location_info_t; + +OpenAPI_location_info_t *OpenAPI_location_info_create( + char *supi, + char *gpsi, + OpenAPI_list_t *registration_location_info_list, + char *supported_features + ); +void OpenAPI_location_info_free(OpenAPI_location_info_t *location_info); +OpenAPI_location_info_t *OpenAPI_location_info_parseFromJSON(cJSON *location_infoJSON); +cJSON *OpenAPI_location_info_convertToJSON(OpenAPI_location_info_t *location_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_location_info_H_ */ + diff --git a/lib/sbi/openapi/model/location_privacy_ind.c b/lib/sbi/openapi/model/location_privacy_ind.c new file mode 100644 index 0000000000..7aa49e63cc --- /dev/null +++ b/lib/sbi/openapi/model/location_privacy_ind.c @@ -0,0 +1,30 @@ + +#include +#include +#include +#include "location_privacy_ind.h" + +char* OpenAPI_location_privacy_ind_ToString(OpenAPI_location_privacy_ind_e location_privacy_ind) +{ + const char *location_privacy_indArray[] = { "NULL", "LOCATION_DISALLOWED", "LOCATION_ALLOWED" }; + size_t sizeofArray = sizeof(location_privacy_indArray) / sizeof(location_privacy_indArray[0]); + if (location_privacy_ind < sizeofArray) + return (char *)location_privacy_indArray[location_privacy_ind]; + else + return (char *)"Unknown"; +} + +OpenAPI_location_privacy_ind_e OpenAPI_location_privacy_ind_FromString(char* location_privacy_ind) +{ + int stringToReturn = 0; + const char *location_privacy_indArray[] = { "NULL", "LOCATION_DISALLOWED", "LOCATION_ALLOWED" }; + size_t sizeofArray = sizeof(location_privacy_indArray) / sizeof(location_privacy_indArray[0]); + while (stringToReturn < sizeofArray) { + if (strcmp(location_privacy_ind, location_privacy_indArray[stringToReturn]) == 0) { + return stringToReturn; + } + stringToReturn++; + } + return 0; +} + diff --git a/lib/sbi/openapi/model/location_privacy_ind.h b/lib/sbi/openapi/model/location_privacy_ind.h new file mode 100644 index 0000000000..08cfa86559 --- /dev/null +++ b/lib/sbi/openapi/model/location_privacy_ind.h @@ -0,0 +1,31 @@ +/* + * location_privacy_ind.h + * + * + */ + +#ifndef _OpenAPI_location_privacy_ind_H_ +#define _OpenAPI_location_privacy_ind_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { OpenAPI_location_privacy_ind_NULL = 0, OpenAPI_location_privacy_ind_LOCATION_DISALLOWED, OpenAPI_location_privacy_ind_LOCATION_ALLOWED } OpenAPI_location_privacy_ind_e; + +char* OpenAPI_location_privacy_ind_ToString(OpenAPI_location_privacy_ind_e location_privacy_ind); + +OpenAPI_location_privacy_ind_e OpenAPI_location_privacy_ind_FromString(char* location_privacy_ind); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_location_privacy_ind_H_ */ + diff --git a/lib/sbi/openapi/model/location_reporting_configuration.c b/lib/sbi/openapi/model/location_reporting_configuration.c new file mode 100644 index 0000000000..a10195a137 --- /dev/null +++ b/lib/sbi/openapi/model/location_reporting_configuration.c @@ -0,0 +1,138 @@ + +#include +#include +#include +#include "location_reporting_configuration.h" + +OpenAPI_location_reporting_configuration_t *OpenAPI_location_reporting_configuration_create( + int current_location, + int one_time, + OpenAPI_location_accuracy_t *accuracy, + OpenAPI_location_accuracy_t *n3gpp_accuracy + ) +{ + OpenAPI_location_reporting_configuration_t *location_reporting_configuration_local_var = OpenAPI_malloc(sizeof(OpenAPI_location_reporting_configuration_t)); + if (!location_reporting_configuration_local_var) { + return NULL; + } + location_reporting_configuration_local_var->current_location = current_location; + location_reporting_configuration_local_var->one_time = one_time; + location_reporting_configuration_local_var->accuracy = accuracy; + location_reporting_configuration_local_var->n3gpp_accuracy = n3gpp_accuracy; + + return location_reporting_configuration_local_var; +} + +void OpenAPI_location_reporting_configuration_free(OpenAPI_location_reporting_configuration_t *location_reporting_configuration) +{ + if (NULL == location_reporting_configuration) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_location_accuracy_free(location_reporting_configuration->accuracy); + OpenAPI_location_accuracy_free(location_reporting_configuration->n3gpp_accuracy); + ogs_free(location_reporting_configuration); +} + +cJSON *OpenAPI_location_reporting_configuration_convertToJSON(OpenAPI_location_reporting_configuration_t *location_reporting_configuration) +{ + cJSON *item = NULL; + + if (location_reporting_configuration == NULL) { + ogs_error("OpenAPI_location_reporting_configuration_convertToJSON() failed [LocationReportingConfiguration]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (cJSON_AddBoolToObject(item, "currentLocation", location_reporting_configuration->current_location) == NULL) { + ogs_error("OpenAPI_location_reporting_configuration_convertToJSON() failed [current_location]"); + goto end; + } + + if (location_reporting_configuration->one_time >= 0) { + if (cJSON_AddBoolToObject(item, "oneTime", location_reporting_configuration->one_time) == NULL) { + ogs_error("OpenAPI_location_reporting_configuration_convertToJSON() failed [one_time]"); + goto end; + } + } + + if (location_reporting_configuration->accuracy) { + cJSON *accuracy_local_JSON = OpenAPI_location_accuracy_convertToJSON(location_reporting_configuration->accuracy); + if (accuracy_local_JSON == NULL) { + ogs_error("OpenAPI_location_reporting_configuration_convertToJSON() failed [accuracy]"); + goto end; + } + cJSON_AddItemToObject(item, "accuracy", accuracy_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_location_reporting_configuration_convertToJSON() failed [accuracy]"); + goto end; + } + } + + if (location_reporting_configuration->n3gpp_accuracy) { + cJSON *n3gpp_accuracy_local_JSON = OpenAPI_location_accuracy_convertToJSON(location_reporting_configuration->n3gpp_accuracy); + if (n3gpp_accuracy_local_JSON == NULL) { + ogs_error("OpenAPI_location_reporting_configuration_convertToJSON() failed [n3gpp_accuracy]"); + goto end; + } + cJSON_AddItemToObject(item, "n3gppAccuracy", n3gpp_accuracy_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_location_reporting_configuration_convertToJSON() failed [n3gpp_accuracy]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_location_reporting_configuration_t *OpenAPI_location_reporting_configuration_parseFromJSON(cJSON *location_reporting_configurationJSON) +{ + OpenAPI_location_reporting_configuration_t *location_reporting_configuration_local_var = NULL; + cJSON *current_location = cJSON_GetObjectItemCaseSensitive(location_reporting_configurationJSON, "currentLocation"); + if (!current_location) { + ogs_error("OpenAPI_location_reporting_configuration_parseFromJSON() failed [current_location]"); + goto end; + } + + + if (!cJSON_IsBool(current_location)) { + ogs_error("OpenAPI_location_reporting_configuration_parseFromJSON() failed [current_location]"); + goto end; + } + + cJSON *one_time = cJSON_GetObjectItemCaseSensitive(location_reporting_configurationJSON, "oneTime"); + + if (one_time) { + if (!cJSON_IsBool(one_time)) { + ogs_error("OpenAPI_location_reporting_configuration_parseFromJSON() failed [one_time]"); + goto end; + } + } + + cJSON *accuracy = cJSON_GetObjectItemCaseSensitive(location_reporting_configurationJSON, "accuracy"); + + OpenAPI_location_accuracy_t *accuracy_local_nonprim = NULL; + if (accuracy) { + accuracy_local_nonprim = OpenAPI_location_accuracy_parseFromJSON(accuracy); + } + + cJSON *n3gpp_accuracy = cJSON_GetObjectItemCaseSensitive(location_reporting_configurationJSON, "n3gppAccuracy"); + + OpenAPI_location_accuracy_t *n3gpp_accuracy_local_nonprim = NULL; + if (n3gpp_accuracy) { + n3gpp_accuracy_local_nonprim = OpenAPI_location_accuracy_parseFromJSON(n3gpp_accuracy); + } + + location_reporting_configuration_local_var = OpenAPI_location_reporting_configuration_create ( + current_location->valueint, + one_time ? one_time->valueint : 0, + accuracy ? accuracy_local_nonprim : NULL, + n3gpp_accuracy ? n3gpp_accuracy_local_nonprim : NULL + ); + + return location_reporting_configuration_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/location_reporting_configuration.h b/lib/sbi/openapi/model/location_reporting_configuration.h new file mode 100644 index 0000000000..97cbaf9591 --- /dev/null +++ b/lib/sbi/openapi/model/location_reporting_configuration.h @@ -0,0 +1,44 @@ +/* + * location_reporting_configuration.h + * + * + */ + +#ifndef _OpenAPI_location_reporting_configuration_H_ +#define _OpenAPI_location_reporting_configuration_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "location_accuracy.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_location_reporting_configuration_s OpenAPI_location_reporting_configuration_t; +typedef struct OpenAPI_location_reporting_configuration_s { + int current_location; + int one_time; + struct OpenAPI_location_accuracy_s *accuracy; + struct OpenAPI_location_accuracy_s *n3gpp_accuracy; +} OpenAPI_location_reporting_configuration_t; + +OpenAPI_location_reporting_configuration_t *OpenAPI_location_reporting_configuration_create( + int current_location, + int one_time, + OpenAPI_location_accuracy_t *accuracy, + OpenAPI_location_accuracy_t *n3gpp_accuracy + ); +void OpenAPI_location_reporting_configuration_free(OpenAPI_location_reporting_configuration_t *location_reporting_configuration); +OpenAPI_location_reporting_configuration_t *OpenAPI_location_reporting_configuration_parseFromJSON(cJSON *location_reporting_configurationJSON); +cJSON *OpenAPI_location_reporting_configuration_convertToJSON(OpenAPI_location_reporting_configuration_t *location_reporting_configuration); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_location_reporting_configuration_H_ */ + diff --git a/lib/sbi/openapi/model/lpi.c b/lib/sbi/openapi/model/lpi.c new file mode 100644 index 0000000000..5d7589ebe1 --- /dev/null +++ b/lib/sbi/openapi/model/lpi.c @@ -0,0 +1,101 @@ + +#include +#include +#include +#include "lpi.h" + +OpenAPI_lpi_t *OpenAPI_lpi_create( + OpenAPI_location_privacy_ind_e location_privacy_ind, + OpenAPI_valid_time_period_t *valid_time_period + ) +{ + OpenAPI_lpi_t *lpi_local_var = OpenAPI_malloc(sizeof(OpenAPI_lpi_t)); + if (!lpi_local_var) { + return NULL; + } + lpi_local_var->location_privacy_ind = location_privacy_ind; + lpi_local_var->valid_time_period = valid_time_period; + + return lpi_local_var; +} + +void OpenAPI_lpi_free(OpenAPI_lpi_t *lpi) +{ + if (NULL == lpi) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_valid_time_period_free(lpi->valid_time_period); + ogs_free(lpi); +} + +cJSON *OpenAPI_lpi_convertToJSON(OpenAPI_lpi_t *lpi) +{ + cJSON *item = NULL; + + if (lpi == NULL) { + ogs_error("OpenAPI_lpi_convertToJSON() failed [Lpi]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!lpi->location_privacy_ind) { + ogs_error("OpenAPI_lpi_convertToJSON() failed [location_privacy_ind]"); + goto end; + } + if (cJSON_AddStringToObject(item, "locationPrivacyInd", OpenAPI_location_privacy_ind_ToString(lpi->location_privacy_ind)) == NULL) { + ogs_error("OpenAPI_lpi_convertToJSON() failed [location_privacy_ind]"); + goto end; + } + + if (lpi->valid_time_period) { + cJSON *valid_time_period_local_JSON = OpenAPI_valid_time_period_convertToJSON(lpi->valid_time_period); + if (valid_time_period_local_JSON == NULL) { + ogs_error("OpenAPI_lpi_convertToJSON() failed [valid_time_period]"); + goto end; + } + cJSON_AddItemToObject(item, "validTimePeriod", valid_time_period_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_lpi_convertToJSON() failed [valid_time_period]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_lpi_t *OpenAPI_lpi_parseFromJSON(cJSON *lpiJSON) +{ + OpenAPI_lpi_t *lpi_local_var = NULL; + cJSON *location_privacy_ind = cJSON_GetObjectItemCaseSensitive(lpiJSON, "locationPrivacyInd"); + if (!location_privacy_ind) { + ogs_error("OpenAPI_lpi_parseFromJSON() failed [location_privacy_ind]"); + goto end; + } + + OpenAPI_location_privacy_ind_e location_privacy_indVariable; + + if (!cJSON_IsString(location_privacy_ind)) { + ogs_error("OpenAPI_lpi_parseFromJSON() failed [location_privacy_ind]"); + goto end; + } + location_privacy_indVariable = OpenAPI_location_privacy_ind_FromString(location_privacy_ind->valuestring); + + cJSON *valid_time_period = cJSON_GetObjectItemCaseSensitive(lpiJSON, "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); + } + + lpi_local_var = OpenAPI_lpi_create ( + location_privacy_indVariable, + valid_time_period ? valid_time_period_local_nonprim : NULL + ); + + return lpi_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/lpi.h b/lib/sbi/openapi/model/lpi.h new file mode 100644 index 0000000000..17239adc2a --- /dev/null +++ b/lib/sbi/openapi/model/lpi.h @@ -0,0 +1,41 @@ +/* + * lpi.h + * + * + */ + +#ifndef _OpenAPI_lpi_H_ +#define _OpenAPI_lpi_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "location_privacy_ind.h" +#include "valid_time_period.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_lpi_s OpenAPI_lpi_t; +typedef struct OpenAPI_lpi_s { + OpenAPI_location_privacy_ind_e location_privacy_ind; + struct OpenAPI_valid_time_period_s *valid_time_period; +} OpenAPI_lpi_t; + +OpenAPI_lpi_t *OpenAPI_lpi_create( + OpenAPI_location_privacy_ind_e location_privacy_ind, + OpenAPI_valid_time_period_t *valid_time_period + ); +void OpenAPI_lpi_free(OpenAPI_lpi_t *lpi); +OpenAPI_lpi_t *OpenAPI_lpi_parseFromJSON(cJSON *lpiJSON); +cJSON *OpenAPI_lpi_convertToJSON(OpenAPI_lpi_t *lpi); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_lpi_H_ */ + diff --git a/lib/sbi/openapi/model/lte_v2x_auth.c b/lib/sbi/openapi/model/lte_v2x_auth.c new file mode 100644 index 0000000000..4aa6efacb3 --- /dev/null +++ b/lib/sbi/openapi/model/lte_v2x_auth.c @@ -0,0 +1,99 @@ + +#include +#include +#include +#include "lte_v2x_auth.h" + +OpenAPI_lte_v2x_auth_t *OpenAPI_lte_v2x_auth_create( + OpenAPI_ue_auth_t *vehicle_ue_auth, + OpenAPI_ue_auth_t *pedestrian_ue_auth + ) +{ + OpenAPI_lte_v2x_auth_t *lte_v2x_auth_local_var = OpenAPI_malloc(sizeof(OpenAPI_lte_v2x_auth_t)); + if (!lte_v2x_auth_local_var) { + return NULL; + } + lte_v2x_auth_local_var->vehicle_ue_auth = vehicle_ue_auth; + lte_v2x_auth_local_var->pedestrian_ue_auth = pedestrian_ue_auth; + + return lte_v2x_auth_local_var; +} + +void OpenAPI_lte_v2x_auth_free(OpenAPI_lte_v2x_auth_t *lte_v2x_auth) +{ + if (NULL == lte_v2x_auth) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_ue_auth_free(lte_v2x_auth->vehicle_ue_auth); + OpenAPI_ue_auth_free(lte_v2x_auth->pedestrian_ue_auth); + ogs_free(lte_v2x_auth); +} + +cJSON *OpenAPI_lte_v2x_auth_convertToJSON(OpenAPI_lte_v2x_auth_t *lte_v2x_auth) +{ + cJSON *item = NULL; + + if (lte_v2x_auth == NULL) { + ogs_error("OpenAPI_lte_v2x_auth_convertToJSON() failed [LteV2xAuth]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (lte_v2x_auth->vehicle_ue_auth) { + cJSON *vehicle_ue_auth_local_JSON = OpenAPI_ue_auth_convertToJSON(lte_v2x_auth->vehicle_ue_auth); + if (vehicle_ue_auth_local_JSON == NULL) { + ogs_error("OpenAPI_lte_v2x_auth_convertToJSON() failed [vehicle_ue_auth]"); + goto end; + } + cJSON_AddItemToObject(item, "vehicleUeAuth", vehicle_ue_auth_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_lte_v2x_auth_convertToJSON() failed [vehicle_ue_auth]"); + goto end; + } + } + + if (lte_v2x_auth->pedestrian_ue_auth) { + cJSON *pedestrian_ue_auth_local_JSON = OpenAPI_ue_auth_convertToJSON(lte_v2x_auth->pedestrian_ue_auth); + if (pedestrian_ue_auth_local_JSON == NULL) { + ogs_error("OpenAPI_lte_v2x_auth_convertToJSON() failed [pedestrian_ue_auth]"); + goto end; + } + cJSON_AddItemToObject(item, "pedestrianUeAuth", pedestrian_ue_auth_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_lte_v2x_auth_convertToJSON() failed [pedestrian_ue_auth]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_lte_v2x_auth_t *OpenAPI_lte_v2x_auth_parseFromJSON(cJSON *lte_v2x_authJSON) +{ + OpenAPI_lte_v2x_auth_t *lte_v2x_auth_local_var = NULL; + cJSON *vehicle_ue_auth = cJSON_GetObjectItemCaseSensitive(lte_v2x_authJSON, "vehicleUeAuth"); + + OpenAPI_ue_auth_t *vehicle_ue_auth_local_nonprim = NULL; + if (vehicle_ue_auth) { + vehicle_ue_auth_local_nonprim = OpenAPI_ue_auth_parseFromJSON(vehicle_ue_auth); + } + + cJSON *pedestrian_ue_auth = cJSON_GetObjectItemCaseSensitive(lte_v2x_authJSON, "pedestrianUeAuth"); + + OpenAPI_ue_auth_t *pedestrian_ue_auth_local_nonprim = NULL; + if (pedestrian_ue_auth) { + pedestrian_ue_auth_local_nonprim = OpenAPI_ue_auth_parseFromJSON(pedestrian_ue_auth); + } + + lte_v2x_auth_local_var = OpenAPI_lte_v2x_auth_create ( + vehicle_ue_auth ? vehicle_ue_auth_local_nonprim : NULL, + pedestrian_ue_auth ? pedestrian_ue_auth_local_nonprim : NULL + ); + + return lte_v2x_auth_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/lte_v2x_auth.h b/lib/sbi/openapi/model/lte_v2x_auth.h new file mode 100644 index 0000000000..a770e6788e --- /dev/null +++ b/lib/sbi/openapi/model/lte_v2x_auth.h @@ -0,0 +1,40 @@ +/* + * lte_v2x_auth.h + * + * + */ + +#ifndef _OpenAPI_lte_v2x_auth_H_ +#define _OpenAPI_lte_v2x_auth_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "ue_auth.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_lte_v2x_auth_s OpenAPI_lte_v2x_auth_t; +typedef struct OpenAPI_lte_v2x_auth_s { + struct OpenAPI_ue_auth_s *vehicle_ue_auth; + struct OpenAPI_ue_auth_s *pedestrian_ue_auth; +} OpenAPI_lte_v2x_auth_t; + +OpenAPI_lte_v2x_auth_t *OpenAPI_lte_v2x_auth_create( + OpenAPI_ue_auth_t *vehicle_ue_auth, + OpenAPI_ue_auth_t *pedestrian_ue_auth + ); +void OpenAPI_lte_v2x_auth_free(OpenAPI_lte_v2x_auth_t *lte_v2x_auth); +OpenAPI_lte_v2x_auth_t *OpenAPI_lte_v2x_auth_parseFromJSON(cJSON *lte_v2x_authJSON); +cJSON *OpenAPI_lte_v2x_auth_convertToJSON(OpenAPI_lte_v2x_auth_t *lte_v2x_auth); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_lte_v2x_auth_H_ */ + diff --git a/lib/sbi/openapi/model/maximum_latency.c b/lib/sbi/openapi/model/maximum_latency.c new file mode 100644 index 0000000000..a0053a82bf --- /dev/null +++ b/lib/sbi/openapi/model/maximum_latency.c @@ -0,0 +1,139 @@ + +#include +#include +#include +#include "maximum_latency.h" + +OpenAPI_maximum_latency_t *OpenAPI_maximum_latency_create( + int maximum_latency, + OpenAPI_snssai_t *snssai, + char *dnn, + char *validity_time + ) +{ + OpenAPI_maximum_latency_t *maximum_latency_local_var = OpenAPI_malloc(sizeof(OpenAPI_maximum_latency_t)); + if (!maximum_latency_local_var) { + return NULL; + } + maximum_latency_local_var->maximum_latency = maximum_latency; + maximum_latency_local_var->snssai = snssai; + maximum_latency_local_var->dnn = dnn; + maximum_latency_local_var->validity_time = validity_time; + + return maximum_latency_local_var; +} + +void OpenAPI_maximum_latency_free(OpenAPI_maximum_latency_t *maximum_latency) +{ + if (NULL == maximum_latency) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_snssai_free(maximum_latency->snssai); + ogs_free(maximum_latency->dnn); + ogs_free(maximum_latency->validity_time); + ogs_free(maximum_latency); +} + +cJSON *OpenAPI_maximum_latency_convertToJSON(OpenAPI_maximum_latency_t *maximum_latency) +{ + cJSON *item = NULL; + + if (maximum_latency == NULL) { + ogs_error("OpenAPI_maximum_latency_convertToJSON() failed [MaximumLatency]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!maximum_latency->maximum_latency) { + ogs_error("OpenAPI_maximum_latency_convertToJSON() failed [maximum_latency]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "maximumLatency", maximum_latency->maximum_latency) == NULL) { + ogs_error("OpenAPI_maximum_latency_convertToJSON() failed [maximum_latency]"); + goto end; + } + + if (maximum_latency->snssai) { + cJSON *snssai_local_JSON = OpenAPI_snssai_convertToJSON(maximum_latency->snssai); + if (snssai_local_JSON == NULL) { + ogs_error("OpenAPI_maximum_latency_convertToJSON() failed [snssai]"); + goto end; + } + cJSON_AddItemToObject(item, "snssai", snssai_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_maximum_latency_convertToJSON() failed [snssai]"); + goto end; + } + } + + if (maximum_latency->dnn) { + if (cJSON_AddStringToObject(item, "dnn", maximum_latency->dnn) == NULL) { + ogs_error("OpenAPI_maximum_latency_convertToJSON() failed [dnn]"); + goto end; + } + } + + if (maximum_latency->validity_time) { + if (cJSON_AddStringToObject(item, "validityTime", maximum_latency->validity_time) == NULL) { + ogs_error("OpenAPI_maximum_latency_convertToJSON() failed [validity_time]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_maximum_latency_t *OpenAPI_maximum_latency_parseFromJSON(cJSON *maximum_latencyJSON) +{ + OpenAPI_maximum_latency_t *maximum_latency_local_var = NULL; + cJSON *maximum_latency = cJSON_GetObjectItemCaseSensitive(maximum_latencyJSON, "maximumLatency"); + if (!maximum_latency) { + ogs_error("OpenAPI_maximum_latency_parseFromJSON() failed [maximum_latency]"); + goto end; + } + + + if (!cJSON_IsNumber(maximum_latency)) { + ogs_error("OpenAPI_maximum_latency_parseFromJSON() failed [maximum_latency]"); + goto end; + } + + cJSON *snssai = cJSON_GetObjectItemCaseSensitive(maximum_latencyJSON, "snssai"); + + OpenAPI_snssai_t *snssai_local_nonprim = NULL; + if (snssai) { + snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(snssai); + } + + cJSON *dnn = cJSON_GetObjectItemCaseSensitive(maximum_latencyJSON, "dnn"); + + if (dnn) { + if (!cJSON_IsString(dnn)) { + ogs_error("OpenAPI_maximum_latency_parseFromJSON() failed [dnn]"); + goto end; + } + } + + cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(maximum_latencyJSON, "validityTime"); + + if (validity_time) { + if (!cJSON_IsString(validity_time)) { + ogs_error("OpenAPI_maximum_latency_parseFromJSON() failed [validity_time]"); + goto end; + } + } + + maximum_latency_local_var = OpenAPI_maximum_latency_create ( + maximum_latency->valuedouble, + snssai ? snssai_local_nonprim : NULL, + dnn ? ogs_strdup(dnn->valuestring) : NULL, + validity_time ? ogs_strdup(validity_time->valuestring) : NULL + ); + + return maximum_latency_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/maximum_latency.h b/lib/sbi/openapi/model/maximum_latency.h new file mode 100644 index 0000000000..79495376d3 --- /dev/null +++ b/lib/sbi/openapi/model/maximum_latency.h @@ -0,0 +1,44 @@ +/* + * maximum_latency.h + * + * + */ + +#ifndef _OpenAPI_maximum_latency_H_ +#define _OpenAPI_maximum_latency_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "snssai.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_maximum_latency_s OpenAPI_maximum_latency_t; +typedef struct OpenAPI_maximum_latency_s { + int maximum_latency; + struct OpenAPI_snssai_s *snssai; + char *dnn; + char *validity_time; +} OpenAPI_maximum_latency_t; + +OpenAPI_maximum_latency_t *OpenAPI_maximum_latency_create( + int maximum_latency, + OpenAPI_snssai_t *snssai, + char *dnn, + char *validity_time + ); +void OpenAPI_maximum_latency_free(OpenAPI_maximum_latency_t *maximum_latency); +OpenAPI_maximum_latency_t *OpenAPI_maximum_latency_parseFromJSON(cJSON *maximum_latencyJSON); +cJSON *OpenAPI_maximum_latency_convertToJSON(OpenAPI_maximum_latency_t *maximum_latency); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_maximum_latency_H_ */ + diff --git a/lib/sbi/openapi/model/maximum_response_time.c b/lib/sbi/openapi/model/maximum_response_time.c new file mode 100644 index 0000000000..70cca1d230 --- /dev/null +++ b/lib/sbi/openapi/model/maximum_response_time.c @@ -0,0 +1,139 @@ + +#include +#include +#include +#include "maximum_response_time.h" + +OpenAPI_maximum_response_time_t *OpenAPI_maximum_response_time_create( + int maximum_response_time, + OpenAPI_snssai_t *snssai, + char *dnn, + char *validity_time + ) +{ + OpenAPI_maximum_response_time_t *maximum_response_time_local_var = OpenAPI_malloc(sizeof(OpenAPI_maximum_response_time_t)); + if (!maximum_response_time_local_var) { + return NULL; + } + maximum_response_time_local_var->maximum_response_time = maximum_response_time; + maximum_response_time_local_var->snssai = snssai; + maximum_response_time_local_var->dnn = dnn; + maximum_response_time_local_var->validity_time = validity_time; + + return maximum_response_time_local_var; +} + +void OpenAPI_maximum_response_time_free(OpenAPI_maximum_response_time_t *maximum_response_time) +{ + if (NULL == maximum_response_time) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_snssai_free(maximum_response_time->snssai); + ogs_free(maximum_response_time->dnn); + ogs_free(maximum_response_time->validity_time); + ogs_free(maximum_response_time); +} + +cJSON *OpenAPI_maximum_response_time_convertToJSON(OpenAPI_maximum_response_time_t *maximum_response_time) +{ + cJSON *item = NULL; + + if (maximum_response_time == NULL) { + ogs_error("OpenAPI_maximum_response_time_convertToJSON() failed [MaximumResponseTime]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!maximum_response_time->maximum_response_time) { + ogs_error("OpenAPI_maximum_response_time_convertToJSON() failed [maximum_response_time]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "maximumResponseTime", maximum_response_time->maximum_response_time) == NULL) { + ogs_error("OpenAPI_maximum_response_time_convertToJSON() failed [maximum_response_time]"); + goto end; + } + + if (maximum_response_time->snssai) { + cJSON *snssai_local_JSON = OpenAPI_snssai_convertToJSON(maximum_response_time->snssai); + if (snssai_local_JSON == NULL) { + ogs_error("OpenAPI_maximum_response_time_convertToJSON() failed [snssai]"); + goto end; + } + cJSON_AddItemToObject(item, "snssai", snssai_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_maximum_response_time_convertToJSON() failed [snssai]"); + goto end; + } + } + + if (maximum_response_time->dnn) { + if (cJSON_AddStringToObject(item, "dnn", maximum_response_time->dnn) == NULL) { + ogs_error("OpenAPI_maximum_response_time_convertToJSON() failed [dnn]"); + goto end; + } + } + + if (maximum_response_time->validity_time) { + if (cJSON_AddStringToObject(item, "validityTime", maximum_response_time->validity_time) == NULL) { + ogs_error("OpenAPI_maximum_response_time_convertToJSON() failed [validity_time]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_maximum_response_time_t *OpenAPI_maximum_response_time_parseFromJSON(cJSON *maximum_response_timeJSON) +{ + OpenAPI_maximum_response_time_t *maximum_response_time_local_var = NULL; + cJSON *maximum_response_time = cJSON_GetObjectItemCaseSensitive(maximum_response_timeJSON, "maximumResponseTime"); + if (!maximum_response_time) { + ogs_error("OpenAPI_maximum_response_time_parseFromJSON() failed [maximum_response_time]"); + goto end; + } + + + if (!cJSON_IsNumber(maximum_response_time)) { + ogs_error("OpenAPI_maximum_response_time_parseFromJSON() failed [maximum_response_time]"); + goto end; + } + + cJSON *snssai = cJSON_GetObjectItemCaseSensitive(maximum_response_timeJSON, "snssai"); + + OpenAPI_snssai_t *snssai_local_nonprim = NULL; + if (snssai) { + snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(snssai); + } + + cJSON *dnn = cJSON_GetObjectItemCaseSensitive(maximum_response_timeJSON, "dnn"); + + if (dnn) { + if (!cJSON_IsString(dnn)) { + ogs_error("OpenAPI_maximum_response_time_parseFromJSON() failed [dnn]"); + goto end; + } + } + + cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(maximum_response_timeJSON, "validityTime"); + + if (validity_time) { + if (!cJSON_IsString(validity_time)) { + ogs_error("OpenAPI_maximum_response_time_parseFromJSON() failed [validity_time]"); + goto end; + } + } + + maximum_response_time_local_var = OpenAPI_maximum_response_time_create ( + maximum_response_time->valuedouble, + snssai ? snssai_local_nonprim : NULL, + dnn ? ogs_strdup(dnn->valuestring) : NULL, + validity_time ? ogs_strdup(validity_time->valuestring) : NULL + ); + + return maximum_response_time_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/maximum_response_time.h b/lib/sbi/openapi/model/maximum_response_time.h new file mode 100644 index 0000000000..f1446d2397 --- /dev/null +++ b/lib/sbi/openapi/model/maximum_response_time.h @@ -0,0 +1,44 @@ +/* + * maximum_response_time.h + * + * + */ + +#ifndef _OpenAPI_maximum_response_time_H_ +#define _OpenAPI_maximum_response_time_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "snssai.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_maximum_response_time_s OpenAPI_maximum_response_time_t; +typedef struct OpenAPI_maximum_response_time_s { + int maximum_response_time; + struct OpenAPI_snssai_s *snssai; + char *dnn; + char *validity_time; +} OpenAPI_maximum_response_time_t; + +OpenAPI_maximum_response_time_t *OpenAPI_maximum_response_time_create( + int maximum_response_time, + OpenAPI_snssai_t *snssai, + char *dnn, + char *validity_time + ); +void OpenAPI_maximum_response_time_free(OpenAPI_maximum_response_time_t *maximum_response_time); +OpenAPI_maximum_response_time_t *OpenAPI_maximum_response_time_parseFromJSON(cJSON *maximum_response_timeJSON); +cJSON *OpenAPI_maximum_response_time_convertToJSON(OpenAPI_maximum_response_time_t *maximum_response_time); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_maximum_response_time_H_ */ + diff --git a/lib/sbi/openapi/model/model_5_g_vn_group_configuration.c b/lib/sbi/openapi/model/model_5_g_vn_group_configuration.c new file mode 100644 index 0000000000..13eb855714 --- /dev/null +++ b/lib/sbi/openapi/model/model_5_g_vn_group_configuration.c @@ -0,0 +1,177 @@ + +#include +#include +#include +#include "model_5_g_vn_group_configuration.h" + +OpenAPI_model_5_g_vn_group_configuration_t *OpenAPI_model_5_g_vn_group_configuration_create( + OpenAPI_model_5_g_vn_group_data_t *_5g_vn_group_data, + OpenAPI_list_t *members, + int reference_id, + char *af_instance_id, + char *internal_group_identifier + ) +{ + OpenAPI_model_5_g_vn_group_configuration_t *model_5_g_vn_group_configuration_local_var = OpenAPI_malloc(sizeof(OpenAPI_model_5_g_vn_group_configuration_t)); + if (!model_5_g_vn_group_configuration_local_var) { + return NULL; + } + model_5_g_vn_group_configuration_local_var->_5g_vn_group_data = _5g_vn_group_data; + model_5_g_vn_group_configuration_local_var->members = members; + model_5_g_vn_group_configuration_local_var->reference_id = reference_id; + model_5_g_vn_group_configuration_local_var->af_instance_id = af_instance_id; + model_5_g_vn_group_configuration_local_var->internal_group_identifier = internal_group_identifier; + + return model_5_g_vn_group_configuration_local_var; +} + +void OpenAPI_model_5_g_vn_group_configuration_free(OpenAPI_model_5_g_vn_group_configuration_t *model_5_g_vn_group_configuration) +{ + if (NULL == model_5_g_vn_group_configuration) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_model_5_g_vn_group_data_free(model_5_g_vn_group_configuration->_5g_vn_group_data); + OpenAPI_list_for_each(model_5_g_vn_group_configuration->members, node) { + ogs_free(node->data); + } + OpenAPI_list_free(model_5_g_vn_group_configuration->members); + ogs_free(model_5_g_vn_group_configuration->af_instance_id); + ogs_free(model_5_g_vn_group_configuration->internal_group_identifier); + ogs_free(model_5_g_vn_group_configuration); +} + +cJSON *OpenAPI_model_5_g_vn_group_configuration_convertToJSON(OpenAPI_model_5_g_vn_group_configuration_t *model_5_g_vn_group_configuration) +{ + cJSON *item = NULL; + + if (model_5_g_vn_group_configuration == NULL) { + ogs_error("OpenAPI_model_5_g_vn_group_configuration_convertToJSON() failed [5GVnGroupConfiguration]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (model_5_g_vn_group_configuration->_5g_vn_group_data) { + cJSON *_5g_vn_group_data_local_JSON = OpenAPI_model_5_g_vn_group_data_convertToJSON(model_5_g_vn_group_configuration->_5g_vn_group_data); + if (_5g_vn_group_data_local_JSON == NULL) { + ogs_error("OpenAPI_model_5_g_vn_group_configuration_convertToJSON() failed [_5g_vn_group_data]"); + goto end; + } + cJSON_AddItemToObject(item, "5gVnGroupData", _5g_vn_group_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_model_5_g_vn_group_configuration_convertToJSON() failed [_5g_vn_group_data]"); + goto end; + } + } + + if (model_5_g_vn_group_configuration->members) { + cJSON *members = cJSON_AddArrayToObject(item, "members"); + if (members == NULL) { + ogs_error("OpenAPI_model_5_g_vn_group_configuration_convertToJSON() failed [members]"); + goto end; + } + + OpenAPI_lnode_t *members_node; + OpenAPI_list_for_each(model_5_g_vn_group_configuration->members, members_node) { + if (cJSON_AddStringToObject(members, "", (char*)members_node->data) == NULL) { + ogs_error("OpenAPI_model_5_g_vn_group_configuration_convertToJSON() failed [members]"); + goto end; + } + } + } + + if (model_5_g_vn_group_configuration->reference_id) { + if (cJSON_AddNumberToObject(item, "referenceId", model_5_g_vn_group_configuration->reference_id) == NULL) { + ogs_error("OpenAPI_model_5_g_vn_group_configuration_convertToJSON() failed [reference_id]"); + goto end; + } + } + + if (model_5_g_vn_group_configuration->af_instance_id) { + if (cJSON_AddStringToObject(item, "afInstanceId", model_5_g_vn_group_configuration->af_instance_id) == NULL) { + ogs_error("OpenAPI_model_5_g_vn_group_configuration_convertToJSON() failed [af_instance_id]"); + goto end; + } + } + + if (model_5_g_vn_group_configuration->internal_group_identifier) { + if (cJSON_AddStringToObject(item, "internalGroupIdentifier", model_5_g_vn_group_configuration->internal_group_identifier) == NULL) { + ogs_error("OpenAPI_model_5_g_vn_group_configuration_convertToJSON() failed [internal_group_identifier]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_model_5_g_vn_group_configuration_t *OpenAPI_model_5_g_vn_group_configuration_parseFromJSON(cJSON *model_5_g_vn_group_configurationJSON) +{ + OpenAPI_model_5_g_vn_group_configuration_t *model_5_g_vn_group_configuration_local_var = NULL; + cJSON *_5g_vn_group_data = cJSON_GetObjectItemCaseSensitive(model_5_g_vn_group_configurationJSON, "5gVnGroupData"); + + OpenAPI_model_5_g_vn_group_data_t *_5g_vn_group_data_local_nonprim = NULL; + if (_5g_vn_group_data) { + _5g_vn_group_data_local_nonprim = OpenAPI_model_5_g_vn_group_data_parseFromJSON(_5g_vn_group_data); + } + + cJSON *members = cJSON_GetObjectItemCaseSensitive(model_5_g_vn_group_configurationJSON, "members"); + + OpenAPI_list_t *membersList; + if (members) { + cJSON *members_local; + if (!cJSON_IsArray(members)) { + ogs_error("OpenAPI_model_5_g_vn_group_configuration_parseFromJSON() failed [members]"); + goto end; + } + membersList = OpenAPI_list_create(); + + cJSON_ArrayForEach(members_local, members) { + if (!cJSON_IsString(members_local)) { + ogs_error("OpenAPI_model_5_g_vn_group_configuration_parseFromJSON() failed [members]"); + goto end; + } + OpenAPI_list_add(membersList, ogs_strdup(members_local->valuestring)); + } + } + + cJSON *reference_id = cJSON_GetObjectItemCaseSensitive(model_5_g_vn_group_configurationJSON, "referenceId"); + + if (reference_id) { + if (!cJSON_IsNumber(reference_id)) { + ogs_error("OpenAPI_model_5_g_vn_group_configuration_parseFromJSON() failed [reference_id]"); + goto end; + } + } + + cJSON *af_instance_id = cJSON_GetObjectItemCaseSensitive(model_5_g_vn_group_configurationJSON, "afInstanceId"); + + if (af_instance_id) { + if (!cJSON_IsString(af_instance_id)) { + ogs_error("OpenAPI_model_5_g_vn_group_configuration_parseFromJSON() failed [af_instance_id]"); + goto end; + } + } + + cJSON *internal_group_identifier = cJSON_GetObjectItemCaseSensitive(model_5_g_vn_group_configurationJSON, "internalGroupIdentifier"); + + if (internal_group_identifier) { + if (!cJSON_IsString(internal_group_identifier)) { + ogs_error("OpenAPI_model_5_g_vn_group_configuration_parseFromJSON() failed [internal_group_identifier]"); + goto end; + } + } + + model_5_g_vn_group_configuration_local_var = OpenAPI_model_5_g_vn_group_configuration_create ( + _5g_vn_group_data ? _5g_vn_group_data_local_nonprim : NULL, + members ? membersList : NULL, + reference_id ? reference_id->valuedouble : 0, + af_instance_id ? ogs_strdup(af_instance_id->valuestring) : NULL, + internal_group_identifier ? ogs_strdup(internal_group_identifier->valuestring) : NULL + ); + + return model_5_g_vn_group_configuration_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/model_5_g_vn_group_configuration.h b/lib/sbi/openapi/model/model_5_g_vn_group_configuration.h new file mode 100644 index 0000000000..d041ce87ae --- /dev/null +++ b/lib/sbi/openapi/model/model_5_g_vn_group_configuration.h @@ -0,0 +1,46 @@ +/* + * model_5_g_vn_group_configuration.h + * + * + */ + +#ifndef _OpenAPI_model_5_g_vn_group_configuration_H_ +#define _OpenAPI_model_5_g_vn_group_configuration_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "model_5_g_vn_group_data.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_model_5_g_vn_group_configuration_s OpenAPI_model_5_g_vn_group_configuration_t; +typedef struct OpenAPI_model_5_g_vn_group_configuration_s { + struct OpenAPI_model_5_g_vn_group_data_s *_5g_vn_group_data; + OpenAPI_list_t *members; + int reference_id; + char *af_instance_id; + char *internal_group_identifier; +} OpenAPI_model_5_g_vn_group_configuration_t; + +OpenAPI_model_5_g_vn_group_configuration_t *OpenAPI_model_5_g_vn_group_configuration_create( + OpenAPI_model_5_g_vn_group_data_t *_5g_vn_group_data, + OpenAPI_list_t *members, + int reference_id, + char *af_instance_id, + char *internal_group_identifier + ); +void OpenAPI_model_5_g_vn_group_configuration_free(OpenAPI_model_5_g_vn_group_configuration_t *model_5_g_vn_group_configuration); +OpenAPI_model_5_g_vn_group_configuration_t *OpenAPI_model_5_g_vn_group_configuration_parseFromJSON(cJSON *model_5_g_vn_group_configurationJSON); +cJSON *OpenAPI_model_5_g_vn_group_configuration_convertToJSON(OpenAPI_model_5_g_vn_group_configuration_t *model_5_g_vn_group_configuration); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_model_5_g_vn_group_configuration_H_ */ + diff --git a/lib/sbi/openapi/model/model_5_g_vn_group_data.c b/lib/sbi/openapi/model/model_5_g_vn_group_data.c new file mode 100644 index 0000000000..c06d8e4dee --- /dev/null +++ b/lib/sbi/openapi/model/model_5_g_vn_group_data.c @@ -0,0 +1,205 @@ + +#include +#include +#include +#include "model_5_g_vn_group_data.h" + +OpenAPI_model_5_g_vn_group_data_t *OpenAPI_model_5_g_vn_group_data_create( + char *dnn, + OpenAPI_snssai_t *s_nssai, + OpenAPI_list_t *pdu_session_types, + OpenAPI_list_t *app_descriptors + ) +{ + OpenAPI_model_5_g_vn_group_data_t *model_5_g_vn_group_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_model_5_g_vn_group_data_t)); + if (!model_5_g_vn_group_data_local_var) { + return NULL; + } + model_5_g_vn_group_data_local_var->dnn = dnn; + model_5_g_vn_group_data_local_var->s_nssai = s_nssai; + model_5_g_vn_group_data_local_var->pdu_session_types = pdu_session_types; + model_5_g_vn_group_data_local_var->app_descriptors = app_descriptors; + + return model_5_g_vn_group_data_local_var; +} + +void OpenAPI_model_5_g_vn_group_data_free(OpenAPI_model_5_g_vn_group_data_t *model_5_g_vn_group_data) +{ + if (NULL == model_5_g_vn_group_data) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(model_5_g_vn_group_data->dnn); + OpenAPI_snssai_free(model_5_g_vn_group_data->s_nssai); + OpenAPI_list_for_each(model_5_g_vn_group_data->pdu_session_types, node) { + OpenAPI_pdu_session_type_free(node->data); + } + OpenAPI_list_free(model_5_g_vn_group_data->pdu_session_types); + OpenAPI_list_for_each(model_5_g_vn_group_data->app_descriptors, node) { + OpenAPI_app_descriptor_free(node->data); + } + OpenAPI_list_free(model_5_g_vn_group_data->app_descriptors); + ogs_free(model_5_g_vn_group_data); +} + +cJSON *OpenAPI_model_5_g_vn_group_data_convertToJSON(OpenAPI_model_5_g_vn_group_data_t *model_5_g_vn_group_data) +{ + cJSON *item = NULL; + + if (model_5_g_vn_group_data == NULL) { + ogs_error("OpenAPI_model_5_g_vn_group_data_convertToJSON() failed [5GVnGroupData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!model_5_g_vn_group_data->dnn) { + ogs_error("OpenAPI_model_5_g_vn_group_data_convertToJSON() failed [dnn]"); + goto end; + } + if (cJSON_AddStringToObject(item, "dnn", model_5_g_vn_group_data->dnn) == NULL) { + ogs_error("OpenAPI_model_5_g_vn_group_data_convertToJSON() failed [dnn]"); + goto end; + } + + if (!model_5_g_vn_group_data->s_nssai) { + ogs_error("OpenAPI_model_5_g_vn_group_data_convertToJSON() failed [s_nssai]"); + goto end; + } + cJSON *s_nssai_local_JSON = OpenAPI_snssai_convertToJSON(model_5_g_vn_group_data->s_nssai); + if (s_nssai_local_JSON == NULL) { + ogs_error("OpenAPI_model_5_g_vn_group_data_convertToJSON() failed [s_nssai]"); + goto end; + } + cJSON_AddItemToObject(item, "sNssai", s_nssai_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_model_5_g_vn_group_data_convertToJSON() failed [s_nssai]"); + goto end; + } + + if (model_5_g_vn_group_data->pdu_session_types) { + cJSON *pdu_session_typesList = cJSON_AddArrayToObject(item, "pduSessionTypes"); + if (pdu_session_typesList == NULL) { + ogs_error("OpenAPI_model_5_g_vn_group_data_convertToJSON() failed [pdu_session_types]"); + goto end; + } + + OpenAPI_lnode_t *pdu_session_types_node; + if (model_5_g_vn_group_data->pdu_session_types) { + OpenAPI_list_for_each(model_5_g_vn_group_data->pdu_session_types, pdu_session_types_node) { + cJSON *itemLocal = OpenAPI_pdu_session_type_convertToJSON(pdu_session_types_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_model_5_g_vn_group_data_convertToJSON() failed [pdu_session_types]"); + goto end; + } + cJSON_AddItemToArray(pdu_session_typesList, itemLocal); + } + } + } + + if (model_5_g_vn_group_data->app_descriptors) { + cJSON *app_descriptorsList = cJSON_AddArrayToObject(item, "appDescriptors"); + if (app_descriptorsList == NULL) { + ogs_error("OpenAPI_model_5_g_vn_group_data_convertToJSON() failed [app_descriptors]"); + goto end; + } + + OpenAPI_lnode_t *app_descriptors_node; + if (model_5_g_vn_group_data->app_descriptors) { + OpenAPI_list_for_each(model_5_g_vn_group_data->app_descriptors, app_descriptors_node) { + cJSON *itemLocal = OpenAPI_app_descriptor_convertToJSON(app_descriptors_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_model_5_g_vn_group_data_convertToJSON() failed [app_descriptors]"); + goto end; + } + cJSON_AddItemToArray(app_descriptorsList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_model_5_g_vn_group_data_t *OpenAPI_model_5_g_vn_group_data_parseFromJSON(cJSON *model_5_g_vn_group_dataJSON) +{ + OpenAPI_model_5_g_vn_group_data_t *model_5_g_vn_group_data_local_var = NULL; + cJSON *dnn = cJSON_GetObjectItemCaseSensitive(model_5_g_vn_group_dataJSON, "dnn"); + if (!dnn) { + ogs_error("OpenAPI_model_5_g_vn_group_data_parseFromJSON() failed [dnn]"); + goto end; + } + + + if (!cJSON_IsString(dnn)) { + ogs_error("OpenAPI_model_5_g_vn_group_data_parseFromJSON() failed [dnn]"); + goto end; + } + + cJSON *s_nssai = cJSON_GetObjectItemCaseSensitive(model_5_g_vn_group_dataJSON, "sNssai"); + if (!s_nssai) { + ogs_error("OpenAPI_model_5_g_vn_group_data_parseFromJSON() failed [s_nssai]"); + goto end; + } + + OpenAPI_snssai_t *s_nssai_local_nonprim = NULL; + + s_nssai_local_nonprim = OpenAPI_snssai_parseFromJSON(s_nssai); + + cJSON *pdu_session_types = cJSON_GetObjectItemCaseSensitive(model_5_g_vn_group_dataJSON, "pduSessionTypes"); + + OpenAPI_list_t *pdu_session_typesList; + if (pdu_session_types) { + cJSON *pdu_session_types_local_nonprimitive; + if (!cJSON_IsArray(pdu_session_types)) { + ogs_error("OpenAPI_model_5_g_vn_group_data_parseFromJSON() failed [pdu_session_types]"); + goto end; + } + + pdu_session_typesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pdu_session_types_local_nonprimitive, pdu_session_types ) { + if (!cJSON_IsObject(pdu_session_types_local_nonprimitive)) { + ogs_error("OpenAPI_model_5_g_vn_group_data_parseFromJSON() failed [pdu_session_types]"); + goto end; + } + OpenAPI_pdu_session_type_t *pdu_session_typesItem = OpenAPI_pdu_session_type_parseFromJSON(pdu_session_types_local_nonprimitive); + + OpenAPI_list_add(pdu_session_typesList, pdu_session_typesItem); + } + } + + cJSON *app_descriptors = cJSON_GetObjectItemCaseSensitive(model_5_g_vn_group_dataJSON, "appDescriptors"); + + OpenAPI_list_t *app_descriptorsList; + if (app_descriptors) { + cJSON *app_descriptors_local_nonprimitive; + if (!cJSON_IsArray(app_descriptors)) { + ogs_error("OpenAPI_model_5_g_vn_group_data_parseFromJSON() failed [app_descriptors]"); + goto end; + } + + app_descriptorsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(app_descriptors_local_nonprimitive, app_descriptors ) { + if (!cJSON_IsObject(app_descriptors_local_nonprimitive)) { + ogs_error("OpenAPI_model_5_g_vn_group_data_parseFromJSON() failed [app_descriptors]"); + goto end; + } + OpenAPI_app_descriptor_t *app_descriptorsItem = OpenAPI_app_descriptor_parseFromJSON(app_descriptors_local_nonprimitive); + + OpenAPI_list_add(app_descriptorsList, app_descriptorsItem); + } + } + + model_5_g_vn_group_data_local_var = OpenAPI_model_5_g_vn_group_data_create ( + ogs_strdup(dnn->valuestring), + s_nssai_local_nonprim, + pdu_session_types ? pdu_session_typesList : NULL, + app_descriptors ? app_descriptorsList : NULL + ); + + return model_5_g_vn_group_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/model_5_g_vn_group_data.h b/lib/sbi/openapi/model/model_5_g_vn_group_data.h new file mode 100644 index 0000000000..2720e8a33d --- /dev/null +++ b/lib/sbi/openapi/model/model_5_g_vn_group_data.h @@ -0,0 +1,46 @@ +/* + * model_5_g_vn_group_data.h + * + * + */ + +#ifndef _OpenAPI_model_5_g_vn_group_data_H_ +#define _OpenAPI_model_5_g_vn_group_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "app_descriptor.h" +#include "pdu_session_type.h" +#include "snssai.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_model_5_g_vn_group_data_s OpenAPI_model_5_g_vn_group_data_t; +typedef struct OpenAPI_model_5_g_vn_group_data_s { + char *dnn; + struct OpenAPI_snssai_s *s_nssai; + OpenAPI_list_t *pdu_session_types; + OpenAPI_list_t *app_descriptors; +} OpenAPI_model_5_g_vn_group_data_t; + +OpenAPI_model_5_g_vn_group_data_t *OpenAPI_model_5_g_vn_group_data_create( + char *dnn, + OpenAPI_snssai_t *s_nssai, + OpenAPI_list_t *pdu_session_types, + OpenAPI_list_t *app_descriptors + ); +void OpenAPI_model_5_g_vn_group_data_free(OpenAPI_model_5_g_vn_group_data_t *model_5_g_vn_group_data); +OpenAPI_model_5_g_vn_group_data_t *OpenAPI_model_5_g_vn_group_data_parseFromJSON(cJSON *model_5_g_vn_group_dataJSON); +cJSON *OpenAPI_model_5_g_vn_group_data_convertToJSON(OpenAPI_model_5_g_vn_group_data_t *model_5_g_vn_group_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_model_5_g_vn_group_data_H_ */ + diff --git a/lib/sbi/openapi/model/modification_notification.c b/lib/sbi/openapi/model/modification_notification.c new file mode 100644 index 0000000000..e14e14f125 --- /dev/null +++ b/lib/sbi/openapi/model/modification_notification.c @@ -0,0 +1,106 @@ + +#include +#include +#include +#include "modification_notification.h" + +OpenAPI_modification_notification_t *OpenAPI_modification_notification_create( + OpenAPI_list_t *notify_items + ) +{ + OpenAPI_modification_notification_t *modification_notification_local_var = OpenAPI_malloc(sizeof(OpenAPI_modification_notification_t)); + if (!modification_notification_local_var) { + return NULL; + } + modification_notification_local_var->notify_items = notify_items; + + return modification_notification_local_var; +} + +void OpenAPI_modification_notification_free(OpenAPI_modification_notification_t *modification_notification) +{ + if (NULL == modification_notification) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(modification_notification->notify_items, node) { + OpenAPI_notify_item_free(node->data); + } + OpenAPI_list_free(modification_notification->notify_items); + ogs_free(modification_notification); +} + +cJSON *OpenAPI_modification_notification_convertToJSON(OpenAPI_modification_notification_t *modification_notification) +{ + cJSON *item = NULL; + + if (modification_notification == NULL) { + ogs_error("OpenAPI_modification_notification_convertToJSON() failed [ModificationNotification]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!modification_notification->notify_items) { + ogs_error("OpenAPI_modification_notification_convertToJSON() failed [notify_items]"); + goto end; + } + cJSON *notify_itemsList = cJSON_AddArrayToObject(item, "notifyItems"); + if (notify_itemsList == NULL) { + ogs_error("OpenAPI_modification_notification_convertToJSON() failed [notify_items]"); + goto end; + } + + OpenAPI_lnode_t *notify_items_node; + if (modification_notification->notify_items) { + OpenAPI_list_for_each(modification_notification->notify_items, notify_items_node) { + cJSON *itemLocal = OpenAPI_notify_item_convertToJSON(notify_items_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_modification_notification_convertToJSON() failed [notify_items]"); + goto end; + } + cJSON_AddItemToArray(notify_itemsList, itemLocal); + } + } + +end: + return item; +} + +OpenAPI_modification_notification_t *OpenAPI_modification_notification_parseFromJSON(cJSON *modification_notificationJSON) +{ + OpenAPI_modification_notification_t *modification_notification_local_var = NULL; + cJSON *notify_items = cJSON_GetObjectItemCaseSensitive(modification_notificationJSON, "notifyItems"); + if (!notify_items) { + ogs_error("OpenAPI_modification_notification_parseFromJSON() failed [notify_items]"); + goto end; + } + + OpenAPI_list_t *notify_itemsList; + + cJSON *notify_items_local_nonprimitive; + if (!cJSON_IsArray(notify_items)) { + ogs_error("OpenAPI_modification_notification_parseFromJSON() failed [notify_items]"); + goto end; + } + + notify_itemsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(notify_items_local_nonprimitive, notify_items ) { + if (!cJSON_IsObject(notify_items_local_nonprimitive)) { + ogs_error("OpenAPI_modification_notification_parseFromJSON() failed [notify_items]"); + goto end; + } + OpenAPI_notify_item_t *notify_itemsItem = OpenAPI_notify_item_parseFromJSON(notify_items_local_nonprimitive); + + OpenAPI_list_add(notify_itemsList, notify_itemsItem); + } + + modification_notification_local_var = OpenAPI_modification_notification_create ( + notify_itemsList + ); + + return modification_notification_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/modification_notification.h b/lib/sbi/openapi/model/modification_notification.h new file mode 100644 index 0000000000..65b16efd1a --- /dev/null +++ b/lib/sbi/openapi/model/modification_notification.h @@ -0,0 +1,38 @@ +/* + * modification_notification.h + * + * + */ + +#ifndef _OpenAPI_modification_notification_H_ +#define _OpenAPI_modification_notification_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "notify_item.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_modification_notification_s OpenAPI_modification_notification_t; +typedef struct OpenAPI_modification_notification_s { + OpenAPI_list_t *notify_items; +} OpenAPI_modification_notification_t; + +OpenAPI_modification_notification_t *OpenAPI_modification_notification_create( + OpenAPI_list_t *notify_items + ); +void OpenAPI_modification_notification_free(OpenAPI_modification_notification_t *modification_notification); +OpenAPI_modification_notification_t *OpenAPI_modification_notification_parseFromJSON(cJSON *modification_notificationJSON); +cJSON *OpenAPI_modification_notification_convertToJSON(OpenAPI_modification_notification_t *modification_notification); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_modification_notification_H_ */ + diff --git a/lib/sbi/openapi/model/monitoring_configuration.c b/lib/sbi/openapi/model/monitoring_configuration.c new file mode 100644 index 0000000000..55f24ae9f0 --- /dev/null +++ b/lib/sbi/openapi/model/monitoring_configuration.c @@ -0,0 +1,171 @@ + +#include +#include +#include +#include "monitoring_configuration.h" + +OpenAPI_monitoring_configuration_t *OpenAPI_monitoring_configuration_create( + OpenAPI_event_type_t *event_type, + int immediate_flag, + OpenAPI_location_reporting_configuration_t *location_reporting_configuration, + OpenAPI_association_type_t *association_type, + OpenAPI_datalink_reporting_configuration_t *datalink_report_cfg + ) +{ + OpenAPI_monitoring_configuration_t *monitoring_configuration_local_var = OpenAPI_malloc(sizeof(OpenAPI_monitoring_configuration_t)); + if (!monitoring_configuration_local_var) { + return NULL; + } + monitoring_configuration_local_var->event_type = event_type; + monitoring_configuration_local_var->immediate_flag = immediate_flag; + monitoring_configuration_local_var->location_reporting_configuration = location_reporting_configuration; + monitoring_configuration_local_var->association_type = association_type; + monitoring_configuration_local_var->datalink_report_cfg = datalink_report_cfg; + + return monitoring_configuration_local_var; +} + +void OpenAPI_monitoring_configuration_free(OpenAPI_monitoring_configuration_t *monitoring_configuration) +{ + if (NULL == monitoring_configuration) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_event_type_free(monitoring_configuration->event_type); + OpenAPI_location_reporting_configuration_free(monitoring_configuration->location_reporting_configuration); + OpenAPI_association_type_free(monitoring_configuration->association_type); + OpenAPI_datalink_reporting_configuration_free(monitoring_configuration->datalink_report_cfg); + ogs_free(monitoring_configuration); +} + +cJSON *OpenAPI_monitoring_configuration_convertToJSON(OpenAPI_monitoring_configuration_t *monitoring_configuration) +{ + cJSON *item = NULL; + + if (monitoring_configuration == NULL) { + ogs_error("OpenAPI_monitoring_configuration_convertToJSON() failed [MonitoringConfiguration]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!monitoring_configuration->event_type) { + ogs_error("OpenAPI_monitoring_configuration_convertToJSON() failed [event_type]"); + goto end; + } + cJSON *event_type_local_JSON = OpenAPI_event_type_convertToJSON(monitoring_configuration->event_type); + if (event_type_local_JSON == NULL) { + ogs_error("OpenAPI_monitoring_configuration_convertToJSON() failed [event_type]"); + goto end; + } + cJSON_AddItemToObject(item, "eventType", event_type_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_monitoring_configuration_convertToJSON() failed [event_type]"); + goto end; + } + + if (monitoring_configuration->immediate_flag >= 0) { + if (cJSON_AddBoolToObject(item, "immediateFlag", monitoring_configuration->immediate_flag) == NULL) { + ogs_error("OpenAPI_monitoring_configuration_convertToJSON() failed [immediate_flag]"); + goto end; + } + } + + if (monitoring_configuration->location_reporting_configuration) { + cJSON *location_reporting_configuration_local_JSON = OpenAPI_location_reporting_configuration_convertToJSON(monitoring_configuration->location_reporting_configuration); + if (location_reporting_configuration_local_JSON == NULL) { + ogs_error("OpenAPI_monitoring_configuration_convertToJSON() failed [location_reporting_configuration]"); + goto end; + } + cJSON_AddItemToObject(item, "locationReportingConfiguration", location_reporting_configuration_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_monitoring_configuration_convertToJSON() failed [location_reporting_configuration]"); + goto end; + } + } + + if (monitoring_configuration->association_type) { + cJSON *association_type_local_JSON = OpenAPI_association_type_convertToJSON(monitoring_configuration->association_type); + if (association_type_local_JSON == NULL) { + ogs_error("OpenAPI_monitoring_configuration_convertToJSON() failed [association_type]"); + goto end; + } + cJSON_AddItemToObject(item, "associationType", association_type_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_monitoring_configuration_convertToJSON() failed [association_type]"); + goto end; + } + } + + if (monitoring_configuration->datalink_report_cfg) { + cJSON *datalink_report_cfg_local_JSON = OpenAPI_datalink_reporting_configuration_convertToJSON(monitoring_configuration->datalink_report_cfg); + if (datalink_report_cfg_local_JSON == NULL) { + ogs_error("OpenAPI_monitoring_configuration_convertToJSON() failed [datalink_report_cfg]"); + goto end; + } + cJSON_AddItemToObject(item, "datalinkReportCfg", datalink_report_cfg_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_monitoring_configuration_convertToJSON() failed [datalink_report_cfg]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_monitoring_configuration_t *OpenAPI_monitoring_configuration_parseFromJSON(cJSON *monitoring_configurationJSON) +{ + OpenAPI_monitoring_configuration_t *monitoring_configuration_local_var = NULL; + cJSON *event_type = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "eventType"); + if (!event_type) { + ogs_error("OpenAPI_monitoring_configuration_parseFromJSON() failed [event_type]"); + goto end; + } + + OpenAPI_event_type_t *event_type_local_nonprim = NULL; + + event_type_local_nonprim = OpenAPI_event_type_parseFromJSON(event_type); + + cJSON *immediate_flag = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "immediateFlag"); + + if (immediate_flag) { + if (!cJSON_IsBool(immediate_flag)) { + ogs_error("OpenAPI_monitoring_configuration_parseFromJSON() failed [immediate_flag]"); + goto end; + } + } + + cJSON *location_reporting_configuration = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "locationReportingConfiguration"); + + OpenAPI_location_reporting_configuration_t *location_reporting_configuration_local_nonprim = NULL; + if (location_reporting_configuration) { + location_reporting_configuration_local_nonprim = OpenAPI_location_reporting_configuration_parseFromJSON(location_reporting_configuration); + } + + cJSON *association_type = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "associationType"); + + OpenAPI_association_type_t *association_type_local_nonprim = NULL; + if (association_type) { + association_type_local_nonprim = OpenAPI_association_type_parseFromJSON(association_type); + } + + cJSON *datalink_report_cfg = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "datalinkReportCfg"); + + OpenAPI_datalink_reporting_configuration_t *datalink_report_cfg_local_nonprim = NULL; + if (datalink_report_cfg) { + datalink_report_cfg_local_nonprim = OpenAPI_datalink_reporting_configuration_parseFromJSON(datalink_report_cfg); + } + + monitoring_configuration_local_var = OpenAPI_monitoring_configuration_create ( + event_type_local_nonprim, + immediate_flag ? immediate_flag->valueint : 0, + location_reporting_configuration ? location_reporting_configuration_local_nonprim : NULL, + association_type ? association_type_local_nonprim : NULL, + datalink_report_cfg ? datalink_report_cfg_local_nonprim : NULL + ); + + return monitoring_configuration_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/monitoring_configuration.h b/lib/sbi/openapi/model/monitoring_configuration.h new file mode 100644 index 0000000000..caf3dc01ff --- /dev/null +++ b/lib/sbi/openapi/model/monitoring_configuration.h @@ -0,0 +1,49 @@ +/* + * monitoring_configuration.h + * + * + */ + +#ifndef _OpenAPI_monitoring_configuration_H_ +#define _OpenAPI_monitoring_configuration_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "association_type.h" +#include "datalink_reporting_configuration.h" +#include "event_type.h" +#include "location_reporting_configuration.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_monitoring_configuration_s OpenAPI_monitoring_configuration_t; +typedef struct OpenAPI_monitoring_configuration_s { + struct OpenAPI_event_type_s *event_type; + int immediate_flag; + struct OpenAPI_location_reporting_configuration_s *location_reporting_configuration; + struct OpenAPI_association_type_s *association_type; + struct OpenAPI_datalink_reporting_configuration_s *datalink_report_cfg; +} OpenAPI_monitoring_configuration_t; + +OpenAPI_monitoring_configuration_t *OpenAPI_monitoring_configuration_create( + OpenAPI_event_type_t *event_type, + int immediate_flag, + OpenAPI_location_reporting_configuration_t *location_reporting_configuration, + OpenAPI_association_type_t *association_type, + OpenAPI_datalink_reporting_configuration_t *datalink_report_cfg + ); +void OpenAPI_monitoring_configuration_free(OpenAPI_monitoring_configuration_t *monitoring_configuration); +OpenAPI_monitoring_configuration_t *OpenAPI_monitoring_configuration_parseFromJSON(cJSON *monitoring_configurationJSON); +cJSON *OpenAPI_monitoring_configuration_convertToJSON(OpenAPI_monitoring_configuration_t *monitoring_configuration); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_monitoring_configuration_H_ */ + diff --git a/lib/sbi/openapi/model/multicast_access_control.c b/lib/sbi/openapi/model/multicast_access_control.c new file mode 100644 index 0000000000..00f337f5a3 --- /dev/null +++ b/lib/sbi/openapi/model/multicast_access_control.c @@ -0,0 +1,160 @@ + +#include +#include +#include +#include "multicast_access_control.h" + +OpenAPI_multicast_access_control_t *OpenAPI_multicast_access_control_create( + char *src_ipv4_addr, + char *src_ipv6_addr, + char *multicast_v4_addr, + char *multicast_v6_addr, + OpenAPI_access_right_status_t *acc_status + ) +{ + OpenAPI_multicast_access_control_t *multicast_access_control_local_var = OpenAPI_malloc(sizeof(OpenAPI_multicast_access_control_t)); + if (!multicast_access_control_local_var) { + return NULL; + } + multicast_access_control_local_var->src_ipv4_addr = src_ipv4_addr; + multicast_access_control_local_var->src_ipv6_addr = src_ipv6_addr; + multicast_access_control_local_var->multicast_v4_addr = multicast_v4_addr; + multicast_access_control_local_var->multicast_v6_addr = multicast_v6_addr; + multicast_access_control_local_var->acc_status = acc_status; + + return multicast_access_control_local_var; +} + +void OpenAPI_multicast_access_control_free(OpenAPI_multicast_access_control_t *multicast_access_control) +{ + if (NULL == multicast_access_control) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(multicast_access_control->src_ipv4_addr); + ogs_free(multicast_access_control->src_ipv6_addr); + ogs_free(multicast_access_control->multicast_v4_addr); + ogs_free(multicast_access_control->multicast_v6_addr); + OpenAPI_access_right_status_free(multicast_access_control->acc_status); + ogs_free(multicast_access_control); +} + +cJSON *OpenAPI_multicast_access_control_convertToJSON(OpenAPI_multicast_access_control_t *multicast_access_control) +{ + cJSON *item = NULL; + + if (multicast_access_control == NULL) { + ogs_error("OpenAPI_multicast_access_control_convertToJSON() failed [MulticastAccessControl]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (multicast_access_control->src_ipv4_addr) { + if (cJSON_AddStringToObject(item, "srcIpv4Addr", multicast_access_control->src_ipv4_addr) == NULL) { + ogs_error("OpenAPI_multicast_access_control_convertToJSON() failed [src_ipv4_addr]"); + goto end; + } + } + + if (multicast_access_control->src_ipv6_addr) { + if (cJSON_AddStringToObject(item, "srcIpv6Addr", multicast_access_control->src_ipv6_addr) == NULL) { + ogs_error("OpenAPI_multicast_access_control_convertToJSON() failed [src_ipv6_addr]"); + goto end; + } + } + + if (multicast_access_control->multicast_v4_addr) { + if (cJSON_AddStringToObject(item, "multicastV4Addr", multicast_access_control->multicast_v4_addr) == NULL) { + ogs_error("OpenAPI_multicast_access_control_convertToJSON() failed [multicast_v4_addr]"); + goto end; + } + } + + if (multicast_access_control->multicast_v6_addr) { + if (cJSON_AddStringToObject(item, "multicastV6Addr", multicast_access_control->multicast_v6_addr) == NULL) { + ogs_error("OpenAPI_multicast_access_control_convertToJSON() failed [multicast_v6_addr]"); + goto end; + } + } + + if (!multicast_access_control->acc_status) { + ogs_error("OpenAPI_multicast_access_control_convertToJSON() failed [acc_status]"); + goto end; + } + cJSON *acc_status_local_JSON = OpenAPI_access_right_status_convertToJSON(multicast_access_control->acc_status); + if (acc_status_local_JSON == NULL) { + ogs_error("OpenAPI_multicast_access_control_convertToJSON() failed [acc_status]"); + goto end; + } + cJSON_AddItemToObject(item, "accStatus", acc_status_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_multicast_access_control_convertToJSON() failed [acc_status]"); + goto end; + } + +end: + return item; +} + +OpenAPI_multicast_access_control_t *OpenAPI_multicast_access_control_parseFromJSON(cJSON *multicast_access_controlJSON) +{ + OpenAPI_multicast_access_control_t *multicast_access_control_local_var = NULL; + cJSON *src_ipv4_addr = cJSON_GetObjectItemCaseSensitive(multicast_access_controlJSON, "srcIpv4Addr"); + + if (src_ipv4_addr) { + if (!cJSON_IsString(src_ipv4_addr)) { + ogs_error("OpenAPI_multicast_access_control_parseFromJSON() failed [src_ipv4_addr]"); + goto end; + } + } + + cJSON *src_ipv6_addr = cJSON_GetObjectItemCaseSensitive(multicast_access_controlJSON, "srcIpv6Addr"); + + if (src_ipv6_addr) { + if (!cJSON_IsString(src_ipv6_addr)) { + ogs_error("OpenAPI_multicast_access_control_parseFromJSON() failed [src_ipv6_addr]"); + goto end; + } + } + + cJSON *multicast_v4_addr = cJSON_GetObjectItemCaseSensitive(multicast_access_controlJSON, "multicastV4Addr"); + + if (multicast_v4_addr) { + if (!cJSON_IsString(multicast_v4_addr)) { + ogs_error("OpenAPI_multicast_access_control_parseFromJSON() failed [multicast_v4_addr]"); + goto end; + } + } + + cJSON *multicast_v6_addr = cJSON_GetObjectItemCaseSensitive(multicast_access_controlJSON, "multicastV6Addr"); + + if (multicast_v6_addr) { + if (!cJSON_IsString(multicast_v6_addr)) { + ogs_error("OpenAPI_multicast_access_control_parseFromJSON() failed [multicast_v6_addr]"); + goto end; + } + } + + cJSON *acc_status = cJSON_GetObjectItemCaseSensitive(multicast_access_controlJSON, "accStatus"); + if (!acc_status) { + ogs_error("OpenAPI_multicast_access_control_parseFromJSON() failed [acc_status]"); + goto end; + } + + OpenAPI_access_right_status_t *acc_status_local_nonprim = NULL; + + acc_status_local_nonprim = OpenAPI_access_right_status_parseFromJSON(acc_status); + + multicast_access_control_local_var = OpenAPI_multicast_access_control_create ( + src_ipv4_addr ? ogs_strdup(src_ipv4_addr->valuestring) : NULL, + src_ipv6_addr ? ogs_strdup(src_ipv6_addr->valuestring) : NULL, + multicast_v4_addr ? ogs_strdup(multicast_v4_addr->valuestring) : NULL, + multicast_v6_addr ? ogs_strdup(multicast_v6_addr->valuestring) : NULL, + acc_status_local_nonprim + ); + + return multicast_access_control_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/multicast_access_control.h b/lib/sbi/openapi/model/multicast_access_control.h new file mode 100644 index 0000000000..dceed62cd4 --- /dev/null +++ b/lib/sbi/openapi/model/multicast_access_control.h @@ -0,0 +1,46 @@ +/* + * multicast_access_control.h + * + * + */ + +#ifndef _OpenAPI_multicast_access_control_H_ +#define _OpenAPI_multicast_access_control_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "access_right_status.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_multicast_access_control_s OpenAPI_multicast_access_control_t; +typedef struct OpenAPI_multicast_access_control_s { + char *src_ipv4_addr; + char *src_ipv6_addr; + char *multicast_v4_addr; + char *multicast_v6_addr; + struct OpenAPI_access_right_status_s *acc_status; +} OpenAPI_multicast_access_control_t; + +OpenAPI_multicast_access_control_t *OpenAPI_multicast_access_control_create( + char *src_ipv4_addr, + char *src_ipv6_addr, + char *multicast_v4_addr, + char *multicast_v6_addr, + OpenAPI_access_right_status_t *acc_status + ); +void OpenAPI_multicast_access_control_free(OpenAPI_multicast_access_control_t *multicast_access_control); +OpenAPI_multicast_access_control_t *OpenAPI_multicast_access_control_parseFromJSON(cJSON *multicast_access_controlJSON); +cJSON *OpenAPI_multicast_access_control_convertToJSON(OpenAPI_multicast_access_control_t *multicast_access_control); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_multicast_access_control_H_ */ + diff --git a/lib/sbi/openapi/model/n1_message_class.c b/lib/sbi/openapi/model/n1_message_class.c index 33c4533468..cc9af7a457 100644 --- a/lib/sbi/openapi/model/n1_message_class.c +++ b/lib/sbi/openapi/model/n1_message_class.c @@ -6,7 +6,7 @@ char* OpenAPI_n1_message_class_ToString(OpenAPI_n1_message_class_e n1_message_class) { - const char *n1_message_classArray[] = { "NULL", "5GMM", "SM", "LPP", "SMS", "UPDP" }; + const char *n1_message_classArray[] = { "NULL", "5GMM", "SM", "LPP", "SMS", "UPDP", "LCS" }; size_t sizeofArray = sizeof(n1_message_classArray) / sizeof(n1_message_classArray[0]); if (n1_message_class < sizeofArray) return (char *)n1_message_classArray[n1_message_class]; @@ -17,7 +17,7 @@ char* OpenAPI_n1_message_class_ToString(OpenAPI_n1_message_class_e n1_message_cl OpenAPI_n1_message_class_e OpenAPI_n1_message_class_FromString(char* n1_message_class) { int stringToReturn = 0; - const char *n1_message_classArray[] = { "NULL", "5GMM", "SM", "LPP", "SMS", "UPDP" }; + const char *n1_message_classArray[] = { "NULL", "5GMM", "SM", "LPP", "SMS", "UPDP", "LCS" }; size_t sizeofArray = sizeof(n1_message_classArray) / sizeof(n1_message_classArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(n1_message_class, n1_message_classArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/n1_message_class.h b/lib/sbi/openapi/model/n1_message_class.h index 2c2cd1112e..d7eaf58b9a 100644 --- a/lib/sbi/openapi/model/n1_message_class.h +++ b/lib/sbi/openapi/model/n1_message_class.h @@ -17,7 +17,7 @@ extern "C" { #endif -typedef enum { OpenAPI_n1_message_class_NULL = 0, OpenAPI_n1_message_class_5GMM, OpenAPI_n1_message_class_SM, OpenAPI_n1_message_class_LPP, OpenAPI_n1_message_class_SMS, OpenAPI_n1_message_class_UPDP } OpenAPI_n1_message_class_e; +typedef enum { OpenAPI_n1_message_class_NULL = 0, OpenAPI_n1_message_class_5GMM, OpenAPI_n1_message_class_SM, OpenAPI_n1_message_class_LPP, OpenAPI_n1_message_class_SMS, OpenAPI_n1_message_class_UPDP, OpenAPI_n1_message_class_LCS } OpenAPI_n1_message_class_e; char* OpenAPI_n1_message_class_ToString(OpenAPI_n1_message_class_e n1_message_class); diff --git a/lib/sbi/openapi/model/n2_interface_amf_info.h b/lib/sbi/openapi/model/n2_interface_amf_info.h index 87807c60df..0f75720511 100644 --- a/lib/sbi/openapi/model/n2_interface_amf_info.h +++ b/lib/sbi/openapi/model/n2_interface_amf_info.h @@ -1,7 +1,7 @@ /* * n2_interface_amf_info.h * - * + * AMF N2 interface information */ #ifndef _OpenAPI_n2_interface_amf_info_H_ diff --git a/lib/sbi/openapi/model/n3ga_location.c b/lib/sbi/openapi/model/n3ga_location.c new file mode 100644 index 0000000000..97e5be9ce5 --- /dev/null +++ b/lib/sbi/openapi/model/n3ga_location.c @@ -0,0 +1,256 @@ + +#include +#include +#include +#include "n3ga_location.h" + +OpenAPI_n3ga_location_t *OpenAPI_n3ga_location_create( + OpenAPI_tai_t *n3gpp_tai, + char *n3_iwf_id, + char *ue_ipv4_addr, + char *ue_ipv6_addr, + int port_number, + char *ss_id, + char *bss_id, + char civic_address, + OpenAPI_hfc_node_id_t *hfc_node_id, + char gli + ) +{ + OpenAPI_n3ga_location_t *n3ga_location_local_var = OpenAPI_malloc(sizeof(OpenAPI_n3ga_location_t)); + if (!n3ga_location_local_var) { + return NULL; + } + n3ga_location_local_var->n3gpp_tai = n3gpp_tai; + n3ga_location_local_var->n3_iwf_id = n3_iwf_id; + n3ga_location_local_var->ue_ipv4_addr = ue_ipv4_addr; + n3ga_location_local_var->ue_ipv6_addr = ue_ipv6_addr; + n3ga_location_local_var->port_number = port_number; + n3ga_location_local_var->ss_id = ss_id; + n3ga_location_local_var->bss_id = bss_id; + n3ga_location_local_var->civic_address = civic_address; + n3ga_location_local_var->hfc_node_id = hfc_node_id; + n3ga_location_local_var->gli = gli; + + return n3ga_location_local_var; +} + +void OpenAPI_n3ga_location_free(OpenAPI_n3ga_location_t *n3ga_location) +{ + if (NULL == n3ga_location) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_tai_free(n3ga_location->n3gpp_tai); + ogs_free(n3ga_location->n3_iwf_id); + ogs_free(n3ga_location->ue_ipv4_addr); + ogs_free(n3ga_location->ue_ipv6_addr); + ogs_free(n3ga_location->ss_id); + ogs_free(n3ga_location->bss_id); + OpenAPI_hfc_node_id_free(n3ga_location->hfc_node_id); + ogs_free(n3ga_location); +} + +cJSON *OpenAPI_n3ga_location_convertToJSON(OpenAPI_n3ga_location_t *n3ga_location) +{ + cJSON *item = NULL; + + if (n3ga_location == NULL) { + ogs_error("OpenAPI_n3ga_location_convertToJSON() failed [N3gaLocation]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (n3ga_location->n3gpp_tai) { + cJSON *n3gpp_tai_local_JSON = OpenAPI_tai_convertToJSON(n3ga_location->n3gpp_tai); + if (n3gpp_tai_local_JSON == NULL) { + ogs_error("OpenAPI_n3ga_location_convertToJSON() failed [n3gpp_tai]"); + goto end; + } + cJSON_AddItemToObject(item, "n3gppTai", n3gpp_tai_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_n3ga_location_convertToJSON() failed [n3gpp_tai]"); + goto end; + } + } + + if (n3ga_location->n3_iwf_id) { + if (cJSON_AddStringToObject(item, "n3IwfId", n3ga_location->n3_iwf_id) == NULL) { + ogs_error("OpenAPI_n3ga_location_convertToJSON() failed [n3_iwf_id]"); + goto end; + } + } + + if (n3ga_location->ue_ipv4_addr) { + if (cJSON_AddStringToObject(item, "ueIpv4Addr", n3ga_location->ue_ipv4_addr) == NULL) { + ogs_error("OpenAPI_n3ga_location_convertToJSON() failed [ue_ipv4_addr]"); + goto end; + } + } + + if (n3ga_location->ue_ipv6_addr) { + if (cJSON_AddStringToObject(item, "ueIpv6Addr", n3ga_location->ue_ipv6_addr) == NULL) { + ogs_error("OpenAPI_n3ga_location_convertToJSON() failed [ue_ipv6_addr]"); + goto end; + } + } + + if (n3ga_location->port_number) { + if (cJSON_AddNumberToObject(item, "portNumber", n3ga_location->port_number) == NULL) { + ogs_error("OpenAPI_n3ga_location_convertToJSON() failed [port_number]"); + goto end; + } + } + + if (n3ga_location->ss_id) { + if (cJSON_AddStringToObject(item, "ssId", n3ga_location->ss_id) == NULL) { + ogs_error("OpenAPI_n3ga_location_convertToJSON() failed [ss_id]"); + goto end; + } + } + + if (n3ga_location->bss_id) { + if (cJSON_AddStringToObject(item, "bssId", n3ga_location->bss_id) == NULL) { + ogs_error("OpenAPI_n3ga_location_convertToJSON() failed [bss_id]"); + goto end; + } + } + + if (n3ga_location->civic_address) { + if (cJSON_AddNumberToObject(item, "civicAddress", n3ga_location->civic_address) == NULL) { + ogs_error("OpenAPI_n3ga_location_convertToJSON() failed [civic_address]"); + goto end; + } + } + + if (n3ga_location->hfc_node_id) { + cJSON *hfc_node_id_local_JSON = OpenAPI_hfc_node_id_convertToJSON(n3ga_location->hfc_node_id); + if (hfc_node_id_local_JSON == NULL) { + ogs_error("OpenAPI_n3ga_location_convertToJSON() failed [hfc_node_id]"); + goto end; + } + cJSON_AddItemToObject(item, "hfcNodeId", hfc_node_id_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_n3ga_location_convertToJSON() failed [hfc_node_id]"); + goto end; + } + } + + if (n3ga_location->gli) { + if (cJSON_AddNumberToObject(item, "gli", n3ga_location->gli) == NULL) { + ogs_error("OpenAPI_n3ga_location_convertToJSON() failed [gli]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_n3ga_location_t *OpenAPI_n3ga_location_parseFromJSON(cJSON *n3ga_locationJSON) +{ + OpenAPI_n3ga_location_t *n3ga_location_local_var = NULL; + cJSON *n3gpp_tai = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "n3gppTai"); + + OpenAPI_tai_t *n3gpp_tai_local_nonprim = NULL; + if (n3gpp_tai) { + n3gpp_tai_local_nonprim = OpenAPI_tai_parseFromJSON(n3gpp_tai); + } + + cJSON *n3_iwf_id = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "n3IwfId"); + + if (n3_iwf_id) { + if (!cJSON_IsString(n3_iwf_id)) { + ogs_error("OpenAPI_n3ga_location_parseFromJSON() failed [n3_iwf_id]"); + goto end; + } + } + + cJSON *ue_ipv4_addr = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "ueIpv4Addr"); + + if (ue_ipv4_addr) { + if (!cJSON_IsString(ue_ipv4_addr)) { + ogs_error("OpenAPI_n3ga_location_parseFromJSON() failed [ue_ipv4_addr]"); + goto end; + } + } + + cJSON *ue_ipv6_addr = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "ueIpv6Addr"); + + if (ue_ipv6_addr) { + if (!cJSON_IsString(ue_ipv6_addr)) { + ogs_error("OpenAPI_n3ga_location_parseFromJSON() failed [ue_ipv6_addr]"); + goto end; + } + } + + cJSON *port_number = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "portNumber"); + + if (port_number) { + if (!cJSON_IsNumber(port_number)) { + ogs_error("OpenAPI_n3ga_location_parseFromJSON() failed [port_number]"); + goto end; + } + } + + cJSON *ss_id = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "ssId"); + + if (ss_id) { + if (!cJSON_IsString(ss_id)) { + ogs_error("OpenAPI_n3ga_location_parseFromJSON() failed [ss_id]"); + goto end; + } + } + + cJSON *bss_id = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "bssId"); + + if (bss_id) { + if (!cJSON_IsString(bss_id)) { + ogs_error("OpenAPI_n3ga_location_parseFromJSON() failed [bss_id]"); + goto end; + } + } + + cJSON *civic_address = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "civicAddress"); + + if (civic_address) { + if (!cJSON_IsNumber(civic_address)) { + ogs_error("OpenAPI_n3ga_location_parseFromJSON() failed [civic_address]"); + goto end; + } + } + + cJSON *hfc_node_id = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "hfcNodeId"); + + OpenAPI_hfc_node_id_t *hfc_node_id_local_nonprim = NULL; + if (hfc_node_id) { + hfc_node_id_local_nonprim = OpenAPI_hfc_node_id_parseFromJSON(hfc_node_id); + } + + cJSON *gli = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "gli"); + + if (gli) { + if (!cJSON_IsNumber(gli)) { + ogs_error("OpenAPI_n3ga_location_parseFromJSON() failed [gli]"); + goto end; + } + } + + n3ga_location_local_var = OpenAPI_n3ga_location_create ( + n3gpp_tai ? n3gpp_tai_local_nonprim : NULL, + n3_iwf_id ? ogs_strdup(n3_iwf_id->valuestring) : NULL, + ue_ipv4_addr ? ogs_strdup(ue_ipv4_addr->valuestring) : NULL, + ue_ipv6_addr ? ogs_strdup(ue_ipv6_addr->valuestring) : NULL, + port_number ? port_number->valuedouble : 0, + ss_id ? ogs_strdup(ss_id->valuestring) : NULL, + bss_id ? ogs_strdup(bss_id->valuestring) : NULL, + civic_address ? civic_address->valueint : 0, + hfc_node_id ? hfc_node_id_local_nonprim : NULL, + gli ? gli->valueint : 0 + ); + + return n3ga_location_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/n3ga_location.h b/lib/sbi/openapi/model/n3ga_location.h new file mode 100644 index 0000000000..30eaea32e8 --- /dev/null +++ b/lib/sbi/openapi/model/n3ga_location.h @@ -0,0 +1,57 @@ +/* + * n3ga_location.h + * + * + */ + +#ifndef _OpenAPI_n3ga_location_H_ +#define _OpenAPI_n3ga_location_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "hfc_node_id.h" +#include "tai.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_n3ga_location_s OpenAPI_n3ga_location_t; +typedef struct OpenAPI_n3ga_location_s { + struct OpenAPI_tai_s *n3gpp_tai; + char *n3_iwf_id; + char *ue_ipv4_addr; + char *ue_ipv6_addr; + int port_number; + char *ss_id; + char *bss_id; + char civic_address; + struct OpenAPI_hfc_node_id_s *hfc_node_id; + char gli; +} OpenAPI_n3ga_location_t; + +OpenAPI_n3ga_location_t *OpenAPI_n3ga_location_create( + OpenAPI_tai_t *n3gpp_tai, + char *n3_iwf_id, + char *ue_ipv4_addr, + char *ue_ipv6_addr, + int port_number, + char *ss_id, + char *bss_id, + char civic_address, + OpenAPI_hfc_node_id_t *hfc_node_id, + char gli + ); +void OpenAPI_n3ga_location_free(OpenAPI_n3ga_location_t *n3ga_location); +OpenAPI_n3ga_location_t *OpenAPI_n3ga_location_parseFromJSON(cJSON *n3ga_locationJSON); +cJSON *OpenAPI_n3ga_location_convertToJSON(OpenAPI_n3ga_location_t *n3ga_location); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_n3ga_location_H_ */ + diff --git a/lib/sbi/openapi/model/ncgi.c b/lib/sbi/openapi/model/ncgi.c new file mode 100644 index 0000000000..21cae53e0e --- /dev/null +++ b/lib/sbi/openapi/model/ncgi.c @@ -0,0 +1,125 @@ + +#include +#include +#include +#include "ncgi.h" + +OpenAPI_ncgi_t *OpenAPI_ncgi_create( + OpenAPI_plmn_id_t *plmn_id, + char *nr_cell_id, + char *nid + ) +{ + OpenAPI_ncgi_t *ncgi_local_var = OpenAPI_malloc(sizeof(OpenAPI_ncgi_t)); + if (!ncgi_local_var) { + return NULL; + } + ncgi_local_var->plmn_id = plmn_id; + ncgi_local_var->nr_cell_id = nr_cell_id; + ncgi_local_var->nid = nid; + + return ncgi_local_var; +} + +void OpenAPI_ncgi_free(OpenAPI_ncgi_t *ncgi) +{ + if (NULL == ncgi) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_plmn_id_free(ncgi->plmn_id); + ogs_free(ncgi->nr_cell_id); + ogs_free(ncgi->nid); + ogs_free(ncgi); +} + +cJSON *OpenAPI_ncgi_convertToJSON(OpenAPI_ncgi_t *ncgi) +{ + cJSON *item = NULL; + + if (ncgi == NULL) { + ogs_error("OpenAPI_ncgi_convertToJSON() failed [Ncgi]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!ncgi->plmn_id) { + ogs_error("OpenAPI_ncgi_convertToJSON() failed [plmn_id]"); + goto end; + } + cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_convertToJSON(ncgi->plmn_id); + if (plmn_id_local_JSON == NULL) { + ogs_error("OpenAPI_ncgi_convertToJSON() failed [plmn_id]"); + goto end; + } + cJSON_AddItemToObject(item, "plmnId", plmn_id_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_ncgi_convertToJSON() failed [plmn_id]"); + goto end; + } + + if (!ncgi->nr_cell_id) { + ogs_error("OpenAPI_ncgi_convertToJSON() failed [nr_cell_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "nrCellId", ncgi->nr_cell_id) == NULL) { + ogs_error("OpenAPI_ncgi_convertToJSON() failed [nr_cell_id]"); + goto end; + } + + if (ncgi->nid) { + if (cJSON_AddStringToObject(item, "nid", ncgi->nid) == NULL) { + ogs_error("OpenAPI_ncgi_convertToJSON() failed [nid]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_ncgi_t *OpenAPI_ncgi_parseFromJSON(cJSON *ncgiJSON) +{ + OpenAPI_ncgi_t *ncgi_local_var = NULL; + cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(ncgiJSON, "plmnId"); + if (!plmn_id) { + ogs_error("OpenAPI_ncgi_parseFromJSON() failed [plmn_id]"); + goto end; + } + + OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + + plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); + + cJSON *nr_cell_id = cJSON_GetObjectItemCaseSensitive(ncgiJSON, "nrCellId"); + if (!nr_cell_id) { + ogs_error("OpenAPI_ncgi_parseFromJSON() failed [nr_cell_id]"); + goto end; + } + + + if (!cJSON_IsString(nr_cell_id)) { + ogs_error("OpenAPI_ncgi_parseFromJSON() failed [nr_cell_id]"); + goto end; + } + + cJSON *nid = cJSON_GetObjectItemCaseSensitive(ncgiJSON, "nid"); + + if (nid) { + if (!cJSON_IsString(nid)) { + ogs_error("OpenAPI_ncgi_parseFromJSON() failed [nid]"); + goto end; + } + } + + ncgi_local_var = OpenAPI_ncgi_create ( + plmn_id_local_nonprim, + ogs_strdup(nr_cell_id->valuestring), + nid ? ogs_strdup(nid->valuestring) : NULL + ); + + return ncgi_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/ncgi.h b/lib/sbi/openapi/model/ncgi.h new file mode 100644 index 0000000000..f06f74ee01 --- /dev/null +++ b/lib/sbi/openapi/model/ncgi.h @@ -0,0 +1,42 @@ +/* + * ncgi.h + * + * + */ + +#ifndef _OpenAPI_ncgi_H_ +#define _OpenAPI_ncgi_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "plmn_id.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_ncgi_s OpenAPI_ncgi_t; +typedef struct OpenAPI_ncgi_s { + struct OpenAPI_plmn_id_s *plmn_id; + char *nr_cell_id; + char *nid; +} OpenAPI_ncgi_t; + +OpenAPI_ncgi_t *OpenAPI_ncgi_create( + OpenAPI_plmn_id_t *plmn_id, + char *nr_cell_id, + char *nid + ); +void OpenAPI_ncgi_free(OpenAPI_ncgi_t *ncgi); +OpenAPI_ncgi_t *OpenAPI_ncgi_parseFromJSON(cJSON *ncgiJSON); +cJSON *OpenAPI_ncgi_convertToJSON(OpenAPI_ncgi_t *ncgi); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_ncgi_H_ */ + diff --git a/lib/sbi/openapi/model/nef_info.c b/lib/sbi/openapi/model/nef_info.c new file mode 100644 index 0000000000..eeee218769 --- /dev/null +++ b/lib/sbi/openapi/model/nef_info.c @@ -0,0 +1,119 @@ + +#include +#include +#include +#include "nef_info.h" + +OpenAPI_nef_info_t *OpenAPI_nef_info_create( + char *nef_id, + OpenAPI_pfd_data_t *pfd_data, + OpenAPI_af_event_exposure_data_t *af_ee_data + ) +{ + OpenAPI_nef_info_t *nef_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_nef_info_t)); + if (!nef_info_local_var) { + return NULL; + } + nef_info_local_var->nef_id = nef_id; + nef_info_local_var->pfd_data = pfd_data; + nef_info_local_var->af_ee_data = af_ee_data; + + return nef_info_local_var; +} + +void OpenAPI_nef_info_free(OpenAPI_nef_info_t *nef_info) +{ + if (NULL == nef_info) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(nef_info->nef_id); + OpenAPI_pfd_data_free(nef_info->pfd_data); + OpenAPI_af_event_exposure_data_free(nef_info->af_ee_data); + ogs_free(nef_info); +} + +cJSON *OpenAPI_nef_info_convertToJSON(OpenAPI_nef_info_t *nef_info) +{ + cJSON *item = NULL; + + if (nef_info == NULL) { + ogs_error("OpenAPI_nef_info_convertToJSON() failed [NefInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (nef_info->nef_id) { + if (cJSON_AddStringToObject(item, "nefId", nef_info->nef_id) == NULL) { + ogs_error("OpenAPI_nef_info_convertToJSON() failed [nef_id]"); + goto end; + } + } + + if (nef_info->pfd_data) { + cJSON *pfd_data_local_JSON = OpenAPI_pfd_data_convertToJSON(nef_info->pfd_data); + if (pfd_data_local_JSON == NULL) { + ogs_error("OpenAPI_nef_info_convertToJSON() failed [pfd_data]"); + goto end; + } + cJSON_AddItemToObject(item, "pfdData", pfd_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_nef_info_convertToJSON() failed [pfd_data]"); + goto end; + } + } + + if (nef_info->af_ee_data) { + cJSON *af_ee_data_local_JSON = OpenAPI_af_event_exposure_data_convertToJSON(nef_info->af_ee_data); + if (af_ee_data_local_JSON == NULL) { + ogs_error("OpenAPI_nef_info_convertToJSON() failed [af_ee_data]"); + goto end; + } + cJSON_AddItemToObject(item, "afEeData", af_ee_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_nef_info_convertToJSON() failed [af_ee_data]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_nef_info_t *OpenAPI_nef_info_parseFromJSON(cJSON *nef_infoJSON) +{ + OpenAPI_nef_info_t *nef_info_local_var = NULL; + cJSON *nef_id = cJSON_GetObjectItemCaseSensitive(nef_infoJSON, "nefId"); + + if (nef_id) { + if (!cJSON_IsString(nef_id)) { + ogs_error("OpenAPI_nef_info_parseFromJSON() failed [nef_id]"); + goto end; + } + } + + cJSON *pfd_data = cJSON_GetObjectItemCaseSensitive(nef_infoJSON, "pfdData"); + + OpenAPI_pfd_data_t *pfd_data_local_nonprim = NULL; + if (pfd_data) { + pfd_data_local_nonprim = OpenAPI_pfd_data_parseFromJSON(pfd_data); + } + + cJSON *af_ee_data = cJSON_GetObjectItemCaseSensitive(nef_infoJSON, "afEeData"); + + OpenAPI_af_event_exposure_data_t *af_ee_data_local_nonprim = NULL; + if (af_ee_data) { + af_ee_data_local_nonprim = OpenAPI_af_event_exposure_data_parseFromJSON(af_ee_data); + } + + nef_info_local_var = OpenAPI_nef_info_create ( + nef_id ? ogs_strdup(nef_id->valuestring) : NULL, + pfd_data ? pfd_data_local_nonprim : NULL, + af_ee_data ? af_ee_data_local_nonprim : NULL + ); + + return nef_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/nef_info.h b/lib/sbi/openapi/model/nef_info.h new file mode 100644 index 0000000000..08c687a87d --- /dev/null +++ b/lib/sbi/openapi/model/nef_info.h @@ -0,0 +1,43 @@ +/* + * nef_info.h + * + * Information of an NEF NF Instance + */ + +#ifndef _OpenAPI_nef_info_H_ +#define _OpenAPI_nef_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "af_event_exposure_data.h" +#include "pfd_data.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_nef_info_s OpenAPI_nef_info_t; +typedef struct OpenAPI_nef_info_s { + char *nef_id; + struct OpenAPI_pfd_data_s *pfd_data; + struct OpenAPI_af_event_exposure_data_s *af_ee_data; +} OpenAPI_nef_info_t; + +OpenAPI_nef_info_t *OpenAPI_nef_info_create( + char *nef_id, + OpenAPI_pfd_data_t *pfd_data, + OpenAPI_af_event_exposure_data_t *af_ee_data + ); +void OpenAPI_nef_info_free(OpenAPI_nef_info_t *nef_info); +OpenAPI_nef_info_t *OpenAPI_nef_info_parseFromJSON(cJSON *nef_infoJSON); +cJSON *OpenAPI_nef_info_convertToJSON(OpenAPI_nef_info_t *nef_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_nef_info_H_ */ + diff --git a/lib/sbi/openapi/model/network_area_info.c b/lib/sbi/openapi/model/network_area_info.c new file mode 100644 index 0000000000..09696b72bc --- /dev/null +++ b/lib/sbi/openapi/model/network_area_info.c @@ -0,0 +1,251 @@ + +#include +#include +#include +#include "network_area_info.h" + +OpenAPI_network_area_info_t *OpenAPI_network_area_info_create( + OpenAPI_list_t *ecgis, + OpenAPI_list_t *ncgis, + OpenAPI_list_t *g_ran_node_ids, + OpenAPI_list_t *tais + ) +{ + OpenAPI_network_area_info_t *network_area_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_network_area_info_t)); + if (!network_area_info_local_var) { + return NULL; + } + network_area_info_local_var->ecgis = ecgis; + network_area_info_local_var->ncgis = ncgis; + network_area_info_local_var->g_ran_node_ids = g_ran_node_ids; + network_area_info_local_var->tais = tais; + + return network_area_info_local_var; +} + +void OpenAPI_network_area_info_free(OpenAPI_network_area_info_t *network_area_info) +{ + if (NULL == network_area_info) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(network_area_info->ecgis, node) { + OpenAPI_ecgi_free(node->data); + } + OpenAPI_list_free(network_area_info->ecgis); + OpenAPI_list_for_each(network_area_info->ncgis, node) { + OpenAPI_ncgi_free(node->data); + } + OpenAPI_list_free(network_area_info->ncgis); + OpenAPI_list_for_each(network_area_info->g_ran_node_ids, node) { + OpenAPI_global_ran_node_id_free(node->data); + } + OpenAPI_list_free(network_area_info->g_ran_node_ids); + OpenAPI_list_for_each(network_area_info->tais, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(network_area_info->tais); + ogs_free(network_area_info); +} + +cJSON *OpenAPI_network_area_info_convertToJSON(OpenAPI_network_area_info_t *network_area_info) +{ + cJSON *item = NULL; + + if (network_area_info == NULL) { + ogs_error("OpenAPI_network_area_info_convertToJSON() failed [NetworkAreaInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (network_area_info->ecgis) { + cJSON *ecgisList = cJSON_AddArrayToObject(item, "ecgis"); + if (ecgisList == NULL) { + ogs_error("OpenAPI_network_area_info_convertToJSON() failed [ecgis]"); + goto end; + } + + OpenAPI_lnode_t *ecgis_node; + if (network_area_info->ecgis) { + OpenAPI_list_for_each(network_area_info->ecgis, ecgis_node) { + cJSON *itemLocal = OpenAPI_ecgi_convertToJSON(ecgis_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_network_area_info_convertToJSON() failed [ecgis]"); + goto end; + } + cJSON_AddItemToArray(ecgisList, itemLocal); + } + } + } + + if (network_area_info->ncgis) { + cJSON *ncgisList = cJSON_AddArrayToObject(item, "ncgis"); + if (ncgisList == NULL) { + ogs_error("OpenAPI_network_area_info_convertToJSON() failed [ncgis]"); + goto end; + } + + OpenAPI_lnode_t *ncgis_node; + if (network_area_info->ncgis) { + OpenAPI_list_for_each(network_area_info->ncgis, ncgis_node) { + cJSON *itemLocal = OpenAPI_ncgi_convertToJSON(ncgis_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_network_area_info_convertToJSON() failed [ncgis]"); + goto end; + } + cJSON_AddItemToArray(ncgisList, itemLocal); + } + } + } + + if (network_area_info->g_ran_node_ids) { + cJSON *g_ran_node_idsList = cJSON_AddArrayToObject(item, "gRanNodeIds"); + if (g_ran_node_idsList == NULL) { + ogs_error("OpenAPI_network_area_info_convertToJSON() failed [g_ran_node_ids]"); + goto end; + } + + OpenAPI_lnode_t *g_ran_node_ids_node; + if (network_area_info->g_ran_node_ids) { + OpenAPI_list_for_each(network_area_info->g_ran_node_ids, g_ran_node_ids_node) { + cJSON *itemLocal = OpenAPI_global_ran_node_id_convertToJSON(g_ran_node_ids_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_network_area_info_convertToJSON() failed [g_ran_node_ids]"); + goto end; + } + cJSON_AddItemToArray(g_ran_node_idsList, itemLocal); + } + } + } + + if (network_area_info->tais) { + cJSON *taisList = cJSON_AddArrayToObject(item, "tais"); + if (taisList == NULL) { + ogs_error("OpenAPI_network_area_info_convertToJSON() failed [tais]"); + goto end; + } + + OpenAPI_lnode_t *tais_node; + if (network_area_info->tais) { + OpenAPI_list_for_each(network_area_info->tais, tais_node) { + cJSON *itemLocal = OpenAPI_tai_convertToJSON(tais_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_network_area_info_convertToJSON() failed [tais]"); + goto end; + } + cJSON_AddItemToArray(taisList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_network_area_info_t *OpenAPI_network_area_info_parseFromJSON(cJSON *network_area_infoJSON) +{ + OpenAPI_network_area_info_t *network_area_info_local_var = NULL; + cJSON *ecgis = cJSON_GetObjectItemCaseSensitive(network_area_infoJSON, "ecgis"); + + OpenAPI_list_t *ecgisList; + if (ecgis) { + cJSON *ecgis_local_nonprimitive; + if (!cJSON_IsArray(ecgis)) { + ogs_error("OpenAPI_network_area_info_parseFromJSON() failed [ecgis]"); + goto end; + } + + ecgisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ecgis_local_nonprimitive, ecgis ) { + if (!cJSON_IsObject(ecgis_local_nonprimitive)) { + ogs_error("OpenAPI_network_area_info_parseFromJSON() failed [ecgis]"); + goto end; + } + OpenAPI_ecgi_t *ecgisItem = OpenAPI_ecgi_parseFromJSON(ecgis_local_nonprimitive); + + OpenAPI_list_add(ecgisList, ecgisItem); + } + } + + cJSON *ncgis = cJSON_GetObjectItemCaseSensitive(network_area_infoJSON, "ncgis"); + + OpenAPI_list_t *ncgisList; + if (ncgis) { + cJSON *ncgis_local_nonprimitive; + if (!cJSON_IsArray(ncgis)) { + ogs_error("OpenAPI_network_area_info_parseFromJSON() failed [ncgis]"); + goto end; + } + + ncgisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ncgis_local_nonprimitive, ncgis ) { + if (!cJSON_IsObject(ncgis_local_nonprimitive)) { + ogs_error("OpenAPI_network_area_info_parseFromJSON() failed [ncgis]"); + goto end; + } + OpenAPI_ncgi_t *ncgisItem = OpenAPI_ncgi_parseFromJSON(ncgis_local_nonprimitive); + + OpenAPI_list_add(ncgisList, ncgisItem); + } + } + + cJSON *g_ran_node_ids = cJSON_GetObjectItemCaseSensitive(network_area_infoJSON, "gRanNodeIds"); + + OpenAPI_list_t *g_ran_node_idsList; + if (g_ran_node_ids) { + cJSON *g_ran_node_ids_local_nonprimitive; + if (!cJSON_IsArray(g_ran_node_ids)) { + ogs_error("OpenAPI_network_area_info_parseFromJSON() failed [g_ran_node_ids]"); + goto end; + } + + g_ran_node_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(g_ran_node_ids_local_nonprimitive, g_ran_node_ids ) { + if (!cJSON_IsObject(g_ran_node_ids_local_nonprimitive)) { + ogs_error("OpenAPI_network_area_info_parseFromJSON() failed [g_ran_node_ids]"); + goto end; + } + OpenAPI_global_ran_node_id_t *g_ran_node_idsItem = OpenAPI_global_ran_node_id_parseFromJSON(g_ran_node_ids_local_nonprimitive); + + OpenAPI_list_add(g_ran_node_idsList, g_ran_node_idsItem); + } + } + + cJSON *tais = cJSON_GetObjectItemCaseSensitive(network_area_infoJSON, "tais"); + + OpenAPI_list_t *taisList; + if (tais) { + cJSON *tais_local_nonprimitive; + if (!cJSON_IsArray(tais)) { + ogs_error("OpenAPI_network_area_info_parseFromJSON() failed [tais]"); + goto end; + } + + taisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tais_local_nonprimitive, tais ) { + if (!cJSON_IsObject(tais_local_nonprimitive)) { + ogs_error("OpenAPI_network_area_info_parseFromJSON() failed [tais]"); + goto end; + } + OpenAPI_tai_t *taisItem = OpenAPI_tai_parseFromJSON(tais_local_nonprimitive); + + OpenAPI_list_add(taisList, taisItem); + } + } + + network_area_info_local_var = OpenAPI_network_area_info_create ( + ecgis ? ecgisList : NULL, + ncgis ? ncgisList : NULL, + g_ran_node_ids ? g_ran_node_idsList : NULL, + tais ? taisList : NULL + ); + + return network_area_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/network_area_info.h b/lib/sbi/openapi/model/network_area_info.h new file mode 100644 index 0000000000..3c68afacc4 --- /dev/null +++ b/lib/sbi/openapi/model/network_area_info.h @@ -0,0 +1,47 @@ +/* + * network_area_info.h + * + * Describes a network area information in which the NF service consumer requests the number of UEs. + */ + +#ifndef _OpenAPI_network_area_info_H_ +#define _OpenAPI_network_area_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "ecgi.h" +#include "global_ran_node_id.h" +#include "ncgi.h" +#include "tai.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_network_area_info_s OpenAPI_network_area_info_t; +typedef struct OpenAPI_network_area_info_s { + OpenAPI_list_t *ecgis; + OpenAPI_list_t *ncgis; + OpenAPI_list_t *g_ran_node_ids; + OpenAPI_list_t *tais; +} OpenAPI_network_area_info_t; + +OpenAPI_network_area_info_t *OpenAPI_network_area_info_create( + OpenAPI_list_t *ecgis, + OpenAPI_list_t *ncgis, + OpenAPI_list_t *g_ran_node_ids, + OpenAPI_list_t *tais + ); +void OpenAPI_network_area_info_free(OpenAPI_network_area_info_t *network_area_info); +OpenAPI_network_area_info_t *OpenAPI_network_area_info_parseFromJSON(cJSON *network_area_infoJSON); +cJSON *OpenAPI_network_area_info_convertToJSON(OpenAPI_network_area_info_t *network_area_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_network_area_info_H_ */ + diff --git a/lib/sbi/openapi/model/network_area_info_2.c b/lib/sbi/openapi/model/network_area_info_2.c new file mode 100644 index 0000000000..d7b2e2aaf9 --- /dev/null +++ b/lib/sbi/openapi/model/network_area_info_2.c @@ -0,0 +1,251 @@ + +#include +#include +#include +#include "network_area_info_2.h" + +OpenAPI_network_area_info_2_t *OpenAPI_network_area_info_2_create( + OpenAPI_list_t *ecgis, + OpenAPI_list_t *ncgis, + OpenAPI_list_t *g_ran_node_ids, + OpenAPI_list_t *tais + ) +{ + OpenAPI_network_area_info_2_t *network_area_info_2_local_var = OpenAPI_malloc(sizeof(OpenAPI_network_area_info_2_t)); + if (!network_area_info_2_local_var) { + return NULL; + } + network_area_info_2_local_var->ecgis = ecgis; + network_area_info_2_local_var->ncgis = ncgis; + network_area_info_2_local_var->g_ran_node_ids = g_ran_node_ids; + network_area_info_2_local_var->tais = tais; + + return network_area_info_2_local_var; +} + +void OpenAPI_network_area_info_2_free(OpenAPI_network_area_info_2_t *network_area_info_2) +{ + if (NULL == network_area_info_2) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(network_area_info_2->ecgis, node) { + OpenAPI_ecgi_free(node->data); + } + OpenAPI_list_free(network_area_info_2->ecgis); + OpenAPI_list_for_each(network_area_info_2->ncgis, node) { + OpenAPI_ncgi_free(node->data); + } + OpenAPI_list_free(network_area_info_2->ncgis); + OpenAPI_list_for_each(network_area_info_2->g_ran_node_ids, node) { + OpenAPI_global_ran_node_id_free(node->data); + } + OpenAPI_list_free(network_area_info_2->g_ran_node_ids); + OpenAPI_list_for_each(network_area_info_2->tais, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(network_area_info_2->tais); + ogs_free(network_area_info_2); +} + +cJSON *OpenAPI_network_area_info_2_convertToJSON(OpenAPI_network_area_info_2_t *network_area_info_2) +{ + cJSON *item = NULL; + + if (network_area_info_2 == NULL) { + ogs_error("OpenAPI_network_area_info_2_convertToJSON() failed [NetworkAreaInfo_2]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (network_area_info_2->ecgis) { + cJSON *ecgisList = cJSON_AddArrayToObject(item, "ecgis"); + if (ecgisList == NULL) { + ogs_error("OpenAPI_network_area_info_2_convertToJSON() failed [ecgis]"); + goto end; + } + + OpenAPI_lnode_t *ecgis_node; + if (network_area_info_2->ecgis) { + OpenAPI_list_for_each(network_area_info_2->ecgis, ecgis_node) { + cJSON *itemLocal = OpenAPI_ecgi_convertToJSON(ecgis_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_network_area_info_2_convertToJSON() failed [ecgis]"); + goto end; + } + cJSON_AddItemToArray(ecgisList, itemLocal); + } + } + } + + if (network_area_info_2->ncgis) { + cJSON *ncgisList = cJSON_AddArrayToObject(item, "ncgis"); + if (ncgisList == NULL) { + ogs_error("OpenAPI_network_area_info_2_convertToJSON() failed [ncgis]"); + goto end; + } + + OpenAPI_lnode_t *ncgis_node; + if (network_area_info_2->ncgis) { + OpenAPI_list_for_each(network_area_info_2->ncgis, ncgis_node) { + cJSON *itemLocal = OpenAPI_ncgi_convertToJSON(ncgis_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_network_area_info_2_convertToJSON() failed [ncgis]"); + goto end; + } + cJSON_AddItemToArray(ncgisList, itemLocal); + } + } + } + + if (network_area_info_2->g_ran_node_ids) { + cJSON *g_ran_node_idsList = cJSON_AddArrayToObject(item, "gRanNodeIds"); + if (g_ran_node_idsList == NULL) { + ogs_error("OpenAPI_network_area_info_2_convertToJSON() failed [g_ran_node_ids]"); + goto end; + } + + OpenAPI_lnode_t *g_ran_node_ids_node; + if (network_area_info_2->g_ran_node_ids) { + OpenAPI_list_for_each(network_area_info_2->g_ran_node_ids, g_ran_node_ids_node) { + cJSON *itemLocal = OpenAPI_global_ran_node_id_convertToJSON(g_ran_node_ids_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_network_area_info_2_convertToJSON() failed [g_ran_node_ids]"); + goto end; + } + cJSON_AddItemToArray(g_ran_node_idsList, itemLocal); + } + } + } + + if (network_area_info_2->tais) { + cJSON *taisList = cJSON_AddArrayToObject(item, "tais"); + if (taisList == NULL) { + ogs_error("OpenAPI_network_area_info_2_convertToJSON() failed [tais]"); + goto end; + } + + OpenAPI_lnode_t *tais_node; + if (network_area_info_2->tais) { + OpenAPI_list_for_each(network_area_info_2->tais, tais_node) { + cJSON *itemLocal = OpenAPI_tai_convertToJSON(tais_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_network_area_info_2_convertToJSON() failed [tais]"); + goto end; + } + cJSON_AddItemToArray(taisList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_network_area_info_2_t *OpenAPI_network_area_info_2_parseFromJSON(cJSON *network_area_info_2JSON) +{ + OpenAPI_network_area_info_2_t *network_area_info_2_local_var = NULL; + cJSON *ecgis = cJSON_GetObjectItemCaseSensitive(network_area_info_2JSON, "ecgis"); + + OpenAPI_list_t *ecgisList; + if (ecgis) { + cJSON *ecgis_local_nonprimitive; + if (!cJSON_IsArray(ecgis)) { + ogs_error("OpenAPI_network_area_info_2_parseFromJSON() failed [ecgis]"); + goto end; + } + + ecgisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ecgis_local_nonprimitive, ecgis ) { + if (!cJSON_IsObject(ecgis_local_nonprimitive)) { + ogs_error("OpenAPI_network_area_info_2_parseFromJSON() failed [ecgis]"); + goto end; + } + OpenAPI_ecgi_t *ecgisItem = OpenAPI_ecgi_parseFromJSON(ecgis_local_nonprimitive); + + OpenAPI_list_add(ecgisList, ecgisItem); + } + } + + cJSON *ncgis = cJSON_GetObjectItemCaseSensitive(network_area_info_2JSON, "ncgis"); + + OpenAPI_list_t *ncgisList; + if (ncgis) { + cJSON *ncgis_local_nonprimitive; + if (!cJSON_IsArray(ncgis)) { + ogs_error("OpenAPI_network_area_info_2_parseFromJSON() failed [ncgis]"); + goto end; + } + + ncgisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ncgis_local_nonprimitive, ncgis ) { + if (!cJSON_IsObject(ncgis_local_nonprimitive)) { + ogs_error("OpenAPI_network_area_info_2_parseFromJSON() failed [ncgis]"); + goto end; + } + OpenAPI_ncgi_t *ncgisItem = OpenAPI_ncgi_parseFromJSON(ncgis_local_nonprimitive); + + OpenAPI_list_add(ncgisList, ncgisItem); + } + } + + cJSON *g_ran_node_ids = cJSON_GetObjectItemCaseSensitive(network_area_info_2JSON, "gRanNodeIds"); + + OpenAPI_list_t *g_ran_node_idsList; + if (g_ran_node_ids) { + cJSON *g_ran_node_ids_local_nonprimitive; + if (!cJSON_IsArray(g_ran_node_ids)) { + ogs_error("OpenAPI_network_area_info_2_parseFromJSON() failed [g_ran_node_ids]"); + goto end; + } + + g_ran_node_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(g_ran_node_ids_local_nonprimitive, g_ran_node_ids ) { + if (!cJSON_IsObject(g_ran_node_ids_local_nonprimitive)) { + ogs_error("OpenAPI_network_area_info_2_parseFromJSON() failed [g_ran_node_ids]"); + goto end; + } + OpenAPI_global_ran_node_id_t *g_ran_node_idsItem = OpenAPI_global_ran_node_id_parseFromJSON(g_ran_node_ids_local_nonprimitive); + + OpenAPI_list_add(g_ran_node_idsList, g_ran_node_idsItem); + } + } + + cJSON *tais = cJSON_GetObjectItemCaseSensitive(network_area_info_2JSON, "tais"); + + OpenAPI_list_t *taisList; + if (tais) { + cJSON *tais_local_nonprimitive; + if (!cJSON_IsArray(tais)) { + ogs_error("OpenAPI_network_area_info_2_parseFromJSON() failed [tais]"); + goto end; + } + + taisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tais_local_nonprimitive, tais ) { + if (!cJSON_IsObject(tais_local_nonprimitive)) { + ogs_error("OpenAPI_network_area_info_2_parseFromJSON() failed [tais]"); + goto end; + } + OpenAPI_tai_t *taisItem = OpenAPI_tai_parseFromJSON(tais_local_nonprimitive); + + OpenAPI_list_add(taisList, taisItem); + } + } + + network_area_info_2_local_var = OpenAPI_network_area_info_2_create ( + ecgis ? ecgisList : NULL, + ncgis ? ncgisList : NULL, + g_ran_node_ids ? g_ran_node_idsList : NULL, + tais ? taisList : NULL + ); + + return network_area_info_2_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/network_area_info_2.h b/lib/sbi/openapi/model/network_area_info_2.h new file mode 100644 index 0000000000..210ccc3f51 --- /dev/null +++ b/lib/sbi/openapi/model/network_area_info_2.h @@ -0,0 +1,47 @@ +/* + * network_area_info_2.h + * + * Describes a network area information in which the NF service consumer requests the number of UEs. + */ + +#ifndef _OpenAPI_network_area_info_2_H_ +#define _OpenAPI_network_area_info_2_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "ecgi.h" +#include "global_ran_node_id.h" +#include "ncgi.h" +#include "tai.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_network_area_info_2_s OpenAPI_network_area_info_2_t; +typedef struct OpenAPI_network_area_info_2_s { + OpenAPI_list_t *ecgis; + OpenAPI_list_t *ncgis; + OpenAPI_list_t *g_ran_node_ids; + OpenAPI_list_t *tais; +} OpenAPI_network_area_info_2_t; + +OpenAPI_network_area_info_2_t *OpenAPI_network_area_info_2_create( + OpenAPI_list_t *ecgis, + OpenAPI_list_t *ncgis, + OpenAPI_list_t *g_ran_node_ids, + OpenAPI_list_t *tais + ); +void OpenAPI_network_area_info_2_free(OpenAPI_network_area_info_2_t *network_area_info_2); +OpenAPI_network_area_info_2_t *OpenAPI_network_area_info_2_parseFromJSON(cJSON *network_area_info_2JSON); +cJSON *OpenAPI_network_area_info_2_convertToJSON(OpenAPI_network_area_info_2_t *network_area_info_2); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_network_area_info_2_H_ */ + diff --git a/lib/sbi/openapi/model/network_node_diameter_address.c b/lib/sbi/openapi/model/network_node_diameter_address.c new file mode 100644 index 0000000000..5b1ed61dfa --- /dev/null +++ b/lib/sbi/openapi/model/network_node_diameter_address.c @@ -0,0 +1,101 @@ + +#include +#include +#include +#include "network_node_diameter_address.h" + +OpenAPI_network_node_diameter_address_t *OpenAPI_network_node_diameter_address_create( + char *name, + char *realm + ) +{ + OpenAPI_network_node_diameter_address_t *network_node_diameter_address_local_var = OpenAPI_malloc(sizeof(OpenAPI_network_node_diameter_address_t)); + if (!network_node_diameter_address_local_var) { + return NULL; + } + network_node_diameter_address_local_var->name = name; + network_node_diameter_address_local_var->realm = realm; + + return network_node_diameter_address_local_var; +} + +void OpenAPI_network_node_diameter_address_free(OpenAPI_network_node_diameter_address_t *network_node_diameter_address) +{ + if (NULL == network_node_diameter_address) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(network_node_diameter_address->name); + ogs_free(network_node_diameter_address->realm); + ogs_free(network_node_diameter_address); +} + +cJSON *OpenAPI_network_node_diameter_address_convertToJSON(OpenAPI_network_node_diameter_address_t *network_node_diameter_address) +{ + cJSON *item = NULL; + + if (network_node_diameter_address == NULL) { + ogs_error("OpenAPI_network_node_diameter_address_convertToJSON() failed [NetworkNodeDiameterAddress]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!network_node_diameter_address->name) { + ogs_error("OpenAPI_network_node_diameter_address_convertToJSON() failed [name]"); + goto end; + } + if (cJSON_AddStringToObject(item, "name", network_node_diameter_address->name) == NULL) { + ogs_error("OpenAPI_network_node_diameter_address_convertToJSON() failed [name]"); + goto end; + } + + if (!network_node_diameter_address->realm) { + ogs_error("OpenAPI_network_node_diameter_address_convertToJSON() failed [realm]"); + goto end; + } + if (cJSON_AddStringToObject(item, "realm", network_node_diameter_address->realm) == NULL) { + ogs_error("OpenAPI_network_node_diameter_address_convertToJSON() failed [realm]"); + goto end; + } + +end: + return item; +} + +OpenAPI_network_node_diameter_address_t *OpenAPI_network_node_diameter_address_parseFromJSON(cJSON *network_node_diameter_addressJSON) +{ + OpenAPI_network_node_diameter_address_t *network_node_diameter_address_local_var = NULL; + cJSON *name = cJSON_GetObjectItemCaseSensitive(network_node_diameter_addressJSON, "name"); + if (!name) { + ogs_error("OpenAPI_network_node_diameter_address_parseFromJSON() failed [name]"); + goto end; + } + + + if (!cJSON_IsString(name)) { + ogs_error("OpenAPI_network_node_diameter_address_parseFromJSON() failed [name]"); + goto end; + } + + cJSON *realm = cJSON_GetObjectItemCaseSensitive(network_node_diameter_addressJSON, "realm"); + if (!realm) { + ogs_error("OpenAPI_network_node_diameter_address_parseFromJSON() failed [realm]"); + goto end; + } + + + if (!cJSON_IsString(realm)) { + ogs_error("OpenAPI_network_node_diameter_address_parseFromJSON() failed [realm]"); + goto end; + } + + network_node_diameter_address_local_var = OpenAPI_network_node_diameter_address_create ( + ogs_strdup(name->valuestring), + ogs_strdup(realm->valuestring) + ); + + return network_node_diameter_address_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/network_node_diameter_address.h b/lib/sbi/openapi/model/network_node_diameter_address.h new file mode 100644 index 0000000000..444960e991 --- /dev/null +++ b/lib/sbi/openapi/model/network_node_diameter_address.h @@ -0,0 +1,39 @@ +/* + * network_node_diameter_address.h + * + * + */ + +#ifndef _OpenAPI_network_node_diameter_address_H_ +#define _OpenAPI_network_node_diameter_address_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_network_node_diameter_address_s OpenAPI_network_node_diameter_address_t; +typedef struct OpenAPI_network_node_diameter_address_s { + char *name; + char *realm; +} OpenAPI_network_node_diameter_address_t; + +OpenAPI_network_node_diameter_address_t *OpenAPI_network_node_diameter_address_create( + char *name, + char *realm + ); +void OpenAPI_network_node_diameter_address_free(OpenAPI_network_node_diameter_address_t *network_node_diameter_address); +OpenAPI_network_node_diameter_address_t *OpenAPI_network_node_diameter_address_parseFromJSON(cJSON *network_node_diameter_addressJSON); +cJSON *OpenAPI_network_node_diameter_address_convertToJSON(OpenAPI_network_node_diameter_address_t *network_node_diameter_address); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_network_node_diameter_address_H_ */ + diff --git a/lib/sbi/openapi/model/network_slice_cond.h b/lib/sbi/openapi/model/network_slice_cond.h index 2152c8c0ea..65eb465bcd 100644 --- a/lib/sbi/openapi/model/network_slice_cond.h +++ b/lib/sbi/openapi/model/network_slice_cond.h @@ -1,7 +1,7 @@ /* * network_slice_cond.h * - * + * Subscription to a set of NFs, based on the slices (S-NSSAI and NSI) they support */ #ifndef _OpenAPI_network_slice_cond_H_ diff --git a/lib/sbi/openapi/model/nf_group_cond.c b/lib/sbi/openapi/model/nf_group_cond.c index 01eb3628d7..9c7cc1b470 100644 --- a/lib/sbi/openapi/model/nf_group_cond.c +++ b/lib/sbi/openapi/model/nf_group_cond.c @@ -6,7 +6,7 @@ char *OpenAPI_nf_typenf_group_cond_ToString(OpenAPI_nf_group_cond_nf_type_e nf_type) { - const char *nf_typeArray[] = { "NULL", "UDM", "AUSF", "UDR", "PCF" }; + const char *nf_typeArray[] = { "NULL", "UDM", "AUSF", "UDR", "PCF", "CHF" }; size_t sizeofArray = sizeof(nf_typeArray) / sizeof(nf_typeArray[0]); if (nf_type < sizeofArray) return (char *)nf_typeArray[nf_type]; @@ -17,7 +17,7 @@ char *OpenAPI_nf_typenf_group_cond_ToString(OpenAPI_nf_group_cond_nf_type_e nf_t OpenAPI_nf_group_cond_nf_type_e OpenAPI_nf_typenf_group_cond_FromString(char* nf_type) { int stringToReturn = 0; - const char *nf_typeArray[] = { "NULL", "UDM", "AUSF", "UDR", "PCF" }; + const char *nf_typeArray[] = { "NULL", "UDM", "AUSF", "UDR", "PCF", "CHF" }; size_t sizeofArray = sizeof(nf_typeArray) / sizeof(nf_typeArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(nf_type, nf_typeArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/nf_group_cond.h b/lib/sbi/openapi/model/nf_group_cond.h index 5184c61a17..7fff76ce0c 100644 --- a/lib/sbi/openapi/model/nf_group_cond.h +++ b/lib/sbi/openapi/model/nf_group_cond.h @@ -1,7 +1,7 @@ /* * nf_group_cond.h * - * + * Subscription to a set of NFs based on their Group Id */ #ifndef _OpenAPI_nf_group_cond_H_ @@ -18,7 +18,7 @@ extern "C" { #endif typedef struct OpenAPI_nf_group_cond_s OpenAPI_nf_group_cond_t; -typedef enum { OpenAPI_nf_group_cond_NFTYPE_NULL = 0, OpenAPI_nf_group_cond_NFTYPE_UDM, OpenAPI_nf_group_cond_NFTYPE_AUSF, OpenAPI_nf_group_cond_NFTYPE_UDR, OpenAPI_nf_group_cond_NFTYPE_PCF } OpenAPI_nf_group_cond_nf_type_e; +typedef enum { OpenAPI_nf_group_cond_NFTYPE_NULL = 0, OpenAPI_nf_group_cond_NFTYPE_UDM, OpenAPI_nf_group_cond_NFTYPE_AUSF, OpenAPI_nf_group_cond_NFTYPE_UDR, OpenAPI_nf_group_cond_NFTYPE_PCF, OpenAPI_nf_group_cond_NFTYPE_CHF } OpenAPI_nf_group_cond_nf_type_e; char* OpenAPI_nf_group_cond_nf_type_ToString(OpenAPI_nf_group_cond_nf_type_e nf_type); diff --git a/lib/sbi/openapi/model/nf_info.c b/lib/sbi/openapi/model/nf_info.c new file mode 100644 index 0000000000..e2d1e0a94d --- /dev/null +++ b/lib/sbi/openapi/model/nf_info.c @@ -0,0 +1,72 @@ + +#include +#include +#include +#include "nf_info.h" + +OpenAPI_nf_info_t *OpenAPI_nf_info_create( + OpenAPI_nf_type_e nf_type + ) +{ + OpenAPI_nf_info_t *nf_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_nf_info_t)); + if (!nf_info_local_var) { + return NULL; + } + nf_info_local_var->nf_type = nf_type; + + return nf_info_local_var; +} + +void OpenAPI_nf_info_free(OpenAPI_nf_info_t *nf_info) +{ + if (NULL == nf_info) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(nf_info); +} + +cJSON *OpenAPI_nf_info_convertToJSON(OpenAPI_nf_info_t *nf_info) +{ + cJSON *item = NULL; + + if (nf_info == NULL) { + ogs_error("OpenAPI_nf_info_convertToJSON() failed [NfInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (nf_info->nf_type) { + if (cJSON_AddStringToObject(item, "nfType", OpenAPI_nf_type_ToString(nf_info->nf_type)) == NULL) { + ogs_error("OpenAPI_nf_info_convertToJSON() failed [nf_type]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_nf_info_t *OpenAPI_nf_info_parseFromJSON(cJSON *nf_infoJSON) +{ + OpenAPI_nf_info_t *nf_info_local_var = NULL; + cJSON *nf_type = cJSON_GetObjectItemCaseSensitive(nf_infoJSON, "nfType"); + + OpenAPI_nf_type_e nf_typeVariable; + if (nf_type) { + if (!cJSON_IsString(nf_type)) { + ogs_error("OpenAPI_nf_info_parseFromJSON() failed [nf_type]"); + goto end; + } + nf_typeVariable = OpenAPI_nf_type_FromString(nf_type->valuestring); + } + + nf_info_local_var = OpenAPI_nf_info_create ( + nf_type ? nf_typeVariable : 0 + ); + + return nf_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/nf_info.h b/lib/sbi/openapi/model/nf_info.h new file mode 100644 index 0000000000..5675cddf0e --- /dev/null +++ b/lib/sbi/openapi/model/nf_info.h @@ -0,0 +1,38 @@ +/* + * nf_info.h + * + * Information of a generic NF Instance + */ + +#ifndef _OpenAPI_nf_info_H_ +#define _OpenAPI_nf_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "nf_type.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_nf_info_s OpenAPI_nf_info_t; +typedef struct OpenAPI_nf_info_s { + OpenAPI_nf_type_e nf_type; +} OpenAPI_nf_info_t; + +OpenAPI_nf_info_t *OpenAPI_nf_info_create( + OpenAPI_nf_type_e nf_type + ); +void OpenAPI_nf_info_free(OpenAPI_nf_info_t *nf_info); +OpenAPI_nf_info_t *OpenAPI_nf_info_parseFromJSON(cJSON *nf_infoJSON); +cJSON *OpenAPI_nf_info_convertToJSON(OpenAPI_nf_info_t *nf_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_nf_info_H_ */ + diff --git a/lib/sbi/openapi/model/nf_instance_id_cond.h b/lib/sbi/openapi/model/nf_instance_id_cond.h index 961f0fc11d..dac4f8cb4f 100644 --- a/lib/sbi/openapi/model/nf_instance_id_cond.h +++ b/lib/sbi/openapi/model/nf_instance_id_cond.h @@ -1,7 +1,7 @@ /* * nf_instance_id_cond.h * - * + * Subscription to a given NF Instance Id */ #ifndef _OpenAPI_nf_instance_id_cond_H_ diff --git a/lib/sbi/openapi/model/nf_profile.c b/lib/sbi/openapi/model/nf_profile.c index e1d80f6c44..9d653af05d 100644 --- a/lib/sbi/openapi/model/nf_profile.c +++ b/lib/sbi/openapi/model/nf_profile.c @@ -11,6 +11,7 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_create( OpenAPI_nf_status_e nf_status, int heart_beat_timer, OpenAPI_list_t *plmn_list, + OpenAPI_list_t *snpn_list, OpenAPI_list_t *s_nssais, OpenAPI_list_t *per_plmn_snssai_list, OpenAPI_list_t *nsi_list, @@ -19,12 +20,14 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_create( OpenAPI_list_t *ipv4_addresses, OpenAPI_list_t *ipv6_addresses, OpenAPI_list_t *allowed_plmns, + OpenAPI_list_t *allowed_snpns, OpenAPI_list_t *allowed_nf_types, OpenAPI_list_t *allowed_nf_domains, OpenAPI_list_t *allowed_nssais, int priority, int capacity, int load, + char *load_time_stamp, char *locality, OpenAPI_udr_info_t *udr_info, OpenAPI_list_t *udr_info_ext, @@ -44,15 +47,26 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_create( OpenAPI_list_t *bsf_info_ext, OpenAPI_chf_info_t *chf_info, OpenAPI_list_t *chf_info_ext, + OpenAPI_nef_info_t *nef_info, OpenAPI_nrf_info_t *nrf_info, + OpenAPI_udsf_info_t *udsf_info, + OpenAPI_list_t *udsf_info_ext, OpenAPI_nwdaf_info_t *nwdaf_info, + OpenAPI_list_t *pcscf_info, + OpenAPI_list_t *hss_info, OpenAPI_object_t *custom_info, char *recovery_time, int nf_service_persistence, OpenAPI_list_t *nf_services, int nf_profile_changes_support_ind, int nf_profile_changes_ind, - OpenAPI_list_t *default_notification_subscriptions + OpenAPI_list_t *default_notification_subscriptions, + OpenAPI_lmf_info_t *lmf_info, + OpenAPI_gmlc_info_t *gmlc_info, + OpenAPI_list_t *nf_set_id_list, + OpenAPI_list_t *serving_scope, + int lc_h_support_ind, + int olc_h_support_ind ) { OpenAPI_nf_profile_t *nf_profile_local_var = OpenAPI_malloc(sizeof(OpenAPI_nf_profile_t)); @@ -65,6 +79,7 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_create( nf_profile_local_var->nf_status = nf_status; nf_profile_local_var->heart_beat_timer = heart_beat_timer; nf_profile_local_var->plmn_list = plmn_list; + nf_profile_local_var->snpn_list = snpn_list; nf_profile_local_var->s_nssais = s_nssais; nf_profile_local_var->per_plmn_snssai_list = per_plmn_snssai_list; nf_profile_local_var->nsi_list = nsi_list; @@ -73,12 +88,14 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_create( nf_profile_local_var->ipv4_addresses = ipv4_addresses; nf_profile_local_var->ipv6_addresses = ipv6_addresses; nf_profile_local_var->allowed_plmns = allowed_plmns; + nf_profile_local_var->allowed_snpns = allowed_snpns; nf_profile_local_var->allowed_nf_types = allowed_nf_types; nf_profile_local_var->allowed_nf_domains = allowed_nf_domains; nf_profile_local_var->allowed_nssais = allowed_nssais; nf_profile_local_var->priority = priority; nf_profile_local_var->capacity = capacity; nf_profile_local_var->load = load; + nf_profile_local_var->load_time_stamp = load_time_stamp; nf_profile_local_var->locality = locality; nf_profile_local_var->udr_info = udr_info; nf_profile_local_var->udr_info_ext = udr_info_ext; @@ -98,8 +115,13 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_create( nf_profile_local_var->bsf_info_ext = bsf_info_ext; nf_profile_local_var->chf_info = chf_info; nf_profile_local_var->chf_info_ext = chf_info_ext; + nf_profile_local_var->nef_info = nef_info; nf_profile_local_var->nrf_info = nrf_info; + nf_profile_local_var->udsf_info = udsf_info; + nf_profile_local_var->udsf_info_ext = udsf_info_ext; nf_profile_local_var->nwdaf_info = nwdaf_info; + nf_profile_local_var->pcscf_info = pcscf_info; + nf_profile_local_var->hss_info = hss_info; nf_profile_local_var->custom_info = custom_info; nf_profile_local_var->recovery_time = recovery_time; nf_profile_local_var->nf_service_persistence = nf_service_persistence; @@ -107,6 +129,12 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_create( nf_profile_local_var->nf_profile_changes_support_ind = nf_profile_changes_support_ind; nf_profile_local_var->nf_profile_changes_ind = nf_profile_changes_ind; nf_profile_local_var->default_notification_subscriptions = default_notification_subscriptions; + nf_profile_local_var->lmf_info = lmf_info; + nf_profile_local_var->gmlc_info = gmlc_info; + nf_profile_local_var->nf_set_id_list = nf_set_id_list; + nf_profile_local_var->serving_scope = serving_scope; + nf_profile_local_var->lc_h_support_ind = lc_h_support_ind; + nf_profile_local_var->olc_h_support_ind = olc_h_support_ind; return nf_profile_local_var; } @@ -123,6 +151,10 @@ void OpenAPI_nf_profile_free(OpenAPI_nf_profile_t *nf_profile) OpenAPI_plmn_id_free(node->data); } OpenAPI_list_free(nf_profile->plmn_list); + OpenAPI_list_for_each(nf_profile->snpn_list, node) { + OpenAPI_plmn_id_nid_free(node->data); + } + OpenAPI_list_free(nf_profile->snpn_list); OpenAPI_list_for_each(nf_profile->s_nssais, node) { OpenAPI_snssai_free(node->data); } @@ -149,6 +181,10 @@ void OpenAPI_nf_profile_free(OpenAPI_nf_profile_t *nf_profile) OpenAPI_plmn_id_free(node->data); } OpenAPI_list_free(nf_profile->allowed_plmns); + OpenAPI_list_for_each(nf_profile->allowed_snpns, node) { + OpenAPI_plmn_id_nid_free(node->data); + } + OpenAPI_list_free(nf_profile->allowed_snpns); OpenAPI_list_free(nf_profile->allowed_nf_types); OpenAPI_list_for_each(nf_profile->allowed_nf_domains, node) { ogs_free(node->data); @@ -158,6 +194,7 @@ void OpenAPI_nf_profile_free(OpenAPI_nf_profile_t *nf_profile) OpenAPI_snssai_free(node->data); } OpenAPI_list_free(nf_profile->allowed_nssais); + ogs_free(nf_profile->load_time_stamp); ogs_free(nf_profile->locality); OpenAPI_udr_info_free(nf_profile->udr_info); OpenAPI_list_for_each(nf_profile->udr_info_ext, node) { @@ -204,8 +241,22 @@ void OpenAPI_nf_profile_free(OpenAPI_nf_profile_t *nf_profile) OpenAPI_chf_info_free(node->data); } OpenAPI_list_free(nf_profile->chf_info_ext); + OpenAPI_nef_info_free(nf_profile->nef_info); OpenAPI_nrf_info_free(nf_profile->nrf_info); + OpenAPI_udsf_info_free(nf_profile->udsf_info); + OpenAPI_list_for_each(nf_profile->udsf_info_ext, node) { + OpenAPI_udsf_info_free(node->data); + } + OpenAPI_list_free(nf_profile->udsf_info_ext); OpenAPI_nwdaf_info_free(nf_profile->nwdaf_info); + OpenAPI_list_for_each(nf_profile->pcscf_info, node) { + OpenAPI_pcscf_info_free(node->data); + } + OpenAPI_list_free(nf_profile->pcscf_info); + OpenAPI_list_for_each(nf_profile->hss_info, node) { + OpenAPI_hss_info_free(node->data); + } + OpenAPI_list_free(nf_profile->hss_info); OpenAPI_object_free(nf_profile->custom_info); ogs_free(nf_profile->recovery_time); OpenAPI_list_for_each(nf_profile->nf_services, node) { @@ -216,6 +267,16 @@ void OpenAPI_nf_profile_free(OpenAPI_nf_profile_t *nf_profile) OpenAPI_default_notification_subscription_free(node->data); } OpenAPI_list_free(nf_profile->default_notification_subscriptions); + OpenAPI_lmf_info_free(nf_profile->lmf_info); + OpenAPI_gmlc_info_free(nf_profile->gmlc_info); + OpenAPI_list_for_each(nf_profile->nf_set_id_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(nf_profile->nf_set_id_list); + OpenAPI_list_for_each(nf_profile->serving_scope, node) { + ogs_free(node->data); + } + OpenAPI_list_free(nf_profile->serving_scope); ogs_free(nf_profile); } @@ -290,6 +351,26 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) } } + if (nf_profile->snpn_list) { + cJSON *snpn_listList = cJSON_AddArrayToObject(item, "snpnList"); + if (snpn_listList == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [snpn_list]"); + goto end; + } + + OpenAPI_lnode_t *snpn_list_node; + if (nf_profile->snpn_list) { + OpenAPI_list_for_each(nf_profile->snpn_list, snpn_list_node) { + cJSON *itemLocal = OpenAPI_plmn_id_nid_convertToJSON(snpn_list_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [snpn_list]"); + goto end; + } + cJSON_AddItemToArray(snpn_listList, itemLocal); + } + } + } + if (nf_profile->s_nssais) { cJSON *s_nssaisList = cJSON_AddArrayToObject(item, "sNssais"); if (s_nssaisList == NULL) { @@ -412,6 +493,26 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) } } + if (nf_profile->allowed_snpns) { + cJSON *allowed_snpnsList = cJSON_AddArrayToObject(item, "allowedSnpns"); + if (allowed_snpnsList == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [allowed_snpns]"); + goto end; + } + + OpenAPI_lnode_t *allowed_snpns_node; + if (nf_profile->allowed_snpns) { + OpenAPI_list_for_each(nf_profile->allowed_snpns, allowed_snpns_node) { + cJSON *itemLocal = OpenAPI_plmn_id_nid_convertToJSON(allowed_snpns_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [allowed_snpns]"); + goto end; + } + cJSON_AddItemToArray(allowed_snpnsList, itemLocal); + } + } + } + if (nf_profile->allowed_nf_types) { cJSON *allowed_nf_types = cJSON_AddArrayToObject(item, "allowedNfTypes"); if (allowed_nf_types == NULL) { @@ -484,6 +585,13 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) } } + if (nf_profile->load_time_stamp) { + if (cJSON_AddStringToObject(item, "loadTimeStamp", nf_profile->load_time_stamp) == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [load_time_stamp]"); + goto end; + } + } + if (nf_profile->locality) { if (cJSON_AddStringToObject(item, "locality", nf_profile->locality) == NULL) { ogs_error("OpenAPI_nf_profile_convertToJSON() failed [locality]"); @@ -788,6 +896,19 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) } } + if (nf_profile->nef_info) { + cJSON *nef_info_local_JSON = OpenAPI_nef_info_convertToJSON(nf_profile->nef_info); + if (nef_info_local_JSON == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [nef_info]"); + goto end; + } + cJSON_AddItemToObject(item, "nefInfo", nef_info_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [nef_info]"); + goto end; + } + } + if (nf_profile->nrf_info) { cJSON *nrf_info_local_JSON = OpenAPI_nrf_info_convertToJSON(nf_profile->nrf_info); if (nrf_info_local_JSON == NULL) { @@ -801,6 +922,39 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) } } + if (nf_profile->udsf_info) { + cJSON *udsf_info_local_JSON = OpenAPI_udsf_info_convertToJSON(nf_profile->udsf_info); + if (udsf_info_local_JSON == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [udsf_info]"); + goto end; + } + cJSON_AddItemToObject(item, "udsfInfo", udsf_info_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [udsf_info]"); + goto end; + } + } + + if (nf_profile->udsf_info_ext) { + cJSON *udsf_info_extList = cJSON_AddArrayToObject(item, "udsfInfoExt"); + if (udsf_info_extList == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [udsf_info_ext]"); + goto end; + } + + OpenAPI_lnode_t *udsf_info_ext_node; + if (nf_profile->udsf_info_ext) { + OpenAPI_list_for_each(nf_profile->udsf_info_ext, udsf_info_ext_node) { + cJSON *itemLocal = OpenAPI_udsf_info_convertToJSON(udsf_info_ext_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [udsf_info_ext]"); + goto end; + } + cJSON_AddItemToArray(udsf_info_extList, itemLocal); + } + } + } + if (nf_profile->nwdaf_info) { cJSON *nwdaf_info_local_JSON = OpenAPI_nwdaf_info_convertToJSON(nf_profile->nwdaf_info); if (nwdaf_info_local_JSON == NULL) { @@ -814,6 +968,46 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) } } + if (nf_profile->pcscf_info) { + cJSON *pcscf_infoList = cJSON_AddArrayToObject(item, "pcscfInfo"); + if (pcscf_infoList == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [pcscf_info]"); + goto end; + } + + OpenAPI_lnode_t *pcscf_info_node; + if (nf_profile->pcscf_info) { + OpenAPI_list_for_each(nf_profile->pcscf_info, pcscf_info_node) { + cJSON *itemLocal = OpenAPI_pcscf_info_convertToJSON(pcscf_info_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [pcscf_info]"); + goto end; + } + cJSON_AddItemToArray(pcscf_infoList, itemLocal); + } + } + } + + if (nf_profile->hss_info) { + cJSON *hss_infoList = cJSON_AddArrayToObject(item, "hssInfo"); + if (hss_infoList == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [hss_info]"); + goto end; + } + + OpenAPI_lnode_t *hss_info_node; + if (nf_profile->hss_info) { + OpenAPI_list_for_each(nf_profile->hss_info, hss_info_node) { + cJSON *itemLocal = OpenAPI_hss_info_convertToJSON(hss_info_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [hss_info]"); + goto end; + } + cJSON_AddItemToArray(hss_infoList, itemLocal); + } + } + } + if (nf_profile->custom_info) { cJSON *custom_info_object = OpenAPI_object_convertToJSON(nf_profile->custom_info); if (custom_info_object == NULL) { @@ -834,7 +1028,7 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) } } - if (nf_profile->nf_service_persistence) { + if (nf_profile->nf_service_persistence >= 0) { if (cJSON_AddBoolToObject(item, "nfServicePersistence", nf_profile->nf_service_persistence) == NULL) { ogs_error("OpenAPI_nf_profile_convertToJSON() failed [nf_service_persistence]"); goto end; @@ -861,14 +1055,14 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) } } - if (nf_profile->nf_profile_changes_support_ind) { + if (nf_profile->nf_profile_changes_support_ind >= 0) { if (cJSON_AddBoolToObject(item, "nfProfileChangesSupportInd", nf_profile->nf_profile_changes_support_ind) == NULL) { ogs_error("OpenAPI_nf_profile_convertToJSON() failed [nf_profile_changes_support_ind]"); goto end; } } - if (nf_profile->nf_profile_changes_ind) { + if (nf_profile->nf_profile_changes_ind >= 0) { if (cJSON_AddBoolToObject(item, "nfProfileChangesInd", nf_profile->nf_profile_changes_ind) == NULL) { ogs_error("OpenAPI_nf_profile_convertToJSON() failed [nf_profile_changes_ind]"); goto end; @@ -895,6 +1089,78 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) } } + if (nf_profile->lmf_info) { + cJSON *lmf_info_local_JSON = OpenAPI_lmf_info_convertToJSON(nf_profile->lmf_info); + if (lmf_info_local_JSON == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [lmf_info]"); + goto end; + } + cJSON_AddItemToObject(item, "lmfInfo", lmf_info_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [lmf_info]"); + goto end; + } + } + + if (nf_profile->gmlc_info) { + cJSON *gmlc_info_local_JSON = OpenAPI_gmlc_info_convertToJSON(nf_profile->gmlc_info); + if (gmlc_info_local_JSON == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [gmlc_info]"); + goto end; + } + cJSON_AddItemToObject(item, "gmlcInfo", gmlc_info_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [gmlc_info]"); + goto end; + } + } + + if (nf_profile->nf_set_id_list) { + cJSON *nf_set_id_list = cJSON_AddArrayToObject(item, "nfSetIdList"); + if (nf_set_id_list == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [nf_set_id_list]"); + goto end; + } + + OpenAPI_lnode_t *nf_set_id_list_node; + OpenAPI_list_for_each(nf_profile->nf_set_id_list, nf_set_id_list_node) { + if (cJSON_AddStringToObject(nf_set_id_list, "", (char*)nf_set_id_list_node->data) == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [nf_set_id_list]"); + goto end; + } + } + } + + if (nf_profile->serving_scope) { + cJSON *serving_scope = cJSON_AddArrayToObject(item, "servingScope"); + if (serving_scope == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [serving_scope]"); + goto end; + } + + OpenAPI_lnode_t *serving_scope_node; + OpenAPI_list_for_each(nf_profile->serving_scope, serving_scope_node) { + if (cJSON_AddStringToObject(serving_scope, "", (char*)serving_scope_node->data) == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [serving_scope]"); + goto end; + } + } + } + + if (nf_profile->lc_h_support_ind >= 0) { + if (cJSON_AddBoolToObject(item, "lcHSupportInd", nf_profile->lc_h_support_ind) == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [lc_h_support_ind]"); + goto end; + } + } + + if (nf_profile->olc_h_support_ind >= 0) { + if (cJSON_AddBoolToObject(item, "olcHSupportInd", nf_profile->olc_h_support_ind) == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [olc_h_support_ind]"); + goto end; + } + } + end: return item; } @@ -983,6 +1249,29 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_parseFromJSON(cJSON *nf_profileJSON) } } + cJSON *snpn_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "snpnList"); + + OpenAPI_list_t *snpn_listList; + if (snpn_list) { + cJSON *snpn_list_local_nonprimitive; + if (!cJSON_IsArray(snpn_list)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [snpn_list]"); + goto end; + } + + snpn_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(snpn_list_local_nonprimitive, snpn_list ) { + if (!cJSON_IsObject(snpn_list_local_nonprimitive)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [snpn_list]"); + goto end; + } + OpenAPI_plmn_id_nid_t *snpn_listItem = OpenAPI_plmn_id_nid_parseFromJSON(snpn_list_local_nonprimitive); + + OpenAPI_list_add(snpn_listList, snpn_listItem); + } + } + cJSON *s_nssais = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "sNssais"); OpenAPI_list_t *s_nssaisList; @@ -1130,6 +1419,29 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_parseFromJSON(cJSON *nf_profileJSON) } } + cJSON *allowed_snpns = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "allowedSnpns"); + + OpenAPI_list_t *allowed_snpnsList; + if (allowed_snpns) { + cJSON *allowed_snpns_local_nonprimitive; + if (!cJSON_IsArray(allowed_snpns)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [allowed_snpns]"); + goto end; + } + + allowed_snpnsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_snpns_local_nonprimitive, allowed_snpns ) { + if (!cJSON_IsObject(allowed_snpns_local_nonprimitive)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [allowed_snpns]"); + goto end; + } + OpenAPI_plmn_id_nid_t *allowed_snpnsItem = OpenAPI_plmn_id_nid_parseFromJSON(allowed_snpns_local_nonprimitive); + + OpenAPI_list_add(allowed_snpnsList, allowed_snpnsItem); + } + } + cJSON *allowed_nf_types = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "allowedNfTypes"); OpenAPI_list_t *allowed_nf_typesList; @@ -1222,6 +1534,15 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_parseFromJSON(cJSON *nf_profileJSON) } } + cJSON *load_time_stamp = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "loadTimeStamp"); + + if (load_time_stamp) { + if (!cJSON_IsString(load_time_stamp)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [load_time_stamp]"); + goto end; + } + } + cJSON *locality = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "locality"); if (locality) { @@ -1501,6 +1822,13 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_parseFromJSON(cJSON *nf_profileJSON) } } + cJSON *nef_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nefInfo"); + + OpenAPI_nef_info_t *nef_info_local_nonprim = NULL; + if (nef_info) { + nef_info_local_nonprim = OpenAPI_nef_info_parseFromJSON(nef_info); + } + cJSON *nrf_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nrfInfo"); OpenAPI_nrf_info_t *nrf_info_local_nonprim = NULL; @@ -1508,6 +1836,36 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_parseFromJSON(cJSON *nf_profileJSON) nrf_info_local_nonprim = OpenAPI_nrf_info_parseFromJSON(nrf_info); } + cJSON *udsf_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "udsfInfo"); + + OpenAPI_udsf_info_t *udsf_info_local_nonprim = NULL; + if (udsf_info) { + udsf_info_local_nonprim = OpenAPI_udsf_info_parseFromJSON(udsf_info); + } + + cJSON *udsf_info_ext = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "udsfInfoExt"); + + OpenAPI_list_t *udsf_info_extList; + if (udsf_info_ext) { + cJSON *udsf_info_ext_local_nonprimitive; + if (!cJSON_IsArray(udsf_info_ext)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [udsf_info_ext]"); + goto end; + } + + udsf_info_extList = OpenAPI_list_create(); + + cJSON_ArrayForEach(udsf_info_ext_local_nonprimitive, udsf_info_ext ) { + if (!cJSON_IsObject(udsf_info_ext_local_nonprimitive)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [udsf_info_ext]"); + goto end; + } + OpenAPI_udsf_info_t *udsf_info_extItem = OpenAPI_udsf_info_parseFromJSON(udsf_info_ext_local_nonprimitive); + + OpenAPI_list_add(udsf_info_extList, udsf_info_extItem); + } + } + cJSON *nwdaf_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nwdafInfo"); OpenAPI_nwdaf_info_t *nwdaf_info_local_nonprim = NULL; @@ -1515,6 +1873,52 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_parseFromJSON(cJSON *nf_profileJSON) nwdaf_info_local_nonprim = OpenAPI_nwdaf_info_parseFromJSON(nwdaf_info); } + cJSON *pcscf_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "pcscfInfo"); + + OpenAPI_list_t *pcscf_infoList; + if (pcscf_info) { + cJSON *pcscf_info_local_nonprimitive; + if (!cJSON_IsArray(pcscf_info)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [pcscf_info]"); + goto end; + } + + pcscf_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pcscf_info_local_nonprimitive, pcscf_info ) { + if (!cJSON_IsObject(pcscf_info_local_nonprimitive)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [pcscf_info]"); + goto end; + } + OpenAPI_pcscf_info_t *pcscf_infoItem = OpenAPI_pcscf_info_parseFromJSON(pcscf_info_local_nonprimitive); + + OpenAPI_list_add(pcscf_infoList, pcscf_infoItem); + } + } + + cJSON *hss_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "hssInfo"); + + OpenAPI_list_t *hss_infoList; + if (hss_info) { + cJSON *hss_info_local_nonprimitive; + if (!cJSON_IsArray(hss_info)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [hss_info]"); + goto end; + } + + hss_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(hss_info_local_nonprimitive, hss_info ) { + if (!cJSON_IsObject(hss_info_local_nonprimitive)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [hss_info]"); + goto end; + } + OpenAPI_hss_info_t *hss_infoItem = OpenAPI_hss_info_parseFromJSON(hss_info_local_nonprimitive); + + OpenAPI_list_add(hss_infoList, hss_infoItem); + } + } + cJSON *custom_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "customInfo"); OpenAPI_object_t *custom_info_local_object = NULL; @@ -1604,6 +2008,78 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_parseFromJSON(cJSON *nf_profileJSON) } } + cJSON *lmf_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "lmfInfo"); + + OpenAPI_lmf_info_t *lmf_info_local_nonprim = NULL; + if (lmf_info) { + lmf_info_local_nonprim = OpenAPI_lmf_info_parseFromJSON(lmf_info); + } + + cJSON *gmlc_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "gmlcInfo"); + + OpenAPI_gmlc_info_t *gmlc_info_local_nonprim = NULL; + if (gmlc_info) { + gmlc_info_local_nonprim = OpenAPI_gmlc_info_parseFromJSON(gmlc_info); + } + + cJSON *nf_set_id_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nfSetIdList"); + + OpenAPI_list_t *nf_set_id_listList; + if (nf_set_id_list) { + cJSON *nf_set_id_list_local; + if (!cJSON_IsArray(nf_set_id_list)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [nf_set_id_list]"); + goto end; + } + nf_set_id_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(nf_set_id_list_local, nf_set_id_list) { + if (!cJSON_IsString(nf_set_id_list_local)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [nf_set_id_list]"); + goto end; + } + OpenAPI_list_add(nf_set_id_listList, ogs_strdup(nf_set_id_list_local->valuestring)); + } + } + + cJSON *serving_scope = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "servingScope"); + + OpenAPI_list_t *serving_scopeList; + if (serving_scope) { + cJSON *serving_scope_local; + if (!cJSON_IsArray(serving_scope)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [serving_scope]"); + goto end; + } + serving_scopeList = OpenAPI_list_create(); + + cJSON_ArrayForEach(serving_scope_local, serving_scope) { + if (!cJSON_IsString(serving_scope_local)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [serving_scope]"); + goto end; + } + OpenAPI_list_add(serving_scopeList, ogs_strdup(serving_scope_local->valuestring)); + } + } + + cJSON *lc_h_support_ind = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "lcHSupportInd"); + + if (lc_h_support_ind) { + if (!cJSON_IsBool(lc_h_support_ind)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [lc_h_support_ind]"); + goto end; + } + } + + cJSON *olc_h_support_ind = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "olcHSupportInd"); + + if (olc_h_support_ind) { + if (!cJSON_IsBool(olc_h_support_ind)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [olc_h_support_ind]"); + goto end; + } + } + nf_profile_local_var = OpenAPI_nf_profile_create ( ogs_strdup(nf_instance_id->valuestring), nf_instance_name ? ogs_strdup(nf_instance_name->valuestring) : NULL, @@ -1611,6 +2087,7 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_parseFromJSON(cJSON *nf_profileJSON) nf_statusVariable, heart_beat_timer ? heart_beat_timer->valuedouble : 0, plmn_list ? plmn_listList : NULL, + snpn_list ? snpn_listList : NULL, s_nssais ? s_nssaisList : NULL, per_plmn_snssai_list ? per_plmn_snssai_listList : NULL, nsi_list ? nsi_listList : NULL, @@ -1619,12 +2096,14 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_parseFromJSON(cJSON *nf_profileJSON) ipv4_addresses ? ipv4_addressesList : NULL, ipv6_addresses ? ipv6_addressesList : NULL, allowed_plmns ? allowed_plmnsList : NULL, + allowed_snpns ? allowed_snpnsList : NULL, allowed_nf_types ? allowed_nf_typesList : NULL, allowed_nf_domains ? allowed_nf_domainsList : NULL, allowed_nssais ? allowed_nssaisList : NULL, priority ? priority->valuedouble : 0, capacity ? capacity->valuedouble : 0, load ? load->valuedouble : 0, + load_time_stamp ? ogs_strdup(load_time_stamp->valuestring) : NULL, locality ? ogs_strdup(locality->valuestring) : NULL, udr_info ? udr_info_local_nonprim : NULL, udr_info_ext ? udr_info_extList : NULL, @@ -1644,15 +2123,26 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_parseFromJSON(cJSON *nf_profileJSON) bsf_info_ext ? bsf_info_extList : NULL, chf_info ? chf_info_local_nonprim : NULL, chf_info_ext ? chf_info_extList : NULL, + nef_info ? nef_info_local_nonprim : NULL, nrf_info ? nrf_info_local_nonprim : NULL, + udsf_info ? udsf_info_local_nonprim : NULL, + udsf_info_ext ? udsf_info_extList : NULL, nwdaf_info ? nwdaf_info_local_nonprim : NULL, + pcscf_info ? pcscf_infoList : NULL, + hss_info ? hss_infoList : NULL, custom_info ? custom_info_local_object : NULL, recovery_time ? ogs_strdup(recovery_time->valuestring) : NULL, nf_service_persistence ? nf_service_persistence->valueint : 0, nf_services ? nf_servicesList : NULL, nf_profile_changes_support_ind ? nf_profile_changes_support_ind->valueint : 0, nf_profile_changes_ind ? nf_profile_changes_ind->valueint : 0, - default_notification_subscriptions ? default_notification_subscriptionsList : NULL + default_notification_subscriptions ? default_notification_subscriptionsList : NULL, + lmf_info ? lmf_info_local_nonprim : NULL, + gmlc_info ? gmlc_info_local_nonprim : NULL, + nf_set_id_list ? nf_set_id_listList : NULL, + serving_scope ? serving_scopeList : NULL, + lc_h_support_ind ? lc_h_support_ind->valueint : 0, + olc_h_support_ind ? olc_h_support_ind->valueint : 0 ); return nf_profile_local_var; diff --git a/lib/sbi/openapi/model/nf_profile.h b/lib/sbi/openapi/model/nf_profile.h index f342888d9d..dd72e9653f 100644 --- a/lib/sbi/openapi/model/nf_profile.h +++ b/lib/sbi/openapi/model/nf_profile.h @@ -1,7 +1,7 @@ /* * nf_profile.h * - * + * Information of an NF Instance registered in the NRF */ #ifndef _OpenAPI_nf_profile_H_ @@ -17,6 +17,10 @@ #include "bsf_info.h" #include "chf_info.h" #include "default_notification_subscription.h" +#include "gmlc_info.h" +#include "hss_info.h" +#include "lmf_info.h" +#include "nef_info.h" #include "nf_service.h" #include "nf_status.h" #include "nf_type.h" @@ -24,12 +28,15 @@ #include "nwdaf_info.h" #include "object.h" #include "pcf_info.h" +#include "pcscf_info.h" #include "plmn_id.h" +#include "plmn_id_nid.h" #include "plmn_snssai.h" #include "smf_info.h" #include "snssai.h" #include "udm_info.h" #include "udr_info.h" +#include "udsf_info.h" #include "upf_info.h" #ifdef __cplusplus @@ -44,6 +51,7 @@ typedef struct OpenAPI_nf_profile_s { OpenAPI_nf_status_e nf_status; int heart_beat_timer; OpenAPI_list_t *plmn_list; + OpenAPI_list_t *snpn_list; OpenAPI_list_t *s_nssais; OpenAPI_list_t *per_plmn_snssai_list; OpenAPI_list_t *nsi_list; @@ -52,12 +60,14 @@ typedef struct OpenAPI_nf_profile_s { OpenAPI_list_t *ipv4_addresses; OpenAPI_list_t *ipv6_addresses; OpenAPI_list_t *allowed_plmns; + OpenAPI_list_t *allowed_snpns; OpenAPI_list_t *allowed_nf_types; OpenAPI_list_t *allowed_nf_domains; OpenAPI_list_t *allowed_nssais; int priority; int capacity; int load; + char *load_time_stamp; char *locality; struct OpenAPI_udr_info_s *udr_info; OpenAPI_list_t *udr_info_ext; @@ -77,8 +87,13 @@ typedef struct OpenAPI_nf_profile_s { OpenAPI_list_t *bsf_info_ext; struct OpenAPI_chf_info_s *chf_info; OpenAPI_list_t *chf_info_ext; + struct OpenAPI_nef_info_s *nef_info; struct OpenAPI_nrf_info_s *nrf_info; + struct OpenAPI_udsf_info_s *udsf_info; + OpenAPI_list_t *udsf_info_ext; struct OpenAPI_nwdaf_info_s *nwdaf_info; + OpenAPI_list_t *pcscf_info; + OpenAPI_list_t *hss_info; OpenAPI_object_t *custom_info; char *recovery_time; int nf_service_persistence; @@ -86,6 +101,12 @@ typedef struct OpenAPI_nf_profile_s { int nf_profile_changes_support_ind; int nf_profile_changes_ind; OpenAPI_list_t *default_notification_subscriptions; + struct OpenAPI_lmf_info_s *lmf_info; + struct OpenAPI_gmlc_info_s *gmlc_info; + OpenAPI_list_t *nf_set_id_list; + OpenAPI_list_t *serving_scope; + int lc_h_support_ind; + int olc_h_support_ind; } OpenAPI_nf_profile_t; OpenAPI_nf_profile_t *OpenAPI_nf_profile_create( @@ -95,6 +116,7 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_create( OpenAPI_nf_status_e nf_status, int heart_beat_timer, OpenAPI_list_t *plmn_list, + OpenAPI_list_t *snpn_list, OpenAPI_list_t *s_nssais, OpenAPI_list_t *per_plmn_snssai_list, OpenAPI_list_t *nsi_list, @@ -103,12 +125,14 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_create( OpenAPI_list_t *ipv4_addresses, OpenAPI_list_t *ipv6_addresses, OpenAPI_list_t *allowed_plmns, + OpenAPI_list_t *allowed_snpns, OpenAPI_list_t *allowed_nf_types, OpenAPI_list_t *allowed_nf_domains, OpenAPI_list_t *allowed_nssais, int priority, int capacity, int load, + char *load_time_stamp, char *locality, OpenAPI_udr_info_t *udr_info, OpenAPI_list_t *udr_info_ext, @@ -128,15 +152,26 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_create( OpenAPI_list_t *bsf_info_ext, OpenAPI_chf_info_t *chf_info, OpenAPI_list_t *chf_info_ext, + OpenAPI_nef_info_t *nef_info, OpenAPI_nrf_info_t *nrf_info, + OpenAPI_udsf_info_t *udsf_info, + OpenAPI_list_t *udsf_info_ext, OpenAPI_nwdaf_info_t *nwdaf_info, + OpenAPI_list_t *pcscf_info, + OpenAPI_list_t *hss_info, OpenAPI_object_t *custom_info, char *recovery_time, int nf_service_persistence, OpenAPI_list_t *nf_services, int nf_profile_changes_support_ind, int nf_profile_changes_ind, - OpenAPI_list_t *default_notification_subscriptions + OpenAPI_list_t *default_notification_subscriptions, + OpenAPI_lmf_info_t *lmf_info, + OpenAPI_gmlc_info_t *gmlc_info, + OpenAPI_list_t *nf_set_id_list, + OpenAPI_list_t *serving_scope, + int lc_h_support_ind, + int olc_h_support_ind ); void OpenAPI_nf_profile_free(OpenAPI_nf_profile_t *nf_profile); OpenAPI_nf_profile_t *OpenAPI_nf_profile_parseFromJSON(cJSON *nf_profileJSON); diff --git a/lib/sbi/openapi/model/nf_service.c b/lib/sbi/openapi/model/nf_service.c index 3505363499..3af01d0bdd 100644 --- a/lib/sbi/openapi/model/nf_service.c +++ b/lib/sbi/openapi/model/nf_service.c @@ -16,15 +16,23 @@ OpenAPI_nf_service_t *OpenAPI_nf_service_create( char *api_prefix, OpenAPI_list_t *default_notification_subscriptions, OpenAPI_list_t *allowed_plmns, + OpenAPI_list_t *allowed_snpns, OpenAPI_list_t *allowed_nf_types, OpenAPI_list_t *allowed_nf_domains, OpenAPI_list_t *allowed_nssais, int priority, int capacity, int load, + char *load_time_stamp, char *recovery_time, OpenAPI_chf_service_info_t *chf_service_info, - char *supported_features + char *supported_features, + OpenAPI_list_t *nf_service_set_id_list, + OpenAPI_list_t *s_nssais, + OpenAPI_list_t *per_plmn_snssai_list, + char *vendor_id, + OpenAPI_list_t* supported_vendor_specific_features, + int oauth2_required ) { OpenAPI_nf_service_t *nf_service_local_var = OpenAPI_malloc(sizeof(OpenAPI_nf_service_t)); @@ -42,15 +50,23 @@ OpenAPI_nf_service_t *OpenAPI_nf_service_create( nf_service_local_var->api_prefix = api_prefix; nf_service_local_var->default_notification_subscriptions = default_notification_subscriptions; nf_service_local_var->allowed_plmns = allowed_plmns; + nf_service_local_var->allowed_snpns = allowed_snpns; nf_service_local_var->allowed_nf_types = allowed_nf_types; nf_service_local_var->allowed_nf_domains = allowed_nf_domains; nf_service_local_var->allowed_nssais = allowed_nssais; nf_service_local_var->priority = priority; nf_service_local_var->capacity = capacity; nf_service_local_var->load = load; + nf_service_local_var->load_time_stamp = load_time_stamp; nf_service_local_var->recovery_time = recovery_time; nf_service_local_var->chf_service_info = chf_service_info; nf_service_local_var->supported_features = supported_features; + nf_service_local_var->nf_service_set_id_list = nf_service_set_id_list; + nf_service_local_var->s_nssais = s_nssais; + nf_service_local_var->per_plmn_snssai_list = per_plmn_snssai_list; + nf_service_local_var->vendor_id = vendor_id; + nf_service_local_var->supported_vendor_specific_features = supported_vendor_specific_features; + nf_service_local_var->oauth2_required = oauth2_required; return nf_service_local_var; } @@ -82,6 +98,10 @@ void OpenAPI_nf_service_free(OpenAPI_nf_service_t *nf_service) OpenAPI_plmn_id_free(node->data); } OpenAPI_list_free(nf_service->allowed_plmns); + OpenAPI_list_for_each(nf_service->allowed_snpns, node) { + OpenAPI_plmn_id_nid_free(node->data); + } + OpenAPI_list_free(nf_service->allowed_snpns); OpenAPI_list_free(nf_service->allowed_nf_types); OpenAPI_list_for_each(nf_service->allowed_nf_domains, node) { ogs_free(node->data); @@ -91,9 +111,29 @@ void OpenAPI_nf_service_free(OpenAPI_nf_service_t *nf_service) OpenAPI_snssai_free(node->data); } OpenAPI_list_free(nf_service->allowed_nssais); + ogs_free(nf_service->load_time_stamp); ogs_free(nf_service->recovery_time); OpenAPI_chf_service_info_free(nf_service->chf_service_info); ogs_free(nf_service->supported_features); + OpenAPI_list_for_each(nf_service->nf_service_set_id_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(nf_service->nf_service_set_id_list); + OpenAPI_list_for_each(nf_service->s_nssais, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(nf_service->s_nssais); + OpenAPI_list_for_each(nf_service->per_plmn_snssai_list, node) { + OpenAPI_plmn_snssai_free(node->data); + } + OpenAPI_list_free(nf_service->per_plmn_snssai_list); + ogs_free(nf_service->vendor_id); + OpenAPI_list_for_each(nf_service->supported_vendor_specific_features, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(nf_service->supported_vendor_specific_features); ogs_free(nf_service); } @@ -246,6 +286,26 @@ cJSON *OpenAPI_nf_service_convertToJSON(OpenAPI_nf_service_t *nf_service) } } + if (nf_service->allowed_snpns) { + cJSON *allowed_snpnsList = cJSON_AddArrayToObject(item, "allowedSnpns"); + if (allowed_snpnsList == NULL) { + ogs_error("OpenAPI_nf_service_convertToJSON() failed [allowed_snpns]"); + goto end; + } + + OpenAPI_lnode_t *allowed_snpns_node; + if (nf_service->allowed_snpns) { + OpenAPI_list_for_each(nf_service->allowed_snpns, allowed_snpns_node) { + cJSON *itemLocal = OpenAPI_plmn_id_nid_convertToJSON(allowed_snpns_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_service_convertToJSON() failed [allowed_snpns]"); + goto end; + } + cJSON_AddItemToArray(allowed_snpnsList, itemLocal); + } + } + } + if (nf_service->allowed_nf_types) { cJSON *allowed_nf_types = cJSON_AddArrayToObject(item, "allowedNfTypes"); if (allowed_nf_types == NULL) { @@ -318,6 +378,13 @@ cJSON *OpenAPI_nf_service_convertToJSON(OpenAPI_nf_service_t *nf_service) } } + if (nf_service->load_time_stamp) { + if (cJSON_AddStringToObject(item, "loadTimeStamp", nf_service->load_time_stamp) == NULL) { + ogs_error("OpenAPI_nf_service_convertToJSON() failed [load_time_stamp]"); + goto end; + } + } + if (nf_service->recovery_time) { if (cJSON_AddStringToObject(item, "recoveryTime", nf_service->recovery_time) == NULL) { ogs_error("OpenAPI_nf_service_convertToJSON() failed [recovery_time]"); @@ -345,6 +412,91 @@ cJSON *OpenAPI_nf_service_convertToJSON(OpenAPI_nf_service_t *nf_service) } } + if (nf_service->nf_service_set_id_list) { + cJSON *nf_service_set_id_list = cJSON_AddArrayToObject(item, "nfServiceSetIdList"); + if (nf_service_set_id_list == NULL) { + ogs_error("OpenAPI_nf_service_convertToJSON() failed [nf_service_set_id_list]"); + goto end; + } + + OpenAPI_lnode_t *nf_service_set_id_list_node; + OpenAPI_list_for_each(nf_service->nf_service_set_id_list, nf_service_set_id_list_node) { + if (cJSON_AddStringToObject(nf_service_set_id_list, "", (char*)nf_service_set_id_list_node->data) == NULL) { + ogs_error("OpenAPI_nf_service_convertToJSON() failed [nf_service_set_id_list]"); + goto end; + } + } + } + + if (nf_service->s_nssais) { + cJSON *s_nssaisList = cJSON_AddArrayToObject(item, "sNssais"); + if (s_nssaisList == NULL) { + ogs_error("OpenAPI_nf_service_convertToJSON() failed [s_nssais]"); + goto end; + } + + OpenAPI_lnode_t *s_nssais_node; + if (nf_service->s_nssais) { + OpenAPI_list_for_each(nf_service->s_nssais, s_nssais_node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(s_nssais_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_service_convertToJSON() failed [s_nssais]"); + goto end; + } + cJSON_AddItemToArray(s_nssaisList, itemLocal); + } + } + } + + if (nf_service->per_plmn_snssai_list) { + cJSON *per_plmn_snssai_listList = cJSON_AddArrayToObject(item, "perPlmnSnssaiList"); + if (per_plmn_snssai_listList == NULL) { + ogs_error("OpenAPI_nf_service_convertToJSON() failed [per_plmn_snssai_list]"); + goto end; + } + + OpenAPI_lnode_t *per_plmn_snssai_list_node; + if (nf_service->per_plmn_snssai_list) { + OpenAPI_list_for_each(nf_service->per_plmn_snssai_list, per_plmn_snssai_list_node) { + cJSON *itemLocal = OpenAPI_plmn_snssai_convertToJSON(per_plmn_snssai_list_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_service_convertToJSON() failed [per_plmn_snssai_list]"); + goto end; + } + cJSON_AddItemToArray(per_plmn_snssai_listList, itemLocal); + } + } + } + + if (nf_service->vendor_id) { + if (cJSON_AddStringToObject(item, "vendorId", nf_service->vendor_id) == NULL) { + ogs_error("OpenAPI_nf_service_convertToJSON() failed [vendor_id]"); + goto end; + } + } + + if (nf_service->supported_vendor_specific_features) { + cJSON *supported_vendor_specific_features = cJSON_AddObjectToObject(item, "supportedVendorSpecificFeatures"); + if (supported_vendor_specific_features == NULL) { + ogs_error("OpenAPI_nf_service_convertToJSON() failed [supported_vendor_specific_features]"); + goto end; + } + cJSON *localMapObject = supported_vendor_specific_features; + OpenAPI_lnode_t *supported_vendor_specific_features_node; + if (nf_service->supported_vendor_specific_features) { + OpenAPI_list_for_each(nf_service->supported_vendor_specific_features, supported_vendor_specific_features_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)supported_vendor_specific_features_node->data; + } + } + } + + if (nf_service->oauth2_required >= 0) { + if (cJSON_AddBoolToObject(item, "oauth2Required", nf_service->oauth2_required) == NULL) { + ogs_error("OpenAPI_nf_service_convertToJSON() failed [oauth2_required]"); + goto end; + } + } + end: return item; } @@ -526,6 +678,29 @@ OpenAPI_nf_service_t *OpenAPI_nf_service_parseFromJSON(cJSON *nf_serviceJSON) } } + cJSON *allowed_snpns = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "allowedSnpns"); + + OpenAPI_list_t *allowed_snpnsList; + if (allowed_snpns) { + cJSON *allowed_snpns_local_nonprimitive; + if (!cJSON_IsArray(allowed_snpns)) { + ogs_error("OpenAPI_nf_service_parseFromJSON() failed [allowed_snpns]"); + goto end; + } + + allowed_snpnsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_snpns_local_nonprimitive, allowed_snpns ) { + if (!cJSON_IsObject(allowed_snpns_local_nonprimitive)) { + ogs_error("OpenAPI_nf_service_parseFromJSON() failed [allowed_snpns]"); + goto end; + } + OpenAPI_plmn_id_nid_t *allowed_snpnsItem = OpenAPI_plmn_id_nid_parseFromJSON(allowed_snpns_local_nonprimitive); + + OpenAPI_list_add(allowed_snpnsList, allowed_snpnsItem); + } + } + cJSON *allowed_nf_types = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "allowedNfTypes"); OpenAPI_list_t *allowed_nf_typesList; @@ -618,6 +793,15 @@ OpenAPI_nf_service_t *OpenAPI_nf_service_parseFromJSON(cJSON *nf_serviceJSON) } } + cJSON *load_time_stamp = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "loadTimeStamp"); + + if (load_time_stamp) { + if (!cJSON_IsString(load_time_stamp)) { + ogs_error("OpenAPI_nf_service_parseFromJSON() failed [load_time_stamp]"); + goto end; + } + } + cJSON *recovery_time = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "recoveryTime"); if (recovery_time) { @@ -643,6 +827,107 @@ OpenAPI_nf_service_t *OpenAPI_nf_service_parseFromJSON(cJSON *nf_serviceJSON) } } + cJSON *nf_service_set_id_list = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "nfServiceSetIdList"); + + OpenAPI_list_t *nf_service_set_id_listList; + if (nf_service_set_id_list) { + cJSON *nf_service_set_id_list_local; + if (!cJSON_IsArray(nf_service_set_id_list)) { + ogs_error("OpenAPI_nf_service_parseFromJSON() failed [nf_service_set_id_list]"); + goto end; + } + nf_service_set_id_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(nf_service_set_id_list_local, nf_service_set_id_list) { + if (!cJSON_IsString(nf_service_set_id_list_local)) { + ogs_error("OpenAPI_nf_service_parseFromJSON() failed [nf_service_set_id_list]"); + goto end; + } + OpenAPI_list_add(nf_service_set_id_listList, ogs_strdup(nf_service_set_id_list_local->valuestring)); + } + } + + cJSON *s_nssais = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "sNssais"); + + OpenAPI_list_t *s_nssaisList; + if (s_nssais) { + cJSON *s_nssais_local_nonprimitive; + if (!cJSON_IsArray(s_nssais)) { + ogs_error("OpenAPI_nf_service_parseFromJSON() failed [s_nssais]"); + goto end; + } + + s_nssaisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(s_nssais_local_nonprimitive, s_nssais ) { + if (!cJSON_IsObject(s_nssais_local_nonprimitive)) { + ogs_error("OpenAPI_nf_service_parseFromJSON() failed [s_nssais]"); + goto end; + } + OpenAPI_snssai_t *s_nssaisItem = OpenAPI_snssai_parseFromJSON(s_nssais_local_nonprimitive); + + OpenAPI_list_add(s_nssaisList, s_nssaisItem); + } + } + + cJSON *per_plmn_snssai_list = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "perPlmnSnssaiList"); + + OpenAPI_list_t *per_plmn_snssai_listList; + if (per_plmn_snssai_list) { + cJSON *per_plmn_snssai_list_local_nonprimitive; + if (!cJSON_IsArray(per_plmn_snssai_list)) { + ogs_error("OpenAPI_nf_service_parseFromJSON() failed [per_plmn_snssai_list]"); + goto end; + } + + per_plmn_snssai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(per_plmn_snssai_list_local_nonprimitive, per_plmn_snssai_list ) { + if (!cJSON_IsObject(per_plmn_snssai_list_local_nonprimitive)) { + ogs_error("OpenAPI_nf_service_parseFromJSON() failed [per_plmn_snssai_list]"); + goto end; + } + OpenAPI_plmn_snssai_t *per_plmn_snssai_listItem = OpenAPI_plmn_snssai_parseFromJSON(per_plmn_snssai_list_local_nonprimitive); + + OpenAPI_list_add(per_plmn_snssai_listList, per_plmn_snssai_listItem); + } + } + + cJSON *vendor_id = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "vendorId"); + + if (vendor_id) { + if (!cJSON_IsString(vendor_id)) { + ogs_error("OpenAPI_nf_service_parseFromJSON() failed [vendor_id]"); + goto end; + } + } + + cJSON *supported_vendor_specific_features = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "supportedVendorSpecificFeatures"); + + OpenAPI_list_t *supported_vendor_specific_featuresList; + if (supported_vendor_specific_features) { + cJSON *supported_vendor_specific_features_local_map; + if (!cJSON_IsObject(supported_vendor_specific_features)) { + ogs_error("OpenAPI_nf_service_parseFromJSON() failed [supported_vendor_specific_features]"); + goto end; + } + supported_vendor_specific_featuresList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(supported_vendor_specific_features_local_map, supported_vendor_specific_features) { + cJSON *localMapObject = supported_vendor_specific_features_local_map; + OpenAPI_list_add(supported_vendor_specific_featuresList, localMapKeyPair); + } + } + + cJSON *oauth2_required = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "oauth2Required"); + + if (oauth2_required) { + if (!cJSON_IsBool(oauth2_required)) { + ogs_error("OpenAPI_nf_service_parseFromJSON() failed [oauth2_required]"); + goto end; + } + } + nf_service_local_var = OpenAPI_nf_service_create ( ogs_strdup(service_instance_id->valuestring), ogs_strdup(service_name->valuestring), @@ -655,15 +940,23 @@ OpenAPI_nf_service_t *OpenAPI_nf_service_parseFromJSON(cJSON *nf_serviceJSON) api_prefix ? ogs_strdup(api_prefix->valuestring) : NULL, default_notification_subscriptions ? default_notification_subscriptionsList : NULL, allowed_plmns ? allowed_plmnsList : NULL, + allowed_snpns ? allowed_snpnsList : NULL, allowed_nf_types ? allowed_nf_typesList : NULL, allowed_nf_domains ? allowed_nf_domainsList : NULL, allowed_nssais ? allowed_nssaisList : NULL, priority ? priority->valuedouble : 0, capacity ? capacity->valuedouble : 0, load ? load->valuedouble : 0, + load_time_stamp ? ogs_strdup(load_time_stamp->valuestring) : NULL, recovery_time ? ogs_strdup(recovery_time->valuestring) : NULL, chf_service_info ? chf_service_info_local_nonprim : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL + supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + nf_service_set_id_list ? nf_service_set_id_listList : NULL, + s_nssais ? s_nssaisList : NULL, + per_plmn_snssai_list ? per_plmn_snssai_listList : NULL, + vendor_id ? ogs_strdup(vendor_id->valuestring) : NULL, + supported_vendor_specific_features ? supported_vendor_specific_featuresList : NULL, + oauth2_required ? oauth2_required->valueint : 0 ); return nf_service_local_var; diff --git a/lib/sbi/openapi/model/nf_service.h b/lib/sbi/openapi/model/nf_service.h index f3755cca94..d60248fc31 100644 --- a/lib/sbi/openapi/model/nf_service.h +++ b/lib/sbi/openapi/model/nf_service.h @@ -1,7 +1,7 @@ /* * nf_service.h * - * + * Information of a given NF Service Instance; it is part of the NFProfile of an NF Instance */ #ifndef _OpenAPI_nf_service_H_ @@ -19,8 +19,11 @@ #include "nf_service_version.h" #include "nf_type.h" #include "plmn_id.h" +#include "plmn_id_nid.h" +#include "plmn_snssai.h" #include "snssai.h" #include "uri_scheme.h" +#include "vendor_specific_feature.h" #ifdef __cplusplus extern "C" { @@ -39,15 +42,23 @@ typedef struct OpenAPI_nf_service_s { char *api_prefix; OpenAPI_list_t *default_notification_subscriptions; OpenAPI_list_t *allowed_plmns; + OpenAPI_list_t *allowed_snpns; OpenAPI_list_t *allowed_nf_types; OpenAPI_list_t *allowed_nf_domains; OpenAPI_list_t *allowed_nssais; int priority; int capacity; int load; + char *load_time_stamp; char *recovery_time; struct OpenAPI_chf_service_info_s *chf_service_info; char *supported_features; + OpenAPI_list_t *nf_service_set_id_list; + OpenAPI_list_t *s_nssais; + OpenAPI_list_t *per_plmn_snssai_list; + char *vendor_id; + OpenAPI_list_t* supported_vendor_specific_features; + int oauth2_required; } OpenAPI_nf_service_t; OpenAPI_nf_service_t *OpenAPI_nf_service_create( @@ -62,15 +73,23 @@ OpenAPI_nf_service_t *OpenAPI_nf_service_create( char *api_prefix, OpenAPI_list_t *default_notification_subscriptions, OpenAPI_list_t *allowed_plmns, + OpenAPI_list_t *allowed_snpns, OpenAPI_list_t *allowed_nf_types, OpenAPI_list_t *allowed_nf_domains, OpenAPI_list_t *allowed_nssais, int priority, int capacity, int load, + char *load_time_stamp, char *recovery_time, OpenAPI_chf_service_info_t *chf_service_info, - char *supported_features + char *supported_features, + OpenAPI_list_t *nf_service_set_id_list, + OpenAPI_list_t *s_nssais, + OpenAPI_list_t *per_plmn_snssai_list, + char *vendor_id, + OpenAPI_list_t* supported_vendor_specific_features, + int oauth2_required ); void OpenAPI_nf_service_free(OpenAPI_nf_service_t *nf_service); OpenAPI_nf_service_t *OpenAPI_nf_service_parseFromJSON(cJSON *nf_serviceJSON); diff --git a/lib/sbi/openapi/model/nf_service_set_cond.c b/lib/sbi/openapi/model/nf_service_set_cond.c new file mode 100644 index 0000000000..53873ac1b4 --- /dev/null +++ b/lib/sbi/openapi/model/nf_service_set_cond.c @@ -0,0 +1,76 @@ + +#include +#include +#include +#include "nf_service_set_cond.h" + +OpenAPI_nf_service_set_cond_t *OpenAPI_nf_service_set_cond_create( + char *nf_service_set_id + ) +{ + OpenAPI_nf_service_set_cond_t *nf_service_set_cond_local_var = OpenAPI_malloc(sizeof(OpenAPI_nf_service_set_cond_t)); + if (!nf_service_set_cond_local_var) { + return NULL; + } + nf_service_set_cond_local_var->nf_service_set_id = nf_service_set_id; + + return nf_service_set_cond_local_var; +} + +void OpenAPI_nf_service_set_cond_free(OpenAPI_nf_service_set_cond_t *nf_service_set_cond) +{ + if (NULL == nf_service_set_cond) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(nf_service_set_cond->nf_service_set_id); + ogs_free(nf_service_set_cond); +} + +cJSON *OpenAPI_nf_service_set_cond_convertToJSON(OpenAPI_nf_service_set_cond_t *nf_service_set_cond) +{ + cJSON *item = NULL; + + if (nf_service_set_cond == NULL) { + ogs_error("OpenAPI_nf_service_set_cond_convertToJSON() failed [NfServiceSetCond]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!nf_service_set_cond->nf_service_set_id) { + ogs_error("OpenAPI_nf_service_set_cond_convertToJSON() failed [nf_service_set_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "nfServiceSetId", nf_service_set_cond->nf_service_set_id) == NULL) { + ogs_error("OpenAPI_nf_service_set_cond_convertToJSON() failed [nf_service_set_id]"); + goto end; + } + +end: + return item; +} + +OpenAPI_nf_service_set_cond_t *OpenAPI_nf_service_set_cond_parseFromJSON(cJSON *nf_service_set_condJSON) +{ + OpenAPI_nf_service_set_cond_t *nf_service_set_cond_local_var = NULL; + cJSON *nf_service_set_id = cJSON_GetObjectItemCaseSensitive(nf_service_set_condJSON, "nfServiceSetId"); + if (!nf_service_set_id) { + ogs_error("OpenAPI_nf_service_set_cond_parseFromJSON() failed [nf_service_set_id]"); + goto end; + } + + + if (!cJSON_IsString(nf_service_set_id)) { + ogs_error("OpenAPI_nf_service_set_cond_parseFromJSON() failed [nf_service_set_id]"); + goto end; + } + + nf_service_set_cond_local_var = OpenAPI_nf_service_set_cond_create ( + ogs_strdup(nf_service_set_id->valuestring) + ); + + return nf_service_set_cond_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/nf_service_set_cond.h b/lib/sbi/openapi/model/nf_service_set_cond.h new file mode 100644 index 0000000000..102460d018 --- /dev/null +++ b/lib/sbi/openapi/model/nf_service_set_cond.h @@ -0,0 +1,37 @@ +/* + * nf_service_set_cond.h + * + * Subscription to a set of NFs based on their Service Set Id + */ + +#ifndef _OpenAPI_nf_service_set_cond_H_ +#define _OpenAPI_nf_service_set_cond_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_nf_service_set_cond_s OpenAPI_nf_service_set_cond_t; +typedef struct OpenAPI_nf_service_set_cond_s { + char *nf_service_set_id; +} OpenAPI_nf_service_set_cond_t; + +OpenAPI_nf_service_set_cond_t *OpenAPI_nf_service_set_cond_create( + char *nf_service_set_id + ); +void OpenAPI_nf_service_set_cond_free(OpenAPI_nf_service_set_cond_t *nf_service_set_cond); +OpenAPI_nf_service_set_cond_t *OpenAPI_nf_service_set_cond_parseFromJSON(cJSON *nf_service_set_condJSON); +cJSON *OpenAPI_nf_service_set_cond_convertToJSON(OpenAPI_nf_service_set_cond_t *nf_service_set_cond); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_nf_service_set_cond_H_ */ + diff --git a/lib/sbi/openapi/model/nf_service_version.h b/lib/sbi/openapi/model/nf_service_version.h index 2cf60eb92f..3720db9b04 100644 --- a/lib/sbi/openapi/model/nf_service_version.h +++ b/lib/sbi/openapi/model/nf_service_version.h @@ -1,7 +1,7 @@ /* * nf_service_version.h * - * + * Contains the version details of an NF service */ #ifndef _OpenAPI_nf_service_version_H_ diff --git a/lib/sbi/openapi/model/nf_set_cond.c b/lib/sbi/openapi/model/nf_set_cond.c new file mode 100644 index 0000000000..c4276e6401 --- /dev/null +++ b/lib/sbi/openapi/model/nf_set_cond.c @@ -0,0 +1,76 @@ + +#include +#include +#include +#include "nf_set_cond.h" + +OpenAPI_nf_set_cond_t *OpenAPI_nf_set_cond_create( + char *nf_set_id + ) +{ + OpenAPI_nf_set_cond_t *nf_set_cond_local_var = OpenAPI_malloc(sizeof(OpenAPI_nf_set_cond_t)); + if (!nf_set_cond_local_var) { + return NULL; + } + nf_set_cond_local_var->nf_set_id = nf_set_id; + + return nf_set_cond_local_var; +} + +void OpenAPI_nf_set_cond_free(OpenAPI_nf_set_cond_t *nf_set_cond) +{ + if (NULL == nf_set_cond) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(nf_set_cond->nf_set_id); + ogs_free(nf_set_cond); +} + +cJSON *OpenAPI_nf_set_cond_convertToJSON(OpenAPI_nf_set_cond_t *nf_set_cond) +{ + cJSON *item = NULL; + + if (nf_set_cond == NULL) { + ogs_error("OpenAPI_nf_set_cond_convertToJSON() failed [NfSetCond]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!nf_set_cond->nf_set_id) { + ogs_error("OpenAPI_nf_set_cond_convertToJSON() failed [nf_set_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "nfSetId", nf_set_cond->nf_set_id) == NULL) { + ogs_error("OpenAPI_nf_set_cond_convertToJSON() failed [nf_set_id]"); + goto end; + } + +end: + return item; +} + +OpenAPI_nf_set_cond_t *OpenAPI_nf_set_cond_parseFromJSON(cJSON *nf_set_condJSON) +{ + OpenAPI_nf_set_cond_t *nf_set_cond_local_var = NULL; + cJSON *nf_set_id = cJSON_GetObjectItemCaseSensitive(nf_set_condJSON, "nfSetId"); + if (!nf_set_id) { + ogs_error("OpenAPI_nf_set_cond_parseFromJSON() failed [nf_set_id]"); + goto end; + } + + + if (!cJSON_IsString(nf_set_id)) { + ogs_error("OpenAPI_nf_set_cond_parseFromJSON() failed [nf_set_id]"); + goto end; + } + + nf_set_cond_local_var = OpenAPI_nf_set_cond_create ( + ogs_strdup(nf_set_id->valuestring) + ); + + return nf_set_cond_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/nf_set_cond.h b/lib/sbi/openapi/model/nf_set_cond.h new file mode 100644 index 0000000000..30b6e30fbe --- /dev/null +++ b/lib/sbi/openapi/model/nf_set_cond.h @@ -0,0 +1,37 @@ +/* + * nf_set_cond.h + * + * Subscription to a set of NFs based on their Set Id + */ + +#ifndef _OpenAPI_nf_set_cond_H_ +#define _OpenAPI_nf_set_cond_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_nf_set_cond_s OpenAPI_nf_set_cond_t; +typedef struct OpenAPI_nf_set_cond_s { + char *nf_set_id; +} OpenAPI_nf_set_cond_t; + +OpenAPI_nf_set_cond_t *OpenAPI_nf_set_cond_create( + char *nf_set_id + ); +void OpenAPI_nf_set_cond_free(OpenAPI_nf_set_cond_t *nf_set_cond); +OpenAPI_nf_set_cond_t *OpenAPI_nf_set_cond_parseFromJSON(cJSON *nf_set_condJSON); +cJSON *OpenAPI_nf_set_cond_convertToJSON(OpenAPI_nf_set_cond_t *nf_set_cond); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_nf_set_cond_H_ */ + diff --git a/lib/sbi/openapi/model/nf_type.c b/lib/sbi/openapi/model/nf_type.c index d1f4c686e7..2548af8f8f 100644 --- a/lib/sbi/openapi/model/nf_type.c +++ b/lib/sbi/openapi/model/nf_type.c @@ -6,7 +6,7 @@ char* OpenAPI_nf_type_ToString(OpenAPI_nf_type_e nf_type) { - const char *nf_typeArray[] = { "NULL", "NRF", "UDM", "AMF", "SMF", "AUSF", "NEF", "PCF", "SMSF", "NSSF", "UDR", "LMF", "GMLC", "5G_EIR", "SEPP", "UPF", "N3IWF", "AF", "UDSF", "BSF", "CHF", "NWDAF" }; + const char *nf_typeArray[] = { "NULL", "NRF", "UDM", "AMF", "SMF", "AUSF", "NEF", "PCF", "SMSF", "NSSF", "UDR", "LMF", "GMLC", "5G_EIR", "SEPP", "UPF", "N3IWF", "AF", "UDSF", "BSF", "CHF", "NWDAF", "PCSCF", "CBCF", "HSS", "UCMF", "SOR_AF", "SPAF", "MME", "SCSAS", "SCEF", "SCP" }; size_t sizeofArray = sizeof(nf_typeArray) / sizeof(nf_typeArray[0]); if (nf_type < sizeofArray) return (char *)nf_typeArray[nf_type]; @@ -17,7 +17,7 @@ char* OpenAPI_nf_type_ToString(OpenAPI_nf_type_e nf_type) OpenAPI_nf_type_e OpenAPI_nf_type_FromString(char* nf_type) { int stringToReturn = 0; - const char *nf_typeArray[] = { "NULL", "NRF", "UDM", "AMF", "SMF", "AUSF", "NEF", "PCF", "SMSF", "NSSF", "UDR", "LMF", "GMLC", "5G_EIR", "SEPP", "UPF", "N3IWF", "AF", "UDSF", "BSF", "CHF", "NWDAF" }; + const char *nf_typeArray[] = { "NULL", "NRF", "UDM", "AMF", "SMF", "AUSF", "NEF", "PCF", "SMSF", "NSSF", "UDR", "LMF", "GMLC", "5G_EIR", "SEPP", "UPF", "N3IWF", "AF", "UDSF", "BSF", "CHF", "NWDAF", "PCSCF", "CBCF", "HSS", "UCMF", "SOR_AF", "SPAF", "MME", "SCSAS", "SCEF", "SCP" }; size_t sizeofArray = sizeof(nf_typeArray) / sizeof(nf_typeArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(nf_type, nf_typeArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/nf_type.h b/lib/sbi/openapi/model/nf_type.h index ae3551997c..b8a1f1b72c 100644 --- a/lib/sbi/openapi/model/nf_type.h +++ b/lib/sbi/openapi/model/nf_type.h @@ -17,7 +17,7 @@ extern "C" { #endif -typedef enum { OpenAPI_nf_type_NULL = 0, OpenAPI_nf_type_NRF, OpenAPI_nf_type_UDM, OpenAPI_nf_type_AMF, OpenAPI_nf_type_SMF, OpenAPI_nf_type_AUSF, OpenAPI_nf_type_NEF, OpenAPI_nf_type_PCF, OpenAPI_nf_type_SMSF, OpenAPI_nf_type_NSSF, OpenAPI_nf_type_UDR, OpenAPI_nf_type_LMF, OpenAPI_nf_type_GMLC, OpenAPI_nf_type_5G_EIR, OpenAPI_nf_type_SEPP, OpenAPI_nf_type_UPF, OpenAPI_nf_type_N3IWF, OpenAPI_nf_type_AF, OpenAPI_nf_type_UDSF, OpenAPI_nf_type_BSF, OpenAPI_nf_type_CHF, OpenAPI_nf_type_NWDAF } OpenAPI_nf_type_e; +typedef enum { OpenAPI_nf_type_NULL = 0, OpenAPI_nf_type_NRF, OpenAPI_nf_type_UDM, OpenAPI_nf_type_AMF, OpenAPI_nf_type_SMF, OpenAPI_nf_type_AUSF, OpenAPI_nf_type_NEF, OpenAPI_nf_type_PCF, OpenAPI_nf_type_SMSF, OpenAPI_nf_type_NSSF, OpenAPI_nf_type_UDR, OpenAPI_nf_type_LMF, OpenAPI_nf_type_GMLC, OpenAPI_nf_type_5G_EIR, OpenAPI_nf_type_SEPP, OpenAPI_nf_type_UPF, OpenAPI_nf_type_N3IWF, OpenAPI_nf_type_AF, OpenAPI_nf_type_UDSF, OpenAPI_nf_type_BSF, OpenAPI_nf_type_CHF, OpenAPI_nf_type_NWDAF, OpenAPI_nf_type_PCSCF, OpenAPI_nf_type_CBCF, OpenAPI_nf_type_HSS, OpenAPI_nf_type_UCMF, OpenAPI_nf_type_SOR_AF, OpenAPI_nf_type_SPAF, OpenAPI_nf_type_MME, OpenAPI_nf_type_SCSAS, OpenAPI_nf_type_SCEF, OpenAPI_nf_type_SCP } OpenAPI_nf_type_e; char* OpenAPI_nf_type_ToString(OpenAPI_nf_type_e nf_type); diff --git a/lib/sbi/openapi/model/nf_type_cond.h b/lib/sbi/openapi/model/nf_type_cond.h index 2a4a3db405..743b083118 100644 --- a/lib/sbi/openapi/model/nf_type_cond.h +++ b/lib/sbi/openapi/model/nf_type_cond.h @@ -1,7 +1,7 @@ /* * nf_type_cond.h * - * + * Subscription to a set of NFs based on their NF Type */ #ifndef _OpenAPI_nf_type_cond_H_ diff --git a/lib/sbi/openapi/model/nidd_information.c b/lib/sbi/openapi/model/nidd_information.c new file mode 100644 index 0000000000..6f6b217c95 --- /dev/null +++ b/lib/sbi/openapi/model/nidd_information.c @@ -0,0 +1,116 @@ + +#include +#include +#include +#include "nidd_information.h" + +OpenAPI_nidd_information_t *OpenAPI_nidd_information_create( + char *af_id, + char *gpsi, + char *ext_group_id + ) +{ + OpenAPI_nidd_information_t *nidd_information_local_var = OpenAPI_malloc(sizeof(OpenAPI_nidd_information_t)); + if (!nidd_information_local_var) { + return NULL; + } + nidd_information_local_var->af_id = af_id; + nidd_information_local_var->gpsi = gpsi; + nidd_information_local_var->ext_group_id = ext_group_id; + + return nidd_information_local_var; +} + +void OpenAPI_nidd_information_free(OpenAPI_nidd_information_t *nidd_information) +{ + if (NULL == nidd_information) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(nidd_information->af_id); + ogs_free(nidd_information->gpsi); + ogs_free(nidd_information->ext_group_id); + ogs_free(nidd_information); +} + +cJSON *OpenAPI_nidd_information_convertToJSON(OpenAPI_nidd_information_t *nidd_information) +{ + cJSON *item = NULL; + + if (nidd_information == NULL) { + ogs_error("OpenAPI_nidd_information_convertToJSON() failed [NiddInformation]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!nidd_information->af_id) { + ogs_error("OpenAPI_nidd_information_convertToJSON() failed [af_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "afId", nidd_information->af_id) == NULL) { + ogs_error("OpenAPI_nidd_information_convertToJSON() failed [af_id]"); + goto end; + } + + if (nidd_information->gpsi) { + if (cJSON_AddStringToObject(item, "gpsi", nidd_information->gpsi) == NULL) { + ogs_error("OpenAPI_nidd_information_convertToJSON() failed [gpsi]"); + goto end; + } + } + + if (nidd_information->ext_group_id) { + if (cJSON_AddStringToObject(item, "extGroupId", nidd_information->ext_group_id) == NULL) { + ogs_error("OpenAPI_nidd_information_convertToJSON() failed [ext_group_id]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_nidd_information_t *OpenAPI_nidd_information_parseFromJSON(cJSON *nidd_informationJSON) +{ + OpenAPI_nidd_information_t *nidd_information_local_var = NULL; + cJSON *af_id = cJSON_GetObjectItemCaseSensitive(nidd_informationJSON, "afId"); + if (!af_id) { + ogs_error("OpenAPI_nidd_information_parseFromJSON() failed [af_id]"); + goto end; + } + + + if (!cJSON_IsString(af_id)) { + ogs_error("OpenAPI_nidd_information_parseFromJSON() failed [af_id]"); + goto end; + } + + cJSON *gpsi = cJSON_GetObjectItemCaseSensitive(nidd_informationJSON, "gpsi"); + + if (gpsi) { + if (!cJSON_IsString(gpsi)) { + ogs_error("OpenAPI_nidd_information_parseFromJSON() failed [gpsi]"); + goto end; + } + } + + cJSON *ext_group_id = cJSON_GetObjectItemCaseSensitive(nidd_informationJSON, "extGroupId"); + + if (ext_group_id) { + if (!cJSON_IsString(ext_group_id)) { + ogs_error("OpenAPI_nidd_information_parseFromJSON() failed [ext_group_id]"); + goto end; + } + } + + nidd_information_local_var = OpenAPI_nidd_information_create ( + ogs_strdup(af_id->valuestring), + gpsi ? ogs_strdup(gpsi->valuestring) : NULL, + ext_group_id ? ogs_strdup(ext_group_id->valuestring) : NULL + ); + + return nidd_information_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/nidd_information.h b/lib/sbi/openapi/model/nidd_information.h new file mode 100644 index 0000000000..9bb0825d59 --- /dev/null +++ b/lib/sbi/openapi/model/nidd_information.h @@ -0,0 +1,41 @@ +/* + * nidd_information.h + * + * + */ + +#ifndef _OpenAPI_nidd_information_H_ +#define _OpenAPI_nidd_information_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_nidd_information_s OpenAPI_nidd_information_t; +typedef struct OpenAPI_nidd_information_s { + char *af_id; + char *gpsi; + char *ext_group_id; +} OpenAPI_nidd_information_t; + +OpenAPI_nidd_information_t *OpenAPI_nidd_information_create( + char *af_id, + char *gpsi, + char *ext_group_id + ); +void OpenAPI_nidd_information_free(OpenAPI_nidd_information_t *nidd_information); +OpenAPI_nidd_information_t *OpenAPI_nidd_information_parseFromJSON(cJSON *nidd_informationJSON); +cJSON *OpenAPI_nidd_information_convertToJSON(OpenAPI_nidd_information_t *nidd_information); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_nidd_information_H_ */ + diff --git a/lib/sbi/openapi/model/non_external_unrelated_class.c b/lib/sbi/openapi/model/non_external_unrelated_class.c new file mode 100644 index 0000000000..4a23144bf9 --- /dev/null +++ b/lib/sbi/openapi/model/non_external_unrelated_class.c @@ -0,0 +1,151 @@ + +#include +#include +#include +#include "non_external_unrelated_class.h" + +OpenAPI_non_external_unrelated_class_t *OpenAPI_non_external_unrelated_class_create( + OpenAPI_list_t *lcs_client_non_externals, + OpenAPI_list_t *af_non_externals + ) +{ + OpenAPI_non_external_unrelated_class_t *non_external_unrelated_class_local_var = OpenAPI_malloc(sizeof(OpenAPI_non_external_unrelated_class_t)); + if (!non_external_unrelated_class_local_var) { + return NULL; + } + non_external_unrelated_class_local_var->lcs_client_non_externals = lcs_client_non_externals; + non_external_unrelated_class_local_var->af_non_externals = af_non_externals; + + return non_external_unrelated_class_local_var; +} + +void OpenAPI_non_external_unrelated_class_free(OpenAPI_non_external_unrelated_class_t *non_external_unrelated_class) +{ + if (NULL == non_external_unrelated_class) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(non_external_unrelated_class->lcs_client_non_externals, node) { + OpenAPI_lcs_client_non_external_free(node->data); + } + OpenAPI_list_free(non_external_unrelated_class->lcs_client_non_externals); + OpenAPI_list_for_each(non_external_unrelated_class->af_non_externals, node) { + OpenAPI_af_non_external_free(node->data); + } + OpenAPI_list_free(non_external_unrelated_class->af_non_externals); + ogs_free(non_external_unrelated_class); +} + +cJSON *OpenAPI_non_external_unrelated_class_convertToJSON(OpenAPI_non_external_unrelated_class_t *non_external_unrelated_class) +{ + cJSON *item = NULL; + + if (non_external_unrelated_class == NULL) { + ogs_error("OpenAPI_non_external_unrelated_class_convertToJSON() failed [NonExternalUnrelatedClass]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (non_external_unrelated_class->lcs_client_non_externals) { + cJSON *lcs_client_non_externalsList = cJSON_AddArrayToObject(item, "lcsClientNonExternals"); + if (lcs_client_non_externalsList == NULL) { + ogs_error("OpenAPI_non_external_unrelated_class_convertToJSON() failed [lcs_client_non_externals]"); + goto end; + } + + OpenAPI_lnode_t *lcs_client_non_externals_node; + if (non_external_unrelated_class->lcs_client_non_externals) { + OpenAPI_list_for_each(non_external_unrelated_class->lcs_client_non_externals, lcs_client_non_externals_node) { + cJSON *itemLocal = OpenAPI_lcs_client_non_external_convertToJSON(lcs_client_non_externals_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_non_external_unrelated_class_convertToJSON() failed [lcs_client_non_externals]"); + goto end; + } + cJSON_AddItemToArray(lcs_client_non_externalsList, itemLocal); + } + } + } + + if (non_external_unrelated_class->af_non_externals) { + cJSON *af_non_externalsList = cJSON_AddArrayToObject(item, "afNonExternals"); + if (af_non_externalsList == NULL) { + ogs_error("OpenAPI_non_external_unrelated_class_convertToJSON() failed [af_non_externals]"); + goto end; + } + + OpenAPI_lnode_t *af_non_externals_node; + if (non_external_unrelated_class->af_non_externals) { + OpenAPI_list_for_each(non_external_unrelated_class->af_non_externals, af_non_externals_node) { + cJSON *itemLocal = OpenAPI_af_non_external_convertToJSON(af_non_externals_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_non_external_unrelated_class_convertToJSON() failed [af_non_externals]"); + goto end; + } + cJSON_AddItemToArray(af_non_externalsList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_non_external_unrelated_class_t *OpenAPI_non_external_unrelated_class_parseFromJSON(cJSON *non_external_unrelated_classJSON) +{ + OpenAPI_non_external_unrelated_class_t *non_external_unrelated_class_local_var = NULL; + cJSON *lcs_client_non_externals = cJSON_GetObjectItemCaseSensitive(non_external_unrelated_classJSON, "lcsClientNonExternals"); + + OpenAPI_list_t *lcs_client_non_externalsList; + if (lcs_client_non_externals) { + cJSON *lcs_client_non_externals_local_nonprimitive; + if (!cJSON_IsArray(lcs_client_non_externals)) { + ogs_error("OpenAPI_non_external_unrelated_class_parseFromJSON() failed [lcs_client_non_externals]"); + goto end; + } + + lcs_client_non_externalsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(lcs_client_non_externals_local_nonprimitive, lcs_client_non_externals ) { + if (!cJSON_IsObject(lcs_client_non_externals_local_nonprimitive)) { + ogs_error("OpenAPI_non_external_unrelated_class_parseFromJSON() failed [lcs_client_non_externals]"); + goto end; + } + OpenAPI_lcs_client_non_external_t *lcs_client_non_externalsItem = OpenAPI_lcs_client_non_external_parseFromJSON(lcs_client_non_externals_local_nonprimitive); + + OpenAPI_list_add(lcs_client_non_externalsList, lcs_client_non_externalsItem); + } + } + + cJSON *af_non_externals = cJSON_GetObjectItemCaseSensitive(non_external_unrelated_classJSON, "afNonExternals"); + + OpenAPI_list_t *af_non_externalsList; + if (af_non_externals) { + cJSON *af_non_externals_local_nonprimitive; + if (!cJSON_IsArray(af_non_externals)) { + ogs_error("OpenAPI_non_external_unrelated_class_parseFromJSON() failed [af_non_externals]"); + goto end; + } + + af_non_externalsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(af_non_externals_local_nonprimitive, af_non_externals ) { + if (!cJSON_IsObject(af_non_externals_local_nonprimitive)) { + ogs_error("OpenAPI_non_external_unrelated_class_parseFromJSON() failed [af_non_externals]"); + goto end; + } + OpenAPI_af_non_external_t *af_non_externalsItem = OpenAPI_af_non_external_parseFromJSON(af_non_externals_local_nonprimitive); + + OpenAPI_list_add(af_non_externalsList, af_non_externalsItem); + } + } + + non_external_unrelated_class_local_var = OpenAPI_non_external_unrelated_class_create ( + lcs_client_non_externals ? lcs_client_non_externalsList : NULL, + af_non_externals ? af_non_externalsList : NULL + ); + + return non_external_unrelated_class_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/non_external_unrelated_class.h b/lib/sbi/openapi/model/non_external_unrelated_class.h new file mode 100644 index 0000000000..603a80dc5a --- /dev/null +++ b/lib/sbi/openapi/model/non_external_unrelated_class.h @@ -0,0 +1,41 @@ +/* + * non_external_unrelated_class.h + * + * + */ + +#ifndef _OpenAPI_non_external_unrelated_class_H_ +#define _OpenAPI_non_external_unrelated_class_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "af_non_external.h" +#include "lcs_client_non_external.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_non_external_unrelated_class_s OpenAPI_non_external_unrelated_class_t; +typedef struct OpenAPI_non_external_unrelated_class_s { + OpenAPI_list_t *lcs_client_non_externals; + OpenAPI_list_t *af_non_externals; +} OpenAPI_non_external_unrelated_class_t; + +OpenAPI_non_external_unrelated_class_t *OpenAPI_non_external_unrelated_class_create( + OpenAPI_list_t *lcs_client_non_externals, + OpenAPI_list_t *af_non_externals + ); +void OpenAPI_non_external_unrelated_class_free(OpenAPI_non_external_unrelated_class_t *non_external_unrelated_class); +OpenAPI_non_external_unrelated_class_t *OpenAPI_non_external_unrelated_class_parseFromJSON(cJSON *non_external_unrelated_classJSON); +cJSON *OpenAPI_non_external_unrelated_class_convertToJSON(OpenAPI_non_external_unrelated_class_t *non_external_unrelated_class); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_non_external_unrelated_class_H_ */ + diff --git a/lib/sbi/openapi/model/notif_condition.h b/lib/sbi/openapi/model/notif_condition.h index c2c5e5688a..2dd57404cf 100644 --- a/lib/sbi/openapi/model/notif_condition.h +++ b/lib/sbi/openapi/model/notif_condition.h @@ -1,7 +1,7 @@ /* * notif_condition.h * - * + * Condition (list of attributes in the NF Profile) to determine whether a notification must be sent by NRF */ #ifndef _OpenAPI_notif_condition_H_ diff --git a/lib/sbi/openapi/model/notification_data.h b/lib/sbi/openapi/model/notification_data.h index 91194c7a66..e8a4b7b646 100644 --- a/lib/sbi/openapi/model/notification_data.h +++ b/lib/sbi/openapi/model/notification_data.h @@ -1,7 +1,7 @@ /* * notification_data.h * - * + * Data sent in notifications from NRF to subscribed NF Instances */ #ifndef _OpenAPI_notification_data_H_ diff --git a/lib/sbi/openapi/model/notification_item.c b/lib/sbi/openapi/model/notification_item.c new file mode 100644 index 0000000000..b6445cf73c --- /dev/null +++ b/lib/sbi/openapi/model/notification_item.c @@ -0,0 +1,131 @@ + +#include +#include +#include +#include "notification_item.h" + +OpenAPI_notification_item_t *OpenAPI_notification_item_create( + char *resource_id, + OpenAPI_list_t *notif_items + ) +{ + OpenAPI_notification_item_t *notification_item_local_var = OpenAPI_malloc(sizeof(OpenAPI_notification_item_t)); + if (!notification_item_local_var) { + return NULL; + } + notification_item_local_var->resource_id = resource_id; + notification_item_local_var->notif_items = notif_items; + + return notification_item_local_var; +} + +void OpenAPI_notification_item_free(OpenAPI_notification_item_t *notification_item) +{ + if (NULL == notification_item) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(notification_item->resource_id); + OpenAPI_list_for_each(notification_item->notif_items, node) { + OpenAPI_updated_item_free(node->data); + } + OpenAPI_list_free(notification_item->notif_items); + ogs_free(notification_item); +} + +cJSON *OpenAPI_notification_item_convertToJSON(OpenAPI_notification_item_t *notification_item) +{ + cJSON *item = NULL; + + if (notification_item == NULL) { + ogs_error("OpenAPI_notification_item_convertToJSON() failed [NotificationItem]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!notification_item->resource_id) { + ogs_error("OpenAPI_notification_item_convertToJSON() failed [resource_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "resourceId", notification_item->resource_id) == NULL) { + ogs_error("OpenAPI_notification_item_convertToJSON() failed [resource_id]"); + goto end; + } + + if (!notification_item->notif_items) { + ogs_error("OpenAPI_notification_item_convertToJSON() failed [notif_items]"); + goto end; + } + cJSON *notif_itemsList = cJSON_AddArrayToObject(item, "notifItems"); + if (notif_itemsList == NULL) { + ogs_error("OpenAPI_notification_item_convertToJSON() failed [notif_items]"); + goto end; + } + + OpenAPI_lnode_t *notif_items_node; + if (notification_item->notif_items) { + OpenAPI_list_for_each(notification_item->notif_items, notif_items_node) { + cJSON *itemLocal = OpenAPI_updated_item_convertToJSON(notif_items_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_notification_item_convertToJSON() failed [notif_items]"); + goto end; + } + cJSON_AddItemToArray(notif_itemsList, itemLocal); + } + } + +end: + return item; +} + +OpenAPI_notification_item_t *OpenAPI_notification_item_parseFromJSON(cJSON *notification_itemJSON) +{ + OpenAPI_notification_item_t *notification_item_local_var = NULL; + cJSON *resource_id = cJSON_GetObjectItemCaseSensitive(notification_itemJSON, "resourceId"); + if (!resource_id) { + ogs_error("OpenAPI_notification_item_parseFromJSON() failed [resource_id]"); + goto end; + } + + + if (!cJSON_IsString(resource_id)) { + ogs_error("OpenAPI_notification_item_parseFromJSON() failed [resource_id]"); + goto end; + } + + cJSON *notif_items = cJSON_GetObjectItemCaseSensitive(notification_itemJSON, "notifItems"); + if (!notif_items) { + ogs_error("OpenAPI_notification_item_parseFromJSON() failed [notif_items]"); + goto end; + } + + OpenAPI_list_t *notif_itemsList; + + cJSON *notif_items_local_nonprimitive; + if (!cJSON_IsArray(notif_items)) { + ogs_error("OpenAPI_notification_item_parseFromJSON() failed [notif_items]"); + goto end; + } + + notif_itemsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(notif_items_local_nonprimitive, notif_items ) { + if (!cJSON_IsObject(notif_items_local_nonprimitive)) { + ogs_error("OpenAPI_notification_item_parseFromJSON() failed [notif_items]"); + goto end; + } + OpenAPI_updated_item_t *notif_itemsItem = OpenAPI_updated_item_parseFromJSON(notif_items_local_nonprimitive); + + OpenAPI_list_add(notif_itemsList, notif_itemsItem); + } + + notification_item_local_var = OpenAPI_notification_item_create ( + ogs_strdup(resource_id->valuestring), + notif_itemsList + ); + + return notification_item_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/notification_item.h b/lib/sbi/openapi/model/notification_item.h new file mode 100644 index 0000000000..704656efa3 --- /dev/null +++ b/lib/sbi/openapi/model/notification_item.h @@ -0,0 +1,40 @@ +/* + * notification_item.h + * + * Identifies a data change notification when the change occurs in a fragment (subset of resource data) of a given resource. + */ + +#ifndef _OpenAPI_notification_item_H_ +#define _OpenAPI_notification_item_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "updated_item.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_notification_item_s OpenAPI_notification_item_t; +typedef struct OpenAPI_notification_item_s { + char *resource_id; + OpenAPI_list_t *notif_items; +} OpenAPI_notification_item_t; + +OpenAPI_notification_item_t *OpenAPI_notification_item_create( + char *resource_id, + OpenAPI_list_t *notif_items + ); +void OpenAPI_notification_item_free(OpenAPI_notification_item_t *notification_item); +OpenAPI_notification_item_t *OpenAPI_notification_item_parseFromJSON(cJSON *notification_itemJSON); +cJSON *OpenAPI_notification_item_convertToJSON(OpenAPI_notification_item_t *notification_item); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_notification_item_H_ */ + diff --git a/lib/sbi/openapi/model/notification_type.c b/lib/sbi/openapi/model/notification_type.c index 66b6e32a64..9b80f02206 100644 --- a/lib/sbi/openapi/model/notification_type.c +++ b/lib/sbi/openapi/model/notification_type.c @@ -6,7 +6,7 @@ char* OpenAPI_notification_type_ToString(OpenAPI_notification_type_e notification_type) { - const char *notification_typeArray[] = { "NULL", "N1_MESSAGES", "N2_INFORMATION", "LOCATION_NOTIFICATION", "DATA_REMOVAL_NOTIFICATION", "DATA_CHANGE_NOTIFICATION" }; + const char *notification_typeArray[] = { "NULL", "N1_MESSAGES", "N2_INFORMATION", "LOCATION_NOTIFICATION", "DATA_REMOVAL_NOTIFICATION", "DATA_CHANGE_NOTIFICATION", "LOCATION_UPDATE_NOTIFICATION" }; size_t sizeofArray = sizeof(notification_typeArray) / sizeof(notification_typeArray[0]); if (notification_type < sizeofArray) return (char *)notification_typeArray[notification_type]; @@ -17,7 +17,7 @@ char* OpenAPI_notification_type_ToString(OpenAPI_notification_type_e notificatio OpenAPI_notification_type_e OpenAPI_notification_type_FromString(char* notification_type) { int stringToReturn = 0; - const char *notification_typeArray[] = { "NULL", "N1_MESSAGES", "N2_INFORMATION", "LOCATION_NOTIFICATION", "DATA_REMOVAL_NOTIFICATION", "DATA_CHANGE_NOTIFICATION" }; + const char *notification_typeArray[] = { "NULL", "N1_MESSAGES", "N2_INFORMATION", "LOCATION_NOTIFICATION", "DATA_REMOVAL_NOTIFICATION", "DATA_CHANGE_NOTIFICATION", "LOCATION_UPDATE_NOTIFICATION" }; size_t sizeofArray = sizeof(notification_typeArray) / sizeof(notification_typeArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(notification_type, notification_typeArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/notification_type.h b/lib/sbi/openapi/model/notification_type.h index 3cf33b4f9e..c5a937a12b 100644 --- a/lib/sbi/openapi/model/notification_type.h +++ b/lib/sbi/openapi/model/notification_type.h @@ -17,7 +17,7 @@ extern "C" { #endif -typedef enum { OpenAPI_notification_type_NULL = 0, OpenAPI_notification_type_N1_MESSAGES, OpenAPI_notification_type_N2_INFORMATION, OpenAPI_notification_type_LOCATION_NOTIFICATION, OpenAPI_notification_type_DATA_REMOVAL_NOTIFICATION, OpenAPI_notification_type_DATA_CHANGE_NOTIFICATION } OpenAPI_notification_type_e; +typedef enum { OpenAPI_notification_type_NULL = 0, OpenAPI_notification_type_N1_MESSAGES, OpenAPI_notification_type_N2_INFORMATION, OpenAPI_notification_type_LOCATION_NOTIFICATION, OpenAPI_notification_type_DATA_REMOVAL_NOTIFICATION, OpenAPI_notification_type_DATA_CHANGE_NOTIFICATION, OpenAPI_notification_type_LOCATION_UPDATE_NOTIFICATION } OpenAPI_notification_type_e; char* OpenAPI_notification_type_ToString(OpenAPI_notification_type_e notification_type); diff --git a/lib/sbi/openapi/model/notify_item.c b/lib/sbi/openapi/model/notify_item.c new file mode 100644 index 0000000000..0c6f6aa177 --- /dev/null +++ b/lib/sbi/openapi/model/notify_item.c @@ -0,0 +1,131 @@ + +#include +#include +#include +#include "notify_item.h" + +OpenAPI_notify_item_t *OpenAPI_notify_item_create( + char *resource_id, + OpenAPI_list_t *changes + ) +{ + OpenAPI_notify_item_t *notify_item_local_var = OpenAPI_malloc(sizeof(OpenAPI_notify_item_t)); + if (!notify_item_local_var) { + return NULL; + } + notify_item_local_var->resource_id = resource_id; + notify_item_local_var->changes = changes; + + return notify_item_local_var; +} + +void OpenAPI_notify_item_free(OpenAPI_notify_item_t *notify_item) +{ + if (NULL == notify_item) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(notify_item->resource_id); + OpenAPI_list_for_each(notify_item->changes, node) { + OpenAPI_change_item_free(node->data); + } + OpenAPI_list_free(notify_item->changes); + ogs_free(notify_item); +} + +cJSON *OpenAPI_notify_item_convertToJSON(OpenAPI_notify_item_t *notify_item) +{ + cJSON *item = NULL; + + if (notify_item == NULL) { + ogs_error("OpenAPI_notify_item_convertToJSON() failed [NotifyItem]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!notify_item->resource_id) { + ogs_error("OpenAPI_notify_item_convertToJSON() failed [resource_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "resourceId", notify_item->resource_id) == NULL) { + ogs_error("OpenAPI_notify_item_convertToJSON() failed [resource_id]"); + goto end; + } + + if (!notify_item->changes) { + ogs_error("OpenAPI_notify_item_convertToJSON() failed [changes]"); + goto end; + } + cJSON *changesList = cJSON_AddArrayToObject(item, "changes"); + if (changesList == NULL) { + ogs_error("OpenAPI_notify_item_convertToJSON() failed [changes]"); + goto end; + } + + OpenAPI_lnode_t *changes_node; + if (notify_item->changes) { + OpenAPI_list_for_each(notify_item->changes, changes_node) { + cJSON *itemLocal = OpenAPI_change_item_convertToJSON(changes_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_notify_item_convertToJSON() failed [changes]"); + goto end; + } + cJSON_AddItemToArray(changesList, itemLocal); + } + } + +end: + return item; +} + +OpenAPI_notify_item_t *OpenAPI_notify_item_parseFromJSON(cJSON *notify_itemJSON) +{ + OpenAPI_notify_item_t *notify_item_local_var = NULL; + cJSON *resource_id = cJSON_GetObjectItemCaseSensitive(notify_itemJSON, "resourceId"); + if (!resource_id) { + ogs_error("OpenAPI_notify_item_parseFromJSON() failed [resource_id]"); + goto end; + } + + + if (!cJSON_IsString(resource_id)) { + ogs_error("OpenAPI_notify_item_parseFromJSON() failed [resource_id]"); + goto end; + } + + cJSON *changes = cJSON_GetObjectItemCaseSensitive(notify_itemJSON, "changes"); + if (!changes) { + ogs_error("OpenAPI_notify_item_parseFromJSON() failed [changes]"); + goto end; + } + + OpenAPI_list_t *changesList; + + cJSON *changes_local_nonprimitive; + if (!cJSON_IsArray(changes)) { + ogs_error("OpenAPI_notify_item_parseFromJSON() failed [changes]"); + goto end; + } + + changesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(changes_local_nonprimitive, changes ) { + if (!cJSON_IsObject(changes_local_nonprimitive)) { + ogs_error("OpenAPI_notify_item_parseFromJSON() failed [changes]"); + goto end; + } + OpenAPI_change_item_t *changesItem = OpenAPI_change_item_parseFromJSON(changes_local_nonprimitive); + + OpenAPI_list_add(changesList, changesItem); + } + + notify_item_local_var = OpenAPI_notify_item_create ( + ogs_strdup(resource_id->valuestring), + changesList + ); + + return notify_item_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/notify_item.h b/lib/sbi/openapi/model/notify_item.h new file mode 100644 index 0000000000..cffdf7c250 --- /dev/null +++ b/lib/sbi/openapi/model/notify_item.h @@ -0,0 +1,40 @@ +/* + * notify_item.h + * + * + */ + +#ifndef _OpenAPI_notify_item_H_ +#define _OpenAPI_notify_item_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "change_item.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_notify_item_s OpenAPI_notify_item_t; +typedef struct OpenAPI_notify_item_s { + char *resource_id; + OpenAPI_list_t *changes; +} OpenAPI_notify_item_t; + +OpenAPI_notify_item_t *OpenAPI_notify_item_create( + char *resource_id, + OpenAPI_list_t *changes + ); +void OpenAPI_notify_item_free(OpenAPI_notify_item_t *notify_item); +OpenAPI_notify_item_t *OpenAPI_notify_item_parseFromJSON(cJSON *notify_itemJSON); +cJSON *OpenAPI_notify_item_convertToJSON(OpenAPI_notify_item_t *notify_item); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_notify_item_H_ */ + diff --git a/lib/sbi/openapi/model/nr_location.c b/lib/sbi/openapi/model/nr_location.c new file mode 100644 index 0000000000..6b75fb3cd7 --- /dev/null +++ b/lib/sbi/openapi/model/nr_location.c @@ -0,0 +1,212 @@ + +#include +#include +#include +#include "nr_location.h" + +OpenAPI_nr_location_t *OpenAPI_nr_location_create( + OpenAPI_tai_t *tai, + OpenAPI_ncgi_t *ncgi, + int age_of_location_information, + char *ue_location_timestamp, + char *geographical_information, + char *geodetic_information, + OpenAPI_global_ran_node_id_t *global_gnb_id + ) +{ + OpenAPI_nr_location_t *nr_location_local_var = OpenAPI_malloc(sizeof(OpenAPI_nr_location_t)); + if (!nr_location_local_var) { + return NULL; + } + nr_location_local_var->tai = tai; + nr_location_local_var->ncgi = ncgi; + nr_location_local_var->age_of_location_information = age_of_location_information; + nr_location_local_var->ue_location_timestamp = ue_location_timestamp; + nr_location_local_var->geographical_information = geographical_information; + nr_location_local_var->geodetic_information = geodetic_information; + nr_location_local_var->global_gnb_id = global_gnb_id; + + return nr_location_local_var; +} + +void OpenAPI_nr_location_free(OpenAPI_nr_location_t *nr_location) +{ + if (NULL == nr_location) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_tai_free(nr_location->tai); + OpenAPI_ncgi_free(nr_location->ncgi); + ogs_free(nr_location->ue_location_timestamp); + ogs_free(nr_location->geographical_information); + ogs_free(nr_location->geodetic_information); + OpenAPI_global_ran_node_id_free(nr_location->global_gnb_id); + ogs_free(nr_location); +} + +cJSON *OpenAPI_nr_location_convertToJSON(OpenAPI_nr_location_t *nr_location) +{ + cJSON *item = NULL; + + if (nr_location == NULL) { + ogs_error("OpenAPI_nr_location_convertToJSON() failed [NrLocation]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!nr_location->tai) { + ogs_error("OpenAPI_nr_location_convertToJSON() failed [tai]"); + goto end; + } + cJSON *tai_local_JSON = OpenAPI_tai_convertToJSON(nr_location->tai); + if (tai_local_JSON == NULL) { + ogs_error("OpenAPI_nr_location_convertToJSON() failed [tai]"); + goto end; + } + cJSON_AddItemToObject(item, "tai", tai_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_nr_location_convertToJSON() failed [tai]"); + goto end; + } + + if (!nr_location->ncgi) { + ogs_error("OpenAPI_nr_location_convertToJSON() failed [ncgi]"); + goto end; + } + cJSON *ncgi_local_JSON = OpenAPI_ncgi_convertToJSON(nr_location->ncgi); + if (ncgi_local_JSON == NULL) { + ogs_error("OpenAPI_nr_location_convertToJSON() failed [ncgi]"); + goto end; + } + cJSON_AddItemToObject(item, "ncgi", ncgi_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_nr_location_convertToJSON() failed [ncgi]"); + goto end; + } + + if (nr_location->age_of_location_information) { + if (cJSON_AddNumberToObject(item, "ageOfLocationInformation", nr_location->age_of_location_information) == NULL) { + ogs_error("OpenAPI_nr_location_convertToJSON() failed [age_of_location_information]"); + goto end; + } + } + + if (nr_location->ue_location_timestamp) { + if (cJSON_AddStringToObject(item, "ueLocationTimestamp", nr_location->ue_location_timestamp) == NULL) { + ogs_error("OpenAPI_nr_location_convertToJSON() failed [ue_location_timestamp]"); + goto end; + } + } + + if (nr_location->geographical_information) { + if (cJSON_AddStringToObject(item, "geographicalInformation", nr_location->geographical_information) == NULL) { + ogs_error("OpenAPI_nr_location_convertToJSON() failed [geographical_information]"); + goto end; + } + } + + if (nr_location->geodetic_information) { + if (cJSON_AddStringToObject(item, "geodeticInformation", nr_location->geodetic_information) == NULL) { + ogs_error("OpenAPI_nr_location_convertToJSON() failed [geodetic_information]"); + goto end; + } + } + + if (nr_location->global_gnb_id) { + cJSON *global_gnb_id_local_JSON = OpenAPI_global_ran_node_id_convertToJSON(nr_location->global_gnb_id); + if (global_gnb_id_local_JSON == NULL) { + ogs_error("OpenAPI_nr_location_convertToJSON() failed [global_gnb_id]"); + goto end; + } + cJSON_AddItemToObject(item, "globalGnbId", global_gnb_id_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_nr_location_convertToJSON() failed [global_gnb_id]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_nr_location_t *OpenAPI_nr_location_parseFromJSON(cJSON *nr_locationJSON) +{ + OpenAPI_nr_location_t *nr_location_local_var = NULL; + cJSON *tai = cJSON_GetObjectItemCaseSensitive(nr_locationJSON, "tai"); + if (!tai) { + ogs_error("OpenAPI_nr_location_parseFromJSON() failed [tai]"); + goto end; + } + + OpenAPI_tai_t *tai_local_nonprim = NULL; + + tai_local_nonprim = OpenAPI_tai_parseFromJSON(tai); + + cJSON *ncgi = cJSON_GetObjectItemCaseSensitive(nr_locationJSON, "ncgi"); + if (!ncgi) { + ogs_error("OpenAPI_nr_location_parseFromJSON() failed [ncgi]"); + goto end; + } + + OpenAPI_ncgi_t *ncgi_local_nonprim = NULL; + + ncgi_local_nonprim = OpenAPI_ncgi_parseFromJSON(ncgi); + + cJSON *age_of_location_information = cJSON_GetObjectItemCaseSensitive(nr_locationJSON, "ageOfLocationInformation"); + + if (age_of_location_information) { + if (!cJSON_IsNumber(age_of_location_information)) { + ogs_error("OpenAPI_nr_location_parseFromJSON() failed [age_of_location_information]"); + goto end; + } + } + + cJSON *ue_location_timestamp = cJSON_GetObjectItemCaseSensitive(nr_locationJSON, "ueLocationTimestamp"); + + if (ue_location_timestamp) { + if (!cJSON_IsString(ue_location_timestamp)) { + ogs_error("OpenAPI_nr_location_parseFromJSON() failed [ue_location_timestamp]"); + goto end; + } + } + + cJSON *geographical_information = cJSON_GetObjectItemCaseSensitive(nr_locationJSON, "geographicalInformation"); + + if (geographical_information) { + if (!cJSON_IsString(geographical_information)) { + ogs_error("OpenAPI_nr_location_parseFromJSON() failed [geographical_information]"); + goto end; + } + } + + cJSON *geodetic_information = cJSON_GetObjectItemCaseSensitive(nr_locationJSON, "geodeticInformation"); + + if (geodetic_information) { + if (!cJSON_IsString(geodetic_information)) { + ogs_error("OpenAPI_nr_location_parseFromJSON() failed [geodetic_information]"); + goto end; + } + } + + cJSON *global_gnb_id = cJSON_GetObjectItemCaseSensitive(nr_locationJSON, "globalGnbId"); + + OpenAPI_global_ran_node_id_t *global_gnb_id_local_nonprim = NULL; + if (global_gnb_id) { + global_gnb_id_local_nonprim = OpenAPI_global_ran_node_id_parseFromJSON(global_gnb_id); + } + + nr_location_local_var = OpenAPI_nr_location_create ( + tai_local_nonprim, + ncgi_local_nonprim, + age_of_location_information ? age_of_location_information->valuedouble : 0, + ue_location_timestamp ? ogs_strdup(ue_location_timestamp->valuestring) : NULL, + geographical_information ? ogs_strdup(geographical_information->valuestring) : NULL, + geodetic_information ? ogs_strdup(geodetic_information->valuestring) : NULL, + global_gnb_id ? global_gnb_id_local_nonprim : NULL + ); + + return nr_location_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/nr_location.h b/lib/sbi/openapi/model/nr_location.h new file mode 100644 index 0000000000..7745b79f90 --- /dev/null +++ b/lib/sbi/openapi/model/nr_location.h @@ -0,0 +1,52 @@ +/* + * nr_location.h + * + * + */ + +#ifndef _OpenAPI_nr_location_H_ +#define _OpenAPI_nr_location_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "global_ran_node_id.h" +#include "ncgi.h" +#include "tai.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_nr_location_s OpenAPI_nr_location_t; +typedef struct OpenAPI_nr_location_s { + struct OpenAPI_tai_s *tai; + struct OpenAPI_ncgi_s *ncgi; + int age_of_location_information; + char *ue_location_timestamp; + char *geographical_information; + char *geodetic_information; + struct OpenAPI_global_ran_node_id_s *global_gnb_id; +} OpenAPI_nr_location_t; + +OpenAPI_nr_location_t *OpenAPI_nr_location_create( + OpenAPI_tai_t *tai, + OpenAPI_ncgi_t *ncgi, + int age_of_location_information, + char *ue_location_timestamp, + char *geographical_information, + char *geodetic_information, + OpenAPI_global_ran_node_id_t *global_gnb_id + ); +void OpenAPI_nr_location_free(OpenAPI_nr_location_t *nr_location); +OpenAPI_nr_location_t *OpenAPI_nr_location_parseFromJSON(cJSON *nr_locationJSON); +cJSON *OpenAPI_nr_location_convertToJSON(OpenAPI_nr_location_t *nr_location); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_nr_location_H_ */ + diff --git a/lib/sbi/openapi/model/nr_v2x_auth.c b/lib/sbi/openapi/model/nr_v2x_auth.c new file mode 100644 index 0000000000..0bcee7a0fb --- /dev/null +++ b/lib/sbi/openapi/model/nr_v2x_auth.c @@ -0,0 +1,99 @@ + +#include +#include +#include +#include "nr_v2x_auth.h" + +OpenAPI_nr_v2x_auth_t *OpenAPI_nr_v2x_auth_create( + OpenAPI_ue_auth_t *vehicle_ue_auth, + OpenAPI_ue_auth_t *pedestrian_ue_auth + ) +{ + OpenAPI_nr_v2x_auth_t *nr_v2x_auth_local_var = OpenAPI_malloc(sizeof(OpenAPI_nr_v2x_auth_t)); + if (!nr_v2x_auth_local_var) { + return NULL; + } + nr_v2x_auth_local_var->vehicle_ue_auth = vehicle_ue_auth; + nr_v2x_auth_local_var->pedestrian_ue_auth = pedestrian_ue_auth; + + return nr_v2x_auth_local_var; +} + +void OpenAPI_nr_v2x_auth_free(OpenAPI_nr_v2x_auth_t *nr_v2x_auth) +{ + if (NULL == nr_v2x_auth) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_ue_auth_free(nr_v2x_auth->vehicle_ue_auth); + OpenAPI_ue_auth_free(nr_v2x_auth->pedestrian_ue_auth); + ogs_free(nr_v2x_auth); +} + +cJSON *OpenAPI_nr_v2x_auth_convertToJSON(OpenAPI_nr_v2x_auth_t *nr_v2x_auth) +{ + cJSON *item = NULL; + + if (nr_v2x_auth == NULL) { + ogs_error("OpenAPI_nr_v2x_auth_convertToJSON() failed [NrV2xAuth]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (nr_v2x_auth->vehicle_ue_auth) { + cJSON *vehicle_ue_auth_local_JSON = OpenAPI_ue_auth_convertToJSON(nr_v2x_auth->vehicle_ue_auth); + if (vehicle_ue_auth_local_JSON == NULL) { + ogs_error("OpenAPI_nr_v2x_auth_convertToJSON() failed [vehicle_ue_auth]"); + goto end; + } + cJSON_AddItemToObject(item, "vehicleUeAuth", vehicle_ue_auth_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_nr_v2x_auth_convertToJSON() failed [vehicle_ue_auth]"); + goto end; + } + } + + if (nr_v2x_auth->pedestrian_ue_auth) { + cJSON *pedestrian_ue_auth_local_JSON = OpenAPI_ue_auth_convertToJSON(nr_v2x_auth->pedestrian_ue_auth); + if (pedestrian_ue_auth_local_JSON == NULL) { + ogs_error("OpenAPI_nr_v2x_auth_convertToJSON() failed [pedestrian_ue_auth]"); + goto end; + } + cJSON_AddItemToObject(item, "pedestrianUeAuth", pedestrian_ue_auth_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_nr_v2x_auth_convertToJSON() failed [pedestrian_ue_auth]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_nr_v2x_auth_t *OpenAPI_nr_v2x_auth_parseFromJSON(cJSON *nr_v2x_authJSON) +{ + OpenAPI_nr_v2x_auth_t *nr_v2x_auth_local_var = NULL; + cJSON *vehicle_ue_auth = cJSON_GetObjectItemCaseSensitive(nr_v2x_authJSON, "vehicleUeAuth"); + + OpenAPI_ue_auth_t *vehicle_ue_auth_local_nonprim = NULL; + if (vehicle_ue_auth) { + vehicle_ue_auth_local_nonprim = OpenAPI_ue_auth_parseFromJSON(vehicle_ue_auth); + } + + cJSON *pedestrian_ue_auth = cJSON_GetObjectItemCaseSensitive(nr_v2x_authJSON, "pedestrianUeAuth"); + + OpenAPI_ue_auth_t *pedestrian_ue_auth_local_nonprim = NULL; + if (pedestrian_ue_auth) { + pedestrian_ue_auth_local_nonprim = OpenAPI_ue_auth_parseFromJSON(pedestrian_ue_auth); + } + + nr_v2x_auth_local_var = OpenAPI_nr_v2x_auth_create ( + vehicle_ue_auth ? vehicle_ue_auth_local_nonprim : NULL, + pedestrian_ue_auth ? pedestrian_ue_auth_local_nonprim : NULL + ); + + return nr_v2x_auth_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/nr_v2x_auth.h b/lib/sbi/openapi/model/nr_v2x_auth.h new file mode 100644 index 0000000000..46ee9def85 --- /dev/null +++ b/lib/sbi/openapi/model/nr_v2x_auth.h @@ -0,0 +1,40 @@ +/* + * nr_v2x_auth.h + * + * + */ + +#ifndef _OpenAPI_nr_v2x_auth_H_ +#define _OpenAPI_nr_v2x_auth_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "ue_auth.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_nr_v2x_auth_s OpenAPI_nr_v2x_auth_t; +typedef struct OpenAPI_nr_v2x_auth_s { + struct OpenAPI_ue_auth_s *vehicle_ue_auth; + struct OpenAPI_ue_auth_s *pedestrian_ue_auth; +} OpenAPI_nr_v2x_auth_t; + +OpenAPI_nr_v2x_auth_t *OpenAPI_nr_v2x_auth_create( + OpenAPI_ue_auth_t *vehicle_ue_auth, + OpenAPI_ue_auth_t *pedestrian_ue_auth + ); +void OpenAPI_nr_v2x_auth_free(OpenAPI_nr_v2x_auth_t *nr_v2x_auth); +OpenAPI_nr_v2x_auth_t *OpenAPI_nr_v2x_auth_parseFromJSON(cJSON *nr_v2x_authJSON); +cJSON *OpenAPI_nr_v2x_auth_convertToJSON(OpenAPI_nr_v2x_auth_t *nr_v2x_auth); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_nr_v2x_auth_H_ */ + diff --git a/lib/sbi/openapi/model/nrf_info.c b/lib/sbi/openapi/model/nrf_info.c index 8d5e60f9e4..a8d8cc5708 100644 --- a/lib/sbi/openapi/model/nrf_info.c +++ b/lib/sbi/openapi/model/nrf_info.c @@ -14,7 +14,13 @@ OpenAPI_nrf_info_t *OpenAPI_nrf_info_create( OpenAPI_list_t* served_pcf_info, OpenAPI_list_t* served_bsf_info, OpenAPI_list_t* served_chf_info, - OpenAPI_list_t* served_nwdaf_info + OpenAPI_list_t* served_nef_info, + OpenAPI_list_t* served_nwdaf_info, + OpenAPI_list_t* served_pcscf_info, + OpenAPI_list_t* served_gmlc_info, + OpenAPI_list_t* served_lmf_info, + OpenAPI_list_t* served_nf_info, + OpenAPI_list_t* served_hss_info ) { OpenAPI_nrf_info_t *nrf_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_nrf_info_t)); @@ -30,7 +36,13 @@ OpenAPI_nrf_info_t *OpenAPI_nrf_info_create( nrf_info_local_var->served_pcf_info = served_pcf_info; nrf_info_local_var->served_bsf_info = served_bsf_info; nrf_info_local_var->served_chf_info = served_chf_info; + nrf_info_local_var->served_nef_info = served_nef_info; nrf_info_local_var->served_nwdaf_info = served_nwdaf_info; + nrf_info_local_var->served_pcscf_info = served_pcscf_info; + nrf_info_local_var->served_gmlc_info = served_gmlc_info; + nrf_info_local_var->served_lmf_info = served_lmf_info; + nrf_info_local_var->served_nf_info = served_nf_info; + nrf_info_local_var->served_hss_info = served_hss_info; return nrf_info_local_var; } @@ -95,12 +107,48 @@ void OpenAPI_nrf_info_free(OpenAPI_nrf_info_t *nrf_info) ogs_free(localKeyValue); } OpenAPI_list_free(nrf_info->served_chf_info); + OpenAPI_list_for_each(nrf_info->served_nef_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_nef_info_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_nef_info); OpenAPI_list_for_each(nrf_info->served_nwdaf_info, node) { OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; OpenAPI_nwdaf_info_free(localKeyValue->value); ogs_free(localKeyValue); } OpenAPI_list_free(nrf_info->served_nwdaf_info); + OpenAPI_list_for_each(nrf_info->served_pcscf_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_pcscf_info_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_pcscf_info); + OpenAPI_list_for_each(nrf_info->served_gmlc_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_gmlc_info_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_gmlc_info); + OpenAPI_list_for_each(nrf_info->served_lmf_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_lmf_info_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_lmf_info); + OpenAPI_list_for_each(nrf_info->served_nf_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_nf_info_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_nf_info); + OpenAPI_list_for_each(nrf_info->served_hss_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_hss_info_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_hss_info); ogs_free(nrf_info); } @@ -303,6 +351,27 @@ cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) } } + if (nrf_info->served_nef_info) { + cJSON *served_nef_info = cJSON_AddObjectToObject(item, "servedNefInfo"); + if (served_nef_info == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [served_nef_info]"); + goto end; + } + cJSON *localMapObject = served_nef_info; + OpenAPI_lnode_t *served_nef_info_node; + if (nrf_info->served_nef_info) { + OpenAPI_list_for_each(nrf_info->served_nef_info, served_nef_info_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_nef_info_node->data; + cJSON *itemLocal = OpenAPI_nef_info_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [served_nef_info]"); + goto end; + } + cJSON_AddItemToObject(served_nef_info, localKeyValue->key, itemLocal); + } + } + } + if (nrf_info->served_nwdaf_info) { cJSON *served_nwdaf_info = cJSON_AddObjectToObject(item, "servedNwdafInfo"); if (served_nwdaf_info == NULL) { @@ -324,6 +393,111 @@ cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) } } + if (nrf_info->served_pcscf_info) { + cJSON *served_pcscf_info = cJSON_AddObjectToObject(item, "servedPcscfInfo"); + if (served_pcscf_info == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [served_pcscf_info]"); + goto end; + } + cJSON *localMapObject = served_pcscf_info; + OpenAPI_lnode_t *served_pcscf_info_node; + if (nrf_info->served_pcscf_info) { + OpenAPI_list_for_each(nrf_info->served_pcscf_info, served_pcscf_info_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_pcscf_info_node->data; + cJSON *itemLocal = OpenAPI_pcscf_info_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [served_pcscf_info]"); + goto end; + } + cJSON_AddItemToObject(served_pcscf_info, localKeyValue->key, itemLocal); + } + } + } + + if (nrf_info->served_gmlc_info) { + cJSON *served_gmlc_info = cJSON_AddObjectToObject(item, "servedGmlcInfo"); + if (served_gmlc_info == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [served_gmlc_info]"); + goto end; + } + cJSON *localMapObject = served_gmlc_info; + OpenAPI_lnode_t *served_gmlc_info_node; + if (nrf_info->served_gmlc_info) { + OpenAPI_list_for_each(nrf_info->served_gmlc_info, served_gmlc_info_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_gmlc_info_node->data; + cJSON *itemLocal = OpenAPI_gmlc_info_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [served_gmlc_info]"); + goto end; + } + cJSON_AddItemToObject(served_gmlc_info, localKeyValue->key, itemLocal); + } + } + } + + if (nrf_info->served_lmf_info) { + cJSON *served_lmf_info = cJSON_AddObjectToObject(item, "servedLmfInfo"); + if (served_lmf_info == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [served_lmf_info]"); + goto end; + } + cJSON *localMapObject = served_lmf_info; + OpenAPI_lnode_t *served_lmf_info_node; + if (nrf_info->served_lmf_info) { + OpenAPI_list_for_each(nrf_info->served_lmf_info, served_lmf_info_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_lmf_info_node->data; + cJSON *itemLocal = OpenAPI_lmf_info_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [served_lmf_info]"); + goto end; + } + cJSON_AddItemToObject(served_lmf_info, localKeyValue->key, itemLocal); + } + } + } + + if (nrf_info->served_nf_info) { + cJSON *served_nf_info = cJSON_AddObjectToObject(item, "servedNfInfo"); + if (served_nf_info == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [served_nf_info]"); + goto end; + } + cJSON *localMapObject = served_nf_info; + OpenAPI_lnode_t *served_nf_info_node; + if (nrf_info->served_nf_info) { + OpenAPI_list_for_each(nrf_info->served_nf_info, served_nf_info_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_nf_info_node->data; + cJSON *itemLocal = OpenAPI_nf_info_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [served_nf_info]"); + goto end; + } + cJSON_AddItemToObject(served_nf_info, localKeyValue->key, itemLocal); + } + } + } + + if (nrf_info->served_hss_info) { + cJSON *served_hss_info = cJSON_AddObjectToObject(item, "servedHssInfo"); + if (served_hss_info == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [served_hss_info]"); + goto end; + } + cJSON *localMapObject = served_hss_info; + OpenAPI_lnode_t *served_hss_info_node; + if (nrf_info->served_hss_info) { + OpenAPI_list_for_each(nrf_info->served_hss_info, served_hss_info_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_hss_info_node->data; + cJSON *itemLocal = OpenAPI_hss_info_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [served_hss_info]"); + goto end; + } + cJSON_AddItemToObject(served_hss_info, localKeyValue->key, itemLocal); + } + } + } + end: return item; } @@ -538,6 +712,29 @@ OpenAPI_nrf_info_t *OpenAPI_nrf_info_parseFromJSON(cJSON *nrf_infoJSON) } } + cJSON *served_nef_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedNefInfo"); + + OpenAPI_list_t *served_nef_infoList; + if (served_nef_info) { + cJSON *served_nef_info_local_map; + if (!cJSON_IsObject(served_nef_info)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_nef_info]"); + goto end; + } + served_nef_infoList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_nef_info_local_map, served_nef_info) { + cJSON *localMapObject = served_nef_info_local_map; + if (!cJSON_IsObject(served_nef_info_local_map)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_nef_info]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_nef_info_parseFromJSON(localMapObject)); + OpenAPI_list_add(served_nef_infoList, localMapKeyPair); + } + } + cJSON *served_nwdaf_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedNwdafInfo"); OpenAPI_list_t *served_nwdaf_infoList; @@ -561,6 +758,121 @@ OpenAPI_nrf_info_t *OpenAPI_nrf_info_parseFromJSON(cJSON *nrf_infoJSON) } } + cJSON *served_pcscf_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedPcscfInfo"); + + OpenAPI_list_t *served_pcscf_infoList; + if (served_pcscf_info) { + cJSON *served_pcscf_info_local_map; + if (!cJSON_IsObject(served_pcscf_info)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_pcscf_info]"); + goto end; + } + served_pcscf_infoList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_pcscf_info_local_map, served_pcscf_info) { + cJSON *localMapObject = served_pcscf_info_local_map; + if (!cJSON_IsObject(served_pcscf_info_local_map)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_pcscf_info]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_pcscf_info_parseFromJSON(localMapObject)); + OpenAPI_list_add(served_pcscf_infoList, localMapKeyPair); + } + } + + cJSON *served_gmlc_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedGmlcInfo"); + + OpenAPI_list_t *served_gmlc_infoList; + if (served_gmlc_info) { + cJSON *served_gmlc_info_local_map; + if (!cJSON_IsObject(served_gmlc_info)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_gmlc_info]"); + goto end; + } + served_gmlc_infoList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_gmlc_info_local_map, served_gmlc_info) { + cJSON *localMapObject = served_gmlc_info_local_map; + if (!cJSON_IsObject(served_gmlc_info_local_map)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_gmlc_info]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_gmlc_info_parseFromJSON(localMapObject)); + OpenAPI_list_add(served_gmlc_infoList, localMapKeyPair); + } + } + + cJSON *served_lmf_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedLmfInfo"); + + OpenAPI_list_t *served_lmf_infoList; + if (served_lmf_info) { + cJSON *served_lmf_info_local_map; + if (!cJSON_IsObject(served_lmf_info)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_lmf_info]"); + goto end; + } + served_lmf_infoList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_lmf_info_local_map, served_lmf_info) { + cJSON *localMapObject = served_lmf_info_local_map; + if (!cJSON_IsObject(served_lmf_info_local_map)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_lmf_info]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_lmf_info_parseFromJSON(localMapObject)); + OpenAPI_list_add(served_lmf_infoList, localMapKeyPair); + } + } + + cJSON *served_nf_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedNfInfo"); + + OpenAPI_list_t *served_nf_infoList; + if (served_nf_info) { + cJSON *served_nf_info_local_map; + if (!cJSON_IsObject(served_nf_info)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_nf_info]"); + goto end; + } + served_nf_infoList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_nf_info_local_map, served_nf_info) { + cJSON *localMapObject = served_nf_info_local_map; + if (!cJSON_IsObject(served_nf_info_local_map)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_nf_info]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_nf_info_parseFromJSON(localMapObject)); + OpenAPI_list_add(served_nf_infoList, localMapKeyPair); + } + } + + cJSON *served_hss_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedHssInfo"); + + OpenAPI_list_t *served_hss_infoList; + if (served_hss_info) { + cJSON *served_hss_info_local_map; + if (!cJSON_IsObject(served_hss_info)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_hss_info]"); + goto end; + } + served_hss_infoList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_hss_info_local_map, served_hss_info) { + cJSON *localMapObject = served_hss_info_local_map; + if (!cJSON_IsObject(served_hss_info_local_map)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_hss_info]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_hss_info_parseFromJSON(localMapObject)); + OpenAPI_list_add(served_hss_infoList, localMapKeyPair); + } + } + nrf_info_local_var = OpenAPI_nrf_info_create ( served_udr_info ? served_udr_infoList : NULL, served_udm_info ? served_udm_infoList : NULL, @@ -571,7 +883,13 @@ OpenAPI_nrf_info_t *OpenAPI_nrf_info_parseFromJSON(cJSON *nrf_infoJSON) served_pcf_info ? served_pcf_infoList : NULL, served_bsf_info ? served_bsf_infoList : NULL, served_chf_info ? served_chf_infoList : NULL, - served_nwdaf_info ? served_nwdaf_infoList : NULL + served_nef_info ? served_nef_infoList : NULL, + served_nwdaf_info ? served_nwdaf_infoList : NULL, + served_pcscf_info ? served_pcscf_infoList : NULL, + served_gmlc_info ? served_gmlc_infoList : NULL, + served_lmf_info ? served_lmf_infoList : NULL, + served_nf_info ? served_nf_infoList : NULL, + served_hss_info ? served_hss_infoList : NULL ); return nrf_info_local_var; diff --git a/lib/sbi/openapi/model/nrf_info.h b/lib/sbi/openapi/model/nrf_info.h index 1863ce3101..18a9488f2d 100644 --- a/lib/sbi/openapi/model/nrf_info.h +++ b/lib/sbi/openapi/model/nrf_info.h @@ -1,7 +1,7 @@ /* * nrf_info.h * - * + * Information of an NRF NF Instance, used in hierarchical NRF deployments */ #ifndef _OpenAPI_nrf_info_H_ @@ -16,8 +16,14 @@ #include "ausf_info.h" #include "bsf_info.h" #include "chf_info.h" +#include "gmlc_info.h" +#include "hss_info.h" +#include "lmf_info.h" +#include "nef_info.h" +#include "nf_info.h" #include "nwdaf_info.h" #include "pcf_info.h" +#include "pcscf_info.h" #include "smf_info.h" #include "udm_info.h" #include "udr_info.h" @@ -38,7 +44,13 @@ typedef struct OpenAPI_nrf_info_s { OpenAPI_list_t* served_pcf_info; OpenAPI_list_t* served_bsf_info; OpenAPI_list_t* served_chf_info; + OpenAPI_list_t* served_nef_info; OpenAPI_list_t* served_nwdaf_info; + OpenAPI_list_t* served_pcscf_info; + OpenAPI_list_t* served_gmlc_info; + OpenAPI_list_t* served_lmf_info; + OpenAPI_list_t* served_nf_info; + OpenAPI_list_t* served_hss_info; } OpenAPI_nrf_info_t; OpenAPI_nrf_info_t *OpenAPI_nrf_info_create( @@ -51,7 +63,13 @@ OpenAPI_nrf_info_t *OpenAPI_nrf_info_create( OpenAPI_list_t* served_pcf_info, OpenAPI_list_t* served_bsf_info, OpenAPI_list_t* served_chf_info, - OpenAPI_list_t* served_nwdaf_info + OpenAPI_list_t* served_nef_info, + OpenAPI_list_t* served_nwdaf_info, + OpenAPI_list_t* served_pcscf_info, + OpenAPI_list_t* served_gmlc_info, + OpenAPI_list_t* served_lmf_info, + OpenAPI_list_t* served_nf_info, + OpenAPI_list_t* served_hss_info ); void OpenAPI_nrf_info_free(OpenAPI_nrf_info_t *nrf_info); OpenAPI_nrf_info_t *OpenAPI_nrf_info_parseFromJSON(cJSON *nrf_infoJSON); diff --git a/lib/sbi/openapi/model/nssai.c b/lib/sbi/openapi/model/nssai.c new file mode 100644 index 0000000000..9dbd8b7484 --- /dev/null +++ b/lib/sbi/openapi/model/nssai.c @@ -0,0 +1,249 @@ + +#include +#include +#include +#include "nssai.h" + +OpenAPI_nssai_t *OpenAPI_nssai_create( + char *supported_features, + OpenAPI_list_t *default_single_nssais, + OpenAPI_list_t *single_nssais, + char *provisioning_time, + OpenAPI_list_t* additional_snssai_data + ) +{ + OpenAPI_nssai_t *nssai_local_var = OpenAPI_malloc(sizeof(OpenAPI_nssai_t)); + if (!nssai_local_var) { + return NULL; + } + nssai_local_var->supported_features = supported_features; + nssai_local_var->default_single_nssais = default_single_nssais; + nssai_local_var->single_nssais = single_nssais; + nssai_local_var->provisioning_time = provisioning_time; + nssai_local_var->additional_snssai_data = additional_snssai_data; + + return nssai_local_var; +} + +void OpenAPI_nssai_free(OpenAPI_nssai_t *nssai) +{ + if (NULL == nssai) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(nssai->supported_features); + OpenAPI_list_for_each(nssai->default_single_nssais, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(nssai->default_single_nssais); + OpenAPI_list_for_each(nssai->single_nssais, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(nssai->single_nssais); + ogs_free(nssai->provisioning_time); + OpenAPI_list_for_each(nssai->additional_snssai_data, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_additional_snssai_data_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(nssai->additional_snssai_data); + ogs_free(nssai); +} + +cJSON *OpenAPI_nssai_convertToJSON(OpenAPI_nssai_t *nssai) +{ + cJSON *item = NULL; + + if (nssai == NULL) { + ogs_error("OpenAPI_nssai_convertToJSON() failed [Nssai]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (nssai->supported_features) { + if (cJSON_AddStringToObject(item, "supportedFeatures", nssai->supported_features) == NULL) { + ogs_error("OpenAPI_nssai_convertToJSON() failed [supported_features]"); + goto end; + } + } + + if (!nssai->default_single_nssais) { + ogs_error("OpenAPI_nssai_convertToJSON() failed [default_single_nssais]"); + goto end; + } + cJSON *default_single_nssaisList = cJSON_AddArrayToObject(item, "defaultSingleNssais"); + if (default_single_nssaisList == NULL) { + ogs_error("OpenAPI_nssai_convertToJSON() failed [default_single_nssais]"); + goto end; + } + + OpenAPI_lnode_t *default_single_nssais_node; + if (nssai->default_single_nssais) { + OpenAPI_list_for_each(nssai->default_single_nssais, default_single_nssais_node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(default_single_nssais_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nssai_convertToJSON() failed [default_single_nssais]"); + goto end; + } + cJSON_AddItemToArray(default_single_nssaisList, itemLocal); + } + } + + if (nssai->single_nssais) { + cJSON *single_nssaisList = cJSON_AddArrayToObject(item, "singleNssais"); + if (single_nssaisList == NULL) { + ogs_error("OpenAPI_nssai_convertToJSON() failed [single_nssais]"); + goto end; + } + + OpenAPI_lnode_t *single_nssais_node; + if (nssai->single_nssais) { + OpenAPI_list_for_each(nssai->single_nssais, single_nssais_node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(single_nssais_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nssai_convertToJSON() failed [single_nssais]"); + goto end; + } + cJSON_AddItemToArray(single_nssaisList, itemLocal); + } + } + } + + if (nssai->provisioning_time) { + if (cJSON_AddStringToObject(item, "provisioningTime", nssai->provisioning_time) == NULL) { + ogs_error("OpenAPI_nssai_convertToJSON() failed [provisioning_time]"); + goto end; + } + } + + if (nssai->additional_snssai_data) { + cJSON *additional_snssai_data = cJSON_AddObjectToObject(item, "additionalSnssaiData"); + if (additional_snssai_data == NULL) { + ogs_error("OpenAPI_nssai_convertToJSON() failed [additional_snssai_data]"); + goto end; + } + cJSON *localMapObject = additional_snssai_data; + OpenAPI_lnode_t *additional_snssai_data_node; + if (nssai->additional_snssai_data) { + OpenAPI_list_for_each(nssai->additional_snssai_data, additional_snssai_data_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)additional_snssai_data_node->data; + cJSON *itemLocal = OpenAPI_additional_snssai_data_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nssai_convertToJSON() failed [additional_snssai_data]"); + goto end; + } + cJSON_AddItemToObject(additional_snssai_data, localKeyValue->key, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_nssai_t *OpenAPI_nssai_parseFromJSON(cJSON *nssaiJSON) +{ + OpenAPI_nssai_t *nssai_local_var = NULL; + cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(nssaiJSON, "supportedFeatures"); + + if (supported_features) { + if (!cJSON_IsString(supported_features)) { + ogs_error("OpenAPI_nssai_parseFromJSON() failed [supported_features]"); + goto end; + } + } + + cJSON *default_single_nssais = cJSON_GetObjectItemCaseSensitive(nssaiJSON, "defaultSingleNssais"); + if (!default_single_nssais) { + ogs_error("OpenAPI_nssai_parseFromJSON() failed [default_single_nssais]"); + goto end; + } + + OpenAPI_list_t *default_single_nssaisList; + + cJSON *default_single_nssais_local_nonprimitive; + if (!cJSON_IsArray(default_single_nssais)) { + ogs_error("OpenAPI_nssai_parseFromJSON() failed [default_single_nssais]"); + goto end; + } + + default_single_nssaisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(default_single_nssais_local_nonprimitive, default_single_nssais ) { + if (!cJSON_IsObject(default_single_nssais_local_nonprimitive)) { + ogs_error("OpenAPI_nssai_parseFromJSON() failed [default_single_nssais]"); + goto end; + } + OpenAPI_snssai_t *default_single_nssaisItem = OpenAPI_snssai_parseFromJSON(default_single_nssais_local_nonprimitive); + + OpenAPI_list_add(default_single_nssaisList, default_single_nssaisItem); + } + + cJSON *single_nssais = cJSON_GetObjectItemCaseSensitive(nssaiJSON, "singleNssais"); + + OpenAPI_list_t *single_nssaisList; + if (single_nssais) { + cJSON *single_nssais_local_nonprimitive; + if (!cJSON_IsArray(single_nssais)) { + ogs_error("OpenAPI_nssai_parseFromJSON() failed [single_nssais]"); + goto end; + } + + single_nssaisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(single_nssais_local_nonprimitive, single_nssais ) { + if (!cJSON_IsObject(single_nssais_local_nonprimitive)) { + ogs_error("OpenAPI_nssai_parseFromJSON() failed [single_nssais]"); + goto end; + } + OpenAPI_snssai_t *single_nssaisItem = OpenAPI_snssai_parseFromJSON(single_nssais_local_nonprimitive); + + OpenAPI_list_add(single_nssaisList, single_nssaisItem); + } + } + + cJSON *provisioning_time = cJSON_GetObjectItemCaseSensitive(nssaiJSON, "provisioningTime"); + + if (provisioning_time) { + if (!cJSON_IsString(provisioning_time)) { + ogs_error("OpenAPI_nssai_parseFromJSON() failed [provisioning_time]"); + goto end; + } + } + + cJSON *additional_snssai_data = cJSON_GetObjectItemCaseSensitive(nssaiJSON, "additionalSnssaiData"); + + OpenAPI_list_t *additional_snssai_dataList; + if (additional_snssai_data) { + cJSON *additional_snssai_data_local_map; + if (!cJSON_IsObject(additional_snssai_data)) { + ogs_error("OpenAPI_nssai_parseFromJSON() failed [additional_snssai_data]"); + goto end; + } + additional_snssai_dataList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(additional_snssai_data_local_map, additional_snssai_data) { + cJSON *localMapObject = additional_snssai_data_local_map; + if (!cJSON_IsObject(additional_snssai_data_local_map)) { + ogs_error("OpenAPI_nssai_parseFromJSON() failed [additional_snssai_data]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_additional_snssai_data_parseFromJSON(localMapObject)); + OpenAPI_list_add(additional_snssai_dataList, localMapKeyPair); + } + } + + nssai_local_var = OpenAPI_nssai_create ( + supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + default_single_nssaisList, + single_nssais ? single_nssaisList : NULL, + provisioning_time ? ogs_strdup(provisioning_time->valuestring) : NULL, + additional_snssai_data ? additional_snssai_dataList : NULL + ); + + return nssai_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/nssai.h b/lib/sbi/openapi/model/nssai.h new file mode 100644 index 0000000000..663354da37 --- /dev/null +++ b/lib/sbi/openapi/model/nssai.h @@ -0,0 +1,47 @@ +/* + * nssai.h + * + * + */ + +#ifndef _OpenAPI_nssai_H_ +#define _OpenAPI_nssai_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "additional_snssai_data.h" +#include "snssai.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_nssai_s OpenAPI_nssai_t; +typedef struct OpenAPI_nssai_s { + char *supported_features; + OpenAPI_list_t *default_single_nssais; + OpenAPI_list_t *single_nssais; + char *provisioning_time; + OpenAPI_list_t* additional_snssai_data; +} OpenAPI_nssai_t; + +OpenAPI_nssai_t *OpenAPI_nssai_create( + char *supported_features, + OpenAPI_list_t *default_single_nssais, + OpenAPI_list_t *single_nssais, + char *provisioning_time, + OpenAPI_list_t* additional_snssai_data + ); +void OpenAPI_nssai_free(OpenAPI_nssai_t *nssai); +OpenAPI_nssai_t *OpenAPI_nssai_parseFromJSON(cJSON *nssaiJSON); +cJSON *OpenAPI_nssai_convertToJSON(OpenAPI_nssai_t *nssai); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_nssai_H_ */ + diff --git a/lib/sbi/openapi/model/nssai_ack_data.c b/lib/sbi/openapi/model/nssai_ack_data.c new file mode 100644 index 0000000000..181930a467 --- /dev/null +++ b/lib/sbi/openapi/model/nssai_ack_data.c @@ -0,0 +1,102 @@ + +#include +#include +#include +#include "nssai_ack_data.h" + +OpenAPI_nssai_ack_data_t *OpenAPI_nssai_ack_data_create( + char *provisioning_time, + OpenAPI_ue_update_status_e ue_update_status + ) +{ + OpenAPI_nssai_ack_data_t *nssai_ack_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_nssai_ack_data_t)); + if (!nssai_ack_data_local_var) { + return NULL; + } + nssai_ack_data_local_var->provisioning_time = provisioning_time; + nssai_ack_data_local_var->ue_update_status = ue_update_status; + + return nssai_ack_data_local_var; +} + +void OpenAPI_nssai_ack_data_free(OpenAPI_nssai_ack_data_t *nssai_ack_data) +{ + if (NULL == nssai_ack_data) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(nssai_ack_data->provisioning_time); + ogs_free(nssai_ack_data); +} + +cJSON *OpenAPI_nssai_ack_data_convertToJSON(OpenAPI_nssai_ack_data_t *nssai_ack_data) +{ + cJSON *item = NULL; + + if (nssai_ack_data == NULL) { + ogs_error("OpenAPI_nssai_ack_data_convertToJSON() failed [NssaiAckData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!nssai_ack_data->provisioning_time) { + ogs_error("OpenAPI_nssai_ack_data_convertToJSON() failed [provisioning_time]"); + goto end; + } + if (cJSON_AddStringToObject(item, "provisioningTime", nssai_ack_data->provisioning_time) == NULL) { + ogs_error("OpenAPI_nssai_ack_data_convertToJSON() failed [provisioning_time]"); + goto end; + } + + if (!nssai_ack_data->ue_update_status) { + ogs_error("OpenAPI_nssai_ack_data_convertToJSON() failed [ue_update_status]"); + goto end; + } + if (cJSON_AddStringToObject(item, "ueUpdateStatus", OpenAPI_ue_update_status_ToString(nssai_ack_data->ue_update_status)) == NULL) { + ogs_error("OpenAPI_nssai_ack_data_convertToJSON() failed [ue_update_status]"); + goto end; + } + +end: + return item; +} + +OpenAPI_nssai_ack_data_t *OpenAPI_nssai_ack_data_parseFromJSON(cJSON *nssai_ack_dataJSON) +{ + OpenAPI_nssai_ack_data_t *nssai_ack_data_local_var = NULL; + cJSON *provisioning_time = cJSON_GetObjectItemCaseSensitive(nssai_ack_dataJSON, "provisioningTime"); + if (!provisioning_time) { + ogs_error("OpenAPI_nssai_ack_data_parseFromJSON() failed [provisioning_time]"); + goto end; + } + + + if (!cJSON_IsString(provisioning_time)) { + ogs_error("OpenAPI_nssai_ack_data_parseFromJSON() failed [provisioning_time]"); + goto end; + } + + cJSON *ue_update_status = cJSON_GetObjectItemCaseSensitive(nssai_ack_dataJSON, "ueUpdateStatus"); + if (!ue_update_status) { + ogs_error("OpenAPI_nssai_ack_data_parseFromJSON() failed [ue_update_status]"); + goto end; + } + + OpenAPI_ue_update_status_e ue_update_statusVariable; + + if (!cJSON_IsString(ue_update_status)) { + ogs_error("OpenAPI_nssai_ack_data_parseFromJSON() failed [ue_update_status]"); + goto end; + } + ue_update_statusVariable = OpenAPI_ue_update_status_FromString(ue_update_status->valuestring); + + nssai_ack_data_local_var = OpenAPI_nssai_ack_data_create ( + ogs_strdup(provisioning_time->valuestring), + ue_update_statusVariable + ); + + return nssai_ack_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/nssai_ack_data.h b/lib/sbi/openapi/model/nssai_ack_data.h new file mode 100644 index 0000000000..d07b6b4de9 --- /dev/null +++ b/lib/sbi/openapi/model/nssai_ack_data.h @@ -0,0 +1,40 @@ +/* + * nssai_ack_data.h + * + * + */ + +#ifndef _OpenAPI_nssai_ack_data_H_ +#define _OpenAPI_nssai_ack_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "ue_update_status.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_nssai_ack_data_s OpenAPI_nssai_ack_data_t; +typedef struct OpenAPI_nssai_ack_data_s { + char *provisioning_time; + OpenAPI_ue_update_status_e ue_update_status; +} OpenAPI_nssai_ack_data_t; + +OpenAPI_nssai_ack_data_t *OpenAPI_nssai_ack_data_create( + char *provisioning_time, + OpenAPI_ue_update_status_e ue_update_status + ); +void OpenAPI_nssai_ack_data_free(OpenAPI_nssai_ack_data_t *nssai_ack_data); +OpenAPI_nssai_ack_data_t *OpenAPI_nssai_ack_data_parseFromJSON(cJSON *nssai_ack_dataJSON); +cJSON *OpenAPI_nssai_ack_data_convertToJSON(OpenAPI_nssai_ack_data_t *nssai_ack_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_nssai_ack_data_H_ */ + diff --git a/lib/sbi/openapi/model/null_value.c b/lib/sbi/openapi/model/null_value.c new file mode 100644 index 0000000000..d19d78d70d --- /dev/null +++ b/lib/sbi/openapi/model/null_value.c @@ -0,0 +1,30 @@ + +#include +#include +#include +#include "null_value.h" + +char* OpenAPI_null_value_ToString(OpenAPI_null_value_e null_value) +{ + const char *null_valueArray[] = { "NULL", "null" }; + size_t sizeofArray = sizeof(null_valueArray) / sizeof(null_valueArray[0]); + if (null_value < sizeofArray) + return (char *)null_valueArray[null_value]; + else + return (char *)"Unknown"; +} + +OpenAPI_null_value_e OpenAPI_null_value_FromString(char* null_value) +{ + int stringToReturn = 0; + const char *null_valueArray[] = { "NULL", "null" }; + size_t sizeofArray = sizeof(null_valueArray) / sizeof(null_valueArray[0]); + while (stringToReturn < sizeofArray) { + if (strcmp(null_value, null_valueArray[stringToReturn]) == 0) { + return stringToReturn; + } + stringToReturn++; + } + return 0; +} + diff --git a/lib/sbi/openapi/model/null_value.h b/lib/sbi/openapi/model/null_value.h new file mode 100644 index 0000000000..fd8a3161c0 --- /dev/null +++ b/lib/sbi/openapi/model/null_value.h @@ -0,0 +1,31 @@ +/* + * null_value.h + * + * + */ + +#ifndef _OpenAPI_null_value_H_ +#define _OpenAPI_null_value_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { OpenAPI_null_value_NULL = 0, OpenAPI_null_value_null } OpenAPI_null_value_e; + +char* OpenAPI_null_value_ToString(OpenAPI_null_value_e null_value); + +OpenAPI_null_value_e OpenAPI_null_value_FromString(char* null_value); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_null_value_H_ */ + diff --git a/lib/sbi/openapi/model/nwdaf_info.h b/lib/sbi/openapi/model/nwdaf_info.h index fa5a3b6dc8..31c68831ef 100644 --- a/lib/sbi/openapi/model/nwdaf_info.h +++ b/lib/sbi/openapi/model/nwdaf_info.h @@ -1,7 +1,7 @@ /* * nwdaf_info.h * - * + * Information of a NWDAF NF Instance */ #ifndef _OpenAPI_nwdaf_info_H_ diff --git a/lib/sbi/openapi/model/odb_data.c b/lib/sbi/openapi/model/odb_data.c new file mode 100644 index 0000000000..5b38a04231 --- /dev/null +++ b/lib/sbi/openapi/model/odb_data.c @@ -0,0 +1,75 @@ + +#include +#include +#include +#include "odb_data.h" + +OpenAPI_odb_data_t *OpenAPI_odb_data_create( + OpenAPI_roaming_odb_t *roaming_odb + ) +{ + OpenAPI_odb_data_t *odb_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_odb_data_t)); + if (!odb_data_local_var) { + return NULL; + } + odb_data_local_var->roaming_odb = roaming_odb; + + return odb_data_local_var; +} + +void OpenAPI_odb_data_free(OpenAPI_odb_data_t *odb_data) +{ + if (NULL == odb_data) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_roaming_odb_free(odb_data->roaming_odb); + ogs_free(odb_data); +} + +cJSON *OpenAPI_odb_data_convertToJSON(OpenAPI_odb_data_t *odb_data) +{ + cJSON *item = NULL; + + if (odb_data == NULL) { + ogs_error("OpenAPI_odb_data_convertToJSON() failed [OdbData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (odb_data->roaming_odb) { + cJSON *roaming_odb_local_JSON = OpenAPI_roaming_odb_convertToJSON(odb_data->roaming_odb); + if (roaming_odb_local_JSON == NULL) { + ogs_error("OpenAPI_odb_data_convertToJSON() failed [roaming_odb]"); + goto end; + } + cJSON_AddItemToObject(item, "roamingOdb", roaming_odb_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_odb_data_convertToJSON() failed [roaming_odb]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_odb_data_t *OpenAPI_odb_data_parseFromJSON(cJSON *odb_dataJSON) +{ + OpenAPI_odb_data_t *odb_data_local_var = NULL; + cJSON *roaming_odb = cJSON_GetObjectItemCaseSensitive(odb_dataJSON, "roamingOdb"); + + OpenAPI_roaming_odb_t *roaming_odb_local_nonprim = NULL; + if (roaming_odb) { + roaming_odb_local_nonprim = OpenAPI_roaming_odb_parseFromJSON(roaming_odb); + } + + odb_data_local_var = OpenAPI_odb_data_create ( + roaming_odb ? roaming_odb_local_nonprim : NULL + ); + + return odb_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/odb_data.h b/lib/sbi/openapi/model/odb_data.h new file mode 100644 index 0000000000..687994ca6f --- /dev/null +++ b/lib/sbi/openapi/model/odb_data.h @@ -0,0 +1,38 @@ +/* + * odb_data.h + * + * + */ + +#ifndef _OpenAPI_odb_data_H_ +#define _OpenAPI_odb_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "roaming_odb.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_odb_data_s OpenAPI_odb_data_t; +typedef struct OpenAPI_odb_data_s { + struct OpenAPI_roaming_odb_s *roaming_odb; +} OpenAPI_odb_data_t; + +OpenAPI_odb_data_t *OpenAPI_odb_data_create( + OpenAPI_roaming_odb_t *roaming_odb + ); +void OpenAPI_odb_data_free(OpenAPI_odb_data_t *odb_data); +OpenAPI_odb_data_t *OpenAPI_odb_data_parseFromJSON(cJSON *odb_dataJSON); +cJSON *OpenAPI_odb_data_convertToJSON(OpenAPI_odb_data_t *odb_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_odb_data_H_ */ + diff --git a/lib/sbi/openapi/model/odb_packet_services.c b/lib/sbi/openapi/model/odb_packet_services.c new file mode 100644 index 0000000000..6137eeb0bc --- /dev/null +++ b/lib/sbi/openapi/model/odb_packet_services.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "odb_packet_services.h" + +OpenAPI_odb_packet_services_t *OpenAPI_odb_packet_services_create( + ) +{ + OpenAPI_odb_packet_services_t *odb_packet_services_local_var = OpenAPI_malloc(sizeof(OpenAPI_odb_packet_services_t)); + if (!odb_packet_services_local_var) { + return NULL; + } + + return odb_packet_services_local_var; +} + +void OpenAPI_odb_packet_services_free(OpenAPI_odb_packet_services_t *odb_packet_services) +{ + if (NULL == odb_packet_services) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(odb_packet_services); +} + +cJSON *OpenAPI_odb_packet_services_convertToJSON(OpenAPI_odb_packet_services_t *odb_packet_services) +{ + cJSON *item = NULL; + + if (odb_packet_services == NULL) { + ogs_error("OpenAPI_odb_packet_services_convertToJSON() failed [OdbPacketServices]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_odb_packet_services_t *OpenAPI_odb_packet_services_parseFromJSON(cJSON *odb_packet_servicesJSON) +{ + OpenAPI_odb_packet_services_t *odb_packet_services_local_var = NULL; + odb_packet_services_local_var = OpenAPI_odb_packet_services_create ( + ); + + return odb_packet_services_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/odb_packet_services.h b/lib/sbi/openapi/model/odb_packet_services.h new file mode 100644 index 0000000000..e8b7a7497b --- /dev/null +++ b/lib/sbi/openapi/model/odb_packet_services.h @@ -0,0 +1,36 @@ +/* + * odb_packet_services.h + * + * + */ + +#ifndef _OpenAPI_odb_packet_services_H_ +#define _OpenAPI_odb_packet_services_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "null_value.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_odb_packet_services_s OpenAPI_odb_packet_services_t; +typedef struct OpenAPI_odb_packet_services_s { +} OpenAPI_odb_packet_services_t; + +OpenAPI_odb_packet_services_t *OpenAPI_odb_packet_services_create( + ); +void OpenAPI_odb_packet_services_free(OpenAPI_odb_packet_services_t *odb_packet_services); +OpenAPI_odb_packet_services_t *OpenAPI_odb_packet_services_parseFromJSON(cJSON *odb_packet_servicesJSON); +cJSON *OpenAPI_odb_packet_services_convertToJSON(OpenAPI_odb_packet_services_t *odb_packet_services); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_odb_packet_services_H_ */ + diff --git a/lib/sbi/openapi/model/operation_mode.c b/lib/sbi/openapi/model/operation_mode.c new file mode 100644 index 0000000000..c4b8252c8e --- /dev/null +++ b/lib/sbi/openapi/model/operation_mode.c @@ -0,0 +1,30 @@ + +#include +#include +#include +#include "operation_mode.h" + +char* OpenAPI_operation_mode_ToString(OpenAPI_operation_mode_e operation_mode) +{ + const char *operation_modeArray[] = { "NULL", "WB_S1", "NB_S1", "WB_N1", "NB_N1" }; + size_t sizeofArray = sizeof(operation_modeArray) / sizeof(operation_modeArray[0]); + if (operation_mode < sizeofArray) + return (char *)operation_modeArray[operation_mode]; + else + return (char *)"Unknown"; +} + +OpenAPI_operation_mode_e OpenAPI_operation_mode_FromString(char* operation_mode) +{ + int stringToReturn = 0; + const char *operation_modeArray[] = { "NULL", "WB_S1", "NB_S1", "WB_N1", "NB_N1" }; + size_t sizeofArray = sizeof(operation_modeArray) / sizeof(operation_modeArray[0]); + while (stringToReturn < sizeofArray) { + if (strcmp(operation_mode, operation_modeArray[stringToReturn]) == 0) { + return stringToReturn; + } + stringToReturn++; + } + return 0; +} + diff --git a/lib/sbi/openapi/model/operation_mode.h b/lib/sbi/openapi/model/operation_mode.h new file mode 100644 index 0000000000..2e32f0e902 --- /dev/null +++ b/lib/sbi/openapi/model/operation_mode.h @@ -0,0 +1,31 @@ +/* + * operation_mode.h + * + * + */ + +#ifndef _OpenAPI_operation_mode_H_ +#define _OpenAPI_operation_mode_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { OpenAPI_operation_mode_NULL = 0, OpenAPI_operation_mode_WB_S1, OpenAPI_operation_mode_NB_S1, OpenAPI_operation_mode_WB_N1, OpenAPI_operation_mode_NB_N1 } OpenAPI_operation_mode_e; + +char* OpenAPI_operation_mode_ToString(OpenAPI_operation_mode_e operation_mode); + +OpenAPI_operation_mode_e OpenAPI_operation_mode_FromString(char* operation_mode); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_operation_mode_H_ */ + diff --git a/lib/sbi/openapi/model/operator_managed.c b/lib/sbi/openapi/model/operator_managed.c new file mode 100644 index 0000000000..5d24cdd100 --- /dev/null +++ b/lib/sbi/openapi/model/operator_managed.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "operator_managed.h" + +OpenAPI_operator_managed_t *OpenAPI_operator_managed_create( + ) +{ + OpenAPI_operator_managed_t *operator_managed_local_var = OpenAPI_malloc(sizeof(OpenAPI_operator_managed_t)); + if (!operator_managed_local_var) { + return NULL; + } + + return operator_managed_local_var; +} + +void OpenAPI_operator_managed_free(OpenAPI_operator_managed_t *operator_managed) +{ + if (NULL == operator_managed) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(operator_managed); +} + +cJSON *OpenAPI_operator_managed_convertToJSON(OpenAPI_operator_managed_t *operator_managed) +{ + cJSON *item = NULL; + + if (operator_managed == NULL) { + ogs_error("OpenAPI_operator_managed_convertToJSON() failed [OperatorManaged]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_operator_managed_t *OpenAPI_operator_managed_parseFromJSON(cJSON *operator_managedJSON) +{ + OpenAPI_operator_managed_t *operator_managed_local_var = NULL; + operator_managed_local_var = OpenAPI_operator_managed_create ( + ); + + return operator_managed_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/operator_managed.h b/lib/sbi/openapi/model/operator_managed.h new file mode 100644 index 0000000000..2ee686c78c --- /dev/null +++ b/lib/sbi/openapi/model/operator_managed.h @@ -0,0 +1,35 @@ +/* + * operator_managed.h + * + * Possible values are - OPERATOR_MANAGED: The radio parameters are \"operator managed\". - NON_OPERATOR_MANAGED: The radio parameters are \"non-operator managed\". + */ + +#ifndef _OpenAPI_operator_managed_H_ +#define _OpenAPI_operator_managed_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_operator_managed_s OpenAPI_operator_managed_t; +typedef struct OpenAPI_operator_managed_s { +} OpenAPI_operator_managed_t; + +OpenAPI_operator_managed_t *OpenAPI_operator_managed_create( + ); +void OpenAPI_operator_managed_free(OpenAPI_operator_managed_t *operator_managed); +OpenAPI_operator_managed_t *OpenAPI_operator_managed_parseFromJSON(cJSON *operator_managedJSON); +cJSON *OpenAPI_operator_managed_convertToJSON(OpenAPI_operator_managed_t *operator_managed); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_operator_managed_H_ */ + diff --git a/lib/sbi/openapi/model/operator_specific_data_container.c b/lib/sbi/openapi/model/operator_specific_data_container.c new file mode 100644 index 0000000000..a47847384f --- /dev/null +++ b/lib/sbi/openapi/model/operator_specific_data_container.c @@ -0,0 +1,165 @@ + +#include +#include +#include +#include "operator_specific_data_container.h" + +char *OpenAPI_data_typeoperator_specific_data_container_ToString(OpenAPI_operator_specific_data_container_data_type_e data_type) +{ + const char *data_typeArray[] = { "NULL", "string", "integer", "number", "boolean", "object" }; + size_t sizeofArray = sizeof(data_typeArray) / sizeof(data_typeArray[0]); + if (data_type < sizeofArray) + return (char *)data_typeArray[data_type]; + else + return (char *)"Unknown"; +} + +OpenAPI_operator_specific_data_container_data_type_e OpenAPI_data_typeoperator_specific_data_container_FromString(char* data_type) +{ + int stringToReturn = 0; + const char *data_typeArray[] = { "NULL", "string", "integer", "number", "boolean", "object" }; + size_t sizeofArray = sizeof(data_typeArray) / sizeof(data_typeArray[0]); + while (stringToReturn < sizeofArray) { + if (strcmp(data_type, data_typeArray[stringToReturn]) == 0) { + return stringToReturn; + } + stringToReturn++; + } + return 0; +} +OpenAPI_operator_specific_data_container_t *OpenAPI_operator_specific_data_container_create( + OpenAPI_operator_specific_data_container_data_type_e data_type, + char *data_type_definition, + char *value, + char *supported_features + ) +{ + OpenAPI_operator_specific_data_container_t *operator_specific_data_container_local_var = OpenAPI_malloc(sizeof(OpenAPI_operator_specific_data_container_t)); + if (!operator_specific_data_container_local_var) { + return NULL; + } + operator_specific_data_container_local_var->data_type = data_type; + operator_specific_data_container_local_var->data_type_definition = data_type_definition; + operator_specific_data_container_local_var->value = value; + operator_specific_data_container_local_var->supported_features = supported_features; + + return operator_specific_data_container_local_var; +} + +void OpenAPI_operator_specific_data_container_free(OpenAPI_operator_specific_data_container_t *operator_specific_data_container) +{ + if (NULL == operator_specific_data_container) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(operator_specific_data_container->data_type_definition); + ogs_free(operator_specific_data_container->value); + ogs_free(operator_specific_data_container->supported_features); + ogs_free(operator_specific_data_container); +} + +cJSON *OpenAPI_operator_specific_data_container_convertToJSON(OpenAPI_operator_specific_data_container_t *operator_specific_data_container) +{ + cJSON *item = NULL; + + if (operator_specific_data_container == NULL) { + ogs_error("OpenAPI_operator_specific_data_container_convertToJSON() failed [OperatorSpecificDataContainer]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!operator_specific_data_container->data_type) { + ogs_error("OpenAPI_operator_specific_data_container_convertToJSON() failed [data_type]"); + goto end; + } + if (cJSON_AddStringToObject(item, "dataType", OpenAPI_data_typeoperator_specific_data_container_ToString(operator_specific_data_container->data_type)) == NULL) { + ogs_error("OpenAPI_operator_specific_data_container_convertToJSON() failed [data_type]"); + goto end; + } + + if (operator_specific_data_container->data_type_definition) { + if (cJSON_AddStringToObject(item, "dataTypeDefinition", operator_specific_data_container->data_type_definition) == NULL) { + ogs_error("OpenAPI_operator_specific_data_container_convertToJSON() failed [data_type_definition]"); + goto end; + } + } + + if (!operator_specific_data_container->value) { + ogs_error("OpenAPI_operator_specific_data_container_convertToJSON() failed [value]"); + goto end; + } + if (cJSON_AddStringToObject(item, "value", operator_specific_data_container->value) == NULL) { + ogs_error("OpenAPI_operator_specific_data_container_convertToJSON() failed [value]"); + goto end; + } + + if (operator_specific_data_container->supported_features) { + if (cJSON_AddStringToObject(item, "supportedFeatures", operator_specific_data_container->supported_features) == NULL) { + ogs_error("OpenAPI_operator_specific_data_container_convertToJSON() failed [supported_features]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_operator_specific_data_container_t *OpenAPI_operator_specific_data_container_parseFromJSON(cJSON *operator_specific_data_containerJSON) +{ + OpenAPI_operator_specific_data_container_t *operator_specific_data_container_local_var = NULL; + cJSON *data_type = cJSON_GetObjectItemCaseSensitive(operator_specific_data_containerJSON, "dataType"); + if (!data_type) { + ogs_error("OpenAPI_operator_specific_data_container_parseFromJSON() failed [data_type]"); + goto end; + } + + OpenAPI_operator_specific_data_container_data_type_e data_typeVariable; + + if (!cJSON_IsString(data_type)) { + ogs_error("OpenAPI_operator_specific_data_container_parseFromJSON() failed [data_type]"); + goto end; + } + data_typeVariable = OpenAPI_data_typeoperator_specific_data_container_FromString(data_type->valuestring); + + cJSON *data_type_definition = cJSON_GetObjectItemCaseSensitive(operator_specific_data_containerJSON, "dataTypeDefinition"); + + if (data_type_definition) { + if (!cJSON_IsString(data_type_definition)) { + ogs_error("OpenAPI_operator_specific_data_container_parseFromJSON() failed [data_type_definition]"); + goto end; + } + } + + cJSON *value = cJSON_GetObjectItemCaseSensitive(operator_specific_data_containerJSON, "value"); + if (!value) { + ogs_error("OpenAPI_operator_specific_data_container_parseFromJSON() failed [value]"); + goto end; + } + + + if (!cJSON_IsString(value)) { + ogs_error("OpenAPI_operator_specific_data_container_parseFromJSON() failed [value]"); + goto end; + } + + cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(operator_specific_data_containerJSON, "supportedFeatures"); + + if (supported_features) { + if (!cJSON_IsString(supported_features)) { + ogs_error("OpenAPI_operator_specific_data_container_parseFromJSON() failed [supported_features]"); + goto end; + } + } + + operator_specific_data_container_local_var = OpenAPI_operator_specific_data_container_create ( + data_typeVariable, + data_type_definition ? ogs_strdup(data_type_definition->valuestring) : NULL, + ogs_strdup(value->valuestring), + supported_features ? ogs_strdup(supported_features->valuestring) : NULL + ); + + return operator_specific_data_container_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/operator_specific_data_container.h b/lib/sbi/openapi/model/operator_specific_data_container.h new file mode 100644 index 0000000000..cdf7c825de --- /dev/null +++ b/lib/sbi/openapi/model/operator_specific_data_container.h @@ -0,0 +1,48 @@ +/* + * operator_specific_data_container.h + * + * + */ + +#ifndef _OpenAPI_operator_specific_data_container_H_ +#define _OpenAPI_operator_specific_data_container_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_operator_specific_data_container_s OpenAPI_operator_specific_data_container_t; +typedef enum { OpenAPI_operator_specific_data_container_DATATYPE_NULL = 0, OpenAPI_operator_specific_data_container_DATATYPE_string, OpenAPI_operator_specific_data_container_DATATYPE_integer, OpenAPI_operator_specific_data_container_DATATYPE_number, OpenAPI_operator_specific_data_container_DATATYPE_boolean, OpenAPI_operator_specific_data_container_DATATYPE_object } OpenAPI_operator_specific_data_container_data_type_e; + +char* OpenAPI_operator_specific_data_container_data_type_ToString(OpenAPI_operator_specific_data_container_data_type_e data_type); + +OpenAPI_operator_specific_data_container_data_type_e OpenAPI_operator_specific_data_container_data_type_FromString(char* data_type); +typedef struct OpenAPI_operator_specific_data_container_s { + OpenAPI_operator_specific_data_container_data_type_e data_type; + char *data_type_definition; + char *value; + char *supported_features; +} OpenAPI_operator_specific_data_container_t; + +OpenAPI_operator_specific_data_container_t *OpenAPI_operator_specific_data_container_create( + OpenAPI_operator_specific_data_container_data_type_e data_type, + char *data_type_definition, + char *value, + char *supported_features + ); +void OpenAPI_operator_specific_data_container_free(OpenAPI_operator_specific_data_container_t *operator_specific_data_container); +OpenAPI_operator_specific_data_container_t *OpenAPI_operator_specific_data_container_parseFromJSON(cJSON *operator_specific_data_containerJSON); +cJSON *OpenAPI_operator_specific_data_container_convertToJSON(OpenAPI_operator_specific_data_container_t *operator_specific_data_container); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_operator_specific_data_container_H_ */ + diff --git a/lib/sbi/openapi/model/parameter_over_pc5.c b/lib/sbi/openapi/model/parameter_over_pc5.c new file mode 100644 index 0000000000..e46ff2ed6e --- /dev/null +++ b/lib/sbi/openapi/model/parameter_over_pc5.c @@ -0,0 +1,338 @@ + +#include +#include +#include +#include "parameter_over_pc5.h" + +OpenAPI_parameter_over_pc5_t *OpenAPI_parameter_over_pc5_create( + char *expiry, + OpenAPI_list_t *plmm_rat_served, + int auth_not_served, + OpenAPI_list_t *radio_params_not_served, + OpenAPI_list_t *ser_to_tx, + OpenAPI_list_t *privacy_params, + OpenAPI_configuration_parameters_eutra_t *config_para_eutra, + OpenAPI_configuration_parameters_nr_t *config_para_nr + ) +{ + OpenAPI_parameter_over_pc5_t *parameter_over_pc5_local_var = OpenAPI_malloc(sizeof(OpenAPI_parameter_over_pc5_t)); + if (!parameter_over_pc5_local_var) { + return NULL; + } + parameter_over_pc5_local_var->expiry = expiry; + parameter_over_pc5_local_var->plmm_rat_served = plmm_rat_served; + parameter_over_pc5_local_var->auth_not_served = auth_not_served; + parameter_over_pc5_local_var->radio_params_not_served = radio_params_not_served; + parameter_over_pc5_local_var->ser_to_tx = ser_to_tx; + parameter_over_pc5_local_var->privacy_params = privacy_params; + parameter_over_pc5_local_var->config_para_eutra = config_para_eutra; + parameter_over_pc5_local_var->config_para_nr = config_para_nr; + + return parameter_over_pc5_local_var; +} + +void OpenAPI_parameter_over_pc5_free(OpenAPI_parameter_over_pc5_t *parameter_over_pc5) +{ + if (NULL == parameter_over_pc5) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(parameter_over_pc5->expiry); + OpenAPI_list_for_each(parameter_over_pc5->plmm_rat_served, node) { + OpenAPI_plmn_rat_served_free(node->data); + } + OpenAPI_list_free(parameter_over_pc5->plmm_rat_served); + OpenAPI_list_for_each(parameter_over_pc5->radio_params_not_served, node) { + OpenAPI_radio_parameter_not_served_free(node->data); + } + OpenAPI_list_free(parameter_over_pc5->radio_params_not_served); + OpenAPI_list_for_each(parameter_over_pc5->ser_to_tx, node) { + OpenAPI_service_to_tx_free(node->data); + } + OpenAPI_list_free(parameter_over_pc5->ser_to_tx); + OpenAPI_list_for_each(parameter_over_pc5->privacy_params, node) { + OpenAPI_privacy_parameter_free(node->data); + } + OpenAPI_list_free(parameter_over_pc5->privacy_params); + OpenAPI_configuration_parameters_eutra_free(parameter_over_pc5->config_para_eutra); + OpenAPI_configuration_parameters_nr_free(parameter_over_pc5->config_para_nr); + ogs_free(parameter_over_pc5); +} + +cJSON *OpenAPI_parameter_over_pc5_convertToJSON(OpenAPI_parameter_over_pc5_t *parameter_over_pc5) +{ + cJSON *item = NULL; + + if (parameter_over_pc5 == NULL) { + ogs_error("OpenAPI_parameter_over_pc5_convertToJSON() failed [ParameterOverPc5]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (parameter_over_pc5->expiry) { + if (cJSON_AddStringToObject(item, "expiry", parameter_over_pc5->expiry) == NULL) { + ogs_error("OpenAPI_parameter_over_pc5_convertToJSON() failed [expiry]"); + goto end; + } + } + + if (parameter_over_pc5->plmm_rat_served) { + cJSON *plmm_rat_servedList = cJSON_AddArrayToObject(item, "plmmRatServed"); + if (plmm_rat_servedList == NULL) { + ogs_error("OpenAPI_parameter_over_pc5_convertToJSON() failed [plmm_rat_served]"); + goto end; + } + + OpenAPI_lnode_t *plmm_rat_served_node; + if (parameter_over_pc5->plmm_rat_served) { + OpenAPI_list_for_each(parameter_over_pc5->plmm_rat_served, plmm_rat_served_node) { + cJSON *itemLocal = OpenAPI_plmn_rat_served_convertToJSON(plmm_rat_served_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_parameter_over_pc5_convertToJSON() failed [plmm_rat_served]"); + goto end; + } + cJSON_AddItemToArray(plmm_rat_servedList, itemLocal); + } + } + } + + if (parameter_over_pc5->auth_not_served >= 0) { + if (cJSON_AddBoolToObject(item, "authNotServed", parameter_over_pc5->auth_not_served) == NULL) { + ogs_error("OpenAPI_parameter_over_pc5_convertToJSON() failed [auth_not_served]"); + goto end; + } + } + + if (parameter_over_pc5->radio_params_not_served) { + cJSON *radio_params_not_servedList = cJSON_AddArrayToObject(item, "radioParamsNotServed"); + if (radio_params_not_servedList == NULL) { + ogs_error("OpenAPI_parameter_over_pc5_convertToJSON() failed [radio_params_not_served]"); + goto end; + } + + OpenAPI_lnode_t *radio_params_not_served_node; + if (parameter_over_pc5->radio_params_not_served) { + OpenAPI_list_for_each(parameter_over_pc5->radio_params_not_served, radio_params_not_served_node) { + cJSON *itemLocal = OpenAPI_radio_parameter_not_served_convertToJSON(radio_params_not_served_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_parameter_over_pc5_convertToJSON() failed [radio_params_not_served]"); + goto end; + } + cJSON_AddItemToArray(radio_params_not_servedList, itemLocal); + } + } + } + + if (parameter_over_pc5->ser_to_tx) { + cJSON *ser_to_txList = cJSON_AddArrayToObject(item, "serToTx"); + if (ser_to_txList == NULL) { + ogs_error("OpenAPI_parameter_over_pc5_convertToJSON() failed [ser_to_tx]"); + goto end; + } + + OpenAPI_lnode_t *ser_to_tx_node; + if (parameter_over_pc5->ser_to_tx) { + OpenAPI_list_for_each(parameter_over_pc5->ser_to_tx, ser_to_tx_node) { + cJSON *itemLocal = OpenAPI_service_to_tx_convertToJSON(ser_to_tx_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_parameter_over_pc5_convertToJSON() failed [ser_to_tx]"); + goto end; + } + cJSON_AddItemToArray(ser_to_txList, itemLocal); + } + } + } + + if (parameter_over_pc5->privacy_params) { + cJSON *privacy_paramsList = cJSON_AddArrayToObject(item, "privacyParams"); + if (privacy_paramsList == NULL) { + ogs_error("OpenAPI_parameter_over_pc5_convertToJSON() failed [privacy_params]"); + goto end; + } + + OpenAPI_lnode_t *privacy_params_node; + if (parameter_over_pc5->privacy_params) { + OpenAPI_list_for_each(parameter_over_pc5->privacy_params, privacy_params_node) { + cJSON *itemLocal = OpenAPI_privacy_parameter_convertToJSON(privacy_params_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_parameter_over_pc5_convertToJSON() failed [privacy_params]"); + goto end; + } + cJSON_AddItemToArray(privacy_paramsList, itemLocal); + } + } + } + + if (parameter_over_pc5->config_para_eutra) { + cJSON *config_para_eutra_local_JSON = OpenAPI_configuration_parameters_eutra_convertToJSON(parameter_over_pc5->config_para_eutra); + if (config_para_eutra_local_JSON == NULL) { + ogs_error("OpenAPI_parameter_over_pc5_convertToJSON() failed [config_para_eutra]"); + goto end; + } + cJSON_AddItemToObject(item, "configParaEutra", config_para_eutra_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_parameter_over_pc5_convertToJSON() failed [config_para_eutra]"); + goto end; + } + } + + if (parameter_over_pc5->config_para_nr) { + cJSON *config_para_nr_local_JSON = OpenAPI_configuration_parameters_nr_convertToJSON(parameter_over_pc5->config_para_nr); + if (config_para_nr_local_JSON == NULL) { + ogs_error("OpenAPI_parameter_over_pc5_convertToJSON() failed [config_para_nr]"); + goto end; + } + cJSON_AddItemToObject(item, "configParaNr", config_para_nr_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_parameter_over_pc5_convertToJSON() failed [config_para_nr]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_parameter_over_pc5_t *OpenAPI_parameter_over_pc5_parseFromJSON(cJSON *parameter_over_pc5JSON) +{ + OpenAPI_parameter_over_pc5_t *parameter_over_pc5_local_var = NULL; + cJSON *expiry = cJSON_GetObjectItemCaseSensitive(parameter_over_pc5JSON, "expiry"); + + if (expiry) { + if (!cJSON_IsString(expiry)) { + ogs_error("OpenAPI_parameter_over_pc5_parseFromJSON() failed [expiry]"); + goto end; + } + } + + cJSON *plmm_rat_served = cJSON_GetObjectItemCaseSensitive(parameter_over_pc5JSON, "plmmRatServed"); + + OpenAPI_list_t *plmm_rat_servedList; + if (plmm_rat_served) { + cJSON *plmm_rat_served_local_nonprimitive; + if (!cJSON_IsArray(plmm_rat_served)) { + ogs_error("OpenAPI_parameter_over_pc5_parseFromJSON() failed [plmm_rat_served]"); + goto end; + } + + plmm_rat_servedList = OpenAPI_list_create(); + + cJSON_ArrayForEach(plmm_rat_served_local_nonprimitive, plmm_rat_served ) { + if (!cJSON_IsObject(plmm_rat_served_local_nonprimitive)) { + ogs_error("OpenAPI_parameter_over_pc5_parseFromJSON() failed [plmm_rat_served]"); + goto end; + } + OpenAPI_plmn_rat_served_t *plmm_rat_servedItem = OpenAPI_plmn_rat_served_parseFromJSON(plmm_rat_served_local_nonprimitive); + + OpenAPI_list_add(plmm_rat_servedList, plmm_rat_servedItem); + } + } + + cJSON *auth_not_served = cJSON_GetObjectItemCaseSensitive(parameter_over_pc5JSON, "authNotServed"); + + if (auth_not_served) { + if (!cJSON_IsBool(auth_not_served)) { + ogs_error("OpenAPI_parameter_over_pc5_parseFromJSON() failed [auth_not_served]"); + goto end; + } + } + + cJSON *radio_params_not_served = cJSON_GetObjectItemCaseSensitive(parameter_over_pc5JSON, "radioParamsNotServed"); + + OpenAPI_list_t *radio_params_not_servedList; + if (radio_params_not_served) { + cJSON *radio_params_not_served_local_nonprimitive; + if (!cJSON_IsArray(radio_params_not_served)) { + ogs_error("OpenAPI_parameter_over_pc5_parseFromJSON() failed [radio_params_not_served]"); + goto end; + } + + radio_params_not_servedList = OpenAPI_list_create(); + + cJSON_ArrayForEach(radio_params_not_served_local_nonprimitive, radio_params_not_served ) { + if (!cJSON_IsObject(radio_params_not_served_local_nonprimitive)) { + ogs_error("OpenAPI_parameter_over_pc5_parseFromJSON() failed [radio_params_not_served]"); + goto end; + } + OpenAPI_radio_parameter_not_served_t *radio_params_not_servedItem = OpenAPI_radio_parameter_not_served_parseFromJSON(radio_params_not_served_local_nonprimitive); + + OpenAPI_list_add(radio_params_not_servedList, radio_params_not_servedItem); + } + } + + cJSON *ser_to_tx = cJSON_GetObjectItemCaseSensitive(parameter_over_pc5JSON, "serToTx"); + + OpenAPI_list_t *ser_to_txList; + if (ser_to_tx) { + cJSON *ser_to_tx_local_nonprimitive; + if (!cJSON_IsArray(ser_to_tx)) { + ogs_error("OpenAPI_parameter_over_pc5_parseFromJSON() failed [ser_to_tx]"); + goto end; + } + + ser_to_txList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ser_to_tx_local_nonprimitive, ser_to_tx ) { + if (!cJSON_IsObject(ser_to_tx_local_nonprimitive)) { + ogs_error("OpenAPI_parameter_over_pc5_parseFromJSON() failed [ser_to_tx]"); + goto end; + } + OpenAPI_service_to_tx_t *ser_to_txItem = OpenAPI_service_to_tx_parseFromJSON(ser_to_tx_local_nonprimitive); + + OpenAPI_list_add(ser_to_txList, ser_to_txItem); + } + } + + cJSON *privacy_params = cJSON_GetObjectItemCaseSensitive(parameter_over_pc5JSON, "privacyParams"); + + OpenAPI_list_t *privacy_paramsList; + if (privacy_params) { + cJSON *privacy_params_local_nonprimitive; + if (!cJSON_IsArray(privacy_params)) { + ogs_error("OpenAPI_parameter_over_pc5_parseFromJSON() failed [privacy_params]"); + goto end; + } + + privacy_paramsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(privacy_params_local_nonprimitive, privacy_params ) { + if (!cJSON_IsObject(privacy_params_local_nonprimitive)) { + ogs_error("OpenAPI_parameter_over_pc5_parseFromJSON() failed [privacy_params]"); + goto end; + } + OpenAPI_privacy_parameter_t *privacy_paramsItem = OpenAPI_privacy_parameter_parseFromJSON(privacy_params_local_nonprimitive); + + OpenAPI_list_add(privacy_paramsList, privacy_paramsItem); + } + } + + cJSON *config_para_eutra = cJSON_GetObjectItemCaseSensitive(parameter_over_pc5JSON, "configParaEutra"); + + OpenAPI_configuration_parameters_eutra_t *config_para_eutra_local_nonprim = NULL; + if (config_para_eutra) { + config_para_eutra_local_nonprim = OpenAPI_configuration_parameters_eutra_parseFromJSON(config_para_eutra); + } + + cJSON *config_para_nr = cJSON_GetObjectItemCaseSensitive(parameter_over_pc5JSON, "configParaNr"); + + OpenAPI_configuration_parameters_nr_t *config_para_nr_local_nonprim = NULL; + if (config_para_nr) { + config_para_nr_local_nonprim = OpenAPI_configuration_parameters_nr_parseFromJSON(config_para_nr); + } + + parameter_over_pc5_local_var = OpenAPI_parameter_over_pc5_create ( + expiry ? ogs_strdup(expiry->valuestring) : NULL, + plmm_rat_served ? plmm_rat_servedList : NULL, + auth_not_served ? auth_not_served->valueint : 0, + radio_params_not_served ? radio_params_not_servedList : NULL, + ser_to_tx ? ser_to_txList : NULL, + privacy_params ? privacy_paramsList : NULL, + config_para_eutra ? config_para_eutra_local_nonprim : NULL, + config_para_nr ? config_para_nr_local_nonprim : NULL + ); + + return parameter_over_pc5_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/parameter_over_pc5.h b/lib/sbi/openapi/model/parameter_over_pc5.h new file mode 100644 index 0000000000..55e7d098a4 --- /dev/null +++ b/lib/sbi/openapi/model/parameter_over_pc5.h @@ -0,0 +1,57 @@ +/* + * parameter_over_pc5.h + * + * + */ + +#ifndef _OpenAPI_parameter_over_pc5_H_ +#define _OpenAPI_parameter_over_pc5_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "configuration_parameters_eutra.h" +#include "configuration_parameters_nr.h" +#include "plmn_rat_served.h" +#include "privacy_parameter.h" +#include "radio_parameter_not_served.h" +#include "service_to_tx.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_parameter_over_pc5_s OpenAPI_parameter_over_pc5_t; +typedef struct OpenAPI_parameter_over_pc5_s { + char *expiry; + OpenAPI_list_t *plmm_rat_served; + int auth_not_served; + OpenAPI_list_t *radio_params_not_served; + OpenAPI_list_t *ser_to_tx; + OpenAPI_list_t *privacy_params; + struct OpenAPI_configuration_parameters_eutra_s *config_para_eutra; + struct OpenAPI_configuration_parameters_nr_s *config_para_nr; +} OpenAPI_parameter_over_pc5_t; + +OpenAPI_parameter_over_pc5_t *OpenAPI_parameter_over_pc5_create( + char *expiry, + OpenAPI_list_t *plmm_rat_served, + int auth_not_served, + OpenAPI_list_t *radio_params_not_served, + OpenAPI_list_t *ser_to_tx, + OpenAPI_list_t *privacy_params, + OpenAPI_configuration_parameters_eutra_t *config_para_eutra, + OpenAPI_configuration_parameters_nr_t *config_para_nr + ); +void OpenAPI_parameter_over_pc5_free(OpenAPI_parameter_over_pc5_t *parameter_over_pc5); +OpenAPI_parameter_over_pc5_t *OpenAPI_parameter_over_pc5_parseFromJSON(cJSON *parameter_over_pc5JSON); +cJSON *OpenAPI_parameter_over_pc5_convertToJSON(OpenAPI_parameter_over_pc5_t *parameter_over_pc5); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_parameter_over_pc5_H_ */ + diff --git a/lib/sbi/openapi/model/parameter_over_uu.c b/lib/sbi/openapi/model/parameter_over_uu.c new file mode 100644 index 0000000000..27f987c7ae --- /dev/null +++ b/lib/sbi/openapi/model/parameter_over_uu.c @@ -0,0 +1,171 @@ + +#include +#include +#include +#include "parameter_over_uu.h" + +OpenAPI_parameter_over_uu_t *OpenAPI_parameter_over_uu_create( + char *expiry, + OpenAPI_list_t *ser_to_pdu_sess, + OpenAPI_list_t *ser_to_app_addr + ) +{ + OpenAPI_parameter_over_uu_t *parameter_over_uu_local_var = OpenAPI_malloc(sizeof(OpenAPI_parameter_over_uu_t)); + if (!parameter_over_uu_local_var) { + return NULL; + } + parameter_over_uu_local_var->expiry = expiry; + parameter_over_uu_local_var->ser_to_pdu_sess = ser_to_pdu_sess; + parameter_over_uu_local_var->ser_to_app_addr = ser_to_app_addr; + + return parameter_over_uu_local_var; +} + +void OpenAPI_parameter_over_uu_free(OpenAPI_parameter_over_uu_t *parameter_over_uu) +{ + if (NULL == parameter_over_uu) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(parameter_over_uu->expiry); + OpenAPI_list_for_each(parameter_over_uu->ser_to_pdu_sess, node) { + OpenAPI_service_to_pdu_session_free(node->data); + } + OpenAPI_list_free(parameter_over_uu->ser_to_pdu_sess); + OpenAPI_list_for_each(parameter_over_uu->ser_to_app_addr, node) { + OpenAPI_service_application_server_address_free(node->data); + } + OpenAPI_list_free(parameter_over_uu->ser_to_app_addr); + ogs_free(parameter_over_uu); +} + +cJSON *OpenAPI_parameter_over_uu_convertToJSON(OpenAPI_parameter_over_uu_t *parameter_over_uu) +{ + cJSON *item = NULL; + + if (parameter_over_uu == NULL) { + ogs_error("OpenAPI_parameter_over_uu_convertToJSON() failed [ParameterOverUu]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (parameter_over_uu->expiry) { + if (cJSON_AddStringToObject(item, "expiry", parameter_over_uu->expiry) == NULL) { + ogs_error("OpenAPI_parameter_over_uu_convertToJSON() failed [expiry]"); + goto end; + } + } + + if (parameter_over_uu->ser_to_pdu_sess) { + cJSON *ser_to_pdu_sessList = cJSON_AddArrayToObject(item, "serToPduSess"); + if (ser_to_pdu_sessList == NULL) { + ogs_error("OpenAPI_parameter_over_uu_convertToJSON() failed [ser_to_pdu_sess]"); + goto end; + } + + OpenAPI_lnode_t *ser_to_pdu_sess_node; + if (parameter_over_uu->ser_to_pdu_sess) { + OpenAPI_list_for_each(parameter_over_uu->ser_to_pdu_sess, ser_to_pdu_sess_node) { + cJSON *itemLocal = OpenAPI_service_to_pdu_session_convertToJSON(ser_to_pdu_sess_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_parameter_over_uu_convertToJSON() failed [ser_to_pdu_sess]"); + goto end; + } + cJSON_AddItemToArray(ser_to_pdu_sessList, itemLocal); + } + } + } + + if (parameter_over_uu->ser_to_app_addr) { + cJSON *ser_to_app_addrList = cJSON_AddArrayToObject(item, "serToAppAddr"); + if (ser_to_app_addrList == NULL) { + ogs_error("OpenAPI_parameter_over_uu_convertToJSON() failed [ser_to_app_addr]"); + goto end; + } + + OpenAPI_lnode_t *ser_to_app_addr_node; + if (parameter_over_uu->ser_to_app_addr) { + OpenAPI_list_for_each(parameter_over_uu->ser_to_app_addr, ser_to_app_addr_node) { + cJSON *itemLocal = OpenAPI_service_application_server_address_convertToJSON(ser_to_app_addr_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_parameter_over_uu_convertToJSON() failed [ser_to_app_addr]"); + goto end; + } + cJSON_AddItemToArray(ser_to_app_addrList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_parameter_over_uu_t *OpenAPI_parameter_over_uu_parseFromJSON(cJSON *parameter_over_uuJSON) +{ + OpenAPI_parameter_over_uu_t *parameter_over_uu_local_var = NULL; + cJSON *expiry = cJSON_GetObjectItemCaseSensitive(parameter_over_uuJSON, "expiry"); + + if (expiry) { + if (!cJSON_IsString(expiry)) { + ogs_error("OpenAPI_parameter_over_uu_parseFromJSON() failed [expiry]"); + goto end; + } + } + + cJSON *ser_to_pdu_sess = cJSON_GetObjectItemCaseSensitive(parameter_over_uuJSON, "serToPduSess"); + + OpenAPI_list_t *ser_to_pdu_sessList; + if (ser_to_pdu_sess) { + cJSON *ser_to_pdu_sess_local_nonprimitive; + if (!cJSON_IsArray(ser_to_pdu_sess)) { + ogs_error("OpenAPI_parameter_over_uu_parseFromJSON() failed [ser_to_pdu_sess]"); + goto end; + } + + ser_to_pdu_sessList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ser_to_pdu_sess_local_nonprimitive, ser_to_pdu_sess ) { + if (!cJSON_IsObject(ser_to_pdu_sess_local_nonprimitive)) { + ogs_error("OpenAPI_parameter_over_uu_parseFromJSON() failed [ser_to_pdu_sess]"); + goto end; + } + OpenAPI_service_to_pdu_session_t *ser_to_pdu_sessItem = OpenAPI_service_to_pdu_session_parseFromJSON(ser_to_pdu_sess_local_nonprimitive); + + OpenAPI_list_add(ser_to_pdu_sessList, ser_to_pdu_sessItem); + } + } + + cJSON *ser_to_app_addr = cJSON_GetObjectItemCaseSensitive(parameter_over_uuJSON, "serToAppAddr"); + + OpenAPI_list_t *ser_to_app_addrList; + if (ser_to_app_addr) { + cJSON *ser_to_app_addr_local_nonprimitive; + if (!cJSON_IsArray(ser_to_app_addr)) { + ogs_error("OpenAPI_parameter_over_uu_parseFromJSON() failed [ser_to_app_addr]"); + goto end; + } + + ser_to_app_addrList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ser_to_app_addr_local_nonprimitive, ser_to_app_addr ) { + if (!cJSON_IsObject(ser_to_app_addr_local_nonprimitive)) { + ogs_error("OpenAPI_parameter_over_uu_parseFromJSON() failed [ser_to_app_addr]"); + goto end; + } + OpenAPI_service_application_server_address_t *ser_to_app_addrItem = OpenAPI_service_application_server_address_parseFromJSON(ser_to_app_addr_local_nonprimitive); + + OpenAPI_list_add(ser_to_app_addrList, ser_to_app_addrItem); + } + } + + parameter_over_uu_local_var = OpenAPI_parameter_over_uu_create ( + expiry ? ogs_strdup(expiry->valuestring) : NULL, + ser_to_pdu_sess ? ser_to_pdu_sessList : NULL, + ser_to_app_addr ? ser_to_app_addrList : NULL + ); + + return parameter_over_uu_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/parameter_over_uu.h b/lib/sbi/openapi/model/parameter_over_uu.h new file mode 100644 index 0000000000..d5cedb6d6b --- /dev/null +++ b/lib/sbi/openapi/model/parameter_over_uu.h @@ -0,0 +1,43 @@ +/* + * parameter_over_uu.h + * + * + */ + +#ifndef _OpenAPI_parameter_over_uu_H_ +#define _OpenAPI_parameter_over_uu_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "service_application_server_address.h" +#include "service_to_pdu_session.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_parameter_over_uu_s OpenAPI_parameter_over_uu_t; +typedef struct OpenAPI_parameter_over_uu_s { + char *expiry; + OpenAPI_list_t *ser_to_pdu_sess; + OpenAPI_list_t *ser_to_app_addr; +} OpenAPI_parameter_over_uu_t; + +OpenAPI_parameter_over_uu_t *OpenAPI_parameter_over_uu_create( + char *expiry, + OpenAPI_list_t *ser_to_pdu_sess, + OpenAPI_list_t *ser_to_app_addr + ); +void OpenAPI_parameter_over_uu_free(OpenAPI_parameter_over_uu_t *parameter_over_uu); +OpenAPI_parameter_over_uu_t *OpenAPI_parameter_over_uu_parseFromJSON(cJSON *parameter_over_uuJSON); +cJSON *OpenAPI_parameter_over_uu_convertToJSON(OpenAPI_parameter_over_uu_t *parameter_over_uu); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_parameter_over_uu_H_ */ + diff --git a/lib/sbi/openapi/model/patch_result.c b/lib/sbi/openapi/model/patch_result.c new file mode 100644 index 0000000000..63b78f23ff --- /dev/null +++ b/lib/sbi/openapi/model/patch_result.c @@ -0,0 +1,106 @@ + +#include +#include +#include +#include "patch_result.h" + +OpenAPI_patch_result_t *OpenAPI_patch_result_create( + OpenAPI_list_t *report + ) +{ + OpenAPI_patch_result_t *patch_result_local_var = OpenAPI_malloc(sizeof(OpenAPI_patch_result_t)); + if (!patch_result_local_var) { + return NULL; + } + patch_result_local_var->report = report; + + return patch_result_local_var; +} + +void OpenAPI_patch_result_free(OpenAPI_patch_result_t *patch_result) +{ + if (NULL == patch_result) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(patch_result->report, node) { + OpenAPI_report_item_free(node->data); + } + OpenAPI_list_free(patch_result->report); + ogs_free(patch_result); +} + +cJSON *OpenAPI_patch_result_convertToJSON(OpenAPI_patch_result_t *patch_result) +{ + cJSON *item = NULL; + + if (patch_result == NULL) { + ogs_error("OpenAPI_patch_result_convertToJSON() failed [PatchResult]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!patch_result->report) { + ogs_error("OpenAPI_patch_result_convertToJSON() failed [report]"); + goto end; + } + cJSON *reportList = cJSON_AddArrayToObject(item, "report"); + if (reportList == NULL) { + ogs_error("OpenAPI_patch_result_convertToJSON() failed [report]"); + goto end; + } + + OpenAPI_lnode_t *report_node; + if (patch_result->report) { + OpenAPI_list_for_each(patch_result->report, report_node) { + cJSON *itemLocal = OpenAPI_report_item_convertToJSON(report_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_patch_result_convertToJSON() failed [report]"); + goto end; + } + cJSON_AddItemToArray(reportList, itemLocal); + } + } + +end: + return item; +} + +OpenAPI_patch_result_t *OpenAPI_patch_result_parseFromJSON(cJSON *patch_resultJSON) +{ + OpenAPI_patch_result_t *patch_result_local_var = NULL; + cJSON *report = cJSON_GetObjectItemCaseSensitive(patch_resultJSON, "report"); + if (!report) { + ogs_error("OpenAPI_patch_result_parseFromJSON() failed [report]"); + goto end; + } + + OpenAPI_list_t *reportList; + + cJSON *report_local_nonprimitive; + if (!cJSON_IsArray(report)) { + ogs_error("OpenAPI_patch_result_parseFromJSON() failed [report]"); + goto end; + } + + reportList = OpenAPI_list_create(); + + cJSON_ArrayForEach(report_local_nonprimitive, report ) { + if (!cJSON_IsObject(report_local_nonprimitive)) { + ogs_error("OpenAPI_patch_result_parseFromJSON() failed [report]"); + goto end; + } + OpenAPI_report_item_t *reportItem = OpenAPI_report_item_parseFromJSON(report_local_nonprimitive); + + OpenAPI_list_add(reportList, reportItem); + } + + patch_result_local_var = OpenAPI_patch_result_create ( + reportList + ); + + return patch_result_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/patch_result.h b/lib/sbi/openapi/model/patch_result.h new file mode 100644 index 0000000000..9320924dee --- /dev/null +++ b/lib/sbi/openapi/model/patch_result.h @@ -0,0 +1,38 @@ +/* + * patch_result.h + * + * + */ + +#ifndef _OpenAPI_patch_result_H_ +#define _OpenAPI_patch_result_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "report_item.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_patch_result_s OpenAPI_patch_result_t; +typedef struct OpenAPI_patch_result_s { + OpenAPI_list_t *report; +} OpenAPI_patch_result_t; + +OpenAPI_patch_result_t *OpenAPI_patch_result_create( + OpenAPI_list_t *report + ); +void OpenAPI_patch_result_free(OpenAPI_patch_result_t *patch_result); +OpenAPI_patch_result_t *OpenAPI_patch_result_parseFromJSON(cJSON *patch_resultJSON); +cJSON *OpenAPI_patch_result_convertToJSON(OpenAPI_patch_result_t *patch_result); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_patch_result_H_ */ + diff --git a/lib/sbi/openapi/model/pc5_flow_bit_rates.c b/lib/sbi/openapi/model/pc5_flow_bit_rates.c new file mode 100644 index 0000000000..9d845f3bd8 --- /dev/null +++ b/lib/sbi/openapi/model/pc5_flow_bit_rates.c @@ -0,0 +1,91 @@ + +#include +#include +#include +#include "pc5_flow_bit_rates.h" + +OpenAPI_pc5_flow_bit_rates_t *OpenAPI_pc5_flow_bit_rates_create( + char *gua_fbr, + char *max_fbr + ) +{ + OpenAPI_pc5_flow_bit_rates_t *pc5_flow_bit_rates_local_var = OpenAPI_malloc(sizeof(OpenAPI_pc5_flow_bit_rates_t)); + if (!pc5_flow_bit_rates_local_var) { + return NULL; + } + pc5_flow_bit_rates_local_var->gua_fbr = gua_fbr; + pc5_flow_bit_rates_local_var->max_fbr = max_fbr; + + return pc5_flow_bit_rates_local_var; +} + +void OpenAPI_pc5_flow_bit_rates_free(OpenAPI_pc5_flow_bit_rates_t *pc5_flow_bit_rates) +{ + if (NULL == pc5_flow_bit_rates) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(pc5_flow_bit_rates->gua_fbr); + ogs_free(pc5_flow_bit_rates->max_fbr); + ogs_free(pc5_flow_bit_rates); +} + +cJSON *OpenAPI_pc5_flow_bit_rates_convertToJSON(OpenAPI_pc5_flow_bit_rates_t *pc5_flow_bit_rates) +{ + cJSON *item = NULL; + + if (pc5_flow_bit_rates == NULL) { + ogs_error("OpenAPI_pc5_flow_bit_rates_convertToJSON() failed [Pc5FlowBitRates]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (pc5_flow_bit_rates->gua_fbr) { + if (cJSON_AddStringToObject(item, "guaFbr", pc5_flow_bit_rates->gua_fbr) == NULL) { + ogs_error("OpenAPI_pc5_flow_bit_rates_convertToJSON() failed [gua_fbr]"); + goto end; + } + } + + if (pc5_flow_bit_rates->max_fbr) { + if (cJSON_AddStringToObject(item, "maxFbr", pc5_flow_bit_rates->max_fbr) == NULL) { + ogs_error("OpenAPI_pc5_flow_bit_rates_convertToJSON() failed [max_fbr]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_pc5_flow_bit_rates_t *OpenAPI_pc5_flow_bit_rates_parseFromJSON(cJSON *pc5_flow_bit_ratesJSON) +{ + OpenAPI_pc5_flow_bit_rates_t *pc5_flow_bit_rates_local_var = NULL; + cJSON *gua_fbr = cJSON_GetObjectItemCaseSensitive(pc5_flow_bit_ratesJSON, "guaFbr"); + + if (gua_fbr) { + if (!cJSON_IsString(gua_fbr)) { + ogs_error("OpenAPI_pc5_flow_bit_rates_parseFromJSON() failed [gua_fbr]"); + goto end; + } + } + + cJSON *max_fbr = cJSON_GetObjectItemCaseSensitive(pc5_flow_bit_ratesJSON, "maxFbr"); + + if (max_fbr) { + if (!cJSON_IsString(max_fbr)) { + ogs_error("OpenAPI_pc5_flow_bit_rates_parseFromJSON() failed [max_fbr]"); + goto end; + } + } + + pc5_flow_bit_rates_local_var = OpenAPI_pc5_flow_bit_rates_create ( + gua_fbr ? ogs_strdup(gua_fbr->valuestring) : NULL, + max_fbr ? ogs_strdup(max_fbr->valuestring) : NULL + ); + + return pc5_flow_bit_rates_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/pc5_flow_bit_rates.h b/lib/sbi/openapi/model/pc5_flow_bit_rates.h new file mode 100644 index 0000000000..bcdf4f2da0 --- /dev/null +++ b/lib/sbi/openapi/model/pc5_flow_bit_rates.h @@ -0,0 +1,39 @@ +/* + * pc5_flow_bit_rates.h + * + * + */ + +#ifndef _OpenAPI_pc5_flow_bit_rates_H_ +#define _OpenAPI_pc5_flow_bit_rates_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_pc5_flow_bit_rates_s OpenAPI_pc5_flow_bit_rates_t; +typedef struct OpenAPI_pc5_flow_bit_rates_s { + char *gua_fbr; + char *max_fbr; +} OpenAPI_pc5_flow_bit_rates_t; + +OpenAPI_pc5_flow_bit_rates_t *OpenAPI_pc5_flow_bit_rates_create( + char *gua_fbr, + char *max_fbr + ); +void OpenAPI_pc5_flow_bit_rates_free(OpenAPI_pc5_flow_bit_rates_t *pc5_flow_bit_rates); +OpenAPI_pc5_flow_bit_rates_t *OpenAPI_pc5_flow_bit_rates_parseFromJSON(cJSON *pc5_flow_bit_ratesJSON); +cJSON *OpenAPI_pc5_flow_bit_rates_convertToJSON(OpenAPI_pc5_flow_bit_rates_t *pc5_flow_bit_rates); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_pc5_flow_bit_rates_H_ */ + diff --git a/lib/sbi/openapi/model/pc5_qo_s_para.c b/lib/sbi/openapi/model/pc5_qo_s_para.c new file mode 100644 index 0000000000..146dc25301 --- /dev/null +++ b/lib/sbi/openapi/model/pc5_qo_s_para.c @@ -0,0 +1,126 @@ + +#include +#include +#include +#include "pc5_qo_s_para.h" + +OpenAPI_pc5_qo_s_para_t *OpenAPI_pc5_qo_s_para_create( + OpenAPI_list_t *pc5_qos_flow_list, + char *pc5_link_ambr + ) +{ + OpenAPI_pc5_qo_s_para_t *pc5_qo_s_para_local_var = OpenAPI_malloc(sizeof(OpenAPI_pc5_qo_s_para_t)); + if (!pc5_qo_s_para_local_var) { + return NULL; + } + pc5_qo_s_para_local_var->pc5_qos_flow_list = pc5_qos_flow_list; + pc5_qo_s_para_local_var->pc5_link_ambr = pc5_link_ambr; + + return pc5_qo_s_para_local_var; +} + +void OpenAPI_pc5_qo_s_para_free(OpenAPI_pc5_qo_s_para_t *pc5_qo_s_para) +{ + if (NULL == pc5_qo_s_para) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(pc5_qo_s_para->pc5_qos_flow_list, node) { + OpenAPI_pc5_qos_flow_item_free(node->data); + } + OpenAPI_list_free(pc5_qo_s_para->pc5_qos_flow_list); + ogs_free(pc5_qo_s_para->pc5_link_ambr); + ogs_free(pc5_qo_s_para); +} + +cJSON *OpenAPI_pc5_qo_s_para_convertToJSON(OpenAPI_pc5_qo_s_para_t *pc5_qo_s_para) +{ + cJSON *item = NULL; + + if (pc5_qo_s_para == NULL) { + ogs_error("OpenAPI_pc5_qo_s_para_convertToJSON() failed [Pc5QoSPara]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!pc5_qo_s_para->pc5_qos_flow_list) { + ogs_error("OpenAPI_pc5_qo_s_para_convertToJSON() failed [pc5_qos_flow_list]"); + goto end; + } + cJSON *pc5_qos_flow_listList = cJSON_AddArrayToObject(item, "pc5QosFlowList"); + if (pc5_qos_flow_listList == NULL) { + ogs_error("OpenAPI_pc5_qo_s_para_convertToJSON() failed [pc5_qos_flow_list]"); + goto end; + } + + OpenAPI_lnode_t *pc5_qos_flow_list_node; + if (pc5_qo_s_para->pc5_qos_flow_list) { + OpenAPI_list_for_each(pc5_qo_s_para->pc5_qos_flow_list, pc5_qos_flow_list_node) { + cJSON *itemLocal = OpenAPI_pc5_qos_flow_item_convertToJSON(pc5_qos_flow_list_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_pc5_qo_s_para_convertToJSON() failed [pc5_qos_flow_list]"); + goto end; + } + cJSON_AddItemToArray(pc5_qos_flow_listList, itemLocal); + } + } + + if (pc5_qo_s_para->pc5_link_ambr) { + if (cJSON_AddStringToObject(item, "pc5LinkAmbr", pc5_qo_s_para->pc5_link_ambr) == NULL) { + ogs_error("OpenAPI_pc5_qo_s_para_convertToJSON() failed [pc5_link_ambr]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_pc5_qo_s_para_t *OpenAPI_pc5_qo_s_para_parseFromJSON(cJSON *pc5_qo_s_paraJSON) +{ + OpenAPI_pc5_qo_s_para_t *pc5_qo_s_para_local_var = NULL; + cJSON *pc5_qos_flow_list = cJSON_GetObjectItemCaseSensitive(pc5_qo_s_paraJSON, "pc5QosFlowList"); + if (!pc5_qos_flow_list) { + ogs_error("OpenAPI_pc5_qo_s_para_parseFromJSON() failed [pc5_qos_flow_list]"); + goto end; + } + + OpenAPI_list_t *pc5_qos_flow_listList; + + cJSON *pc5_qos_flow_list_local_nonprimitive; + if (!cJSON_IsArray(pc5_qos_flow_list)) { + ogs_error("OpenAPI_pc5_qo_s_para_parseFromJSON() failed [pc5_qos_flow_list]"); + goto end; + } + + pc5_qos_flow_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pc5_qos_flow_list_local_nonprimitive, pc5_qos_flow_list ) { + if (!cJSON_IsObject(pc5_qos_flow_list_local_nonprimitive)) { + ogs_error("OpenAPI_pc5_qo_s_para_parseFromJSON() failed [pc5_qos_flow_list]"); + goto end; + } + OpenAPI_pc5_qos_flow_item_t *pc5_qos_flow_listItem = OpenAPI_pc5_qos_flow_item_parseFromJSON(pc5_qos_flow_list_local_nonprimitive); + + OpenAPI_list_add(pc5_qos_flow_listList, pc5_qos_flow_listItem); + } + + cJSON *pc5_link_ambr = cJSON_GetObjectItemCaseSensitive(pc5_qo_s_paraJSON, "pc5LinkAmbr"); + + if (pc5_link_ambr) { + if (!cJSON_IsString(pc5_link_ambr)) { + ogs_error("OpenAPI_pc5_qo_s_para_parseFromJSON() failed [pc5_link_ambr]"); + goto end; + } + } + + pc5_qo_s_para_local_var = OpenAPI_pc5_qo_s_para_create ( + pc5_qos_flow_listList, + pc5_link_ambr ? ogs_strdup(pc5_link_ambr->valuestring) : NULL + ); + + return pc5_qo_s_para_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/pc5_qo_s_para.h b/lib/sbi/openapi/model/pc5_qo_s_para.h new file mode 100644 index 0000000000..7d88da67b1 --- /dev/null +++ b/lib/sbi/openapi/model/pc5_qo_s_para.h @@ -0,0 +1,40 @@ +/* + * pc5_qo_s_para.h + * + * + */ + +#ifndef _OpenAPI_pc5_qo_s_para_H_ +#define _OpenAPI_pc5_qo_s_para_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "pc5_qos_flow_item.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_pc5_qo_s_para_s OpenAPI_pc5_qo_s_para_t; +typedef struct OpenAPI_pc5_qo_s_para_s { + OpenAPI_list_t *pc5_qos_flow_list; + char *pc5_link_ambr; +} OpenAPI_pc5_qo_s_para_t; + +OpenAPI_pc5_qo_s_para_t *OpenAPI_pc5_qo_s_para_create( + OpenAPI_list_t *pc5_qos_flow_list, + char *pc5_link_ambr + ); +void OpenAPI_pc5_qo_s_para_free(OpenAPI_pc5_qo_s_para_t *pc5_qo_s_para); +OpenAPI_pc5_qo_s_para_t *OpenAPI_pc5_qo_s_para_parseFromJSON(cJSON *pc5_qo_s_paraJSON); +cJSON *OpenAPI_pc5_qo_s_para_convertToJSON(OpenAPI_pc5_qo_s_para_t *pc5_qo_s_para); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_pc5_qo_s_para_H_ */ + diff --git a/lib/sbi/openapi/model/pc5_qos_flow_item.c b/lib/sbi/openapi/model/pc5_qos_flow_item.c new file mode 100644 index 0000000000..4c91d61943 --- /dev/null +++ b/lib/sbi/openapi/model/pc5_qos_flow_item.c @@ -0,0 +1,118 @@ + +#include +#include +#include +#include "pc5_qos_flow_item.h" + +OpenAPI_pc5_qos_flow_item_t *OpenAPI_pc5_qos_flow_item_create( + int pqi, + OpenAPI_pc5_flow_bit_rates_t *pc5_flow_bit_rates, + int range + ) +{ + OpenAPI_pc5_qos_flow_item_t *pc5_qos_flow_item_local_var = OpenAPI_malloc(sizeof(OpenAPI_pc5_qos_flow_item_t)); + if (!pc5_qos_flow_item_local_var) { + return NULL; + } + pc5_qos_flow_item_local_var->pqi = pqi; + pc5_qos_flow_item_local_var->pc5_flow_bit_rates = pc5_flow_bit_rates; + pc5_qos_flow_item_local_var->range = range; + + return pc5_qos_flow_item_local_var; +} + +void OpenAPI_pc5_qos_flow_item_free(OpenAPI_pc5_qos_flow_item_t *pc5_qos_flow_item) +{ + if (NULL == pc5_qos_flow_item) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_pc5_flow_bit_rates_free(pc5_qos_flow_item->pc5_flow_bit_rates); + ogs_free(pc5_qos_flow_item); +} + +cJSON *OpenAPI_pc5_qos_flow_item_convertToJSON(OpenAPI_pc5_qos_flow_item_t *pc5_qos_flow_item) +{ + cJSON *item = NULL; + + if (pc5_qos_flow_item == NULL) { + ogs_error("OpenAPI_pc5_qos_flow_item_convertToJSON() failed [Pc5QosFlowItem]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!pc5_qos_flow_item->pqi) { + ogs_error("OpenAPI_pc5_qos_flow_item_convertToJSON() failed [pqi]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "pqi", pc5_qos_flow_item->pqi) == NULL) { + ogs_error("OpenAPI_pc5_qos_flow_item_convertToJSON() failed [pqi]"); + goto end; + } + + if (pc5_qos_flow_item->pc5_flow_bit_rates) { + cJSON *pc5_flow_bit_rates_local_JSON = OpenAPI_pc5_flow_bit_rates_convertToJSON(pc5_qos_flow_item->pc5_flow_bit_rates); + if (pc5_flow_bit_rates_local_JSON == NULL) { + ogs_error("OpenAPI_pc5_qos_flow_item_convertToJSON() failed [pc5_flow_bit_rates]"); + goto end; + } + cJSON_AddItemToObject(item, "pc5FlowBitRates", pc5_flow_bit_rates_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_pc5_qos_flow_item_convertToJSON() failed [pc5_flow_bit_rates]"); + goto end; + } + } + + if (pc5_qos_flow_item->range) { + if (cJSON_AddNumberToObject(item, "range", pc5_qos_flow_item->range) == NULL) { + ogs_error("OpenAPI_pc5_qos_flow_item_convertToJSON() failed [range]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_pc5_qos_flow_item_t *OpenAPI_pc5_qos_flow_item_parseFromJSON(cJSON *pc5_qos_flow_itemJSON) +{ + OpenAPI_pc5_qos_flow_item_t *pc5_qos_flow_item_local_var = NULL; + cJSON *pqi = cJSON_GetObjectItemCaseSensitive(pc5_qos_flow_itemJSON, "pqi"); + if (!pqi) { + ogs_error("OpenAPI_pc5_qos_flow_item_parseFromJSON() failed [pqi]"); + goto end; + } + + + if (!cJSON_IsNumber(pqi)) { + ogs_error("OpenAPI_pc5_qos_flow_item_parseFromJSON() failed [pqi]"); + goto end; + } + + cJSON *pc5_flow_bit_rates = cJSON_GetObjectItemCaseSensitive(pc5_qos_flow_itemJSON, "pc5FlowBitRates"); + + OpenAPI_pc5_flow_bit_rates_t *pc5_flow_bit_rates_local_nonprim = NULL; + if (pc5_flow_bit_rates) { + pc5_flow_bit_rates_local_nonprim = OpenAPI_pc5_flow_bit_rates_parseFromJSON(pc5_flow_bit_rates); + } + + cJSON *range = cJSON_GetObjectItemCaseSensitive(pc5_qos_flow_itemJSON, "range"); + + if (range) { + if (!cJSON_IsNumber(range)) { + ogs_error("OpenAPI_pc5_qos_flow_item_parseFromJSON() failed [range]"); + goto end; + } + } + + pc5_qos_flow_item_local_var = OpenAPI_pc5_qos_flow_item_create ( + pqi->valuedouble, + pc5_flow_bit_rates ? pc5_flow_bit_rates_local_nonprim : NULL, + range ? range->valuedouble : 0 + ); + + return pc5_qos_flow_item_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/pc5_qos_flow_item.h b/lib/sbi/openapi/model/pc5_qos_flow_item.h new file mode 100644 index 0000000000..dc807d1abe --- /dev/null +++ b/lib/sbi/openapi/model/pc5_qos_flow_item.h @@ -0,0 +1,42 @@ +/* + * pc5_qos_flow_item.h + * + * + */ + +#ifndef _OpenAPI_pc5_qos_flow_item_H_ +#define _OpenAPI_pc5_qos_flow_item_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "pc5_flow_bit_rates.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_pc5_qos_flow_item_s OpenAPI_pc5_qos_flow_item_t; +typedef struct OpenAPI_pc5_qos_flow_item_s { + int pqi; + struct OpenAPI_pc5_flow_bit_rates_s *pc5_flow_bit_rates; + int range; +} OpenAPI_pc5_qos_flow_item_t; + +OpenAPI_pc5_qos_flow_item_t *OpenAPI_pc5_qos_flow_item_create( + int pqi, + OpenAPI_pc5_flow_bit_rates_t *pc5_flow_bit_rates, + int range + ); +void OpenAPI_pc5_qos_flow_item_free(OpenAPI_pc5_qos_flow_item_t *pc5_qos_flow_item); +OpenAPI_pc5_qos_flow_item_t *OpenAPI_pc5_qos_flow_item_parseFromJSON(cJSON *pc5_qos_flow_itemJSON); +cJSON *OpenAPI_pc5_qos_flow_item_convertToJSON(OpenAPI_pc5_qos_flow_item_t *pc5_qos_flow_item); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_pc5_qos_flow_item_H_ */ + diff --git a/lib/sbi/openapi/model/pc5_qos_mapping.c b/lib/sbi/openapi/model/pc5_qos_mapping.c new file mode 100644 index 0000000000..382bdd278a --- /dev/null +++ b/lib/sbi/openapi/model/pc5_qos_mapping.c @@ -0,0 +1,123 @@ + +#include +#include +#include +#include "pc5_qos_mapping.h" + +OpenAPI_pc5_qos_mapping_t *OpenAPI_pc5_qos_mapping_create( + OpenAPI_list_t *ser_ids, + OpenAPI_pc5_qos_flow_item_t *pc5_qo_s_flow_param + ) +{ + OpenAPI_pc5_qos_mapping_t *pc5_qos_mapping_local_var = OpenAPI_malloc(sizeof(OpenAPI_pc5_qos_mapping_t)); + if (!pc5_qos_mapping_local_var) { + return NULL; + } + pc5_qos_mapping_local_var->ser_ids = ser_ids; + pc5_qos_mapping_local_var->pc5_qo_s_flow_param = pc5_qo_s_flow_param; + + return pc5_qos_mapping_local_var; +} + +void OpenAPI_pc5_qos_mapping_free(OpenAPI_pc5_qos_mapping_t *pc5_qos_mapping) +{ + if (NULL == pc5_qos_mapping) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(pc5_qos_mapping->ser_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pc5_qos_mapping->ser_ids); + OpenAPI_pc5_qos_flow_item_free(pc5_qos_mapping->pc5_qo_s_flow_param); + ogs_free(pc5_qos_mapping); +} + +cJSON *OpenAPI_pc5_qos_mapping_convertToJSON(OpenAPI_pc5_qos_mapping_t *pc5_qos_mapping) +{ + cJSON *item = NULL; + + if (pc5_qos_mapping == NULL) { + ogs_error("OpenAPI_pc5_qos_mapping_convertToJSON() failed [Pc5QosMapping]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!pc5_qos_mapping->ser_ids) { + ogs_error("OpenAPI_pc5_qos_mapping_convertToJSON() failed [ser_ids]"); + goto end; + } + cJSON *ser_ids = cJSON_AddArrayToObject(item, "serIds"); + if (ser_ids == NULL) { + ogs_error("OpenAPI_pc5_qos_mapping_convertToJSON() failed [ser_ids]"); + goto end; + } + + OpenAPI_lnode_t *ser_ids_node; + OpenAPI_list_for_each(pc5_qos_mapping->ser_ids, ser_ids_node) { + if (cJSON_AddStringToObject(ser_ids, "", (char*)ser_ids_node->data) == NULL) { + ogs_error("OpenAPI_pc5_qos_mapping_convertToJSON() failed [ser_ids]"); + goto end; + } + } + + if (pc5_qos_mapping->pc5_qo_s_flow_param) { + cJSON *pc5_qo_s_flow_param_local_JSON = OpenAPI_pc5_qos_flow_item_convertToJSON(pc5_qos_mapping->pc5_qo_s_flow_param); + if (pc5_qo_s_flow_param_local_JSON == NULL) { + ogs_error("OpenAPI_pc5_qos_mapping_convertToJSON() failed [pc5_qo_s_flow_param]"); + goto end; + } + cJSON_AddItemToObject(item, "pc5QoSFlowParam", pc5_qo_s_flow_param_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_pc5_qos_mapping_convertToJSON() failed [pc5_qo_s_flow_param]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_pc5_qos_mapping_t *OpenAPI_pc5_qos_mapping_parseFromJSON(cJSON *pc5_qos_mappingJSON) +{ + OpenAPI_pc5_qos_mapping_t *pc5_qos_mapping_local_var = NULL; + cJSON *ser_ids = cJSON_GetObjectItemCaseSensitive(pc5_qos_mappingJSON, "serIds"); + if (!ser_ids) { + ogs_error("OpenAPI_pc5_qos_mapping_parseFromJSON() failed [ser_ids]"); + goto end; + } + + OpenAPI_list_t *ser_idsList; + + cJSON *ser_ids_local; + if (!cJSON_IsArray(ser_ids)) { + ogs_error("OpenAPI_pc5_qos_mapping_parseFromJSON() failed [ser_ids]"); + goto end; + } + ser_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ser_ids_local, ser_ids) { + if (!cJSON_IsString(ser_ids_local)) { + ogs_error("OpenAPI_pc5_qos_mapping_parseFromJSON() failed [ser_ids]"); + goto end; + } + OpenAPI_list_add(ser_idsList, ogs_strdup(ser_ids_local->valuestring)); + } + + cJSON *pc5_qo_s_flow_param = cJSON_GetObjectItemCaseSensitive(pc5_qos_mappingJSON, "pc5QoSFlowParam"); + + OpenAPI_pc5_qos_flow_item_t *pc5_qo_s_flow_param_local_nonprim = NULL; + if (pc5_qo_s_flow_param) { + pc5_qo_s_flow_param_local_nonprim = OpenAPI_pc5_qos_flow_item_parseFromJSON(pc5_qo_s_flow_param); + } + + pc5_qos_mapping_local_var = OpenAPI_pc5_qos_mapping_create ( + ser_idsList, + pc5_qo_s_flow_param ? pc5_qo_s_flow_param_local_nonprim : NULL + ); + + return pc5_qos_mapping_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/pc5_qos_mapping.h b/lib/sbi/openapi/model/pc5_qos_mapping.h new file mode 100644 index 0000000000..40ecb7d79a --- /dev/null +++ b/lib/sbi/openapi/model/pc5_qos_mapping.h @@ -0,0 +1,40 @@ +/* + * pc5_qos_mapping.h + * + * + */ + +#ifndef _OpenAPI_pc5_qos_mapping_H_ +#define _OpenAPI_pc5_qos_mapping_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "pc5_qos_flow_item.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_pc5_qos_mapping_s OpenAPI_pc5_qos_mapping_t; +typedef struct OpenAPI_pc5_qos_mapping_s { + OpenAPI_list_t *ser_ids; + struct OpenAPI_pc5_qos_flow_item_s *pc5_qo_s_flow_param; +} OpenAPI_pc5_qos_mapping_t; + +OpenAPI_pc5_qos_mapping_t *OpenAPI_pc5_qos_mapping_create( + OpenAPI_list_t *ser_ids, + OpenAPI_pc5_qos_flow_item_t *pc5_qo_s_flow_param + ); +void OpenAPI_pc5_qos_mapping_free(OpenAPI_pc5_qos_mapping_t *pc5_qos_mapping); +OpenAPI_pc5_qos_mapping_t *OpenAPI_pc5_qos_mapping_parseFromJSON(cJSON *pc5_qos_mappingJSON); +cJSON *OpenAPI_pc5_qos_mapping_convertToJSON(OpenAPI_pc5_qos_mapping_t *pc5_qos_mapping); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_pc5_qos_mapping_H_ */ + diff --git a/lib/sbi/openapi/model/pcf_info.c b/lib/sbi/openapi/model/pcf_info.c index 3a246d77d9..93f1eed42c 100644 --- a/lib/sbi/openapi/model/pcf_info.c +++ b/lib/sbi/openapi/model/pcf_info.c @@ -10,7 +10,8 @@ OpenAPI_pcf_info_t *OpenAPI_pcf_info_create( OpenAPI_list_t *supi_ranges, OpenAPI_list_t *gpsi_ranges, char *rx_diam_host, - char *rx_diam_realm + char *rx_diam_realm, + int v2x_support_ind ) { OpenAPI_pcf_info_t *pcf_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_pcf_info_t)); @@ -23,6 +24,7 @@ OpenAPI_pcf_info_t *OpenAPI_pcf_info_create( pcf_info_local_var->gpsi_ranges = gpsi_ranges; pcf_info_local_var->rx_diam_host = rx_diam_host; pcf_info_local_var->rx_diam_realm = rx_diam_realm; + pcf_info_local_var->v2x_support_ind = v2x_support_ind; return pcf_info_local_var; } @@ -138,6 +140,13 @@ cJSON *OpenAPI_pcf_info_convertToJSON(OpenAPI_pcf_info_t *pcf_info) } } + if (pcf_info->v2x_support_ind >= 0) { + if (cJSON_AddBoolToObject(item, "v2xSupportInd", pcf_info->v2x_support_ind) == NULL) { + ogs_error("OpenAPI_pcf_info_convertToJSON() failed [v2x_support_ind]"); + goto end; + } + } + end: return item; } @@ -238,13 +247,23 @@ OpenAPI_pcf_info_t *OpenAPI_pcf_info_parseFromJSON(cJSON *pcf_infoJSON) } } + cJSON *v2x_support_ind = cJSON_GetObjectItemCaseSensitive(pcf_infoJSON, "v2xSupportInd"); + + if (v2x_support_ind) { + if (!cJSON_IsBool(v2x_support_ind)) { + ogs_error("OpenAPI_pcf_info_parseFromJSON() failed [v2x_support_ind]"); + goto end; + } + } + pcf_info_local_var = OpenAPI_pcf_info_create ( group_id ? ogs_strdup(group_id->valuestring) : NULL, dnn_list ? dnn_listList : NULL, supi_ranges ? supi_rangesList : NULL, gpsi_ranges ? gpsi_rangesList : NULL, rx_diam_host ? ogs_strdup(rx_diam_host->valuestring) : NULL, - rx_diam_realm ? ogs_strdup(rx_diam_realm->valuestring) : NULL + rx_diam_realm ? ogs_strdup(rx_diam_realm->valuestring) : NULL, + v2x_support_ind ? v2x_support_ind->valueint : 0 ); return pcf_info_local_var; diff --git a/lib/sbi/openapi/model/pcf_info.h b/lib/sbi/openapi/model/pcf_info.h index 369fc06e38..f92edae269 100644 --- a/lib/sbi/openapi/model/pcf_info.h +++ b/lib/sbi/openapi/model/pcf_info.h @@ -1,7 +1,7 @@ /* * pcf_info.h * - * + * Information of a PCF NF Instance */ #ifndef _OpenAPI_pcf_info_H_ @@ -27,6 +27,7 @@ typedef struct OpenAPI_pcf_info_s { OpenAPI_list_t *gpsi_ranges; char *rx_diam_host; char *rx_diam_realm; + int v2x_support_ind; } OpenAPI_pcf_info_t; OpenAPI_pcf_info_t *OpenAPI_pcf_info_create( @@ -35,7 +36,8 @@ OpenAPI_pcf_info_t *OpenAPI_pcf_info_create( OpenAPI_list_t *supi_ranges, OpenAPI_list_t *gpsi_ranges, char *rx_diam_host, - char *rx_diam_realm + char *rx_diam_realm, + int v2x_support_ind ); void OpenAPI_pcf_info_free(OpenAPI_pcf_info_t *pcf_info); OpenAPI_pcf_info_t *OpenAPI_pcf_info_parseFromJSON(cJSON *pcf_infoJSON); diff --git a/lib/sbi/openapi/model/pcscf_info.c b/lib/sbi/openapi/model/pcscf_info.c new file mode 100644 index 0000000000..15fa1b2b67 --- /dev/null +++ b/lib/sbi/openapi/model/pcscf_info.c @@ -0,0 +1,135 @@ + +#include +#include +#include +#include "pcscf_info.h" + +OpenAPI_pcscf_info_t *OpenAPI_pcscf_info_create( + OpenAPI_list_t *access_type, + OpenAPI_list_t *dnn_list + ) +{ + OpenAPI_pcscf_info_t *pcscf_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_pcscf_info_t)); + if (!pcscf_info_local_var) { + return NULL; + } + pcscf_info_local_var->access_type = access_type; + pcscf_info_local_var->dnn_list = dnn_list; + + return pcscf_info_local_var; +} + +void OpenAPI_pcscf_info_free(OpenAPI_pcscf_info_t *pcscf_info) +{ + if (NULL == pcscf_info) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_free(pcscf_info->access_type); + OpenAPI_list_for_each(pcscf_info->dnn_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pcscf_info->dnn_list); + ogs_free(pcscf_info); +} + +cJSON *OpenAPI_pcscf_info_convertToJSON(OpenAPI_pcscf_info_t *pcscf_info) +{ + cJSON *item = NULL; + + if (pcscf_info == NULL) { + ogs_error("OpenAPI_pcscf_info_convertToJSON() failed [PcscfInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (pcscf_info->access_type) { + cJSON *access_type = cJSON_AddArrayToObject(item, "accessType"); + if (access_type == NULL) { + ogs_error("OpenAPI_pcscf_info_convertToJSON() failed [access_type]"); + goto end; + } + OpenAPI_lnode_t *access_type_node; + OpenAPI_list_for_each(pcscf_info->access_type, access_type_node) { + if (cJSON_AddStringToObject(access_type, "", OpenAPI_access_type_ToString((OpenAPI_access_type_e)access_type_node->data)) == NULL) { + ogs_error("OpenAPI_pcscf_info_convertToJSON() failed [access_type]"); + goto end; + } + } + } + + if (pcscf_info->dnn_list) { + cJSON *dnn_list = cJSON_AddArrayToObject(item, "dnnList"); + if (dnn_list == NULL) { + ogs_error("OpenAPI_pcscf_info_convertToJSON() failed [dnn_list]"); + goto end; + } + + OpenAPI_lnode_t *dnn_list_node; + OpenAPI_list_for_each(pcscf_info->dnn_list, dnn_list_node) { + if (cJSON_AddStringToObject(dnn_list, "", (char*)dnn_list_node->data) == NULL) { + ogs_error("OpenAPI_pcscf_info_convertToJSON() failed [dnn_list]"); + goto end; + } + } + } + +end: + return item; +} + +OpenAPI_pcscf_info_t *OpenAPI_pcscf_info_parseFromJSON(cJSON *pcscf_infoJSON) +{ + OpenAPI_pcscf_info_t *pcscf_info_local_var = NULL; + cJSON *access_type = cJSON_GetObjectItemCaseSensitive(pcscf_infoJSON, "accessType"); + + OpenAPI_list_t *access_typeList; + if (access_type) { + cJSON *access_type_local_nonprimitive; + if (!cJSON_IsArray(access_type)) { + ogs_error("OpenAPI_pcscf_info_parseFromJSON() failed [access_type]"); + goto end; + } + + access_typeList = OpenAPI_list_create(); + + cJSON_ArrayForEach(access_type_local_nonprimitive, access_type ) { + if (!cJSON_IsString(access_type_local_nonprimitive)) { + ogs_error("OpenAPI_pcscf_info_parseFromJSON() failed [access_type]"); + goto end; + } + + OpenAPI_list_add(access_typeList, (void *)OpenAPI_access_type_FromString(access_type_local_nonprimitive->valuestring)); + } + } + + cJSON *dnn_list = cJSON_GetObjectItemCaseSensitive(pcscf_infoJSON, "dnnList"); + + OpenAPI_list_t *dnn_listList; + if (dnn_list) { + cJSON *dnn_list_local; + if (!cJSON_IsArray(dnn_list)) { + ogs_error("OpenAPI_pcscf_info_parseFromJSON() failed [dnn_list]"); + goto end; + } + dnn_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(dnn_list_local, dnn_list) { + if (!cJSON_IsString(dnn_list_local)) { + ogs_error("OpenAPI_pcscf_info_parseFromJSON() failed [dnn_list]"); + goto end; + } + OpenAPI_list_add(dnn_listList, ogs_strdup(dnn_list_local->valuestring)); + } + } + + pcscf_info_local_var = OpenAPI_pcscf_info_create ( + access_type ? access_typeList : NULL, + dnn_list ? dnn_listList : NULL + ); + + return pcscf_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/pcscf_info.h b/lib/sbi/openapi/model/pcscf_info.h new file mode 100644 index 0000000000..3e4838a484 --- /dev/null +++ b/lib/sbi/openapi/model/pcscf_info.h @@ -0,0 +1,40 @@ +/* + * pcscf_info.h + * + * Information of a P-CSCF NF Instance + */ + +#ifndef _OpenAPI_pcscf_info_H_ +#define _OpenAPI_pcscf_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "access_type.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_pcscf_info_s OpenAPI_pcscf_info_t; +typedef struct OpenAPI_pcscf_info_s { + OpenAPI_list_t *access_type; + OpenAPI_list_t *dnn_list; +} OpenAPI_pcscf_info_t; + +OpenAPI_pcscf_info_t *OpenAPI_pcscf_info_create( + OpenAPI_list_t *access_type, + OpenAPI_list_t *dnn_list + ); +void OpenAPI_pcscf_info_free(OpenAPI_pcscf_info_t *pcscf_info); +OpenAPI_pcscf_info_t *OpenAPI_pcscf_info_parseFromJSON(cJSON *pcscf_infoJSON); +cJSON *OpenAPI_pcscf_info_convertToJSON(OpenAPI_pcscf_info_t *pcscf_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_pcscf_info_H_ */ + diff --git a/lib/sbi/openapi/model/pcscf_restoration_notification.c b/lib/sbi/openapi/model/pcscf_restoration_notification.c new file mode 100644 index 0000000000..1ba0b8edda --- /dev/null +++ b/lib/sbi/openapi/model/pcscf_restoration_notification.c @@ -0,0 +1,76 @@ + +#include +#include +#include +#include "pcscf_restoration_notification.h" + +OpenAPI_pcscf_restoration_notification_t *OpenAPI_pcscf_restoration_notification_create( + char *supi + ) +{ + OpenAPI_pcscf_restoration_notification_t *pcscf_restoration_notification_local_var = OpenAPI_malloc(sizeof(OpenAPI_pcscf_restoration_notification_t)); + if (!pcscf_restoration_notification_local_var) { + return NULL; + } + pcscf_restoration_notification_local_var->supi = supi; + + return pcscf_restoration_notification_local_var; +} + +void OpenAPI_pcscf_restoration_notification_free(OpenAPI_pcscf_restoration_notification_t *pcscf_restoration_notification) +{ + if (NULL == pcscf_restoration_notification) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(pcscf_restoration_notification->supi); + ogs_free(pcscf_restoration_notification); +} + +cJSON *OpenAPI_pcscf_restoration_notification_convertToJSON(OpenAPI_pcscf_restoration_notification_t *pcscf_restoration_notification) +{ + cJSON *item = NULL; + + if (pcscf_restoration_notification == NULL) { + ogs_error("OpenAPI_pcscf_restoration_notification_convertToJSON() failed [PcscfRestorationNotification]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!pcscf_restoration_notification->supi) { + ogs_error("OpenAPI_pcscf_restoration_notification_convertToJSON() failed [supi]"); + goto end; + } + if (cJSON_AddStringToObject(item, "supi", pcscf_restoration_notification->supi) == NULL) { + ogs_error("OpenAPI_pcscf_restoration_notification_convertToJSON() failed [supi]"); + goto end; + } + +end: + return item; +} + +OpenAPI_pcscf_restoration_notification_t *OpenAPI_pcscf_restoration_notification_parseFromJSON(cJSON *pcscf_restoration_notificationJSON) +{ + OpenAPI_pcscf_restoration_notification_t *pcscf_restoration_notification_local_var = NULL; + cJSON *supi = cJSON_GetObjectItemCaseSensitive(pcscf_restoration_notificationJSON, "supi"); + if (!supi) { + ogs_error("OpenAPI_pcscf_restoration_notification_parseFromJSON() failed [supi]"); + goto end; + } + + + if (!cJSON_IsString(supi)) { + ogs_error("OpenAPI_pcscf_restoration_notification_parseFromJSON() failed [supi]"); + goto end; + } + + pcscf_restoration_notification_local_var = OpenAPI_pcscf_restoration_notification_create ( + ogs_strdup(supi->valuestring) + ); + + return pcscf_restoration_notification_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/pcscf_restoration_notification.h b/lib/sbi/openapi/model/pcscf_restoration_notification.h new file mode 100644 index 0000000000..5b36edf22e --- /dev/null +++ b/lib/sbi/openapi/model/pcscf_restoration_notification.h @@ -0,0 +1,37 @@ +/* + * pcscf_restoration_notification.h + * + * + */ + +#ifndef _OpenAPI_pcscf_restoration_notification_H_ +#define _OpenAPI_pcscf_restoration_notification_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_pcscf_restoration_notification_s OpenAPI_pcscf_restoration_notification_t; +typedef struct OpenAPI_pcscf_restoration_notification_s { + char *supi; +} OpenAPI_pcscf_restoration_notification_t; + +OpenAPI_pcscf_restoration_notification_t *OpenAPI_pcscf_restoration_notification_create( + char *supi + ); +void OpenAPI_pcscf_restoration_notification_free(OpenAPI_pcscf_restoration_notification_t *pcscf_restoration_notification); +OpenAPI_pcscf_restoration_notification_t *OpenAPI_pcscf_restoration_notification_parseFromJSON(cJSON *pcscf_restoration_notificationJSON); +cJSON *OpenAPI_pcscf_restoration_notification_convertToJSON(OpenAPI_pcscf_restoration_notification_t *pcscf_restoration_notification); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_pcscf_restoration_notification_H_ */ + diff --git a/lib/sbi/openapi/model/pdu_session.c b/lib/sbi/openapi/model/pdu_session.c new file mode 100644 index 0000000000..17b8ac1847 --- /dev/null +++ b/lib/sbi/openapi/model/pdu_session.c @@ -0,0 +1,130 @@ + +#include +#include +#include +#include "pdu_session.h" + +OpenAPI_pdu_session_t *OpenAPI_pdu_session_create( + char *dnn, + char *smf_instance_id, + OpenAPI_plmn_id_t *plmn_id + ) +{ + OpenAPI_pdu_session_t *pdu_session_local_var = OpenAPI_malloc(sizeof(OpenAPI_pdu_session_t)); + if (!pdu_session_local_var) { + return NULL; + } + pdu_session_local_var->dnn = dnn; + pdu_session_local_var->smf_instance_id = smf_instance_id; + pdu_session_local_var->plmn_id = plmn_id; + + return pdu_session_local_var; +} + +void OpenAPI_pdu_session_free(OpenAPI_pdu_session_t *pdu_session) +{ + if (NULL == pdu_session) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(pdu_session->dnn); + ogs_free(pdu_session->smf_instance_id); + OpenAPI_plmn_id_free(pdu_session->plmn_id); + ogs_free(pdu_session); +} + +cJSON *OpenAPI_pdu_session_convertToJSON(OpenAPI_pdu_session_t *pdu_session) +{ + cJSON *item = NULL; + + if (pdu_session == NULL) { + ogs_error("OpenAPI_pdu_session_convertToJSON() failed [PduSession]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!pdu_session->dnn) { + ogs_error("OpenAPI_pdu_session_convertToJSON() failed [dnn]"); + goto end; + } + if (cJSON_AddStringToObject(item, "dnn", pdu_session->dnn) == NULL) { + ogs_error("OpenAPI_pdu_session_convertToJSON() failed [dnn]"); + goto end; + } + + if (!pdu_session->smf_instance_id) { + ogs_error("OpenAPI_pdu_session_convertToJSON() failed [smf_instance_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "smfInstanceId", pdu_session->smf_instance_id) == NULL) { + ogs_error("OpenAPI_pdu_session_convertToJSON() failed [smf_instance_id]"); + goto end; + } + + if (!pdu_session->plmn_id) { + ogs_error("OpenAPI_pdu_session_convertToJSON() failed [plmn_id]"); + goto end; + } + cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_convertToJSON(pdu_session->plmn_id); + if (plmn_id_local_JSON == NULL) { + ogs_error("OpenAPI_pdu_session_convertToJSON() failed [plmn_id]"); + goto end; + } + cJSON_AddItemToObject(item, "plmnId", plmn_id_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_pdu_session_convertToJSON() failed [plmn_id]"); + goto end; + } + +end: + return item; +} + +OpenAPI_pdu_session_t *OpenAPI_pdu_session_parseFromJSON(cJSON *pdu_sessionJSON) +{ + OpenAPI_pdu_session_t *pdu_session_local_var = NULL; + cJSON *dnn = cJSON_GetObjectItemCaseSensitive(pdu_sessionJSON, "dnn"); + if (!dnn) { + ogs_error("OpenAPI_pdu_session_parseFromJSON() failed [dnn]"); + goto end; + } + + + if (!cJSON_IsString(dnn)) { + ogs_error("OpenAPI_pdu_session_parseFromJSON() failed [dnn]"); + goto end; + } + + cJSON *smf_instance_id = cJSON_GetObjectItemCaseSensitive(pdu_sessionJSON, "smfInstanceId"); + if (!smf_instance_id) { + ogs_error("OpenAPI_pdu_session_parseFromJSON() failed [smf_instance_id]"); + goto end; + } + + + if (!cJSON_IsString(smf_instance_id)) { + ogs_error("OpenAPI_pdu_session_parseFromJSON() failed [smf_instance_id]"); + goto end; + } + + cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(pdu_sessionJSON, "plmnId"); + if (!plmn_id) { + ogs_error("OpenAPI_pdu_session_parseFromJSON() failed [plmn_id]"); + goto end; + } + + OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + + plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); + + pdu_session_local_var = OpenAPI_pdu_session_create ( + ogs_strdup(dnn->valuestring), + ogs_strdup(smf_instance_id->valuestring), + plmn_id_local_nonprim + ); + + return pdu_session_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/pdu_session.h b/lib/sbi/openapi/model/pdu_session.h new file mode 100644 index 0000000000..62eb03ac63 --- /dev/null +++ b/lib/sbi/openapi/model/pdu_session.h @@ -0,0 +1,42 @@ +/* + * pdu_session.h + * + * + */ + +#ifndef _OpenAPI_pdu_session_H_ +#define _OpenAPI_pdu_session_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "plmn_id.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_pdu_session_s OpenAPI_pdu_session_t; +typedef struct OpenAPI_pdu_session_s { + char *dnn; + char *smf_instance_id; + struct OpenAPI_plmn_id_s *plmn_id; +} OpenAPI_pdu_session_t; + +OpenAPI_pdu_session_t *OpenAPI_pdu_session_create( + char *dnn, + char *smf_instance_id, + OpenAPI_plmn_id_t *plmn_id + ); +void OpenAPI_pdu_session_free(OpenAPI_pdu_session_t *pdu_session); +OpenAPI_pdu_session_t *OpenAPI_pdu_session_parseFromJSON(cJSON *pdu_sessionJSON); +cJSON *OpenAPI_pdu_session_convertToJSON(OpenAPI_pdu_session_t *pdu_session); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_pdu_session_H_ */ + diff --git a/lib/sbi/openapi/model/pdu_session_continuity_ind.c b/lib/sbi/openapi/model/pdu_session_continuity_ind.c new file mode 100644 index 0000000000..00da296087 --- /dev/null +++ b/lib/sbi/openapi/model/pdu_session_continuity_ind.c @@ -0,0 +1,30 @@ + +#include +#include +#include +#include "pdu_session_continuity_ind.h" + +char* OpenAPI_pdu_session_continuity_ind_ToString(OpenAPI_pdu_session_continuity_ind_e pdu_session_continuity_ind) +{ + const char *pdu_session_continuity_indArray[] = { "NULL", "MAINTAIN_PDUSESSION", "RECONNECT_PDUSESSION", "RELEASE_PDUSESSION" }; + size_t sizeofArray = sizeof(pdu_session_continuity_indArray) / sizeof(pdu_session_continuity_indArray[0]); + if (pdu_session_continuity_ind < sizeofArray) + return (char *)pdu_session_continuity_indArray[pdu_session_continuity_ind]; + else + return (char *)"Unknown"; +} + +OpenAPI_pdu_session_continuity_ind_e OpenAPI_pdu_session_continuity_ind_FromString(char* pdu_session_continuity_ind) +{ + int stringToReturn = 0; + const char *pdu_session_continuity_indArray[] = { "NULL", "MAINTAIN_PDUSESSION", "RECONNECT_PDUSESSION", "RELEASE_PDUSESSION" }; + size_t sizeofArray = sizeof(pdu_session_continuity_indArray) / sizeof(pdu_session_continuity_indArray[0]); + while (stringToReturn < sizeofArray) { + if (strcmp(pdu_session_continuity_ind, pdu_session_continuity_indArray[stringToReturn]) == 0) { + return stringToReturn; + } + stringToReturn++; + } + return 0; +} + diff --git a/lib/sbi/openapi/model/pdu_session_continuity_ind.h b/lib/sbi/openapi/model/pdu_session_continuity_ind.h new file mode 100644 index 0000000000..a366470116 --- /dev/null +++ b/lib/sbi/openapi/model/pdu_session_continuity_ind.h @@ -0,0 +1,31 @@ +/* + * pdu_session_continuity_ind.h + * + * + */ + +#ifndef _OpenAPI_pdu_session_continuity_ind_H_ +#define _OpenAPI_pdu_session_continuity_ind_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { OpenAPI_pdu_session_continuity_ind_NULL = 0, OpenAPI_pdu_session_continuity_ind_MAINTAIN_PDUSESSION, OpenAPI_pdu_session_continuity_ind_RECONNECT_PDUSESSION, OpenAPI_pdu_session_continuity_ind_RELEASE_PDUSESSION } OpenAPI_pdu_session_continuity_ind_e; + +char* OpenAPI_pdu_session_continuity_ind_ToString(OpenAPI_pdu_session_continuity_ind_e pdu_session_continuity_ind); + +OpenAPI_pdu_session_continuity_ind_e OpenAPI_pdu_session_continuity_ind_FromString(char* pdu_session_continuity_ind); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_pdu_session_continuity_ind_H_ */ + diff --git a/lib/sbi/openapi/model/pdu_session_management_data.c b/lib/sbi/openapi/model/pdu_session_management_data.c new file mode 100644 index 0000000000..4c0bbadf84 --- /dev/null +++ b/lib/sbi/openapi/model/pdu_session_management_data.c @@ -0,0 +1,394 @@ + +#include +#include +#include +#include "pdu_session_management_data.h" + +OpenAPI_pdu_session_management_data_t *OpenAPI_pdu_session_management_data_create( + OpenAPI_pdu_session_status_t *pdu_session_status, + char *pdu_session_status_ts, + char *dnai, + char *dnai_ts, + OpenAPI_list_t *n6_traffic_routing_info, + char *n6_traffic_routing_info_ts, + char *ipv4_addr, + OpenAPI_list_t *ipv6_prefix, + OpenAPI_list_t *ipv6_addrs, + OpenAPI_pdu_session_type_t *pdu_sess_type, + char *ip_addr_ts, + char *dnn, + int pdu_session_id + ) +{ + OpenAPI_pdu_session_management_data_t *pdu_session_management_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_pdu_session_management_data_t)); + if (!pdu_session_management_data_local_var) { + return NULL; + } + pdu_session_management_data_local_var->pdu_session_status = pdu_session_status; + pdu_session_management_data_local_var->pdu_session_status_ts = pdu_session_status_ts; + pdu_session_management_data_local_var->dnai = dnai; + pdu_session_management_data_local_var->dnai_ts = dnai_ts; + pdu_session_management_data_local_var->n6_traffic_routing_info = n6_traffic_routing_info; + pdu_session_management_data_local_var->n6_traffic_routing_info_ts = n6_traffic_routing_info_ts; + pdu_session_management_data_local_var->ipv4_addr = ipv4_addr; + pdu_session_management_data_local_var->ipv6_prefix = ipv6_prefix; + pdu_session_management_data_local_var->ipv6_addrs = ipv6_addrs; + pdu_session_management_data_local_var->pdu_sess_type = pdu_sess_type; + pdu_session_management_data_local_var->ip_addr_ts = ip_addr_ts; + pdu_session_management_data_local_var->dnn = dnn; + pdu_session_management_data_local_var->pdu_session_id = pdu_session_id; + + return pdu_session_management_data_local_var; +} + +void OpenAPI_pdu_session_management_data_free(OpenAPI_pdu_session_management_data_t *pdu_session_management_data) +{ + if (NULL == pdu_session_management_data) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_pdu_session_status_free(pdu_session_management_data->pdu_session_status); + ogs_free(pdu_session_management_data->pdu_session_status_ts); + ogs_free(pdu_session_management_data->dnai); + ogs_free(pdu_session_management_data->dnai_ts); + OpenAPI_list_for_each(pdu_session_management_data->n6_traffic_routing_info, node) { + OpenAPI_route_to_location_free(node->data); + } + OpenAPI_list_free(pdu_session_management_data->n6_traffic_routing_info); + ogs_free(pdu_session_management_data->n6_traffic_routing_info_ts); + ogs_free(pdu_session_management_data->ipv4_addr); + OpenAPI_list_for_each(pdu_session_management_data->ipv6_prefix, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pdu_session_management_data->ipv6_prefix); + OpenAPI_list_for_each(pdu_session_management_data->ipv6_addrs, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pdu_session_management_data->ipv6_addrs); + OpenAPI_pdu_session_type_free(pdu_session_management_data->pdu_sess_type); + ogs_free(pdu_session_management_data->ip_addr_ts); + ogs_free(pdu_session_management_data->dnn); + ogs_free(pdu_session_management_data); +} + +cJSON *OpenAPI_pdu_session_management_data_convertToJSON(OpenAPI_pdu_session_management_data_t *pdu_session_management_data) +{ + cJSON *item = NULL; + + if (pdu_session_management_data == NULL) { + ogs_error("OpenAPI_pdu_session_management_data_convertToJSON() failed [PduSessionManagementData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (pdu_session_management_data->pdu_session_status) { + cJSON *pdu_session_status_local_JSON = OpenAPI_pdu_session_status_convertToJSON(pdu_session_management_data->pdu_session_status); + if (pdu_session_status_local_JSON == NULL) { + ogs_error("OpenAPI_pdu_session_management_data_convertToJSON() failed [pdu_session_status]"); + goto end; + } + cJSON_AddItemToObject(item, "pduSessionStatus", pdu_session_status_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_pdu_session_management_data_convertToJSON() failed [pdu_session_status]"); + goto end; + } + } + + if (pdu_session_management_data->pdu_session_status_ts) { + if (cJSON_AddStringToObject(item, "pduSessionStatusTs", pdu_session_management_data->pdu_session_status_ts) == NULL) { + ogs_error("OpenAPI_pdu_session_management_data_convertToJSON() failed [pdu_session_status_ts]"); + goto end; + } + } + + if (pdu_session_management_data->dnai) { + if (cJSON_AddStringToObject(item, "dnai", pdu_session_management_data->dnai) == NULL) { + ogs_error("OpenAPI_pdu_session_management_data_convertToJSON() failed [dnai]"); + goto end; + } + } + + if (pdu_session_management_data->dnai_ts) { + if (cJSON_AddStringToObject(item, "dnaiTs", pdu_session_management_data->dnai_ts) == NULL) { + ogs_error("OpenAPI_pdu_session_management_data_convertToJSON() failed [dnai_ts]"); + goto end; + } + } + + if (pdu_session_management_data->n6_traffic_routing_info) { + cJSON *n6_traffic_routing_infoList = cJSON_AddArrayToObject(item, "n6TrafficRoutingInfo"); + if (n6_traffic_routing_infoList == NULL) { + ogs_error("OpenAPI_pdu_session_management_data_convertToJSON() failed [n6_traffic_routing_info]"); + goto end; + } + + OpenAPI_lnode_t *n6_traffic_routing_info_node; + if (pdu_session_management_data->n6_traffic_routing_info) { + OpenAPI_list_for_each(pdu_session_management_data->n6_traffic_routing_info, n6_traffic_routing_info_node) { + cJSON *itemLocal = OpenAPI_route_to_location_convertToJSON(n6_traffic_routing_info_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_pdu_session_management_data_convertToJSON() failed [n6_traffic_routing_info]"); + goto end; + } + cJSON_AddItemToArray(n6_traffic_routing_infoList, itemLocal); + } + } + } + + if (pdu_session_management_data->n6_traffic_routing_info_ts) { + if (cJSON_AddStringToObject(item, "n6TrafficRoutingInfoTs", pdu_session_management_data->n6_traffic_routing_info_ts) == NULL) { + ogs_error("OpenAPI_pdu_session_management_data_convertToJSON() failed [n6_traffic_routing_info_ts]"); + goto end; + } + } + + if (pdu_session_management_data->ipv4_addr) { + if (cJSON_AddStringToObject(item, "ipv4Addr", pdu_session_management_data->ipv4_addr) == NULL) { + ogs_error("OpenAPI_pdu_session_management_data_convertToJSON() failed [ipv4_addr]"); + goto end; + } + } + + if (pdu_session_management_data->ipv6_prefix) { + cJSON *ipv6_prefix = cJSON_AddArrayToObject(item, "ipv6Prefix"); + if (ipv6_prefix == NULL) { + ogs_error("OpenAPI_pdu_session_management_data_convertToJSON() failed [ipv6_prefix]"); + goto end; + } + + OpenAPI_lnode_t *ipv6_prefix_node; + OpenAPI_list_for_each(pdu_session_management_data->ipv6_prefix, ipv6_prefix_node) { + if (cJSON_AddStringToObject(ipv6_prefix, "", (char*)ipv6_prefix_node->data) == NULL) { + ogs_error("OpenAPI_pdu_session_management_data_convertToJSON() failed [ipv6_prefix]"); + goto end; + } + } + } + + if (pdu_session_management_data->ipv6_addrs) { + cJSON *ipv6_addrs = cJSON_AddArrayToObject(item, "ipv6Addrs"); + if (ipv6_addrs == NULL) { + ogs_error("OpenAPI_pdu_session_management_data_convertToJSON() failed [ipv6_addrs]"); + goto end; + } + + OpenAPI_lnode_t *ipv6_addrs_node; + OpenAPI_list_for_each(pdu_session_management_data->ipv6_addrs, ipv6_addrs_node) { + if (cJSON_AddStringToObject(ipv6_addrs, "", (char*)ipv6_addrs_node->data) == NULL) { + ogs_error("OpenAPI_pdu_session_management_data_convertToJSON() failed [ipv6_addrs]"); + goto end; + } + } + } + + if (pdu_session_management_data->pdu_sess_type) { + cJSON *pdu_sess_type_local_JSON = OpenAPI_pdu_session_type_convertToJSON(pdu_session_management_data->pdu_sess_type); + if (pdu_sess_type_local_JSON == NULL) { + ogs_error("OpenAPI_pdu_session_management_data_convertToJSON() failed [pdu_sess_type]"); + goto end; + } + cJSON_AddItemToObject(item, "pduSessType", pdu_sess_type_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_pdu_session_management_data_convertToJSON() failed [pdu_sess_type]"); + goto end; + } + } + + if (pdu_session_management_data->ip_addr_ts) { + if (cJSON_AddStringToObject(item, "ipAddrTs", pdu_session_management_data->ip_addr_ts) == NULL) { + ogs_error("OpenAPI_pdu_session_management_data_convertToJSON() failed [ip_addr_ts]"); + goto end; + } + } + + if (pdu_session_management_data->dnn) { + if (cJSON_AddStringToObject(item, "dnn", pdu_session_management_data->dnn) == NULL) { + ogs_error("OpenAPI_pdu_session_management_data_convertToJSON() failed [dnn]"); + goto end; + } + } + + if (pdu_session_management_data->pdu_session_id) { + if (cJSON_AddNumberToObject(item, "pduSessionId", pdu_session_management_data->pdu_session_id) == NULL) { + ogs_error("OpenAPI_pdu_session_management_data_convertToJSON() failed [pdu_session_id]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_pdu_session_management_data_t *OpenAPI_pdu_session_management_data_parseFromJSON(cJSON *pdu_session_management_dataJSON) +{ + OpenAPI_pdu_session_management_data_t *pdu_session_management_data_local_var = NULL; + cJSON *pdu_session_status = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "pduSessionStatus"); + + OpenAPI_pdu_session_status_t *pdu_session_status_local_nonprim = NULL; + if (pdu_session_status) { + pdu_session_status_local_nonprim = OpenAPI_pdu_session_status_parseFromJSON(pdu_session_status); + } + + cJSON *pdu_session_status_ts = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "pduSessionStatusTs"); + + if (pdu_session_status_ts) { + if (!cJSON_IsString(pdu_session_status_ts)) { + ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [pdu_session_status_ts]"); + goto end; + } + } + + cJSON *dnai = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "dnai"); + + if (dnai) { + if (!cJSON_IsString(dnai)) { + ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [dnai]"); + goto end; + } + } + + cJSON *dnai_ts = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "dnaiTs"); + + if (dnai_ts) { + if (!cJSON_IsString(dnai_ts)) { + ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [dnai_ts]"); + goto end; + } + } + + cJSON *n6_traffic_routing_info = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "n6TrafficRoutingInfo"); + + OpenAPI_list_t *n6_traffic_routing_infoList; + if (n6_traffic_routing_info) { + cJSON *n6_traffic_routing_info_local_nonprimitive; + if (!cJSON_IsArray(n6_traffic_routing_info)) { + ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [n6_traffic_routing_info]"); + goto end; + } + + n6_traffic_routing_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(n6_traffic_routing_info_local_nonprimitive, n6_traffic_routing_info ) { + if (!cJSON_IsObject(n6_traffic_routing_info_local_nonprimitive)) { + ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [n6_traffic_routing_info]"); + goto end; + } + OpenAPI_route_to_location_t *n6_traffic_routing_infoItem = OpenAPI_route_to_location_parseFromJSON(n6_traffic_routing_info_local_nonprimitive); + + OpenAPI_list_add(n6_traffic_routing_infoList, n6_traffic_routing_infoItem); + } + } + + cJSON *n6_traffic_routing_info_ts = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "n6TrafficRoutingInfoTs"); + + if (n6_traffic_routing_info_ts) { + if (!cJSON_IsString(n6_traffic_routing_info_ts)) { + ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [n6_traffic_routing_info_ts]"); + goto end; + } + } + + cJSON *ipv4_addr = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "ipv4Addr"); + + if (ipv4_addr) { + if (!cJSON_IsString(ipv4_addr)) { + ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [ipv4_addr]"); + goto end; + } + } + + cJSON *ipv6_prefix = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "ipv6Prefix"); + + OpenAPI_list_t *ipv6_prefixList; + if (ipv6_prefix) { + cJSON *ipv6_prefix_local; + if (!cJSON_IsArray(ipv6_prefix)) { + ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [ipv6_prefix]"); + goto end; + } + ipv6_prefixList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv6_prefix_local, ipv6_prefix) { + if (!cJSON_IsString(ipv6_prefix_local)) { + ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [ipv6_prefix]"); + goto end; + } + OpenAPI_list_add(ipv6_prefixList, ogs_strdup(ipv6_prefix_local->valuestring)); + } + } + + cJSON *ipv6_addrs = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "ipv6Addrs"); + + OpenAPI_list_t *ipv6_addrsList; + if (ipv6_addrs) { + cJSON *ipv6_addrs_local; + if (!cJSON_IsArray(ipv6_addrs)) { + ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [ipv6_addrs]"); + goto end; + } + ipv6_addrsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv6_addrs_local, ipv6_addrs) { + if (!cJSON_IsString(ipv6_addrs_local)) { + ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [ipv6_addrs]"); + goto end; + } + OpenAPI_list_add(ipv6_addrsList, ogs_strdup(ipv6_addrs_local->valuestring)); + } + } + + cJSON *pdu_sess_type = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "pduSessType"); + + OpenAPI_pdu_session_type_t *pdu_sess_type_local_nonprim = NULL; + if (pdu_sess_type) { + pdu_sess_type_local_nonprim = OpenAPI_pdu_session_type_parseFromJSON(pdu_sess_type); + } + + cJSON *ip_addr_ts = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "ipAddrTs"); + + if (ip_addr_ts) { + if (!cJSON_IsString(ip_addr_ts)) { + ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [ip_addr_ts]"); + goto end; + } + } + + cJSON *dnn = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "dnn"); + + if (dnn) { + if (!cJSON_IsString(dnn)) { + ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [dnn]"); + goto end; + } + } + + cJSON *pdu_session_id = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "pduSessionId"); + + if (pdu_session_id) { + if (!cJSON_IsNumber(pdu_session_id)) { + ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [pdu_session_id]"); + goto end; + } + } + + pdu_session_management_data_local_var = OpenAPI_pdu_session_management_data_create ( + pdu_session_status ? pdu_session_status_local_nonprim : NULL, + pdu_session_status_ts ? ogs_strdup(pdu_session_status_ts->valuestring) : NULL, + dnai ? ogs_strdup(dnai->valuestring) : NULL, + dnai_ts ? ogs_strdup(dnai_ts->valuestring) : NULL, + n6_traffic_routing_info ? n6_traffic_routing_infoList : NULL, + n6_traffic_routing_info_ts ? ogs_strdup(n6_traffic_routing_info_ts->valuestring) : NULL, + ipv4_addr ? ogs_strdup(ipv4_addr->valuestring) : NULL, + ipv6_prefix ? ipv6_prefixList : NULL, + ipv6_addrs ? ipv6_addrsList : NULL, + pdu_sess_type ? pdu_sess_type_local_nonprim : NULL, + ip_addr_ts ? ogs_strdup(ip_addr_ts->valuestring) : NULL, + dnn ? ogs_strdup(dnn->valuestring) : NULL, + pdu_session_id ? pdu_session_id->valuedouble : 0 + ); + + return pdu_session_management_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/pdu_session_management_data.h b/lib/sbi/openapi/model/pdu_session_management_data.h new file mode 100644 index 0000000000..d9ad454d9a --- /dev/null +++ b/lib/sbi/openapi/model/pdu_session_management_data.h @@ -0,0 +1,64 @@ +/* + * pdu_session_management_data.h + * + * + */ + +#ifndef _OpenAPI_pdu_session_management_data_H_ +#define _OpenAPI_pdu_session_management_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "pdu_session_status.h" +#include "pdu_session_type.h" +#include "route_to_location.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_pdu_session_management_data_s OpenAPI_pdu_session_management_data_t; +typedef struct OpenAPI_pdu_session_management_data_s { + struct OpenAPI_pdu_session_status_s *pdu_session_status; + char *pdu_session_status_ts; + char *dnai; + char *dnai_ts; + OpenAPI_list_t *n6_traffic_routing_info; + char *n6_traffic_routing_info_ts; + char *ipv4_addr; + OpenAPI_list_t *ipv6_prefix; + OpenAPI_list_t *ipv6_addrs; + struct OpenAPI_pdu_session_type_s *pdu_sess_type; + char *ip_addr_ts; + char *dnn; + int pdu_session_id; +} OpenAPI_pdu_session_management_data_t; + +OpenAPI_pdu_session_management_data_t *OpenAPI_pdu_session_management_data_create( + OpenAPI_pdu_session_status_t *pdu_session_status, + char *pdu_session_status_ts, + char *dnai, + char *dnai_ts, + OpenAPI_list_t *n6_traffic_routing_info, + char *n6_traffic_routing_info_ts, + char *ipv4_addr, + OpenAPI_list_t *ipv6_prefix, + OpenAPI_list_t *ipv6_addrs, + OpenAPI_pdu_session_type_t *pdu_sess_type, + char *ip_addr_ts, + char *dnn, + int pdu_session_id + ); +void OpenAPI_pdu_session_management_data_free(OpenAPI_pdu_session_management_data_t *pdu_session_management_data); +OpenAPI_pdu_session_management_data_t *OpenAPI_pdu_session_management_data_parseFromJSON(cJSON *pdu_session_management_dataJSON); +cJSON *OpenAPI_pdu_session_management_data_convertToJSON(OpenAPI_pdu_session_management_data_t *pdu_session_management_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_pdu_session_management_data_H_ */ + diff --git a/lib/sbi/openapi/model/pdu_session_status.c b/lib/sbi/openapi/model/pdu_session_status.c new file mode 100644 index 0000000000..147f7b7886 --- /dev/null +++ b/lib/sbi/openapi/model/pdu_session_status.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "pdu_session_status.h" + +OpenAPI_pdu_session_status_t *OpenAPI_pdu_session_status_create( + ) +{ + OpenAPI_pdu_session_status_t *pdu_session_status_local_var = OpenAPI_malloc(sizeof(OpenAPI_pdu_session_status_t)); + if (!pdu_session_status_local_var) { + return NULL; + } + + return pdu_session_status_local_var; +} + +void OpenAPI_pdu_session_status_free(OpenAPI_pdu_session_status_t *pdu_session_status) +{ + if (NULL == pdu_session_status) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(pdu_session_status); +} + +cJSON *OpenAPI_pdu_session_status_convertToJSON(OpenAPI_pdu_session_status_t *pdu_session_status) +{ + cJSON *item = NULL; + + if (pdu_session_status == NULL) { + ogs_error("OpenAPI_pdu_session_status_convertToJSON() failed [PduSessionStatus]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_pdu_session_status_t *OpenAPI_pdu_session_status_parseFromJSON(cJSON *pdu_session_statusJSON) +{ + OpenAPI_pdu_session_status_t *pdu_session_status_local_var = NULL; + pdu_session_status_local_var = OpenAPI_pdu_session_status_create ( + ); + + return pdu_session_status_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/pdu_session_status.h b/lib/sbi/openapi/model/pdu_session_status.h new file mode 100644 index 0000000000..76ad15d9f9 --- /dev/null +++ b/lib/sbi/openapi/model/pdu_session_status.h @@ -0,0 +1,35 @@ +/* + * pdu_session_status.h + * + * Possible values are - \"ACTIVE\" - \"RELEASED\" + */ + +#ifndef _OpenAPI_pdu_session_status_H_ +#define _OpenAPI_pdu_session_status_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_pdu_session_status_s OpenAPI_pdu_session_status_t; +typedef struct OpenAPI_pdu_session_status_s { +} OpenAPI_pdu_session_status_t; + +OpenAPI_pdu_session_status_t *OpenAPI_pdu_session_status_create( + ); +void OpenAPI_pdu_session_status_free(OpenAPI_pdu_session_status_t *pdu_session_status); +OpenAPI_pdu_session_status_t *OpenAPI_pdu_session_status_parseFromJSON(cJSON *pdu_session_statusJSON); +cJSON *OpenAPI_pdu_session_status_convertToJSON(OpenAPI_pdu_session_status_t *pdu_session_status); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_pdu_session_status_H_ */ + diff --git a/lib/sbi/openapi/model/pdu_session_types.c b/lib/sbi/openapi/model/pdu_session_types.c new file mode 100644 index 0000000000..2c667051f4 --- /dev/null +++ b/lib/sbi/openapi/model/pdu_session_types.c @@ -0,0 +1,130 @@ + +#include +#include +#include +#include "pdu_session_types.h" + +OpenAPI_pdu_session_types_t *OpenAPI_pdu_session_types_create( + OpenAPI_pdu_session_type_t *default_session_type, + OpenAPI_list_t *allowed_session_types + ) +{ + OpenAPI_pdu_session_types_t *pdu_session_types_local_var = OpenAPI_malloc(sizeof(OpenAPI_pdu_session_types_t)); + if (!pdu_session_types_local_var) { + return NULL; + } + pdu_session_types_local_var->default_session_type = default_session_type; + pdu_session_types_local_var->allowed_session_types = allowed_session_types; + + return pdu_session_types_local_var; +} + +void OpenAPI_pdu_session_types_free(OpenAPI_pdu_session_types_t *pdu_session_types) +{ + if (NULL == pdu_session_types) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_pdu_session_type_free(pdu_session_types->default_session_type); + OpenAPI_list_for_each(pdu_session_types->allowed_session_types, node) { + OpenAPI_pdu_session_type_free(node->data); + } + OpenAPI_list_free(pdu_session_types->allowed_session_types); + ogs_free(pdu_session_types); +} + +cJSON *OpenAPI_pdu_session_types_convertToJSON(OpenAPI_pdu_session_types_t *pdu_session_types) +{ + cJSON *item = NULL; + + if (pdu_session_types == NULL) { + ogs_error("OpenAPI_pdu_session_types_convertToJSON() failed [PduSessionTypes]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!pdu_session_types->default_session_type) { + ogs_error("OpenAPI_pdu_session_types_convertToJSON() failed [default_session_type]"); + goto end; + } + cJSON *default_session_type_local_JSON = OpenAPI_pdu_session_type_convertToJSON(pdu_session_types->default_session_type); + if (default_session_type_local_JSON == NULL) { + ogs_error("OpenAPI_pdu_session_types_convertToJSON() failed [default_session_type]"); + goto end; + } + cJSON_AddItemToObject(item, "defaultSessionType", default_session_type_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_pdu_session_types_convertToJSON() failed [default_session_type]"); + goto end; + } + + if (pdu_session_types->allowed_session_types) { + cJSON *allowed_session_typesList = cJSON_AddArrayToObject(item, "allowedSessionTypes"); + if (allowed_session_typesList == NULL) { + ogs_error("OpenAPI_pdu_session_types_convertToJSON() failed [allowed_session_types]"); + goto end; + } + + OpenAPI_lnode_t *allowed_session_types_node; + if (pdu_session_types->allowed_session_types) { + OpenAPI_list_for_each(pdu_session_types->allowed_session_types, allowed_session_types_node) { + cJSON *itemLocal = OpenAPI_pdu_session_type_convertToJSON(allowed_session_types_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_pdu_session_types_convertToJSON() failed [allowed_session_types]"); + goto end; + } + cJSON_AddItemToArray(allowed_session_typesList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_pdu_session_types_t *OpenAPI_pdu_session_types_parseFromJSON(cJSON *pdu_session_typesJSON) +{ + OpenAPI_pdu_session_types_t *pdu_session_types_local_var = NULL; + cJSON *default_session_type = cJSON_GetObjectItemCaseSensitive(pdu_session_typesJSON, "defaultSessionType"); + if (!default_session_type) { + ogs_error("OpenAPI_pdu_session_types_parseFromJSON() failed [default_session_type]"); + goto end; + } + + OpenAPI_pdu_session_type_t *default_session_type_local_nonprim = NULL; + + default_session_type_local_nonprim = OpenAPI_pdu_session_type_parseFromJSON(default_session_type); + + cJSON *allowed_session_types = cJSON_GetObjectItemCaseSensitive(pdu_session_typesJSON, "allowedSessionTypes"); + + OpenAPI_list_t *allowed_session_typesList; + if (allowed_session_types) { + cJSON *allowed_session_types_local_nonprimitive; + if (!cJSON_IsArray(allowed_session_types)) { + ogs_error("OpenAPI_pdu_session_types_parseFromJSON() failed [allowed_session_types]"); + goto end; + } + + allowed_session_typesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_session_types_local_nonprimitive, allowed_session_types ) { + if (!cJSON_IsObject(allowed_session_types_local_nonprimitive)) { + ogs_error("OpenAPI_pdu_session_types_parseFromJSON() failed [allowed_session_types]"); + goto end; + } + OpenAPI_pdu_session_type_t *allowed_session_typesItem = OpenAPI_pdu_session_type_parseFromJSON(allowed_session_types_local_nonprimitive); + + OpenAPI_list_add(allowed_session_typesList, allowed_session_typesItem); + } + } + + pdu_session_types_local_var = OpenAPI_pdu_session_types_create ( + default_session_type_local_nonprim, + allowed_session_types ? allowed_session_typesList : NULL + ); + + return pdu_session_types_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/pdu_session_types.h b/lib/sbi/openapi/model/pdu_session_types.h new file mode 100644 index 0000000000..385869a253 --- /dev/null +++ b/lib/sbi/openapi/model/pdu_session_types.h @@ -0,0 +1,40 @@ +/* + * pdu_session_types.h + * + * + */ + +#ifndef _OpenAPI_pdu_session_types_H_ +#define _OpenAPI_pdu_session_types_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "pdu_session_type.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_pdu_session_types_s OpenAPI_pdu_session_types_t; +typedef struct OpenAPI_pdu_session_types_s { + struct OpenAPI_pdu_session_type_s *default_session_type; + OpenAPI_list_t *allowed_session_types; +} OpenAPI_pdu_session_types_t; + +OpenAPI_pdu_session_types_t *OpenAPI_pdu_session_types_create( + OpenAPI_pdu_session_type_t *default_session_type, + OpenAPI_list_t *allowed_session_types + ); +void OpenAPI_pdu_session_types_free(OpenAPI_pdu_session_types_t *pdu_session_types); +OpenAPI_pdu_session_types_t *OpenAPI_pdu_session_types_parseFromJSON(cJSON *pdu_session_typesJSON); +cJSON *OpenAPI_pdu_session_types_convertToJSON(OpenAPI_pdu_session_types_t *pdu_session_types); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_pdu_session_types_H_ */ + diff --git a/lib/sbi/openapi/model/pei_update_info.c b/lib/sbi/openapi/model/pei_update_info.c new file mode 100644 index 0000000000..366c2f8cbe --- /dev/null +++ b/lib/sbi/openapi/model/pei_update_info.c @@ -0,0 +1,76 @@ + +#include +#include +#include +#include "pei_update_info.h" + +OpenAPI_pei_update_info_t *OpenAPI_pei_update_info_create( + char *pei + ) +{ + OpenAPI_pei_update_info_t *pei_update_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_pei_update_info_t)); + if (!pei_update_info_local_var) { + return NULL; + } + pei_update_info_local_var->pei = pei; + + return pei_update_info_local_var; +} + +void OpenAPI_pei_update_info_free(OpenAPI_pei_update_info_t *pei_update_info) +{ + if (NULL == pei_update_info) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(pei_update_info->pei); + ogs_free(pei_update_info); +} + +cJSON *OpenAPI_pei_update_info_convertToJSON(OpenAPI_pei_update_info_t *pei_update_info) +{ + cJSON *item = NULL; + + if (pei_update_info == NULL) { + ogs_error("OpenAPI_pei_update_info_convertToJSON() failed [PeiUpdateInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!pei_update_info->pei) { + ogs_error("OpenAPI_pei_update_info_convertToJSON() failed [pei]"); + goto end; + } + if (cJSON_AddStringToObject(item, "pei", pei_update_info->pei) == NULL) { + ogs_error("OpenAPI_pei_update_info_convertToJSON() failed [pei]"); + goto end; + } + +end: + return item; +} + +OpenAPI_pei_update_info_t *OpenAPI_pei_update_info_parseFromJSON(cJSON *pei_update_infoJSON) +{ + OpenAPI_pei_update_info_t *pei_update_info_local_var = NULL; + cJSON *pei = cJSON_GetObjectItemCaseSensitive(pei_update_infoJSON, "pei"); + if (!pei) { + ogs_error("OpenAPI_pei_update_info_parseFromJSON() failed [pei]"); + goto end; + } + + + if (!cJSON_IsString(pei)) { + ogs_error("OpenAPI_pei_update_info_parseFromJSON() failed [pei]"); + goto end; + } + + pei_update_info_local_var = OpenAPI_pei_update_info_create ( + ogs_strdup(pei->valuestring) + ); + + return pei_update_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/pei_update_info.h b/lib/sbi/openapi/model/pei_update_info.h new file mode 100644 index 0000000000..4cbacb12aa --- /dev/null +++ b/lib/sbi/openapi/model/pei_update_info.h @@ -0,0 +1,37 @@ +/* + * pei_update_info.h + * + * + */ + +#ifndef _OpenAPI_pei_update_info_H_ +#define _OpenAPI_pei_update_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_pei_update_info_s OpenAPI_pei_update_info_t; +typedef struct OpenAPI_pei_update_info_s { + char *pei; +} OpenAPI_pei_update_info_t; + +OpenAPI_pei_update_info_t *OpenAPI_pei_update_info_create( + char *pei + ); +void OpenAPI_pei_update_info_free(OpenAPI_pei_update_info_t *pei_update_info); +OpenAPI_pei_update_info_t *OpenAPI_pei_update_info_parseFromJSON(cJSON *pei_update_infoJSON); +cJSON *OpenAPI_pei_update_info_convertToJSON(OpenAPI_pei_update_info_t *pei_update_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_pei_update_info_H_ */ + diff --git a/lib/sbi/openapi/model/periodicity.c b/lib/sbi/openapi/model/periodicity.c new file mode 100644 index 0000000000..0ea85f987c --- /dev/null +++ b/lib/sbi/openapi/model/periodicity.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "periodicity.h" + +OpenAPI_periodicity_t *OpenAPI_periodicity_create( + ) +{ + OpenAPI_periodicity_t *periodicity_local_var = OpenAPI_malloc(sizeof(OpenAPI_periodicity_t)); + if (!periodicity_local_var) { + return NULL; + } + + return periodicity_local_var; +} + +void OpenAPI_periodicity_free(OpenAPI_periodicity_t *periodicity) +{ + if (NULL == periodicity) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(periodicity); +} + +cJSON *OpenAPI_periodicity_convertToJSON(OpenAPI_periodicity_t *periodicity) +{ + cJSON *item = NULL; + + if (periodicity == NULL) { + ogs_error("OpenAPI_periodicity_convertToJSON() failed [Periodicity]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_periodicity_t *OpenAPI_periodicity_parseFromJSON(cJSON *periodicityJSON) +{ + OpenAPI_periodicity_t *periodicity_local_var = NULL; + periodicity_local_var = OpenAPI_periodicity_create ( + ); + + return periodicity_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/periodicity.h b/lib/sbi/openapi/model/periodicity.h new file mode 100644 index 0000000000..174be62ae7 --- /dev/null +++ b/lib/sbi/openapi/model/periodicity.h @@ -0,0 +1,35 @@ +/* + * periodicity.h + * + * + */ + +#ifndef _OpenAPI_periodicity_H_ +#define _OpenAPI_periodicity_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_periodicity_s OpenAPI_periodicity_t; +typedef struct OpenAPI_periodicity_s { +} OpenAPI_periodicity_t; + +OpenAPI_periodicity_t *OpenAPI_periodicity_create( + ); +void OpenAPI_periodicity_free(OpenAPI_periodicity_t *periodicity); +OpenAPI_periodicity_t *OpenAPI_periodicity_parseFromJSON(cJSON *periodicityJSON); +cJSON *OpenAPI_periodicity_convertToJSON(OpenAPI_periodicity_t *periodicity); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_periodicity_H_ */ + diff --git a/lib/sbi/openapi/model/pfd_change_notification.c b/lib/sbi/openapi/model/pfd_change_notification.c new file mode 100644 index 0000000000..dcb4004638 --- /dev/null +++ b/lib/sbi/openapi/model/pfd_change_notification.c @@ -0,0 +1,164 @@ + +#include +#include +#include +#include "pfd_change_notification.h" + +OpenAPI_pfd_change_notification_t *OpenAPI_pfd_change_notification_create( + char *application_id, + int removal_flag, + int partial_flag, + OpenAPI_list_t *pfds + ) +{ + OpenAPI_pfd_change_notification_t *pfd_change_notification_local_var = OpenAPI_malloc(sizeof(OpenAPI_pfd_change_notification_t)); + if (!pfd_change_notification_local_var) { + return NULL; + } + pfd_change_notification_local_var->application_id = application_id; + pfd_change_notification_local_var->removal_flag = removal_flag; + pfd_change_notification_local_var->partial_flag = partial_flag; + pfd_change_notification_local_var->pfds = pfds; + + return pfd_change_notification_local_var; +} + +void OpenAPI_pfd_change_notification_free(OpenAPI_pfd_change_notification_t *pfd_change_notification) +{ + if (NULL == pfd_change_notification) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(pfd_change_notification->application_id); + OpenAPI_list_for_each(pfd_change_notification->pfds, node) { + OpenAPI_pfd_content_free(node->data); + } + OpenAPI_list_free(pfd_change_notification->pfds); + ogs_free(pfd_change_notification); +} + +cJSON *OpenAPI_pfd_change_notification_convertToJSON(OpenAPI_pfd_change_notification_t *pfd_change_notification) +{ + cJSON *item = NULL; + + if (pfd_change_notification == NULL) { + ogs_error("OpenAPI_pfd_change_notification_convertToJSON() failed [PfdChangeNotification]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!pfd_change_notification->application_id) { + ogs_error("OpenAPI_pfd_change_notification_convertToJSON() failed [application_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "applicationId", pfd_change_notification->application_id) == NULL) { + ogs_error("OpenAPI_pfd_change_notification_convertToJSON() failed [application_id]"); + goto end; + } + + if (pfd_change_notification->removal_flag >= 0) { + if (cJSON_AddBoolToObject(item, "removalFlag", pfd_change_notification->removal_flag) == NULL) { + ogs_error("OpenAPI_pfd_change_notification_convertToJSON() failed [removal_flag]"); + goto end; + } + } + + if (pfd_change_notification->partial_flag >= 0) { + if (cJSON_AddBoolToObject(item, "partialFlag", pfd_change_notification->partial_flag) == NULL) { + ogs_error("OpenAPI_pfd_change_notification_convertToJSON() failed [partial_flag]"); + goto end; + } + } + + if (pfd_change_notification->pfds) { + cJSON *pfdsList = cJSON_AddArrayToObject(item, "pfds"); + if (pfdsList == NULL) { + ogs_error("OpenAPI_pfd_change_notification_convertToJSON() failed [pfds]"); + goto end; + } + + OpenAPI_lnode_t *pfds_node; + if (pfd_change_notification->pfds) { + OpenAPI_list_for_each(pfd_change_notification->pfds, pfds_node) { + cJSON *itemLocal = OpenAPI_pfd_content_convertToJSON(pfds_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_pfd_change_notification_convertToJSON() failed [pfds]"); + goto end; + } + cJSON_AddItemToArray(pfdsList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_pfd_change_notification_t *OpenAPI_pfd_change_notification_parseFromJSON(cJSON *pfd_change_notificationJSON) +{ + OpenAPI_pfd_change_notification_t *pfd_change_notification_local_var = NULL; + cJSON *application_id = cJSON_GetObjectItemCaseSensitive(pfd_change_notificationJSON, "applicationId"); + if (!application_id) { + ogs_error("OpenAPI_pfd_change_notification_parseFromJSON() failed [application_id]"); + goto end; + } + + + if (!cJSON_IsString(application_id)) { + ogs_error("OpenAPI_pfd_change_notification_parseFromJSON() failed [application_id]"); + goto end; + } + + cJSON *removal_flag = cJSON_GetObjectItemCaseSensitive(pfd_change_notificationJSON, "removalFlag"); + + if (removal_flag) { + if (!cJSON_IsBool(removal_flag)) { + ogs_error("OpenAPI_pfd_change_notification_parseFromJSON() failed [removal_flag]"); + goto end; + } + } + + cJSON *partial_flag = cJSON_GetObjectItemCaseSensitive(pfd_change_notificationJSON, "partialFlag"); + + if (partial_flag) { + if (!cJSON_IsBool(partial_flag)) { + ogs_error("OpenAPI_pfd_change_notification_parseFromJSON() failed [partial_flag]"); + goto end; + } + } + + cJSON *pfds = cJSON_GetObjectItemCaseSensitive(pfd_change_notificationJSON, "pfds"); + + OpenAPI_list_t *pfdsList; + if (pfds) { + cJSON *pfds_local_nonprimitive; + if (!cJSON_IsArray(pfds)) { + ogs_error("OpenAPI_pfd_change_notification_parseFromJSON() failed [pfds]"); + goto end; + } + + pfdsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pfds_local_nonprimitive, pfds ) { + if (!cJSON_IsObject(pfds_local_nonprimitive)) { + ogs_error("OpenAPI_pfd_change_notification_parseFromJSON() failed [pfds]"); + goto end; + } + OpenAPI_pfd_content_t *pfdsItem = OpenAPI_pfd_content_parseFromJSON(pfds_local_nonprimitive); + + OpenAPI_list_add(pfdsList, pfdsItem); + } + } + + pfd_change_notification_local_var = OpenAPI_pfd_change_notification_create ( + ogs_strdup(application_id->valuestring), + removal_flag ? removal_flag->valueint : 0, + partial_flag ? partial_flag->valueint : 0, + pfds ? pfdsList : NULL + ); + + return pfd_change_notification_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/pfd_change_notification.h b/lib/sbi/openapi/model/pfd_change_notification.h new file mode 100644 index 0000000000..a0999f7fb9 --- /dev/null +++ b/lib/sbi/openapi/model/pfd_change_notification.h @@ -0,0 +1,44 @@ +/* + * pfd_change_notification.h + * + * + */ + +#ifndef _OpenAPI_pfd_change_notification_H_ +#define _OpenAPI_pfd_change_notification_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "pfd_content.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_pfd_change_notification_s OpenAPI_pfd_change_notification_t; +typedef struct OpenAPI_pfd_change_notification_s { + char *application_id; + int removal_flag; + int partial_flag; + OpenAPI_list_t *pfds; +} OpenAPI_pfd_change_notification_t; + +OpenAPI_pfd_change_notification_t *OpenAPI_pfd_change_notification_create( + char *application_id, + int removal_flag, + int partial_flag, + OpenAPI_list_t *pfds + ); +void OpenAPI_pfd_change_notification_free(OpenAPI_pfd_change_notification_t *pfd_change_notification); +OpenAPI_pfd_change_notification_t *OpenAPI_pfd_change_notification_parseFromJSON(cJSON *pfd_change_notificationJSON); +cJSON *OpenAPI_pfd_change_notification_convertToJSON(OpenAPI_pfd_change_notification_t *pfd_change_notification); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_pfd_change_notification_H_ */ + diff --git a/lib/sbi/openapi/model/pfd_content.c b/lib/sbi/openapi/model/pfd_content.c new file mode 100644 index 0000000000..8ede9ca98c --- /dev/null +++ b/lib/sbi/openapi/model/pfd_content.c @@ -0,0 +1,224 @@ + +#include +#include +#include +#include "pfd_content.h" + +OpenAPI_pfd_content_t *OpenAPI_pfd_content_create( + char *pfd_id, + OpenAPI_list_t *flow_descriptions, + OpenAPI_list_t *urls, + OpenAPI_list_t *domain_names, + OpenAPI_domain_name_protocol_t *dn_protocol + ) +{ + OpenAPI_pfd_content_t *pfd_content_local_var = OpenAPI_malloc(sizeof(OpenAPI_pfd_content_t)); + if (!pfd_content_local_var) { + return NULL; + } + pfd_content_local_var->pfd_id = pfd_id; + pfd_content_local_var->flow_descriptions = flow_descriptions; + pfd_content_local_var->urls = urls; + pfd_content_local_var->domain_names = domain_names; + pfd_content_local_var->dn_protocol = dn_protocol; + + return pfd_content_local_var; +} + +void OpenAPI_pfd_content_free(OpenAPI_pfd_content_t *pfd_content) +{ + if (NULL == pfd_content) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(pfd_content->pfd_id); + OpenAPI_list_for_each(pfd_content->flow_descriptions, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pfd_content->flow_descriptions); + OpenAPI_list_for_each(pfd_content->urls, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pfd_content->urls); + OpenAPI_list_for_each(pfd_content->domain_names, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pfd_content->domain_names); + OpenAPI_domain_name_protocol_free(pfd_content->dn_protocol); + ogs_free(pfd_content); +} + +cJSON *OpenAPI_pfd_content_convertToJSON(OpenAPI_pfd_content_t *pfd_content) +{ + cJSON *item = NULL; + + if (pfd_content == NULL) { + ogs_error("OpenAPI_pfd_content_convertToJSON() failed [PfdContent]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (pfd_content->pfd_id) { + if (cJSON_AddStringToObject(item, "pfdId", pfd_content->pfd_id) == NULL) { + ogs_error("OpenAPI_pfd_content_convertToJSON() failed [pfd_id]"); + goto end; + } + } + + if (pfd_content->flow_descriptions) { + cJSON *flow_descriptions = cJSON_AddArrayToObject(item, "flowDescriptions"); + if (flow_descriptions == NULL) { + ogs_error("OpenAPI_pfd_content_convertToJSON() failed [flow_descriptions]"); + goto end; + } + + OpenAPI_lnode_t *flow_descriptions_node; + OpenAPI_list_for_each(pfd_content->flow_descriptions, flow_descriptions_node) { + if (cJSON_AddStringToObject(flow_descriptions, "", (char*)flow_descriptions_node->data) == NULL) { + ogs_error("OpenAPI_pfd_content_convertToJSON() failed [flow_descriptions]"); + goto end; + } + } + } + + if (pfd_content->urls) { + cJSON *urls = cJSON_AddArrayToObject(item, "urls"); + if (urls == NULL) { + ogs_error("OpenAPI_pfd_content_convertToJSON() failed [urls]"); + goto end; + } + + OpenAPI_lnode_t *urls_node; + OpenAPI_list_for_each(pfd_content->urls, urls_node) { + if (cJSON_AddStringToObject(urls, "", (char*)urls_node->data) == NULL) { + ogs_error("OpenAPI_pfd_content_convertToJSON() failed [urls]"); + goto end; + } + } + } + + if (pfd_content->domain_names) { + cJSON *domain_names = cJSON_AddArrayToObject(item, "domainNames"); + if (domain_names == NULL) { + ogs_error("OpenAPI_pfd_content_convertToJSON() failed [domain_names]"); + goto end; + } + + OpenAPI_lnode_t *domain_names_node; + OpenAPI_list_for_each(pfd_content->domain_names, domain_names_node) { + if (cJSON_AddStringToObject(domain_names, "", (char*)domain_names_node->data) == NULL) { + ogs_error("OpenAPI_pfd_content_convertToJSON() failed [domain_names]"); + goto end; + } + } + } + + if (pfd_content->dn_protocol) { + cJSON *dn_protocol_local_JSON = OpenAPI_domain_name_protocol_convertToJSON(pfd_content->dn_protocol); + if (dn_protocol_local_JSON == NULL) { + ogs_error("OpenAPI_pfd_content_convertToJSON() failed [dn_protocol]"); + goto end; + } + cJSON_AddItemToObject(item, "dnProtocol", dn_protocol_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_pfd_content_convertToJSON() failed [dn_protocol]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_pfd_content_t *OpenAPI_pfd_content_parseFromJSON(cJSON *pfd_contentJSON) +{ + OpenAPI_pfd_content_t *pfd_content_local_var = NULL; + cJSON *pfd_id = cJSON_GetObjectItemCaseSensitive(pfd_contentJSON, "pfdId"); + + if (pfd_id) { + if (!cJSON_IsString(pfd_id)) { + ogs_error("OpenAPI_pfd_content_parseFromJSON() failed [pfd_id]"); + goto end; + } + } + + cJSON *flow_descriptions = cJSON_GetObjectItemCaseSensitive(pfd_contentJSON, "flowDescriptions"); + + OpenAPI_list_t *flow_descriptionsList; + if (flow_descriptions) { + cJSON *flow_descriptions_local; + if (!cJSON_IsArray(flow_descriptions)) { + ogs_error("OpenAPI_pfd_content_parseFromJSON() failed [flow_descriptions]"); + goto end; + } + flow_descriptionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(flow_descriptions_local, flow_descriptions) { + if (!cJSON_IsString(flow_descriptions_local)) { + ogs_error("OpenAPI_pfd_content_parseFromJSON() failed [flow_descriptions]"); + goto end; + } + OpenAPI_list_add(flow_descriptionsList, ogs_strdup(flow_descriptions_local->valuestring)); + } + } + + cJSON *urls = cJSON_GetObjectItemCaseSensitive(pfd_contentJSON, "urls"); + + OpenAPI_list_t *urlsList; + if (urls) { + cJSON *urls_local; + if (!cJSON_IsArray(urls)) { + ogs_error("OpenAPI_pfd_content_parseFromJSON() failed [urls]"); + goto end; + } + urlsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(urls_local, urls) { + if (!cJSON_IsString(urls_local)) { + ogs_error("OpenAPI_pfd_content_parseFromJSON() failed [urls]"); + goto end; + } + OpenAPI_list_add(urlsList, ogs_strdup(urls_local->valuestring)); + } + } + + cJSON *domain_names = cJSON_GetObjectItemCaseSensitive(pfd_contentJSON, "domainNames"); + + OpenAPI_list_t *domain_namesList; + if (domain_names) { + cJSON *domain_names_local; + if (!cJSON_IsArray(domain_names)) { + ogs_error("OpenAPI_pfd_content_parseFromJSON() failed [domain_names]"); + goto end; + } + domain_namesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(domain_names_local, domain_names) { + if (!cJSON_IsString(domain_names_local)) { + ogs_error("OpenAPI_pfd_content_parseFromJSON() failed [domain_names]"); + goto end; + } + OpenAPI_list_add(domain_namesList, ogs_strdup(domain_names_local->valuestring)); + } + } + + cJSON *dn_protocol = cJSON_GetObjectItemCaseSensitive(pfd_contentJSON, "dnProtocol"); + + OpenAPI_domain_name_protocol_t *dn_protocol_local_nonprim = NULL; + if (dn_protocol) { + dn_protocol_local_nonprim = OpenAPI_domain_name_protocol_parseFromJSON(dn_protocol); + } + + pfd_content_local_var = OpenAPI_pfd_content_create ( + pfd_id ? ogs_strdup(pfd_id->valuestring) : NULL, + flow_descriptions ? flow_descriptionsList : NULL, + urls ? urlsList : NULL, + domain_names ? domain_namesList : NULL, + dn_protocol ? dn_protocol_local_nonprim : NULL + ); + + return pfd_content_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/pfd_content.h b/lib/sbi/openapi/model/pfd_content.h new file mode 100644 index 0000000000..6b5fc55f7a --- /dev/null +++ b/lib/sbi/openapi/model/pfd_content.h @@ -0,0 +1,46 @@ +/* + * pfd_content.h + * + * + */ + +#ifndef _OpenAPI_pfd_content_H_ +#define _OpenAPI_pfd_content_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "domain_name_protocol.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_pfd_content_s OpenAPI_pfd_content_t; +typedef struct OpenAPI_pfd_content_s { + char *pfd_id; + OpenAPI_list_t *flow_descriptions; + OpenAPI_list_t *urls; + OpenAPI_list_t *domain_names; + struct OpenAPI_domain_name_protocol_s *dn_protocol; +} OpenAPI_pfd_content_t; + +OpenAPI_pfd_content_t *OpenAPI_pfd_content_create( + char *pfd_id, + OpenAPI_list_t *flow_descriptions, + OpenAPI_list_t *urls, + OpenAPI_list_t *domain_names, + OpenAPI_domain_name_protocol_t *dn_protocol + ); +void OpenAPI_pfd_content_free(OpenAPI_pfd_content_t *pfd_content); +OpenAPI_pfd_content_t *OpenAPI_pfd_content_parseFromJSON(cJSON *pfd_contentJSON); +cJSON *OpenAPI_pfd_content_convertToJSON(OpenAPI_pfd_content_t *pfd_content); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_pfd_content_H_ */ + diff --git a/lib/sbi/openapi/model/pfd_data.c b/lib/sbi/openapi/model/pfd_data.c new file mode 100644 index 0000000000..16d525c2a7 --- /dev/null +++ b/lib/sbi/openapi/model/pfd_data.c @@ -0,0 +1,137 @@ + +#include +#include +#include +#include "pfd_data.h" + +OpenAPI_pfd_data_t *OpenAPI_pfd_data_create( + OpenAPI_list_t *app_ids, + OpenAPI_list_t *af_ids + ) +{ + OpenAPI_pfd_data_t *pfd_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_pfd_data_t)); + if (!pfd_data_local_var) { + return NULL; + } + pfd_data_local_var->app_ids = app_ids; + pfd_data_local_var->af_ids = af_ids; + + return pfd_data_local_var; +} + +void OpenAPI_pfd_data_free(OpenAPI_pfd_data_t *pfd_data) +{ + if (NULL == pfd_data) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(pfd_data->app_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pfd_data->app_ids); + OpenAPI_list_for_each(pfd_data->af_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pfd_data->af_ids); + ogs_free(pfd_data); +} + +cJSON *OpenAPI_pfd_data_convertToJSON(OpenAPI_pfd_data_t *pfd_data) +{ + cJSON *item = NULL; + + if (pfd_data == NULL) { + ogs_error("OpenAPI_pfd_data_convertToJSON() failed [PfdData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (pfd_data->app_ids) { + cJSON *app_ids = cJSON_AddArrayToObject(item, "appIds"); + if (app_ids == NULL) { + ogs_error("OpenAPI_pfd_data_convertToJSON() failed [app_ids]"); + goto end; + } + + OpenAPI_lnode_t *app_ids_node; + OpenAPI_list_for_each(pfd_data->app_ids, app_ids_node) { + if (cJSON_AddStringToObject(app_ids, "", (char*)app_ids_node->data) == NULL) { + ogs_error("OpenAPI_pfd_data_convertToJSON() failed [app_ids]"); + goto end; + } + } + } + + if (pfd_data->af_ids) { + cJSON *af_ids = cJSON_AddArrayToObject(item, "afIds"); + if (af_ids == NULL) { + ogs_error("OpenAPI_pfd_data_convertToJSON() failed [af_ids]"); + goto end; + } + + OpenAPI_lnode_t *af_ids_node; + OpenAPI_list_for_each(pfd_data->af_ids, af_ids_node) { + if (cJSON_AddStringToObject(af_ids, "", (char*)af_ids_node->data) == NULL) { + ogs_error("OpenAPI_pfd_data_convertToJSON() failed [af_ids]"); + goto end; + } + } + } + +end: + return item; +} + +OpenAPI_pfd_data_t *OpenAPI_pfd_data_parseFromJSON(cJSON *pfd_dataJSON) +{ + OpenAPI_pfd_data_t *pfd_data_local_var = NULL; + cJSON *app_ids = cJSON_GetObjectItemCaseSensitive(pfd_dataJSON, "appIds"); + + OpenAPI_list_t *app_idsList; + if (app_ids) { + cJSON *app_ids_local; + if (!cJSON_IsArray(app_ids)) { + ogs_error("OpenAPI_pfd_data_parseFromJSON() failed [app_ids]"); + goto end; + } + app_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(app_ids_local, app_ids) { + if (!cJSON_IsString(app_ids_local)) { + ogs_error("OpenAPI_pfd_data_parseFromJSON() failed [app_ids]"); + goto end; + } + OpenAPI_list_add(app_idsList, ogs_strdup(app_ids_local->valuestring)); + } + } + + cJSON *af_ids = cJSON_GetObjectItemCaseSensitive(pfd_dataJSON, "afIds"); + + OpenAPI_list_t *af_idsList; + if (af_ids) { + cJSON *af_ids_local; + if (!cJSON_IsArray(af_ids)) { + ogs_error("OpenAPI_pfd_data_parseFromJSON() failed [af_ids]"); + goto end; + } + af_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(af_ids_local, af_ids) { + if (!cJSON_IsString(af_ids_local)) { + ogs_error("OpenAPI_pfd_data_parseFromJSON() failed [af_ids]"); + goto end; + } + OpenAPI_list_add(af_idsList, ogs_strdup(af_ids_local->valuestring)); + } + } + + pfd_data_local_var = OpenAPI_pfd_data_create ( + app_ids ? app_idsList : NULL, + af_ids ? af_idsList : NULL + ); + + return pfd_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/pfd_data.h b/lib/sbi/openapi/model/pfd_data.h new file mode 100644 index 0000000000..9676be8aa3 --- /dev/null +++ b/lib/sbi/openapi/model/pfd_data.h @@ -0,0 +1,39 @@ +/* + * pfd_data.h + * + * List of Application IDs and/or AF IDs managed by a given NEF Instance + */ + +#ifndef _OpenAPI_pfd_data_H_ +#define _OpenAPI_pfd_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_pfd_data_s OpenAPI_pfd_data_t; +typedef struct OpenAPI_pfd_data_s { + OpenAPI_list_t *app_ids; + OpenAPI_list_t *af_ids; +} OpenAPI_pfd_data_t; + +OpenAPI_pfd_data_t *OpenAPI_pfd_data_create( + OpenAPI_list_t *app_ids, + OpenAPI_list_t *af_ids + ); +void OpenAPI_pfd_data_free(OpenAPI_pfd_data_t *pfd_data); +OpenAPI_pfd_data_t *OpenAPI_pfd_data_parseFromJSON(cJSON *pfd_dataJSON); +cJSON *OpenAPI_pfd_data_convertToJSON(OpenAPI_pfd_data_t *pfd_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_pfd_data_H_ */ + diff --git a/lib/sbi/openapi/model/pfd_data_for_app.c b/lib/sbi/openapi/model/pfd_data_for_app.c new file mode 100644 index 0000000000..83ac31bfa0 --- /dev/null +++ b/lib/sbi/openapi/model/pfd_data_for_app.c @@ -0,0 +1,151 @@ + +#include +#include +#include +#include "pfd_data_for_app.h" + +OpenAPI_pfd_data_for_app_t *OpenAPI_pfd_data_for_app_create( + char *application_id, + OpenAPI_list_t *pfds, + char *caching_time + ) +{ + OpenAPI_pfd_data_for_app_t *pfd_data_for_app_local_var = OpenAPI_malloc(sizeof(OpenAPI_pfd_data_for_app_t)); + if (!pfd_data_for_app_local_var) { + return NULL; + } + pfd_data_for_app_local_var->application_id = application_id; + pfd_data_for_app_local_var->pfds = pfds; + pfd_data_for_app_local_var->caching_time = caching_time; + + return pfd_data_for_app_local_var; +} + +void OpenAPI_pfd_data_for_app_free(OpenAPI_pfd_data_for_app_t *pfd_data_for_app) +{ + if (NULL == pfd_data_for_app) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(pfd_data_for_app->application_id); + OpenAPI_list_for_each(pfd_data_for_app->pfds, node) { + OpenAPI_pfd_content_free(node->data); + } + OpenAPI_list_free(pfd_data_for_app->pfds); + ogs_free(pfd_data_for_app->caching_time); + ogs_free(pfd_data_for_app); +} + +cJSON *OpenAPI_pfd_data_for_app_convertToJSON(OpenAPI_pfd_data_for_app_t *pfd_data_for_app) +{ + cJSON *item = NULL; + + if (pfd_data_for_app == NULL) { + ogs_error("OpenAPI_pfd_data_for_app_convertToJSON() failed [PfdDataForApp]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!pfd_data_for_app->application_id) { + ogs_error("OpenAPI_pfd_data_for_app_convertToJSON() failed [application_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "applicationId", pfd_data_for_app->application_id) == NULL) { + ogs_error("OpenAPI_pfd_data_for_app_convertToJSON() failed [application_id]"); + goto end; + } + + if (!pfd_data_for_app->pfds) { + ogs_error("OpenAPI_pfd_data_for_app_convertToJSON() failed [pfds]"); + goto end; + } + cJSON *pfdsList = cJSON_AddArrayToObject(item, "pfds"); + if (pfdsList == NULL) { + ogs_error("OpenAPI_pfd_data_for_app_convertToJSON() failed [pfds]"); + goto end; + } + + OpenAPI_lnode_t *pfds_node; + if (pfd_data_for_app->pfds) { + OpenAPI_list_for_each(pfd_data_for_app->pfds, pfds_node) { + cJSON *itemLocal = OpenAPI_pfd_content_convertToJSON(pfds_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_pfd_data_for_app_convertToJSON() failed [pfds]"); + goto end; + } + cJSON_AddItemToArray(pfdsList, itemLocal); + } + } + + if (pfd_data_for_app->caching_time) { + if (cJSON_AddStringToObject(item, "cachingTime", pfd_data_for_app->caching_time) == NULL) { + ogs_error("OpenAPI_pfd_data_for_app_convertToJSON() failed [caching_time]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_pfd_data_for_app_t *OpenAPI_pfd_data_for_app_parseFromJSON(cJSON *pfd_data_for_appJSON) +{ + OpenAPI_pfd_data_for_app_t *pfd_data_for_app_local_var = NULL; + cJSON *application_id = cJSON_GetObjectItemCaseSensitive(pfd_data_for_appJSON, "applicationId"); + if (!application_id) { + ogs_error("OpenAPI_pfd_data_for_app_parseFromJSON() failed [application_id]"); + goto end; + } + + + if (!cJSON_IsString(application_id)) { + ogs_error("OpenAPI_pfd_data_for_app_parseFromJSON() failed [application_id]"); + goto end; + } + + cJSON *pfds = cJSON_GetObjectItemCaseSensitive(pfd_data_for_appJSON, "pfds"); + if (!pfds) { + ogs_error("OpenAPI_pfd_data_for_app_parseFromJSON() failed [pfds]"); + goto end; + } + + OpenAPI_list_t *pfdsList; + + cJSON *pfds_local_nonprimitive; + if (!cJSON_IsArray(pfds)) { + ogs_error("OpenAPI_pfd_data_for_app_parseFromJSON() failed [pfds]"); + goto end; + } + + pfdsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pfds_local_nonprimitive, pfds ) { + if (!cJSON_IsObject(pfds_local_nonprimitive)) { + ogs_error("OpenAPI_pfd_data_for_app_parseFromJSON() failed [pfds]"); + goto end; + } + OpenAPI_pfd_content_t *pfdsItem = OpenAPI_pfd_content_parseFromJSON(pfds_local_nonprimitive); + + OpenAPI_list_add(pfdsList, pfdsItem); + } + + cJSON *caching_time = cJSON_GetObjectItemCaseSensitive(pfd_data_for_appJSON, "cachingTime"); + + if (caching_time) { + if (!cJSON_IsString(caching_time)) { + ogs_error("OpenAPI_pfd_data_for_app_parseFromJSON() failed [caching_time]"); + goto end; + } + } + + pfd_data_for_app_local_var = OpenAPI_pfd_data_for_app_create ( + ogs_strdup(application_id->valuestring), + pfdsList, + caching_time ? ogs_strdup(caching_time->valuestring) : NULL + ); + + return pfd_data_for_app_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/pfd_data_for_app.h b/lib/sbi/openapi/model/pfd_data_for_app.h new file mode 100644 index 0000000000..b8b9742e25 --- /dev/null +++ b/lib/sbi/openapi/model/pfd_data_for_app.h @@ -0,0 +1,42 @@ +/* + * pfd_data_for_app.h + * + * + */ + +#ifndef _OpenAPI_pfd_data_for_app_H_ +#define _OpenAPI_pfd_data_for_app_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "pfd_content.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_pfd_data_for_app_s OpenAPI_pfd_data_for_app_t; +typedef struct OpenAPI_pfd_data_for_app_s { + char *application_id; + OpenAPI_list_t *pfds; + char *caching_time; +} OpenAPI_pfd_data_for_app_t; + +OpenAPI_pfd_data_for_app_t *OpenAPI_pfd_data_for_app_create( + char *application_id, + OpenAPI_list_t *pfds, + char *caching_time + ); +void OpenAPI_pfd_data_for_app_free(OpenAPI_pfd_data_for_app_t *pfd_data_for_app); +OpenAPI_pfd_data_for_app_t *OpenAPI_pfd_data_for_app_parseFromJSON(cJSON *pfd_data_for_appJSON); +cJSON *OpenAPI_pfd_data_for_app_convertToJSON(OpenAPI_pfd_data_for_app_t *pfd_data_for_app); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_pfd_data_for_app_H_ */ + diff --git a/lib/sbi/openapi/model/pfd_data_for_app_ext.c b/lib/sbi/openapi/model/pfd_data_for_app_ext.c new file mode 100644 index 0000000000..40d4c45abd --- /dev/null +++ b/lib/sbi/openapi/model/pfd_data_for_app_ext.c @@ -0,0 +1,171 @@ + +#include +#include +#include +#include "pfd_data_for_app_ext.h" + +OpenAPI_pfd_data_for_app_ext_t *OpenAPI_pfd_data_for_app_ext_create( + char *application_id, + OpenAPI_list_t *pfds, + char *caching_time, + char *supp_feat + ) +{ + OpenAPI_pfd_data_for_app_ext_t *pfd_data_for_app_ext_local_var = OpenAPI_malloc(sizeof(OpenAPI_pfd_data_for_app_ext_t)); + if (!pfd_data_for_app_ext_local_var) { + return NULL; + } + pfd_data_for_app_ext_local_var->application_id = application_id; + pfd_data_for_app_ext_local_var->pfds = pfds; + pfd_data_for_app_ext_local_var->caching_time = caching_time; + pfd_data_for_app_ext_local_var->supp_feat = supp_feat; + + return pfd_data_for_app_ext_local_var; +} + +void OpenAPI_pfd_data_for_app_ext_free(OpenAPI_pfd_data_for_app_ext_t *pfd_data_for_app_ext) +{ + if (NULL == pfd_data_for_app_ext) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(pfd_data_for_app_ext->application_id); + OpenAPI_list_for_each(pfd_data_for_app_ext->pfds, node) { + OpenAPI_pfd_content_free(node->data); + } + OpenAPI_list_free(pfd_data_for_app_ext->pfds); + ogs_free(pfd_data_for_app_ext->caching_time); + ogs_free(pfd_data_for_app_ext->supp_feat); + ogs_free(pfd_data_for_app_ext); +} + +cJSON *OpenAPI_pfd_data_for_app_ext_convertToJSON(OpenAPI_pfd_data_for_app_ext_t *pfd_data_for_app_ext) +{ + cJSON *item = NULL; + + if (pfd_data_for_app_ext == NULL) { + ogs_error("OpenAPI_pfd_data_for_app_ext_convertToJSON() failed [PfdDataForAppExt]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!pfd_data_for_app_ext->application_id) { + ogs_error("OpenAPI_pfd_data_for_app_ext_convertToJSON() failed [application_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "applicationId", pfd_data_for_app_ext->application_id) == NULL) { + ogs_error("OpenAPI_pfd_data_for_app_ext_convertToJSON() failed [application_id]"); + goto end; + } + + if (!pfd_data_for_app_ext->pfds) { + ogs_error("OpenAPI_pfd_data_for_app_ext_convertToJSON() failed [pfds]"); + goto end; + } + cJSON *pfdsList = cJSON_AddArrayToObject(item, "pfds"); + if (pfdsList == NULL) { + ogs_error("OpenAPI_pfd_data_for_app_ext_convertToJSON() failed [pfds]"); + goto end; + } + + OpenAPI_lnode_t *pfds_node; + if (pfd_data_for_app_ext->pfds) { + OpenAPI_list_for_each(pfd_data_for_app_ext->pfds, pfds_node) { + cJSON *itemLocal = OpenAPI_pfd_content_convertToJSON(pfds_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_pfd_data_for_app_ext_convertToJSON() failed [pfds]"); + goto end; + } + cJSON_AddItemToArray(pfdsList, itemLocal); + } + } + + if (pfd_data_for_app_ext->caching_time) { + if (cJSON_AddStringToObject(item, "cachingTime", pfd_data_for_app_ext->caching_time) == NULL) { + ogs_error("OpenAPI_pfd_data_for_app_ext_convertToJSON() failed [caching_time]"); + goto end; + } + } + + if (pfd_data_for_app_ext->supp_feat) { + if (cJSON_AddStringToObject(item, "suppFeat", pfd_data_for_app_ext->supp_feat) == NULL) { + ogs_error("OpenAPI_pfd_data_for_app_ext_convertToJSON() failed [supp_feat]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_pfd_data_for_app_ext_t *OpenAPI_pfd_data_for_app_ext_parseFromJSON(cJSON *pfd_data_for_app_extJSON) +{ + OpenAPI_pfd_data_for_app_ext_t *pfd_data_for_app_ext_local_var = NULL; + cJSON *application_id = cJSON_GetObjectItemCaseSensitive(pfd_data_for_app_extJSON, "applicationId"); + if (!application_id) { + ogs_error("OpenAPI_pfd_data_for_app_ext_parseFromJSON() failed [application_id]"); + goto end; + } + + + if (!cJSON_IsString(application_id)) { + ogs_error("OpenAPI_pfd_data_for_app_ext_parseFromJSON() failed [application_id]"); + goto end; + } + + cJSON *pfds = cJSON_GetObjectItemCaseSensitive(pfd_data_for_app_extJSON, "pfds"); + if (!pfds) { + ogs_error("OpenAPI_pfd_data_for_app_ext_parseFromJSON() failed [pfds]"); + goto end; + } + + OpenAPI_list_t *pfdsList; + + cJSON *pfds_local_nonprimitive; + if (!cJSON_IsArray(pfds)) { + ogs_error("OpenAPI_pfd_data_for_app_ext_parseFromJSON() failed [pfds]"); + goto end; + } + + pfdsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pfds_local_nonprimitive, pfds ) { + if (!cJSON_IsObject(pfds_local_nonprimitive)) { + ogs_error("OpenAPI_pfd_data_for_app_ext_parseFromJSON() failed [pfds]"); + goto end; + } + OpenAPI_pfd_content_t *pfdsItem = OpenAPI_pfd_content_parseFromJSON(pfds_local_nonprimitive); + + OpenAPI_list_add(pfdsList, pfdsItem); + } + + cJSON *caching_time = cJSON_GetObjectItemCaseSensitive(pfd_data_for_app_extJSON, "cachingTime"); + + if (caching_time) { + if (!cJSON_IsString(caching_time)) { + ogs_error("OpenAPI_pfd_data_for_app_ext_parseFromJSON() failed [caching_time]"); + goto end; + } + } + + cJSON *supp_feat = cJSON_GetObjectItemCaseSensitive(pfd_data_for_app_extJSON, "suppFeat"); + + if (supp_feat) { + if (!cJSON_IsString(supp_feat)) { + ogs_error("OpenAPI_pfd_data_for_app_ext_parseFromJSON() failed [supp_feat]"); + goto end; + } + } + + pfd_data_for_app_ext_local_var = OpenAPI_pfd_data_for_app_ext_create ( + ogs_strdup(application_id->valuestring), + pfdsList, + caching_time ? ogs_strdup(caching_time->valuestring) : NULL, + supp_feat ? ogs_strdup(supp_feat->valuestring) : NULL + ); + + return pfd_data_for_app_ext_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/pfd_data_for_app_ext.h b/lib/sbi/openapi/model/pfd_data_for_app_ext.h new file mode 100644 index 0000000000..cfbfdd9790 --- /dev/null +++ b/lib/sbi/openapi/model/pfd_data_for_app_ext.h @@ -0,0 +1,46 @@ +/* + * pfd_data_for_app_ext.h + * + * + */ + +#ifndef _OpenAPI_pfd_data_for_app_ext_H_ +#define _OpenAPI_pfd_data_for_app_ext_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "pfd_content.h" +#include "pfd_data_for_app.h" +#include "pfd_data_for_app_ext_all_of.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_pfd_data_for_app_ext_s OpenAPI_pfd_data_for_app_ext_t; +typedef struct OpenAPI_pfd_data_for_app_ext_s { + char *application_id; + OpenAPI_list_t *pfds; + char *caching_time; + char *supp_feat; +} OpenAPI_pfd_data_for_app_ext_t; + +OpenAPI_pfd_data_for_app_ext_t *OpenAPI_pfd_data_for_app_ext_create( + char *application_id, + OpenAPI_list_t *pfds, + char *caching_time, + char *supp_feat + ); +void OpenAPI_pfd_data_for_app_ext_free(OpenAPI_pfd_data_for_app_ext_t *pfd_data_for_app_ext); +OpenAPI_pfd_data_for_app_ext_t *OpenAPI_pfd_data_for_app_ext_parseFromJSON(cJSON *pfd_data_for_app_extJSON); +cJSON *OpenAPI_pfd_data_for_app_ext_convertToJSON(OpenAPI_pfd_data_for_app_ext_t *pfd_data_for_app_ext); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_pfd_data_for_app_ext_H_ */ + diff --git a/lib/sbi/openapi/model/pfd_data_for_app_ext_all_of.c b/lib/sbi/openapi/model/pfd_data_for_app_ext_all_of.c new file mode 100644 index 0000000000..d684855a49 --- /dev/null +++ b/lib/sbi/openapi/model/pfd_data_for_app_ext_all_of.c @@ -0,0 +1,71 @@ + +#include +#include +#include +#include "pfd_data_for_app_ext_all_of.h" + +OpenAPI_pfd_data_for_app_ext_all_of_t *OpenAPI_pfd_data_for_app_ext_all_of_create( + char *supp_feat + ) +{ + OpenAPI_pfd_data_for_app_ext_all_of_t *pfd_data_for_app_ext_all_of_local_var = OpenAPI_malloc(sizeof(OpenAPI_pfd_data_for_app_ext_all_of_t)); + if (!pfd_data_for_app_ext_all_of_local_var) { + return NULL; + } + pfd_data_for_app_ext_all_of_local_var->supp_feat = supp_feat; + + return pfd_data_for_app_ext_all_of_local_var; +} + +void OpenAPI_pfd_data_for_app_ext_all_of_free(OpenAPI_pfd_data_for_app_ext_all_of_t *pfd_data_for_app_ext_all_of) +{ + if (NULL == pfd_data_for_app_ext_all_of) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(pfd_data_for_app_ext_all_of->supp_feat); + ogs_free(pfd_data_for_app_ext_all_of); +} + +cJSON *OpenAPI_pfd_data_for_app_ext_all_of_convertToJSON(OpenAPI_pfd_data_for_app_ext_all_of_t *pfd_data_for_app_ext_all_of) +{ + cJSON *item = NULL; + + if (pfd_data_for_app_ext_all_of == NULL) { + ogs_error("OpenAPI_pfd_data_for_app_ext_all_of_convertToJSON() failed [PfdDataForAppExt_allOf]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (pfd_data_for_app_ext_all_of->supp_feat) { + if (cJSON_AddStringToObject(item, "suppFeat", pfd_data_for_app_ext_all_of->supp_feat) == NULL) { + ogs_error("OpenAPI_pfd_data_for_app_ext_all_of_convertToJSON() failed [supp_feat]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_pfd_data_for_app_ext_all_of_t *OpenAPI_pfd_data_for_app_ext_all_of_parseFromJSON(cJSON *pfd_data_for_app_ext_all_ofJSON) +{ + OpenAPI_pfd_data_for_app_ext_all_of_t *pfd_data_for_app_ext_all_of_local_var = NULL; + cJSON *supp_feat = cJSON_GetObjectItemCaseSensitive(pfd_data_for_app_ext_all_ofJSON, "suppFeat"); + + if (supp_feat) { + if (!cJSON_IsString(supp_feat)) { + ogs_error("OpenAPI_pfd_data_for_app_ext_all_of_parseFromJSON() failed [supp_feat]"); + goto end; + } + } + + pfd_data_for_app_ext_all_of_local_var = OpenAPI_pfd_data_for_app_ext_all_of_create ( + supp_feat ? ogs_strdup(supp_feat->valuestring) : NULL + ); + + return pfd_data_for_app_ext_all_of_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/pfd_data_for_app_ext_all_of.h b/lib/sbi/openapi/model/pfd_data_for_app_ext_all_of.h new file mode 100644 index 0000000000..457f857104 --- /dev/null +++ b/lib/sbi/openapi/model/pfd_data_for_app_ext_all_of.h @@ -0,0 +1,37 @@ +/* + * pfd_data_for_app_ext_all_of.h + * + * + */ + +#ifndef _OpenAPI_pfd_data_for_app_ext_all_of_H_ +#define _OpenAPI_pfd_data_for_app_ext_all_of_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_pfd_data_for_app_ext_all_of_s OpenAPI_pfd_data_for_app_ext_all_of_t; +typedef struct OpenAPI_pfd_data_for_app_ext_all_of_s { + char *supp_feat; +} OpenAPI_pfd_data_for_app_ext_all_of_t; + +OpenAPI_pfd_data_for_app_ext_all_of_t *OpenAPI_pfd_data_for_app_ext_all_of_create( + char *supp_feat + ); +void OpenAPI_pfd_data_for_app_ext_all_of_free(OpenAPI_pfd_data_for_app_ext_all_of_t *pfd_data_for_app_ext_all_of); +OpenAPI_pfd_data_for_app_ext_all_of_t *OpenAPI_pfd_data_for_app_ext_all_of_parseFromJSON(cJSON *pfd_data_for_app_ext_all_ofJSON); +cJSON *OpenAPI_pfd_data_for_app_ext_all_of_convertToJSON(OpenAPI_pfd_data_for_app_ext_all_of_t *pfd_data_for_app_ext_all_of); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_pfd_data_for_app_ext_all_of_H_ */ + diff --git a/lib/sbi/openapi/model/pgw_info.c b/lib/sbi/openapi/model/pgw_info.c new file mode 100644 index 0000000000..d0441c275c --- /dev/null +++ b/lib/sbi/openapi/model/pgw_info.c @@ -0,0 +1,125 @@ + +#include +#include +#include +#include "pgw_info.h" + +OpenAPI_pgw_info_t *OpenAPI_pgw_info_create( + char *dnn, + char *pgw_fqdn, + OpenAPI_plmn_id_t *plmn_id + ) +{ + OpenAPI_pgw_info_t *pgw_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_pgw_info_t)); + if (!pgw_info_local_var) { + return NULL; + } + pgw_info_local_var->dnn = dnn; + pgw_info_local_var->pgw_fqdn = pgw_fqdn; + pgw_info_local_var->plmn_id = plmn_id; + + return pgw_info_local_var; +} + +void OpenAPI_pgw_info_free(OpenAPI_pgw_info_t *pgw_info) +{ + if (NULL == pgw_info) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(pgw_info->dnn); + ogs_free(pgw_info->pgw_fqdn); + OpenAPI_plmn_id_free(pgw_info->plmn_id); + ogs_free(pgw_info); +} + +cJSON *OpenAPI_pgw_info_convertToJSON(OpenAPI_pgw_info_t *pgw_info) +{ + cJSON *item = NULL; + + if (pgw_info == NULL) { + ogs_error("OpenAPI_pgw_info_convertToJSON() failed [PgwInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!pgw_info->dnn) { + ogs_error("OpenAPI_pgw_info_convertToJSON() failed [dnn]"); + goto end; + } + if (cJSON_AddStringToObject(item, "dnn", pgw_info->dnn) == NULL) { + ogs_error("OpenAPI_pgw_info_convertToJSON() failed [dnn]"); + goto end; + } + + if (!pgw_info->pgw_fqdn) { + ogs_error("OpenAPI_pgw_info_convertToJSON() failed [pgw_fqdn]"); + goto end; + } + if (cJSON_AddStringToObject(item, "pgwFqdn", pgw_info->pgw_fqdn) == NULL) { + ogs_error("OpenAPI_pgw_info_convertToJSON() failed [pgw_fqdn]"); + goto end; + } + + if (pgw_info->plmn_id) { + cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_convertToJSON(pgw_info->plmn_id); + if (plmn_id_local_JSON == NULL) { + ogs_error("OpenAPI_pgw_info_convertToJSON() failed [plmn_id]"); + goto end; + } + cJSON_AddItemToObject(item, "plmnId", plmn_id_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_pgw_info_convertToJSON() failed [plmn_id]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_pgw_info_t *OpenAPI_pgw_info_parseFromJSON(cJSON *pgw_infoJSON) +{ + OpenAPI_pgw_info_t *pgw_info_local_var = NULL; + cJSON *dnn = cJSON_GetObjectItemCaseSensitive(pgw_infoJSON, "dnn"); + if (!dnn) { + ogs_error("OpenAPI_pgw_info_parseFromJSON() failed [dnn]"); + goto end; + } + + + if (!cJSON_IsString(dnn)) { + ogs_error("OpenAPI_pgw_info_parseFromJSON() failed [dnn]"); + goto end; + } + + cJSON *pgw_fqdn = cJSON_GetObjectItemCaseSensitive(pgw_infoJSON, "pgwFqdn"); + if (!pgw_fqdn) { + ogs_error("OpenAPI_pgw_info_parseFromJSON() failed [pgw_fqdn]"); + goto end; + } + + + if (!cJSON_IsString(pgw_fqdn)) { + ogs_error("OpenAPI_pgw_info_parseFromJSON() failed [pgw_fqdn]"); + goto end; + } + + cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(pgw_infoJSON, "plmnId"); + + OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + if (plmn_id) { + plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); + } + + pgw_info_local_var = OpenAPI_pgw_info_create ( + ogs_strdup(dnn->valuestring), + ogs_strdup(pgw_fqdn->valuestring), + plmn_id ? plmn_id_local_nonprim : NULL + ); + + return pgw_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/pgw_info.h b/lib/sbi/openapi/model/pgw_info.h new file mode 100644 index 0000000000..70c39a18d9 --- /dev/null +++ b/lib/sbi/openapi/model/pgw_info.h @@ -0,0 +1,42 @@ +/* + * pgw_info.h + * + * + */ + +#ifndef _OpenAPI_pgw_info_H_ +#define _OpenAPI_pgw_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "plmn_id.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_pgw_info_s OpenAPI_pgw_info_t; +typedef struct OpenAPI_pgw_info_s { + char *dnn; + char *pgw_fqdn; + struct OpenAPI_plmn_id_s *plmn_id; +} OpenAPI_pgw_info_t; + +OpenAPI_pgw_info_t *OpenAPI_pgw_info_create( + char *dnn, + char *pgw_fqdn, + OpenAPI_plmn_id_t *plmn_id + ); +void OpenAPI_pgw_info_free(OpenAPI_pgw_info_t *pgw_info); +OpenAPI_pgw_info_t *OpenAPI_pgw_info_parseFromJSON(cJSON *pgw_infoJSON); +cJSON *OpenAPI_pgw_info_convertToJSON(OpenAPI_pgw_info_t *pgw_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_pgw_info_H_ */ + diff --git a/lib/sbi/openapi/model/plmn_ec_info.c b/lib/sbi/openapi/model/plmn_ec_info.c new file mode 100644 index 0000000000..1650faf83a --- /dev/null +++ b/lib/sbi/openapi/model/plmn_ec_info.c @@ -0,0 +1,118 @@ + +#include +#include +#include +#include "plmn_ec_info.h" + +OpenAPI_plmn_ec_info_t *OpenAPI_plmn_ec_info_create( + OpenAPI_plmn_id_t *plmn_id, + int ec_mode_a_restricted, + int ec_mode_b_restricted + ) +{ + OpenAPI_plmn_ec_info_t *plmn_ec_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_plmn_ec_info_t)); + if (!plmn_ec_info_local_var) { + return NULL; + } + plmn_ec_info_local_var->plmn_id = plmn_id; + plmn_ec_info_local_var->ec_mode_a_restricted = ec_mode_a_restricted; + plmn_ec_info_local_var->ec_mode_b_restricted = ec_mode_b_restricted; + + return plmn_ec_info_local_var; +} + +void OpenAPI_plmn_ec_info_free(OpenAPI_plmn_ec_info_t *plmn_ec_info) +{ + if (NULL == plmn_ec_info) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_plmn_id_free(plmn_ec_info->plmn_id); + ogs_free(plmn_ec_info); +} + +cJSON *OpenAPI_plmn_ec_info_convertToJSON(OpenAPI_plmn_ec_info_t *plmn_ec_info) +{ + cJSON *item = NULL; + + if (plmn_ec_info == NULL) { + ogs_error("OpenAPI_plmn_ec_info_convertToJSON() failed [PlmnEcInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!plmn_ec_info->plmn_id) { + ogs_error("OpenAPI_plmn_ec_info_convertToJSON() failed [plmn_id]"); + goto end; + } + cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_convertToJSON(plmn_ec_info->plmn_id); + if (plmn_id_local_JSON == NULL) { + ogs_error("OpenAPI_plmn_ec_info_convertToJSON() failed [plmn_id]"); + goto end; + } + cJSON_AddItemToObject(item, "plmnId", plmn_id_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_plmn_ec_info_convertToJSON() failed [plmn_id]"); + goto end; + } + + if (plmn_ec_info->ec_mode_a_restricted >= 0) { + if (cJSON_AddBoolToObject(item, "ecModeARestricted", plmn_ec_info->ec_mode_a_restricted) == NULL) { + ogs_error("OpenAPI_plmn_ec_info_convertToJSON() failed [ec_mode_a_restricted]"); + goto end; + } + } + + if (plmn_ec_info->ec_mode_b_restricted >= 0) { + if (cJSON_AddBoolToObject(item, "ecModeBRestricted", plmn_ec_info->ec_mode_b_restricted) == NULL) { + ogs_error("OpenAPI_plmn_ec_info_convertToJSON() failed [ec_mode_b_restricted]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_plmn_ec_info_t *OpenAPI_plmn_ec_info_parseFromJSON(cJSON *plmn_ec_infoJSON) +{ + OpenAPI_plmn_ec_info_t *plmn_ec_info_local_var = NULL; + cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(plmn_ec_infoJSON, "plmnId"); + if (!plmn_id) { + ogs_error("OpenAPI_plmn_ec_info_parseFromJSON() failed [plmn_id]"); + goto end; + } + + OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + + plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); + + cJSON *ec_mode_a_restricted = cJSON_GetObjectItemCaseSensitive(plmn_ec_infoJSON, "ecModeARestricted"); + + if (ec_mode_a_restricted) { + if (!cJSON_IsBool(ec_mode_a_restricted)) { + ogs_error("OpenAPI_plmn_ec_info_parseFromJSON() failed [ec_mode_a_restricted]"); + goto end; + } + } + + cJSON *ec_mode_b_restricted = cJSON_GetObjectItemCaseSensitive(plmn_ec_infoJSON, "ecModeBRestricted"); + + if (ec_mode_b_restricted) { + if (!cJSON_IsBool(ec_mode_b_restricted)) { + ogs_error("OpenAPI_plmn_ec_info_parseFromJSON() failed [ec_mode_b_restricted]"); + goto end; + } + } + + plmn_ec_info_local_var = OpenAPI_plmn_ec_info_create ( + plmn_id_local_nonprim, + ec_mode_a_restricted ? ec_mode_a_restricted->valueint : 0, + ec_mode_b_restricted ? ec_mode_b_restricted->valueint : 0 + ); + + return plmn_ec_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/plmn_ec_info.h b/lib/sbi/openapi/model/plmn_ec_info.h new file mode 100644 index 0000000000..6a140661a1 --- /dev/null +++ b/lib/sbi/openapi/model/plmn_ec_info.h @@ -0,0 +1,42 @@ +/* + * plmn_ec_info.h + * + * + */ + +#ifndef _OpenAPI_plmn_ec_info_H_ +#define _OpenAPI_plmn_ec_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "plmn_id.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_plmn_ec_info_s OpenAPI_plmn_ec_info_t; +typedef struct OpenAPI_plmn_ec_info_s { + struct OpenAPI_plmn_id_s *plmn_id; + int ec_mode_a_restricted; + int ec_mode_b_restricted; +} OpenAPI_plmn_ec_info_t; + +OpenAPI_plmn_ec_info_t *OpenAPI_plmn_ec_info_create( + OpenAPI_plmn_id_t *plmn_id, + int ec_mode_a_restricted, + int ec_mode_b_restricted + ); +void OpenAPI_plmn_ec_info_free(OpenAPI_plmn_ec_info_t *plmn_ec_info); +OpenAPI_plmn_ec_info_t *OpenAPI_plmn_ec_info_parseFromJSON(cJSON *plmn_ec_infoJSON); +cJSON *OpenAPI_plmn_ec_info_convertToJSON(OpenAPI_plmn_ec_info_t *plmn_ec_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_plmn_ec_info_H_ */ + diff --git a/lib/sbi/openapi/model/plmn_id_nid.c b/lib/sbi/openapi/model/plmn_id_nid.c new file mode 100644 index 0000000000..6fd8bb57f9 --- /dev/null +++ b/lib/sbi/openapi/model/plmn_id_nid.c @@ -0,0 +1,121 @@ + +#include +#include +#include +#include "plmn_id_nid.h" + +OpenAPI_plmn_id_nid_t *OpenAPI_plmn_id_nid_create( + char *mcc, + char *mnc, + char *nid + ) +{ + OpenAPI_plmn_id_nid_t *plmn_id_nid_local_var = OpenAPI_malloc(sizeof(OpenAPI_plmn_id_nid_t)); + if (!plmn_id_nid_local_var) { + return NULL; + } + plmn_id_nid_local_var->mcc = mcc; + plmn_id_nid_local_var->mnc = mnc; + plmn_id_nid_local_var->nid = nid; + + return plmn_id_nid_local_var; +} + +void OpenAPI_plmn_id_nid_free(OpenAPI_plmn_id_nid_t *plmn_id_nid) +{ + if (NULL == plmn_id_nid) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(plmn_id_nid->mcc); + ogs_free(plmn_id_nid->mnc); + ogs_free(plmn_id_nid->nid); + ogs_free(plmn_id_nid); +} + +cJSON *OpenAPI_plmn_id_nid_convertToJSON(OpenAPI_plmn_id_nid_t *plmn_id_nid) +{ + cJSON *item = NULL; + + if (plmn_id_nid == NULL) { + ogs_error("OpenAPI_plmn_id_nid_convertToJSON() failed [PlmnIdNid]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!plmn_id_nid->mcc) { + ogs_error("OpenAPI_plmn_id_nid_convertToJSON() failed [mcc]"); + goto end; + } + if (cJSON_AddStringToObject(item, "mcc", plmn_id_nid->mcc) == NULL) { + ogs_error("OpenAPI_plmn_id_nid_convertToJSON() failed [mcc]"); + goto end; + } + + if (!plmn_id_nid->mnc) { + ogs_error("OpenAPI_plmn_id_nid_convertToJSON() failed [mnc]"); + goto end; + } + if (cJSON_AddStringToObject(item, "mnc", plmn_id_nid->mnc) == NULL) { + ogs_error("OpenAPI_plmn_id_nid_convertToJSON() failed [mnc]"); + goto end; + } + + if (plmn_id_nid->nid) { + if (cJSON_AddStringToObject(item, "nid", plmn_id_nid->nid) == NULL) { + ogs_error("OpenAPI_plmn_id_nid_convertToJSON() failed [nid]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_plmn_id_nid_t *OpenAPI_plmn_id_nid_parseFromJSON(cJSON *plmn_id_nidJSON) +{ + OpenAPI_plmn_id_nid_t *plmn_id_nid_local_var = NULL; + cJSON *mcc = cJSON_GetObjectItemCaseSensitive(plmn_id_nidJSON, "mcc"); + if (!mcc) { + ogs_error("OpenAPI_plmn_id_nid_parseFromJSON() failed [mcc]"); + goto end; + } + + + if (!cJSON_IsString(mcc)) { + ogs_error("OpenAPI_plmn_id_nid_parseFromJSON() failed [mcc]"); + goto end; + } + + cJSON *mnc = cJSON_GetObjectItemCaseSensitive(plmn_id_nidJSON, "mnc"); + if (!mnc) { + ogs_error("OpenAPI_plmn_id_nid_parseFromJSON() failed [mnc]"); + goto end; + } + + + if (!cJSON_IsString(mnc)) { + ogs_error("OpenAPI_plmn_id_nid_parseFromJSON() failed [mnc]"); + goto end; + } + + cJSON *nid = cJSON_GetObjectItemCaseSensitive(plmn_id_nidJSON, "nid"); + + if (nid) { + if (!cJSON_IsString(nid)) { + ogs_error("OpenAPI_plmn_id_nid_parseFromJSON() failed [nid]"); + goto end; + } + } + + plmn_id_nid_local_var = OpenAPI_plmn_id_nid_create ( + ogs_strdup(mcc->valuestring), + ogs_strdup(mnc->valuestring), + nid ? ogs_strdup(nid->valuestring) : NULL + ); + + return plmn_id_nid_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/plmn_id_nid.h b/lib/sbi/openapi/model/plmn_id_nid.h new file mode 100644 index 0000000000..a06c71485b --- /dev/null +++ b/lib/sbi/openapi/model/plmn_id_nid.h @@ -0,0 +1,41 @@ +/* + * plmn_id_nid.h + * + * + */ + +#ifndef _OpenAPI_plmn_id_nid_H_ +#define _OpenAPI_plmn_id_nid_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_plmn_id_nid_s OpenAPI_plmn_id_nid_t; +typedef struct OpenAPI_plmn_id_nid_s { + char *mcc; + char *mnc; + char *nid; +} OpenAPI_plmn_id_nid_t; + +OpenAPI_plmn_id_nid_t *OpenAPI_plmn_id_nid_create( + char *mcc, + char *mnc, + char *nid + ); +void OpenAPI_plmn_id_nid_free(OpenAPI_plmn_id_nid_t *plmn_id_nid); +OpenAPI_plmn_id_nid_t *OpenAPI_plmn_id_nid_parseFromJSON(cJSON *plmn_id_nidJSON); +cJSON *OpenAPI_plmn_id_nid_convertToJSON(OpenAPI_plmn_id_nid_t *plmn_id_nid); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_plmn_id_nid_H_ */ + diff --git a/lib/sbi/openapi/model/plmn_operator_class.c b/lib/sbi/openapi/model/plmn_operator_class.c new file mode 100644 index 0000000000..deb92d304f --- /dev/null +++ b/lib/sbi/openapi/model/plmn_operator_class.c @@ -0,0 +1,125 @@ + +#include +#include +#include +#include "plmn_operator_class.h" + +OpenAPI_plmn_operator_class_t *OpenAPI_plmn_operator_class_create( + OpenAPI_lcs_client_class_e lcs_client_class, + OpenAPI_list_t *lcs_client_ids + ) +{ + OpenAPI_plmn_operator_class_t *plmn_operator_class_local_var = OpenAPI_malloc(sizeof(OpenAPI_plmn_operator_class_t)); + if (!plmn_operator_class_local_var) { + return NULL; + } + plmn_operator_class_local_var->lcs_client_class = lcs_client_class; + plmn_operator_class_local_var->lcs_client_ids = lcs_client_ids; + + return plmn_operator_class_local_var; +} + +void OpenAPI_plmn_operator_class_free(OpenAPI_plmn_operator_class_t *plmn_operator_class) +{ + if (NULL == plmn_operator_class) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(plmn_operator_class->lcs_client_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(plmn_operator_class->lcs_client_ids); + ogs_free(plmn_operator_class); +} + +cJSON *OpenAPI_plmn_operator_class_convertToJSON(OpenAPI_plmn_operator_class_t *plmn_operator_class) +{ + cJSON *item = NULL; + + if (plmn_operator_class == NULL) { + ogs_error("OpenAPI_plmn_operator_class_convertToJSON() failed [PlmnOperatorClass]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!plmn_operator_class->lcs_client_class) { + ogs_error("OpenAPI_plmn_operator_class_convertToJSON() failed [lcs_client_class]"); + goto end; + } + if (cJSON_AddStringToObject(item, "lcsClientClass", OpenAPI_lcs_client_class_ToString(plmn_operator_class->lcs_client_class)) == NULL) { + ogs_error("OpenAPI_plmn_operator_class_convertToJSON() failed [lcs_client_class]"); + goto end; + } + + if (!plmn_operator_class->lcs_client_ids) { + ogs_error("OpenAPI_plmn_operator_class_convertToJSON() failed [lcs_client_ids]"); + goto end; + } + cJSON *lcs_client_ids = cJSON_AddArrayToObject(item, "lcsClientIds"); + if (lcs_client_ids == NULL) { + ogs_error("OpenAPI_plmn_operator_class_convertToJSON() failed [lcs_client_ids]"); + goto end; + } + + OpenAPI_lnode_t *lcs_client_ids_node; + OpenAPI_list_for_each(plmn_operator_class->lcs_client_ids, lcs_client_ids_node) { + if (cJSON_AddStringToObject(lcs_client_ids, "", (char*)lcs_client_ids_node->data) == NULL) { + ogs_error("OpenAPI_plmn_operator_class_convertToJSON() failed [lcs_client_ids]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_plmn_operator_class_t *OpenAPI_plmn_operator_class_parseFromJSON(cJSON *plmn_operator_classJSON) +{ + OpenAPI_plmn_operator_class_t *plmn_operator_class_local_var = NULL; + cJSON *lcs_client_class = cJSON_GetObjectItemCaseSensitive(plmn_operator_classJSON, "lcsClientClass"); + if (!lcs_client_class) { + ogs_error("OpenAPI_plmn_operator_class_parseFromJSON() failed [lcs_client_class]"); + goto end; + } + + OpenAPI_lcs_client_class_e lcs_client_classVariable; + + if (!cJSON_IsString(lcs_client_class)) { + ogs_error("OpenAPI_plmn_operator_class_parseFromJSON() failed [lcs_client_class]"); + goto end; + } + lcs_client_classVariable = OpenAPI_lcs_client_class_FromString(lcs_client_class->valuestring); + + cJSON *lcs_client_ids = cJSON_GetObjectItemCaseSensitive(plmn_operator_classJSON, "lcsClientIds"); + if (!lcs_client_ids) { + ogs_error("OpenAPI_plmn_operator_class_parseFromJSON() failed [lcs_client_ids]"); + goto end; + } + + OpenAPI_list_t *lcs_client_idsList; + + cJSON *lcs_client_ids_local; + if (!cJSON_IsArray(lcs_client_ids)) { + ogs_error("OpenAPI_plmn_operator_class_parseFromJSON() failed [lcs_client_ids]"); + goto end; + } + lcs_client_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(lcs_client_ids_local, lcs_client_ids) { + if (!cJSON_IsString(lcs_client_ids_local)) { + ogs_error("OpenAPI_plmn_operator_class_parseFromJSON() failed [lcs_client_ids]"); + goto end; + } + OpenAPI_list_add(lcs_client_idsList, ogs_strdup(lcs_client_ids_local->valuestring)); + } + + plmn_operator_class_local_var = OpenAPI_plmn_operator_class_create ( + lcs_client_classVariable, + lcs_client_idsList + ); + + return plmn_operator_class_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/plmn_operator_class.h b/lib/sbi/openapi/model/plmn_operator_class.h new file mode 100644 index 0000000000..47071d6940 --- /dev/null +++ b/lib/sbi/openapi/model/plmn_operator_class.h @@ -0,0 +1,40 @@ +/* + * plmn_operator_class.h + * + * + */ + +#ifndef _OpenAPI_plmn_operator_class_H_ +#define _OpenAPI_plmn_operator_class_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "lcs_client_class.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_plmn_operator_class_s OpenAPI_plmn_operator_class_t; +typedef struct OpenAPI_plmn_operator_class_s { + OpenAPI_lcs_client_class_e lcs_client_class; + OpenAPI_list_t *lcs_client_ids; +} OpenAPI_plmn_operator_class_t; + +OpenAPI_plmn_operator_class_t *OpenAPI_plmn_operator_class_create( + OpenAPI_lcs_client_class_e lcs_client_class, + OpenAPI_list_t *lcs_client_ids + ); +void OpenAPI_plmn_operator_class_free(OpenAPI_plmn_operator_class_t *plmn_operator_class); +OpenAPI_plmn_operator_class_t *OpenAPI_plmn_operator_class_parseFromJSON(cJSON *plmn_operator_classJSON); +cJSON *OpenAPI_plmn_operator_class_convertToJSON(OpenAPI_plmn_operator_class_t *plmn_operator_class); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_plmn_operator_class_H_ */ + diff --git a/lib/sbi/openapi/model/plmn_range.h b/lib/sbi/openapi/model/plmn_range.h index 77246f8c4d..dd8658f598 100644 --- a/lib/sbi/openapi/model/plmn_range.h +++ b/lib/sbi/openapi/model/plmn_range.h @@ -1,7 +1,7 @@ /* * plmn_range.h * - * + * Range of PLMN IDs */ #ifndef _OpenAPI_plmn_range_H_ diff --git a/lib/sbi/openapi/model/plmn_rat_served.c b/lib/sbi/openapi/model/plmn_rat_served.c new file mode 100644 index 0000000000..1280be422c --- /dev/null +++ b/lib/sbi/openapi/model/plmn_rat_served.c @@ -0,0 +1,135 @@ + +#include +#include +#include +#include "plmn_rat_served.h" + +OpenAPI_plmn_rat_served_t *OpenAPI_plmn_rat_served_create( + OpenAPI_plmn_id_t *plmn, + OpenAPI_list_t *rats + ) +{ + OpenAPI_plmn_rat_served_t *plmn_rat_served_local_var = OpenAPI_malloc(sizeof(OpenAPI_plmn_rat_served_t)); + if (!plmn_rat_served_local_var) { + return NULL; + } + plmn_rat_served_local_var->plmn = plmn; + plmn_rat_served_local_var->rats = rats; + + return plmn_rat_served_local_var; +} + +void OpenAPI_plmn_rat_served_free(OpenAPI_plmn_rat_served_t *plmn_rat_served) +{ + if (NULL == plmn_rat_served) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_plmn_id_free(plmn_rat_served->plmn); + OpenAPI_list_for_each(plmn_rat_served->rats, node) { + OpenAPI_v2x_rat_type_free(node->data); + } + OpenAPI_list_free(plmn_rat_served->rats); + ogs_free(plmn_rat_served); +} + +cJSON *OpenAPI_plmn_rat_served_convertToJSON(OpenAPI_plmn_rat_served_t *plmn_rat_served) +{ + cJSON *item = NULL; + + if (plmn_rat_served == NULL) { + ogs_error("OpenAPI_plmn_rat_served_convertToJSON() failed [PlmnRatServed]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!plmn_rat_served->plmn) { + ogs_error("OpenAPI_plmn_rat_served_convertToJSON() failed [plmn]"); + goto end; + } + cJSON *plmn_local_JSON = OpenAPI_plmn_id_convertToJSON(plmn_rat_served->plmn); + if (plmn_local_JSON == NULL) { + ogs_error("OpenAPI_plmn_rat_served_convertToJSON() failed [plmn]"); + goto end; + } + cJSON_AddItemToObject(item, "plmn", plmn_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_plmn_rat_served_convertToJSON() failed [plmn]"); + goto end; + } + + if (!plmn_rat_served->rats) { + ogs_error("OpenAPI_plmn_rat_served_convertToJSON() failed [rats]"); + goto end; + } + cJSON *ratsList = cJSON_AddArrayToObject(item, "rats"); + if (ratsList == NULL) { + ogs_error("OpenAPI_plmn_rat_served_convertToJSON() failed [rats]"); + goto end; + } + + OpenAPI_lnode_t *rats_node; + if (plmn_rat_served->rats) { + OpenAPI_list_for_each(plmn_rat_served->rats, rats_node) { + cJSON *itemLocal = OpenAPI_v2x_rat_type_convertToJSON(rats_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_plmn_rat_served_convertToJSON() failed [rats]"); + goto end; + } + cJSON_AddItemToArray(ratsList, itemLocal); + } + } + +end: + return item; +} + +OpenAPI_plmn_rat_served_t *OpenAPI_plmn_rat_served_parseFromJSON(cJSON *plmn_rat_servedJSON) +{ + OpenAPI_plmn_rat_served_t *plmn_rat_served_local_var = NULL; + cJSON *plmn = cJSON_GetObjectItemCaseSensitive(plmn_rat_servedJSON, "plmn"); + if (!plmn) { + ogs_error("OpenAPI_plmn_rat_served_parseFromJSON() failed [plmn]"); + goto end; + } + + OpenAPI_plmn_id_t *plmn_local_nonprim = NULL; + + plmn_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn); + + cJSON *rats = cJSON_GetObjectItemCaseSensitive(plmn_rat_servedJSON, "rats"); + if (!rats) { + ogs_error("OpenAPI_plmn_rat_served_parseFromJSON() failed [rats]"); + goto end; + } + + OpenAPI_list_t *ratsList; + + cJSON *rats_local_nonprimitive; + if (!cJSON_IsArray(rats)) { + ogs_error("OpenAPI_plmn_rat_served_parseFromJSON() failed [rats]"); + goto end; + } + + ratsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(rats_local_nonprimitive, rats ) { + if (!cJSON_IsObject(rats_local_nonprimitive)) { + ogs_error("OpenAPI_plmn_rat_served_parseFromJSON() failed [rats]"); + goto end; + } + OpenAPI_v2x_rat_type_t *ratsItem = OpenAPI_v2x_rat_type_parseFromJSON(rats_local_nonprimitive); + + OpenAPI_list_add(ratsList, ratsItem); + } + + plmn_rat_served_local_var = OpenAPI_plmn_rat_served_create ( + plmn_local_nonprim, + ratsList + ); + + return plmn_rat_served_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/plmn_rat_served.h b/lib/sbi/openapi/model/plmn_rat_served.h new file mode 100644 index 0000000000..4a1f375906 --- /dev/null +++ b/lib/sbi/openapi/model/plmn_rat_served.h @@ -0,0 +1,41 @@ +/* + * plmn_rat_served.h + * + * + */ + +#ifndef _OpenAPI_plmn_rat_served_H_ +#define _OpenAPI_plmn_rat_served_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "plmn_id.h" +#include "v2x_rat_type.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_plmn_rat_served_s OpenAPI_plmn_rat_served_t; +typedef struct OpenAPI_plmn_rat_served_s { + struct OpenAPI_plmn_id_s *plmn; + OpenAPI_list_t *rats; +} OpenAPI_plmn_rat_served_t; + +OpenAPI_plmn_rat_served_t *OpenAPI_plmn_rat_served_create( + OpenAPI_plmn_id_t *plmn, + OpenAPI_list_t *rats + ); +void OpenAPI_plmn_rat_served_free(OpenAPI_plmn_rat_served_t *plmn_rat_served); +OpenAPI_plmn_rat_served_t *OpenAPI_plmn_rat_served_parseFromJSON(cJSON *plmn_rat_servedJSON); +cJSON *OpenAPI_plmn_rat_served_convertToJSON(OpenAPI_plmn_rat_served_t *plmn_rat_served); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_plmn_rat_served_H_ */ + diff --git a/lib/sbi/openapi/model/plmn_route_selection_descriptor.c b/lib/sbi/openapi/model/plmn_route_selection_descriptor.c new file mode 100644 index 0000000000..5453bcf1e5 --- /dev/null +++ b/lib/sbi/openapi/model/plmn_route_selection_descriptor.c @@ -0,0 +1,130 @@ + +#include +#include +#include +#include "plmn_route_selection_descriptor.h" + +OpenAPI_plmn_route_selection_descriptor_t *OpenAPI_plmn_route_selection_descriptor_create( + OpenAPI_plmn_id_t *serving_plmn, + OpenAPI_list_t *snssai_route_sel_descs + ) +{ + OpenAPI_plmn_route_selection_descriptor_t *plmn_route_selection_descriptor_local_var = OpenAPI_malloc(sizeof(OpenAPI_plmn_route_selection_descriptor_t)); + if (!plmn_route_selection_descriptor_local_var) { + return NULL; + } + plmn_route_selection_descriptor_local_var->serving_plmn = serving_plmn; + plmn_route_selection_descriptor_local_var->snssai_route_sel_descs = snssai_route_sel_descs; + + return plmn_route_selection_descriptor_local_var; +} + +void OpenAPI_plmn_route_selection_descriptor_free(OpenAPI_plmn_route_selection_descriptor_t *plmn_route_selection_descriptor) +{ + if (NULL == plmn_route_selection_descriptor) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_plmn_id_free(plmn_route_selection_descriptor->serving_plmn); + OpenAPI_list_for_each(plmn_route_selection_descriptor->snssai_route_sel_descs, node) { + OpenAPI_snssai_route_selection_descriptor_free(node->data); + } + OpenAPI_list_free(plmn_route_selection_descriptor->snssai_route_sel_descs); + ogs_free(plmn_route_selection_descriptor); +} + +cJSON *OpenAPI_plmn_route_selection_descriptor_convertToJSON(OpenAPI_plmn_route_selection_descriptor_t *plmn_route_selection_descriptor) +{ + cJSON *item = NULL; + + if (plmn_route_selection_descriptor == NULL) { + ogs_error("OpenAPI_plmn_route_selection_descriptor_convertToJSON() failed [PlmnRouteSelectionDescriptor]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!plmn_route_selection_descriptor->serving_plmn) { + ogs_error("OpenAPI_plmn_route_selection_descriptor_convertToJSON() failed [serving_plmn]"); + goto end; + } + cJSON *serving_plmn_local_JSON = OpenAPI_plmn_id_convertToJSON(plmn_route_selection_descriptor->serving_plmn); + if (serving_plmn_local_JSON == NULL) { + ogs_error("OpenAPI_plmn_route_selection_descriptor_convertToJSON() failed [serving_plmn]"); + goto end; + } + cJSON_AddItemToObject(item, "servingPlmn", serving_plmn_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_plmn_route_selection_descriptor_convertToJSON() failed [serving_plmn]"); + goto end; + } + + if (plmn_route_selection_descriptor->snssai_route_sel_descs) { + cJSON *snssai_route_sel_descsList = cJSON_AddArrayToObject(item, "snssaiRouteSelDescs"); + if (snssai_route_sel_descsList == NULL) { + ogs_error("OpenAPI_plmn_route_selection_descriptor_convertToJSON() failed [snssai_route_sel_descs]"); + goto end; + } + + OpenAPI_lnode_t *snssai_route_sel_descs_node; + if (plmn_route_selection_descriptor->snssai_route_sel_descs) { + OpenAPI_list_for_each(plmn_route_selection_descriptor->snssai_route_sel_descs, snssai_route_sel_descs_node) { + cJSON *itemLocal = OpenAPI_snssai_route_selection_descriptor_convertToJSON(snssai_route_sel_descs_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_plmn_route_selection_descriptor_convertToJSON() failed [snssai_route_sel_descs]"); + goto end; + } + cJSON_AddItemToArray(snssai_route_sel_descsList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_plmn_route_selection_descriptor_t *OpenAPI_plmn_route_selection_descriptor_parseFromJSON(cJSON *plmn_route_selection_descriptorJSON) +{ + OpenAPI_plmn_route_selection_descriptor_t *plmn_route_selection_descriptor_local_var = NULL; + cJSON *serving_plmn = cJSON_GetObjectItemCaseSensitive(plmn_route_selection_descriptorJSON, "servingPlmn"); + if (!serving_plmn) { + ogs_error("OpenAPI_plmn_route_selection_descriptor_parseFromJSON() failed [serving_plmn]"); + goto end; + } + + OpenAPI_plmn_id_t *serving_plmn_local_nonprim = NULL; + + serving_plmn_local_nonprim = OpenAPI_plmn_id_parseFromJSON(serving_plmn); + + cJSON *snssai_route_sel_descs = cJSON_GetObjectItemCaseSensitive(plmn_route_selection_descriptorJSON, "snssaiRouteSelDescs"); + + OpenAPI_list_t *snssai_route_sel_descsList; + if (snssai_route_sel_descs) { + cJSON *snssai_route_sel_descs_local_nonprimitive; + if (!cJSON_IsArray(snssai_route_sel_descs)) { + ogs_error("OpenAPI_plmn_route_selection_descriptor_parseFromJSON() failed [snssai_route_sel_descs]"); + goto end; + } + + snssai_route_sel_descsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(snssai_route_sel_descs_local_nonprimitive, snssai_route_sel_descs ) { + if (!cJSON_IsObject(snssai_route_sel_descs_local_nonprimitive)) { + ogs_error("OpenAPI_plmn_route_selection_descriptor_parseFromJSON() failed [snssai_route_sel_descs]"); + goto end; + } + OpenAPI_snssai_route_selection_descriptor_t *snssai_route_sel_descsItem = OpenAPI_snssai_route_selection_descriptor_parseFromJSON(snssai_route_sel_descs_local_nonprimitive); + + OpenAPI_list_add(snssai_route_sel_descsList, snssai_route_sel_descsItem); + } + } + + plmn_route_selection_descriptor_local_var = OpenAPI_plmn_route_selection_descriptor_create ( + serving_plmn_local_nonprim, + snssai_route_sel_descs ? snssai_route_sel_descsList : NULL + ); + + return plmn_route_selection_descriptor_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/plmn_route_selection_descriptor.h b/lib/sbi/openapi/model/plmn_route_selection_descriptor.h new file mode 100644 index 0000000000..7e35ab4785 --- /dev/null +++ b/lib/sbi/openapi/model/plmn_route_selection_descriptor.h @@ -0,0 +1,41 @@ +/* + * plmn_route_selection_descriptor.h + * + * Contains the route selection descriptors (combinations of SNSSAI, DNNs, PDU session types, and SSC modes) allowed by subscription to the UE for a serving PLMN + */ + +#ifndef _OpenAPI_plmn_route_selection_descriptor_H_ +#define _OpenAPI_plmn_route_selection_descriptor_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "plmn_id.h" +#include "snssai_route_selection_descriptor.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_plmn_route_selection_descriptor_s OpenAPI_plmn_route_selection_descriptor_t; +typedef struct OpenAPI_plmn_route_selection_descriptor_s { + struct OpenAPI_plmn_id_s *serving_plmn; + OpenAPI_list_t *snssai_route_sel_descs; +} OpenAPI_plmn_route_selection_descriptor_t; + +OpenAPI_plmn_route_selection_descriptor_t *OpenAPI_plmn_route_selection_descriptor_create( + OpenAPI_plmn_id_t *serving_plmn, + OpenAPI_list_t *snssai_route_sel_descs + ); +void OpenAPI_plmn_route_selection_descriptor_free(OpenAPI_plmn_route_selection_descriptor_t *plmn_route_selection_descriptor); +OpenAPI_plmn_route_selection_descriptor_t *OpenAPI_plmn_route_selection_descriptor_parseFromJSON(cJSON *plmn_route_selection_descriptorJSON); +cJSON *OpenAPI_plmn_route_selection_descriptor_convertToJSON(OpenAPI_plmn_route_selection_descriptor_t *plmn_route_selection_descriptor); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_plmn_route_selection_descriptor_H_ */ + diff --git a/lib/sbi/openapi/model/plmn_snssai.c b/lib/sbi/openapi/model/plmn_snssai.c index bf9e36fd95..c1844d0586 100644 --- a/lib/sbi/openapi/model/plmn_snssai.c +++ b/lib/sbi/openapi/model/plmn_snssai.c @@ -6,7 +6,8 @@ OpenAPI_plmn_snssai_t *OpenAPI_plmn_snssai_create( OpenAPI_plmn_id_t *plmn_id, - OpenAPI_list_t *s_nssai_list + OpenAPI_list_t *s_nssai_list, + char *nid ) { OpenAPI_plmn_snssai_t *plmn_snssai_local_var = OpenAPI_malloc(sizeof(OpenAPI_plmn_snssai_t)); @@ -15,6 +16,7 @@ OpenAPI_plmn_snssai_t *OpenAPI_plmn_snssai_create( } plmn_snssai_local_var->plmn_id = plmn_id; plmn_snssai_local_var->s_nssai_list = s_nssai_list; + plmn_snssai_local_var->nid = nid; return plmn_snssai_local_var; } @@ -30,6 +32,7 @@ void OpenAPI_plmn_snssai_free(OpenAPI_plmn_snssai_t *plmn_snssai) OpenAPI_snssai_free(node->data); } OpenAPI_list_free(plmn_snssai->s_nssai_list); + ogs_free(plmn_snssai->nid); ogs_free(plmn_snssai); } @@ -80,6 +83,13 @@ cJSON *OpenAPI_plmn_snssai_convertToJSON(OpenAPI_plmn_snssai_t *plmn_snssai) } } + if (plmn_snssai->nid) { + if (cJSON_AddStringToObject(item, "nid", plmn_snssai->nid) == NULL) { + ogs_error("OpenAPI_plmn_snssai_convertToJSON() failed [nid]"); + goto end; + } + } + end: return item; } @@ -123,9 +133,19 @@ OpenAPI_plmn_snssai_t *OpenAPI_plmn_snssai_parseFromJSON(cJSON *plmn_snssaiJSON) OpenAPI_list_add(s_nssai_listList, s_nssai_listItem); } + cJSON *nid = cJSON_GetObjectItemCaseSensitive(plmn_snssaiJSON, "nid"); + + if (nid) { + if (!cJSON_IsString(nid)) { + ogs_error("OpenAPI_plmn_snssai_parseFromJSON() failed [nid]"); + goto end; + } + } + plmn_snssai_local_var = OpenAPI_plmn_snssai_create ( plmn_id_local_nonprim, - s_nssai_listList + s_nssai_listList, + nid ? ogs_strdup(nid->valuestring) : NULL ); return plmn_snssai_local_var; diff --git a/lib/sbi/openapi/model/plmn_snssai.h b/lib/sbi/openapi/model/plmn_snssai.h index fc5a57a53f..576d020f61 100644 --- a/lib/sbi/openapi/model/plmn_snssai.h +++ b/lib/sbi/openapi/model/plmn_snssai.h @@ -1,7 +1,7 @@ /* * plmn_snssai.h * - * + * List of network slices (S-NSSAIs) for a given PLMN ID */ #ifndef _OpenAPI_plmn_snssai_H_ @@ -23,11 +23,13 @@ typedef struct OpenAPI_plmn_snssai_s OpenAPI_plmn_snssai_t; typedef struct OpenAPI_plmn_snssai_s { struct OpenAPI_plmn_id_s *plmn_id; OpenAPI_list_t *s_nssai_list; + char *nid; } OpenAPI_plmn_snssai_t; OpenAPI_plmn_snssai_t *OpenAPI_plmn_snssai_create( OpenAPI_plmn_id_t *plmn_id, - OpenAPI_list_t *s_nssai_list + OpenAPI_list_t *s_nssai_list, + char *nid ); void OpenAPI_plmn_snssai_free(OpenAPI_plmn_snssai_t *plmn_snssai); OpenAPI_plmn_snssai_t *OpenAPI_plmn_snssai_parseFromJSON(cJSON *plmn_snssaiJSON); diff --git a/lib/sbi/openapi/model/point.c b/lib/sbi/openapi/model/point.c new file mode 100644 index 0000000000..8cd9ee000c --- /dev/null +++ b/lib/sbi/openapi/model/point.c @@ -0,0 +1,109 @@ + +#include +#include +#include +#include "point.h" + +OpenAPI_point_t *OpenAPI_point_create( + OpenAPI_supported_gad_shapes_t *shape, + OpenAPI_geographical_coordinates_t *point + ) +{ + OpenAPI_point_t *point_local_var = OpenAPI_malloc(sizeof(OpenAPI_point_t)); + if (!point_local_var) { + return NULL; + } + point_local_var->shape = shape; + point_local_var->point = point; + + return point_local_var; +} + +void OpenAPI_point_free(OpenAPI_point_t *point) +{ + if (NULL == point) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_supported_gad_shapes_free(point->shape); + OpenAPI_geographical_coordinates_free(point->point); + ogs_free(point); +} + +cJSON *OpenAPI_point_convertToJSON(OpenAPI_point_t *point) +{ + cJSON *item = NULL; + + if (point == NULL) { + ogs_error("OpenAPI_point_convertToJSON() failed [Point]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!point->shape) { + ogs_error("OpenAPI_point_convertToJSON() failed [shape]"); + goto end; + } + cJSON *shape_local_JSON = OpenAPI_supported_gad_shapes_convertToJSON(point->shape); + if (shape_local_JSON == NULL) { + ogs_error("OpenAPI_point_convertToJSON() failed [shape]"); + goto end; + } + cJSON_AddItemToObject(item, "shape", shape_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_point_convertToJSON() failed [shape]"); + goto end; + } + + if (!point->point) { + ogs_error("OpenAPI_point_convertToJSON() failed [point]"); + goto end; + } + cJSON *point_local_JSON = OpenAPI_geographical_coordinates_convertToJSON(point->point); + if (point_local_JSON == NULL) { + ogs_error("OpenAPI_point_convertToJSON() failed [point]"); + goto end; + } + cJSON_AddItemToObject(item, "point", point_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_point_convertToJSON() failed [point]"); + goto end; + } + +end: + return item; +} + +OpenAPI_point_t *OpenAPI_point_parseFromJSON(cJSON *pointJSON) +{ + OpenAPI_point_t *point_local_var = NULL; + cJSON *shape = cJSON_GetObjectItemCaseSensitive(pointJSON, "shape"); + if (!shape) { + ogs_error("OpenAPI_point_parseFromJSON() failed [shape]"); + goto end; + } + + OpenAPI_supported_gad_shapes_t *shape_local_nonprim = NULL; + + shape_local_nonprim = OpenAPI_supported_gad_shapes_parseFromJSON(shape); + + cJSON *point = cJSON_GetObjectItemCaseSensitive(pointJSON, "point"); + if (!point) { + ogs_error("OpenAPI_point_parseFromJSON() failed [point]"); + goto end; + } + + OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; + + point_local_nonprim = OpenAPI_geographical_coordinates_parseFromJSON(point); + + point_local_var = OpenAPI_point_create ( + shape_local_nonprim, + point_local_nonprim + ); + + return point_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/point.h b/lib/sbi/openapi/model/point.h new file mode 100644 index 0000000000..f5aacaa619 --- /dev/null +++ b/lib/sbi/openapi/model/point.h @@ -0,0 +1,43 @@ +/* + * point.h + * + * + */ + +#ifndef _OpenAPI_point_H_ +#define _OpenAPI_point_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "gad_shape.h" +#include "geographical_coordinates.h" +#include "point_all_of.h" +#include "supported_gad_shapes.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_point_s OpenAPI_point_t; +typedef struct OpenAPI_point_s { + struct OpenAPI_supported_gad_shapes_s *shape; + struct OpenAPI_geographical_coordinates_s *point; +} OpenAPI_point_t; + +OpenAPI_point_t *OpenAPI_point_create( + OpenAPI_supported_gad_shapes_t *shape, + OpenAPI_geographical_coordinates_t *point + ); +void OpenAPI_point_free(OpenAPI_point_t *point); +OpenAPI_point_t *OpenAPI_point_parseFromJSON(cJSON *pointJSON); +cJSON *OpenAPI_point_convertToJSON(OpenAPI_point_t *point); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_point_H_ */ + diff --git a/lib/sbi/openapi/model/point_all_of.c b/lib/sbi/openapi/model/point_all_of.c new file mode 100644 index 0000000000..67ea92115d --- /dev/null +++ b/lib/sbi/openapi/model/point_all_of.c @@ -0,0 +1,80 @@ + +#include +#include +#include +#include "point_all_of.h" + +OpenAPI_point_all_of_t *OpenAPI_point_all_of_create( + OpenAPI_geographical_coordinates_t *point + ) +{ + OpenAPI_point_all_of_t *point_all_of_local_var = OpenAPI_malloc(sizeof(OpenAPI_point_all_of_t)); + if (!point_all_of_local_var) { + return NULL; + } + point_all_of_local_var->point = point; + + return point_all_of_local_var; +} + +void OpenAPI_point_all_of_free(OpenAPI_point_all_of_t *point_all_of) +{ + if (NULL == point_all_of) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_geographical_coordinates_free(point_all_of->point); + ogs_free(point_all_of); +} + +cJSON *OpenAPI_point_all_of_convertToJSON(OpenAPI_point_all_of_t *point_all_of) +{ + cJSON *item = NULL; + + if (point_all_of == NULL) { + ogs_error("OpenAPI_point_all_of_convertToJSON() failed [Point_allOf]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!point_all_of->point) { + ogs_error("OpenAPI_point_all_of_convertToJSON() failed [point]"); + goto end; + } + cJSON *point_local_JSON = OpenAPI_geographical_coordinates_convertToJSON(point_all_of->point); + if (point_local_JSON == NULL) { + ogs_error("OpenAPI_point_all_of_convertToJSON() failed [point]"); + goto end; + } + cJSON_AddItemToObject(item, "point", point_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_point_all_of_convertToJSON() failed [point]"); + goto end; + } + +end: + return item; +} + +OpenAPI_point_all_of_t *OpenAPI_point_all_of_parseFromJSON(cJSON *point_all_ofJSON) +{ + OpenAPI_point_all_of_t *point_all_of_local_var = NULL; + cJSON *point = cJSON_GetObjectItemCaseSensitive(point_all_ofJSON, "point"); + if (!point) { + ogs_error("OpenAPI_point_all_of_parseFromJSON() failed [point]"); + goto end; + } + + OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; + + point_local_nonprim = OpenAPI_geographical_coordinates_parseFromJSON(point); + + point_all_of_local_var = OpenAPI_point_all_of_create ( + point_local_nonprim + ); + + return point_all_of_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/point_all_of.h b/lib/sbi/openapi/model/point_all_of.h new file mode 100644 index 0000000000..49865e8496 --- /dev/null +++ b/lib/sbi/openapi/model/point_all_of.h @@ -0,0 +1,38 @@ +/* + * point_all_of.h + * + * + */ + +#ifndef _OpenAPI_point_all_of_H_ +#define _OpenAPI_point_all_of_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "geographical_coordinates.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_point_all_of_s OpenAPI_point_all_of_t; +typedef struct OpenAPI_point_all_of_s { + struct OpenAPI_geographical_coordinates_s *point; +} OpenAPI_point_all_of_t; + +OpenAPI_point_all_of_t *OpenAPI_point_all_of_create( + OpenAPI_geographical_coordinates_t *point + ); +void OpenAPI_point_all_of_free(OpenAPI_point_all_of_t *point_all_of); +OpenAPI_point_all_of_t *OpenAPI_point_all_of_parseFromJSON(cJSON *point_all_ofJSON); +cJSON *OpenAPI_point_all_of_convertToJSON(OpenAPI_point_all_of_t *point_all_of); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_point_all_of_H_ */ + diff --git a/lib/sbi/openapi/model/point_altitude.c b/lib/sbi/openapi/model/point_altitude.c new file mode 100644 index 0000000000..acdff6bb2e --- /dev/null +++ b/lib/sbi/openapi/model/point_altitude.c @@ -0,0 +1,133 @@ + +#include +#include +#include +#include "point_altitude.h" + +OpenAPI_point_altitude_t *OpenAPI_point_altitude_create( + OpenAPI_supported_gad_shapes_t *shape, + OpenAPI_geographical_coordinates_t *point, + double altitude + ) +{ + OpenAPI_point_altitude_t *point_altitude_local_var = OpenAPI_malloc(sizeof(OpenAPI_point_altitude_t)); + if (!point_altitude_local_var) { + return NULL; + } + point_altitude_local_var->shape = shape; + point_altitude_local_var->point = point; + point_altitude_local_var->altitude = altitude; + + return point_altitude_local_var; +} + +void OpenAPI_point_altitude_free(OpenAPI_point_altitude_t *point_altitude) +{ + if (NULL == point_altitude) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_supported_gad_shapes_free(point_altitude->shape); + OpenAPI_geographical_coordinates_free(point_altitude->point); + ogs_free(point_altitude); +} + +cJSON *OpenAPI_point_altitude_convertToJSON(OpenAPI_point_altitude_t *point_altitude) +{ + cJSON *item = NULL; + + if (point_altitude == NULL) { + ogs_error("OpenAPI_point_altitude_convertToJSON() failed [PointAltitude]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!point_altitude->shape) { + ogs_error("OpenAPI_point_altitude_convertToJSON() failed [shape]"); + goto end; + } + cJSON *shape_local_JSON = OpenAPI_supported_gad_shapes_convertToJSON(point_altitude->shape); + if (shape_local_JSON == NULL) { + ogs_error("OpenAPI_point_altitude_convertToJSON() failed [shape]"); + goto end; + } + cJSON_AddItemToObject(item, "shape", shape_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_point_altitude_convertToJSON() failed [shape]"); + goto end; + } + + if (!point_altitude->point) { + ogs_error("OpenAPI_point_altitude_convertToJSON() failed [point]"); + goto end; + } + cJSON *point_local_JSON = OpenAPI_geographical_coordinates_convertToJSON(point_altitude->point); + if (point_local_JSON == NULL) { + ogs_error("OpenAPI_point_altitude_convertToJSON() failed [point]"); + goto end; + } + cJSON_AddItemToObject(item, "point", point_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_point_altitude_convertToJSON() failed [point]"); + goto end; + } + + if (!point_altitude->altitude) { + ogs_error("OpenAPI_point_altitude_convertToJSON() failed [altitude]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "altitude", point_altitude->altitude) == NULL) { + ogs_error("OpenAPI_point_altitude_convertToJSON() failed [altitude]"); + goto end; + } + +end: + return item; +} + +OpenAPI_point_altitude_t *OpenAPI_point_altitude_parseFromJSON(cJSON *point_altitudeJSON) +{ + OpenAPI_point_altitude_t *point_altitude_local_var = NULL; + cJSON *shape = cJSON_GetObjectItemCaseSensitive(point_altitudeJSON, "shape"); + if (!shape) { + ogs_error("OpenAPI_point_altitude_parseFromJSON() failed [shape]"); + goto end; + } + + OpenAPI_supported_gad_shapes_t *shape_local_nonprim = NULL; + + shape_local_nonprim = OpenAPI_supported_gad_shapes_parseFromJSON(shape); + + cJSON *point = cJSON_GetObjectItemCaseSensitive(point_altitudeJSON, "point"); + if (!point) { + ogs_error("OpenAPI_point_altitude_parseFromJSON() failed [point]"); + goto end; + } + + OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; + + point_local_nonprim = OpenAPI_geographical_coordinates_parseFromJSON(point); + + cJSON *altitude = cJSON_GetObjectItemCaseSensitive(point_altitudeJSON, "altitude"); + if (!altitude) { + ogs_error("OpenAPI_point_altitude_parseFromJSON() failed [altitude]"); + goto end; + } + + + if (!cJSON_IsNumber(altitude)) { + ogs_error("OpenAPI_point_altitude_parseFromJSON() failed [altitude]"); + goto end; + } + + point_altitude_local_var = OpenAPI_point_altitude_create ( + shape_local_nonprim, + point_local_nonprim, + altitude->valuedouble + ); + + return point_altitude_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/point_altitude.h b/lib/sbi/openapi/model/point_altitude.h new file mode 100644 index 0000000000..200bef67f4 --- /dev/null +++ b/lib/sbi/openapi/model/point_altitude.h @@ -0,0 +1,45 @@ +/* + * point_altitude.h + * + * + */ + +#ifndef _OpenAPI_point_altitude_H_ +#define _OpenAPI_point_altitude_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "gad_shape.h" +#include "geographical_coordinates.h" +#include "point_altitude_all_of.h" +#include "supported_gad_shapes.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_point_altitude_s OpenAPI_point_altitude_t; +typedef struct OpenAPI_point_altitude_s { + struct OpenAPI_supported_gad_shapes_s *shape; + struct OpenAPI_geographical_coordinates_s *point; + double altitude; +} OpenAPI_point_altitude_t; + +OpenAPI_point_altitude_t *OpenAPI_point_altitude_create( + OpenAPI_supported_gad_shapes_t *shape, + OpenAPI_geographical_coordinates_t *point, + double altitude + ); +void OpenAPI_point_altitude_free(OpenAPI_point_altitude_t *point_altitude); +OpenAPI_point_altitude_t *OpenAPI_point_altitude_parseFromJSON(cJSON *point_altitudeJSON); +cJSON *OpenAPI_point_altitude_convertToJSON(OpenAPI_point_altitude_t *point_altitude); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_point_altitude_H_ */ + diff --git a/lib/sbi/openapi/model/point_altitude_all_of.c b/lib/sbi/openapi/model/point_altitude_all_of.c new file mode 100644 index 0000000000..2d8e1183f2 --- /dev/null +++ b/lib/sbi/openapi/model/point_altitude_all_of.c @@ -0,0 +1,104 @@ + +#include +#include +#include +#include "point_altitude_all_of.h" + +OpenAPI_point_altitude_all_of_t *OpenAPI_point_altitude_all_of_create( + OpenAPI_geographical_coordinates_t *point, + double altitude + ) +{ + OpenAPI_point_altitude_all_of_t *point_altitude_all_of_local_var = OpenAPI_malloc(sizeof(OpenAPI_point_altitude_all_of_t)); + if (!point_altitude_all_of_local_var) { + return NULL; + } + point_altitude_all_of_local_var->point = point; + point_altitude_all_of_local_var->altitude = altitude; + + return point_altitude_all_of_local_var; +} + +void OpenAPI_point_altitude_all_of_free(OpenAPI_point_altitude_all_of_t *point_altitude_all_of) +{ + if (NULL == point_altitude_all_of) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_geographical_coordinates_free(point_altitude_all_of->point); + ogs_free(point_altitude_all_of); +} + +cJSON *OpenAPI_point_altitude_all_of_convertToJSON(OpenAPI_point_altitude_all_of_t *point_altitude_all_of) +{ + cJSON *item = NULL; + + if (point_altitude_all_of == NULL) { + ogs_error("OpenAPI_point_altitude_all_of_convertToJSON() failed [PointAltitude_allOf]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!point_altitude_all_of->point) { + ogs_error("OpenAPI_point_altitude_all_of_convertToJSON() failed [point]"); + goto end; + } + cJSON *point_local_JSON = OpenAPI_geographical_coordinates_convertToJSON(point_altitude_all_of->point); + if (point_local_JSON == NULL) { + ogs_error("OpenAPI_point_altitude_all_of_convertToJSON() failed [point]"); + goto end; + } + cJSON_AddItemToObject(item, "point", point_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_point_altitude_all_of_convertToJSON() failed [point]"); + goto end; + } + + if (!point_altitude_all_of->altitude) { + ogs_error("OpenAPI_point_altitude_all_of_convertToJSON() failed [altitude]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "altitude", point_altitude_all_of->altitude) == NULL) { + ogs_error("OpenAPI_point_altitude_all_of_convertToJSON() failed [altitude]"); + goto end; + } + +end: + return item; +} + +OpenAPI_point_altitude_all_of_t *OpenAPI_point_altitude_all_of_parseFromJSON(cJSON *point_altitude_all_ofJSON) +{ + OpenAPI_point_altitude_all_of_t *point_altitude_all_of_local_var = NULL; + cJSON *point = cJSON_GetObjectItemCaseSensitive(point_altitude_all_ofJSON, "point"); + if (!point) { + ogs_error("OpenAPI_point_altitude_all_of_parseFromJSON() failed [point]"); + goto end; + } + + OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; + + point_local_nonprim = OpenAPI_geographical_coordinates_parseFromJSON(point); + + cJSON *altitude = cJSON_GetObjectItemCaseSensitive(point_altitude_all_ofJSON, "altitude"); + if (!altitude) { + ogs_error("OpenAPI_point_altitude_all_of_parseFromJSON() failed [altitude]"); + goto end; + } + + + if (!cJSON_IsNumber(altitude)) { + ogs_error("OpenAPI_point_altitude_all_of_parseFromJSON() failed [altitude]"); + goto end; + } + + point_altitude_all_of_local_var = OpenAPI_point_altitude_all_of_create ( + point_local_nonprim, + altitude->valuedouble + ); + + return point_altitude_all_of_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/point_altitude_all_of.h b/lib/sbi/openapi/model/point_altitude_all_of.h new file mode 100644 index 0000000000..6e8a5c177b --- /dev/null +++ b/lib/sbi/openapi/model/point_altitude_all_of.h @@ -0,0 +1,40 @@ +/* + * point_altitude_all_of.h + * + * + */ + +#ifndef _OpenAPI_point_altitude_all_of_H_ +#define _OpenAPI_point_altitude_all_of_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "geographical_coordinates.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_point_altitude_all_of_s OpenAPI_point_altitude_all_of_t; +typedef struct OpenAPI_point_altitude_all_of_s { + struct OpenAPI_geographical_coordinates_s *point; + double altitude; +} OpenAPI_point_altitude_all_of_t; + +OpenAPI_point_altitude_all_of_t *OpenAPI_point_altitude_all_of_create( + OpenAPI_geographical_coordinates_t *point, + double altitude + ); +void OpenAPI_point_altitude_all_of_free(OpenAPI_point_altitude_all_of_t *point_altitude_all_of); +OpenAPI_point_altitude_all_of_t *OpenAPI_point_altitude_all_of_parseFromJSON(cJSON *point_altitude_all_ofJSON); +cJSON *OpenAPI_point_altitude_all_of_convertToJSON(OpenAPI_point_altitude_all_of_t *point_altitude_all_of); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_point_altitude_all_of_H_ */ + diff --git a/lib/sbi/openapi/model/point_altitude_uncertainty.c b/lib/sbi/openapi/model/point_altitude_uncertainty.c new file mode 100644 index 0000000000..5706ed0b41 --- /dev/null +++ b/lib/sbi/openapi/model/point_altitude_uncertainty.c @@ -0,0 +1,210 @@ + +#include +#include +#include +#include "point_altitude_uncertainty.h" + +OpenAPI_point_altitude_uncertainty_t *OpenAPI_point_altitude_uncertainty_create( + OpenAPI_supported_gad_shapes_t *shape, + OpenAPI_geographical_coordinates_t *point, + double altitude, + OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse, + float uncertainty_altitude, + int confidence + ) +{ + OpenAPI_point_altitude_uncertainty_t *point_altitude_uncertainty_local_var = OpenAPI_malloc(sizeof(OpenAPI_point_altitude_uncertainty_t)); + if (!point_altitude_uncertainty_local_var) { + return NULL; + } + point_altitude_uncertainty_local_var->shape = shape; + point_altitude_uncertainty_local_var->point = point; + point_altitude_uncertainty_local_var->altitude = altitude; + point_altitude_uncertainty_local_var->uncertainty_ellipse = uncertainty_ellipse; + point_altitude_uncertainty_local_var->uncertainty_altitude = uncertainty_altitude; + point_altitude_uncertainty_local_var->confidence = confidence; + + return point_altitude_uncertainty_local_var; +} + +void OpenAPI_point_altitude_uncertainty_free(OpenAPI_point_altitude_uncertainty_t *point_altitude_uncertainty) +{ + if (NULL == point_altitude_uncertainty) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_supported_gad_shapes_free(point_altitude_uncertainty->shape); + OpenAPI_geographical_coordinates_free(point_altitude_uncertainty->point); + OpenAPI_uncertainty_ellipse_free(point_altitude_uncertainty->uncertainty_ellipse); + ogs_free(point_altitude_uncertainty); +} + +cJSON *OpenAPI_point_altitude_uncertainty_convertToJSON(OpenAPI_point_altitude_uncertainty_t *point_altitude_uncertainty) +{ + cJSON *item = NULL; + + if (point_altitude_uncertainty == NULL) { + ogs_error("OpenAPI_point_altitude_uncertainty_convertToJSON() failed [PointAltitudeUncertainty]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!point_altitude_uncertainty->shape) { + ogs_error("OpenAPI_point_altitude_uncertainty_convertToJSON() failed [shape]"); + goto end; + } + cJSON *shape_local_JSON = OpenAPI_supported_gad_shapes_convertToJSON(point_altitude_uncertainty->shape); + if (shape_local_JSON == NULL) { + ogs_error("OpenAPI_point_altitude_uncertainty_convertToJSON() failed [shape]"); + goto end; + } + cJSON_AddItemToObject(item, "shape", shape_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_point_altitude_uncertainty_convertToJSON() failed [shape]"); + goto end; + } + + if (!point_altitude_uncertainty->point) { + ogs_error("OpenAPI_point_altitude_uncertainty_convertToJSON() failed [point]"); + goto end; + } + cJSON *point_local_JSON = OpenAPI_geographical_coordinates_convertToJSON(point_altitude_uncertainty->point); + if (point_local_JSON == NULL) { + ogs_error("OpenAPI_point_altitude_uncertainty_convertToJSON() failed [point]"); + goto end; + } + cJSON_AddItemToObject(item, "point", point_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_point_altitude_uncertainty_convertToJSON() failed [point]"); + goto end; + } + + if (!point_altitude_uncertainty->altitude) { + ogs_error("OpenAPI_point_altitude_uncertainty_convertToJSON() failed [altitude]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "altitude", point_altitude_uncertainty->altitude) == NULL) { + ogs_error("OpenAPI_point_altitude_uncertainty_convertToJSON() failed [altitude]"); + goto end; + } + + if (!point_altitude_uncertainty->uncertainty_ellipse) { + ogs_error("OpenAPI_point_altitude_uncertainty_convertToJSON() failed [uncertainty_ellipse]"); + goto end; + } + cJSON *uncertainty_ellipse_local_JSON = OpenAPI_uncertainty_ellipse_convertToJSON(point_altitude_uncertainty->uncertainty_ellipse); + if (uncertainty_ellipse_local_JSON == NULL) { + ogs_error("OpenAPI_point_altitude_uncertainty_convertToJSON() failed [uncertainty_ellipse]"); + goto end; + } + cJSON_AddItemToObject(item, "uncertaintyEllipse", uncertainty_ellipse_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_point_altitude_uncertainty_convertToJSON() failed [uncertainty_ellipse]"); + goto end; + } + + if (!point_altitude_uncertainty->uncertainty_altitude) { + ogs_error("OpenAPI_point_altitude_uncertainty_convertToJSON() failed [uncertainty_altitude]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "uncertaintyAltitude", point_altitude_uncertainty->uncertainty_altitude) == NULL) { + ogs_error("OpenAPI_point_altitude_uncertainty_convertToJSON() failed [uncertainty_altitude]"); + goto end; + } + + if (!point_altitude_uncertainty->confidence) { + ogs_error("OpenAPI_point_altitude_uncertainty_convertToJSON() failed [confidence]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "confidence", point_altitude_uncertainty->confidence) == NULL) { + ogs_error("OpenAPI_point_altitude_uncertainty_convertToJSON() failed [confidence]"); + goto end; + } + +end: + return item; +} + +OpenAPI_point_altitude_uncertainty_t *OpenAPI_point_altitude_uncertainty_parseFromJSON(cJSON *point_altitude_uncertaintyJSON) +{ + OpenAPI_point_altitude_uncertainty_t *point_altitude_uncertainty_local_var = NULL; + cJSON *shape = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertaintyJSON, "shape"); + if (!shape) { + ogs_error("OpenAPI_point_altitude_uncertainty_parseFromJSON() failed [shape]"); + goto end; + } + + OpenAPI_supported_gad_shapes_t *shape_local_nonprim = NULL; + + shape_local_nonprim = OpenAPI_supported_gad_shapes_parseFromJSON(shape); + + cJSON *point = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertaintyJSON, "point"); + if (!point) { + ogs_error("OpenAPI_point_altitude_uncertainty_parseFromJSON() failed [point]"); + goto end; + } + + OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; + + point_local_nonprim = OpenAPI_geographical_coordinates_parseFromJSON(point); + + cJSON *altitude = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertaintyJSON, "altitude"); + if (!altitude) { + ogs_error("OpenAPI_point_altitude_uncertainty_parseFromJSON() failed [altitude]"); + goto end; + } + + + if (!cJSON_IsNumber(altitude)) { + ogs_error("OpenAPI_point_altitude_uncertainty_parseFromJSON() failed [altitude]"); + goto end; + } + + cJSON *uncertainty_ellipse = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertaintyJSON, "uncertaintyEllipse"); + if (!uncertainty_ellipse) { + ogs_error("OpenAPI_point_altitude_uncertainty_parseFromJSON() failed [uncertainty_ellipse]"); + goto end; + } + + OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse_local_nonprim = NULL; + + uncertainty_ellipse_local_nonprim = OpenAPI_uncertainty_ellipse_parseFromJSON(uncertainty_ellipse); + + cJSON *uncertainty_altitude = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertaintyJSON, "uncertaintyAltitude"); + if (!uncertainty_altitude) { + ogs_error("OpenAPI_point_altitude_uncertainty_parseFromJSON() failed [uncertainty_altitude]"); + goto end; + } + + + if (!cJSON_IsNumber(uncertainty_altitude)) { + ogs_error("OpenAPI_point_altitude_uncertainty_parseFromJSON() failed [uncertainty_altitude]"); + goto end; + } + + cJSON *confidence = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertaintyJSON, "confidence"); + if (!confidence) { + ogs_error("OpenAPI_point_altitude_uncertainty_parseFromJSON() failed [confidence]"); + goto end; + } + + + if (!cJSON_IsNumber(confidence)) { + ogs_error("OpenAPI_point_altitude_uncertainty_parseFromJSON() failed [confidence]"); + goto end; + } + + point_altitude_uncertainty_local_var = OpenAPI_point_altitude_uncertainty_create ( + shape_local_nonprim, + point_local_nonprim, + altitude->valuedouble, + uncertainty_ellipse_local_nonprim, + uncertainty_altitude->valuedouble, + confidence->valuedouble + ); + + return point_altitude_uncertainty_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/point_altitude_uncertainty.h b/lib/sbi/openapi/model/point_altitude_uncertainty.h new file mode 100644 index 0000000000..ed49a53116 --- /dev/null +++ b/lib/sbi/openapi/model/point_altitude_uncertainty.h @@ -0,0 +1,52 @@ +/* + * point_altitude_uncertainty.h + * + * + */ + +#ifndef _OpenAPI_point_altitude_uncertainty_H_ +#define _OpenAPI_point_altitude_uncertainty_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "gad_shape.h" +#include "geographical_coordinates.h" +#include "point_altitude_uncertainty_all_of.h" +#include "supported_gad_shapes.h" +#include "uncertainty_ellipse.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_point_altitude_uncertainty_s OpenAPI_point_altitude_uncertainty_t; +typedef struct OpenAPI_point_altitude_uncertainty_s { + struct OpenAPI_supported_gad_shapes_s *shape; + struct OpenAPI_geographical_coordinates_s *point; + double altitude; + struct OpenAPI_uncertainty_ellipse_s *uncertainty_ellipse; + float uncertainty_altitude; + int confidence; +} OpenAPI_point_altitude_uncertainty_t; + +OpenAPI_point_altitude_uncertainty_t *OpenAPI_point_altitude_uncertainty_create( + OpenAPI_supported_gad_shapes_t *shape, + OpenAPI_geographical_coordinates_t *point, + double altitude, + OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse, + float uncertainty_altitude, + int confidence + ); +void OpenAPI_point_altitude_uncertainty_free(OpenAPI_point_altitude_uncertainty_t *point_altitude_uncertainty); +OpenAPI_point_altitude_uncertainty_t *OpenAPI_point_altitude_uncertainty_parseFromJSON(cJSON *point_altitude_uncertaintyJSON); +cJSON *OpenAPI_point_altitude_uncertainty_convertToJSON(OpenAPI_point_altitude_uncertainty_t *point_altitude_uncertainty); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_point_altitude_uncertainty_H_ */ + diff --git a/lib/sbi/openapi/model/point_altitude_uncertainty_all_of.c b/lib/sbi/openapi/model/point_altitude_uncertainty_all_of.c new file mode 100644 index 0000000000..e40cf36ae2 --- /dev/null +++ b/lib/sbi/openapi/model/point_altitude_uncertainty_all_of.c @@ -0,0 +1,181 @@ + +#include +#include +#include +#include "point_altitude_uncertainty_all_of.h" + +OpenAPI_point_altitude_uncertainty_all_of_t *OpenAPI_point_altitude_uncertainty_all_of_create( + OpenAPI_geographical_coordinates_t *point, + double altitude, + OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse, + float uncertainty_altitude, + int confidence + ) +{ + OpenAPI_point_altitude_uncertainty_all_of_t *point_altitude_uncertainty_all_of_local_var = OpenAPI_malloc(sizeof(OpenAPI_point_altitude_uncertainty_all_of_t)); + if (!point_altitude_uncertainty_all_of_local_var) { + return NULL; + } + point_altitude_uncertainty_all_of_local_var->point = point; + point_altitude_uncertainty_all_of_local_var->altitude = altitude; + point_altitude_uncertainty_all_of_local_var->uncertainty_ellipse = uncertainty_ellipse; + point_altitude_uncertainty_all_of_local_var->uncertainty_altitude = uncertainty_altitude; + point_altitude_uncertainty_all_of_local_var->confidence = confidence; + + return point_altitude_uncertainty_all_of_local_var; +} + +void OpenAPI_point_altitude_uncertainty_all_of_free(OpenAPI_point_altitude_uncertainty_all_of_t *point_altitude_uncertainty_all_of) +{ + if (NULL == point_altitude_uncertainty_all_of) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_geographical_coordinates_free(point_altitude_uncertainty_all_of->point); + OpenAPI_uncertainty_ellipse_free(point_altitude_uncertainty_all_of->uncertainty_ellipse); + ogs_free(point_altitude_uncertainty_all_of); +} + +cJSON *OpenAPI_point_altitude_uncertainty_all_of_convertToJSON(OpenAPI_point_altitude_uncertainty_all_of_t *point_altitude_uncertainty_all_of) +{ + cJSON *item = NULL; + + if (point_altitude_uncertainty_all_of == NULL) { + ogs_error("OpenAPI_point_altitude_uncertainty_all_of_convertToJSON() failed [PointAltitudeUncertainty_allOf]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!point_altitude_uncertainty_all_of->point) { + ogs_error("OpenAPI_point_altitude_uncertainty_all_of_convertToJSON() failed [point]"); + goto end; + } + cJSON *point_local_JSON = OpenAPI_geographical_coordinates_convertToJSON(point_altitude_uncertainty_all_of->point); + if (point_local_JSON == NULL) { + ogs_error("OpenAPI_point_altitude_uncertainty_all_of_convertToJSON() failed [point]"); + goto end; + } + cJSON_AddItemToObject(item, "point", point_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_point_altitude_uncertainty_all_of_convertToJSON() failed [point]"); + goto end; + } + + if (!point_altitude_uncertainty_all_of->altitude) { + ogs_error("OpenAPI_point_altitude_uncertainty_all_of_convertToJSON() failed [altitude]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "altitude", point_altitude_uncertainty_all_of->altitude) == NULL) { + ogs_error("OpenAPI_point_altitude_uncertainty_all_of_convertToJSON() failed [altitude]"); + goto end; + } + + if (!point_altitude_uncertainty_all_of->uncertainty_ellipse) { + ogs_error("OpenAPI_point_altitude_uncertainty_all_of_convertToJSON() failed [uncertainty_ellipse]"); + goto end; + } + cJSON *uncertainty_ellipse_local_JSON = OpenAPI_uncertainty_ellipse_convertToJSON(point_altitude_uncertainty_all_of->uncertainty_ellipse); + if (uncertainty_ellipse_local_JSON == NULL) { + ogs_error("OpenAPI_point_altitude_uncertainty_all_of_convertToJSON() failed [uncertainty_ellipse]"); + goto end; + } + cJSON_AddItemToObject(item, "uncertaintyEllipse", uncertainty_ellipse_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_point_altitude_uncertainty_all_of_convertToJSON() failed [uncertainty_ellipse]"); + goto end; + } + + if (!point_altitude_uncertainty_all_of->uncertainty_altitude) { + ogs_error("OpenAPI_point_altitude_uncertainty_all_of_convertToJSON() failed [uncertainty_altitude]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "uncertaintyAltitude", point_altitude_uncertainty_all_of->uncertainty_altitude) == NULL) { + ogs_error("OpenAPI_point_altitude_uncertainty_all_of_convertToJSON() failed [uncertainty_altitude]"); + goto end; + } + + if (!point_altitude_uncertainty_all_of->confidence) { + ogs_error("OpenAPI_point_altitude_uncertainty_all_of_convertToJSON() failed [confidence]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "confidence", point_altitude_uncertainty_all_of->confidence) == NULL) { + ogs_error("OpenAPI_point_altitude_uncertainty_all_of_convertToJSON() failed [confidence]"); + goto end; + } + +end: + return item; +} + +OpenAPI_point_altitude_uncertainty_all_of_t *OpenAPI_point_altitude_uncertainty_all_of_parseFromJSON(cJSON *point_altitude_uncertainty_all_ofJSON) +{ + OpenAPI_point_altitude_uncertainty_all_of_t *point_altitude_uncertainty_all_of_local_var = NULL; + cJSON *point = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertainty_all_ofJSON, "point"); + if (!point) { + ogs_error("OpenAPI_point_altitude_uncertainty_all_of_parseFromJSON() failed [point]"); + goto end; + } + + OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; + + point_local_nonprim = OpenAPI_geographical_coordinates_parseFromJSON(point); + + cJSON *altitude = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertainty_all_ofJSON, "altitude"); + if (!altitude) { + ogs_error("OpenAPI_point_altitude_uncertainty_all_of_parseFromJSON() failed [altitude]"); + goto end; + } + + + if (!cJSON_IsNumber(altitude)) { + ogs_error("OpenAPI_point_altitude_uncertainty_all_of_parseFromJSON() failed [altitude]"); + goto end; + } + + cJSON *uncertainty_ellipse = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertainty_all_ofJSON, "uncertaintyEllipse"); + if (!uncertainty_ellipse) { + ogs_error("OpenAPI_point_altitude_uncertainty_all_of_parseFromJSON() failed [uncertainty_ellipse]"); + goto end; + } + + OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse_local_nonprim = NULL; + + uncertainty_ellipse_local_nonprim = OpenAPI_uncertainty_ellipse_parseFromJSON(uncertainty_ellipse); + + cJSON *uncertainty_altitude = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertainty_all_ofJSON, "uncertaintyAltitude"); + if (!uncertainty_altitude) { + ogs_error("OpenAPI_point_altitude_uncertainty_all_of_parseFromJSON() failed [uncertainty_altitude]"); + goto end; + } + + + if (!cJSON_IsNumber(uncertainty_altitude)) { + ogs_error("OpenAPI_point_altitude_uncertainty_all_of_parseFromJSON() failed [uncertainty_altitude]"); + goto end; + } + + cJSON *confidence = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertainty_all_ofJSON, "confidence"); + if (!confidence) { + ogs_error("OpenAPI_point_altitude_uncertainty_all_of_parseFromJSON() failed [confidence]"); + goto end; + } + + + if (!cJSON_IsNumber(confidence)) { + ogs_error("OpenAPI_point_altitude_uncertainty_all_of_parseFromJSON() failed [confidence]"); + goto end; + } + + point_altitude_uncertainty_all_of_local_var = OpenAPI_point_altitude_uncertainty_all_of_create ( + point_local_nonprim, + altitude->valuedouble, + uncertainty_ellipse_local_nonprim, + uncertainty_altitude->valuedouble, + confidence->valuedouble + ); + + return point_altitude_uncertainty_all_of_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/point_altitude_uncertainty_all_of.h b/lib/sbi/openapi/model/point_altitude_uncertainty_all_of.h new file mode 100644 index 0000000000..e11f2c989e --- /dev/null +++ b/lib/sbi/openapi/model/point_altitude_uncertainty_all_of.h @@ -0,0 +1,47 @@ +/* + * point_altitude_uncertainty_all_of.h + * + * + */ + +#ifndef _OpenAPI_point_altitude_uncertainty_all_of_H_ +#define _OpenAPI_point_altitude_uncertainty_all_of_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "geographical_coordinates.h" +#include "uncertainty_ellipse.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_point_altitude_uncertainty_all_of_s OpenAPI_point_altitude_uncertainty_all_of_t; +typedef struct OpenAPI_point_altitude_uncertainty_all_of_s { + struct OpenAPI_geographical_coordinates_s *point; + double altitude; + struct OpenAPI_uncertainty_ellipse_s *uncertainty_ellipse; + float uncertainty_altitude; + int confidence; +} OpenAPI_point_altitude_uncertainty_all_of_t; + +OpenAPI_point_altitude_uncertainty_all_of_t *OpenAPI_point_altitude_uncertainty_all_of_create( + OpenAPI_geographical_coordinates_t *point, + double altitude, + OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse, + float uncertainty_altitude, + int confidence + ); +void OpenAPI_point_altitude_uncertainty_all_of_free(OpenAPI_point_altitude_uncertainty_all_of_t *point_altitude_uncertainty_all_of); +OpenAPI_point_altitude_uncertainty_all_of_t *OpenAPI_point_altitude_uncertainty_all_of_parseFromJSON(cJSON *point_altitude_uncertainty_all_ofJSON); +cJSON *OpenAPI_point_altitude_uncertainty_all_of_convertToJSON(OpenAPI_point_altitude_uncertainty_all_of_t *point_altitude_uncertainty_all_of); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_point_altitude_uncertainty_all_of_H_ */ + diff --git a/lib/sbi/openapi/model/point_uncertainty_circle.c b/lib/sbi/openapi/model/point_uncertainty_circle.c new file mode 100644 index 0000000000..b6239e12ff --- /dev/null +++ b/lib/sbi/openapi/model/point_uncertainty_circle.c @@ -0,0 +1,133 @@ + +#include +#include +#include +#include "point_uncertainty_circle.h" + +OpenAPI_point_uncertainty_circle_t *OpenAPI_point_uncertainty_circle_create( + OpenAPI_supported_gad_shapes_t *shape, + OpenAPI_geographical_coordinates_t *point, + float uncertainty + ) +{ + OpenAPI_point_uncertainty_circle_t *point_uncertainty_circle_local_var = OpenAPI_malloc(sizeof(OpenAPI_point_uncertainty_circle_t)); + if (!point_uncertainty_circle_local_var) { + return NULL; + } + point_uncertainty_circle_local_var->shape = shape; + point_uncertainty_circle_local_var->point = point; + point_uncertainty_circle_local_var->uncertainty = uncertainty; + + return point_uncertainty_circle_local_var; +} + +void OpenAPI_point_uncertainty_circle_free(OpenAPI_point_uncertainty_circle_t *point_uncertainty_circle) +{ + if (NULL == point_uncertainty_circle) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_supported_gad_shapes_free(point_uncertainty_circle->shape); + OpenAPI_geographical_coordinates_free(point_uncertainty_circle->point); + ogs_free(point_uncertainty_circle); +} + +cJSON *OpenAPI_point_uncertainty_circle_convertToJSON(OpenAPI_point_uncertainty_circle_t *point_uncertainty_circle) +{ + cJSON *item = NULL; + + if (point_uncertainty_circle == NULL) { + ogs_error("OpenAPI_point_uncertainty_circle_convertToJSON() failed [PointUncertaintyCircle]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!point_uncertainty_circle->shape) { + ogs_error("OpenAPI_point_uncertainty_circle_convertToJSON() failed [shape]"); + goto end; + } + cJSON *shape_local_JSON = OpenAPI_supported_gad_shapes_convertToJSON(point_uncertainty_circle->shape); + if (shape_local_JSON == NULL) { + ogs_error("OpenAPI_point_uncertainty_circle_convertToJSON() failed [shape]"); + goto end; + } + cJSON_AddItemToObject(item, "shape", shape_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_point_uncertainty_circle_convertToJSON() failed [shape]"); + goto end; + } + + if (!point_uncertainty_circle->point) { + ogs_error("OpenAPI_point_uncertainty_circle_convertToJSON() failed [point]"); + goto end; + } + cJSON *point_local_JSON = OpenAPI_geographical_coordinates_convertToJSON(point_uncertainty_circle->point); + if (point_local_JSON == NULL) { + ogs_error("OpenAPI_point_uncertainty_circle_convertToJSON() failed [point]"); + goto end; + } + cJSON_AddItemToObject(item, "point", point_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_point_uncertainty_circle_convertToJSON() failed [point]"); + goto end; + } + + if (!point_uncertainty_circle->uncertainty) { + ogs_error("OpenAPI_point_uncertainty_circle_convertToJSON() failed [uncertainty]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "uncertainty", point_uncertainty_circle->uncertainty) == NULL) { + ogs_error("OpenAPI_point_uncertainty_circle_convertToJSON() failed [uncertainty]"); + goto end; + } + +end: + return item; +} + +OpenAPI_point_uncertainty_circle_t *OpenAPI_point_uncertainty_circle_parseFromJSON(cJSON *point_uncertainty_circleJSON) +{ + OpenAPI_point_uncertainty_circle_t *point_uncertainty_circle_local_var = NULL; + cJSON *shape = cJSON_GetObjectItemCaseSensitive(point_uncertainty_circleJSON, "shape"); + if (!shape) { + ogs_error("OpenAPI_point_uncertainty_circle_parseFromJSON() failed [shape]"); + goto end; + } + + OpenAPI_supported_gad_shapes_t *shape_local_nonprim = NULL; + + shape_local_nonprim = OpenAPI_supported_gad_shapes_parseFromJSON(shape); + + cJSON *point = cJSON_GetObjectItemCaseSensitive(point_uncertainty_circleJSON, "point"); + if (!point) { + ogs_error("OpenAPI_point_uncertainty_circle_parseFromJSON() failed [point]"); + goto end; + } + + OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; + + point_local_nonprim = OpenAPI_geographical_coordinates_parseFromJSON(point); + + cJSON *uncertainty = cJSON_GetObjectItemCaseSensitive(point_uncertainty_circleJSON, "uncertainty"); + if (!uncertainty) { + ogs_error("OpenAPI_point_uncertainty_circle_parseFromJSON() failed [uncertainty]"); + goto end; + } + + + if (!cJSON_IsNumber(uncertainty)) { + ogs_error("OpenAPI_point_uncertainty_circle_parseFromJSON() failed [uncertainty]"); + goto end; + } + + point_uncertainty_circle_local_var = OpenAPI_point_uncertainty_circle_create ( + shape_local_nonprim, + point_local_nonprim, + uncertainty->valuedouble + ); + + return point_uncertainty_circle_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/point_uncertainty_circle.h b/lib/sbi/openapi/model/point_uncertainty_circle.h new file mode 100644 index 0000000000..feea282c04 --- /dev/null +++ b/lib/sbi/openapi/model/point_uncertainty_circle.h @@ -0,0 +1,45 @@ +/* + * point_uncertainty_circle.h + * + * + */ + +#ifndef _OpenAPI_point_uncertainty_circle_H_ +#define _OpenAPI_point_uncertainty_circle_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "gad_shape.h" +#include "geographical_coordinates.h" +#include "point_uncertainty_circle_all_of.h" +#include "supported_gad_shapes.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_point_uncertainty_circle_s OpenAPI_point_uncertainty_circle_t; +typedef struct OpenAPI_point_uncertainty_circle_s { + struct OpenAPI_supported_gad_shapes_s *shape; + struct OpenAPI_geographical_coordinates_s *point; + float uncertainty; +} OpenAPI_point_uncertainty_circle_t; + +OpenAPI_point_uncertainty_circle_t *OpenAPI_point_uncertainty_circle_create( + OpenAPI_supported_gad_shapes_t *shape, + OpenAPI_geographical_coordinates_t *point, + float uncertainty + ); +void OpenAPI_point_uncertainty_circle_free(OpenAPI_point_uncertainty_circle_t *point_uncertainty_circle); +OpenAPI_point_uncertainty_circle_t *OpenAPI_point_uncertainty_circle_parseFromJSON(cJSON *point_uncertainty_circleJSON); +cJSON *OpenAPI_point_uncertainty_circle_convertToJSON(OpenAPI_point_uncertainty_circle_t *point_uncertainty_circle); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_point_uncertainty_circle_H_ */ + diff --git a/lib/sbi/openapi/model/point_uncertainty_circle_all_of.c b/lib/sbi/openapi/model/point_uncertainty_circle_all_of.c new file mode 100644 index 0000000000..f2235a36d7 --- /dev/null +++ b/lib/sbi/openapi/model/point_uncertainty_circle_all_of.c @@ -0,0 +1,104 @@ + +#include +#include +#include +#include "point_uncertainty_circle_all_of.h" + +OpenAPI_point_uncertainty_circle_all_of_t *OpenAPI_point_uncertainty_circle_all_of_create( + OpenAPI_geographical_coordinates_t *point, + float uncertainty + ) +{ + OpenAPI_point_uncertainty_circle_all_of_t *point_uncertainty_circle_all_of_local_var = OpenAPI_malloc(sizeof(OpenAPI_point_uncertainty_circle_all_of_t)); + if (!point_uncertainty_circle_all_of_local_var) { + return NULL; + } + point_uncertainty_circle_all_of_local_var->point = point; + point_uncertainty_circle_all_of_local_var->uncertainty = uncertainty; + + return point_uncertainty_circle_all_of_local_var; +} + +void OpenAPI_point_uncertainty_circle_all_of_free(OpenAPI_point_uncertainty_circle_all_of_t *point_uncertainty_circle_all_of) +{ + if (NULL == point_uncertainty_circle_all_of) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_geographical_coordinates_free(point_uncertainty_circle_all_of->point); + ogs_free(point_uncertainty_circle_all_of); +} + +cJSON *OpenAPI_point_uncertainty_circle_all_of_convertToJSON(OpenAPI_point_uncertainty_circle_all_of_t *point_uncertainty_circle_all_of) +{ + cJSON *item = NULL; + + if (point_uncertainty_circle_all_of == NULL) { + ogs_error("OpenAPI_point_uncertainty_circle_all_of_convertToJSON() failed [PointUncertaintyCircle_allOf]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!point_uncertainty_circle_all_of->point) { + ogs_error("OpenAPI_point_uncertainty_circle_all_of_convertToJSON() failed [point]"); + goto end; + } + cJSON *point_local_JSON = OpenAPI_geographical_coordinates_convertToJSON(point_uncertainty_circle_all_of->point); + if (point_local_JSON == NULL) { + ogs_error("OpenAPI_point_uncertainty_circle_all_of_convertToJSON() failed [point]"); + goto end; + } + cJSON_AddItemToObject(item, "point", point_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_point_uncertainty_circle_all_of_convertToJSON() failed [point]"); + goto end; + } + + if (!point_uncertainty_circle_all_of->uncertainty) { + ogs_error("OpenAPI_point_uncertainty_circle_all_of_convertToJSON() failed [uncertainty]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "uncertainty", point_uncertainty_circle_all_of->uncertainty) == NULL) { + ogs_error("OpenAPI_point_uncertainty_circle_all_of_convertToJSON() failed [uncertainty]"); + goto end; + } + +end: + return item; +} + +OpenAPI_point_uncertainty_circle_all_of_t *OpenAPI_point_uncertainty_circle_all_of_parseFromJSON(cJSON *point_uncertainty_circle_all_ofJSON) +{ + OpenAPI_point_uncertainty_circle_all_of_t *point_uncertainty_circle_all_of_local_var = NULL; + cJSON *point = cJSON_GetObjectItemCaseSensitive(point_uncertainty_circle_all_ofJSON, "point"); + if (!point) { + ogs_error("OpenAPI_point_uncertainty_circle_all_of_parseFromJSON() failed [point]"); + goto end; + } + + OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; + + point_local_nonprim = OpenAPI_geographical_coordinates_parseFromJSON(point); + + cJSON *uncertainty = cJSON_GetObjectItemCaseSensitive(point_uncertainty_circle_all_ofJSON, "uncertainty"); + if (!uncertainty) { + ogs_error("OpenAPI_point_uncertainty_circle_all_of_parseFromJSON() failed [uncertainty]"); + goto end; + } + + + if (!cJSON_IsNumber(uncertainty)) { + ogs_error("OpenAPI_point_uncertainty_circle_all_of_parseFromJSON() failed [uncertainty]"); + goto end; + } + + point_uncertainty_circle_all_of_local_var = OpenAPI_point_uncertainty_circle_all_of_create ( + point_local_nonprim, + uncertainty->valuedouble + ); + + return point_uncertainty_circle_all_of_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/point_uncertainty_circle_all_of.h b/lib/sbi/openapi/model/point_uncertainty_circle_all_of.h new file mode 100644 index 0000000000..d280e3cce2 --- /dev/null +++ b/lib/sbi/openapi/model/point_uncertainty_circle_all_of.h @@ -0,0 +1,40 @@ +/* + * point_uncertainty_circle_all_of.h + * + * + */ + +#ifndef _OpenAPI_point_uncertainty_circle_all_of_H_ +#define _OpenAPI_point_uncertainty_circle_all_of_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "geographical_coordinates.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_point_uncertainty_circle_all_of_s OpenAPI_point_uncertainty_circle_all_of_t; +typedef struct OpenAPI_point_uncertainty_circle_all_of_s { + struct OpenAPI_geographical_coordinates_s *point; + float uncertainty; +} OpenAPI_point_uncertainty_circle_all_of_t; + +OpenAPI_point_uncertainty_circle_all_of_t *OpenAPI_point_uncertainty_circle_all_of_create( + OpenAPI_geographical_coordinates_t *point, + float uncertainty + ); +void OpenAPI_point_uncertainty_circle_all_of_free(OpenAPI_point_uncertainty_circle_all_of_t *point_uncertainty_circle_all_of); +OpenAPI_point_uncertainty_circle_all_of_t *OpenAPI_point_uncertainty_circle_all_of_parseFromJSON(cJSON *point_uncertainty_circle_all_ofJSON); +cJSON *OpenAPI_point_uncertainty_circle_all_of_convertToJSON(OpenAPI_point_uncertainty_circle_all_of_t *point_uncertainty_circle_all_of); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_point_uncertainty_circle_all_of_H_ */ + diff --git a/lib/sbi/openapi/model/point_uncertainty_ellipse.c b/lib/sbi/openapi/model/point_uncertainty_ellipse.c new file mode 100644 index 0000000000..4f64bc3e6e --- /dev/null +++ b/lib/sbi/openapi/model/point_uncertainty_ellipse.c @@ -0,0 +1,162 @@ + +#include +#include +#include +#include "point_uncertainty_ellipse.h" + +OpenAPI_point_uncertainty_ellipse_t *OpenAPI_point_uncertainty_ellipse_create( + OpenAPI_supported_gad_shapes_t *shape, + OpenAPI_geographical_coordinates_t *point, + OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse, + int confidence + ) +{ + OpenAPI_point_uncertainty_ellipse_t *point_uncertainty_ellipse_local_var = OpenAPI_malloc(sizeof(OpenAPI_point_uncertainty_ellipse_t)); + if (!point_uncertainty_ellipse_local_var) { + return NULL; + } + point_uncertainty_ellipse_local_var->shape = shape; + point_uncertainty_ellipse_local_var->point = point; + point_uncertainty_ellipse_local_var->uncertainty_ellipse = uncertainty_ellipse; + point_uncertainty_ellipse_local_var->confidence = confidence; + + return point_uncertainty_ellipse_local_var; +} + +void OpenAPI_point_uncertainty_ellipse_free(OpenAPI_point_uncertainty_ellipse_t *point_uncertainty_ellipse) +{ + if (NULL == point_uncertainty_ellipse) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_supported_gad_shapes_free(point_uncertainty_ellipse->shape); + OpenAPI_geographical_coordinates_free(point_uncertainty_ellipse->point); + OpenAPI_uncertainty_ellipse_free(point_uncertainty_ellipse->uncertainty_ellipse); + ogs_free(point_uncertainty_ellipse); +} + +cJSON *OpenAPI_point_uncertainty_ellipse_convertToJSON(OpenAPI_point_uncertainty_ellipse_t *point_uncertainty_ellipse) +{ + cJSON *item = NULL; + + if (point_uncertainty_ellipse == NULL) { + ogs_error("OpenAPI_point_uncertainty_ellipse_convertToJSON() failed [PointUncertaintyEllipse]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!point_uncertainty_ellipse->shape) { + ogs_error("OpenAPI_point_uncertainty_ellipse_convertToJSON() failed [shape]"); + goto end; + } + cJSON *shape_local_JSON = OpenAPI_supported_gad_shapes_convertToJSON(point_uncertainty_ellipse->shape); + if (shape_local_JSON == NULL) { + ogs_error("OpenAPI_point_uncertainty_ellipse_convertToJSON() failed [shape]"); + goto end; + } + cJSON_AddItemToObject(item, "shape", shape_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_point_uncertainty_ellipse_convertToJSON() failed [shape]"); + goto end; + } + + if (!point_uncertainty_ellipse->point) { + ogs_error("OpenAPI_point_uncertainty_ellipse_convertToJSON() failed [point]"); + goto end; + } + cJSON *point_local_JSON = OpenAPI_geographical_coordinates_convertToJSON(point_uncertainty_ellipse->point); + if (point_local_JSON == NULL) { + ogs_error("OpenAPI_point_uncertainty_ellipse_convertToJSON() failed [point]"); + goto end; + } + cJSON_AddItemToObject(item, "point", point_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_point_uncertainty_ellipse_convertToJSON() failed [point]"); + goto end; + } + + if (!point_uncertainty_ellipse->uncertainty_ellipse) { + ogs_error("OpenAPI_point_uncertainty_ellipse_convertToJSON() failed [uncertainty_ellipse]"); + goto end; + } + cJSON *uncertainty_ellipse_local_JSON = OpenAPI_uncertainty_ellipse_convertToJSON(point_uncertainty_ellipse->uncertainty_ellipse); + if (uncertainty_ellipse_local_JSON == NULL) { + ogs_error("OpenAPI_point_uncertainty_ellipse_convertToJSON() failed [uncertainty_ellipse]"); + goto end; + } + cJSON_AddItemToObject(item, "uncertaintyEllipse", uncertainty_ellipse_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_point_uncertainty_ellipse_convertToJSON() failed [uncertainty_ellipse]"); + goto end; + } + + if (!point_uncertainty_ellipse->confidence) { + ogs_error("OpenAPI_point_uncertainty_ellipse_convertToJSON() failed [confidence]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "confidence", point_uncertainty_ellipse->confidence) == NULL) { + ogs_error("OpenAPI_point_uncertainty_ellipse_convertToJSON() failed [confidence]"); + goto end; + } + +end: + return item; +} + +OpenAPI_point_uncertainty_ellipse_t *OpenAPI_point_uncertainty_ellipse_parseFromJSON(cJSON *point_uncertainty_ellipseJSON) +{ + OpenAPI_point_uncertainty_ellipse_t *point_uncertainty_ellipse_local_var = NULL; + cJSON *shape = cJSON_GetObjectItemCaseSensitive(point_uncertainty_ellipseJSON, "shape"); + if (!shape) { + ogs_error("OpenAPI_point_uncertainty_ellipse_parseFromJSON() failed [shape]"); + goto end; + } + + OpenAPI_supported_gad_shapes_t *shape_local_nonprim = NULL; + + shape_local_nonprim = OpenAPI_supported_gad_shapes_parseFromJSON(shape); + + cJSON *point = cJSON_GetObjectItemCaseSensitive(point_uncertainty_ellipseJSON, "point"); + if (!point) { + ogs_error("OpenAPI_point_uncertainty_ellipse_parseFromJSON() failed [point]"); + goto end; + } + + OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; + + point_local_nonprim = OpenAPI_geographical_coordinates_parseFromJSON(point); + + cJSON *uncertainty_ellipse = cJSON_GetObjectItemCaseSensitive(point_uncertainty_ellipseJSON, "uncertaintyEllipse"); + if (!uncertainty_ellipse) { + ogs_error("OpenAPI_point_uncertainty_ellipse_parseFromJSON() failed [uncertainty_ellipse]"); + goto end; + } + + OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse_local_nonprim = NULL; + + uncertainty_ellipse_local_nonprim = OpenAPI_uncertainty_ellipse_parseFromJSON(uncertainty_ellipse); + + cJSON *confidence = cJSON_GetObjectItemCaseSensitive(point_uncertainty_ellipseJSON, "confidence"); + if (!confidence) { + ogs_error("OpenAPI_point_uncertainty_ellipse_parseFromJSON() failed [confidence]"); + goto end; + } + + + if (!cJSON_IsNumber(confidence)) { + ogs_error("OpenAPI_point_uncertainty_ellipse_parseFromJSON() failed [confidence]"); + goto end; + } + + point_uncertainty_ellipse_local_var = OpenAPI_point_uncertainty_ellipse_create ( + shape_local_nonprim, + point_local_nonprim, + uncertainty_ellipse_local_nonprim, + confidence->valuedouble + ); + + return point_uncertainty_ellipse_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/point_uncertainty_ellipse.h b/lib/sbi/openapi/model/point_uncertainty_ellipse.h new file mode 100644 index 0000000000..62d9bce554 --- /dev/null +++ b/lib/sbi/openapi/model/point_uncertainty_ellipse.h @@ -0,0 +1,48 @@ +/* + * point_uncertainty_ellipse.h + * + * + */ + +#ifndef _OpenAPI_point_uncertainty_ellipse_H_ +#define _OpenAPI_point_uncertainty_ellipse_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "gad_shape.h" +#include "geographical_coordinates.h" +#include "point_uncertainty_ellipse_all_of.h" +#include "supported_gad_shapes.h" +#include "uncertainty_ellipse.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_point_uncertainty_ellipse_s OpenAPI_point_uncertainty_ellipse_t; +typedef struct OpenAPI_point_uncertainty_ellipse_s { + struct OpenAPI_supported_gad_shapes_s *shape; + struct OpenAPI_geographical_coordinates_s *point; + struct OpenAPI_uncertainty_ellipse_s *uncertainty_ellipse; + int confidence; +} OpenAPI_point_uncertainty_ellipse_t; + +OpenAPI_point_uncertainty_ellipse_t *OpenAPI_point_uncertainty_ellipse_create( + OpenAPI_supported_gad_shapes_t *shape, + OpenAPI_geographical_coordinates_t *point, + OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse, + int confidence + ); +void OpenAPI_point_uncertainty_ellipse_free(OpenAPI_point_uncertainty_ellipse_t *point_uncertainty_ellipse); +OpenAPI_point_uncertainty_ellipse_t *OpenAPI_point_uncertainty_ellipse_parseFromJSON(cJSON *point_uncertainty_ellipseJSON); +cJSON *OpenAPI_point_uncertainty_ellipse_convertToJSON(OpenAPI_point_uncertainty_ellipse_t *point_uncertainty_ellipse); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_point_uncertainty_ellipse_H_ */ + diff --git a/lib/sbi/openapi/model/point_uncertainty_ellipse_all_of.c b/lib/sbi/openapi/model/point_uncertainty_ellipse_all_of.c new file mode 100644 index 0000000000..5c6ab08c83 --- /dev/null +++ b/lib/sbi/openapi/model/point_uncertainty_ellipse_all_of.c @@ -0,0 +1,133 @@ + +#include +#include +#include +#include "point_uncertainty_ellipse_all_of.h" + +OpenAPI_point_uncertainty_ellipse_all_of_t *OpenAPI_point_uncertainty_ellipse_all_of_create( + OpenAPI_geographical_coordinates_t *point, + OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse, + int confidence + ) +{ + OpenAPI_point_uncertainty_ellipse_all_of_t *point_uncertainty_ellipse_all_of_local_var = OpenAPI_malloc(sizeof(OpenAPI_point_uncertainty_ellipse_all_of_t)); + if (!point_uncertainty_ellipse_all_of_local_var) { + return NULL; + } + point_uncertainty_ellipse_all_of_local_var->point = point; + point_uncertainty_ellipse_all_of_local_var->uncertainty_ellipse = uncertainty_ellipse; + point_uncertainty_ellipse_all_of_local_var->confidence = confidence; + + return point_uncertainty_ellipse_all_of_local_var; +} + +void OpenAPI_point_uncertainty_ellipse_all_of_free(OpenAPI_point_uncertainty_ellipse_all_of_t *point_uncertainty_ellipse_all_of) +{ + if (NULL == point_uncertainty_ellipse_all_of) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_geographical_coordinates_free(point_uncertainty_ellipse_all_of->point); + OpenAPI_uncertainty_ellipse_free(point_uncertainty_ellipse_all_of->uncertainty_ellipse); + ogs_free(point_uncertainty_ellipse_all_of); +} + +cJSON *OpenAPI_point_uncertainty_ellipse_all_of_convertToJSON(OpenAPI_point_uncertainty_ellipse_all_of_t *point_uncertainty_ellipse_all_of) +{ + cJSON *item = NULL; + + if (point_uncertainty_ellipse_all_of == NULL) { + ogs_error("OpenAPI_point_uncertainty_ellipse_all_of_convertToJSON() failed [PointUncertaintyEllipse_allOf]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!point_uncertainty_ellipse_all_of->point) { + ogs_error("OpenAPI_point_uncertainty_ellipse_all_of_convertToJSON() failed [point]"); + goto end; + } + cJSON *point_local_JSON = OpenAPI_geographical_coordinates_convertToJSON(point_uncertainty_ellipse_all_of->point); + if (point_local_JSON == NULL) { + ogs_error("OpenAPI_point_uncertainty_ellipse_all_of_convertToJSON() failed [point]"); + goto end; + } + cJSON_AddItemToObject(item, "point", point_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_point_uncertainty_ellipse_all_of_convertToJSON() failed [point]"); + goto end; + } + + if (!point_uncertainty_ellipse_all_of->uncertainty_ellipse) { + ogs_error("OpenAPI_point_uncertainty_ellipse_all_of_convertToJSON() failed [uncertainty_ellipse]"); + goto end; + } + cJSON *uncertainty_ellipse_local_JSON = OpenAPI_uncertainty_ellipse_convertToJSON(point_uncertainty_ellipse_all_of->uncertainty_ellipse); + if (uncertainty_ellipse_local_JSON == NULL) { + ogs_error("OpenAPI_point_uncertainty_ellipse_all_of_convertToJSON() failed [uncertainty_ellipse]"); + goto end; + } + cJSON_AddItemToObject(item, "uncertaintyEllipse", uncertainty_ellipse_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_point_uncertainty_ellipse_all_of_convertToJSON() failed [uncertainty_ellipse]"); + goto end; + } + + if (!point_uncertainty_ellipse_all_of->confidence) { + ogs_error("OpenAPI_point_uncertainty_ellipse_all_of_convertToJSON() failed [confidence]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "confidence", point_uncertainty_ellipse_all_of->confidence) == NULL) { + ogs_error("OpenAPI_point_uncertainty_ellipse_all_of_convertToJSON() failed [confidence]"); + goto end; + } + +end: + return item; +} + +OpenAPI_point_uncertainty_ellipse_all_of_t *OpenAPI_point_uncertainty_ellipse_all_of_parseFromJSON(cJSON *point_uncertainty_ellipse_all_ofJSON) +{ + OpenAPI_point_uncertainty_ellipse_all_of_t *point_uncertainty_ellipse_all_of_local_var = NULL; + cJSON *point = cJSON_GetObjectItemCaseSensitive(point_uncertainty_ellipse_all_ofJSON, "point"); + if (!point) { + ogs_error("OpenAPI_point_uncertainty_ellipse_all_of_parseFromJSON() failed [point]"); + goto end; + } + + OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; + + point_local_nonprim = OpenAPI_geographical_coordinates_parseFromJSON(point); + + cJSON *uncertainty_ellipse = cJSON_GetObjectItemCaseSensitive(point_uncertainty_ellipse_all_ofJSON, "uncertaintyEllipse"); + if (!uncertainty_ellipse) { + ogs_error("OpenAPI_point_uncertainty_ellipse_all_of_parseFromJSON() failed [uncertainty_ellipse]"); + goto end; + } + + OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse_local_nonprim = NULL; + + uncertainty_ellipse_local_nonprim = OpenAPI_uncertainty_ellipse_parseFromJSON(uncertainty_ellipse); + + cJSON *confidence = cJSON_GetObjectItemCaseSensitive(point_uncertainty_ellipse_all_ofJSON, "confidence"); + if (!confidence) { + ogs_error("OpenAPI_point_uncertainty_ellipse_all_of_parseFromJSON() failed [confidence]"); + goto end; + } + + + if (!cJSON_IsNumber(confidence)) { + ogs_error("OpenAPI_point_uncertainty_ellipse_all_of_parseFromJSON() failed [confidence]"); + goto end; + } + + point_uncertainty_ellipse_all_of_local_var = OpenAPI_point_uncertainty_ellipse_all_of_create ( + point_local_nonprim, + uncertainty_ellipse_local_nonprim, + confidence->valuedouble + ); + + return point_uncertainty_ellipse_all_of_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/point_uncertainty_ellipse_all_of.h b/lib/sbi/openapi/model/point_uncertainty_ellipse_all_of.h new file mode 100644 index 0000000000..a0b1ac39c0 --- /dev/null +++ b/lib/sbi/openapi/model/point_uncertainty_ellipse_all_of.h @@ -0,0 +1,43 @@ +/* + * point_uncertainty_ellipse_all_of.h + * + * + */ + +#ifndef _OpenAPI_point_uncertainty_ellipse_all_of_H_ +#define _OpenAPI_point_uncertainty_ellipse_all_of_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "geographical_coordinates.h" +#include "uncertainty_ellipse.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_point_uncertainty_ellipse_all_of_s OpenAPI_point_uncertainty_ellipse_all_of_t; +typedef struct OpenAPI_point_uncertainty_ellipse_all_of_s { + struct OpenAPI_geographical_coordinates_s *point; + struct OpenAPI_uncertainty_ellipse_s *uncertainty_ellipse; + int confidence; +} OpenAPI_point_uncertainty_ellipse_all_of_t; + +OpenAPI_point_uncertainty_ellipse_all_of_t *OpenAPI_point_uncertainty_ellipse_all_of_create( + OpenAPI_geographical_coordinates_t *point, + OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse, + int confidence + ); +void OpenAPI_point_uncertainty_ellipse_all_of_free(OpenAPI_point_uncertainty_ellipse_all_of_t *point_uncertainty_ellipse_all_of); +OpenAPI_point_uncertainty_ellipse_all_of_t *OpenAPI_point_uncertainty_ellipse_all_of_parseFromJSON(cJSON *point_uncertainty_ellipse_all_ofJSON); +cJSON *OpenAPI_point_uncertainty_ellipse_all_of_convertToJSON(OpenAPI_point_uncertainty_ellipse_all_of_t *point_uncertainty_ellipse_all_of); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_point_uncertainty_ellipse_all_of_H_ */ + diff --git a/lib/sbi/openapi/model/policy_data_change_notification.c b/lib/sbi/openapi/model/policy_data_change_notification.c new file mode 100644 index 0000000000..31aa014ba6 --- /dev/null +++ b/lib/sbi/openapi/model/policy_data_change_notification.c @@ -0,0 +1,460 @@ + +#include +#include +#include +#include "policy_data_change_notification.h" + +OpenAPI_policy_data_change_notification_t *OpenAPI_policy_data_change_notification_create( + OpenAPI_am_policy_data_t *am_policy_data, + OpenAPI_ue_policy_set_t *ue_policy_set, + OpenAPI_ue_policy_set_t *plmn_ue_policy_set, + OpenAPI_sm_policy_data_t *sm_policy_data, + OpenAPI_usage_mon_data_t *usage_mon_data, + OpenAPI_sponsor_connectivity_data_t *sponsor_connectivity_data, + OpenAPI_bdt_data_t *bdt_data, + OpenAPI_operator_specific_data_container_t *op_spec_data, + char *ue_id, + char *sponsor_id, + char *bdt_ref_id, + char *usage_mon_id, + OpenAPI_plmn_id_t *plmn_id, + OpenAPI_list_t *del_resources, + char *notif_id, + OpenAPI_list_t *reported_fragments + ) +{ + OpenAPI_policy_data_change_notification_t *policy_data_change_notification_local_var = OpenAPI_malloc(sizeof(OpenAPI_policy_data_change_notification_t)); + if (!policy_data_change_notification_local_var) { + return NULL; + } + policy_data_change_notification_local_var->am_policy_data = am_policy_data; + policy_data_change_notification_local_var->ue_policy_set = ue_policy_set; + policy_data_change_notification_local_var->plmn_ue_policy_set = plmn_ue_policy_set; + policy_data_change_notification_local_var->sm_policy_data = sm_policy_data; + policy_data_change_notification_local_var->usage_mon_data = usage_mon_data; + policy_data_change_notification_local_var->sponsor_connectivity_data = sponsor_connectivity_data; + policy_data_change_notification_local_var->bdt_data = bdt_data; + policy_data_change_notification_local_var->op_spec_data = op_spec_data; + policy_data_change_notification_local_var->ue_id = ue_id; + policy_data_change_notification_local_var->sponsor_id = sponsor_id; + policy_data_change_notification_local_var->bdt_ref_id = bdt_ref_id; + policy_data_change_notification_local_var->usage_mon_id = usage_mon_id; + policy_data_change_notification_local_var->plmn_id = plmn_id; + policy_data_change_notification_local_var->del_resources = del_resources; + policy_data_change_notification_local_var->notif_id = notif_id; + policy_data_change_notification_local_var->reported_fragments = reported_fragments; + + return policy_data_change_notification_local_var; +} + +void OpenAPI_policy_data_change_notification_free(OpenAPI_policy_data_change_notification_t *policy_data_change_notification) +{ + if (NULL == policy_data_change_notification) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_am_policy_data_free(policy_data_change_notification->am_policy_data); + OpenAPI_ue_policy_set_free(policy_data_change_notification->ue_policy_set); + OpenAPI_ue_policy_set_free(policy_data_change_notification->plmn_ue_policy_set); + OpenAPI_sm_policy_data_free(policy_data_change_notification->sm_policy_data); + OpenAPI_usage_mon_data_free(policy_data_change_notification->usage_mon_data); + OpenAPI_sponsor_connectivity_data_free(policy_data_change_notification->sponsor_connectivity_data); + OpenAPI_bdt_data_free(policy_data_change_notification->bdt_data); + OpenAPI_operator_specific_data_container_free(policy_data_change_notification->op_spec_data); + ogs_free(policy_data_change_notification->ue_id); + ogs_free(policy_data_change_notification->sponsor_id); + ogs_free(policy_data_change_notification->bdt_ref_id); + ogs_free(policy_data_change_notification->usage_mon_id); + OpenAPI_plmn_id_free(policy_data_change_notification->plmn_id); + OpenAPI_list_for_each(policy_data_change_notification->del_resources, node) { + ogs_free(node->data); + } + OpenAPI_list_free(policy_data_change_notification->del_resources); + ogs_free(policy_data_change_notification->notif_id); + OpenAPI_list_for_each(policy_data_change_notification->reported_fragments, node) { + OpenAPI_notification_item_free(node->data); + } + OpenAPI_list_free(policy_data_change_notification->reported_fragments); + ogs_free(policy_data_change_notification); +} + +cJSON *OpenAPI_policy_data_change_notification_convertToJSON(OpenAPI_policy_data_change_notification_t *policy_data_change_notification) +{ + cJSON *item = NULL; + + if (policy_data_change_notification == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [PolicyDataChangeNotification]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (policy_data_change_notification->am_policy_data) { + cJSON *am_policy_data_local_JSON = OpenAPI_am_policy_data_convertToJSON(policy_data_change_notification->am_policy_data); + if (am_policy_data_local_JSON == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [am_policy_data]"); + goto end; + } + cJSON_AddItemToObject(item, "amPolicyData", am_policy_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [am_policy_data]"); + goto end; + } + } + + if (policy_data_change_notification->ue_policy_set) { + cJSON *ue_policy_set_local_JSON = OpenAPI_ue_policy_set_convertToJSON(policy_data_change_notification->ue_policy_set); + if (ue_policy_set_local_JSON == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [ue_policy_set]"); + goto end; + } + cJSON_AddItemToObject(item, "uePolicySet", ue_policy_set_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [ue_policy_set]"); + goto end; + } + } + + if (policy_data_change_notification->plmn_ue_policy_set) { + cJSON *plmn_ue_policy_set_local_JSON = OpenAPI_ue_policy_set_convertToJSON(policy_data_change_notification->plmn_ue_policy_set); + if (plmn_ue_policy_set_local_JSON == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [plmn_ue_policy_set]"); + goto end; + } + cJSON_AddItemToObject(item, "plmnUePolicySet", plmn_ue_policy_set_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [plmn_ue_policy_set]"); + goto end; + } + } + + if (policy_data_change_notification->sm_policy_data) { + cJSON *sm_policy_data_local_JSON = OpenAPI_sm_policy_data_convertToJSON(policy_data_change_notification->sm_policy_data); + if (sm_policy_data_local_JSON == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [sm_policy_data]"); + goto end; + } + cJSON_AddItemToObject(item, "smPolicyData", sm_policy_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [sm_policy_data]"); + goto end; + } + } + + if (policy_data_change_notification->usage_mon_data) { + cJSON *usage_mon_data_local_JSON = OpenAPI_usage_mon_data_convertToJSON(policy_data_change_notification->usage_mon_data); + if (usage_mon_data_local_JSON == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [usage_mon_data]"); + goto end; + } + cJSON_AddItemToObject(item, "usageMonData", usage_mon_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [usage_mon_data]"); + goto end; + } + } + + if (policy_data_change_notification->sponsor_connectivity_data) { + cJSON *sponsor_connectivity_data_local_JSON = OpenAPI_sponsor_connectivity_data_convertToJSON(policy_data_change_notification->sponsor_connectivity_data); + if (sponsor_connectivity_data_local_JSON == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [sponsor_connectivity_data]"); + goto end; + } + cJSON_AddItemToObject(item, "SponsorConnectivityData", sponsor_connectivity_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [sponsor_connectivity_data]"); + goto end; + } + } + + if (policy_data_change_notification->bdt_data) { + cJSON *bdt_data_local_JSON = OpenAPI_bdt_data_convertToJSON(policy_data_change_notification->bdt_data); + if (bdt_data_local_JSON == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [bdt_data]"); + goto end; + } + cJSON_AddItemToObject(item, "bdtData", bdt_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [bdt_data]"); + goto end; + } + } + + if (policy_data_change_notification->op_spec_data) { + cJSON *op_spec_data_local_JSON = OpenAPI_operator_specific_data_container_convertToJSON(policy_data_change_notification->op_spec_data); + if (op_spec_data_local_JSON == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [op_spec_data]"); + goto end; + } + cJSON_AddItemToObject(item, "opSpecData", op_spec_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [op_spec_data]"); + goto end; + } + } + + if (policy_data_change_notification->ue_id) { + if (cJSON_AddStringToObject(item, "ueId", policy_data_change_notification->ue_id) == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [ue_id]"); + goto end; + } + } + + if (policy_data_change_notification->sponsor_id) { + if (cJSON_AddStringToObject(item, "sponsorId", policy_data_change_notification->sponsor_id) == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [sponsor_id]"); + goto end; + } + } + + if (policy_data_change_notification->bdt_ref_id) { + if (cJSON_AddStringToObject(item, "bdtRefId", policy_data_change_notification->bdt_ref_id) == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [bdt_ref_id]"); + goto end; + } + } + + if (policy_data_change_notification->usage_mon_id) { + if (cJSON_AddStringToObject(item, "usageMonId", policy_data_change_notification->usage_mon_id) == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [usage_mon_id]"); + goto end; + } + } + + if (policy_data_change_notification->plmn_id) { + cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_convertToJSON(policy_data_change_notification->plmn_id); + if (plmn_id_local_JSON == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [plmn_id]"); + goto end; + } + cJSON_AddItemToObject(item, "plmnId", plmn_id_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [plmn_id]"); + goto end; + } + } + + if (policy_data_change_notification->del_resources) { + cJSON *del_resources = cJSON_AddArrayToObject(item, "delResources"); + if (del_resources == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [del_resources]"); + goto end; + } + + OpenAPI_lnode_t *del_resources_node; + OpenAPI_list_for_each(policy_data_change_notification->del_resources, del_resources_node) { + if (cJSON_AddStringToObject(del_resources, "", (char*)del_resources_node->data) == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [del_resources]"); + goto end; + } + } + } + + if (policy_data_change_notification->notif_id) { + if (cJSON_AddStringToObject(item, "notifId", policy_data_change_notification->notif_id) == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [notif_id]"); + goto end; + } + } + + if (policy_data_change_notification->reported_fragments) { + cJSON *reported_fragmentsList = cJSON_AddArrayToObject(item, "reportedFragments"); + if (reported_fragmentsList == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [reported_fragments]"); + goto end; + } + + OpenAPI_lnode_t *reported_fragments_node; + if (policy_data_change_notification->reported_fragments) { + OpenAPI_list_for_each(policy_data_change_notification->reported_fragments, reported_fragments_node) { + cJSON *itemLocal = OpenAPI_notification_item_convertToJSON(reported_fragments_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [reported_fragments]"); + goto end; + } + cJSON_AddItemToArray(reported_fragmentsList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_policy_data_change_notification_t *OpenAPI_policy_data_change_notification_parseFromJSON(cJSON *policy_data_change_notificationJSON) +{ + OpenAPI_policy_data_change_notification_t *policy_data_change_notification_local_var = NULL; + cJSON *am_policy_data = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "amPolicyData"); + + OpenAPI_am_policy_data_t *am_policy_data_local_nonprim = NULL; + if (am_policy_data) { + am_policy_data_local_nonprim = OpenAPI_am_policy_data_parseFromJSON(am_policy_data); + } + + cJSON *ue_policy_set = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "uePolicySet"); + + OpenAPI_ue_policy_set_t *ue_policy_set_local_nonprim = NULL; + if (ue_policy_set) { + ue_policy_set_local_nonprim = OpenAPI_ue_policy_set_parseFromJSON(ue_policy_set); + } + + cJSON *plmn_ue_policy_set = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "plmnUePolicySet"); + + OpenAPI_ue_policy_set_t *plmn_ue_policy_set_local_nonprim = NULL; + if (plmn_ue_policy_set) { + plmn_ue_policy_set_local_nonprim = OpenAPI_ue_policy_set_parseFromJSON(plmn_ue_policy_set); + } + + cJSON *sm_policy_data = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "smPolicyData"); + + OpenAPI_sm_policy_data_t *sm_policy_data_local_nonprim = NULL; + if (sm_policy_data) { + sm_policy_data_local_nonprim = OpenAPI_sm_policy_data_parseFromJSON(sm_policy_data); + } + + cJSON *usage_mon_data = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "usageMonData"); + + OpenAPI_usage_mon_data_t *usage_mon_data_local_nonprim = NULL; + if (usage_mon_data) { + usage_mon_data_local_nonprim = OpenAPI_usage_mon_data_parseFromJSON(usage_mon_data); + } + + cJSON *sponsor_connectivity_data = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "SponsorConnectivityData"); + + OpenAPI_sponsor_connectivity_data_t *sponsor_connectivity_data_local_nonprim = NULL; + if (sponsor_connectivity_data) { + sponsor_connectivity_data_local_nonprim = OpenAPI_sponsor_connectivity_data_parseFromJSON(sponsor_connectivity_data); + } + + cJSON *bdt_data = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "bdtData"); + + OpenAPI_bdt_data_t *bdt_data_local_nonprim = NULL; + if (bdt_data) { + bdt_data_local_nonprim = OpenAPI_bdt_data_parseFromJSON(bdt_data); + } + + cJSON *op_spec_data = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "opSpecData"); + + OpenAPI_operator_specific_data_container_t *op_spec_data_local_nonprim = NULL; + if (op_spec_data) { + op_spec_data_local_nonprim = OpenAPI_operator_specific_data_container_parseFromJSON(op_spec_data); + } + + cJSON *ue_id = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "ueId"); + + if (ue_id) { + if (!cJSON_IsString(ue_id)) { + ogs_error("OpenAPI_policy_data_change_notification_parseFromJSON() failed [ue_id]"); + goto end; + } + } + + cJSON *sponsor_id = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "sponsorId"); + + if (sponsor_id) { + if (!cJSON_IsString(sponsor_id)) { + ogs_error("OpenAPI_policy_data_change_notification_parseFromJSON() failed [sponsor_id]"); + goto end; + } + } + + cJSON *bdt_ref_id = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "bdtRefId"); + + if (bdt_ref_id) { + if (!cJSON_IsString(bdt_ref_id)) { + ogs_error("OpenAPI_policy_data_change_notification_parseFromJSON() failed [bdt_ref_id]"); + goto end; + } + } + + cJSON *usage_mon_id = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "usageMonId"); + + if (usage_mon_id) { + if (!cJSON_IsString(usage_mon_id)) { + ogs_error("OpenAPI_policy_data_change_notification_parseFromJSON() failed [usage_mon_id]"); + goto end; + } + } + + cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "plmnId"); + + OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + if (plmn_id) { + plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); + } + + cJSON *del_resources = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "delResources"); + + OpenAPI_list_t *del_resourcesList; + if (del_resources) { + cJSON *del_resources_local; + if (!cJSON_IsArray(del_resources)) { + ogs_error("OpenAPI_policy_data_change_notification_parseFromJSON() failed [del_resources]"); + goto end; + } + del_resourcesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(del_resources_local, del_resources) { + if (!cJSON_IsString(del_resources_local)) { + ogs_error("OpenAPI_policy_data_change_notification_parseFromJSON() failed [del_resources]"); + goto end; + } + OpenAPI_list_add(del_resourcesList, ogs_strdup(del_resources_local->valuestring)); + } + } + + cJSON *notif_id = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "notifId"); + + if (notif_id) { + if (!cJSON_IsString(notif_id)) { + ogs_error("OpenAPI_policy_data_change_notification_parseFromJSON() failed [notif_id]"); + goto end; + } + } + + cJSON *reported_fragments = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "reportedFragments"); + + OpenAPI_list_t *reported_fragmentsList; + if (reported_fragments) { + cJSON *reported_fragments_local_nonprimitive; + if (!cJSON_IsArray(reported_fragments)) { + ogs_error("OpenAPI_policy_data_change_notification_parseFromJSON() failed [reported_fragments]"); + goto end; + } + + reported_fragmentsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(reported_fragments_local_nonprimitive, reported_fragments ) { + if (!cJSON_IsObject(reported_fragments_local_nonprimitive)) { + ogs_error("OpenAPI_policy_data_change_notification_parseFromJSON() failed [reported_fragments]"); + goto end; + } + OpenAPI_notification_item_t *reported_fragmentsItem = OpenAPI_notification_item_parseFromJSON(reported_fragments_local_nonprimitive); + + OpenAPI_list_add(reported_fragmentsList, reported_fragmentsItem); + } + } + + policy_data_change_notification_local_var = OpenAPI_policy_data_change_notification_create ( + am_policy_data ? am_policy_data_local_nonprim : NULL, + ue_policy_set ? ue_policy_set_local_nonprim : NULL, + plmn_ue_policy_set ? plmn_ue_policy_set_local_nonprim : NULL, + sm_policy_data ? sm_policy_data_local_nonprim : NULL, + usage_mon_data ? usage_mon_data_local_nonprim : NULL, + sponsor_connectivity_data ? sponsor_connectivity_data_local_nonprim : NULL, + bdt_data ? bdt_data_local_nonprim : NULL, + op_spec_data ? op_spec_data_local_nonprim : NULL, + ue_id ? ogs_strdup(ue_id->valuestring) : NULL, + sponsor_id ? ogs_strdup(sponsor_id->valuestring) : NULL, + bdt_ref_id ? ogs_strdup(bdt_ref_id->valuestring) : NULL, + usage_mon_id ? ogs_strdup(usage_mon_id->valuestring) : NULL, + plmn_id ? plmn_id_local_nonprim : NULL, + del_resources ? del_resourcesList : NULL, + notif_id ? ogs_strdup(notif_id->valuestring) : NULL, + reported_fragments ? reported_fragmentsList : NULL + ); + + return policy_data_change_notification_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/policy_data_change_notification.h b/lib/sbi/openapi/model/policy_data_change_notification.h new file mode 100644 index 0000000000..2349040893 --- /dev/null +++ b/lib/sbi/openapi/model/policy_data_change_notification.h @@ -0,0 +1,76 @@ +/* + * policy_data_change_notification.h + * + * Contains changed policy data for which notification was requested. + */ + +#ifndef _OpenAPI_policy_data_change_notification_H_ +#define _OpenAPI_policy_data_change_notification_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "am_policy_data.h" +#include "bdt_data.h" +#include "notification_item.h" +#include "operator_specific_data_container.h" +#include "plmn_id.h" +#include "sm_policy_data.h" +#include "sponsor_connectivity_data.h" +#include "ue_policy_set.h" +#include "usage_mon_data.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_policy_data_change_notification_s OpenAPI_policy_data_change_notification_t; +typedef struct OpenAPI_policy_data_change_notification_s { + struct OpenAPI_am_policy_data_s *am_policy_data; + struct OpenAPI_ue_policy_set_s *ue_policy_set; + struct OpenAPI_ue_policy_set_s *plmn_ue_policy_set; + struct OpenAPI_sm_policy_data_s *sm_policy_data; + struct OpenAPI_usage_mon_data_s *usage_mon_data; + struct OpenAPI_sponsor_connectivity_data_s *sponsor_connectivity_data; + struct OpenAPI_bdt_data_s *bdt_data; + struct OpenAPI_operator_specific_data_container_s *op_spec_data; + char *ue_id; + char *sponsor_id; + char *bdt_ref_id; + char *usage_mon_id; + struct OpenAPI_plmn_id_s *plmn_id; + OpenAPI_list_t *del_resources; + char *notif_id; + OpenAPI_list_t *reported_fragments; +} OpenAPI_policy_data_change_notification_t; + +OpenAPI_policy_data_change_notification_t *OpenAPI_policy_data_change_notification_create( + OpenAPI_am_policy_data_t *am_policy_data, + OpenAPI_ue_policy_set_t *ue_policy_set, + OpenAPI_ue_policy_set_t *plmn_ue_policy_set, + OpenAPI_sm_policy_data_t *sm_policy_data, + OpenAPI_usage_mon_data_t *usage_mon_data, + OpenAPI_sponsor_connectivity_data_t *sponsor_connectivity_data, + OpenAPI_bdt_data_t *bdt_data, + OpenAPI_operator_specific_data_container_t *op_spec_data, + char *ue_id, + char *sponsor_id, + char *bdt_ref_id, + char *usage_mon_id, + OpenAPI_plmn_id_t *plmn_id, + OpenAPI_list_t *del_resources, + char *notif_id, + OpenAPI_list_t *reported_fragments + ); +void OpenAPI_policy_data_change_notification_free(OpenAPI_policy_data_change_notification_t *policy_data_change_notification); +OpenAPI_policy_data_change_notification_t *OpenAPI_policy_data_change_notification_parseFromJSON(cJSON *policy_data_change_notificationJSON); +cJSON *OpenAPI_policy_data_change_notification_convertToJSON(OpenAPI_policy_data_change_notification_t *policy_data_change_notification); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_policy_data_change_notification_H_ */ + diff --git a/lib/sbi/openapi/model/policy_data_subscription.c b/lib/sbi/openapi/model/policy_data_subscription.c new file mode 100644 index 0000000000..3233d7c5bc --- /dev/null +++ b/lib/sbi/openapi/model/policy_data_subscription.c @@ -0,0 +1,234 @@ + +#include +#include +#include +#include "policy_data_subscription.h" + +OpenAPI_policy_data_subscription_t *OpenAPI_policy_data_subscription_create( + char *notification_uri, + char *notif_id, + OpenAPI_list_t *monitored_resource_uris, + OpenAPI_list_t *mon_res_items, + char *expiry, + char *supported_features + ) +{ + OpenAPI_policy_data_subscription_t *policy_data_subscription_local_var = OpenAPI_malloc(sizeof(OpenAPI_policy_data_subscription_t)); + if (!policy_data_subscription_local_var) { + return NULL; + } + policy_data_subscription_local_var->notification_uri = notification_uri; + policy_data_subscription_local_var->notif_id = notif_id; + policy_data_subscription_local_var->monitored_resource_uris = monitored_resource_uris; + policy_data_subscription_local_var->mon_res_items = mon_res_items; + policy_data_subscription_local_var->expiry = expiry; + policy_data_subscription_local_var->supported_features = supported_features; + + return policy_data_subscription_local_var; +} + +void OpenAPI_policy_data_subscription_free(OpenAPI_policy_data_subscription_t *policy_data_subscription) +{ + if (NULL == policy_data_subscription) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(policy_data_subscription->notification_uri); + ogs_free(policy_data_subscription->notif_id); + OpenAPI_list_for_each(policy_data_subscription->monitored_resource_uris, node) { + ogs_free(node->data); + } + OpenAPI_list_free(policy_data_subscription->monitored_resource_uris); + OpenAPI_list_for_each(policy_data_subscription->mon_res_items, node) { + OpenAPI_resource_item_free(node->data); + } + OpenAPI_list_free(policy_data_subscription->mon_res_items); + ogs_free(policy_data_subscription->expiry); + ogs_free(policy_data_subscription->supported_features); + ogs_free(policy_data_subscription); +} + +cJSON *OpenAPI_policy_data_subscription_convertToJSON(OpenAPI_policy_data_subscription_t *policy_data_subscription) +{ + cJSON *item = NULL; + + if (policy_data_subscription == NULL) { + ogs_error("OpenAPI_policy_data_subscription_convertToJSON() failed [PolicyDataSubscription]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!policy_data_subscription->notification_uri) { + ogs_error("OpenAPI_policy_data_subscription_convertToJSON() failed [notification_uri]"); + goto end; + } + if (cJSON_AddStringToObject(item, "notificationUri", policy_data_subscription->notification_uri) == NULL) { + ogs_error("OpenAPI_policy_data_subscription_convertToJSON() failed [notification_uri]"); + goto end; + } + + if (policy_data_subscription->notif_id) { + if (cJSON_AddStringToObject(item, "notifId", policy_data_subscription->notif_id) == NULL) { + ogs_error("OpenAPI_policy_data_subscription_convertToJSON() failed [notif_id]"); + goto end; + } + } + + if (!policy_data_subscription->monitored_resource_uris) { + ogs_error("OpenAPI_policy_data_subscription_convertToJSON() failed [monitored_resource_uris]"); + goto end; + } + cJSON *monitored_resource_uris = cJSON_AddArrayToObject(item, "monitoredResourceUris"); + if (monitored_resource_uris == NULL) { + ogs_error("OpenAPI_policy_data_subscription_convertToJSON() failed [monitored_resource_uris]"); + goto end; + } + + OpenAPI_lnode_t *monitored_resource_uris_node; + OpenAPI_list_for_each(policy_data_subscription->monitored_resource_uris, monitored_resource_uris_node) { + if (cJSON_AddStringToObject(monitored_resource_uris, "", (char*)monitored_resource_uris_node->data) == NULL) { + ogs_error("OpenAPI_policy_data_subscription_convertToJSON() failed [monitored_resource_uris]"); + goto end; + } + } + + if (policy_data_subscription->mon_res_items) { + cJSON *mon_res_itemsList = cJSON_AddArrayToObject(item, "monResItems"); + if (mon_res_itemsList == NULL) { + ogs_error("OpenAPI_policy_data_subscription_convertToJSON() failed [mon_res_items]"); + goto end; + } + + OpenAPI_lnode_t *mon_res_items_node; + if (policy_data_subscription->mon_res_items) { + OpenAPI_list_for_each(policy_data_subscription->mon_res_items, mon_res_items_node) { + cJSON *itemLocal = OpenAPI_resource_item_convertToJSON(mon_res_items_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_policy_data_subscription_convertToJSON() failed [mon_res_items]"); + goto end; + } + cJSON_AddItemToArray(mon_res_itemsList, itemLocal); + } + } + } + + if (policy_data_subscription->expiry) { + if (cJSON_AddStringToObject(item, "expiry", policy_data_subscription->expiry) == NULL) { + ogs_error("OpenAPI_policy_data_subscription_convertToJSON() failed [expiry]"); + goto end; + } + } + + if (policy_data_subscription->supported_features) { + if (cJSON_AddStringToObject(item, "supportedFeatures", policy_data_subscription->supported_features) == NULL) { + ogs_error("OpenAPI_policy_data_subscription_convertToJSON() failed [supported_features]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_policy_data_subscription_t *OpenAPI_policy_data_subscription_parseFromJSON(cJSON *policy_data_subscriptionJSON) +{ + OpenAPI_policy_data_subscription_t *policy_data_subscription_local_var = NULL; + cJSON *notification_uri = cJSON_GetObjectItemCaseSensitive(policy_data_subscriptionJSON, "notificationUri"); + if (!notification_uri) { + ogs_error("OpenAPI_policy_data_subscription_parseFromJSON() failed [notification_uri]"); + goto end; + } + + + if (!cJSON_IsString(notification_uri)) { + ogs_error("OpenAPI_policy_data_subscription_parseFromJSON() failed [notification_uri]"); + goto end; + } + + cJSON *notif_id = cJSON_GetObjectItemCaseSensitive(policy_data_subscriptionJSON, "notifId"); + + if (notif_id) { + if (!cJSON_IsString(notif_id)) { + ogs_error("OpenAPI_policy_data_subscription_parseFromJSON() failed [notif_id]"); + goto end; + } + } + + cJSON *monitored_resource_uris = cJSON_GetObjectItemCaseSensitive(policy_data_subscriptionJSON, "monitoredResourceUris"); + if (!monitored_resource_uris) { + ogs_error("OpenAPI_policy_data_subscription_parseFromJSON() failed [monitored_resource_uris]"); + goto end; + } + + OpenAPI_list_t *monitored_resource_urisList; + + cJSON *monitored_resource_uris_local; + if (!cJSON_IsArray(monitored_resource_uris)) { + ogs_error("OpenAPI_policy_data_subscription_parseFromJSON() failed [monitored_resource_uris]"); + goto end; + } + monitored_resource_urisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(monitored_resource_uris_local, monitored_resource_uris) { + if (!cJSON_IsString(monitored_resource_uris_local)) { + ogs_error("OpenAPI_policy_data_subscription_parseFromJSON() failed [monitored_resource_uris]"); + goto end; + } + OpenAPI_list_add(monitored_resource_urisList, ogs_strdup(monitored_resource_uris_local->valuestring)); + } + + cJSON *mon_res_items = cJSON_GetObjectItemCaseSensitive(policy_data_subscriptionJSON, "monResItems"); + + OpenAPI_list_t *mon_res_itemsList; + if (mon_res_items) { + cJSON *mon_res_items_local_nonprimitive; + if (!cJSON_IsArray(mon_res_items)) { + ogs_error("OpenAPI_policy_data_subscription_parseFromJSON() failed [mon_res_items]"); + goto end; + } + + mon_res_itemsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(mon_res_items_local_nonprimitive, mon_res_items ) { + if (!cJSON_IsObject(mon_res_items_local_nonprimitive)) { + ogs_error("OpenAPI_policy_data_subscription_parseFromJSON() failed [mon_res_items]"); + goto end; + } + OpenAPI_resource_item_t *mon_res_itemsItem = OpenAPI_resource_item_parseFromJSON(mon_res_items_local_nonprimitive); + + OpenAPI_list_add(mon_res_itemsList, mon_res_itemsItem); + } + } + + cJSON *expiry = cJSON_GetObjectItemCaseSensitive(policy_data_subscriptionJSON, "expiry"); + + if (expiry) { + if (!cJSON_IsString(expiry)) { + ogs_error("OpenAPI_policy_data_subscription_parseFromJSON() failed [expiry]"); + goto end; + } + } + + cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(policy_data_subscriptionJSON, "supportedFeatures"); + + if (supported_features) { + if (!cJSON_IsString(supported_features)) { + ogs_error("OpenAPI_policy_data_subscription_parseFromJSON() failed [supported_features]"); + goto end; + } + } + + policy_data_subscription_local_var = OpenAPI_policy_data_subscription_create ( + ogs_strdup(notification_uri->valuestring), + notif_id ? ogs_strdup(notif_id->valuestring) : NULL, + monitored_resource_urisList, + mon_res_items ? mon_res_itemsList : NULL, + expiry ? ogs_strdup(expiry->valuestring) : NULL, + supported_features ? ogs_strdup(supported_features->valuestring) : NULL + ); + + return policy_data_subscription_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/policy_data_subscription.h b/lib/sbi/openapi/model/policy_data_subscription.h new file mode 100644 index 0000000000..91325c1bf6 --- /dev/null +++ b/lib/sbi/openapi/model/policy_data_subscription.h @@ -0,0 +1,48 @@ +/* + * policy_data_subscription.h + * + * Identifies a subscription to policy data change notification. + */ + +#ifndef _OpenAPI_policy_data_subscription_H_ +#define _OpenAPI_policy_data_subscription_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "resource_item.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_policy_data_subscription_s OpenAPI_policy_data_subscription_t; +typedef struct OpenAPI_policy_data_subscription_s { + char *notification_uri; + char *notif_id; + OpenAPI_list_t *monitored_resource_uris; + OpenAPI_list_t *mon_res_items; + char *expiry; + char *supported_features; +} OpenAPI_policy_data_subscription_t; + +OpenAPI_policy_data_subscription_t *OpenAPI_policy_data_subscription_create( + char *notification_uri, + char *notif_id, + OpenAPI_list_t *monitored_resource_uris, + OpenAPI_list_t *mon_res_items, + char *expiry, + char *supported_features + ); +void OpenAPI_policy_data_subscription_free(OpenAPI_policy_data_subscription_t *policy_data_subscription); +OpenAPI_policy_data_subscription_t *OpenAPI_policy_data_subscription_parseFromJSON(cJSON *policy_data_subscriptionJSON); +cJSON *OpenAPI_policy_data_subscription_convertToJSON(OpenAPI_policy_data_subscription_t *policy_data_subscription); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_policy_data_subscription_H_ */ + diff --git a/lib/sbi/openapi/model/polygon.c b/lib/sbi/openapi/model/polygon.c new file mode 100644 index 0000000000..35fa3068af --- /dev/null +++ b/lib/sbi/openapi/model/polygon.c @@ -0,0 +1,135 @@ + +#include +#include +#include +#include "polygon.h" + +OpenAPI_polygon_t *OpenAPI_polygon_create( + OpenAPI_supported_gad_shapes_t *shape, + OpenAPI_list_t *point_list + ) +{ + OpenAPI_polygon_t *polygon_local_var = OpenAPI_malloc(sizeof(OpenAPI_polygon_t)); + if (!polygon_local_var) { + return NULL; + } + polygon_local_var->shape = shape; + polygon_local_var->point_list = point_list; + + return polygon_local_var; +} + +void OpenAPI_polygon_free(OpenAPI_polygon_t *polygon) +{ + if (NULL == polygon) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_supported_gad_shapes_free(polygon->shape); + OpenAPI_list_for_each(polygon->point_list, node) { + OpenAPI_geographical_coordinates_free(node->data); + } + OpenAPI_list_free(polygon->point_list); + ogs_free(polygon); +} + +cJSON *OpenAPI_polygon_convertToJSON(OpenAPI_polygon_t *polygon) +{ + cJSON *item = NULL; + + if (polygon == NULL) { + ogs_error("OpenAPI_polygon_convertToJSON() failed [Polygon]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!polygon->shape) { + ogs_error("OpenAPI_polygon_convertToJSON() failed [shape]"); + goto end; + } + cJSON *shape_local_JSON = OpenAPI_supported_gad_shapes_convertToJSON(polygon->shape); + if (shape_local_JSON == NULL) { + ogs_error("OpenAPI_polygon_convertToJSON() failed [shape]"); + goto end; + } + cJSON_AddItemToObject(item, "shape", shape_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_polygon_convertToJSON() failed [shape]"); + goto end; + } + + if (!polygon->point_list) { + ogs_error("OpenAPI_polygon_convertToJSON() failed [point_list]"); + goto end; + } + cJSON *point_listList = cJSON_AddArrayToObject(item, "pointList"); + if (point_listList == NULL) { + ogs_error("OpenAPI_polygon_convertToJSON() failed [point_list]"); + goto end; + } + + OpenAPI_lnode_t *point_list_node; + if (polygon->point_list) { + OpenAPI_list_for_each(polygon->point_list, point_list_node) { + cJSON *itemLocal = OpenAPI_geographical_coordinates_convertToJSON(point_list_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_polygon_convertToJSON() failed [point_list]"); + goto end; + } + cJSON_AddItemToArray(point_listList, itemLocal); + } + } + +end: + return item; +} + +OpenAPI_polygon_t *OpenAPI_polygon_parseFromJSON(cJSON *polygonJSON) +{ + OpenAPI_polygon_t *polygon_local_var = NULL; + cJSON *shape = cJSON_GetObjectItemCaseSensitive(polygonJSON, "shape"); + if (!shape) { + ogs_error("OpenAPI_polygon_parseFromJSON() failed [shape]"); + goto end; + } + + OpenAPI_supported_gad_shapes_t *shape_local_nonprim = NULL; + + shape_local_nonprim = OpenAPI_supported_gad_shapes_parseFromJSON(shape); + + cJSON *point_list = cJSON_GetObjectItemCaseSensitive(polygonJSON, "pointList"); + if (!point_list) { + ogs_error("OpenAPI_polygon_parseFromJSON() failed [point_list]"); + goto end; + } + + OpenAPI_list_t *point_listList; + + cJSON *point_list_local_nonprimitive; + if (!cJSON_IsArray(point_list)) { + ogs_error("OpenAPI_polygon_parseFromJSON() failed [point_list]"); + goto end; + } + + point_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(point_list_local_nonprimitive, point_list ) { + if (!cJSON_IsObject(point_list_local_nonprimitive)) { + ogs_error("OpenAPI_polygon_parseFromJSON() failed [point_list]"); + goto end; + } + OpenAPI_geographical_coordinates_t *point_listItem = OpenAPI_geographical_coordinates_parseFromJSON(point_list_local_nonprimitive); + + OpenAPI_list_add(point_listList, point_listItem); + } + + polygon_local_var = OpenAPI_polygon_create ( + shape_local_nonprim, + point_listList + ); + + return polygon_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/polygon.h b/lib/sbi/openapi/model/polygon.h new file mode 100644 index 0000000000..b05329a232 --- /dev/null +++ b/lib/sbi/openapi/model/polygon.h @@ -0,0 +1,43 @@ +/* + * polygon.h + * + * + */ + +#ifndef _OpenAPI_polygon_H_ +#define _OpenAPI_polygon_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "gad_shape.h" +#include "geographical_coordinates.h" +#include "polygon_all_of.h" +#include "supported_gad_shapes.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_polygon_s OpenAPI_polygon_t; +typedef struct OpenAPI_polygon_s { + struct OpenAPI_supported_gad_shapes_s *shape; + OpenAPI_list_t *point_list; +} OpenAPI_polygon_t; + +OpenAPI_polygon_t *OpenAPI_polygon_create( + OpenAPI_supported_gad_shapes_t *shape, + OpenAPI_list_t *point_list + ); +void OpenAPI_polygon_free(OpenAPI_polygon_t *polygon); +OpenAPI_polygon_t *OpenAPI_polygon_parseFromJSON(cJSON *polygonJSON); +cJSON *OpenAPI_polygon_convertToJSON(OpenAPI_polygon_t *polygon); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_polygon_H_ */ + diff --git a/lib/sbi/openapi/model/polygon_all_of.c b/lib/sbi/openapi/model/polygon_all_of.c new file mode 100644 index 0000000000..4cc6272981 --- /dev/null +++ b/lib/sbi/openapi/model/polygon_all_of.c @@ -0,0 +1,106 @@ + +#include +#include +#include +#include "polygon_all_of.h" + +OpenAPI_polygon_all_of_t *OpenAPI_polygon_all_of_create( + OpenAPI_list_t *point_list + ) +{ + OpenAPI_polygon_all_of_t *polygon_all_of_local_var = OpenAPI_malloc(sizeof(OpenAPI_polygon_all_of_t)); + if (!polygon_all_of_local_var) { + return NULL; + } + polygon_all_of_local_var->point_list = point_list; + + return polygon_all_of_local_var; +} + +void OpenAPI_polygon_all_of_free(OpenAPI_polygon_all_of_t *polygon_all_of) +{ + if (NULL == polygon_all_of) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(polygon_all_of->point_list, node) { + OpenAPI_geographical_coordinates_free(node->data); + } + OpenAPI_list_free(polygon_all_of->point_list); + ogs_free(polygon_all_of); +} + +cJSON *OpenAPI_polygon_all_of_convertToJSON(OpenAPI_polygon_all_of_t *polygon_all_of) +{ + cJSON *item = NULL; + + if (polygon_all_of == NULL) { + ogs_error("OpenAPI_polygon_all_of_convertToJSON() failed [Polygon_allOf]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!polygon_all_of->point_list) { + ogs_error("OpenAPI_polygon_all_of_convertToJSON() failed [point_list]"); + goto end; + } + cJSON *point_listList = cJSON_AddArrayToObject(item, "pointList"); + if (point_listList == NULL) { + ogs_error("OpenAPI_polygon_all_of_convertToJSON() failed [point_list]"); + goto end; + } + + OpenAPI_lnode_t *point_list_node; + if (polygon_all_of->point_list) { + OpenAPI_list_for_each(polygon_all_of->point_list, point_list_node) { + cJSON *itemLocal = OpenAPI_geographical_coordinates_convertToJSON(point_list_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_polygon_all_of_convertToJSON() failed [point_list]"); + goto end; + } + cJSON_AddItemToArray(point_listList, itemLocal); + } + } + +end: + return item; +} + +OpenAPI_polygon_all_of_t *OpenAPI_polygon_all_of_parseFromJSON(cJSON *polygon_all_ofJSON) +{ + OpenAPI_polygon_all_of_t *polygon_all_of_local_var = NULL; + cJSON *point_list = cJSON_GetObjectItemCaseSensitive(polygon_all_ofJSON, "pointList"); + if (!point_list) { + ogs_error("OpenAPI_polygon_all_of_parseFromJSON() failed [point_list]"); + goto end; + } + + OpenAPI_list_t *point_listList; + + cJSON *point_list_local_nonprimitive; + if (!cJSON_IsArray(point_list)) { + ogs_error("OpenAPI_polygon_all_of_parseFromJSON() failed [point_list]"); + goto end; + } + + point_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(point_list_local_nonprimitive, point_list ) { + if (!cJSON_IsObject(point_list_local_nonprimitive)) { + ogs_error("OpenAPI_polygon_all_of_parseFromJSON() failed [point_list]"); + goto end; + } + OpenAPI_geographical_coordinates_t *point_listItem = OpenAPI_geographical_coordinates_parseFromJSON(point_list_local_nonprimitive); + + OpenAPI_list_add(point_listList, point_listItem); + } + + polygon_all_of_local_var = OpenAPI_polygon_all_of_create ( + point_listList + ); + + return polygon_all_of_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/polygon_all_of.h b/lib/sbi/openapi/model/polygon_all_of.h new file mode 100644 index 0000000000..0cb20c885f --- /dev/null +++ b/lib/sbi/openapi/model/polygon_all_of.h @@ -0,0 +1,38 @@ +/* + * polygon_all_of.h + * + * + */ + +#ifndef _OpenAPI_polygon_all_of_H_ +#define _OpenAPI_polygon_all_of_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "geographical_coordinates.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_polygon_all_of_s OpenAPI_polygon_all_of_t; +typedef struct OpenAPI_polygon_all_of_s { + OpenAPI_list_t *point_list; +} OpenAPI_polygon_all_of_t; + +OpenAPI_polygon_all_of_t *OpenAPI_polygon_all_of_create( + OpenAPI_list_t *point_list + ); +void OpenAPI_polygon_all_of_free(OpenAPI_polygon_all_of_t *polygon_all_of); +OpenAPI_polygon_all_of_t *OpenAPI_polygon_all_of_parseFromJSON(cJSON *polygon_all_ofJSON); +cJSON *OpenAPI_polygon_all_of_convertToJSON(OpenAPI_polygon_all_of_t *polygon_all_of); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_polygon_all_of_H_ */ + diff --git a/lib/sbi/openapi/model/pp_active_time.c b/lib/sbi/openapi/model/pp_active_time.c new file mode 100644 index 0000000000..77dbdc9c89 --- /dev/null +++ b/lib/sbi/openapi/model/pp_active_time.c @@ -0,0 +1,144 @@ + +#include +#include +#include +#include "pp_active_time.h" + +OpenAPI_pp_active_time_t *OpenAPI_pp_active_time_create( + int active_time, + char *af_instance_id, + int reference_id, + char *validity_time + ) +{ + OpenAPI_pp_active_time_t *pp_active_time_local_var = OpenAPI_malloc(sizeof(OpenAPI_pp_active_time_t)); + if (!pp_active_time_local_var) { + return NULL; + } + pp_active_time_local_var->active_time = active_time; + pp_active_time_local_var->af_instance_id = af_instance_id; + pp_active_time_local_var->reference_id = reference_id; + pp_active_time_local_var->validity_time = validity_time; + + return pp_active_time_local_var; +} + +void OpenAPI_pp_active_time_free(OpenAPI_pp_active_time_t *pp_active_time) +{ + if (NULL == pp_active_time) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(pp_active_time->af_instance_id); + ogs_free(pp_active_time->validity_time); + ogs_free(pp_active_time); +} + +cJSON *OpenAPI_pp_active_time_convertToJSON(OpenAPI_pp_active_time_t *pp_active_time) +{ + cJSON *item = NULL; + + if (pp_active_time == NULL) { + ogs_error("OpenAPI_pp_active_time_convertToJSON() failed [PpActiveTime]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!pp_active_time->active_time) { + ogs_error("OpenAPI_pp_active_time_convertToJSON() failed [active_time]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "activeTime", pp_active_time->active_time) == NULL) { + ogs_error("OpenAPI_pp_active_time_convertToJSON() failed [active_time]"); + goto end; + } + + if (!pp_active_time->af_instance_id) { + ogs_error("OpenAPI_pp_active_time_convertToJSON() failed [af_instance_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "afInstanceId", pp_active_time->af_instance_id) == NULL) { + ogs_error("OpenAPI_pp_active_time_convertToJSON() failed [af_instance_id]"); + goto end; + } + + if (!pp_active_time->reference_id) { + ogs_error("OpenAPI_pp_active_time_convertToJSON() failed [reference_id]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "referenceId", pp_active_time->reference_id) == NULL) { + ogs_error("OpenAPI_pp_active_time_convertToJSON() failed [reference_id]"); + goto end; + } + + if (pp_active_time->validity_time) { + if (cJSON_AddStringToObject(item, "validityTime", pp_active_time->validity_time) == NULL) { + ogs_error("OpenAPI_pp_active_time_convertToJSON() failed [validity_time]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_pp_active_time_t *OpenAPI_pp_active_time_parseFromJSON(cJSON *pp_active_timeJSON) +{ + OpenAPI_pp_active_time_t *pp_active_time_local_var = NULL; + cJSON *active_time = cJSON_GetObjectItemCaseSensitive(pp_active_timeJSON, "activeTime"); + if (!active_time) { + ogs_error("OpenAPI_pp_active_time_parseFromJSON() failed [active_time]"); + goto end; + } + + + if (!cJSON_IsNumber(active_time)) { + ogs_error("OpenAPI_pp_active_time_parseFromJSON() failed [active_time]"); + goto end; + } + + cJSON *af_instance_id = cJSON_GetObjectItemCaseSensitive(pp_active_timeJSON, "afInstanceId"); + if (!af_instance_id) { + ogs_error("OpenAPI_pp_active_time_parseFromJSON() failed [af_instance_id]"); + goto end; + } + + + if (!cJSON_IsString(af_instance_id)) { + ogs_error("OpenAPI_pp_active_time_parseFromJSON() failed [af_instance_id]"); + goto end; + } + + cJSON *reference_id = cJSON_GetObjectItemCaseSensitive(pp_active_timeJSON, "referenceId"); + if (!reference_id) { + ogs_error("OpenAPI_pp_active_time_parseFromJSON() failed [reference_id]"); + goto end; + } + + + if (!cJSON_IsNumber(reference_id)) { + ogs_error("OpenAPI_pp_active_time_parseFromJSON() failed [reference_id]"); + goto end; + } + + cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(pp_active_timeJSON, "validityTime"); + + if (validity_time) { + if (!cJSON_IsString(validity_time)) { + ogs_error("OpenAPI_pp_active_time_parseFromJSON() failed [validity_time]"); + goto end; + } + } + + pp_active_time_local_var = OpenAPI_pp_active_time_create ( + active_time->valuedouble, + ogs_strdup(af_instance_id->valuestring), + reference_id->valuedouble, + validity_time ? ogs_strdup(validity_time->valuestring) : NULL + ); + + return pp_active_time_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/pp_active_time.h b/lib/sbi/openapi/model/pp_active_time.h new file mode 100644 index 0000000000..acd596a8ed --- /dev/null +++ b/lib/sbi/openapi/model/pp_active_time.h @@ -0,0 +1,43 @@ +/* + * pp_active_time.h + * + * + */ + +#ifndef _OpenAPI_pp_active_time_H_ +#define _OpenAPI_pp_active_time_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_pp_active_time_s OpenAPI_pp_active_time_t; +typedef struct OpenAPI_pp_active_time_s { + int active_time; + char *af_instance_id; + int reference_id; + char *validity_time; +} OpenAPI_pp_active_time_t; + +OpenAPI_pp_active_time_t *OpenAPI_pp_active_time_create( + int active_time, + char *af_instance_id, + int reference_id, + char *validity_time + ); +void OpenAPI_pp_active_time_free(OpenAPI_pp_active_time_t *pp_active_time); +OpenAPI_pp_active_time_t *OpenAPI_pp_active_time_parseFromJSON(cJSON *pp_active_timeJSON); +cJSON *OpenAPI_pp_active_time_convertToJSON(OpenAPI_pp_active_time_t *pp_active_time); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_pp_active_time_H_ */ + diff --git a/lib/sbi/openapi/model/pp_data.c b/lib/sbi/openapi/model/pp_data.c new file mode 100644 index 0000000000..71dbb32e95 --- /dev/null +++ b/lib/sbi/openapi/model/pp_data.c @@ -0,0 +1,211 @@ + +#include +#include +#include +#include "pp_data.h" + +OpenAPI_pp_data_t *OpenAPI_pp_data_create( + OpenAPI_communication_characteristics_t *communication_characteristics, + char *supported_features, + OpenAPI_expected_ue_behaviour_t *expected_ue_behaviour_parameters, + OpenAPI_ec_restriction_t *ec_restriction, + OpenAPI_acs_info_rm_t *acs_info, + char *stn_sr, + OpenAPI_lcs_privacy_t *lcs_privacy + ) +{ + OpenAPI_pp_data_t *pp_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_pp_data_t)); + if (!pp_data_local_var) { + return NULL; + } + pp_data_local_var->communication_characteristics = communication_characteristics; + pp_data_local_var->supported_features = supported_features; + pp_data_local_var->expected_ue_behaviour_parameters = expected_ue_behaviour_parameters; + pp_data_local_var->ec_restriction = ec_restriction; + pp_data_local_var->acs_info = acs_info; + pp_data_local_var->stn_sr = stn_sr; + pp_data_local_var->lcs_privacy = lcs_privacy; + + return pp_data_local_var; +} + +void OpenAPI_pp_data_free(OpenAPI_pp_data_t *pp_data) +{ + if (NULL == pp_data) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_communication_characteristics_free(pp_data->communication_characteristics); + ogs_free(pp_data->supported_features); + OpenAPI_expected_ue_behaviour_free(pp_data->expected_ue_behaviour_parameters); + OpenAPI_ec_restriction_free(pp_data->ec_restriction); + OpenAPI_acs_info_rm_free(pp_data->acs_info); + ogs_free(pp_data->stn_sr); + OpenAPI_lcs_privacy_free(pp_data->lcs_privacy); + ogs_free(pp_data); +} + +cJSON *OpenAPI_pp_data_convertToJSON(OpenAPI_pp_data_t *pp_data) +{ + cJSON *item = NULL; + + if (pp_data == NULL) { + ogs_error("OpenAPI_pp_data_convertToJSON() failed [PpData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (pp_data->communication_characteristics) { + cJSON *communication_characteristics_local_JSON = OpenAPI_communication_characteristics_convertToJSON(pp_data->communication_characteristics); + if (communication_characteristics_local_JSON == NULL) { + ogs_error("OpenAPI_pp_data_convertToJSON() failed [communication_characteristics]"); + goto end; + } + cJSON_AddItemToObject(item, "communicationCharacteristics", communication_characteristics_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_pp_data_convertToJSON() failed [communication_characteristics]"); + goto end; + } + } + + if (pp_data->supported_features) { + if (cJSON_AddStringToObject(item, "supportedFeatures", pp_data->supported_features) == NULL) { + ogs_error("OpenAPI_pp_data_convertToJSON() failed [supported_features]"); + goto end; + } + } + + if (pp_data->expected_ue_behaviour_parameters) { + cJSON *expected_ue_behaviour_parameters_local_JSON = OpenAPI_expected_ue_behaviour_convertToJSON(pp_data->expected_ue_behaviour_parameters); + if (expected_ue_behaviour_parameters_local_JSON == NULL) { + ogs_error("OpenAPI_pp_data_convertToJSON() failed [expected_ue_behaviour_parameters]"); + goto end; + } + cJSON_AddItemToObject(item, "expectedUeBehaviourParameters", expected_ue_behaviour_parameters_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_pp_data_convertToJSON() failed [expected_ue_behaviour_parameters]"); + goto end; + } + } + + if (pp_data->ec_restriction) { + cJSON *ec_restriction_local_JSON = OpenAPI_ec_restriction_convertToJSON(pp_data->ec_restriction); + if (ec_restriction_local_JSON == NULL) { + ogs_error("OpenAPI_pp_data_convertToJSON() failed [ec_restriction]"); + goto end; + } + cJSON_AddItemToObject(item, "ecRestriction", ec_restriction_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_pp_data_convertToJSON() failed [ec_restriction]"); + goto end; + } + } + + if (pp_data->acs_info) { + cJSON *acs_info_local_JSON = OpenAPI_acs_info_rm_convertToJSON(pp_data->acs_info); + if (acs_info_local_JSON == NULL) { + ogs_error("OpenAPI_pp_data_convertToJSON() failed [acs_info]"); + goto end; + } + cJSON_AddItemToObject(item, "acsInfo", acs_info_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_pp_data_convertToJSON() failed [acs_info]"); + goto end; + } + } + + if (pp_data->stn_sr) { + if (cJSON_AddStringToObject(item, "stnSr", pp_data->stn_sr) == NULL) { + ogs_error("OpenAPI_pp_data_convertToJSON() failed [stn_sr]"); + goto end; + } + } + + if (pp_data->lcs_privacy) { + cJSON *lcs_privacy_local_JSON = OpenAPI_lcs_privacy_convertToJSON(pp_data->lcs_privacy); + if (lcs_privacy_local_JSON == NULL) { + ogs_error("OpenAPI_pp_data_convertToJSON() failed [lcs_privacy]"); + goto end; + } + cJSON_AddItemToObject(item, "lcsPrivacy", lcs_privacy_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_pp_data_convertToJSON() failed [lcs_privacy]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_pp_data_t *OpenAPI_pp_data_parseFromJSON(cJSON *pp_dataJSON) +{ + OpenAPI_pp_data_t *pp_data_local_var = NULL; + cJSON *communication_characteristics = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "communicationCharacteristics"); + + OpenAPI_communication_characteristics_t *communication_characteristics_local_nonprim = NULL; + if (communication_characteristics) { + communication_characteristics_local_nonprim = OpenAPI_communication_characteristics_parseFromJSON(communication_characteristics); + } + + cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "supportedFeatures"); + + if (supported_features) { + if (!cJSON_IsString(supported_features)) { + ogs_error("OpenAPI_pp_data_parseFromJSON() failed [supported_features]"); + goto end; + } + } + + cJSON *expected_ue_behaviour_parameters = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "expectedUeBehaviourParameters"); + + OpenAPI_expected_ue_behaviour_t *expected_ue_behaviour_parameters_local_nonprim = NULL; + if (expected_ue_behaviour_parameters) { + expected_ue_behaviour_parameters_local_nonprim = OpenAPI_expected_ue_behaviour_parseFromJSON(expected_ue_behaviour_parameters); + } + + cJSON *ec_restriction = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "ecRestriction"); + + OpenAPI_ec_restriction_t *ec_restriction_local_nonprim = NULL; + if (ec_restriction) { + ec_restriction_local_nonprim = OpenAPI_ec_restriction_parseFromJSON(ec_restriction); + } + + cJSON *acs_info = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "acsInfo"); + + OpenAPI_acs_info_rm_t *acs_info_local_nonprim = NULL; + if (acs_info) { + acs_info_local_nonprim = OpenAPI_acs_info_rm_parseFromJSON(acs_info); + } + + cJSON *stn_sr = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "stnSr"); + + if (stn_sr) { + if (!cJSON_IsString(stn_sr)) { + ogs_error("OpenAPI_pp_data_parseFromJSON() failed [stn_sr]"); + goto end; + } + } + + cJSON *lcs_privacy = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "lcsPrivacy"); + + OpenAPI_lcs_privacy_t *lcs_privacy_local_nonprim = NULL; + if (lcs_privacy) { + lcs_privacy_local_nonprim = OpenAPI_lcs_privacy_parseFromJSON(lcs_privacy); + } + + pp_data_local_var = OpenAPI_pp_data_create ( + communication_characteristics ? communication_characteristics_local_nonprim : NULL, + supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + expected_ue_behaviour_parameters ? expected_ue_behaviour_parameters_local_nonprim : NULL, + ec_restriction ? ec_restriction_local_nonprim : NULL, + acs_info ? acs_info_local_nonprim : NULL, + stn_sr ? ogs_strdup(stn_sr->valuestring) : NULL, + lcs_privacy ? lcs_privacy_local_nonprim : NULL + ); + + return pp_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/pp_data.h b/lib/sbi/openapi/model/pp_data.h new file mode 100644 index 0000000000..46c7343d54 --- /dev/null +++ b/lib/sbi/openapi/model/pp_data.h @@ -0,0 +1,54 @@ +/* + * pp_data.h + * + * + */ + +#ifndef _OpenAPI_pp_data_H_ +#define _OpenAPI_pp_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "acs_info_rm.h" +#include "communication_characteristics.h" +#include "ec_restriction.h" +#include "expected_ue_behaviour.h" +#include "lcs_privacy.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_pp_data_s OpenAPI_pp_data_t; +typedef struct OpenAPI_pp_data_s { + struct OpenAPI_communication_characteristics_s *communication_characteristics; + char *supported_features; + struct OpenAPI_expected_ue_behaviour_s *expected_ue_behaviour_parameters; + struct OpenAPI_ec_restriction_s *ec_restriction; + struct OpenAPI_acs_info_rm_s *acs_info; + char *stn_sr; + struct OpenAPI_lcs_privacy_s *lcs_privacy; +} OpenAPI_pp_data_t; + +OpenAPI_pp_data_t *OpenAPI_pp_data_create( + OpenAPI_communication_characteristics_t *communication_characteristics, + char *supported_features, + OpenAPI_expected_ue_behaviour_t *expected_ue_behaviour_parameters, + OpenAPI_ec_restriction_t *ec_restriction, + OpenAPI_acs_info_rm_t *acs_info, + char *stn_sr, + OpenAPI_lcs_privacy_t *lcs_privacy + ); +void OpenAPI_pp_data_free(OpenAPI_pp_data_t *pp_data); +OpenAPI_pp_data_t *OpenAPI_pp_data_parseFromJSON(cJSON *pp_dataJSON); +cJSON *OpenAPI_pp_data_convertToJSON(OpenAPI_pp_data_t *pp_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_pp_data_H_ */ + diff --git a/lib/sbi/openapi/model/pp_dl_packet_count_ext.c b/lib/sbi/openapi/model/pp_dl_packet_count_ext.c new file mode 100644 index 0000000000..b02c9de29a --- /dev/null +++ b/lib/sbi/openapi/model/pp_dl_packet_count_ext.c @@ -0,0 +1,120 @@ + +#include +#include +#include +#include "pp_dl_packet_count_ext.h" + +OpenAPI_pp_dl_packet_count_ext_t *OpenAPI_pp_dl_packet_count_ext_create( + char *af_instance_id, + int reference_id, + char *validity_time + ) +{ + OpenAPI_pp_dl_packet_count_ext_t *pp_dl_packet_count_ext_local_var = OpenAPI_malloc(sizeof(OpenAPI_pp_dl_packet_count_ext_t)); + if (!pp_dl_packet_count_ext_local_var) { + return NULL; + } + pp_dl_packet_count_ext_local_var->af_instance_id = af_instance_id; + pp_dl_packet_count_ext_local_var->reference_id = reference_id; + pp_dl_packet_count_ext_local_var->validity_time = validity_time; + + return pp_dl_packet_count_ext_local_var; +} + +void OpenAPI_pp_dl_packet_count_ext_free(OpenAPI_pp_dl_packet_count_ext_t *pp_dl_packet_count_ext) +{ + if (NULL == pp_dl_packet_count_ext) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(pp_dl_packet_count_ext->af_instance_id); + ogs_free(pp_dl_packet_count_ext->validity_time); + ogs_free(pp_dl_packet_count_ext); +} + +cJSON *OpenAPI_pp_dl_packet_count_ext_convertToJSON(OpenAPI_pp_dl_packet_count_ext_t *pp_dl_packet_count_ext) +{ + cJSON *item = NULL; + + if (pp_dl_packet_count_ext == NULL) { + ogs_error("OpenAPI_pp_dl_packet_count_ext_convertToJSON() failed [PpDlPacketCountExt]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!pp_dl_packet_count_ext->af_instance_id) { + ogs_error("OpenAPI_pp_dl_packet_count_ext_convertToJSON() failed [af_instance_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "afInstanceId", pp_dl_packet_count_ext->af_instance_id) == NULL) { + ogs_error("OpenAPI_pp_dl_packet_count_ext_convertToJSON() failed [af_instance_id]"); + goto end; + } + + if (!pp_dl_packet_count_ext->reference_id) { + ogs_error("OpenAPI_pp_dl_packet_count_ext_convertToJSON() failed [reference_id]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "referenceId", pp_dl_packet_count_ext->reference_id) == NULL) { + ogs_error("OpenAPI_pp_dl_packet_count_ext_convertToJSON() failed [reference_id]"); + goto end; + } + + if (pp_dl_packet_count_ext->validity_time) { + if (cJSON_AddStringToObject(item, "validityTime", pp_dl_packet_count_ext->validity_time) == NULL) { + ogs_error("OpenAPI_pp_dl_packet_count_ext_convertToJSON() failed [validity_time]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_pp_dl_packet_count_ext_t *OpenAPI_pp_dl_packet_count_ext_parseFromJSON(cJSON *pp_dl_packet_count_extJSON) +{ + OpenAPI_pp_dl_packet_count_ext_t *pp_dl_packet_count_ext_local_var = NULL; + cJSON *af_instance_id = cJSON_GetObjectItemCaseSensitive(pp_dl_packet_count_extJSON, "afInstanceId"); + if (!af_instance_id) { + ogs_error("OpenAPI_pp_dl_packet_count_ext_parseFromJSON() failed [af_instance_id]"); + goto end; + } + + + if (!cJSON_IsString(af_instance_id)) { + ogs_error("OpenAPI_pp_dl_packet_count_ext_parseFromJSON() failed [af_instance_id]"); + goto end; + } + + cJSON *reference_id = cJSON_GetObjectItemCaseSensitive(pp_dl_packet_count_extJSON, "referenceId"); + if (!reference_id) { + ogs_error("OpenAPI_pp_dl_packet_count_ext_parseFromJSON() failed [reference_id]"); + goto end; + } + + + if (!cJSON_IsNumber(reference_id)) { + ogs_error("OpenAPI_pp_dl_packet_count_ext_parseFromJSON() failed [reference_id]"); + goto end; + } + + cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(pp_dl_packet_count_extJSON, "validityTime"); + + if (validity_time) { + if (!cJSON_IsString(validity_time)) { + ogs_error("OpenAPI_pp_dl_packet_count_ext_parseFromJSON() failed [validity_time]"); + goto end; + } + } + + pp_dl_packet_count_ext_local_var = OpenAPI_pp_dl_packet_count_ext_create ( + ogs_strdup(af_instance_id->valuestring), + reference_id->valuedouble, + validity_time ? ogs_strdup(validity_time->valuestring) : NULL + ); + + return pp_dl_packet_count_ext_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/pp_dl_packet_count_ext.h b/lib/sbi/openapi/model/pp_dl_packet_count_ext.h new file mode 100644 index 0000000000..777726d375 --- /dev/null +++ b/lib/sbi/openapi/model/pp_dl_packet_count_ext.h @@ -0,0 +1,41 @@ +/* + * pp_dl_packet_count_ext.h + * + * + */ + +#ifndef _OpenAPI_pp_dl_packet_count_ext_H_ +#define _OpenAPI_pp_dl_packet_count_ext_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_pp_dl_packet_count_ext_s OpenAPI_pp_dl_packet_count_ext_t; +typedef struct OpenAPI_pp_dl_packet_count_ext_s { + char *af_instance_id; + int reference_id; + char *validity_time; +} OpenAPI_pp_dl_packet_count_ext_t; + +OpenAPI_pp_dl_packet_count_ext_t *OpenAPI_pp_dl_packet_count_ext_create( + char *af_instance_id, + int reference_id, + char *validity_time + ); +void OpenAPI_pp_dl_packet_count_ext_free(OpenAPI_pp_dl_packet_count_ext_t *pp_dl_packet_count_ext); +OpenAPI_pp_dl_packet_count_ext_t *OpenAPI_pp_dl_packet_count_ext_parseFromJSON(cJSON *pp_dl_packet_count_extJSON); +cJSON *OpenAPI_pp_dl_packet_count_ext_convertToJSON(OpenAPI_pp_dl_packet_count_ext_t *pp_dl_packet_count_ext); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_pp_dl_packet_count_ext_H_ */ + diff --git a/lib/sbi/openapi/model/pp_maximum_latency.c b/lib/sbi/openapi/model/pp_maximum_latency.c new file mode 100644 index 0000000000..fde257cfd1 --- /dev/null +++ b/lib/sbi/openapi/model/pp_maximum_latency.c @@ -0,0 +1,144 @@ + +#include +#include +#include +#include "pp_maximum_latency.h" + +OpenAPI_pp_maximum_latency_t *OpenAPI_pp_maximum_latency_create( + int maximum_latency, + char *af_instance_id, + int reference_id, + char *validity_time + ) +{ + OpenAPI_pp_maximum_latency_t *pp_maximum_latency_local_var = OpenAPI_malloc(sizeof(OpenAPI_pp_maximum_latency_t)); + if (!pp_maximum_latency_local_var) { + return NULL; + } + pp_maximum_latency_local_var->maximum_latency = maximum_latency; + pp_maximum_latency_local_var->af_instance_id = af_instance_id; + pp_maximum_latency_local_var->reference_id = reference_id; + pp_maximum_latency_local_var->validity_time = validity_time; + + return pp_maximum_latency_local_var; +} + +void OpenAPI_pp_maximum_latency_free(OpenAPI_pp_maximum_latency_t *pp_maximum_latency) +{ + if (NULL == pp_maximum_latency) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(pp_maximum_latency->af_instance_id); + ogs_free(pp_maximum_latency->validity_time); + ogs_free(pp_maximum_latency); +} + +cJSON *OpenAPI_pp_maximum_latency_convertToJSON(OpenAPI_pp_maximum_latency_t *pp_maximum_latency) +{ + cJSON *item = NULL; + + if (pp_maximum_latency == NULL) { + ogs_error("OpenAPI_pp_maximum_latency_convertToJSON() failed [PpMaximumLatency]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!pp_maximum_latency->maximum_latency) { + ogs_error("OpenAPI_pp_maximum_latency_convertToJSON() failed [maximum_latency]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "maximumLatency", pp_maximum_latency->maximum_latency) == NULL) { + ogs_error("OpenAPI_pp_maximum_latency_convertToJSON() failed [maximum_latency]"); + goto end; + } + + if (!pp_maximum_latency->af_instance_id) { + ogs_error("OpenAPI_pp_maximum_latency_convertToJSON() failed [af_instance_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "afInstanceId", pp_maximum_latency->af_instance_id) == NULL) { + ogs_error("OpenAPI_pp_maximum_latency_convertToJSON() failed [af_instance_id]"); + goto end; + } + + if (!pp_maximum_latency->reference_id) { + ogs_error("OpenAPI_pp_maximum_latency_convertToJSON() failed [reference_id]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "referenceId", pp_maximum_latency->reference_id) == NULL) { + ogs_error("OpenAPI_pp_maximum_latency_convertToJSON() failed [reference_id]"); + goto end; + } + + if (pp_maximum_latency->validity_time) { + if (cJSON_AddStringToObject(item, "validityTime", pp_maximum_latency->validity_time) == NULL) { + ogs_error("OpenAPI_pp_maximum_latency_convertToJSON() failed [validity_time]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_pp_maximum_latency_t *OpenAPI_pp_maximum_latency_parseFromJSON(cJSON *pp_maximum_latencyJSON) +{ + OpenAPI_pp_maximum_latency_t *pp_maximum_latency_local_var = NULL; + cJSON *maximum_latency = cJSON_GetObjectItemCaseSensitive(pp_maximum_latencyJSON, "maximumLatency"); + if (!maximum_latency) { + ogs_error("OpenAPI_pp_maximum_latency_parseFromJSON() failed [maximum_latency]"); + goto end; + } + + + if (!cJSON_IsNumber(maximum_latency)) { + ogs_error("OpenAPI_pp_maximum_latency_parseFromJSON() failed [maximum_latency]"); + goto end; + } + + cJSON *af_instance_id = cJSON_GetObjectItemCaseSensitive(pp_maximum_latencyJSON, "afInstanceId"); + if (!af_instance_id) { + ogs_error("OpenAPI_pp_maximum_latency_parseFromJSON() failed [af_instance_id]"); + goto end; + } + + + if (!cJSON_IsString(af_instance_id)) { + ogs_error("OpenAPI_pp_maximum_latency_parseFromJSON() failed [af_instance_id]"); + goto end; + } + + cJSON *reference_id = cJSON_GetObjectItemCaseSensitive(pp_maximum_latencyJSON, "referenceId"); + if (!reference_id) { + ogs_error("OpenAPI_pp_maximum_latency_parseFromJSON() failed [reference_id]"); + goto end; + } + + + if (!cJSON_IsNumber(reference_id)) { + ogs_error("OpenAPI_pp_maximum_latency_parseFromJSON() failed [reference_id]"); + goto end; + } + + cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(pp_maximum_latencyJSON, "validityTime"); + + if (validity_time) { + if (!cJSON_IsString(validity_time)) { + ogs_error("OpenAPI_pp_maximum_latency_parseFromJSON() failed [validity_time]"); + goto end; + } + } + + pp_maximum_latency_local_var = OpenAPI_pp_maximum_latency_create ( + maximum_latency->valuedouble, + ogs_strdup(af_instance_id->valuestring), + reference_id->valuedouble, + validity_time ? ogs_strdup(validity_time->valuestring) : NULL + ); + + return pp_maximum_latency_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/pp_maximum_latency.h b/lib/sbi/openapi/model/pp_maximum_latency.h new file mode 100644 index 0000000000..846a99ca02 --- /dev/null +++ b/lib/sbi/openapi/model/pp_maximum_latency.h @@ -0,0 +1,43 @@ +/* + * pp_maximum_latency.h + * + * + */ + +#ifndef _OpenAPI_pp_maximum_latency_H_ +#define _OpenAPI_pp_maximum_latency_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_pp_maximum_latency_s OpenAPI_pp_maximum_latency_t; +typedef struct OpenAPI_pp_maximum_latency_s { + int maximum_latency; + char *af_instance_id; + int reference_id; + char *validity_time; +} OpenAPI_pp_maximum_latency_t; + +OpenAPI_pp_maximum_latency_t *OpenAPI_pp_maximum_latency_create( + int maximum_latency, + char *af_instance_id, + int reference_id, + char *validity_time + ); +void OpenAPI_pp_maximum_latency_free(OpenAPI_pp_maximum_latency_t *pp_maximum_latency); +OpenAPI_pp_maximum_latency_t *OpenAPI_pp_maximum_latency_parseFromJSON(cJSON *pp_maximum_latencyJSON); +cJSON *OpenAPI_pp_maximum_latency_convertToJSON(OpenAPI_pp_maximum_latency_t *pp_maximum_latency); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_pp_maximum_latency_H_ */ + diff --git a/lib/sbi/openapi/model/pp_maximum_response_time.c b/lib/sbi/openapi/model/pp_maximum_response_time.c new file mode 100644 index 0000000000..9187663175 --- /dev/null +++ b/lib/sbi/openapi/model/pp_maximum_response_time.c @@ -0,0 +1,144 @@ + +#include +#include +#include +#include "pp_maximum_response_time.h" + +OpenAPI_pp_maximum_response_time_t *OpenAPI_pp_maximum_response_time_create( + int maximum_response_time, + char *af_instance_id, + int reference_id, + char *validity_time + ) +{ + OpenAPI_pp_maximum_response_time_t *pp_maximum_response_time_local_var = OpenAPI_malloc(sizeof(OpenAPI_pp_maximum_response_time_t)); + if (!pp_maximum_response_time_local_var) { + return NULL; + } + pp_maximum_response_time_local_var->maximum_response_time = maximum_response_time; + pp_maximum_response_time_local_var->af_instance_id = af_instance_id; + pp_maximum_response_time_local_var->reference_id = reference_id; + pp_maximum_response_time_local_var->validity_time = validity_time; + + return pp_maximum_response_time_local_var; +} + +void OpenAPI_pp_maximum_response_time_free(OpenAPI_pp_maximum_response_time_t *pp_maximum_response_time) +{ + if (NULL == pp_maximum_response_time) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(pp_maximum_response_time->af_instance_id); + ogs_free(pp_maximum_response_time->validity_time); + ogs_free(pp_maximum_response_time); +} + +cJSON *OpenAPI_pp_maximum_response_time_convertToJSON(OpenAPI_pp_maximum_response_time_t *pp_maximum_response_time) +{ + cJSON *item = NULL; + + if (pp_maximum_response_time == NULL) { + ogs_error("OpenAPI_pp_maximum_response_time_convertToJSON() failed [PpMaximumResponseTime]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!pp_maximum_response_time->maximum_response_time) { + ogs_error("OpenAPI_pp_maximum_response_time_convertToJSON() failed [maximum_response_time]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "maximumResponseTime", pp_maximum_response_time->maximum_response_time) == NULL) { + ogs_error("OpenAPI_pp_maximum_response_time_convertToJSON() failed [maximum_response_time]"); + goto end; + } + + if (!pp_maximum_response_time->af_instance_id) { + ogs_error("OpenAPI_pp_maximum_response_time_convertToJSON() failed [af_instance_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "afInstanceId", pp_maximum_response_time->af_instance_id) == NULL) { + ogs_error("OpenAPI_pp_maximum_response_time_convertToJSON() failed [af_instance_id]"); + goto end; + } + + if (!pp_maximum_response_time->reference_id) { + ogs_error("OpenAPI_pp_maximum_response_time_convertToJSON() failed [reference_id]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "referenceId", pp_maximum_response_time->reference_id) == NULL) { + ogs_error("OpenAPI_pp_maximum_response_time_convertToJSON() failed [reference_id]"); + goto end; + } + + if (pp_maximum_response_time->validity_time) { + if (cJSON_AddStringToObject(item, "validityTime", pp_maximum_response_time->validity_time) == NULL) { + ogs_error("OpenAPI_pp_maximum_response_time_convertToJSON() failed [validity_time]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_pp_maximum_response_time_t *OpenAPI_pp_maximum_response_time_parseFromJSON(cJSON *pp_maximum_response_timeJSON) +{ + OpenAPI_pp_maximum_response_time_t *pp_maximum_response_time_local_var = NULL; + cJSON *maximum_response_time = cJSON_GetObjectItemCaseSensitive(pp_maximum_response_timeJSON, "maximumResponseTime"); + if (!maximum_response_time) { + ogs_error("OpenAPI_pp_maximum_response_time_parseFromJSON() failed [maximum_response_time]"); + goto end; + } + + + if (!cJSON_IsNumber(maximum_response_time)) { + ogs_error("OpenAPI_pp_maximum_response_time_parseFromJSON() failed [maximum_response_time]"); + goto end; + } + + cJSON *af_instance_id = cJSON_GetObjectItemCaseSensitive(pp_maximum_response_timeJSON, "afInstanceId"); + if (!af_instance_id) { + ogs_error("OpenAPI_pp_maximum_response_time_parseFromJSON() failed [af_instance_id]"); + goto end; + } + + + if (!cJSON_IsString(af_instance_id)) { + ogs_error("OpenAPI_pp_maximum_response_time_parseFromJSON() failed [af_instance_id]"); + goto end; + } + + cJSON *reference_id = cJSON_GetObjectItemCaseSensitive(pp_maximum_response_timeJSON, "referenceId"); + if (!reference_id) { + ogs_error("OpenAPI_pp_maximum_response_time_parseFromJSON() failed [reference_id]"); + goto end; + } + + + if (!cJSON_IsNumber(reference_id)) { + ogs_error("OpenAPI_pp_maximum_response_time_parseFromJSON() failed [reference_id]"); + goto end; + } + + cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(pp_maximum_response_timeJSON, "validityTime"); + + if (validity_time) { + if (!cJSON_IsString(validity_time)) { + ogs_error("OpenAPI_pp_maximum_response_time_parseFromJSON() failed [validity_time]"); + goto end; + } + } + + pp_maximum_response_time_local_var = OpenAPI_pp_maximum_response_time_create ( + maximum_response_time->valuedouble, + ogs_strdup(af_instance_id->valuestring), + reference_id->valuedouble, + validity_time ? ogs_strdup(validity_time->valuestring) : NULL + ); + + return pp_maximum_response_time_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/pp_maximum_response_time.h b/lib/sbi/openapi/model/pp_maximum_response_time.h new file mode 100644 index 0000000000..3e6eb5fb59 --- /dev/null +++ b/lib/sbi/openapi/model/pp_maximum_response_time.h @@ -0,0 +1,43 @@ +/* + * pp_maximum_response_time.h + * + * + */ + +#ifndef _OpenAPI_pp_maximum_response_time_H_ +#define _OpenAPI_pp_maximum_response_time_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_pp_maximum_response_time_s OpenAPI_pp_maximum_response_time_t; +typedef struct OpenAPI_pp_maximum_response_time_s { + int maximum_response_time; + char *af_instance_id; + int reference_id; + char *validity_time; +} OpenAPI_pp_maximum_response_time_t; + +OpenAPI_pp_maximum_response_time_t *OpenAPI_pp_maximum_response_time_create( + int maximum_response_time, + char *af_instance_id, + int reference_id, + char *validity_time + ); +void OpenAPI_pp_maximum_response_time_free(OpenAPI_pp_maximum_response_time_t *pp_maximum_response_time); +OpenAPI_pp_maximum_response_time_t *OpenAPI_pp_maximum_response_time_parseFromJSON(cJSON *pp_maximum_response_timeJSON); +cJSON *OpenAPI_pp_maximum_response_time_convertToJSON(OpenAPI_pp_maximum_response_time_t *pp_maximum_response_time); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_pp_maximum_response_time_H_ */ + diff --git a/lib/sbi/openapi/model/pp_subs_reg_timer.c b/lib/sbi/openapi/model/pp_subs_reg_timer.c new file mode 100644 index 0000000000..bf146c9c2a --- /dev/null +++ b/lib/sbi/openapi/model/pp_subs_reg_timer.c @@ -0,0 +1,144 @@ + +#include +#include +#include +#include "pp_subs_reg_timer.h" + +OpenAPI_pp_subs_reg_timer_t *OpenAPI_pp_subs_reg_timer_create( + int subs_reg_timer, + char *af_instance_id, + int reference_id, + char *validity_time + ) +{ + OpenAPI_pp_subs_reg_timer_t *pp_subs_reg_timer_local_var = OpenAPI_malloc(sizeof(OpenAPI_pp_subs_reg_timer_t)); + if (!pp_subs_reg_timer_local_var) { + return NULL; + } + pp_subs_reg_timer_local_var->subs_reg_timer = subs_reg_timer; + pp_subs_reg_timer_local_var->af_instance_id = af_instance_id; + pp_subs_reg_timer_local_var->reference_id = reference_id; + pp_subs_reg_timer_local_var->validity_time = validity_time; + + return pp_subs_reg_timer_local_var; +} + +void OpenAPI_pp_subs_reg_timer_free(OpenAPI_pp_subs_reg_timer_t *pp_subs_reg_timer) +{ + if (NULL == pp_subs_reg_timer) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(pp_subs_reg_timer->af_instance_id); + ogs_free(pp_subs_reg_timer->validity_time); + ogs_free(pp_subs_reg_timer); +} + +cJSON *OpenAPI_pp_subs_reg_timer_convertToJSON(OpenAPI_pp_subs_reg_timer_t *pp_subs_reg_timer) +{ + cJSON *item = NULL; + + if (pp_subs_reg_timer == NULL) { + ogs_error("OpenAPI_pp_subs_reg_timer_convertToJSON() failed [PpSubsRegTimer]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!pp_subs_reg_timer->subs_reg_timer) { + ogs_error("OpenAPI_pp_subs_reg_timer_convertToJSON() failed [subs_reg_timer]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "subsRegTimer", pp_subs_reg_timer->subs_reg_timer) == NULL) { + ogs_error("OpenAPI_pp_subs_reg_timer_convertToJSON() failed [subs_reg_timer]"); + goto end; + } + + if (!pp_subs_reg_timer->af_instance_id) { + ogs_error("OpenAPI_pp_subs_reg_timer_convertToJSON() failed [af_instance_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "afInstanceId", pp_subs_reg_timer->af_instance_id) == NULL) { + ogs_error("OpenAPI_pp_subs_reg_timer_convertToJSON() failed [af_instance_id]"); + goto end; + } + + if (!pp_subs_reg_timer->reference_id) { + ogs_error("OpenAPI_pp_subs_reg_timer_convertToJSON() failed [reference_id]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "referenceId", pp_subs_reg_timer->reference_id) == NULL) { + ogs_error("OpenAPI_pp_subs_reg_timer_convertToJSON() failed [reference_id]"); + goto end; + } + + if (pp_subs_reg_timer->validity_time) { + if (cJSON_AddStringToObject(item, "validityTime", pp_subs_reg_timer->validity_time) == NULL) { + ogs_error("OpenAPI_pp_subs_reg_timer_convertToJSON() failed [validity_time]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_pp_subs_reg_timer_t *OpenAPI_pp_subs_reg_timer_parseFromJSON(cJSON *pp_subs_reg_timerJSON) +{ + OpenAPI_pp_subs_reg_timer_t *pp_subs_reg_timer_local_var = NULL; + cJSON *subs_reg_timer = cJSON_GetObjectItemCaseSensitive(pp_subs_reg_timerJSON, "subsRegTimer"); + if (!subs_reg_timer) { + ogs_error("OpenAPI_pp_subs_reg_timer_parseFromJSON() failed [subs_reg_timer]"); + goto end; + } + + + if (!cJSON_IsNumber(subs_reg_timer)) { + ogs_error("OpenAPI_pp_subs_reg_timer_parseFromJSON() failed [subs_reg_timer]"); + goto end; + } + + cJSON *af_instance_id = cJSON_GetObjectItemCaseSensitive(pp_subs_reg_timerJSON, "afInstanceId"); + if (!af_instance_id) { + ogs_error("OpenAPI_pp_subs_reg_timer_parseFromJSON() failed [af_instance_id]"); + goto end; + } + + + if (!cJSON_IsString(af_instance_id)) { + ogs_error("OpenAPI_pp_subs_reg_timer_parseFromJSON() failed [af_instance_id]"); + goto end; + } + + cJSON *reference_id = cJSON_GetObjectItemCaseSensitive(pp_subs_reg_timerJSON, "referenceId"); + if (!reference_id) { + ogs_error("OpenAPI_pp_subs_reg_timer_parseFromJSON() failed [reference_id]"); + goto end; + } + + + if (!cJSON_IsNumber(reference_id)) { + ogs_error("OpenAPI_pp_subs_reg_timer_parseFromJSON() failed [reference_id]"); + goto end; + } + + cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(pp_subs_reg_timerJSON, "validityTime"); + + if (validity_time) { + if (!cJSON_IsString(validity_time)) { + ogs_error("OpenAPI_pp_subs_reg_timer_parseFromJSON() failed [validity_time]"); + goto end; + } + } + + pp_subs_reg_timer_local_var = OpenAPI_pp_subs_reg_timer_create ( + subs_reg_timer->valuedouble, + ogs_strdup(af_instance_id->valuestring), + reference_id->valuedouble, + validity_time ? ogs_strdup(validity_time->valuestring) : NULL + ); + + return pp_subs_reg_timer_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/pp_subs_reg_timer.h b/lib/sbi/openapi/model/pp_subs_reg_timer.h new file mode 100644 index 0000000000..4053543453 --- /dev/null +++ b/lib/sbi/openapi/model/pp_subs_reg_timer.h @@ -0,0 +1,43 @@ +/* + * pp_subs_reg_timer.h + * + * + */ + +#ifndef _OpenAPI_pp_subs_reg_timer_H_ +#define _OpenAPI_pp_subs_reg_timer_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_pp_subs_reg_timer_s OpenAPI_pp_subs_reg_timer_t; +typedef struct OpenAPI_pp_subs_reg_timer_s { + int subs_reg_timer; + char *af_instance_id; + int reference_id; + char *validity_time; +} OpenAPI_pp_subs_reg_timer_t; + +OpenAPI_pp_subs_reg_timer_t *OpenAPI_pp_subs_reg_timer_create( + int subs_reg_timer, + char *af_instance_id, + int reference_id, + char *validity_time + ); +void OpenAPI_pp_subs_reg_timer_free(OpenAPI_pp_subs_reg_timer_t *pp_subs_reg_timer); +OpenAPI_pp_subs_reg_timer_t *OpenAPI_pp_subs_reg_timer_parseFromJSON(cJSON *pp_subs_reg_timerJSON); +cJSON *OpenAPI_pp_subs_reg_timer_convertToJSON(OpenAPI_pp_subs_reg_timer_t *pp_subs_reg_timer); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_pp_subs_reg_timer_H_ */ + diff --git a/lib/sbi/openapi/model/pppp_to_pdb.c b/lib/sbi/openapi/model/pppp_to_pdb.c new file mode 100644 index 0000000000..e97ce34dd5 --- /dev/null +++ b/lib/sbi/openapi/model/pppp_to_pdb.c @@ -0,0 +1,99 @@ + +#include +#include +#include +#include "pppp_to_pdb.h" + +OpenAPI_pppp_to_pdb_t *OpenAPI_pppp_to_pdb_create( + int pppp, + int pdb + ) +{ + OpenAPI_pppp_to_pdb_t *pppp_to_pdb_local_var = OpenAPI_malloc(sizeof(OpenAPI_pppp_to_pdb_t)); + if (!pppp_to_pdb_local_var) { + return NULL; + } + pppp_to_pdb_local_var->pppp = pppp; + pppp_to_pdb_local_var->pdb = pdb; + + return pppp_to_pdb_local_var; +} + +void OpenAPI_pppp_to_pdb_free(OpenAPI_pppp_to_pdb_t *pppp_to_pdb) +{ + if (NULL == pppp_to_pdb) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(pppp_to_pdb); +} + +cJSON *OpenAPI_pppp_to_pdb_convertToJSON(OpenAPI_pppp_to_pdb_t *pppp_to_pdb) +{ + cJSON *item = NULL; + + if (pppp_to_pdb == NULL) { + ogs_error("OpenAPI_pppp_to_pdb_convertToJSON() failed [PpppToPdb]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!pppp_to_pdb->pppp) { + ogs_error("OpenAPI_pppp_to_pdb_convertToJSON() failed [pppp]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "pppp", pppp_to_pdb->pppp) == NULL) { + ogs_error("OpenAPI_pppp_to_pdb_convertToJSON() failed [pppp]"); + goto end; + } + + if (!pppp_to_pdb->pdb) { + ogs_error("OpenAPI_pppp_to_pdb_convertToJSON() failed [pdb]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "pdb", pppp_to_pdb->pdb) == NULL) { + ogs_error("OpenAPI_pppp_to_pdb_convertToJSON() failed [pdb]"); + goto end; + } + +end: + return item; +} + +OpenAPI_pppp_to_pdb_t *OpenAPI_pppp_to_pdb_parseFromJSON(cJSON *pppp_to_pdbJSON) +{ + OpenAPI_pppp_to_pdb_t *pppp_to_pdb_local_var = NULL; + cJSON *pppp = cJSON_GetObjectItemCaseSensitive(pppp_to_pdbJSON, "pppp"); + if (!pppp) { + ogs_error("OpenAPI_pppp_to_pdb_parseFromJSON() failed [pppp]"); + goto end; + } + + + if (!cJSON_IsNumber(pppp)) { + ogs_error("OpenAPI_pppp_to_pdb_parseFromJSON() failed [pppp]"); + goto end; + } + + cJSON *pdb = cJSON_GetObjectItemCaseSensitive(pppp_to_pdbJSON, "pdb"); + if (!pdb) { + ogs_error("OpenAPI_pppp_to_pdb_parseFromJSON() failed [pdb]"); + goto end; + } + + + if (!cJSON_IsNumber(pdb)) { + ogs_error("OpenAPI_pppp_to_pdb_parseFromJSON() failed [pdb]"); + goto end; + } + + pppp_to_pdb_local_var = OpenAPI_pppp_to_pdb_create ( + pppp->valuedouble, + pdb->valuedouble + ); + + return pppp_to_pdb_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/pppp_to_pdb.h b/lib/sbi/openapi/model/pppp_to_pdb.h new file mode 100644 index 0000000000..362b312bc8 --- /dev/null +++ b/lib/sbi/openapi/model/pppp_to_pdb.h @@ -0,0 +1,39 @@ +/* + * pppp_to_pdb.h + * + * + */ + +#ifndef _OpenAPI_pppp_to_pdb_H_ +#define _OpenAPI_pppp_to_pdb_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_pppp_to_pdb_s OpenAPI_pppp_to_pdb_t; +typedef struct OpenAPI_pppp_to_pdb_s { + int pppp; + int pdb; +} OpenAPI_pppp_to_pdb_t; + +OpenAPI_pppp_to_pdb_t *OpenAPI_pppp_to_pdb_create( + int pppp, + int pdb + ); +void OpenAPI_pppp_to_pdb_free(OpenAPI_pppp_to_pdb_t *pppp_to_pdb); +OpenAPI_pppp_to_pdb_t *OpenAPI_pppp_to_pdb_parseFromJSON(cJSON *pppp_to_pdbJSON); +cJSON *OpenAPI_pppp_to_pdb_convertToJSON(OpenAPI_pppp_to_pdb_t *pppp_to_pdb); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_pppp_to_pdb_H_ */ + diff --git a/lib/sbi/openapi/model/preemption_capability.c b/lib/sbi/openapi/model/preemption_capability.c new file mode 100644 index 0000000000..daa440fe2d --- /dev/null +++ b/lib/sbi/openapi/model/preemption_capability.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "preemption_capability.h" + +OpenAPI_preemption_capability_t *OpenAPI_preemption_capability_create( + ) +{ + OpenAPI_preemption_capability_t *preemption_capability_local_var = OpenAPI_malloc(sizeof(OpenAPI_preemption_capability_t)); + if (!preemption_capability_local_var) { + return NULL; + } + + return preemption_capability_local_var; +} + +void OpenAPI_preemption_capability_free(OpenAPI_preemption_capability_t *preemption_capability) +{ + if (NULL == preemption_capability) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(preemption_capability); +} + +cJSON *OpenAPI_preemption_capability_convertToJSON(OpenAPI_preemption_capability_t *preemption_capability) +{ + cJSON *item = NULL; + + if (preemption_capability == NULL) { + ogs_error("OpenAPI_preemption_capability_convertToJSON() failed [PreemptionCapability]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_preemption_capability_t *OpenAPI_preemption_capability_parseFromJSON(cJSON *preemption_capabilityJSON) +{ + OpenAPI_preemption_capability_t *preemption_capability_local_var = NULL; + preemption_capability_local_var = OpenAPI_preemption_capability_create ( + ); + + return preemption_capability_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/preemption_capability.h b/lib/sbi/openapi/model/preemption_capability.h new file mode 100644 index 0000000000..b07348cd68 --- /dev/null +++ b/lib/sbi/openapi/model/preemption_capability.h @@ -0,0 +1,35 @@ +/* + * preemption_capability.h + * + * + */ + +#ifndef _OpenAPI_preemption_capability_H_ +#define _OpenAPI_preemption_capability_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_preemption_capability_s OpenAPI_preemption_capability_t; +typedef struct OpenAPI_preemption_capability_s { +} OpenAPI_preemption_capability_t; + +OpenAPI_preemption_capability_t *OpenAPI_preemption_capability_create( + ); +void OpenAPI_preemption_capability_free(OpenAPI_preemption_capability_t *preemption_capability); +OpenAPI_preemption_capability_t *OpenAPI_preemption_capability_parseFromJSON(cJSON *preemption_capabilityJSON); +cJSON *OpenAPI_preemption_capability_convertToJSON(OpenAPI_preemption_capability_t *preemption_capability); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_preemption_capability_H_ */ + diff --git a/lib/sbi/openapi/model/preemption_vulnerability.c b/lib/sbi/openapi/model/preemption_vulnerability.c new file mode 100644 index 0000000000..6c5f674ad9 --- /dev/null +++ b/lib/sbi/openapi/model/preemption_vulnerability.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "preemption_vulnerability.h" + +OpenAPI_preemption_vulnerability_t *OpenAPI_preemption_vulnerability_create( + ) +{ + OpenAPI_preemption_vulnerability_t *preemption_vulnerability_local_var = OpenAPI_malloc(sizeof(OpenAPI_preemption_vulnerability_t)); + if (!preemption_vulnerability_local_var) { + return NULL; + } + + return preemption_vulnerability_local_var; +} + +void OpenAPI_preemption_vulnerability_free(OpenAPI_preemption_vulnerability_t *preemption_vulnerability) +{ + if (NULL == preemption_vulnerability) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(preemption_vulnerability); +} + +cJSON *OpenAPI_preemption_vulnerability_convertToJSON(OpenAPI_preemption_vulnerability_t *preemption_vulnerability) +{ + cJSON *item = NULL; + + if (preemption_vulnerability == NULL) { + ogs_error("OpenAPI_preemption_vulnerability_convertToJSON() failed [PreemptionVulnerability]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_preemption_vulnerability_t *OpenAPI_preemption_vulnerability_parseFromJSON(cJSON *preemption_vulnerabilityJSON) +{ + OpenAPI_preemption_vulnerability_t *preemption_vulnerability_local_var = NULL; + preemption_vulnerability_local_var = OpenAPI_preemption_vulnerability_create ( + ); + + return preemption_vulnerability_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/preemption_vulnerability.h b/lib/sbi/openapi/model/preemption_vulnerability.h new file mode 100644 index 0000000000..bf5bc625d5 --- /dev/null +++ b/lib/sbi/openapi/model/preemption_vulnerability.h @@ -0,0 +1,35 @@ +/* + * preemption_vulnerability.h + * + * + */ + +#ifndef _OpenAPI_preemption_vulnerability_H_ +#define _OpenAPI_preemption_vulnerability_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_preemption_vulnerability_s OpenAPI_preemption_vulnerability_t; +typedef struct OpenAPI_preemption_vulnerability_s { +} OpenAPI_preemption_vulnerability_t; + +OpenAPI_preemption_vulnerability_t *OpenAPI_preemption_vulnerability_create( + ); +void OpenAPI_preemption_vulnerability_free(OpenAPI_preemption_vulnerability_t *preemption_vulnerability); +OpenAPI_preemption_vulnerability_t *OpenAPI_preemption_vulnerability_parseFromJSON(cJSON *preemption_vulnerabilityJSON); +cJSON *OpenAPI_preemption_vulnerability_convertToJSON(OpenAPI_preemption_vulnerability_t *preemption_vulnerability); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_preemption_vulnerability_H_ */ + diff --git a/lib/sbi/openapi/model/preferred_search.c b/lib/sbi/openapi/model/preferred_search.c new file mode 100644 index 0000000000..e2794319b7 --- /dev/null +++ b/lib/sbi/openapi/model/preferred_search.c @@ -0,0 +1,70 @@ + +#include +#include +#include +#include "preferred_search.h" + +OpenAPI_preferred_search_t *OpenAPI_preferred_search_create( + int preferred_tai_match_ind + ) +{ + OpenAPI_preferred_search_t *preferred_search_local_var = OpenAPI_malloc(sizeof(OpenAPI_preferred_search_t)); + if (!preferred_search_local_var) { + return NULL; + } + preferred_search_local_var->preferred_tai_match_ind = preferred_tai_match_ind; + + return preferred_search_local_var; +} + +void OpenAPI_preferred_search_free(OpenAPI_preferred_search_t *preferred_search) +{ + if (NULL == preferred_search) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(preferred_search); +} + +cJSON *OpenAPI_preferred_search_convertToJSON(OpenAPI_preferred_search_t *preferred_search) +{ + cJSON *item = NULL; + + if (preferred_search == NULL) { + ogs_error("OpenAPI_preferred_search_convertToJSON() failed [PreferredSearch]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (preferred_search->preferred_tai_match_ind >= 0) { + if (cJSON_AddBoolToObject(item, "preferredTaiMatchInd", preferred_search->preferred_tai_match_ind) == NULL) { + ogs_error("OpenAPI_preferred_search_convertToJSON() failed [preferred_tai_match_ind]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_preferred_search_t *OpenAPI_preferred_search_parseFromJSON(cJSON *preferred_searchJSON) +{ + OpenAPI_preferred_search_t *preferred_search_local_var = NULL; + cJSON *preferred_tai_match_ind = cJSON_GetObjectItemCaseSensitive(preferred_searchJSON, "preferredTaiMatchInd"); + + if (preferred_tai_match_ind) { + if (!cJSON_IsBool(preferred_tai_match_ind)) { + ogs_error("OpenAPI_preferred_search_parseFromJSON() failed [preferred_tai_match_ind]"); + goto end; + } + } + + preferred_search_local_var = OpenAPI_preferred_search_create ( + preferred_tai_match_ind ? preferred_tai_match_ind->valueint : 0 + ); + + return preferred_search_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/preferred_search.h b/lib/sbi/openapi/model/preferred_search.h new file mode 100644 index 0000000000..482afc746d --- /dev/null +++ b/lib/sbi/openapi/model/preferred_search.h @@ -0,0 +1,37 @@ +/* + * preferred_search.h + * + * Contains information on whether the returned NFProfiles match the preferred query parameters + */ + +#ifndef _OpenAPI_preferred_search_H_ +#define _OpenAPI_preferred_search_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_preferred_search_s OpenAPI_preferred_search_t; +typedef struct OpenAPI_preferred_search_s { + int preferred_tai_match_ind; +} OpenAPI_preferred_search_t; + +OpenAPI_preferred_search_t *OpenAPI_preferred_search_create( + int preferred_tai_match_ind + ); +void OpenAPI_preferred_search_free(OpenAPI_preferred_search_t *preferred_search); +OpenAPI_preferred_search_t *OpenAPI_preferred_search_parseFromJSON(cJSON *preferred_searchJSON); +cJSON *OpenAPI_preferred_search_convertToJSON(OpenAPI_preferred_search_t *preferred_search); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_preferred_search_H_ */ + diff --git a/lib/sbi/openapi/model/presence_info.c b/lib/sbi/openapi/model/presence_info.c new file mode 100644 index 0000000000..691053fd6d --- /dev/null +++ b/lib/sbi/openapi/model/presence_info.c @@ -0,0 +1,345 @@ + +#include +#include +#include +#include "presence_info.h" + +OpenAPI_presence_info_t *OpenAPI_presence_info_create( + char *pra_id, + OpenAPI_presence_state_t *presence_state, + OpenAPI_list_t *tracking_area_list, + OpenAPI_list_t *ecgi_list, + OpenAPI_list_t *ncgi_list, + OpenAPI_list_t *global_ran_node_id_list, + OpenAPI_list_t *globale_nb_id_list + ) +{ + OpenAPI_presence_info_t *presence_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_presence_info_t)); + if (!presence_info_local_var) { + return NULL; + } + presence_info_local_var->pra_id = pra_id; + presence_info_local_var->presence_state = presence_state; + presence_info_local_var->tracking_area_list = tracking_area_list; + presence_info_local_var->ecgi_list = ecgi_list; + presence_info_local_var->ncgi_list = ncgi_list; + presence_info_local_var->global_ran_node_id_list = global_ran_node_id_list; + presence_info_local_var->globale_nb_id_list = globale_nb_id_list; + + return presence_info_local_var; +} + +void OpenAPI_presence_info_free(OpenAPI_presence_info_t *presence_info) +{ + if (NULL == presence_info) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(presence_info->pra_id); + OpenAPI_presence_state_free(presence_info->presence_state); + OpenAPI_list_for_each(presence_info->tracking_area_list, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(presence_info->tracking_area_list); + OpenAPI_list_for_each(presence_info->ecgi_list, node) { + OpenAPI_ecgi_free(node->data); + } + OpenAPI_list_free(presence_info->ecgi_list); + OpenAPI_list_for_each(presence_info->ncgi_list, node) { + OpenAPI_ncgi_free(node->data); + } + OpenAPI_list_free(presence_info->ncgi_list); + OpenAPI_list_for_each(presence_info->global_ran_node_id_list, node) { + OpenAPI_global_ran_node_id_free(node->data); + } + OpenAPI_list_free(presence_info->global_ran_node_id_list); + OpenAPI_list_for_each(presence_info->globale_nb_id_list, node) { + OpenAPI_global_ran_node_id_free(node->data); + } + OpenAPI_list_free(presence_info->globale_nb_id_list); + ogs_free(presence_info); +} + +cJSON *OpenAPI_presence_info_convertToJSON(OpenAPI_presence_info_t *presence_info) +{ + cJSON *item = NULL; + + if (presence_info == NULL) { + ogs_error("OpenAPI_presence_info_convertToJSON() failed [PresenceInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (presence_info->pra_id) { + if (cJSON_AddStringToObject(item, "praId", presence_info->pra_id) == NULL) { + ogs_error("OpenAPI_presence_info_convertToJSON() failed [pra_id]"); + goto end; + } + } + + if (presence_info->presence_state) { + cJSON *presence_state_local_JSON = OpenAPI_presence_state_convertToJSON(presence_info->presence_state); + if (presence_state_local_JSON == NULL) { + ogs_error("OpenAPI_presence_info_convertToJSON() failed [presence_state]"); + goto end; + } + cJSON_AddItemToObject(item, "presenceState", presence_state_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_presence_info_convertToJSON() failed [presence_state]"); + goto end; + } + } + + if (presence_info->tracking_area_list) { + cJSON *tracking_area_listList = cJSON_AddArrayToObject(item, "trackingAreaList"); + if (tracking_area_listList == NULL) { + ogs_error("OpenAPI_presence_info_convertToJSON() failed [tracking_area_list]"); + goto end; + } + + OpenAPI_lnode_t *tracking_area_list_node; + if (presence_info->tracking_area_list) { + OpenAPI_list_for_each(presence_info->tracking_area_list, tracking_area_list_node) { + cJSON *itemLocal = OpenAPI_tai_convertToJSON(tracking_area_list_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_presence_info_convertToJSON() failed [tracking_area_list]"); + goto end; + } + cJSON_AddItemToArray(tracking_area_listList, itemLocal); + } + } + } + + if (presence_info->ecgi_list) { + cJSON *ecgi_listList = cJSON_AddArrayToObject(item, "ecgiList"); + if (ecgi_listList == NULL) { + ogs_error("OpenAPI_presence_info_convertToJSON() failed [ecgi_list]"); + goto end; + } + + OpenAPI_lnode_t *ecgi_list_node; + if (presence_info->ecgi_list) { + OpenAPI_list_for_each(presence_info->ecgi_list, ecgi_list_node) { + cJSON *itemLocal = OpenAPI_ecgi_convertToJSON(ecgi_list_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_presence_info_convertToJSON() failed [ecgi_list]"); + goto end; + } + cJSON_AddItemToArray(ecgi_listList, itemLocal); + } + } + } + + if (presence_info->ncgi_list) { + cJSON *ncgi_listList = cJSON_AddArrayToObject(item, "ncgiList"); + if (ncgi_listList == NULL) { + ogs_error("OpenAPI_presence_info_convertToJSON() failed [ncgi_list]"); + goto end; + } + + OpenAPI_lnode_t *ncgi_list_node; + if (presence_info->ncgi_list) { + OpenAPI_list_for_each(presence_info->ncgi_list, ncgi_list_node) { + cJSON *itemLocal = OpenAPI_ncgi_convertToJSON(ncgi_list_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_presence_info_convertToJSON() failed [ncgi_list]"); + goto end; + } + cJSON_AddItemToArray(ncgi_listList, itemLocal); + } + } + } + + if (presence_info->global_ran_node_id_list) { + cJSON *global_ran_node_id_listList = cJSON_AddArrayToObject(item, "globalRanNodeIdList"); + if (global_ran_node_id_listList == NULL) { + ogs_error("OpenAPI_presence_info_convertToJSON() failed [global_ran_node_id_list]"); + goto end; + } + + OpenAPI_lnode_t *global_ran_node_id_list_node; + if (presence_info->global_ran_node_id_list) { + OpenAPI_list_for_each(presence_info->global_ran_node_id_list, global_ran_node_id_list_node) { + cJSON *itemLocal = OpenAPI_global_ran_node_id_convertToJSON(global_ran_node_id_list_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_presence_info_convertToJSON() failed [global_ran_node_id_list]"); + goto end; + } + cJSON_AddItemToArray(global_ran_node_id_listList, itemLocal); + } + } + } + + if (presence_info->globale_nb_id_list) { + cJSON *globale_nb_id_listList = cJSON_AddArrayToObject(item, "globaleNbIdList"); + if (globale_nb_id_listList == NULL) { + ogs_error("OpenAPI_presence_info_convertToJSON() failed [globale_nb_id_list]"); + goto end; + } + + OpenAPI_lnode_t *globale_nb_id_list_node; + if (presence_info->globale_nb_id_list) { + OpenAPI_list_for_each(presence_info->globale_nb_id_list, globale_nb_id_list_node) { + cJSON *itemLocal = OpenAPI_global_ran_node_id_convertToJSON(globale_nb_id_list_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_presence_info_convertToJSON() failed [globale_nb_id_list]"); + goto end; + } + cJSON_AddItemToArray(globale_nb_id_listList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_presence_info_t *OpenAPI_presence_info_parseFromJSON(cJSON *presence_infoJSON) +{ + OpenAPI_presence_info_t *presence_info_local_var = NULL; + cJSON *pra_id = cJSON_GetObjectItemCaseSensitive(presence_infoJSON, "praId"); + + if (pra_id) { + if (!cJSON_IsString(pra_id)) { + ogs_error("OpenAPI_presence_info_parseFromJSON() failed [pra_id]"); + goto end; + } + } + + cJSON *presence_state = cJSON_GetObjectItemCaseSensitive(presence_infoJSON, "presenceState"); + + OpenAPI_presence_state_t *presence_state_local_nonprim = NULL; + if (presence_state) { + presence_state_local_nonprim = OpenAPI_presence_state_parseFromJSON(presence_state); + } + + cJSON *tracking_area_list = cJSON_GetObjectItemCaseSensitive(presence_infoJSON, "trackingAreaList"); + + OpenAPI_list_t *tracking_area_listList; + if (tracking_area_list) { + cJSON *tracking_area_list_local_nonprimitive; + if (!cJSON_IsArray(tracking_area_list)) { + ogs_error("OpenAPI_presence_info_parseFromJSON() failed [tracking_area_list]"); + goto end; + } + + tracking_area_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tracking_area_list_local_nonprimitive, tracking_area_list ) { + if (!cJSON_IsObject(tracking_area_list_local_nonprimitive)) { + ogs_error("OpenAPI_presence_info_parseFromJSON() failed [tracking_area_list]"); + goto end; + } + OpenAPI_tai_t *tracking_area_listItem = OpenAPI_tai_parseFromJSON(tracking_area_list_local_nonprimitive); + + OpenAPI_list_add(tracking_area_listList, tracking_area_listItem); + } + } + + cJSON *ecgi_list = cJSON_GetObjectItemCaseSensitive(presence_infoJSON, "ecgiList"); + + OpenAPI_list_t *ecgi_listList; + if (ecgi_list) { + cJSON *ecgi_list_local_nonprimitive; + if (!cJSON_IsArray(ecgi_list)) { + ogs_error("OpenAPI_presence_info_parseFromJSON() failed [ecgi_list]"); + goto end; + } + + ecgi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ecgi_list_local_nonprimitive, ecgi_list ) { + if (!cJSON_IsObject(ecgi_list_local_nonprimitive)) { + ogs_error("OpenAPI_presence_info_parseFromJSON() failed [ecgi_list]"); + goto end; + } + OpenAPI_ecgi_t *ecgi_listItem = OpenAPI_ecgi_parseFromJSON(ecgi_list_local_nonprimitive); + + OpenAPI_list_add(ecgi_listList, ecgi_listItem); + } + } + + cJSON *ncgi_list = cJSON_GetObjectItemCaseSensitive(presence_infoJSON, "ncgiList"); + + OpenAPI_list_t *ncgi_listList; + if (ncgi_list) { + cJSON *ncgi_list_local_nonprimitive; + if (!cJSON_IsArray(ncgi_list)) { + ogs_error("OpenAPI_presence_info_parseFromJSON() failed [ncgi_list]"); + goto end; + } + + ncgi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ncgi_list_local_nonprimitive, ncgi_list ) { + if (!cJSON_IsObject(ncgi_list_local_nonprimitive)) { + ogs_error("OpenAPI_presence_info_parseFromJSON() failed [ncgi_list]"); + goto end; + } + OpenAPI_ncgi_t *ncgi_listItem = OpenAPI_ncgi_parseFromJSON(ncgi_list_local_nonprimitive); + + OpenAPI_list_add(ncgi_listList, ncgi_listItem); + } + } + + cJSON *global_ran_node_id_list = cJSON_GetObjectItemCaseSensitive(presence_infoJSON, "globalRanNodeIdList"); + + OpenAPI_list_t *global_ran_node_id_listList; + if (global_ran_node_id_list) { + cJSON *global_ran_node_id_list_local_nonprimitive; + if (!cJSON_IsArray(global_ran_node_id_list)) { + ogs_error("OpenAPI_presence_info_parseFromJSON() failed [global_ran_node_id_list]"); + goto end; + } + + global_ran_node_id_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(global_ran_node_id_list_local_nonprimitive, global_ran_node_id_list ) { + if (!cJSON_IsObject(global_ran_node_id_list_local_nonprimitive)) { + ogs_error("OpenAPI_presence_info_parseFromJSON() failed [global_ran_node_id_list]"); + goto end; + } + OpenAPI_global_ran_node_id_t *global_ran_node_id_listItem = OpenAPI_global_ran_node_id_parseFromJSON(global_ran_node_id_list_local_nonprimitive); + + OpenAPI_list_add(global_ran_node_id_listList, global_ran_node_id_listItem); + } + } + + cJSON *globale_nb_id_list = cJSON_GetObjectItemCaseSensitive(presence_infoJSON, "globaleNbIdList"); + + OpenAPI_list_t *globale_nb_id_listList; + if (globale_nb_id_list) { + cJSON *globale_nb_id_list_local_nonprimitive; + if (!cJSON_IsArray(globale_nb_id_list)) { + ogs_error("OpenAPI_presence_info_parseFromJSON() failed [globale_nb_id_list]"); + goto end; + } + + globale_nb_id_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(globale_nb_id_list_local_nonprimitive, globale_nb_id_list ) { + if (!cJSON_IsObject(globale_nb_id_list_local_nonprimitive)) { + ogs_error("OpenAPI_presence_info_parseFromJSON() failed [globale_nb_id_list]"); + goto end; + } + OpenAPI_global_ran_node_id_t *globale_nb_id_listItem = OpenAPI_global_ran_node_id_parseFromJSON(globale_nb_id_list_local_nonprimitive); + + OpenAPI_list_add(globale_nb_id_listList, globale_nb_id_listItem); + } + } + + presence_info_local_var = OpenAPI_presence_info_create ( + pra_id ? ogs_strdup(pra_id->valuestring) : NULL, + presence_state ? presence_state_local_nonprim : NULL, + tracking_area_list ? tracking_area_listList : NULL, + ecgi_list ? ecgi_listList : NULL, + ncgi_list ? ncgi_listList : NULL, + global_ran_node_id_list ? global_ran_node_id_listList : NULL, + globale_nb_id_list ? globale_nb_id_listList : NULL + ); + + return presence_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/presence_info.h b/lib/sbi/openapi/model/presence_info.h new file mode 100644 index 0000000000..213f5fb494 --- /dev/null +++ b/lib/sbi/openapi/model/presence_info.h @@ -0,0 +1,54 @@ +/* + * presence_info.h + * + * + */ + +#ifndef _OpenAPI_presence_info_H_ +#define _OpenAPI_presence_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "ecgi.h" +#include "global_ran_node_id.h" +#include "ncgi.h" +#include "presence_state.h" +#include "tai.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_presence_info_s OpenAPI_presence_info_t; +typedef struct OpenAPI_presence_info_s { + char *pra_id; + struct OpenAPI_presence_state_s *presence_state; + OpenAPI_list_t *tracking_area_list; + OpenAPI_list_t *ecgi_list; + OpenAPI_list_t *ncgi_list; + OpenAPI_list_t *global_ran_node_id_list; + OpenAPI_list_t *globale_nb_id_list; +} OpenAPI_presence_info_t; + +OpenAPI_presence_info_t *OpenAPI_presence_info_create( + char *pra_id, + OpenAPI_presence_state_t *presence_state, + OpenAPI_list_t *tracking_area_list, + OpenAPI_list_t *ecgi_list, + OpenAPI_list_t *ncgi_list, + OpenAPI_list_t *global_ran_node_id_list, + OpenAPI_list_t *globale_nb_id_list + ); +void OpenAPI_presence_info_free(OpenAPI_presence_info_t *presence_info); +OpenAPI_presence_info_t *OpenAPI_presence_info_parseFromJSON(cJSON *presence_infoJSON); +cJSON *OpenAPI_presence_info_convertToJSON(OpenAPI_presence_info_t *presence_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_presence_info_H_ */ + diff --git a/lib/sbi/openapi/model/presence_state.c b/lib/sbi/openapi/model/presence_state.c new file mode 100644 index 0000000000..aa992862a5 --- /dev/null +++ b/lib/sbi/openapi/model/presence_state.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "presence_state.h" + +OpenAPI_presence_state_t *OpenAPI_presence_state_create( + ) +{ + OpenAPI_presence_state_t *presence_state_local_var = OpenAPI_malloc(sizeof(OpenAPI_presence_state_t)); + if (!presence_state_local_var) { + return NULL; + } + + return presence_state_local_var; +} + +void OpenAPI_presence_state_free(OpenAPI_presence_state_t *presence_state) +{ + if (NULL == presence_state) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(presence_state); +} + +cJSON *OpenAPI_presence_state_convertToJSON(OpenAPI_presence_state_t *presence_state) +{ + cJSON *item = NULL; + + if (presence_state == NULL) { + ogs_error("OpenAPI_presence_state_convertToJSON() failed [PresenceState]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_presence_state_t *OpenAPI_presence_state_parseFromJSON(cJSON *presence_stateJSON) +{ + OpenAPI_presence_state_t *presence_state_local_var = NULL; + presence_state_local_var = OpenAPI_presence_state_create ( + ); + + return presence_state_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/presence_state.h b/lib/sbi/openapi/model/presence_state.h new file mode 100644 index 0000000000..3f5e8966ad --- /dev/null +++ b/lib/sbi/openapi/model/presence_state.h @@ -0,0 +1,35 @@ +/* + * presence_state.h + * + * + */ + +#ifndef _OpenAPI_presence_state_H_ +#define _OpenAPI_presence_state_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_presence_state_s OpenAPI_presence_state_t; +typedef struct OpenAPI_presence_state_s { +} OpenAPI_presence_state_t; + +OpenAPI_presence_state_t *OpenAPI_presence_state_create( + ); +void OpenAPI_presence_state_free(OpenAPI_presence_state_t *presence_state); +OpenAPI_presence_state_t *OpenAPI_presence_state_parseFromJSON(cJSON *presence_stateJSON); +cJSON *OpenAPI_presence_state_convertToJSON(OpenAPI_presence_state_t *presence_state); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_presence_state_H_ */ + diff --git a/lib/sbi/openapi/model/privacy_check_related_action.c b/lib/sbi/openapi/model/privacy_check_related_action.c new file mode 100644 index 0000000000..6e0b806da9 --- /dev/null +++ b/lib/sbi/openapi/model/privacy_check_related_action.c @@ -0,0 +1,30 @@ + +#include +#include +#include +#include "privacy_check_related_action.h" + +char* OpenAPI_privacy_check_related_action_ToString(OpenAPI_privacy_check_related_action_e privacy_check_related_action) +{ + const char *privacy_check_related_actionArray[] = { "NULL", "LOCATION_NOT_ALLOWED", "LOCATION_ALLOWED_WITH_NOTIFICATION", "LOCATION_ALLOWED_WITHOUT_NOTIFICATION", "LOCATION_ALLOWED_WITHOUT_RESPONSE", "LOCATION_RESTRICTED_WITHOUT_RESPONSE" }; + size_t sizeofArray = sizeof(privacy_check_related_actionArray) / sizeof(privacy_check_related_actionArray[0]); + if (privacy_check_related_action < sizeofArray) + return (char *)privacy_check_related_actionArray[privacy_check_related_action]; + else + return (char *)"Unknown"; +} + +OpenAPI_privacy_check_related_action_e OpenAPI_privacy_check_related_action_FromString(char* privacy_check_related_action) +{ + int stringToReturn = 0; + const char *privacy_check_related_actionArray[] = { "NULL", "LOCATION_NOT_ALLOWED", "LOCATION_ALLOWED_WITH_NOTIFICATION", "LOCATION_ALLOWED_WITHOUT_NOTIFICATION", "LOCATION_ALLOWED_WITHOUT_RESPONSE", "LOCATION_RESTRICTED_WITHOUT_RESPONSE" }; + size_t sizeofArray = sizeof(privacy_check_related_actionArray) / sizeof(privacy_check_related_actionArray[0]); + while (stringToReturn < sizeofArray) { + if (strcmp(privacy_check_related_action, privacy_check_related_actionArray[stringToReturn]) == 0) { + return stringToReturn; + } + stringToReturn++; + } + return 0; +} + diff --git a/lib/sbi/openapi/model/privacy_check_related_action.h b/lib/sbi/openapi/model/privacy_check_related_action.h new file mode 100644 index 0000000000..d680485d24 --- /dev/null +++ b/lib/sbi/openapi/model/privacy_check_related_action.h @@ -0,0 +1,31 @@ +/* + * privacy_check_related_action.h + * + * + */ + +#ifndef _OpenAPI_privacy_check_related_action_H_ +#define _OpenAPI_privacy_check_related_action_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { OpenAPI_privacy_check_related_action_NULL = 0, OpenAPI_privacy_check_related_action_LOCATION_NOT_ALLOWED, OpenAPI_privacy_check_related_action_LOCATION_ALLOWED_WITH_NOTIFICATION, OpenAPI_privacy_check_related_action_LOCATION_ALLOWED_WITHOUT_NOTIFICATION, OpenAPI_privacy_check_related_action_LOCATION_ALLOWED_WITHOUT_RESPONSE, OpenAPI_privacy_check_related_action_LOCATION_RESTRICTED_WITHOUT_RESPONSE } OpenAPI_privacy_check_related_action_e; + +char* OpenAPI_privacy_check_related_action_ToString(OpenAPI_privacy_check_related_action_e privacy_check_related_action); + +OpenAPI_privacy_check_related_action_e OpenAPI_privacy_check_related_action_FromString(char* privacy_check_related_action); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_privacy_check_related_action_H_ */ + diff --git a/lib/sbi/openapi/model/privacy_parameter.c b/lib/sbi/openapi/model/privacy_parameter.c new file mode 100644 index 0000000000..a17042c5df --- /dev/null +++ b/lib/sbi/openapi/model/privacy_parameter.c @@ -0,0 +1,148 @@ + +#include +#include +#include +#include "privacy_parameter.h" + +OpenAPI_privacy_parameter_t *OpenAPI_privacy_parameter_create( + OpenAPI_list_t *ser_ids, + char *geographical_area, + int timer + ) +{ + OpenAPI_privacy_parameter_t *privacy_parameter_local_var = OpenAPI_malloc(sizeof(OpenAPI_privacy_parameter_t)); + if (!privacy_parameter_local_var) { + return NULL; + } + privacy_parameter_local_var->ser_ids = ser_ids; + privacy_parameter_local_var->geographical_area = geographical_area; + privacy_parameter_local_var->timer = timer; + + return privacy_parameter_local_var; +} + +void OpenAPI_privacy_parameter_free(OpenAPI_privacy_parameter_t *privacy_parameter) +{ + if (NULL == privacy_parameter) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(privacy_parameter->ser_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(privacy_parameter->ser_ids); + ogs_free(privacy_parameter->geographical_area); + ogs_free(privacy_parameter); +} + +cJSON *OpenAPI_privacy_parameter_convertToJSON(OpenAPI_privacy_parameter_t *privacy_parameter) +{ + cJSON *item = NULL; + + if (privacy_parameter == NULL) { + ogs_error("OpenAPI_privacy_parameter_convertToJSON() failed [PrivacyParameter]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!privacy_parameter->ser_ids) { + ogs_error("OpenAPI_privacy_parameter_convertToJSON() failed [ser_ids]"); + goto end; + } + cJSON *ser_ids = cJSON_AddArrayToObject(item, "serIds"); + if (ser_ids == NULL) { + ogs_error("OpenAPI_privacy_parameter_convertToJSON() failed [ser_ids]"); + goto end; + } + + OpenAPI_lnode_t *ser_ids_node; + OpenAPI_list_for_each(privacy_parameter->ser_ids, ser_ids_node) { + if (cJSON_AddStringToObject(ser_ids, "", (char*)ser_ids_node->data) == NULL) { + ogs_error("OpenAPI_privacy_parameter_convertToJSON() failed [ser_ids]"); + goto end; + } + } + + if (!privacy_parameter->geographical_area) { + ogs_error("OpenAPI_privacy_parameter_convertToJSON() failed [geographical_area]"); + goto end; + } + if (cJSON_AddStringToObject(item, "geographicalArea", privacy_parameter->geographical_area) == NULL) { + ogs_error("OpenAPI_privacy_parameter_convertToJSON() failed [geographical_area]"); + goto end; + } + + if (!privacy_parameter->timer) { + ogs_error("OpenAPI_privacy_parameter_convertToJSON() failed [timer]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "timer", privacy_parameter->timer) == NULL) { + ogs_error("OpenAPI_privacy_parameter_convertToJSON() failed [timer]"); + goto end; + } + +end: + return item; +} + +OpenAPI_privacy_parameter_t *OpenAPI_privacy_parameter_parseFromJSON(cJSON *privacy_parameterJSON) +{ + OpenAPI_privacy_parameter_t *privacy_parameter_local_var = NULL; + cJSON *ser_ids = cJSON_GetObjectItemCaseSensitive(privacy_parameterJSON, "serIds"); + if (!ser_ids) { + ogs_error("OpenAPI_privacy_parameter_parseFromJSON() failed [ser_ids]"); + goto end; + } + + OpenAPI_list_t *ser_idsList; + + cJSON *ser_ids_local; + if (!cJSON_IsArray(ser_ids)) { + ogs_error("OpenAPI_privacy_parameter_parseFromJSON() failed [ser_ids]"); + goto end; + } + ser_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ser_ids_local, ser_ids) { + if (!cJSON_IsString(ser_ids_local)) { + ogs_error("OpenAPI_privacy_parameter_parseFromJSON() failed [ser_ids]"); + goto end; + } + OpenAPI_list_add(ser_idsList, ogs_strdup(ser_ids_local->valuestring)); + } + + cJSON *geographical_area = cJSON_GetObjectItemCaseSensitive(privacy_parameterJSON, "geographicalArea"); + if (!geographical_area) { + ogs_error("OpenAPI_privacy_parameter_parseFromJSON() failed [geographical_area]"); + goto end; + } + + + if (!cJSON_IsString(geographical_area)) { + ogs_error("OpenAPI_privacy_parameter_parseFromJSON() failed [geographical_area]"); + goto end; + } + + cJSON *timer = cJSON_GetObjectItemCaseSensitive(privacy_parameterJSON, "timer"); + if (!timer) { + ogs_error("OpenAPI_privacy_parameter_parseFromJSON() failed [timer]"); + goto end; + } + + + if (!cJSON_IsNumber(timer)) { + ogs_error("OpenAPI_privacy_parameter_parseFromJSON() failed [timer]"); + goto end; + } + + privacy_parameter_local_var = OpenAPI_privacy_parameter_create ( + ser_idsList, + ogs_strdup(geographical_area->valuestring), + timer->valuedouble + ); + + return privacy_parameter_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/privacy_parameter.h b/lib/sbi/openapi/model/privacy_parameter.h new file mode 100644 index 0000000000..c656836154 --- /dev/null +++ b/lib/sbi/openapi/model/privacy_parameter.h @@ -0,0 +1,41 @@ +/* + * privacy_parameter.h + * + * + */ + +#ifndef _OpenAPI_privacy_parameter_H_ +#define _OpenAPI_privacy_parameter_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_privacy_parameter_s OpenAPI_privacy_parameter_t; +typedef struct OpenAPI_privacy_parameter_s { + OpenAPI_list_t *ser_ids; + char *geographical_area; + int timer; +} OpenAPI_privacy_parameter_t; + +OpenAPI_privacy_parameter_t *OpenAPI_privacy_parameter_create( + OpenAPI_list_t *ser_ids, + char *geographical_area, + int timer + ); +void OpenAPI_privacy_parameter_free(OpenAPI_privacy_parameter_t *privacy_parameter); +OpenAPI_privacy_parameter_t *OpenAPI_privacy_parameter_parseFromJSON(cJSON *privacy_parameterJSON); +cJSON *OpenAPI_privacy_parameter_convertToJSON(OpenAPI_privacy_parameter_t *privacy_parameter); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_privacy_parameter_H_ */ + diff --git a/lib/sbi/openapi/model/problem_details_2.c b/lib/sbi/openapi/model/problem_details_2.c new file mode 100644 index 0000000000..664099134d --- /dev/null +++ b/lib/sbi/openapi/model/problem_details_2.c @@ -0,0 +1,240 @@ + +#include +#include +#include +#include "problem_details_2.h" + +OpenAPI_problem_details_2_t *OpenAPI_problem_details_2_create( + char *type, + char *title, + int status, + char *detail, + char *instance, + char *cause, + OpenAPI_list_t *invalid_params, + char *supported_features + ) +{ + OpenAPI_problem_details_2_t *problem_details_2_local_var = OpenAPI_malloc(sizeof(OpenAPI_problem_details_2_t)); + if (!problem_details_2_local_var) { + return NULL; + } + problem_details_2_local_var->type = type; + problem_details_2_local_var->title = title; + problem_details_2_local_var->status = status; + problem_details_2_local_var->detail = detail; + problem_details_2_local_var->instance = instance; + problem_details_2_local_var->cause = cause; + problem_details_2_local_var->invalid_params = invalid_params; + problem_details_2_local_var->supported_features = supported_features; + + return problem_details_2_local_var; +} + +void OpenAPI_problem_details_2_free(OpenAPI_problem_details_2_t *problem_details_2) +{ + if (NULL == problem_details_2) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(problem_details_2->type); + ogs_free(problem_details_2->title); + ogs_free(problem_details_2->detail); + ogs_free(problem_details_2->instance); + ogs_free(problem_details_2->cause); + OpenAPI_list_for_each(problem_details_2->invalid_params, node) { + OpenAPI_invalid_param_free(node->data); + } + OpenAPI_list_free(problem_details_2->invalid_params); + ogs_free(problem_details_2->supported_features); + ogs_free(problem_details_2); +} + +cJSON *OpenAPI_problem_details_2_convertToJSON(OpenAPI_problem_details_2_t *problem_details_2) +{ + cJSON *item = NULL; + + if (problem_details_2 == NULL) { + ogs_error("OpenAPI_problem_details_2_convertToJSON() failed [ProblemDetails_2]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (problem_details_2->type) { + if (cJSON_AddStringToObject(item, "type", problem_details_2->type) == NULL) { + ogs_error("OpenAPI_problem_details_2_convertToJSON() failed [type]"); + goto end; + } + } + + if (problem_details_2->title) { + if (cJSON_AddStringToObject(item, "title", problem_details_2->title) == NULL) { + ogs_error("OpenAPI_problem_details_2_convertToJSON() failed [title]"); + goto end; + } + } + + if (problem_details_2->status) { + if (cJSON_AddNumberToObject(item, "status", problem_details_2->status) == NULL) { + ogs_error("OpenAPI_problem_details_2_convertToJSON() failed [status]"); + goto end; + } + } + + if (problem_details_2->detail) { + if (cJSON_AddStringToObject(item, "detail", problem_details_2->detail) == NULL) { + ogs_error("OpenAPI_problem_details_2_convertToJSON() failed [detail]"); + goto end; + } + } + + if (problem_details_2->instance) { + if (cJSON_AddStringToObject(item, "instance", problem_details_2->instance) == NULL) { + ogs_error("OpenAPI_problem_details_2_convertToJSON() failed [instance]"); + goto end; + } + } + + if (problem_details_2->cause) { + if (cJSON_AddStringToObject(item, "cause", problem_details_2->cause) == NULL) { + ogs_error("OpenAPI_problem_details_2_convertToJSON() failed [cause]"); + goto end; + } + } + + if (problem_details_2->invalid_params) { + cJSON *invalid_paramsList = cJSON_AddArrayToObject(item, "invalidParams"); + if (invalid_paramsList == NULL) { + ogs_error("OpenAPI_problem_details_2_convertToJSON() failed [invalid_params]"); + goto end; + } + + OpenAPI_lnode_t *invalid_params_node; + if (problem_details_2->invalid_params) { + OpenAPI_list_for_each(problem_details_2->invalid_params, invalid_params_node) { + cJSON *itemLocal = OpenAPI_invalid_param_convertToJSON(invalid_params_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_problem_details_2_convertToJSON() failed [invalid_params]"); + goto end; + } + cJSON_AddItemToArray(invalid_paramsList, itemLocal); + } + } + } + + if (problem_details_2->supported_features) { + if (cJSON_AddStringToObject(item, "supportedFeatures", problem_details_2->supported_features) == NULL) { + ogs_error("OpenAPI_problem_details_2_convertToJSON() failed [supported_features]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_problem_details_2_t *OpenAPI_problem_details_2_parseFromJSON(cJSON *problem_details_2JSON) +{ + OpenAPI_problem_details_2_t *problem_details_2_local_var = NULL; + cJSON *type = cJSON_GetObjectItemCaseSensitive(problem_details_2JSON, "type"); + + if (type) { + if (!cJSON_IsString(type)) { + ogs_error("OpenAPI_problem_details_2_parseFromJSON() failed [type]"); + goto end; + } + } + + cJSON *title = cJSON_GetObjectItemCaseSensitive(problem_details_2JSON, "title"); + + if (title) { + if (!cJSON_IsString(title)) { + ogs_error("OpenAPI_problem_details_2_parseFromJSON() failed [title]"); + goto end; + } + } + + cJSON *status = cJSON_GetObjectItemCaseSensitive(problem_details_2JSON, "status"); + + if (status) { + if (!cJSON_IsNumber(status)) { + ogs_error("OpenAPI_problem_details_2_parseFromJSON() failed [status]"); + goto end; + } + } + + cJSON *detail = cJSON_GetObjectItemCaseSensitive(problem_details_2JSON, "detail"); + + if (detail) { + if (!cJSON_IsString(detail)) { + ogs_error("OpenAPI_problem_details_2_parseFromJSON() failed [detail]"); + goto end; + } + } + + cJSON *instance = cJSON_GetObjectItemCaseSensitive(problem_details_2JSON, "instance"); + + if (instance) { + if (!cJSON_IsString(instance)) { + ogs_error("OpenAPI_problem_details_2_parseFromJSON() failed [instance]"); + goto end; + } + } + + cJSON *cause = cJSON_GetObjectItemCaseSensitive(problem_details_2JSON, "cause"); + + if (cause) { + if (!cJSON_IsString(cause)) { + ogs_error("OpenAPI_problem_details_2_parseFromJSON() failed [cause]"); + goto end; + } + } + + cJSON *invalid_params = cJSON_GetObjectItemCaseSensitive(problem_details_2JSON, "invalidParams"); + + OpenAPI_list_t *invalid_paramsList; + if (invalid_params) { + cJSON *invalid_params_local_nonprimitive; + if (!cJSON_IsArray(invalid_params)) { + ogs_error("OpenAPI_problem_details_2_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_problem_details_2_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(problem_details_2JSON, "supportedFeatures"); + + if (supported_features) { + if (!cJSON_IsString(supported_features)) { + ogs_error("OpenAPI_problem_details_2_parseFromJSON() failed [supported_features]"); + goto end; + } + } + + problem_details_2_local_var = OpenAPI_problem_details_2_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 + ); + + return problem_details_2_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/problem_details_2.h b/lib/sbi/openapi/model/problem_details_2.h new file mode 100644 index 0000000000..02bc212cd1 --- /dev/null +++ b/lib/sbi/openapi/model/problem_details_2.h @@ -0,0 +1,52 @@ +/* + * problem_details_2.h + * + * + */ + +#ifndef _OpenAPI_problem_details_2_H_ +#define _OpenAPI_problem_details_2_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "invalid_param.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_problem_details_2_s OpenAPI_problem_details_2_t; +typedef struct OpenAPI_problem_details_2_s { + char *type; + char *title; + int status; + char *detail; + char *instance; + char *cause; + OpenAPI_list_t *invalid_params; + char *supported_features; +} OpenAPI_problem_details_2_t; + +OpenAPI_problem_details_2_t *OpenAPI_problem_details_2_create( + char *type, + char *title, + int status, + char *detail, + char *instance, + char *cause, + OpenAPI_list_t *invalid_params, + char *supported_features + ); +void OpenAPI_problem_details_2_free(OpenAPI_problem_details_2_t *problem_details_2); +OpenAPI_problem_details_2_t *OpenAPI_problem_details_2_parseFromJSON(cJSON *problem_details_2JSON); +cJSON *OpenAPI_problem_details_2_convertToJSON(OpenAPI_problem_details_2_t *problem_details_2); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_problem_details_2_H_ */ + diff --git a/lib/sbi/openapi/model/provisioned_data_sets.c b/lib/sbi/openapi/model/provisioned_data_sets.c new file mode 100644 index 0000000000..44f7974ad4 --- /dev/null +++ b/lib/sbi/openapi/model/provisioned_data_sets.c @@ -0,0 +1,269 @@ + +#include +#include +#include +#include "provisioned_data_sets.h" + +OpenAPI_provisioned_data_sets_t *OpenAPI_provisioned_data_sets_create( + OpenAPI_access_and_mobility_subscription_data_t *am_data, + OpenAPI_smf_selection_subscription_data_t *smf_sel_data, + OpenAPI_sms_subscription_data_t *sms_subs_data, + OpenAPI_list_t *sm_data, + OpenAPI_trace_data_t *trace_data, + OpenAPI_sms_management_subscription_data_t *sms_mng_data, + OpenAPI_lcs_privacy_data_t *lcs_privacy_data, + OpenAPI_lcs_mo_data_t *lcs_mo_data + ) +{ + OpenAPI_provisioned_data_sets_t *provisioned_data_sets_local_var = OpenAPI_malloc(sizeof(OpenAPI_provisioned_data_sets_t)); + if (!provisioned_data_sets_local_var) { + return NULL; + } + provisioned_data_sets_local_var->am_data = am_data; + provisioned_data_sets_local_var->smf_sel_data = smf_sel_data; + provisioned_data_sets_local_var->sms_subs_data = sms_subs_data; + provisioned_data_sets_local_var->sm_data = sm_data; + provisioned_data_sets_local_var->trace_data = trace_data; + provisioned_data_sets_local_var->sms_mng_data = sms_mng_data; + provisioned_data_sets_local_var->lcs_privacy_data = lcs_privacy_data; + provisioned_data_sets_local_var->lcs_mo_data = lcs_mo_data; + + return provisioned_data_sets_local_var; +} + +void OpenAPI_provisioned_data_sets_free(OpenAPI_provisioned_data_sets_t *provisioned_data_sets) +{ + if (NULL == provisioned_data_sets) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_access_and_mobility_subscription_data_free(provisioned_data_sets->am_data); + OpenAPI_smf_selection_subscription_data_free(provisioned_data_sets->smf_sel_data); + OpenAPI_sms_subscription_data_free(provisioned_data_sets->sms_subs_data); + OpenAPI_list_for_each(provisioned_data_sets->sm_data, node) { + OpenAPI_session_management_subscription_data_free(node->data); + } + OpenAPI_list_free(provisioned_data_sets->sm_data); + OpenAPI_trace_data_free(provisioned_data_sets->trace_data); + OpenAPI_sms_management_subscription_data_free(provisioned_data_sets->sms_mng_data); + OpenAPI_lcs_privacy_data_free(provisioned_data_sets->lcs_privacy_data); + OpenAPI_lcs_mo_data_free(provisioned_data_sets->lcs_mo_data); + ogs_free(provisioned_data_sets); +} + +cJSON *OpenAPI_provisioned_data_sets_convertToJSON(OpenAPI_provisioned_data_sets_t *provisioned_data_sets) +{ + cJSON *item = NULL; + + if (provisioned_data_sets == NULL) { + ogs_error("OpenAPI_provisioned_data_sets_convertToJSON() failed [ProvisionedDataSets]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (provisioned_data_sets->am_data) { + cJSON *am_data_local_JSON = OpenAPI_access_and_mobility_subscription_data_convertToJSON(provisioned_data_sets->am_data); + if (am_data_local_JSON == NULL) { + ogs_error("OpenAPI_provisioned_data_sets_convertToJSON() failed [am_data]"); + goto end; + } + cJSON_AddItemToObject(item, "amData", am_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_provisioned_data_sets_convertToJSON() failed [am_data]"); + goto end; + } + } + + if (provisioned_data_sets->smf_sel_data) { + cJSON *smf_sel_data_local_JSON = OpenAPI_smf_selection_subscription_data_convertToJSON(provisioned_data_sets->smf_sel_data); + if (smf_sel_data_local_JSON == NULL) { + ogs_error("OpenAPI_provisioned_data_sets_convertToJSON() failed [smf_sel_data]"); + goto end; + } + cJSON_AddItemToObject(item, "smfSelData", smf_sel_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_provisioned_data_sets_convertToJSON() failed [smf_sel_data]"); + goto end; + } + } + + if (provisioned_data_sets->sms_subs_data) { + cJSON *sms_subs_data_local_JSON = OpenAPI_sms_subscription_data_convertToJSON(provisioned_data_sets->sms_subs_data); + if (sms_subs_data_local_JSON == NULL) { + ogs_error("OpenAPI_provisioned_data_sets_convertToJSON() failed [sms_subs_data]"); + goto end; + } + cJSON_AddItemToObject(item, "smsSubsData", sms_subs_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_provisioned_data_sets_convertToJSON() failed [sms_subs_data]"); + goto end; + } + } + + if (provisioned_data_sets->sm_data) { + cJSON *sm_dataList = cJSON_AddArrayToObject(item, "smData"); + if (sm_dataList == NULL) { + ogs_error("OpenAPI_provisioned_data_sets_convertToJSON() failed [sm_data]"); + goto end; + } + + OpenAPI_lnode_t *sm_data_node; + if (provisioned_data_sets->sm_data) { + OpenAPI_list_for_each(provisioned_data_sets->sm_data, sm_data_node) { + cJSON *itemLocal = OpenAPI_session_management_subscription_data_convertToJSON(sm_data_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_provisioned_data_sets_convertToJSON() failed [sm_data]"); + goto end; + } + cJSON_AddItemToArray(sm_dataList, itemLocal); + } + } + } + + if (provisioned_data_sets->trace_data) { + cJSON *trace_data_local_JSON = OpenAPI_trace_data_convertToJSON(provisioned_data_sets->trace_data); + if (trace_data_local_JSON == NULL) { + ogs_error("OpenAPI_provisioned_data_sets_convertToJSON() failed [trace_data]"); + goto end; + } + cJSON_AddItemToObject(item, "traceData", trace_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_provisioned_data_sets_convertToJSON() failed [trace_data]"); + goto end; + } + } + + if (provisioned_data_sets->sms_mng_data) { + cJSON *sms_mng_data_local_JSON = OpenAPI_sms_management_subscription_data_convertToJSON(provisioned_data_sets->sms_mng_data); + if (sms_mng_data_local_JSON == NULL) { + ogs_error("OpenAPI_provisioned_data_sets_convertToJSON() failed [sms_mng_data]"); + goto end; + } + cJSON_AddItemToObject(item, "smsMngData", sms_mng_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_provisioned_data_sets_convertToJSON() failed [sms_mng_data]"); + goto end; + } + } + + if (provisioned_data_sets->lcs_privacy_data) { + cJSON *lcs_privacy_data_local_JSON = OpenAPI_lcs_privacy_data_convertToJSON(provisioned_data_sets->lcs_privacy_data); + if (lcs_privacy_data_local_JSON == NULL) { + ogs_error("OpenAPI_provisioned_data_sets_convertToJSON() failed [lcs_privacy_data]"); + goto end; + } + cJSON_AddItemToObject(item, "lcsPrivacyData", lcs_privacy_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_provisioned_data_sets_convertToJSON() failed [lcs_privacy_data]"); + goto end; + } + } + + if (provisioned_data_sets->lcs_mo_data) { + cJSON *lcs_mo_data_local_JSON = OpenAPI_lcs_mo_data_convertToJSON(provisioned_data_sets->lcs_mo_data); + if (lcs_mo_data_local_JSON == NULL) { + ogs_error("OpenAPI_provisioned_data_sets_convertToJSON() failed [lcs_mo_data]"); + goto end; + } + cJSON_AddItemToObject(item, "lcsMoData", lcs_mo_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_provisioned_data_sets_convertToJSON() failed [lcs_mo_data]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_provisioned_data_sets_t *OpenAPI_provisioned_data_sets_parseFromJSON(cJSON *provisioned_data_setsJSON) +{ + OpenAPI_provisioned_data_sets_t *provisioned_data_sets_local_var = NULL; + cJSON *am_data = cJSON_GetObjectItemCaseSensitive(provisioned_data_setsJSON, "amData"); + + OpenAPI_access_and_mobility_subscription_data_t *am_data_local_nonprim = NULL; + if (am_data) { + am_data_local_nonprim = OpenAPI_access_and_mobility_subscription_data_parseFromJSON(am_data); + } + + cJSON *smf_sel_data = cJSON_GetObjectItemCaseSensitive(provisioned_data_setsJSON, "smfSelData"); + + OpenAPI_smf_selection_subscription_data_t *smf_sel_data_local_nonprim = NULL; + if (smf_sel_data) { + smf_sel_data_local_nonprim = OpenAPI_smf_selection_subscription_data_parseFromJSON(smf_sel_data); + } + + cJSON *sms_subs_data = cJSON_GetObjectItemCaseSensitive(provisioned_data_setsJSON, "smsSubsData"); + + OpenAPI_sms_subscription_data_t *sms_subs_data_local_nonprim = NULL; + if (sms_subs_data) { + sms_subs_data_local_nonprim = OpenAPI_sms_subscription_data_parseFromJSON(sms_subs_data); + } + + cJSON *sm_data = cJSON_GetObjectItemCaseSensitive(provisioned_data_setsJSON, "smData"); + + OpenAPI_list_t *sm_dataList; + if (sm_data) { + cJSON *sm_data_local_nonprimitive; + if (!cJSON_IsArray(sm_data)) { + ogs_error("OpenAPI_provisioned_data_sets_parseFromJSON() failed [sm_data]"); + goto end; + } + + sm_dataList = OpenAPI_list_create(); + + cJSON_ArrayForEach(sm_data_local_nonprimitive, sm_data ) { + if (!cJSON_IsObject(sm_data_local_nonprimitive)) { + ogs_error("OpenAPI_provisioned_data_sets_parseFromJSON() failed [sm_data]"); + goto end; + } + OpenAPI_session_management_subscription_data_t *sm_dataItem = OpenAPI_session_management_subscription_data_parseFromJSON(sm_data_local_nonprimitive); + + OpenAPI_list_add(sm_dataList, sm_dataItem); + } + } + + cJSON *trace_data = cJSON_GetObjectItemCaseSensitive(provisioned_data_setsJSON, "traceData"); + + OpenAPI_trace_data_t *trace_data_local_nonprim = NULL; + if (trace_data) { + trace_data_local_nonprim = OpenAPI_trace_data_parseFromJSON(trace_data); + } + + cJSON *sms_mng_data = cJSON_GetObjectItemCaseSensitive(provisioned_data_setsJSON, "smsMngData"); + + OpenAPI_sms_management_subscription_data_t *sms_mng_data_local_nonprim = NULL; + if (sms_mng_data) { + sms_mng_data_local_nonprim = OpenAPI_sms_management_subscription_data_parseFromJSON(sms_mng_data); + } + + cJSON *lcs_privacy_data = cJSON_GetObjectItemCaseSensitive(provisioned_data_setsJSON, "lcsPrivacyData"); + + OpenAPI_lcs_privacy_data_t *lcs_privacy_data_local_nonprim = NULL; + if (lcs_privacy_data) { + lcs_privacy_data_local_nonprim = OpenAPI_lcs_privacy_data_parseFromJSON(lcs_privacy_data); + } + + cJSON *lcs_mo_data = cJSON_GetObjectItemCaseSensitive(provisioned_data_setsJSON, "lcsMoData"); + + OpenAPI_lcs_mo_data_t *lcs_mo_data_local_nonprim = NULL; + if (lcs_mo_data) { + lcs_mo_data_local_nonprim = OpenAPI_lcs_mo_data_parseFromJSON(lcs_mo_data); + } + + provisioned_data_sets_local_var = OpenAPI_provisioned_data_sets_create ( + am_data ? am_data_local_nonprim : NULL, + smf_sel_data ? smf_sel_data_local_nonprim : NULL, + sms_subs_data ? sms_subs_data_local_nonprim : NULL, + sm_data ? sm_dataList : NULL, + trace_data ? trace_data_local_nonprim : NULL, + sms_mng_data ? sms_mng_data_local_nonprim : NULL, + lcs_privacy_data ? lcs_privacy_data_local_nonprim : NULL, + lcs_mo_data ? lcs_mo_data_local_nonprim : NULL + ); + + return provisioned_data_sets_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/provisioned_data_sets.h b/lib/sbi/openapi/model/provisioned_data_sets.h new file mode 100644 index 0000000000..67d7fdc6fd --- /dev/null +++ b/lib/sbi/openapi/model/provisioned_data_sets.h @@ -0,0 +1,59 @@ +/* + * provisioned_data_sets.h + * + * + */ + +#ifndef _OpenAPI_provisioned_data_sets_H_ +#define _OpenAPI_provisioned_data_sets_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "access_and_mobility_subscription_data.h" +#include "lcs_mo_data.h" +#include "lcs_privacy_data.h" +#include "session_management_subscription_data.h" +#include "smf_selection_subscription_data.h" +#include "sms_management_subscription_data.h" +#include "sms_subscription_data.h" +#include "trace_data.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_provisioned_data_sets_s OpenAPI_provisioned_data_sets_t; +typedef struct OpenAPI_provisioned_data_sets_s { + struct OpenAPI_access_and_mobility_subscription_data_s *am_data; + struct OpenAPI_smf_selection_subscription_data_s *smf_sel_data; + struct OpenAPI_sms_subscription_data_s *sms_subs_data; + OpenAPI_list_t *sm_data; + struct OpenAPI_trace_data_s *trace_data; + struct OpenAPI_sms_management_subscription_data_s *sms_mng_data; + struct OpenAPI_lcs_privacy_data_s *lcs_privacy_data; + struct OpenAPI_lcs_mo_data_s *lcs_mo_data; +} OpenAPI_provisioned_data_sets_t; + +OpenAPI_provisioned_data_sets_t *OpenAPI_provisioned_data_sets_create( + OpenAPI_access_and_mobility_subscription_data_t *am_data, + OpenAPI_smf_selection_subscription_data_t *smf_sel_data, + OpenAPI_sms_subscription_data_t *sms_subs_data, + OpenAPI_list_t *sm_data, + OpenAPI_trace_data_t *trace_data, + OpenAPI_sms_management_subscription_data_t *sms_mng_data, + OpenAPI_lcs_privacy_data_t *lcs_privacy_data, + OpenAPI_lcs_mo_data_t *lcs_mo_data + ); +void OpenAPI_provisioned_data_sets_free(OpenAPI_provisioned_data_sets_t *provisioned_data_sets); +OpenAPI_provisioned_data_sets_t *OpenAPI_provisioned_data_sets_parseFromJSON(cJSON *provisioned_data_setsJSON); +cJSON *OpenAPI_provisioned_data_sets_convertToJSON(OpenAPI_provisioned_data_sets_t *provisioned_data_sets); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_provisioned_data_sets_H_ */ + diff --git a/lib/sbi/openapi/model/ptw_parameters.c b/lib/sbi/openapi/model/ptw_parameters.c new file mode 100644 index 0000000000..61bb24fa1f --- /dev/null +++ b/lib/sbi/openapi/model/ptw_parameters.c @@ -0,0 +1,102 @@ + +#include +#include +#include +#include "ptw_parameters.h" + +OpenAPI_ptw_parameters_t *OpenAPI_ptw_parameters_create( + OpenAPI_operation_mode_e operation_mode, + char *ptw_value + ) +{ + OpenAPI_ptw_parameters_t *ptw_parameters_local_var = OpenAPI_malloc(sizeof(OpenAPI_ptw_parameters_t)); + if (!ptw_parameters_local_var) { + return NULL; + } + ptw_parameters_local_var->operation_mode = operation_mode; + ptw_parameters_local_var->ptw_value = ptw_value; + + return ptw_parameters_local_var; +} + +void OpenAPI_ptw_parameters_free(OpenAPI_ptw_parameters_t *ptw_parameters) +{ + if (NULL == ptw_parameters) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(ptw_parameters->ptw_value); + ogs_free(ptw_parameters); +} + +cJSON *OpenAPI_ptw_parameters_convertToJSON(OpenAPI_ptw_parameters_t *ptw_parameters) +{ + cJSON *item = NULL; + + if (ptw_parameters == NULL) { + ogs_error("OpenAPI_ptw_parameters_convertToJSON() failed [PtwParameters]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!ptw_parameters->operation_mode) { + ogs_error("OpenAPI_ptw_parameters_convertToJSON() failed [operation_mode]"); + goto end; + } + if (cJSON_AddStringToObject(item, "operationMode", OpenAPI_operation_mode_ToString(ptw_parameters->operation_mode)) == NULL) { + ogs_error("OpenAPI_ptw_parameters_convertToJSON() failed [operation_mode]"); + goto end; + } + + if (!ptw_parameters->ptw_value) { + ogs_error("OpenAPI_ptw_parameters_convertToJSON() failed [ptw_value]"); + goto end; + } + if (cJSON_AddStringToObject(item, "ptwValue", ptw_parameters->ptw_value) == NULL) { + ogs_error("OpenAPI_ptw_parameters_convertToJSON() failed [ptw_value]"); + goto end; + } + +end: + return item; +} + +OpenAPI_ptw_parameters_t *OpenAPI_ptw_parameters_parseFromJSON(cJSON *ptw_parametersJSON) +{ + OpenAPI_ptw_parameters_t *ptw_parameters_local_var = NULL; + cJSON *operation_mode = cJSON_GetObjectItemCaseSensitive(ptw_parametersJSON, "operationMode"); + if (!operation_mode) { + ogs_error("OpenAPI_ptw_parameters_parseFromJSON() failed [operation_mode]"); + goto end; + } + + OpenAPI_operation_mode_e operation_modeVariable; + + if (!cJSON_IsString(operation_mode)) { + ogs_error("OpenAPI_ptw_parameters_parseFromJSON() failed [operation_mode]"); + goto end; + } + operation_modeVariable = OpenAPI_operation_mode_FromString(operation_mode->valuestring); + + cJSON *ptw_value = cJSON_GetObjectItemCaseSensitive(ptw_parametersJSON, "ptwValue"); + if (!ptw_value) { + ogs_error("OpenAPI_ptw_parameters_parseFromJSON() failed [ptw_value]"); + goto end; + } + + + if (!cJSON_IsString(ptw_value)) { + ogs_error("OpenAPI_ptw_parameters_parseFromJSON() failed [ptw_value]"); + goto end; + } + + ptw_parameters_local_var = OpenAPI_ptw_parameters_create ( + operation_modeVariable, + ogs_strdup(ptw_value->valuestring) + ); + + return ptw_parameters_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/ptw_parameters.h b/lib/sbi/openapi/model/ptw_parameters.h new file mode 100644 index 0000000000..150aab3214 --- /dev/null +++ b/lib/sbi/openapi/model/ptw_parameters.h @@ -0,0 +1,40 @@ +/* + * ptw_parameters.h + * + * + */ + +#ifndef _OpenAPI_ptw_parameters_H_ +#define _OpenAPI_ptw_parameters_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "operation_mode.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_ptw_parameters_s OpenAPI_ptw_parameters_t; +typedef struct OpenAPI_ptw_parameters_s { + OpenAPI_operation_mode_e operation_mode; + char *ptw_value; +} OpenAPI_ptw_parameters_t; + +OpenAPI_ptw_parameters_t *OpenAPI_ptw_parameters_create( + OpenAPI_operation_mode_e operation_mode, + char *ptw_value + ); +void OpenAPI_ptw_parameters_free(OpenAPI_ptw_parameters_t *ptw_parameters); +OpenAPI_ptw_parameters_t *OpenAPI_ptw_parameters_parseFromJSON(cJSON *ptw_parametersJSON); +cJSON *OpenAPI_ptw_parameters_convertToJSON(OpenAPI_ptw_parameters_t *ptw_parameters); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_ptw_parameters_H_ */ + diff --git a/lib/sbi/openapi/model/radio_parameter_not_served.c b/lib/sbi/openapi/model/radio_parameter_not_served.c new file mode 100644 index 0000000000..84b151a609 --- /dev/null +++ b/lib/sbi/openapi/model/radio_parameter_not_served.c @@ -0,0 +1,159 @@ + +#include +#include +#include +#include "radio_parameter_not_served.h" + +OpenAPI_radio_parameter_not_served_t *OpenAPI_radio_parameter_not_served_create( + char *radio_params, + OpenAPI_v2x_rat_type_t *rat, + char *geographical_area, + OpenAPI_operator_managed_t *oper_managed + ) +{ + OpenAPI_radio_parameter_not_served_t *radio_parameter_not_served_local_var = OpenAPI_malloc(sizeof(OpenAPI_radio_parameter_not_served_t)); + if (!radio_parameter_not_served_local_var) { + return NULL; + } + radio_parameter_not_served_local_var->radio_params = radio_params; + radio_parameter_not_served_local_var->rat = rat; + radio_parameter_not_served_local_var->geographical_area = geographical_area; + radio_parameter_not_served_local_var->oper_managed = oper_managed; + + return radio_parameter_not_served_local_var; +} + +void OpenAPI_radio_parameter_not_served_free(OpenAPI_radio_parameter_not_served_t *radio_parameter_not_served) +{ + if (NULL == radio_parameter_not_served) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(radio_parameter_not_served->radio_params); + OpenAPI_v2x_rat_type_free(radio_parameter_not_served->rat); + ogs_free(radio_parameter_not_served->geographical_area); + OpenAPI_operator_managed_free(radio_parameter_not_served->oper_managed); + ogs_free(radio_parameter_not_served); +} + +cJSON *OpenAPI_radio_parameter_not_served_convertToJSON(OpenAPI_radio_parameter_not_served_t *radio_parameter_not_served) +{ + cJSON *item = NULL; + + if (radio_parameter_not_served == NULL) { + ogs_error("OpenAPI_radio_parameter_not_served_convertToJSON() failed [RadioParameterNotServed]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!radio_parameter_not_served->radio_params) { + ogs_error("OpenAPI_radio_parameter_not_served_convertToJSON() failed [radio_params]"); + goto end; + } + if (cJSON_AddStringToObject(item, "radioParams", radio_parameter_not_served->radio_params) == NULL) { + ogs_error("OpenAPI_radio_parameter_not_served_convertToJSON() failed [radio_params]"); + goto end; + } + + if (!radio_parameter_not_served->rat) { + ogs_error("OpenAPI_radio_parameter_not_served_convertToJSON() failed [rat]"); + goto end; + } + cJSON *rat_local_JSON = OpenAPI_v2x_rat_type_convertToJSON(radio_parameter_not_served->rat); + if (rat_local_JSON == NULL) { + ogs_error("OpenAPI_radio_parameter_not_served_convertToJSON() failed [rat]"); + goto end; + } + cJSON_AddItemToObject(item, "rat", rat_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_radio_parameter_not_served_convertToJSON() failed [rat]"); + goto end; + } + + if (!radio_parameter_not_served->geographical_area) { + ogs_error("OpenAPI_radio_parameter_not_served_convertToJSON() failed [geographical_area]"); + goto end; + } + if (cJSON_AddStringToObject(item, "geographicalArea", radio_parameter_not_served->geographical_area) == NULL) { + ogs_error("OpenAPI_radio_parameter_not_served_convertToJSON() failed [geographical_area]"); + goto end; + } + + if (!radio_parameter_not_served->oper_managed) { + ogs_error("OpenAPI_radio_parameter_not_served_convertToJSON() failed [oper_managed]"); + goto end; + } + cJSON *oper_managed_local_JSON = OpenAPI_operator_managed_convertToJSON(radio_parameter_not_served->oper_managed); + if (oper_managed_local_JSON == NULL) { + ogs_error("OpenAPI_radio_parameter_not_served_convertToJSON() failed [oper_managed]"); + goto end; + } + cJSON_AddItemToObject(item, "operManaged", oper_managed_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_radio_parameter_not_served_convertToJSON() failed [oper_managed]"); + goto end; + } + +end: + return item; +} + +OpenAPI_radio_parameter_not_served_t *OpenAPI_radio_parameter_not_served_parseFromJSON(cJSON *radio_parameter_not_servedJSON) +{ + OpenAPI_radio_parameter_not_served_t *radio_parameter_not_served_local_var = NULL; + cJSON *radio_params = cJSON_GetObjectItemCaseSensitive(radio_parameter_not_servedJSON, "radioParams"); + if (!radio_params) { + ogs_error("OpenAPI_radio_parameter_not_served_parseFromJSON() failed [radio_params]"); + goto end; + } + + + if (!cJSON_IsString(radio_params)) { + ogs_error("OpenAPI_radio_parameter_not_served_parseFromJSON() failed [radio_params]"); + goto end; + } + + cJSON *rat = cJSON_GetObjectItemCaseSensitive(radio_parameter_not_servedJSON, "rat"); + if (!rat) { + ogs_error("OpenAPI_radio_parameter_not_served_parseFromJSON() failed [rat]"); + goto end; + } + + OpenAPI_v2x_rat_type_t *rat_local_nonprim = NULL; + + rat_local_nonprim = OpenAPI_v2x_rat_type_parseFromJSON(rat); + + cJSON *geographical_area = cJSON_GetObjectItemCaseSensitive(radio_parameter_not_servedJSON, "geographicalArea"); + if (!geographical_area) { + ogs_error("OpenAPI_radio_parameter_not_served_parseFromJSON() failed [geographical_area]"); + goto end; + } + + + if (!cJSON_IsString(geographical_area)) { + ogs_error("OpenAPI_radio_parameter_not_served_parseFromJSON() failed [geographical_area]"); + goto end; + } + + cJSON *oper_managed = cJSON_GetObjectItemCaseSensitive(radio_parameter_not_servedJSON, "operManaged"); + if (!oper_managed) { + ogs_error("OpenAPI_radio_parameter_not_served_parseFromJSON() failed [oper_managed]"); + goto end; + } + + OpenAPI_operator_managed_t *oper_managed_local_nonprim = NULL; + + oper_managed_local_nonprim = OpenAPI_operator_managed_parseFromJSON(oper_managed); + + radio_parameter_not_served_local_var = OpenAPI_radio_parameter_not_served_create ( + ogs_strdup(radio_params->valuestring), + rat_local_nonprim, + ogs_strdup(geographical_area->valuestring), + oper_managed_local_nonprim + ); + + return radio_parameter_not_served_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/radio_parameter_not_served.h b/lib/sbi/openapi/model/radio_parameter_not_served.h new file mode 100644 index 0000000000..a0a72a2d24 --- /dev/null +++ b/lib/sbi/openapi/model/radio_parameter_not_served.h @@ -0,0 +1,45 @@ +/* + * radio_parameter_not_served.h + * + * + */ + +#ifndef _OpenAPI_radio_parameter_not_served_H_ +#define _OpenAPI_radio_parameter_not_served_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "operator_managed.h" +#include "v2x_rat_type.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_radio_parameter_not_served_s OpenAPI_radio_parameter_not_served_t; +typedef struct OpenAPI_radio_parameter_not_served_s { + char *radio_params; + struct OpenAPI_v2x_rat_type_s *rat; + char *geographical_area; + struct OpenAPI_operator_managed_s *oper_managed; +} OpenAPI_radio_parameter_not_served_t; + +OpenAPI_radio_parameter_not_served_t *OpenAPI_radio_parameter_not_served_create( + char *radio_params, + OpenAPI_v2x_rat_type_t *rat, + char *geographical_area, + OpenAPI_operator_managed_t *oper_managed + ); +void OpenAPI_radio_parameter_not_served_free(OpenAPI_radio_parameter_not_served_t *radio_parameter_not_served); +OpenAPI_radio_parameter_not_served_t *OpenAPI_radio_parameter_not_served_parseFromJSON(cJSON *radio_parameter_not_servedJSON); +cJSON *OpenAPI_radio_parameter_not_served_convertToJSON(OpenAPI_radio_parameter_not_served_t *radio_parameter_not_served); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_radio_parameter_not_served_H_ */ + diff --git a/lib/sbi/openapi/model/rat_type.c b/lib/sbi/openapi/model/rat_type.c new file mode 100644 index 0000000000..c48e9f461b --- /dev/null +++ b/lib/sbi/openapi/model/rat_type.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "rat_type.h" + +OpenAPI_rat_type_t *OpenAPI_rat_type_create( + ) +{ + OpenAPI_rat_type_t *rat_type_local_var = OpenAPI_malloc(sizeof(OpenAPI_rat_type_t)); + if (!rat_type_local_var) { + return NULL; + } + + return rat_type_local_var; +} + +void OpenAPI_rat_type_free(OpenAPI_rat_type_t *rat_type) +{ + if (NULL == rat_type) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(rat_type); +} + +cJSON *OpenAPI_rat_type_convertToJSON(OpenAPI_rat_type_t *rat_type) +{ + cJSON *item = NULL; + + if (rat_type == NULL) { + ogs_error("OpenAPI_rat_type_convertToJSON() failed [RatType]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_rat_type_t *OpenAPI_rat_type_parseFromJSON(cJSON *rat_typeJSON) +{ + OpenAPI_rat_type_t *rat_type_local_var = NULL; + rat_type_local_var = OpenAPI_rat_type_create ( + ); + + return rat_type_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/rat_type.h b/lib/sbi/openapi/model/rat_type.h new file mode 100644 index 0000000000..b5332bee4c --- /dev/null +++ b/lib/sbi/openapi/model/rat_type.h @@ -0,0 +1,35 @@ +/* + * rat_type.h + * + * + */ + +#ifndef _OpenAPI_rat_type_H_ +#define _OpenAPI_rat_type_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_rat_type_s OpenAPI_rat_type_t; +typedef struct OpenAPI_rat_type_s { +} OpenAPI_rat_type_t; + +OpenAPI_rat_type_t *OpenAPI_rat_type_create( + ); +void OpenAPI_rat_type_free(OpenAPI_rat_type_t *rat_type); +OpenAPI_rat_type_t *OpenAPI_rat_type_parseFromJSON(cJSON *rat_typeJSON); +cJSON *OpenAPI_rat_type_convertToJSON(OpenAPI_rat_type_t *rat_type); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_rat_type_H_ */ + diff --git a/lib/sbi/openapi/model/registration_reason.c b/lib/sbi/openapi/model/registration_reason.c new file mode 100644 index 0000000000..6deb4819eb --- /dev/null +++ b/lib/sbi/openapi/model/registration_reason.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "registration_reason.h" + +OpenAPI_registration_reason_t *OpenAPI_registration_reason_create( + ) +{ + OpenAPI_registration_reason_t *registration_reason_local_var = OpenAPI_malloc(sizeof(OpenAPI_registration_reason_t)); + if (!registration_reason_local_var) { + return NULL; + } + + return registration_reason_local_var; +} + +void OpenAPI_registration_reason_free(OpenAPI_registration_reason_t *registration_reason) +{ + if (NULL == registration_reason) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(registration_reason); +} + +cJSON *OpenAPI_registration_reason_convertToJSON(OpenAPI_registration_reason_t *registration_reason) +{ + cJSON *item = NULL; + + if (registration_reason == NULL) { + ogs_error("OpenAPI_registration_reason_convertToJSON() failed [RegistrationReason]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_registration_reason_t *OpenAPI_registration_reason_parseFromJSON(cJSON *registration_reasonJSON) +{ + OpenAPI_registration_reason_t *registration_reason_local_var = NULL; + registration_reason_local_var = OpenAPI_registration_reason_create ( + ); + + return registration_reason_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/registration_reason.h b/lib/sbi/openapi/model/registration_reason.h new file mode 100644 index 0000000000..cad023f798 --- /dev/null +++ b/lib/sbi/openapi/model/registration_reason.h @@ -0,0 +1,35 @@ +/* + * registration_reason.h + * + * + */ + +#ifndef _OpenAPI_registration_reason_H_ +#define _OpenAPI_registration_reason_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_registration_reason_s OpenAPI_registration_reason_t; +typedef struct OpenAPI_registration_reason_s { +} OpenAPI_registration_reason_t; + +OpenAPI_registration_reason_t *OpenAPI_registration_reason_create( + ); +void OpenAPI_registration_reason_free(OpenAPI_registration_reason_t *registration_reason); +OpenAPI_registration_reason_t *OpenAPI_registration_reason_parseFromJSON(cJSON *registration_reasonJSON); +cJSON *OpenAPI_registration_reason_convertToJSON(OpenAPI_registration_reason_t *registration_reason); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_registration_reason_H_ */ + diff --git a/lib/sbi/openapi/model/report_item.c b/lib/sbi/openapi/model/report_item.c new file mode 100644 index 0000000000..caf2542a21 --- /dev/null +++ b/lib/sbi/openapi/model/report_item.c @@ -0,0 +1,76 @@ + +#include +#include +#include +#include "report_item.h" + +OpenAPI_report_item_t *OpenAPI_report_item_create( + char *path + ) +{ + OpenAPI_report_item_t *report_item_local_var = OpenAPI_malloc(sizeof(OpenAPI_report_item_t)); + if (!report_item_local_var) { + return NULL; + } + report_item_local_var->path = path; + + return report_item_local_var; +} + +void OpenAPI_report_item_free(OpenAPI_report_item_t *report_item) +{ + if (NULL == report_item) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(report_item->path); + ogs_free(report_item); +} + +cJSON *OpenAPI_report_item_convertToJSON(OpenAPI_report_item_t *report_item) +{ + cJSON *item = NULL; + + if (report_item == NULL) { + ogs_error("OpenAPI_report_item_convertToJSON() failed [ReportItem]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!report_item->path) { + ogs_error("OpenAPI_report_item_convertToJSON() failed [path]"); + goto end; + } + if (cJSON_AddStringToObject(item, "path", report_item->path) == NULL) { + ogs_error("OpenAPI_report_item_convertToJSON() failed [path]"); + goto end; + } + +end: + return item; +} + +OpenAPI_report_item_t *OpenAPI_report_item_parseFromJSON(cJSON *report_itemJSON) +{ + OpenAPI_report_item_t *report_item_local_var = NULL; + cJSON *path = cJSON_GetObjectItemCaseSensitive(report_itemJSON, "path"); + if (!path) { + ogs_error("OpenAPI_report_item_parseFromJSON() failed [path]"); + goto end; + } + + + if (!cJSON_IsString(path)) { + ogs_error("OpenAPI_report_item_parseFromJSON() failed [path]"); + goto end; + } + + report_item_local_var = OpenAPI_report_item_create ( + ogs_strdup(path->valuestring) + ); + + return report_item_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/report_item.h b/lib/sbi/openapi/model/report_item.h new file mode 100644 index 0000000000..e727ca1a6b --- /dev/null +++ b/lib/sbi/openapi/model/report_item.h @@ -0,0 +1,37 @@ +/* + * report_item.h + * + * + */ + +#ifndef _OpenAPI_report_item_H_ +#define _OpenAPI_report_item_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_report_item_s OpenAPI_report_item_t; +typedef struct OpenAPI_report_item_s { + char *path; +} OpenAPI_report_item_t; + +OpenAPI_report_item_t *OpenAPI_report_item_create( + char *path + ); +void OpenAPI_report_item_free(OpenAPI_report_item_t *report_item); +OpenAPI_report_item_t *OpenAPI_report_item_parseFromJSON(cJSON *report_itemJSON); +cJSON *OpenAPI_report_item_convertToJSON(OpenAPI_report_item_t *report_item); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_report_item_H_ */ + diff --git a/lib/sbi/openapi/model/reporting_options.c b/lib/sbi/openapi/model/reporting_options.c new file mode 100644 index 0000000000..a857092989 --- /dev/null +++ b/lib/sbi/openapi/model/reporting_options.c @@ -0,0 +1,171 @@ + +#include +#include +#include +#include "reporting_options.h" + +OpenAPI_reporting_options_t *OpenAPI_reporting_options_create( + OpenAPI_event_report_mode_t *report_mode, + int max_num_of_reports, + char *expiry, + int sampling_ratio, + int guard_time, + int report_period + ) +{ + OpenAPI_reporting_options_t *reporting_options_local_var = OpenAPI_malloc(sizeof(OpenAPI_reporting_options_t)); + if (!reporting_options_local_var) { + return NULL; + } + reporting_options_local_var->report_mode = report_mode; + reporting_options_local_var->max_num_of_reports = max_num_of_reports; + reporting_options_local_var->expiry = expiry; + reporting_options_local_var->sampling_ratio = sampling_ratio; + reporting_options_local_var->guard_time = guard_time; + reporting_options_local_var->report_period = report_period; + + return reporting_options_local_var; +} + +void OpenAPI_reporting_options_free(OpenAPI_reporting_options_t *reporting_options) +{ + if (NULL == reporting_options) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_event_report_mode_free(reporting_options->report_mode); + ogs_free(reporting_options->expiry); + ogs_free(reporting_options); +} + +cJSON *OpenAPI_reporting_options_convertToJSON(OpenAPI_reporting_options_t *reporting_options) +{ + cJSON *item = NULL; + + if (reporting_options == NULL) { + ogs_error("OpenAPI_reporting_options_convertToJSON() failed [ReportingOptions]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (reporting_options->report_mode) { + cJSON *report_mode_local_JSON = OpenAPI_event_report_mode_convertToJSON(reporting_options->report_mode); + if (report_mode_local_JSON == NULL) { + ogs_error("OpenAPI_reporting_options_convertToJSON() failed [report_mode]"); + goto end; + } + cJSON_AddItemToObject(item, "reportMode", report_mode_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_reporting_options_convertToJSON() failed [report_mode]"); + goto end; + } + } + + if (reporting_options->max_num_of_reports) { + if (cJSON_AddNumberToObject(item, "maxNumOfReports", reporting_options->max_num_of_reports) == NULL) { + ogs_error("OpenAPI_reporting_options_convertToJSON() failed [max_num_of_reports]"); + goto end; + } + } + + if (reporting_options->expiry) { + if (cJSON_AddStringToObject(item, "expiry", reporting_options->expiry) == NULL) { + ogs_error("OpenAPI_reporting_options_convertToJSON() failed [expiry]"); + goto end; + } + } + + if (reporting_options->sampling_ratio) { + if (cJSON_AddNumberToObject(item, "samplingRatio", reporting_options->sampling_ratio) == NULL) { + ogs_error("OpenAPI_reporting_options_convertToJSON() failed [sampling_ratio]"); + goto end; + } + } + + if (reporting_options->guard_time) { + if (cJSON_AddNumberToObject(item, "guardTime", reporting_options->guard_time) == NULL) { + ogs_error("OpenAPI_reporting_options_convertToJSON() failed [guard_time]"); + goto end; + } + } + + if (reporting_options->report_period) { + if (cJSON_AddNumberToObject(item, "reportPeriod", reporting_options->report_period) == NULL) { + ogs_error("OpenAPI_reporting_options_convertToJSON() failed [report_period]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_reporting_options_t *OpenAPI_reporting_options_parseFromJSON(cJSON *reporting_optionsJSON) +{ + OpenAPI_reporting_options_t *reporting_options_local_var = NULL; + cJSON *report_mode = cJSON_GetObjectItemCaseSensitive(reporting_optionsJSON, "reportMode"); + + OpenAPI_event_report_mode_t *report_mode_local_nonprim = NULL; + if (report_mode) { + report_mode_local_nonprim = OpenAPI_event_report_mode_parseFromJSON(report_mode); + } + + cJSON *max_num_of_reports = cJSON_GetObjectItemCaseSensitive(reporting_optionsJSON, "maxNumOfReports"); + + if (max_num_of_reports) { + if (!cJSON_IsNumber(max_num_of_reports)) { + ogs_error("OpenAPI_reporting_options_parseFromJSON() failed [max_num_of_reports]"); + goto end; + } + } + + cJSON *expiry = cJSON_GetObjectItemCaseSensitive(reporting_optionsJSON, "expiry"); + + if (expiry) { + if (!cJSON_IsString(expiry)) { + ogs_error("OpenAPI_reporting_options_parseFromJSON() failed [expiry]"); + goto end; + } + } + + cJSON *sampling_ratio = cJSON_GetObjectItemCaseSensitive(reporting_optionsJSON, "samplingRatio"); + + if (sampling_ratio) { + if (!cJSON_IsNumber(sampling_ratio)) { + ogs_error("OpenAPI_reporting_options_parseFromJSON() failed [sampling_ratio]"); + goto end; + } + } + + cJSON *guard_time = cJSON_GetObjectItemCaseSensitive(reporting_optionsJSON, "guardTime"); + + if (guard_time) { + if (!cJSON_IsNumber(guard_time)) { + ogs_error("OpenAPI_reporting_options_parseFromJSON() failed [guard_time]"); + goto end; + } + } + + cJSON *report_period = cJSON_GetObjectItemCaseSensitive(reporting_optionsJSON, "reportPeriod"); + + if (report_period) { + if (!cJSON_IsNumber(report_period)) { + ogs_error("OpenAPI_reporting_options_parseFromJSON() failed [report_period]"); + goto end; + } + } + + reporting_options_local_var = OpenAPI_reporting_options_create ( + report_mode ? report_mode_local_nonprim : NULL, + max_num_of_reports ? max_num_of_reports->valuedouble : 0, + expiry ? ogs_strdup(expiry->valuestring) : NULL, + sampling_ratio ? sampling_ratio->valuedouble : 0, + guard_time ? guard_time->valuedouble : 0, + report_period ? report_period->valuedouble : 0 + ); + + return reporting_options_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/reporting_options.h b/lib/sbi/openapi/model/reporting_options.h new file mode 100644 index 0000000000..0c65baec0c --- /dev/null +++ b/lib/sbi/openapi/model/reporting_options.h @@ -0,0 +1,48 @@ +/* + * reporting_options.h + * + * + */ + +#ifndef _OpenAPI_reporting_options_H_ +#define _OpenAPI_reporting_options_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "event_report_mode.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_reporting_options_s OpenAPI_reporting_options_t; +typedef struct OpenAPI_reporting_options_s { + struct OpenAPI_event_report_mode_s *report_mode; + int max_num_of_reports; + char *expiry; + int sampling_ratio; + int guard_time; + int report_period; +} OpenAPI_reporting_options_t; + +OpenAPI_reporting_options_t *OpenAPI_reporting_options_create( + OpenAPI_event_report_mode_t *report_mode, + int max_num_of_reports, + char *expiry, + int sampling_ratio, + int guard_time, + int report_period + ); +void OpenAPI_reporting_options_free(OpenAPI_reporting_options_t *reporting_options); +OpenAPI_reporting_options_t *OpenAPI_reporting_options_parseFromJSON(cJSON *reporting_optionsJSON); +cJSON *OpenAPI_reporting_options_convertToJSON(OpenAPI_reporting_options_t *reporting_options); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_reporting_options_H_ */ + diff --git a/lib/sbi/openapi/model/resource_item.c b/lib/sbi/openapi/model/resource_item.c new file mode 100644 index 0000000000..d1dd476d75 --- /dev/null +++ b/lib/sbi/openapi/model/resource_item.c @@ -0,0 +1,124 @@ + +#include +#include +#include +#include "resource_item.h" + +OpenAPI_resource_item_t *OpenAPI_resource_item_create( + char *mon_resource_uri, + OpenAPI_list_t *items + ) +{ + OpenAPI_resource_item_t *resource_item_local_var = OpenAPI_malloc(sizeof(OpenAPI_resource_item_t)); + if (!resource_item_local_var) { + return NULL; + } + resource_item_local_var->mon_resource_uri = mon_resource_uri; + resource_item_local_var->items = items; + + return resource_item_local_var; +} + +void OpenAPI_resource_item_free(OpenAPI_resource_item_t *resource_item) +{ + if (NULL == resource_item) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(resource_item->mon_resource_uri); + OpenAPI_list_for_each(resource_item->items, node) { + ogs_free(node->data); + } + OpenAPI_list_free(resource_item->items); + ogs_free(resource_item); +} + +cJSON *OpenAPI_resource_item_convertToJSON(OpenAPI_resource_item_t *resource_item) +{ + cJSON *item = NULL; + + if (resource_item == NULL) { + ogs_error("OpenAPI_resource_item_convertToJSON() failed [ResourceItem]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!resource_item->mon_resource_uri) { + ogs_error("OpenAPI_resource_item_convertToJSON() failed [mon_resource_uri]"); + goto end; + } + if (cJSON_AddStringToObject(item, "monResourceUri", resource_item->mon_resource_uri) == NULL) { + ogs_error("OpenAPI_resource_item_convertToJSON() failed [mon_resource_uri]"); + goto end; + } + + if (!resource_item->items) { + ogs_error("OpenAPI_resource_item_convertToJSON() failed [items]"); + goto end; + } + cJSON *items = cJSON_AddArrayToObject(item, "items"); + if (items == NULL) { + ogs_error("OpenAPI_resource_item_convertToJSON() failed [items]"); + goto end; + } + + OpenAPI_lnode_t *items_node; + OpenAPI_list_for_each(resource_item->items, items_node) { + if (cJSON_AddStringToObject(items, "", (char*)items_node->data) == NULL) { + ogs_error("OpenAPI_resource_item_convertToJSON() failed [items]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_resource_item_t *OpenAPI_resource_item_parseFromJSON(cJSON *resource_itemJSON) +{ + OpenAPI_resource_item_t *resource_item_local_var = NULL; + cJSON *mon_resource_uri = cJSON_GetObjectItemCaseSensitive(resource_itemJSON, "monResourceUri"); + if (!mon_resource_uri) { + ogs_error("OpenAPI_resource_item_parseFromJSON() failed [mon_resource_uri]"); + goto end; + } + + + if (!cJSON_IsString(mon_resource_uri)) { + ogs_error("OpenAPI_resource_item_parseFromJSON() failed [mon_resource_uri]"); + goto end; + } + + cJSON *items = cJSON_GetObjectItemCaseSensitive(resource_itemJSON, "items"); + if (!items) { + ogs_error("OpenAPI_resource_item_parseFromJSON() failed [items]"); + goto end; + } + + OpenAPI_list_t *itemsList; + + cJSON *items_local; + if (!cJSON_IsArray(items)) { + ogs_error("OpenAPI_resource_item_parseFromJSON() failed [items]"); + goto end; + } + itemsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(items_local, items) { + if (!cJSON_IsString(items_local)) { + ogs_error("OpenAPI_resource_item_parseFromJSON() failed [items]"); + goto end; + } + OpenAPI_list_add(itemsList, ogs_strdup(items_local->valuestring)); + } + + resource_item_local_var = OpenAPI_resource_item_create ( + ogs_strdup(mon_resource_uri->valuestring), + itemsList + ); + + return resource_item_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/resource_item.h b/lib/sbi/openapi/model/resource_item.h new file mode 100644 index 0000000000..345a19de5b --- /dev/null +++ b/lib/sbi/openapi/model/resource_item.h @@ -0,0 +1,39 @@ +/* + * resource_item.h + * + * Identifies a subscription to policy data change notification when the change occurs in a fragment (subset of resource data) of a given resource. + */ + +#ifndef _OpenAPI_resource_item_H_ +#define _OpenAPI_resource_item_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_resource_item_s OpenAPI_resource_item_t; +typedef struct OpenAPI_resource_item_s { + char *mon_resource_uri; + OpenAPI_list_t *items; +} OpenAPI_resource_item_t; + +OpenAPI_resource_item_t *OpenAPI_resource_item_create( + char *mon_resource_uri, + OpenAPI_list_t *items + ); +void OpenAPI_resource_item_free(OpenAPI_resource_item_t *resource_item); +OpenAPI_resource_item_t *OpenAPI_resource_item_parseFromJSON(cJSON *resource_itemJSON); +cJSON *OpenAPI_resource_item_convertToJSON(OpenAPI_resource_item_t *resource_item); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_resource_item_H_ */ + diff --git a/lib/sbi/openapi/model/restriction_type.c b/lib/sbi/openapi/model/restriction_type.c new file mode 100644 index 0000000000..2181a0bdad --- /dev/null +++ b/lib/sbi/openapi/model/restriction_type.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "restriction_type.h" + +OpenAPI_restriction_type_t *OpenAPI_restriction_type_create( + ) +{ + OpenAPI_restriction_type_t *restriction_type_local_var = OpenAPI_malloc(sizeof(OpenAPI_restriction_type_t)); + if (!restriction_type_local_var) { + return NULL; + } + + return restriction_type_local_var; +} + +void OpenAPI_restriction_type_free(OpenAPI_restriction_type_t *restriction_type) +{ + if (NULL == restriction_type) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(restriction_type); +} + +cJSON *OpenAPI_restriction_type_convertToJSON(OpenAPI_restriction_type_t *restriction_type) +{ + cJSON *item = NULL; + + if (restriction_type == NULL) { + ogs_error("OpenAPI_restriction_type_convertToJSON() failed [RestrictionType]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_restriction_type_t *OpenAPI_restriction_type_parseFromJSON(cJSON *restriction_typeJSON) +{ + OpenAPI_restriction_type_t *restriction_type_local_var = NULL; + restriction_type_local_var = OpenAPI_restriction_type_create ( + ); + + return restriction_type_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/restriction_type.h b/lib/sbi/openapi/model/restriction_type.h new file mode 100644 index 0000000000..a93d4d0ced --- /dev/null +++ b/lib/sbi/openapi/model/restriction_type.h @@ -0,0 +1,35 @@ +/* + * restriction_type.h + * + * + */ + +#ifndef _OpenAPI_restriction_type_H_ +#define _OpenAPI_restriction_type_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_restriction_type_s OpenAPI_restriction_type_t; +typedef struct OpenAPI_restriction_type_s { +} OpenAPI_restriction_type_t; + +OpenAPI_restriction_type_t *OpenAPI_restriction_type_create( + ); +void OpenAPI_restriction_type_free(OpenAPI_restriction_type_t *restriction_type); +OpenAPI_restriction_type_t *OpenAPI_restriction_type_parseFromJSON(cJSON *restriction_typeJSON); +cJSON *OpenAPI_restriction_type_convertToJSON(OpenAPI_restriction_type_t *restriction_type); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_restriction_type_H_ */ + diff --git a/lib/sbi/openapi/model/resynchronization_info.c b/lib/sbi/openapi/model/resynchronization_info.c new file mode 100644 index 0000000000..b1518d2076 --- /dev/null +++ b/lib/sbi/openapi/model/resynchronization_info.c @@ -0,0 +1,101 @@ + +#include +#include +#include +#include "resynchronization_info.h" + +OpenAPI_resynchronization_info_t *OpenAPI_resynchronization_info_create( + char *rand, + char *auts + ) +{ + OpenAPI_resynchronization_info_t *resynchronization_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_resynchronization_info_t)); + if (!resynchronization_info_local_var) { + return NULL; + } + resynchronization_info_local_var->rand = rand; + resynchronization_info_local_var->auts = auts; + + return resynchronization_info_local_var; +} + +void OpenAPI_resynchronization_info_free(OpenAPI_resynchronization_info_t *resynchronization_info) +{ + if (NULL == resynchronization_info) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(resynchronization_info->rand); + ogs_free(resynchronization_info->auts); + ogs_free(resynchronization_info); +} + +cJSON *OpenAPI_resynchronization_info_convertToJSON(OpenAPI_resynchronization_info_t *resynchronization_info) +{ + cJSON *item = NULL; + + if (resynchronization_info == NULL) { + ogs_error("OpenAPI_resynchronization_info_convertToJSON() failed [ResynchronizationInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!resynchronization_info->rand) { + ogs_error("OpenAPI_resynchronization_info_convertToJSON() failed [rand]"); + goto end; + } + if (cJSON_AddStringToObject(item, "rand", resynchronization_info->rand) == NULL) { + ogs_error("OpenAPI_resynchronization_info_convertToJSON() failed [rand]"); + goto end; + } + + if (!resynchronization_info->auts) { + ogs_error("OpenAPI_resynchronization_info_convertToJSON() failed [auts]"); + goto end; + } + if (cJSON_AddStringToObject(item, "auts", resynchronization_info->auts) == NULL) { + ogs_error("OpenAPI_resynchronization_info_convertToJSON() failed [auts]"); + goto end; + } + +end: + return item; +} + +OpenAPI_resynchronization_info_t *OpenAPI_resynchronization_info_parseFromJSON(cJSON *resynchronization_infoJSON) +{ + OpenAPI_resynchronization_info_t *resynchronization_info_local_var = NULL; + cJSON *rand = cJSON_GetObjectItemCaseSensitive(resynchronization_infoJSON, "rand"); + if (!rand) { + ogs_error("OpenAPI_resynchronization_info_parseFromJSON() failed [rand]"); + goto end; + } + + + if (!cJSON_IsString(rand)) { + ogs_error("OpenAPI_resynchronization_info_parseFromJSON() failed [rand]"); + goto end; + } + + cJSON *auts = cJSON_GetObjectItemCaseSensitive(resynchronization_infoJSON, "auts"); + if (!auts) { + ogs_error("OpenAPI_resynchronization_info_parseFromJSON() failed [auts]"); + goto end; + } + + + if (!cJSON_IsString(auts)) { + ogs_error("OpenAPI_resynchronization_info_parseFromJSON() failed [auts]"); + goto end; + } + + resynchronization_info_local_var = OpenAPI_resynchronization_info_create ( + ogs_strdup(rand->valuestring), + ogs_strdup(auts->valuestring) + ); + + return resynchronization_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/resynchronization_info.h b/lib/sbi/openapi/model/resynchronization_info.h new file mode 100644 index 0000000000..89b5bd89d5 --- /dev/null +++ b/lib/sbi/openapi/model/resynchronization_info.h @@ -0,0 +1,39 @@ +/* + * resynchronization_info.h + * + * + */ + +#ifndef _OpenAPI_resynchronization_info_H_ +#define _OpenAPI_resynchronization_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_resynchronization_info_s OpenAPI_resynchronization_info_t; +typedef struct OpenAPI_resynchronization_info_s { + char *rand; + char *auts; +} OpenAPI_resynchronization_info_t; + +OpenAPI_resynchronization_info_t *OpenAPI_resynchronization_info_create( + char *rand, + char *auts + ); +void OpenAPI_resynchronization_info_free(OpenAPI_resynchronization_info_t *resynchronization_info); +OpenAPI_resynchronization_info_t *OpenAPI_resynchronization_info_parseFromJSON(cJSON *resynchronization_infoJSON); +cJSON *OpenAPI_resynchronization_info_convertToJSON(OpenAPI_resynchronization_info_t *resynchronization_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_resynchronization_info_H_ */ + diff --git a/lib/sbi/openapi/model/rg_auth_ctx.c b/lib/sbi/openapi/model/rg_auth_ctx.c new file mode 100644 index 0000000000..98a921be93 --- /dev/null +++ b/lib/sbi/openapi/model/rg_auth_ctx.c @@ -0,0 +1,116 @@ + +#include +#include +#include +#include "rg_auth_ctx.h" + +OpenAPI_rg_auth_ctx_t *OpenAPI_rg_auth_ctx_create( + OpenAPI_auth_result_e auth_result, + char *supi, + int auth_ind + ) +{ + OpenAPI_rg_auth_ctx_t *rg_auth_ctx_local_var = OpenAPI_malloc(sizeof(OpenAPI_rg_auth_ctx_t)); + if (!rg_auth_ctx_local_var) { + return NULL; + } + rg_auth_ctx_local_var->auth_result = auth_result; + rg_auth_ctx_local_var->supi = supi; + rg_auth_ctx_local_var->auth_ind = auth_ind; + + return rg_auth_ctx_local_var; +} + +void OpenAPI_rg_auth_ctx_free(OpenAPI_rg_auth_ctx_t *rg_auth_ctx) +{ + if (NULL == rg_auth_ctx) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(rg_auth_ctx->supi); + ogs_free(rg_auth_ctx); +} + +cJSON *OpenAPI_rg_auth_ctx_convertToJSON(OpenAPI_rg_auth_ctx_t *rg_auth_ctx) +{ + cJSON *item = NULL; + + if (rg_auth_ctx == NULL) { + ogs_error("OpenAPI_rg_auth_ctx_convertToJSON() failed [RgAuthCtx]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!rg_auth_ctx->auth_result) { + ogs_error("OpenAPI_rg_auth_ctx_convertToJSON() failed [auth_result]"); + goto end; + } + if (cJSON_AddStringToObject(item, "authResult", OpenAPI_auth_result_ToString(rg_auth_ctx->auth_result)) == NULL) { + ogs_error("OpenAPI_rg_auth_ctx_convertToJSON() failed [auth_result]"); + goto end; + } + + if (rg_auth_ctx->supi) { + if (cJSON_AddStringToObject(item, "supi", rg_auth_ctx->supi) == NULL) { + ogs_error("OpenAPI_rg_auth_ctx_convertToJSON() failed [supi]"); + goto end; + } + } + + if (rg_auth_ctx->auth_ind >= 0) { + if (cJSON_AddBoolToObject(item, "authInd", rg_auth_ctx->auth_ind) == NULL) { + ogs_error("OpenAPI_rg_auth_ctx_convertToJSON() failed [auth_ind]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_rg_auth_ctx_t *OpenAPI_rg_auth_ctx_parseFromJSON(cJSON *rg_auth_ctxJSON) +{ + OpenAPI_rg_auth_ctx_t *rg_auth_ctx_local_var = NULL; + cJSON *auth_result = cJSON_GetObjectItemCaseSensitive(rg_auth_ctxJSON, "authResult"); + if (!auth_result) { + ogs_error("OpenAPI_rg_auth_ctx_parseFromJSON() failed [auth_result]"); + goto end; + } + + OpenAPI_auth_result_e auth_resultVariable; + + if (!cJSON_IsString(auth_result)) { + ogs_error("OpenAPI_rg_auth_ctx_parseFromJSON() failed [auth_result]"); + goto end; + } + auth_resultVariable = OpenAPI_auth_result_FromString(auth_result->valuestring); + + cJSON *supi = cJSON_GetObjectItemCaseSensitive(rg_auth_ctxJSON, "supi"); + + if (supi) { + if (!cJSON_IsString(supi)) { + ogs_error("OpenAPI_rg_auth_ctx_parseFromJSON() failed [supi]"); + goto end; + } + } + + cJSON *auth_ind = cJSON_GetObjectItemCaseSensitive(rg_auth_ctxJSON, "authInd"); + + if (auth_ind) { + if (!cJSON_IsBool(auth_ind)) { + ogs_error("OpenAPI_rg_auth_ctx_parseFromJSON() failed [auth_ind]"); + goto end; + } + } + + rg_auth_ctx_local_var = OpenAPI_rg_auth_ctx_create ( + auth_resultVariable, + supi ? ogs_strdup(supi->valuestring) : NULL, + auth_ind ? auth_ind->valueint : 0 + ); + + return rg_auth_ctx_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/rg_auth_ctx.h b/lib/sbi/openapi/model/rg_auth_ctx.h new file mode 100644 index 0000000000..04f1549cc3 --- /dev/null +++ b/lib/sbi/openapi/model/rg_auth_ctx.h @@ -0,0 +1,42 @@ +/* + * rg_auth_ctx.h + * + * + */ + +#ifndef _OpenAPI_rg_auth_ctx_H_ +#define _OpenAPI_rg_auth_ctx_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "auth_result.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_rg_auth_ctx_s OpenAPI_rg_auth_ctx_t; +typedef struct OpenAPI_rg_auth_ctx_s { + OpenAPI_auth_result_e auth_result; + char *supi; + int auth_ind; +} OpenAPI_rg_auth_ctx_t; + +OpenAPI_rg_auth_ctx_t *OpenAPI_rg_auth_ctx_create( + OpenAPI_auth_result_e auth_result, + char *supi, + int auth_ind + ); +void OpenAPI_rg_auth_ctx_free(OpenAPI_rg_auth_ctx_t *rg_auth_ctx); +OpenAPI_rg_auth_ctx_t *OpenAPI_rg_auth_ctx_parseFromJSON(cJSON *rg_auth_ctxJSON); +cJSON *OpenAPI_rg_auth_ctx_convertToJSON(OpenAPI_rg_auth_ctx_t *rg_auth_ctx); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_rg_auth_ctx_H_ */ + diff --git a/lib/sbi/openapi/model/rg_authentication_info.c b/lib/sbi/openapi/model/rg_authentication_info.c new file mode 100644 index 0000000000..0017e6db2e --- /dev/null +++ b/lib/sbi/openapi/model/rg_authentication_info.c @@ -0,0 +1,96 @@ + +#include +#include +#include +#include "rg_authentication_info.h" + +OpenAPI_rg_authentication_info_t *OpenAPI_rg_authentication_info_create( + char *suci, + int authenticated_ind + ) +{ + OpenAPI_rg_authentication_info_t *rg_authentication_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_rg_authentication_info_t)); + if (!rg_authentication_info_local_var) { + return NULL; + } + rg_authentication_info_local_var->suci = suci; + rg_authentication_info_local_var->authenticated_ind = authenticated_ind; + + return rg_authentication_info_local_var; +} + +void OpenAPI_rg_authentication_info_free(OpenAPI_rg_authentication_info_t *rg_authentication_info) +{ + if (NULL == rg_authentication_info) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(rg_authentication_info->suci); + ogs_free(rg_authentication_info); +} + +cJSON *OpenAPI_rg_authentication_info_convertToJSON(OpenAPI_rg_authentication_info_t *rg_authentication_info) +{ + cJSON *item = NULL; + + if (rg_authentication_info == NULL) { + ogs_error("OpenAPI_rg_authentication_info_convertToJSON() failed [RgAuthenticationInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!rg_authentication_info->suci) { + ogs_error("OpenAPI_rg_authentication_info_convertToJSON() failed [suci]"); + goto end; + } + if (cJSON_AddStringToObject(item, "suci", rg_authentication_info->suci) == NULL) { + ogs_error("OpenAPI_rg_authentication_info_convertToJSON() failed [suci]"); + goto end; + } + + if (cJSON_AddBoolToObject(item, "authenticatedInd", rg_authentication_info->authenticated_ind) == NULL) { + ogs_error("OpenAPI_rg_authentication_info_convertToJSON() failed [authenticated_ind]"); + goto end; + } + +end: + return item; +} + +OpenAPI_rg_authentication_info_t *OpenAPI_rg_authentication_info_parseFromJSON(cJSON *rg_authentication_infoJSON) +{ + OpenAPI_rg_authentication_info_t *rg_authentication_info_local_var = NULL; + cJSON *suci = cJSON_GetObjectItemCaseSensitive(rg_authentication_infoJSON, "suci"); + if (!suci) { + ogs_error("OpenAPI_rg_authentication_info_parseFromJSON() failed [suci]"); + goto end; + } + + + if (!cJSON_IsString(suci)) { + ogs_error("OpenAPI_rg_authentication_info_parseFromJSON() failed [suci]"); + goto end; + } + + cJSON *authenticated_ind = cJSON_GetObjectItemCaseSensitive(rg_authentication_infoJSON, "authenticatedInd"); + if (!authenticated_ind) { + ogs_error("OpenAPI_rg_authentication_info_parseFromJSON() failed [authenticated_ind]"); + goto end; + } + + + if (!cJSON_IsBool(authenticated_ind)) { + ogs_error("OpenAPI_rg_authentication_info_parseFromJSON() failed [authenticated_ind]"); + goto end; + } + + rg_authentication_info_local_var = OpenAPI_rg_authentication_info_create ( + ogs_strdup(suci->valuestring), + authenticated_ind->valueint + ); + + return rg_authentication_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/rg_authentication_info.h b/lib/sbi/openapi/model/rg_authentication_info.h new file mode 100644 index 0000000000..ff2c30d13a --- /dev/null +++ b/lib/sbi/openapi/model/rg_authentication_info.h @@ -0,0 +1,39 @@ +/* + * rg_authentication_info.h + * + * + */ + +#ifndef _OpenAPI_rg_authentication_info_H_ +#define _OpenAPI_rg_authentication_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_rg_authentication_info_s OpenAPI_rg_authentication_info_t; +typedef struct OpenAPI_rg_authentication_info_s { + char *suci; + int authenticated_ind; +} OpenAPI_rg_authentication_info_t; + +OpenAPI_rg_authentication_info_t *OpenAPI_rg_authentication_info_create( + char *suci, + int authenticated_ind + ); +void OpenAPI_rg_authentication_info_free(OpenAPI_rg_authentication_info_t *rg_authentication_info); +OpenAPI_rg_authentication_info_t *OpenAPI_rg_authentication_info_parseFromJSON(cJSON *rg_authentication_infoJSON); +cJSON *OpenAPI_rg_authentication_info_convertToJSON(OpenAPI_rg_authentication_info_t *rg_authentication_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_rg_authentication_info_H_ */ + diff --git a/lib/sbi/openapi/model/rm_info.c b/lib/sbi/openapi/model/rm_info.c new file mode 100644 index 0000000000..230f7c22bc --- /dev/null +++ b/lib/sbi/openapi/model/rm_info.c @@ -0,0 +1,106 @@ + +#include +#include +#include +#include "rm_info.h" + +OpenAPI_rm_info_t *OpenAPI_rm_info_create( + OpenAPI_rm_state_t *rm_state, + OpenAPI_access_type_e access_type + ) +{ + OpenAPI_rm_info_t *rm_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_rm_info_t)); + if (!rm_info_local_var) { + return NULL; + } + rm_info_local_var->rm_state = rm_state; + rm_info_local_var->access_type = access_type; + + return rm_info_local_var; +} + +void OpenAPI_rm_info_free(OpenAPI_rm_info_t *rm_info) +{ + if (NULL == rm_info) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_rm_state_free(rm_info->rm_state); + ogs_free(rm_info); +} + +cJSON *OpenAPI_rm_info_convertToJSON(OpenAPI_rm_info_t *rm_info) +{ + cJSON *item = NULL; + + if (rm_info == NULL) { + ogs_error("OpenAPI_rm_info_convertToJSON() failed [RmInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!rm_info->rm_state) { + ogs_error("OpenAPI_rm_info_convertToJSON() failed [rm_state]"); + goto end; + } + cJSON *rm_state_local_JSON = OpenAPI_rm_state_convertToJSON(rm_info->rm_state); + if (rm_state_local_JSON == NULL) { + ogs_error("OpenAPI_rm_info_convertToJSON() failed [rm_state]"); + goto end; + } + cJSON_AddItemToObject(item, "rmState", rm_state_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_rm_info_convertToJSON() failed [rm_state]"); + goto end; + } + + if (!rm_info->access_type) { + ogs_error("OpenAPI_rm_info_convertToJSON() failed [access_type]"); + goto end; + } + if (cJSON_AddStringToObject(item, "accessType", OpenAPI_access_type_ToString(rm_info->access_type)) == NULL) { + ogs_error("OpenAPI_rm_info_convertToJSON() failed [access_type]"); + goto end; + } + +end: + return item; +} + +OpenAPI_rm_info_t *OpenAPI_rm_info_parseFromJSON(cJSON *rm_infoJSON) +{ + OpenAPI_rm_info_t *rm_info_local_var = NULL; + cJSON *rm_state = cJSON_GetObjectItemCaseSensitive(rm_infoJSON, "rmState"); + if (!rm_state) { + ogs_error("OpenAPI_rm_info_parseFromJSON() failed [rm_state]"); + goto end; + } + + OpenAPI_rm_state_t *rm_state_local_nonprim = NULL; + + rm_state_local_nonprim = OpenAPI_rm_state_parseFromJSON(rm_state); + + cJSON *access_type = cJSON_GetObjectItemCaseSensitive(rm_infoJSON, "accessType"); + if (!access_type) { + ogs_error("OpenAPI_rm_info_parseFromJSON() failed [access_type]"); + goto end; + } + + OpenAPI_access_type_e access_typeVariable; + + if (!cJSON_IsString(access_type)) { + ogs_error("OpenAPI_rm_info_parseFromJSON() failed [access_type]"); + goto end; + } + access_typeVariable = OpenAPI_access_type_FromString(access_type->valuestring); + + rm_info_local_var = OpenAPI_rm_info_create ( + rm_state_local_nonprim, + access_typeVariable + ); + + return rm_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/rm_info.h b/lib/sbi/openapi/model/rm_info.h new file mode 100644 index 0000000000..66aa2672be --- /dev/null +++ b/lib/sbi/openapi/model/rm_info.h @@ -0,0 +1,41 @@ +/* + * rm_info.h + * + * + */ + +#ifndef _OpenAPI_rm_info_H_ +#define _OpenAPI_rm_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "access_type.h" +#include "rm_state.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_rm_info_s OpenAPI_rm_info_t; +typedef struct OpenAPI_rm_info_s { + struct OpenAPI_rm_state_s *rm_state; + OpenAPI_access_type_e access_type; +} OpenAPI_rm_info_t; + +OpenAPI_rm_info_t *OpenAPI_rm_info_create( + OpenAPI_rm_state_t *rm_state, + OpenAPI_access_type_e access_type + ); +void OpenAPI_rm_info_free(OpenAPI_rm_info_t *rm_info); +OpenAPI_rm_info_t *OpenAPI_rm_info_parseFromJSON(cJSON *rm_infoJSON); +cJSON *OpenAPI_rm_info_convertToJSON(OpenAPI_rm_info_t *rm_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_rm_info_H_ */ + diff --git a/lib/sbi/openapi/model/rm_state.c b/lib/sbi/openapi/model/rm_state.c new file mode 100644 index 0000000000..f836d81d23 --- /dev/null +++ b/lib/sbi/openapi/model/rm_state.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "rm_state.h" + +OpenAPI_rm_state_t *OpenAPI_rm_state_create( + ) +{ + OpenAPI_rm_state_t *rm_state_local_var = OpenAPI_malloc(sizeof(OpenAPI_rm_state_t)); + if (!rm_state_local_var) { + return NULL; + } + + return rm_state_local_var; +} + +void OpenAPI_rm_state_free(OpenAPI_rm_state_t *rm_state) +{ + if (NULL == rm_state) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(rm_state); +} + +cJSON *OpenAPI_rm_state_convertToJSON(OpenAPI_rm_state_t *rm_state) +{ + cJSON *item = NULL; + + if (rm_state == NULL) { + ogs_error("OpenAPI_rm_state_convertToJSON() failed [RmState]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_rm_state_t *OpenAPI_rm_state_parseFromJSON(cJSON *rm_stateJSON) +{ + OpenAPI_rm_state_t *rm_state_local_var = NULL; + rm_state_local_var = OpenAPI_rm_state_create ( + ); + + return rm_state_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/rm_state.h b/lib/sbi/openapi/model/rm_state.h new file mode 100644 index 0000000000..294ea96dbf --- /dev/null +++ b/lib/sbi/openapi/model/rm_state.h @@ -0,0 +1,35 @@ +/* + * rm_state.h + * + * + */ + +#ifndef _OpenAPI_rm_state_H_ +#define _OpenAPI_rm_state_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_rm_state_s OpenAPI_rm_state_t; +typedef struct OpenAPI_rm_state_s { +} OpenAPI_rm_state_t; + +OpenAPI_rm_state_t *OpenAPI_rm_state_create( + ); +void OpenAPI_rm_state_free(OpenAPI_rm_state_t *rm_state); +OpenAPI_rm_state_t *OpenAPI_rm_state_parseFromJSON(cJSON *rm_stateJSON); +cJSON *OpenAPI_rm_state_convertToJSON(OpenAPI_rm_state_t *rm_state); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_rm_state_H_ */ + diff --git a/lib/sbi/openapi/model/roaming_odb.c b/lib/sbi/openapi/model/roaming_odb.c new file mode 100644 index 0000000000..be03b3efcf --- /dev/null +++ b/lib/sbi/openapi/model/roaming_odb.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "roaming_odb.h" + +OpenAPI_roaming_odb_t *OpenAPI_roaming_odb_create( + ) +{ + OpenAPI_roaming_odb_t *roaming_odb_local_var = OpenAPI_malloc(sizeof(OpenAPI_roaming_odb_t)); + if (!roaming_odb_local_var) { + return NULL; + } + + return roaming_odb_local_var; +} + +void OpenAPI_roaming_odb_free(OpenAPI_roaming_odb_t *roaming_odb) +{ + if (NULL == roaming_odb) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(roaming_odb); +} + +cJSON *OpenAPI_roaming_odb_convertToJSON(OpenAPI_roaming_odb_t *roaming_odb) +{ + cJSON *item = NULL; + + if (roaming_odb == NULL) { + ogs_error("OpenAPI_roaming_odb_convertToJSON() failed [RoamingOdb]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_roaming_odb_t *OpenAPI_roaming_odb_parseFromJSON(cJSON *roaming_odbJSON) +{ + OpenAPI_roaming_odb_t *roaming_odb_local_var = NULL; + roaming_odb_local_var = OpenAPI_roaming_odb_create ( + ); + + return roaming_odb_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/roaming_odb.h b/lib/sbi/openapi/model/roaming_odb.h new file mode 100644 index 0000000000..f541d6af60 --- /dev/null +++ b/lib/sbi/openapi/model/roaming_odb.h @@ -0,0 +1,35 @@ +/* + * roaming_odb.h + * + * + */ + +#ifndef _OpenAPI_roaming_odb_H_ +#define _OpenAPI_roaming_odb_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_roaming_odb_s OpenAPI_roaming_odb_t; +typedef struct OpenAPI_roaming_odb_s { +} OpenAPI_roaming_odb_t; + +OpenAPI_roaming_odb_t *OpenAPI_roaming_odb_create( + ); +void OpenAPI_roaming_odb_free(OpenAPI_roaming_odb_t *roaming_odb); +OpenAPI_roaming_odb_t *OpenAPI_roaming_odb_parseFromJSON(cJSON *roaming_odbJSON); +cJSON *OpenAPI_roaming_odb_convertToJSON(OpenAPI_roaming_odb_t *roaming_odb); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_roaming_odb_H_ */ + diff --git a/lib/sbi/openapi/model/route_information.c b/lib/sbi/openapi/model/route_information.c new file mode 100644 index 0000000000..0be118c9d3 --- /dev/null +++ b/lib/sbi/openapi/model/route_information.c @@ -0,0 +1,115 @@ + +#include +#include +#include +#include "route_information.h" + +OpenAPI_route_information_t *OpenAPI_route_information_create( + char *ipv4_addr, + char *ipv6_addr, + int port_number + ) +{ + OpenAPI_route_information_t *route_information_local_var = OpenAPI_malloc(sizeof(OpenAPI_route_information_t)); + if (!route_information_local_var) { + return NULL; + } + route_information_local_var->ipv4_addr = ipv4_addr; + route_information_local_var->ipv6_addr = ipv6_addr; + route_information_local_var->port_number = port_number; + + return route_information_local_var; +} + +void OpenAPI_route_information_free(OpenAPI_route_information_t *route_information) +{ + if (NULL == route_information) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(route_information->ipv4_addr); + ogs_free(route_information->ipv6_addr); + ogs_free(route_information); +} + +cJSON *OpenAPI_route_information_convertToJSON(OpenAPI_route_information_t *route_information) +{ + cJSON *item = NULL; + + if (route_information == NULL) { + ogs_error("OpenAPI_route_information_convertToJSON() failed [RouteInformation]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (route_information->ipv4_addr) { + if (cJSON_AddStringToObject(item, "ipv4Addr", route_information->ipv4_addr) == NULL) { + ogs_error("OpenAPI_route_information_convertToJSON() failed [ipv4_addr]"); + goto end; + } + } + + if (route_information->ipv6_addr) { + if (cJSON_AddStringToObject(item, "ipv6Addr", route_information->ipv6_addr) == NULL) { + ogs_error("OpenAPI_route_information_convertToJSON() failed [ipv6_addr]"); + goto end; + } + } + + if (!route_information->port_number) { + ogs_error("OpenAPI_route_information_convertToJSON() failed [port_number]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "portNumber", route_information->port_number) == NULL) { + ogs_error("OpenAPI_route_information_convertToJSON() failed [port_number]"); + goto end; + } + +end: + return item; +} + +OpenAPI_route_information_t *OpenAPI_route_information_parseFromJSON(cJSON *route_informationJSON) +{ + OpenAPI_route_information_t *route_information_local_var = NULL; + cJSON *ipv4_addr = cJSON_GetObjectItemCaseSensitive(route_informationJSON, "ipv4Addr"); + + if (ipv4_addr) { + if (!cJSON_IsString(ipv4_addr)) { + ogs_error("OpenAPI_route_information_parseFromJSON() failed [ipv4_addr]"); + goto end; + } + } + + cJSON *ipv6_addr = cJSON_GetObjectItemCaseSensitive(route_informationJSON, "ipv6Addr"); + + if (ipv6_addr) { + if (!cJSON_IsString(ipv6_addr)) { + ogs_error("OpenAPI_route_information_parseFromJSON() failed [ipv6_addr]"); + goto end; + } + } + + cJSON *port_number = cJSON_GetObjectItemCaseSensitive(route_informationJSON, "portNumber"); + if (!port_number) { + ogs_error("OpenAPI_route_information_parseFromJSON() failed [port_number]"); + goto end; + } + + + if (!cJSON_IsNumber(port_number)) { + ogs_error("OpenAPI_route_information_parseFromJSON() failed [port_number]"); + goto end; + } + + route_information_local_var = OpenAPI_route_information_create ( + ipv4_addr ? ogs_strdup(ipv4_addr->valuestring) : NULL, + ipv6_addr ? ogs_strdup(ipv6_addr->valuestring) : NULL, + port_number->valuedouble + ); + + return route_information_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/route_information.h b/lib/sbi/openapi/model/route_information.h new file mode 100644 index 0000000000..d45234a98b --- /dev/null +++ b/lib/sbi/openapi/model/route_information.h @@ -0,0 +1,41 @@ +/* + * route_information.h + * + * + */ + +#ifndef _OpenAPI_route_information_H_ +#define _OpenAPI_route_information_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_route_information_s OpenAPI_route_information_t; +typedef struct OpenAPI_route_information_s { + char *ipv4_addr; + char *ipv6_addr; + int port_number; +} OpenAPI_route_information_t; + +OpenAPI_route_information_t *OpenAPI_route_information_create( + char *ipv4_addr, + char *ipv6_addr, + int port_number + ); +void OpenAPI_route_information_free(OpenAPI_route_information_t *route_information); +OpenAPI_route_information_t *OpenAPI_route_information_parseFromJSON(cJSON *route_informationJSON); +cJSON *OpenAPI_route_information_convertToJSON(OpenAPI_route_information_t *route_information); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_route_information_H_ */ + diff --git a/lib/sbi/openapi/model/route_to_location.c b/lib/sbi/openapi/model/route_to_location.c new file mode 100644 index 0000000000..d4ff26fca0 --- /dev/null +++ b/lib/sbi/openapi/model/route_to_location.c @@ -0,0 +1,120 @@ + +#include +#include +#include +#include "route_to_location.h" + +OpenAPI_route_to_location_t *OpenAPI_route_to_location_create( + char *dnai, + OpenAPI_route_information_t *route_info, + char *route_prof_id + ) +{ + OpenAPI_route_to_location_t *route_to_location_local_var = OpenAPI_malloc(sizeof(OpenAPI_route_to_location_t)); + if (!route_to_location_local_var) { + return NULL; + } + route_to_location_local_var->dnai = dnai; + route_to_location_local_var->route_info = route_info; + route_to_location_local_var->route_prof_id = route_prof_id; + + return route_to_location_local_var; +} + +void OpenAPI_route_to_location_free(OpenAPI_route_to_location_t *route_to_location) +{ + if (NULL == route_to_location) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(route_to_location->dnai); + OpenAPI_route_information_free(route_to_location->route_info); + ogs_free(route_to_location->route_prof_id); + ogs_free(route_to_location); +} + +cJSON *OpenAPI_route_to_location_convertToJSON(OpenAPI_route_to_location_t *route_to_location) +{ + cJSON *item = NULL; + + if (route_to_location == NULL) { + ogs_error("OpenAPI_route_to_location_convertToJSON() failed [RouteToLocation]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!route_to_location->dnai) { + ogs_error("OpenAPI_route_to_location_convertToJSON() failed [dnai]"); + goto end; + } + if (cJSON_AddStringToObject(item, "dnai", route_to_location->dnai) == NULL) { + ogs_error("OpenAPI_route_to_location_convertToJSON() failed [dnai]"); + goto end; + } + + if (route_to_location->route_info) { + cJSON *route_info_local_JSON = OpenAPI_route_information_convertToJSON(route_to_location->route_info); + if (route_info_local_JSON == NULL) { + ogs_error("OpenAPI_route_to_location_convertToJSON() failed [route_info]"); + goto end; + } + cJSON_AddItemToObject(item, "routeInfo", route_info_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_route_to_location_convertToJSON() failed [route_info]"); + goto end; + } + } + + if (route_to_location->route_prof_id) { + if (cJSON_AddStringToObject(item, "routeProfId", route_to_location->route_prof_id) == NULL) { + ogs_error("OpenAPI_route_to_location_convertToJSON() failed [route_prof_id]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_route_to_location_t *OpenAPI_route_to_location_parseFromJSON(cJSON *route_to_locationJSON) +{ + OpenAPI_route_to_location_t *route_to_location_local_var = NULL; + cJSON *dnai = cJSON_GetObjectItemCaseSensitive(route_to_locationJSON, "dnai"); + if (!dnai) { + ogs_error("OpenAPI_route_to_location_parseFromJSON() failed [dnai]"); + goto end; + } + + + if (!cJSON_IsString(dnai)) { + ogs_error("OpenAPI_route_to_location_parseFromJSON() failed [dnai]"); + goto end; + } + + cJSON *route_info = cJSON_GetObjectItemCaseSensitive(route_to_locationJSON, "routeInfo"); + + OpenAPI_route_information_t *route_info_local_nonprim = NULL; + if (route_info) { + route_info_local_nonprim = OpenAPI_route_information_parseFromJSON(route_info); + } + + cJSON *route_prof_id = cJSON_GetObjectItemCaseSensitive(route_to_locationJSON, "routeProfId"); + + if (route_prof_id) { + if (!cJSON_IsString(route_prof_id)) { + ogs_error("OpenAPI_route_to_location_parseFromJSON() failed [route_prof_id]"); + goto end; + } + } + + route_to_location_local_var = OpenAPI_route_to_location_create ( + ogs_strdup(dnai->valuestring), + route_info ? route_info_local_nonprim : NULL, + route_prof_id ? ogs_strdup(route_prof_id->valuestring) : NULL + ); + + return route_to_location_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/route_to_location.h b/lib/sbi/openapi/model/route_to_location.h new file mode 100644 index 0000000000..5317bf1496 --- /dev/null +++ b/lib/sbi/openapi/model/route_to_location.h @@ -0,0 +1,42 @@ +/* + * route_to_location.h + * + * + */ + +#ifndef _OpenAPI_route_to_location_H_ +#define _OpenAPI_route_to_location_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "route_information.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_route_to_location_s OpenAPI_route_to_location_t; +typedef struct OpenAPI_route_to_location_s { + char *dnai; + struct OpenAPI_route_information_s *route_info; + char *route_prof_id; +} OpenAPI_route_to_location_t; + +OpenAPI_route_to_location_t *OpenAPI_route_to_location_create( + char *dnai, + OpenAPI_route_information_t *route_info, + char *route_prof_id + ); +void OpenAPI_route_to_location_free(OpenAPI_route_to_location_t *route_to_location); +OpenAPI_route_to_location_t *OpenAPI_route_to_location_parseFromJSON(cJSON *route_to_locationJSON); +cJSON *OpenAPI_route_to_location_convertToJSON(OpenAPI_route_to_location_t *route_to_location); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_route_to_location_H_ */ + diff --git a/lib/sbi/openapi/model/scheduled_communication_time.c b/lib/sbi/openapi/model/scheduled_communication_time.c new file mode 100644 index 0000000000..6a6a82c0f7 --- /dev/null +++ b/lib/sbi/openapi/model/scheduled_communication_time.c @@ -0,0 +1,134 @@ + +#include +#include +#include +#include "scheduled_communication_time.h" + +OpenAPI_scheduled_communication_time_t *OpenAPI_scheduled_communication_time_create( + OpenAPI_list_t *days_of_week, + char *time_of_day_start, + char *time_of_day_end + ) +{ + OpenAPI_scheduled_communication_time_t *scheduled_communication_time_local_var = OpenAPI_malloc(sizeof(OpenAPI_scheduled_communication_time_t)); + if (!scheduled_communication_time_local_var) { + return NULL; + } + scheduled_communication_time_local_var->days_of_week = days_of_week; + scheduled_communication_time_local_var->time_of_day_start = time_of_day_start; + scheduled_communication_time_local_var->time_of_day_end = time_of_day_end; + + return scheduled_communication_time_local_var; +} + +void OpenAPI_scheduled_communication_time_free(OpenAPI_scheduled_communication_time_t *scheduled_communication_time) +{ + if (NULL == scheduled_communication_time) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(scheduled_communication_time->days_of_week, node) { + ogs_free(node->data); + } + OpenAPI_list_free(scheduled_communication_time->days_of_week); + ogs_free(scheduled_communication_time->time_of_day_start); + ogs_free(scheduled_communication_time->time_of_day_end); + ogs_free(scheduled_communication_time); +} + +cJSON *OpenAPI_scheduled_communication_time_convertToJSON(OpenAPI_scheduled_communication_time_t *scheduled_communication_time) +{ + cJSON *item = NULL; + + if (scheduled_communication_time == NULL) { + ogs_error("OpenAPI_scheduled_communication_time_convertToJSON() failed [ScheduledCommunicationTime]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (scheduled_communication_time->days_of_week) { + cJSON *days_of_week = cJSON_AddArrayToObject(item, "daysOfWeek"); + if (days_of_week == NULL) { + ogs_error("OpenAPI_scheduled_communication_time_convertToJSON() failed [days_of_week]"); + goto end; + } + + OpenAPI_lnode_t *days_of_week_node; + OpenAPI_list_for_each(scheduled_communication_time->days_of_week, days_of_week_node) { + if (cJSON_AddNumberToObject(days_of_week, "", *(double *)days_of_week_node->data) == NULL) { + ogs_error("OpenAPI_scheduled_communication_time_convertToJSON() failed [days_of_week]"); + goto end; + } + } + } + + if (scheduled_communication_time->time_of_day_start) { + if (cJSON_AddStringToObject(item, "timeOfDayStart", scheduled_communication_time->time_of_day_start) == NULL) { + ogs_error("OpenAPI_scheduled_communication_time_convertToJSON() failed [time_of_day_start]"); + goto end; + } + } + + if (scheduled_communication_time->time_of_day_end) { + if (cJSON_AddStringToObject(item, "timeOfDayEnd", scheduled_communication_time->time_of_day_end) == NULL) { + ogs_error("OpenAPI_scheduled_communication_time_convertToJSON() failed [time_of_day_end]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_scheduled_communication_time_t *OpenAPI_scheduled_communication_time_parseFromJSON(cJSON *scheduled_communication_timeJSON) +{ + OpenAPI_scheduled_communication_time_t *scheduled_communication_time_local_var = NULL; + cJSON *days_of_week = cJSON_GetObjectItemCaseSensitive(scheduled_communication_timeJSON, "daysOfWeek"); + + OpenAPI_list_t *days_of_weekList; + if (days_of_week) { + cJSON *days_of_week_local; + if (!cJSON_IsArray(days_of_week)) { + ogs_error("OpenAPI_scheduled_communication_time_parseFromJSON() failed [days_of_week]"); + goto end; + } + days_of_weekList = OpenAPI_list_create(); + + cJSON_ArrayForEach(days_of_week_local, days_of_week) { + if (!cJSON_IsNumber(days_of_week_local)) { + ogs_error("OpenAPI_scheduled_communication_time_parseFromJSON() failed [days_of_week]"); + goto end; + } + OpenAPI_list_add(days_of_weekList, &days_of_week_local->valuedouble); + } + } + + cJSON *time_of_day_start = cJSON_GetObjectItemCaseSensitive(scheduled_communication_timeJSON, "timeOfDayStart"); + + if (time_of_day_start) { + if (!cJSON_IsString(time_of_day_start)) { + ogs_error("OpenAPI_scheduled_communication_time_parseFromJSON() failed [time_of_day_start]"); + goto end; + } + } + + cJSON *time_of_day_end = cJSON_GetObjectItemCaseSensitive(scheduled_communication_timeJSON, "timeOfDayEnd"); + + if (time_of_day_end) { + if (!cJSON_IsString(time_of_day_end)) { + ogs_error("OpenAPI_scheduled_communication_time_parseFromJSON() failed [time_of_day_end]"); + goto end; + } + } + + scheduled_communication_time_local_var = OpenAPI_scheduled_communication_time_create ( + days_of_week ? days_of_weekList : NULL, + time_of_day_start ? ogs_strdup(time_of_day_start->valuestring) : NULL, + time_of_day_end ? ogs_strdup(time_of_day_end->valuestring) : NULL + ); + + return scheduled_communication_time_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/scheduled_communication_time.h b/lib/sbi/openapi/model/scheduled_communication_time.h new file mode 100644 index 0000000000..99825cde8f --- /dev/null +++ b/lib/sbi/openapi/model/scheduled_communication_time.h @@ -0,0 +1,41 @@ +/* + * scheduled_communication_time.h + * + * + */ + +#ifndef _OpenAPI_scheduled_communication_time_H_ +#define _OpenAPI_scheduled_communication_time_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_scheduled_communication_time_s OpenAPI_scheduled_communication_time_t; +typedef struct OpenAPI_scheduled_communication_time_s { + OpenAPI_list_t *days_of_week; + char *time_of_day_start; + char *time_of_day_end; +} OpenAPI_scheduled_communication_time_t; + +OpenAPI_scheduled_communication_time_t *OpenAPI_scheduled_communication_time_create( + OpenAPI_list_t *days_of_week, + char *time_of_day_start, + char *time_of_day_end + ); +void OpenAPI_scheduled_communication_time_free(OpenAPI_scheduled_communication_time_t *scheduled_communication_time); +OpenAPI_scheduled_communication_time_t *OpenAPI_scheduled_communication_time_parseFromJSON(cJSON *scheduled_communication_timeJSON); +cJSON *OpenAPI_scheduled_communication_time_convertToJSON(OpenAPI_scheduled_communication_time_t *scheduled_communication_time); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_scheduled_communication_time_H_ */ + diff --git a/lib/sbi/openapi/model/scheduled_communication_time_rm.c b/lib/sbi/openapi/model/scheduled_communication_time_rm.c new file mode 100644 index 0000000000..44ed5dc11f --- /dev/null +++ b/lib/sbi/openapi/model/scheduled_communication_time_rm.c @@ -0,0 +1,134 @@ + +#include +#include +#include +#include "scheduled_communication_time_rm.h" + +OpenAPI_scheduled_communication_time_rm_t *OpenAPI_scheduled_communication_time_rm_create( + OpenAPI_list_t *days_of_week, + char *time_of_day_start, + char *time_of_day_end + ) +{ + OpenAPI_scheduled_communication_time_rm_t *scheduled_communication_time_rm_local_var = OpenAPI_malloc(sizeof(OpenAPI_scheduled_communication_time_rm_t)); + if (!scheduled_communication_time_rm_local_var) { + return NULL; + } + scheduled_communication_time_rm_local_var->days_of_week = days_of_week; + scheduled_communication_time_rm_local_var->time_of_day_start = time_of_day_start; + scheduled_communication_time_rm_local_var->time_of_day_end = time_of_day_end; + + return scheduled_communication_time_rm_local_var; +} + +void OpenAPI_scheduled_communication_time_rm_free(OpenAPI_scheduled_communication_time_rm_t *scheduled_communication_time_rm) +{ + if (NULL == scheduled_communication_time_rm) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(scheduled_communication_time_rm->days_of_week, node) { + ogs_free(node->data); + } + OpenAPI_list_free(scheduled_communication_time_rm->days_of_week); + ogs_free(scheduled_communication_time_rm->time_of_day_start); + ogs_free(scheduled_communication_time_rm->time_of_day_end); + ogs_free(scheduled_communication_time_rm); +} + +cJSON *OpenAPI_scheduled_communication_time_rm_convertToJSON(OpenAPI_scheduled_communication_time_rm_t *scheduled_communication_time_rm) +{ + cJSON *item = NULL; + + if (scheduled_communication_time_rm == NULL) { + ogs_error("OpenAPI_scheduled_communication_time_rm_convertToJSON() failed [ScheduledCommunicationTimeRm]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (scheduled_communication_time_rm->days_of_week) { + cJSON *days_of_week = cJSON_AddArrayToObject(item, "daysOfWeek"); + if (days_of_week == NULL) { + ogs_error("OpenAPI_scheduled_communication_time_rm_convertToJSON() failed [days_of_week]"); + goto end; + } + + OpenAPI_lnode_t *days_of_week_node; + OpenAPI_list_for_each(scheduled_communication_time_rm->days_of_week, days_of_week_node) { + if (cJSON_AddNumberToObject(days_of_week, "", *(double *)days_of_week_node->data) == NULL) { + ogs_error("OpenAPI_scheduled_communication_time_rm_convertToJSON() failed [days_of_week]"); + goto end; + } + } + } + + if (scheduled_communication_time_rm->time_of_day_start) { + if (cJSON_AddStringToObject(item, "timeOfDayStart", scheduled_communication_time_rm->time_of_day_start) == NULL) { + ogs_error("OpenAPI_scheduled_communication_time_rm_convertToJSON() failed [time_of_day_start]"); + goto end; + } + } + + if (scheduled_communication_time_rm->time_of_day_end) { + if (cJSON_AddStringToObject(item, "timeOfDayEnd", scheduled_communication_time_rm->time_of_day_end) == NULL) { + ogs_error("OpenAPI_scheduled_communication_time_rm_convertToJSON() failed [time_of_day_end]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_scheduled_communication_time_rm_t *OpenAPI_scheduled_communication_time_rm_parseFromJSON(cJSON *scheduled_communication_time_rmJSON) +{ + OpenAPI_scheduled_communication_time_rm_t *scheduled_communication_time_rm_local_var = NULL; + cJSON *days_of_week = cJSON_GetObjectItemCaseSensitive(scheduled_communication_time_rmJSON, "daysOfWeek"); + + OpenAPI_list_t *days_of_weekList; + if (days_of_week) { + cJSON *days_of_week_local; + if (!cJSON_IsArray(days_of_week)) { + ogs_error("OpenAPI_scheduled_communication_time_rm_parseFromJSON() failed [days_of_week]"); + goto end; + } + days_of_weekList = OpenAPI_list_create(); + + cJSON_ArrayForEach(days_of_week_local, days_of_week) { + if (!cJSON_IsNumber(days_of_week_local)) { + ogs_error("OpenAPI_scheduled_communication_time_rm_parseFromJSON() failed [days_of_week]"); + goto end; + } + OpenAPI_list_add(days_of_weekList, &days_of_week_local->valuedouble); + } + } + + cJSON *time_of_day_start = cJSON_GetObjectItemCaseSensitive(scheduled_communication_time_rmJSON, "timeOfDayStart"); + + if (time_of_day_start) { + if (!cJSON_IsString(time_of_day_start)) { + ogs_error("OpenAPI_scheduled_communication_time_rm_parseFromJSON() failed [time_of_day_start]"); + goto end; + } + } + + cJSON *time_of_day_end = cJSON_GetObjectItemCaseSensitive(scheduled_communication_time_rmJSON, "timeOfDayEnd"); + + if (time_of_day_end) { + if (!cJSON_IsString(time_of_day_end)) { + ogs_error("OpenAPI_scheduled_communication_time_rm_parseFromJSON() failed [time_of_day_end]"); + goto end; + } + } + + scheduled_communication_time_rm_local_var = OpenAPI_scheduled_communication_time_rm_create ( + days_of_week ? days_of_weekList : NULL, + time_of_day_start ? ogs_strdup(time_of_day_start->valuestring) : NULL, + time_of_day_end ? ogs_strdup(time_of_day_end->valuestring) : NULL + ); + + return scheduled_communication_time_rm_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/scheduled_communication_time_rm.h b/lib/sbi/openapi/model/scheduled_communication_time_rm.h new file mode 100644 index 0000000000..7149f4f332 --- /dev/null +++ b/lib/sbi/openapi/model/scheduled_communication_time_rm.h @@ -0,0 +1,43 @@ +/* + * scheduled_communication_time_rm.h + * + * + */ + +#ifndef _OpenAPI_scheduled_communication_time_rm_H_ +#define _OpenAPI_scheduled_communication_time_rm_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "null_value.h" +#include "scheduled_communication_time.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_scheduled_communication_time_rm_s OpenAPI_scheduled_communication_time_rm_t; +typedef struct OpenAPI_scheduled_communication_time_rm_s { + OpenAPI_list_t *days_of_week; + char *time_of_day_start; + char *time_of_day_end; +} OpenAPI_scheduled_communication_time_rm_t; + +OpenAPI_scheduled_communication_time_rm_t *OpenAPI_scheduled_communication_time_rm_create( + OpenAPI_list_t *days_of_week, + char *time_of_day_start, + char *time_of_day_end + ); +void OpenAPI_scheduled_communication_time_rm_free(OpenAPI_scheduled_communication_time_rm_t *scheduled_communication_time_rm); +OpenAPI_scheduled_communication_time_rm_t *OpenAPI_scheduled_communication_time_rm_parseFromJSON(cJSON *scheduled_communication_time_rmJSON); +cJSON *OpenAPI_scheduled_communication_time_rm_convertToJSON(OpenAPI_scheduled_communication_time_rm_t *scheduled_communication_time_rm); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_scheduled_communication_time_rm_H_ */ + diff --git a/lib/sbi/openapi/model/scheduled_communication_type.c b/lib/sbi/openapi/model/scheduled_communication_type.c new file mode 100644 index 0000000000..86a8ebf454 --- /dev/null +++ b/lib/sbi/openapi/model/scheduled_communication_type.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "scheduled_communication_type.h" + +OpenAPI_scheduled_communication_type_t *OpenAPI_scheduled_communication_type_create( + ) +{ + OpenAPI_scheduled_communication_type_t *scheduled_communication_type_local_var = OpenAPI_malloc(sizeof(OpenAPI_scheduled_communication_type_t)); + if (!scheduled_communication_type_local_var) { + return NULL; + } + + return scheduled_communication_type_local_var; +} + +void OpenAPI_scheduled_communication_type_free(OpenAPI_scheduled_communication_type_t *scheduled_communication_type) +{ + if (NULL == scheduled_communication_type) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(scheduled_communication_type); +} + +cJSON *OpenAPI_scheduled_communication_type_convertToJSON(OpenAPI_scheduled_communication_type_t *scheduled_communication_type) +{ + cJSON *item = NULL; + + if (scheduled_communication_type == NULL) { + ogs_error("OpenAPI_scheduled_communication_type_convertToJSON() failed [ScheduledCommunicationType]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_scheduled_communication_type_t *OpenAPI_scheduled_communication_type_parseFromJSON(cJSON *scheduled_communication_typeJSON) +{ + OpenAPI_scheduled_communication_type_t *scheduled_communication_type_local_var = NULL; + scheduled_communication_type_local_var = OpenAPI_scheduled_communication_type_create ( + ); + + return scheduled_communication_type_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/scheduled_communication_type.h b/lib/sbi/openapi/model/scheduled_communication_type.h new file mode 100644 index 0000000000..4e8f96059e --- /dev/null +++ b/lib/sbi/openapi/model/scheduled_communication_type.h @@ -0,0 +1,35 @@ +/* + * scheduled_communication_type.h + * + * + */ + +#ifndef _OpenAPI_scheduled_communication_type_H_ +#define _OpenAPI_scheduled_communication_type_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_scheduled_communication_type_s OpenAPI_scheduled_communication_type_t; +typedef struct OpenAPI_scheduled_communication_type_s { +} OpenAPI_scheduled_communication_type_t; + +OpenAPI_scheduled_communication_type_t *OpenAPI_scheduled_communication_type_create( + ); +void OpenAPI_scheduled_communication_type_free(OpenAPI_scheduled_communication_type_t *scheduled_communication_type); +OpenAPI_scheduled_communication_type_t *OpenAPI_scheduled_communication_type_parseFromJSON(cJSON *scheduled_communication_typeJSON); +cJSON *OpenAPI_scheduled_communication_type_convertToJSON(OpenAPI_scheduled_communication_type_t *scheduled_communication_type); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_scheduled_communication_type_H_ */ + diff --git a/lib/sbi/openapi/model/scheduled_communication_type_rm.c b/lib/sbi/openapi/model/scheduled_communication_type_rm.c new file mode 100644 index 0000000000..3695baf9d1 --- /dev/null +++ b/lib/sbi/openapi/model/scheduled_communication_type_rm.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "scheduled_communication_type_rm.h" + +OpenAPI_scheduled_communication_type_rm_t *OpenAPI_scheduled_communication_type_rm_create( + ) +{ + OpenAPI_scheduled_communication_type_rm_t *scheduled_communication_type_rm_local_var = OpenAPI_malloc(sizeof(OpenAPI_scheduled_communication_type_rm_t)); + if (!scheduled_communication_type_rm_local_var) { + return NULL; + } + + return scheduled_communication_type_rm_local_var; +} + +void OpenAPI_scheduled_communication_type_rm_free(OpenAPI_scheduled_communication_type_rm_t *scheduled_communication_type_rm) +{ + if (NULL == scheduled_communication_type_rm) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(scheduled_communication_type_rm); +} + +cJSON *OpenAPI_scheduled_communication_type_rm_convertToJSON(OpenAPI_scheduled_communication_type_rm_t *scheduled_communication_type_rm) +{ + cJSON *item = NULL; + + if (scheduled_communication_type_rm == NULL) { + ogs_error("OpenAPI_scheduled_communication_type_rm_convertToJSON() failed [ScheduledCommunicationTypeRm]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_scheduled_communication_type_rm_t *OpenAPI_scheduled_communication_type_rm_parseFromJSON(cJSON *scheduled_communication_type_rmJSON) +{ + OpenAPI_scheduled_communication_type_rm_t *scheduled_communication_type_rm_local_var = NULL; + scheduled_communication_type_rm_local_var = OpenAPI_scheduled_communication_type_rm_create ( + ); + + return scheduled_communication_type_rm_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/scheduled_communication_type_rm.h b/lib/sbi/openapi/model/scheduled_communication_type_rm.h new file mode 100644 index 0000000000..7b7ee29c7e --- /dev/null +++ b/lib/sbi/openapi/model/scheduled_communication_type_rm.h @@ -0,0 +1,37 @@ +/* + * scheduled_communication_type_rm.h + * + * + */ + +#ifndef _OpenAPI_scheduled_communication_type_rm_H_ +#define _OpenAPI_scheduled_communication_type_rm_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "null_value.h" +#include "scheduled_communication_type.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_scheduled_communication_type_rm_s OpenAPI_scheduled_communication_type_rm_t; +typedef struct OpenAPI_scheduled_communication_type_rm_s { +} OpenAPI_scheduled_communication_type_rm_t; + +OpenAPI_scheduled_communication_type_rm_t *OpenAPI_scheduled_communication_type_rm_create( + ); +void OpenAPI_scheduled_communication_type_rm_free(OpenAPI_scheduled_communication_type_rm_t *scheduled_communication_type_rm); +OpenAPI_scheduled_communication_type_rm_t *OpenAPI_scheduled_communication_type_rm_parseFromJSON(cJSON *scheduled_communication_type_rmJSON); +cJSON *OpenAPI_scheduled_communication_type_rm_convertToJSON(OpenAPI_scheduled_communication_type_rm_t *scheduled_communication_type_rm); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_scheduled_communication_type_rm_H_ */ + diff --git a/lib/sbi/openapi/model/sdm_subs_modification.c b/lib/sbi/openapi/model/sdm_subs_modification.c new file mode 100644 index 0000000000..a8c33f228a --- /dev/null +++ b/lib/sbi/openapi/model/sdm_subs_modification.c @@ -0,0 +1,114 @@ + +#include +#include +#include +#include "sdm_subs_modification.h" + +OpenAPI_sdm_subs_modification_t *OpenAPI_sdm_subs_modification_create( + char *expires, + OpenAPI_list_t *monitored_resource_uris + ) +{ + OpenAPI_sdm_subs_modification_t *sdm_subs_modification_local_var = OpenAPI_malloc(sizeof(OpenAPI_sdm_subs_modification_t)); + if (!sdm_subs_modification_local_var) { + return NULL; + } + sdm_subs_modification_local_var->expires = expires; + sdm_subs_modification_local_var->monitored_resource_uris = monitored_resource_uris; + + return sdm_subs_modification_local_var; +} + +void OpenAPI_sdm_subs_modification_free(OpenAPI_sdm_subs_modification_t *sdm_subs_modification) +{ + if (NULL == sdm_subs_modification) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(sdm_subs_modification->expires); + OpenAPI_list_for_each(sdm_subs_modification->monitored_resource_uris, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sdm_subs_modification->monitored_resource_uris); + ogs_free(sdm_subs_modification); +} + +cJSON *OpenAPI_sdm_subs_modification_convertToJSON(OpenAPI_sdm_subs_modification_t *sdm_subs_modification) +{ + cJSON *item = NULL; + + if (sdm_subs_modification == NULL) { + ogs_error("OpenAPI_sdm_subs_modification_convertToJSON() failed [SdmSubsModification]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (sdm_subs_modification->expires) { + if (cJSON_AddStringToObject(item, "expires", sdm_subs_modification->expires) == NULL) { + ogs_error("OpenAPI_sdm_subs_modification_convertToJSON() failed [expires]"); + goto end; + } + } + + if (sdm_subs_modification->monitored_resource_uris) { + cJSON *monitored_resource_uris = cJSON_AddArrayToObject(item, "monitoredResourceUris"); + if (monitored_resource_uris == NULL) { + ogs_error("OpenAPI_sdm_subs_modification_convertToJSON() failed [monitored_resource_uris]"); + goto end; + } + + OpenAPI_lnode_t *monitored_resource_uris_node; + OpenAPI_list_for_each(sdm_subs_modification->monitored_resource_uris, monitored_resource_uris_node) { + if (cJSON_AddStringToObject(monitored_resource_uris, "", (char*)monitored_resource_uris_node->data) == NULL) { + ogs_error("OpenAPI_sdm_subs_modification_convertToJSON() failed [monitored_resource_uris]"); + goto end; + } + } + } + +end: + return item; +} + +OpenAPI_sdm_subs_modification_t *OpenAPI_sdm_subs_modification_parseFromJSON(cJSON *sdm_subs_modificationJSON) +{ + OpenAPI_sdm_subs_modification_t *sdm_subs_modification_local_var = NULL; + cJSON *expires = cJSON_GetObjectItemCaseSensitive(sdm_subs_modificationJSON, "expires"); + + if (expires) { + if (!cJSON_IsString(expires)) { + ogs_error("OpenAPI_sdm_subs_modification_parseFromJSON() failed [expires]"); + goto end; + } + } + + cJSON *monitored_resource_uris = cJSON_GetObjectItemCaseSensitive(sdm_subs_modificationJSON, "monitoredResourceUris"); + + OpenAPI_list_t *monitored_resource_urisList; + if (monitored_resource_uris) { + cJSON *monitored_resource_uris_local; + if (!cJSON_IsArray(monitored_resource_uris)) { + ogs_error("OpenAPI_sdm_subs_modification_parseFromJSON() failed [monitored_resource_uris]"); + goto end; + } + monitored_resource_urisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(monitored_resource_uris_local, monitored_resource_uris) { + if (!cJSON_IsString(monitored_resource_uris_local)) { + ogs_error("OpenAPI_sdm_subs_modification_parseFromJSON() failed [monitored_resource_uris]"); + goto end; + } + OpenAPI_list_add(monitored_resource_urisList, ogs_strdup(monitored_resource_uris_local->valuestring)); + } + } + + sdm_subs_modification_local_var = OpenAPI_sdm_subs_modification_create ( + expires ? ogs_strdup(expires->valuestring) : NULL, + monitored_resource_uris ? monitored_resource_urisList : NULL + ); + + return sdm_subs_modification_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/sdm_subs_modification.h b/lib/sbi/openapi/model/sdm_subs_modification.h new file mode 100644 index 0000000000..4049404f5e --- /dev/null +++ b/lib/sbi/openapi/model/sdm_subs_modification.h @@ -0,0 +1,39 @@ +/* + * sdm_subs_modification.h + * + * + */ + +#ifndef _OpenAPI_sdm_subs_modification_H_ +#define _OpenAPI_sdm_subs_modification_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_sdm_subs_modification_s OpenAPI_sdm_subs_modification_t; +typedef struct OpenAPI_sdm_subs_modification_s { + char *expires; + OpenAPI_list_t *monitored_resource_uris; +} OpenAPI_sdm_subs_modification_t; + +OpenAPI_sdm_subs_modification_t *OpenAPI_sdm_subs_modification_create( + char *expires, + OpenAPI_list_t *monitored_resource_uris + ); +void OpenAPI_sdm_subs_modification_free(OpenAPI_sdm_subs_modification_t *sdm_subs_modification); +OpenAPI_sdm_subs_modification_t *OpenAPI_sdm_subs_modification_parseFromJSON(cJSON *sdm_subs_modificationJSON); +cJSON *OpenAPI_sdm_subs_modification_convertToJSON(OpenAPI_sdm_subs_modification_t *sdm_subs_modification); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_sdm_subs_modification_H_ */ + diff --git a/lib/sbi/openapi/model/sdm_subscription.c b/lib/sbi/openapi/model/sdm_subscription.c new file mode 100644 index 0000000000..0a644929a8 --- /dev/null +++ b/lib/sbi/openapi/model/sdm_subscription.c @@ -0,0 +1,339 @@ + +#include +#include +#include +#include "sdm_subscription.h" + +OpenAPI_sdm_subscription_t *OpenAPI_sdm_subscription_create( + char *nf_instance_id, + int implicit_unsubscribe, + char *expires, + char *callback_reference, + char *amf_service_name, + OpenAPI_list_t *monitored_resource_uris, + OpenAPI_snssai_t *single_nssai, + char *dnn, + char *subscription_id, + OpenAPI_plmn_id_t *plmn_id, + int immediate_report, + OpenAPI_subscription_data_sets_t *report + ) +{ + OpenAPI_sdm_subscription_t *sdm_subscription_local_var = OpenAPI_malloc(sizeof(OpenAPI_sdm_subscription_t)); + if (!sdm_subscription_local_var) { + return NULL; + } + sdm_subscription_local_var->nf_instance_id = nf_instance_id; + sdm_subscription_local_var->implicit_unsubscribe = implicit_unsubscribe; + sdm_subscription_local_var->expires = expires; + sdm_subscription_local_var->callback_reference = callback_reference; + sdm_subscription_local_var->amf_service_name = amf_service_name; + sdm_subscription_local_var->monitored_resource_uris = monitored_resource_uris; + sdm_subscription_local_var->single_nssai = single_nssai; + sdm_subscription_local_var->dnn = dnn; + sdm_subscription_local_var->subscription_id = subscription_id; + sdm_subscription_local_var->plmn_id = plmn_id; + sdm_subscription_local_var->immediate_report = immediate_report; + sdm_subscription_local_var->report = report; + + return sdm_subscription_local_var; +} + +void OpenAPI_sdm_subscription_free(OpenAPI_sdm_subscription_t *sdm_subscription) +{ + if (NULL == sdm_subscription) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(sdm_subscription->nf_instance_id); + ogs_free(sdm_subscription->expires); + ogs_free(sdm_subscription->callback_reference); + ogs_free(sdm_subscription->amf_service_name); + OpenAPI_list_for_each(sdm_subscription->monitored_resource_uris, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sdm_subscription->monitored_resource_uris); + OpenAPI_snssai_free(sdm_subscription->single_nssai); + ogs_free(sdm_subscription->dnn); + ogs_free(sdm_subscription->subscription_id); + OpenAPI_plmn_id_free(sdm_subscription->plmn_id); + OpenAPI_subscription_data_sets_free(sdm_subscription->report); + ogs_free(sdm_subscription); +} + +cJSON *OpenAPI_sdm_subscription_convertToJSON(OpenAPI_sdm_subscription_t *sdm_subscription) +{ + cJSON *item = NULL; + + if (sdm_subscription == NULL) { + ogs_error("OpenAPI_sdm_subscription_convertToJSON() failed [SdmSubscription]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!sdm_subscription->nf_instance_id) { + ogs_error("OpenAPI_sdm_subscription_convertToJSON() failed [nf_instance_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "nfInstanceId", sdm_subscription->nf_instance_id) == NULL) { + ogs_error("OpenAPI_sdm_subscription_convertToJSON() failed [nf_instance_id]"); + goto end; + } + + if (sdm_subscription->implicit_unsubscribe >= 0) { + if (cJSON_AddBoolToObject(item, "implicitUnsubscribe", sdm_subscription->implicit_unsubscribe) == NULL) { + ogs_error("OpenAPI_sdm_subscription_convertToJSON() failed [implicit_unsubscribe]"); + goto end; + } + } + + if (sdm_subscription->expires) { + if (cJSON_AddStringToObject(item, "expires", sdm_subscription->expires) == NULL) { + ogs_error("OpenAPI_sdm_subscription_convertToJSON() failed [expires]"); + goto end; + } + } + + if (!sdm_subscription->callback_reference) { + ogs_error("OpenAPI_sdm_subscription_convertToJSON() failed [callback_reference]"); + goto end; + } + if (cJSON_AddStringToObject(item, "callbackReference", sdm_subscription->callback_reference) == NULL) { + ogs_error("OpenAPI_sdm_subscription_convertToJSON() failed [callback_reference]"); + goto end; + } + + if (sdm_subscription->amf_service_name) { + if (cJSON_AddStringToObject(item, "amfServiceName", sdm_subscription->amf_service_name) == NULL) { + ogs_error("OpenAPI_sdm_subscription_convertToJSON() failed [amf_service_name]"); + goto end; + } + } + + if (!sdm_subscription->monitored_resource_uris) { + ogs_error("OpenAPI_sdm_subscription_convertToJSON() failed [monitored_resource_uris]"); + goto end; + } + cJSON *monitored_resource_uris = cJSON_AddArrayToObject(item, "monitoredResourceUris"); + if (monitored_resource_uris == NULL) { + ogs_error("OpenAPI_sdm_subscription_convertToJSON() failed [monitored_resource_uris]"); + goto end; + } + + OpenAPI_lnode_t *monitored_resource_uris_node; + OpenAPI_list_for_each(sdm_subscription->monitored_resource_uris, monitored_resource_uris_node) { + if (cJSON_AddStringToObject(monitored_resource_uris, "", (char*)monitored_resource_uris_node->data) == NULL) { + ogs_error("OpenAPI_sdm_subscription_convertToJSON() failed [monitored_resource_uris]"); + goto end; + } + } + + if (sdm_subscription->single_nssai) { + cJSON *single_nssai_local_JSON = OpenAPI_snssai_convertToJSON(sdm_subscription->single_nssai); + if (single_nssai_local_JSON == NULL) { + ogs_error("OpenAPI_sdm_subscription_convertToJSON() failed [single_nssai]"); + goto end; + } + cJSON_AddItemToObject(item, "singleNssai", single_nssai_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_sdm_subscription_convertToJSON() failed [single_nssai]"); + goto end; + } + } + + if (sdm_subscription->dnn) { + if (cJSON_AddStringToObject(item, "dnn", sdm_subscription->dnn) == NULL) { + ogs_error("OpenAPI_sdm_subscription_convertToJSON() failed [dnn]"); + goto end; + } + } + + if (sdm_subscription->subscription_id) { + if (cJSON_AddStringToObject(item, "subscriptionId", sdm_subscription->subscription_id) == NULL) { + ogs_error("OpenAPI_sdm_subscription_convertToJSON() failed [subscription_id]"); + goto end; + } + } + + if (sdm_subscription->plmn_id) { + cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_convertToJSON(sdm_subscription->plmn_id); + if (plmn_id_local_JSON == NULL) { + ogs_error("OpenAPI_sdm_subscription_convertToJSON() failed [plmn_id]"); + goto end; + } + cJSON_AddItemToObject(item, "plmnId", plmn_id_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_sdm_subscription_convertToJSON() failed [plmn_id]"); + goto end; + } + } + + if (sdm_subscription->immediate_report >= 0) { + if (cJSON_AddBoolToObject(item, "immediateReport", sdm_subscription->immediate_report) == NULL) { + ogs_error("OpenAPI_sdm_subscription_convertToJSON() failed [immediate_report]"); + goto end; + } + } + + if (sdm_subscription->report) { + cJSON *report_local_JSON = OpenAPI_subscription_data_sets_convertToJSON(sdm_subscription->report); + if (report_local_JSON == NULL) { + ogs_error("OpenAPI_sdm_subscription_convertToJSON() failed [report]"); + goto end; + } + cJSON_AddItemToObject(item, "report", report_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_sdm_subscription_convertToJSON() failed [report]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_sdm_subscription_t *OpenAPI_sdm_subscription_parseFromJSON(cJSON *sdm_subscriptionJSON) +{ + OpenAPI_sdm_subscription_t *sdm_subscription_local_var = NULL; + cJSON *nf_instance_id = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "nfInstanceId"); + if (!nf_instance_id) { + ogs_error("OpenAPI_sdm_subscription_parseFromJSON() failed [nf_instance_id]"); + goto end; + } + + + if (!cJSON_IsString(nf_instance_id)) { + ogs_error("OpenAPI_sdm_subscription_parseFromJSON() failed [nf_instance_id]"); + goto end; + } + + cJSON *implicit_unsubscribe = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "implicitUnsubscribe"); + + if (implicit_unsubscribe) { + if (!cJSON_IsBool(implicit_unsubscribe)) { + ogs_error("OpenAPI_sdm_subscription_parseFromJSON() failed [implicit_unsubscribe]"); + goto end; + } + } + + cJSON *expires = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "expires"); + + if (expires) { + if (!cJSON_IsString(expires)) { + ogs_error("OpenAPI_sdm_subscription_parseFromJSON() failed [expires]"); + goto end; + } + } + + cJSON *callback_reference = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "callbackReference"); + if (!callback_reference) { + ogs_error("OpenAPI_sdm_subscription_parseFromJSON() failed [callback_reference]"); + goto end; + } + + + if (!cJSON_IsString(callback_reference)) { + ogs_error("OpenAPI_sdm_subscription_parseFromJSON() failed [callback_reference]"); + goto end; + } + + cJSON *amf_service_name = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "amfServiceName"); + + if (amf_service_name) { + if (!cJSON_IsString(amf_service_name)) { + ogs_error("OpenAPI_sdm_subscription_parseFromJSON() failed [amf_service_name]"); + goto end; + } + } + + cJSON *monitored_resource_uris = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "monitoredResourceUris"); + if (!monitored_resource_uris) { + ogs_error("OpenAPI_sdm_subscription_parseFromJSON() failed [monitored_resource_uris]"); + goto end; + } + + OpenAPI_list_t *monitored_resource_urisList; + + cJSON *monitored_resource_uris_local; + if (!cJSON_IsArray(monitored_resource_uris)) { + ogs_error("OpenAPI_sdm_subscription_parseFromJSON() failed [monitored_resource_uris]"); + goto end; + } + monitored_resource_urisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(monitored_resource_uris_local, monitored_resource_uris) { + if (!cJSON_IsString(monitored_resource_uris_local)) { + ogs_error("OpenAPI_sdm_subscription_parseFromJSON() failed [monitored_resource_uris]"); + goto end; + } + OpenAPI_list_add(monitored_resource_urisList, ogs_strdup(monitored_resource_uris_local->valuestring)); + } + + cJSON *single_nssai = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "singleNssai"); + + OpenAPI_snssai_t *single_nssai_local_nonprim = NULL; + if (single_nssai) { + single_nssai_local_nonprim = OpenAPI_snssai_parseFromJSON(single_nssai); + } + + cJSON *dnn = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "dnn"); + + if (dnn) { + if (!cJSON_IsString(dnn)) { + ogs_error("OpenAPI_sdm_subscription_parseFromJSON() failed [dnn]"); + goto end; + } + } + + cJSON *subscription_id = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "subscriptionId"); + + if (subscription_id) { + if (!cJSON_IsString(subscription_id)) { + ogs_error("OpenAPI_sdm_subscription_parseFromJSON() failed [subscription_id]"); + goto end; + } + } + + cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "plmnId"); + + OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + if (plmn_id) { + plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); + } + + cJSON *immediate_report = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "immediateReport"); + + if (immediate_report) { + if (!cJSON_IsBool(immediate_report)) { + ogs_error("OpenAPI_sdm_subscription_parseFromJSON() failed [immediate_report]"); + goto end; + } + } + + cJSON *report = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "report"); + + OpenAPI_subscription_data_sets_t *report_local_nonprim = NULL; + if (report) { + report_local_nonprim = OpenAPI_subscription_data_sets_parseFromJSON(report); + } + + sdm_subscription_local_var = OpenAPI_sdm_subscription_create ( + ogs_strdup(nf_instance_id->valuestring), + implicit_unsubscribe ? implicit_unsubscribe->valueint : 0, + expires ? ogs_strdup(expires->valuestring) : NULL, + ogs_strdup(callback_reference->valuestring), + amf_service_name ? ogs_strdup(amf_service_name->valuestring) : NULL, + monitored_resource_urisList, + single_nssai ? single_nssai_local_nonprim : NULL, + dnn ? ogs_strdup(dnn->valuestring) : NULL, + subscription_id ? ogs_strdup(subscription_id->valuestring) : NULL, + plmn_id ? plmn_id_local_nonprim : NULL, + immediate_report ? immediate_report->valueint : 0, + report ? report_local_nonprim : NULL + ); + + return sdm_subscription_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/sdm_subscription.h b/lib/sbi/openapi/model/sdm_subscription.h new file mode 100644 index 0000000000..ad924e3ebd --- /dev/null +++ b/lib/sbi/openapi/model/sdm_subscription.h @@ -0,0 +1,62 @@ +/* + * sdm_subscription.h + * + * + */ + +#ifndef _OpenAPI_sdm_subscription_H_ +#define _OpenAPI_sdm_subscription_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "plmn_id.h" +#include "snssai.h" +#include "subscription_data_sets.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_sdm_subscription_s OpenAPI_sdm_subscription_t; +typedef struct OpenAPI_sdm_subscription_s { + char *nf_instance_id; + int implicit_unsubscribe; + char *expires; + char *callback_reference; + char *amf_service_name; + OpenAPI_list_t *monitored_resource_uris; + struct OpenAPI_snssai_s *single_nssai; + char *dnn; + char *subscription_id; + struct OpenAPI_plmn_id_s *plmn_id; + int immediate_report; + struct OpenAPI_subscription_data_sets_s *report; +} OpenAPI_sdm_subscription_t; + +OpenAPI_sdm_subscription_t *OpenAPI_sdm_subscription_create( + char *nf_instance_id, + int implicit_unsubscribe, + char *expires, + char *callback_reference, + char *amf_service_name, + OpenAPI_list_t *monitored_resource_uris, + OpenAPI_snssai_t *single_nssai, + char *dnn, + char *subscription_id, + OpenAPI_plmn_id_t *plmn_id, + int immediate_report, + OpenAPI_subscription_data_sets_t *report + ); +void OpenAPI_sdm_subscription_free(OpenAPI_sdm_subscription_t *sdm_subscription); +OpenAPI_sdm_subscription_t *OpenAPI_sdm_subscription_parseFromJSON(cJSON *sdm_subscriptionJSON); +cJSON *OpenAPI_sdm_subscription_convertToJSON(OpenAPI_sdm_subscription_t *sdm_subscription); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_sdm_subscription_H_ */ + diff --git a/lib/sbi/openapi/model/search_result.c b/lib/sbi/openapi/model/search_result.c index 69b5a3df42..4a1d48e5f1 100644 --- a/lib/sbi/openapi/model/search_result.c +++ b/lib/sbi/openapi/model/search_result.c @@ -9,6 +9,7 @@ OpenAPI_search_result_t *OpenAPI_search_result_create( OpenAPI_list_t *nf_instances, char *search_id, int num_nf_inst_complete, + OpenAPI_preferred_search_t *preferred_search, char *nrf_supported_features ) { @@ -20,6 +21,7 @@ OpenAPI_search_result_t *OpenAPI_search_result_create( search_result_local_var->nf_instances = nf_instances; search_result_local_var->search_id = search_id; search_result_local_var->num_nf_inst_complete = num_nf_inst_complete; + search_result_local_var->preferred_search = preferred_search; search_result_local_var->nrf_supported_features = nrf_supported_features; return search_result_local_var; @@ -36,6 +38,7 @@ void OpenAPI_search_result_free(OpenAPI_search_result_t *search_result) } OpenAPI_list_free(search_result->nf_instances); ogs_free(search_result->search_id); + OpenAPI_preferred_search_free(search_result->preferred_search); ogs_free(search_result->nrf_supported_features); ogs_free(search_result); } @@ -93,6 +96,19 @@ cJSON *OpenAPI_search_result_convertToJSON(OpenAPI_search_result_t *search_resul } } + if (search_result->preferred_search) { + cJSON *preferred_search_local_JSON = OpenAPI_preferred_search_convertToJSON(search_result->preferred_search); + if (preferred_search_local_JSON == NULL) { + ogs_error("OpenAPI_search_result_convertToJSON() failed [preferred_search]"); + goto end; + } + cJSON_AddItemToObject(item, "preferredSearch", preferred_search_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_search_result_convertToJSON() failed [preferred_search]"); + goto end; + } + } + if (search_result->nrf_supported_features) { if (cJSON_AddStringToObject(item, "nrfSupportedFeatures", search_result->nrf_supported_features) == NULL) { ogs_error("OpenAPI_search_result_convertToJSON() failed [nrf_supported_features]"); @@ -160,6 +176,13 @@ OpenAPI_search_result_t *OpenAPI_search_result_parseFromJSON(cJSON *search_resul } } + cJSON *preferred_search = cJSON_GetObjectItemCaseSensitive(search_resultJSON, "preferredSearch"); + + OpenAPI_preferred_search_t *preferred_search_local_nonprim = NULL; + if (preferred_search) { + preferred_search_local_nonprim = OpenAPI_preferred_search_parseFromJSON(preferred_search); + } + cJSON *nrf_supported_features = cJSON_GetObjectItemCaseSensitive(search_resultJSON, "nrfSupportedFeatures"); if (nrf_supported_features) { @@ -174,6 +197,7 @@ OpenAPI_search_result_t *OpenAPI_search_result_parseFromJSON(cJSON *search_resul nf_instancesList, search_id ? ogs_strdup(search_id->valuestring) : NULL, num_nf_inst_complete ? num_nf_inst_complete->valuedouble : 0, + preferred_search ? preferred_search_local_nonprim : NULL, nrf_supported_features ? ogs_strdup(nrf_supported_features->valuestring) : NULL ); diff --git a/lib/sbi/openapi/model/search_result.h b/lib/sbi/openapi/model/search_result.h index c32bf680a8..4609fb32a3 100644 --- a/lib/sbi/openapi/model/search_result.h +++ b/lib/sbi/openapi/model/search_result.h @@ -1,7 +1,7 @@ /* * search_result.h * - * + * Contains the list of NF Profiles returned in a Discovery response */ #ifndef _OpenAPI_search_result_H_ @@ -13,6 +13,7 @@ #include "../include/keyValuePair.h" #include "../include/binary.h" #include "nf_profile.h" +#include "preferred_search.h" #ifdef __cplusplus extern "C" { @@ -24,6 +25,7 @@ typedef struct OpenAPI_search_result_s { OpenAPI_list_t *nf_instances; char *search_id; int num_nf_inst_complete; + struct OpenAPI_preferred_search_s *preferred_search; char *nrf_supported_features; } OpenAPI_search_result_t; @@ -32,6 +34,7 @@ OpenAPI_search_result_t *OpenAPI_search_result_create( OpenAPI_list_t *nf_instances, char *search_id, int num_nf_inst_complete, + OpenAPI_preferred_search_t *preferred_search, char *nrf_supported_features ); void OpenAPI_search_result_free(OpenAPI_search_result_t *search_result); diff --git a/lib/sbi/openapi/model/sequence_number.c b/lib/sbi/openapi/model/sequence_number.c new file mode 100644 index 0000000000..df9b48ddfa --- /dev/null +++ b/lib/sbi/openapi/model/sequence_number.c @@ -0,0 +1,173 @@ + +#include +#include +#include +#include "sequence_number.h" + +OpenAPI_sequence_number_t *OpenAPI_sequence_number_create( + OpenAPI_sqn_scheme_e sqn_scheme, + char *sqn, + OpenAPI_list_t* last_indexes, + int ind_length, + OpenAPI_sign_e dif_sign + ) +{ + OpenAPI_sequence_number_t *sequence_number_local_var = OpenAPI_malloc(sizeof(OpenAPI_sequence_number_t)); + if (!sequence_number_local_var) { + return NULL; + } + sequence_number_local_var->sqn_scheme = sqn_scheme; + sequence_number_local_var->sqn = sqn; + sequence_number_local_var->last_indexes = last_indexes; + sequence_number_local_var->ind_length = ind_length; + sequence_number_local_var->dif_sign = dif_sign; + + return sequence_number_local_var; +} + +void OpenAPI_sequence_number_free(OpenAPI_sequence_number_t *sequence_number) +{ + if (NULL == sequence_number) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(sequence_number->sqn); + OpenAPI_list_for_each(sequence_number->last_indexes, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(sequence_number->last_indexes); + ogs_free(sequence_number); +} + +cJSON *OpenAPI_sequence_number_convertToJSON(OpenAPI_sequence_number_t *sequence_number) +{ + cJSON *item = NULL; + + if (sequence_number == NULL) { + ogs_error("OpenAPI_sequence_number_convertToJSON() failed [SequenceNumber]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (sequence_number->sqn_scheme) { + if (cJSON_AddStringToObject(item, "sqnScheme", OpenAPI_sqn_scheme_ToString(sequence_number->sqn_scheme)) == NULL) { + ogs_error("OpenAPI_sequence_number_convertToJSON() failed [sqn_scheme]"); + goto end; + } + } + + if (sequence_number->sqn) { + if (cJSON_AddStringToObject(item, "sqn", sequence_number->sqn) == NULL) { + ogs_error("OpenAPI_sequence_number_convertToJSON() failed [sqn]"); + goto end; + } + } + + if (sequence_number->last_indexes) { + cJSON *last_indexes = cJSON_AddObjectToObject(item, "lastIndexes"); + if (last_indexes == NULL) { + ogs_error("OpenAPI_sequence_number_convertToJSON() failed [last_indexes]"); + goto end; + } + cJSON *localMapObject = last_indexes; + OpenAPI_lnode_t *last_indexes_node; + if (sequence_number->last_indexes) { + OpenAPI_list_for_each(sequence_number->last_indexes, last_indexes_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)last_indexes_node->data; + } + } + } + + if (sequence_number->ind_length) { + if (cJSON_AddNumberToObject(item, "indLength", sequence_number->ind_length) == NULL) { + ogs_error("OpenAPI_sequence_number_convertToJSON() failed [ind_length]"); + goto end; + } + } + + if (sequence_number->dif_sign) { + if (cJSON_AddStringToObject(item, "difSign", OpenAPI_sign_ToString(sequence_number->dif_sign)) == NULL) { + ogs_error("OpenAPI_sequence_number_convertToJSON() failed [dif_sign]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_sequence_number_t *OpenAPI_sequence_number_parseFromJSON(cJSON *sequence_numberJSON) +{ + OpenAPI_sequence_number_t *sequence_number_local_var = NULL; + cJSON *sqn_scheme = cJSON_GetObjectItemCaseSensitive(sequence_numberJSON, "sqnScheme"); + + OpenAPI_sqn_scheme_e sqn_schemeVariable; + if (sqn_scheme) { + if (!cJSON_IsString(sqn_scheme)) { + ogs_error("OpenAPI_sequence_number_parseFromJSON() failed [sqn_scheme]"); + goto end; + } + sqn_schemeVariable = OpenAPI_sqn_scheme_FromString(sqn_scheme->valuestring); + } + + cJSON *sqn = cJSON_GetObjectItemCaseSensitive(sequence_numberJSON, "sqn"); + + if (sqn) { + if (!cJSON_IsString(sqn)) { + ogs_error("OpenAPI_sequence_number_parseFromJSON() failed [sqn]"); + goto end; + } + } + + cJSON *last_indexes = cJSON_GetObjectItemCaseSensitive(sequence_numberJSON, "lastIndexes"); + + OpenAPI_list_t *last_indexesList; + if (last_indexes) { + cJSON *last_indexes_local_map; + if (!cJSON_IsObject(last_indexes)) { + ogs_error("OpenAPI_sequence_number_parseFromJSON() failed [last_indexes]"); + goto end; + } + last_indexesList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(last_indexes_local_map, last_indexes) { + cJSON *localMapObject = last_indexes_local_map; + OpenAPI_list_add(last_indexesList, localMapKeyPair); + } + } + + cJSON *ind_length = cJSON_GetObjectItemCaseSensitive(sequence_numberJSON, "indLength"); + + if (ind_length) { + if (!cJSON_IsNumber(ind_length)) { + ogs_error("OpenAPI_sequence_number_parseFromJSON() failed [ind_length]"); + goto end; + } + } + + cJSON *dif_sign = cJSON_GetObjectItemCaseSensitive(sequence_numberJSON, "difSign"); + + OpenAPI_sign_e dif_signVariable; + if (dif_sign) { + if (!cJSON_IsString(dif_sign)) { + ogs_error("OpenAPI_sequence_number_parseFromJSON() failed [dif_sign]"); + goto end; + } + dif_signVariable = OpenAPI_sign_FromString(dif_sign->valuestring); + } + + sequence_number_local_var = OpenAPI_sequence_number_create ( + sqn_scheme ? sqn_schemeVariable : 0, + sqn ? ogs_strdup(sqn->valuestring) : NULL, + last_indexes ? last_indexesList : NULL, + ind_length ? ind_length->valuedouble : 0, + dif_sign ? dif_signVariable : 0 + ); + + return sequence_number_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/sequence_number.h b/lib/sbi/openapi/model/sequence_number.h new file mode 100644 index 0000000000..aba2899339 --- /dev/null +++ b/lib/sbi/openapi/model/sequence_number.h @@ -0,0 +1,47 @@ +/* + * sequence_number.h + * + * + */ + +#ifndef _OpenAPI_sequence_number_H_ +#define _OpenAPI_sequence_number_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "sign.h" +#include "sqn_scheme.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_sequence_number_s OpenAPI_sequence_number_t; +typedef struct OpenAPI_sequence_number_s { + OpenAPI_sqn_scheme_e sqn_scheme; + char *sqn; + OpenAPI_list_t* last_indexes; + int ind_length; + OpenAPI_sign_e dif_sign; +} OpenAPI_sequence_number_t; + +OpenAPI_sequence_number_t *OpenAPI_sequence_number_create( + OpenAPI_sqn_scheme_e sqn_scheme, + char *sqn, + OpenAPI_list_t* last_indexes, + int ind_length, + OpenAPI_sign_e dif_sign + ); +void OpenAPI_sequence_number_free(OpenAPI_sequence_number_t *sequence_number); +OpenAPI_sequence_number_t *OpenAPI_sequence_number_parseFromJSON(cJSON *sequence_numberJSON); +cJSON *OpenAPI_sequence_number_convertToJSON(OpenAPI_sequence_number_t *sequence_number); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_sequence_number_H_ */ + diff --git a/lib/sbi/openapi/model/service_application_server_address.c b/lib/sbi/openapi/model/service_application_server_address.c new file mode 100644 index 0000000000..708342de2b --- /dev/null +++ b/lib/sbi/openapi/model/service_application_server_address.c @@ -0,0 +1,366 @@ + +#include +#include +#include +#include "service_application_server_address.h" + +OpenAPI_service_application_server_address_t *OpenAPI_service_application_server_address_create( + OpenAPI_list_t *ser_ids, + char *fqdn, + OpenAPI_list_t *ipv4_addrs, + OpenAPI_list_t *ipv6_addrs, + OpenAPI_list_t *udp_port_numbers, + OpenAPI_list_t *tcp_port_numbers, + OpenAPI_list_t *plmns, + char *geopraphical_area + ) +{ + OpenAPI_service_application_server_address_t *service_application_server_address_local_var = OpenAPI_malloc(sizeof(OpenAPI_service_application_server_address_t)); + if (!service_application_server_address_local_var) { + return NULL; + } + service_application_server_address_local_var->ser_ids = ser_ids; + service_application_server_address_local_var->fqdn = fqdn; + service_application_server_address_local_var->ipv4_addrs = ipv4_addrs; + service_application_server_address_local_var->ipv6_addrs = ipv6_addrs; + service_application_server_address_local_var->udp_port_numbers = udp_port_numbers; + service_application_server_address_local_var->tcp_port_numbers = tcp_port_numbers; + service_application_server_address_local_var->plmns = plmns; + service_application_server_address_local_var->geopraphical_area = geopraphical_area; + + return service_application_server_address_local_var; +} + +void OpenAPI_service_application_server_address_free(OpenAPI_service_application_server_address_t *service_application_server_address) +{ + if (NULL == service_application_server_address) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(service_application_server_address->ser_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(service_application_server_address->ser_ids); + ogs_free(service_application_server_address->fqdn); + OpenAPI_list_for_each(service_application_server_address->ipv4_addrs, node) { + ogs_free(node->data); + } + OpenAPI_list_free(service_application_server_address->ipv4_addrs); + OpenAPI_list_for_each(service_application_server_address->ipv6_addrs, node) { + ogs_free(node->data); + } + OpenAPI_list_free(service_application_server_address->ipv6_addrs); + OpenAPI_list_for_each(service_application_server_address->udp_port_numbers, node) { + ogs_free(node->data); + } + OpenAPI_list_free(service_application_server_address->udp_port_numbers); + OpenAPI_list_for_each(service_application_server_address->tcp_port_numbers, node) { + ogs_free(node->data); + } + OpenAPI_list_free(service_application_server_address->tcp_port_numbers); + OpenAPI_list_for_each(service_application_server_address->plmns, node) { + OpenAPI_plmn_id_free(node->data); + } + OpenAPI_list_free(service_application_server_address->plmns); + ogs_free(service_application_server_address->geopraphical_area); + ogs_free(service_application_server_address); +} + +cJSON *OpenAPI_service_application_server_address_convertToJSON(OpenAPI_service_application_server_address_t *service_application_server_address) +{ + cJSON *item = NULL; + + if (service_application_server_address == NULL) { + ogs_error("OpenAPI_service_application_server_address_convertToJSON() failed [ServiceApplicationServerAddress]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!service_application_server_address->ser_ids) { + ogs_error("OpenAPI_service_application_server_address_convertToJSON() failed [ser_ids]"); + goto end; + } + cJSON *ser_ids = cJSON_AddArrayToObject(item, "serIds"); + if (ser_ids == NULL) { + ogs_error("OpenAPI_service_application_server_address_convertToJSON() failed [ser_ids]"); + goto end; + } + + OpenAPI_lnode_t *ser_ids_node; + OpenAPI_list_for_each(service_application_server_address->ser_ids, ser_ids_node) { + if (cJSON_AddStringToObject(ser_ids, "", (char*)ser_ids_node->data) == NULL) { + ogs_error("OpenAPI_service_application_server_address_convertToJSON() failed [ser_ids]"); + goto end; + } + } + + if (service_application_server_address->fqdn) { + if (cJSON_AddStringToObject(item, "fqdn", service_application_server_address->fqdn) == NULL) { + ogs_error("OpenAPI_service_application_server_address_convertToJSON() failed [fqdn]"); + goto end; + } + } + + if (service_application_server_address->ipv4_addrs) { + cJSON *ipv4_addrs = cJSON_AddArrayToObject(item, "Ipv4Addrs"); + if (ipv4_addrs == NULL) { + ogs_error("OpenAPI_service_application_server_address_convertToJSON() failed [ipv4_addrs]"); + goto end; + } + + OpenAPI_lnode_t *ipv4_addrs_node; + OpenAPI_list_for_each(service_application_server_address->ipv4_addrs, ipv4_addrs_node) { + if (cJSON_AddStringToObject(ipv4_addrs, "", (char*)ipv4_addrs_node->data) == NULL) { + ogs_error("OpenAPI_service_application_server_address_convertToJSON() failed [ipv4_addrs]"); + goto end; + } + } + } + + if (service_application_server_address->ipv6_addrs) { + cJSON *ipv6_addrs = cJSON_AddArrayToObject(item, "Ipv6Addrs"); + if (ipv6_addrs == NULL) { + ogs_error("OpenAPI_service_application_server_address_convertToJSON() failed [ipv6_addrs]"); + goto end; + } + + OpenAPI_lnode_t *ipv6_addrs_node; + OpenAPI_list_for_each(service_application_server_address->ipv6_addrs, ipv6_addrs_node) { + if (cJSON_AddStringToObject(ipv6_addrs, "", (char*)ipv6_addrs_node->data) == NULL) { + ogs_error("OpenAPI_service_application_server_address_convertToJSON() failed [ipv6_addrs]"); + goto end; + } + } + } + + if (service_application_server_address->udp_port_numbers) { + cJSON *udp_port_numbers = cJSON_AddArrayToObject(item, "udpPortNumbers"); + if (udp_port_numbers == NULL) { + ogs_error("OpenAPI_service_application_server_address_convertToJSON() failed [udp_port_numbers]"); + goto end; + } + + OpenAPI_lnode_t *udp_port_numbers_node; + OpenAPI_list_for_each(service_application_server_address->udp_port_numbers, udp_port_numbers_node) { + if (cJSON_AddNumberToObject(udp_port_numbers, "", *(double *)udp_port_numbers_node->data) == NULL) { + ogs_error("OpenAPI_service_application_server_address_convertToJSON() failed [udp_port_numbers]"); + goto end; + } + } + } + + if (service_application_server_address->tcp_port_numbers) { + cJSON *tcp_port_numbers = cJSON_AddArrayToObject(item, "tcpPortNumbers"); + if (tcp_port_numbers == NULL) { + ogs_error("OpenAPI_service_application_server_address_convertToJSON() failed [tcp_port_numbers]"); + goto end; + } + + OpenAPI_lnode_t *tcp_port_numbers_node; + OpenAPI_list_for_each(service_application_server_address->tcp_port_numbers, tcp_port_numbers_node) { + if (cJSON_AddNumberToObject(tcp_port_numbers, "", *(double *)tcp_port_numbers_node->data) == NULL) { + ogs_error("OpenAPI_service_application_server_address_convertToJSON() failed [tcp_port_numbers]"); + goto end; + } + } + } + + if (!service_application_server_address->plmns) { + ogs_error("OpenAPI_service_application_server_address_convertToJSON() failed [plmns]"); + goto end; + } + cJSON *plmnsList = cJSON_AddArrayToObject(item, "plmns"); + if (plmnsList == NULL) { + ogs_error("OpenAPI_service_application_server_address_convertToJSON() failed [plmns]"); + goto end; + } + + OpenAPI_lnode_t *plmns_node; + if (service_application_server_address->plmns) { + OpenAPI_list_for_each(service_application_server_address->plmns, plmns_node) { + cJSON *itemLocal = OpenAPI_plmn_id_convertToJSON(plmns_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_service_application_server_address_convertToJSON() failed [plmns]"); + goto end; + } + cJSON_AddItemToArray(plmnsList, itemLocal); + } + } + + if (service_application_server_address->geopraphical_area) { + if (cJSON_AddStringToObject(item, "geopraphicalArea", service_application_server_address->geopraphical_area) == NULL) { + ogs_error("OpenAPI_service_application_server_address_convertToJSON() failed [geopraphical_area]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_service_application_server_address_t *OpenAPI_service_application_server_address_parseFromJSON(cJSON *service_application_server_addressJSON) +{ + OpenAPI_service_application_server_address_t *service_application_server_address_local_var = NULL; + cJSON *ser_ids = cJSON_GetObjectItemCaseSensitive(service_application_server_addressJSON, "serIds"); + if (!ser_ids) { + ogs_error("OpenAPI_service_application_server_address_parseFromJSON() failed [ser_ids]"); + goto end; + } + + OpenAPI_list_t *ser_idsList; + + cJSON *ser_ids_local; + if (!cJSON_IsArray(ser_ids)) { + ogs_error("OpenAPI_service_application_server_address_parseFromJSON() failed [ser_ids]"); + goto end; + } + ser_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ser_ids_local, ser_ids) { + if (!cJSON_IsString(ser_ids_local)) { + ogs_error("OpenAPI_service_application_server_address_parseFromJSON() failed [ser_ids]"); + goto end; + } + OpenAPI_list_add(ser_idsList, ogs_strdup(ser_ids_local->valuestring)); + } + + cJSON *fqdn = cJSON_GetObjectItemCaseSensitive(service_application_server_addressJSON, "fqdn"); + + if (fqdn) { + if (!cJSON_IsString(fqdn)) { + ogs_error("OpenAPI_service_application_server_address_parseFromJSON() failed [fqdn]"); + goto end; + } + } + + cJSON *ipv4_addrs = cJSON_GetObjectItemCaseSensitive(service_application_server_addressJSON, "Ipv4Addrs"); + + OpenAPI_list_t *ipv4_addrsList; + if (ipv4_addrs) { + cJSON *ipv4_addrs_local; + if (!cJSON_IsArray(ipv4_addrs)) { + ogs_error("OpenAPI_service_application_server_address_parseFromJSON() failed [ipv4_addrs]"); + goto end; + } + ipv4_addrsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv4_addrs_local, ipv4_addrs) { + if (!cJSON_IsString(ipv4_addrs_local)) { + ogs_error("OpenAPI_service_application_server_address_parseFromJSON() failed [ipv4_addrs]"); + goto end; + } + OpenAPI_list_add(ipv4_addrsList, ogs_strdup(ipv4_addrs_local->valuestring)); + } + } + + cJSON *ipv6_addrs = cJSON_GetObjectItemCaseSensitive(service_application_server_addressJSON, "Ipv6Addrs"); + + OpenAPI_list_t *ipv6_addrsList; + if (ipv6_addrs) { + cJSON *ipv6_addrs_local; + if (!cJSON_IsArray(ipv6_addrs)) { + ogs_error("OpenAPI_service_application_server_address_parseFromJSON() failed [ipv6_addrs]"); + goto end; + } + ipv6_addrsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv6_addrs_local, ipv6_addrs) { + if (!cJSON_IsString(ipv6_addrs_local)) { + ogs_error("OpenAPI_service_application_server_address_parseFromJSON() failed [ipv6_addrs]"); + goto end; + } + OpenAPI_list_add(ipv6_addrsList, ogs_strdup(ipv6_addrs_local->valuestring)); + } + } + + cJSON *udp_port_numbers = cJSON_GetObjectItemCaseSensitive(service_application_server_addressJSON, "udpPortNumbers"); + + OpenAPI_list_t *udp_port_numbersList; + if (udp_port_numbers) { + cJSON *udp_port_numbers_local; + if (!cJSON_IsArray(udp_port_numbers)) { + ogs_error("OpenAPI_service_application_server_address_parseFromJSON() failed [udp_port_numbers]"); + goto end; + } + udp_port_numbersList = OpenAPI_list_create(); + + cJSON_ArrayForEach(udp_port_numbers_local, udp_port_numbers) { + if (!cJSON_IsNumber(udp_port_numbers_local)) { + ogs_error("OpenAPI_service_application_server_address_parseFromJSON() failed [udp_port_numbers]"); + goto end; + } + OpenAPI_list_add(udp_port_numbersList, &udp_port_numbers_local->valuedouble); + } + } + + cJSON *tcp_port_numbers = cJSON_GetObjectItemCaseSensitive(service_application_server_addressJSON, "tcpPortNumbers"); + + OpenAPI_list_t *tcp_port_numbersList; + if (tcp_port_numbers) { + cJSON *tcp_port_numbers_local; + if (!cJSON_IsArray(tcp_port_numbers)) { + ogs_error("OpenAPI_service_application_server_address_parseFromJSON() failed [tcp_port_numbers]"); + goto end; + } + tcp_port_numbersList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tcp_port_numbers_local, tcp_port_numbers) { + if (!cJSON_IsNumber(tcp_port_numbers_local)) { + ogs_error("OpenAPI_service_application_server_address_parseFromJSON() failed [tcp_port_numbers]"); + goto end; + } + OpenAPI_list_add(tcp_port_numbersList, &tcp_port_numbers_local->valuedouble); + } + } + + cJSON *plmns = cJSON_GetObjectItemCaseSensitive(service_application_server_addressJSON, "plmns"); + if (!plmns) { + ogs_error("OpenAPI_service_application_server_address_parseFromJSON() failed [plmns]"); + goto end; + } + + OpenAPI_list_t *plmnsList; + + cJSON *plmns_local_nonprimitive; + if (!cJSON_IsArray(plmns)) { + ogs_error("OpenAPI_service_application_server_address_parseFromJSON() failed [plmns]"); + goto end; + } + + plmnsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(plmns_local_nonprimitive, plmns ) { + if (!cJSON_IsObject(plmns_local_nonprimitive)) { + ogs_error("OpenAPI_service_application_server_address_parseFromJSON() failed [plmns]"); + goto end; + } + OpenAPI_plmn_id_t *plmnsItem = OpenAPI_plmn_id_parseFromJSON(plmns_local_nonprimitive); + + OpenAPI_list_add(plmnsList, plmnsItem); + } + + cJSON *geopraphical_area = cJSON_GetObjectItemCaseSensitive(service_application_server_addressJSON, "geopraphicalArea"); + + if (geopraphical_area) { + if (!cJSON_IsString(geopraphical_area)) { + ogs_error("OpenAPI_service_application_server_address_parseFromJSON() failed [geopraphical_area]"); + goto end; + } + } + + service_application_server_address_local_var = OpenAPI_service_application_server_address_create ( + ser_idsList, + fqdn ? ogs_strdup(fqdn->valuestring) : NULL, + ipv4_addrs ? ipv4_addrsList : NULL, + ipv6_addrs ? ipv6_addrsList : NULL, + udp_port_numbers ? udp_port_numbersList : NULL, + tcp_port_numbers ? tcp_port_numbersList : NULL, + plmnsList, + geopraphical_area ? ogs_strdup(geopraphical_area->valuestring) : NULL + ); + + return service_application_server_address_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/service_application_server_address.h b/lib/sbi/openapi/model/service_application_server_address.h new file mode 100644 index 0000000000..40bcf65232 --- /dev/null +++ b/lib/sbi/openapi/model/service_application_server_address.h @@ -0,0 +1,52 @@ +/* + * service_application_server_address.h + * + * + */ + +#ifndef _OpenAPI_service_application_server_address_H_ +#define _OpenAPI_service_application_server_address_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "plmn_id.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_service_application_server_address_s OpenAPI_service_application_server_address_t; +typedef struct OpenAPI_service_application_server_address_s { + OpenAPI_list_t *ser_ids; + char *fqdn; + OpenAPI_list_t *ipv4_addrs; + OpenAPI_list_t *ipv6_addrs; + OpenAPI_list_t *udp_port_numbers; + OpenAPI_list_t *tcp_port_numbers; + OpenAPI_list_t *plmns; + char *geopraphical_area; +} OpenAPI_service_application_server_address_t; + +OpenAPI_service_application_server_address_t *OpenAPI_service_application_server_address_create( + OpenAPI_list_t *ser_ids, + char *fqdn, + OpenAPI_list_t *ipv4_addrs, + OpenAPI_list_t *ipv6_addrs, + OpenAPI_list_t *udp_port_numbers, + OpenAPI_list_t *tcp_port_numbers, + OpenAPI_list_t *plmns, + char *geopraphical_area + ); +void OpenAPI_service_application_server_address_free(OpenAPI_service_application_server_address_t *service_application_server_address); +OpenAPI_service_application_server_address_t *OpenAPI_service_application_server_address_parseFromJSON(cJSON *service_application_server_addressJSON); +cJSON *OpenAPI_service_application_server_address_convertToJSON(OpenAPI_service_application_server_address_t *service_application_server_address); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_service_application_server_address_H_ */ + diff --git a/lib/sbi/openapi/model/service_area_restriction.c b/lib/sbi/openapi/model/service_area_restriction.c new file mode 100644 index 0000000000..d338a9423d --- /dev/null +++ b/lib/sbi/openapi/model/service_area_restriction.c @@ -0,0 +1,163 @@ + +#include +#include +#include +#include "service_area_restriction.h" + +OpenAPI_service_area_restriction_t *OpenAPI_service_area_restriction_create( + OpenAPI_restriction_type_t *restriction_type, + OpenAPI_list_t *areas, + int max_num_of_t_as, + int max_num_of_t_as_for_not_allowed_areas + ) +{ + OpenAPI_service_area_restriction_t *service_area_restriction_local_var = OpenAPI_malloc(sizeof(OpenAPI_service_area_restriction_t)); + if (!service_area_restriction_local_var) { + return NULL; + } + service_area_restriction_local_var->restriction_type = restriction_type; + service_area_restriction_local_var->areas = areas; + service_area_restriction_local_var->max_num_of_t_as = max_num_of_t_as; + service_area_restriction_local_var->max_num_of_t_as_for_not_allowed_areas = max_num_of_t_as_for_not_allowed_areas; + + return service_area_restriction_local_var; +} + +void OpenAPI_service_area_restriction_free(OpenAPI_service_area_restriction_t *service_area_restriction) +{ + if (NULL == service_area_restriction) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_restriction_type_free(service_area_restriction->restriction_type); + OpenAPI_list_for_each(service_area_restriction->areas, node) { + OpenAPI_area_free(node->data); + } + OpenAPI_list_free(service_area_restriction->areas); + ogs_free(service_area_restriction); +} + +cJSON *OpenAPI_service_area_restriction_convertToJSON(OpenAPI_service_area_restriction_t *service_area_restriction) +{ + cJSON *item = NULL; + + if (service_area_restriction == NULL) { + ogs_error("OpenAPI_service_area_restriction_convertToJSON() failed [ServiceAreaRestriction]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (service_area_restriction->restriction_type) { + cJSON *restriction_type_local_JSON = OpenAPI_restriction_type_convertToJSON(service_area_restriction->restriction_type); + if (restriction_type_local_JSON == NULL) { + ogs_error("OpenAPI_service_area_restriction_convertToJSON() failed [restriction_type]"); + goto end; + } + cJSON_AddItemToObject(item, "restrictionType", restriction_type_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_service_area_restriction_convertToJSON() failed [restriction_type]"); + goto end; + } + } + + if (service_area_restriction->areas) { + cJSON *areasList = cJSON_AddArrayToObject(item, "areas"); + if (areasList == NULL) { + ogs_error("OpenAPI_service_area_restriction_convertToJSON() failed [areas]"); + goto end; + } + + OpenAPI_lnode_t *areas_node; + if (service_area_restriction->areas) { + OpenAPI_list_for_each(service_area_restriction->areas, areas_node) { + cJSON *itemLocal = OpenAPI_area_convertToJSON(areas_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_service_area_restriction_convertToJSON() failed [areas]"); + goto end; + } + cJSON_AddItemToArray(areasList, itemLocal); + } + } + } + + if (service_area_restriction->max_num_of_t_as) { + if (cJSON_AddNumberToObject(item, "maxNumOfTAs", service_area_restriction->max_num_of_t_as) == NULL) { + ogs_error("OpenAPI_service_area_restriction_convertToJSON() failed [max_num_of_t_as]"); + goto end; + } + } + + if (service_area_restriction->max_num_of_t_as_for_not_allowed_areas) { + if (cJSON_AddNumberToObject(item, "maxNumOfTAsForNotAllowedAreas", service_area_restriction->max_num_of_t_as_for_not_allowed_areas) == NULL) { + ogs_error("OpenAPI_service_area_restriction_convertToJSON() failed [max_num_of_t_as_for_not_allowed_areas]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_service_area_restriction_t *OpenAPI_service_area_restriction_parseFromJSON(cJSON *service_area_restrictionJSON) +{ + OpenAPI_service_area_restriction_t *service_area_restriction_local_var = NULL; + cJSON *restriction_type = cJSON_GetObjectItemCaseSensitive(service_area_restrictionJSON, "restrictionType"); + + OpenAPI_restriction_type_t *restriction_type_local_nonprim = NULL; + if (restriction_type) { + restriction_type_local_nonprim = OpenAPI_restriction_type_parseFromJSON(restriction_type); + } + + cJSON *areas = cJSON_GetObjectItemCaseSensitive(service_area_restrictionJSON, "areas"); + + OpenAPI_list_t *areasList; + if (areas) { + cJSON *areas_local_nonprimitive; + if (!cJSON_IsArray(areas)) { + ogs_error("OpenAPI_service_area_restriction_parseFromJSON() failed [areas]"); + goto end; + } + + areasList = OpenAPI_list_create(); + + cJSON_ArrayForEach(areas_local_nonprimitive, areas ) { + if (!cJSON_IsObject(areas_local_nonprimitive)) { + ogs_error("OpenAPI_service_area_restriction_parseFromJSON() failed [areas]"); + goto end; + } + OpenAPI_area_t *areasItem = OpenAPI_area_parseFromJSON(areas_local_nonprimitive); + + OpenAPI_list_add(areasList, areasItem); + } + } + + cJSON *max_num_of_t_as = cJSON_GetObjectItemCaseSensitive(service_area_restrictionJSON, "maxNumOfTAs"); + + if (max_num_of_t_as) { + if (!cJSON_IsNumber(max_num_of_t_as)) { + ogs_error("OpenAPI_service_area_restriction_parseFromJSON() failed [max_num_of_t_as]"); + goto end; + } + } + + cJSON *max_num_of_t_as_for_not_allowed_areas = cJSON_GetObjectItemCaseSensitive(service_area_restrictionJSON, "maxNumOfTAsForNotAllowedAreas"); + + if (max_num_of_t_as_for_not_allowed_areas) { + if (!cJSON_IsNumber(max_num_of_t_as_for_not_allowed_areas)) { + ogs_error("OpenAPI_service_area_restriction_parseFromJSON() failed [max_num_of_t_as_for_not_allowed_areas]"); + goto end; + } + } + + service_area_restriction_local_var = OpenAPI_service_area_restriction_create ( + restriction_type ? restriction_type_local_nonprim : NULL, + areas ? areasList : NULL, + max_num_of_t_as ? max_num_of_t_as->valuedouble : 0, + max_num_of_t_as_for_not_allowed_areas ? max_num_of_t_as_for_not_allowed_areas->valuedouble : 0 + ); + + return service_area_restriction_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/service_area_restriction.h b/lib/sbi/openapi/model/service_area_restriction.h new file mode 100644 index 0000000000..2f28e14993 --- /dev/null +++ b/lib/sbi/openapi/model/service_area_restriction.h @@ -0,0 +1,45 @@ +/* + * service_area_restriction.h + * + * + */ + +#ifndef _OpenAPI_service_area_restriction_H_ +#define _OpenAPI_service_area_restriction_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "area.h" +#include "restriction_type.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_service_area_restriction_s OpenAPI_service_area_restriction_t; +typedef struct OpenAPI_service_area_restriction_s { + struct OpenAPI_restriction_type_s *restriction_type; + OpenAPI_list_t *areas; + int max_num_of_t_as; + int max_num_of_t_as_for_not_allowed_areas; +} OpenAPI_service_area_restriction_t; + +OpenAPI_service_area_restriction_t *OpenAPI_service_area_restriction_create( + OpenAPI_restriction_type_t *restriction_type, + OpenAPI_list_t *areas, + int max_num_of_t_as, + int max_num_of_t_as_for_not_allowed_areas + ); +void OpenAPI_service_area_restriction_free(OpenAPI_service_area_restriction_t *service_area_restriction); +OpenAPI_service_area_restriction_t *OpenAPI_service_area_restriction_parseFromJSON(cJSON *service_area_restrictionJSON); +cJSON *OpenAPI_service_area_restriction_convertToJSON(OpenAPI_service_area_restriction_t *service_area_restriction); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_service_area_restriction_H_ */ + diff --git a/lib/sbi/openapi/model/service_id_to_frequency.c b/lib/sbi/openapi/model/service_id_to_frequency.c new file mode 100644 index 0000000000..be4a6e5e63 --- /dev/null +++ b/lib/sbi/openapi/model/service_id_to_frequency.c @@ -0,0 +1,143 @@ + +#include +#include +#include +#include "service_id_to_frequency.h" + +OpenAPI_service_id_to_frequency_t *OpenAPI_service_id_to_frequency_create( + OpenAPI_list_t *ser_ids, + double frequency, + char *geographical_area + ) +{ + OpenAPI_service_id_to_frequency_t *service_id_to_frequency_local_var = OpenAPI_malloc(sizeof(OpenAPI_service_id_to_frequency_t)); + if (!service_id_to_frequency_local_var) { + return NULL; + } + service_id_to_frequency_local_var->ser_ids = ser_ids; + service_id_to_frequency_local_var->frequency = frequency; + service_id_to_frequency_local_var->geographical_area = geographical_area; + + return service_id_to_frequency_local_var; +} + +void OpenAPI_service_id_to_frequency_free(OpenAPI_service_id_to_frequency_t *service_id_to_frequency) +{ + if (NULL == service_id_to_frequency) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(service_id_to_frequency->ser_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(service_id_to_frequency->ser_ids); + ogs_free(service_id_to_frequency->geographical_area); + ogs_free(service_id_to_frequency); +} + +cJSON *OpenAPI_service_id_to_frequency_convertToJSON(OpenAPI_service_id_to_frequency_t *service_id_to_frequency) +{ + cJSON *item = NULL; + + if (service_id_to_frequency == NULL) { + ogs_error("OpenAPI_service_id_to_frequency_convertToJSON() failed [ServiceIdToFrequency]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!service_id_to_frequency->ser_ids) { + ogs_error("OpenAPI_service_id_to_frequency_convertToJSON() failed [ser_ids]"); + goto end; + } + cJSON *ser_ids = cJSON_AddArrayToObject(item, "serIds"); + if (ser_ids == NULL) { + ogs_error("OpenAPI_service_id_to_frequency_convertToJSON() failed [ser_ids]"); + goto end; + } + + OpenAPI_lnode_t *ser_ids_node; + OpenAPI_list_for_each(service_id_to_frequency->ser_ids, ser_ids_node) { + if (cJSON_AddStringToObject(ser_ids, "", (char*)ser_ids_node->data) == NULL) { + ogs_error("OpenAPI_service_id_to_frequency_convertToJSON() failed [ser_ids]"); + goto end; + } + } + + if (!service_id_to_frequency->frequency) { + ogs_error("OpenAPI_service_id_to_frequency_convertToJSON() failed [frequency]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "frequency", service_id_to_frequency->frequency) == NULL) { + ogs_error("OpenAPI_service_id_to_frequency_convertToJSON() failed [frequency]"); + goto end; + } + + if (service_id_to_frequency->geographical_area) { + if (cJSON_AddStringToObject(item, "geographicalArea", service_id_to_frequency->geographical_area) == NULL) { + ogs_error("OpenAPI_service_id_to_frequency_convertToJSON() failed [geographical_area]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_service_id_to_frequency_t *OpenAPI_service_id_to_frequency_parseFromJSON(cJSON *service_id_to_frequencyJSON) +{ + OpenAPI_service_id_to_frequency_t *service_id_to_frequency_local_var = NULL; + cJSON *ser_ids = cJSON_GetObjectItemCaseSensitive(service_id_to_frequencyJSON, "serIds"); + if (!ser_ids) { + ogs_error("OpenAPI_service_id_to_frequency_parseFromJSON() failed [ser_ids]"); + goto end; + } + + OpenAPI_list_t *ser_idsList; + + cJSON *ser_ids_local; + if (!cJSON_IsArray(ser_ids)) { + ogs_error("OpenAPI_service_id_to_frequency_parseFromJSON() failed [ser_ids]"); + goto end; + } + ser_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ser_ids_local, ser_ids) { + if (!cJSON_IsString(ser_ids_local)) { + ogs_error("OpenAPI_service_id_to_frequency_parseFromJSON() failed [ser_ids]"); + goto end; + } + OpenAPI_list_add(ser_idsList, ogs_strdup(ser_ids_local->valuestring)); + } + + cJSON *frequency = cJSON_GetObjectItemCaseSensitive(service_id_to_frequencyJSON, "frequency"); + if (!frequency) { + ogs_error("OpenAPI_service_id_to_frequency_parseFromJSON() failed [frequency]"); + goto end; + } + + + if (!cJSON_IsNumber(frequency)) { + ogs_error("OpenAPI_service_id_to_frequency_parseFromJSON() failed [frequency]"); + goto end; + } + + cJSON *geographical_area = cJSON_GetObjectItemCaseSensitive(service_id_to_frequencyJSON, "geographicalArea"); + + if (geographical_area) { + if (!cJSON_IsString(geographical_area)) { + ogs_error("OpenAPI_service_id_to_frequency_parseFromJSON() failed [geographical_area]"); + goto end; + } + } + + service_id_to_frequency_local_var = OpenAPI_service_id_to_frequency_create ( + ser_idsList, + frequency->valuedouble, + geographical_area ? ogs_strdup(geographical_area->valuestring) : NULL + ); + + return service_id_to_frequency_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/service_id_to_frequency.h b/lib/sbi/openapi/model/service_id_to_frequency.h new file mode 100644 index 0000000000..f85086b1c9 --- /dev/null +++ b/lib/sbi/openapi/model/service_id_to_frequency.h @@ -0,0 +1,41 @@ +/* + * service_id_to_frequency.h + * + * + */ + +#ifndef _OpenAPI_service_id_to_frequency_H_ +#define _OpenAPI_service_id_to_frequency_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_service_id_to_frequency_s OpenAPI_service_id_to_frequency_t; +typedef struct OpenAPI_service_id_to_frequency_s { + OpenAPI_list_t *ser_ids; + double frequency; + char *geographical_area; +} OpenAPI_service_id_to_frequency_t; + +OpenAPI_service_id_to_frequency_t *OpenAPI_service_id_to_frequency_create( + OpenAPI_list_t *ser_ids, + double frequency, + char *geographical_area + ); +void OpenAPI_service_id_to_frequency_free(OpenAPI_service_id_to_frequency_t *service_id_to_frequency); +OpenAPI_service_id_to_frequency_t *OpenAPI_service_id_to_frequency_parseFromJSON(cJSON *service_id_to_frequencyJSON); +cJSON *OpenAPI_service_id_to_frequency_convertToJSON(OpenAPI_service_id_to_frequency_t *service_id_to_frequency); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_service_id_to_frequency_H_ */ + diff --git a/lib/sbi/openapi/model/service_id_to_layer2_id.c b/lib/sbi/openapi/model/service_id_to_layer2_id.c new file mode 100644 index 0000000000..615cc17036 --- /dev/null +++ b/lib/sbi/openapi/model/service_id_to_layer2_id.c @@ -0,0 +1,124 @@ + +#include +#include +#include +#include "service_id_to_layer2_id.h" + +OpenAPI_service_id_to_layer2_id_t *OpenAPI_service_id_to_layer2_id_create( + OpenAPI_list_t *ser_ids, + char *des_layer2_id + ) +{ + OpenAPI_service_id_to_layer2_id_t *service_id_to_layer2_id_local_var = OpenAPI_malloc(sizeof(OpenAPI_service_id_to_layer2_id_t)); + if (!service_id_to_layer2_id_local_var) { + return NULL; + } + service_id_to_layer2_id_local_var->ser_ids = ser_ids; + service_id_to_layer2_id_local_var->des_layer2_id = des_layer2_id; + + return service_id_to_layer2_id_local_var; +} + +void OpenAPI_service_id_to_layer2_id_free(OpenAPI_service_id_to_layer2_id_t *service_id_to_layer2_id) +{ + if (NULL == service_id_to_layer2_id) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(service_id_to_layer2_id->ser_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(service_id_to_layer2_id->ser_ids); + ogs_free(service_id_to_layer2_id->des_layer2_id); + ogs_free(service_id_to_layer2_id); +} + +cJSON *OpenAPI_service_id_to_layer2_id_convertToJSON(OpenAPI_service_id_to_layer2_id_t *service_id_to_layer2_id) +{ + cJSON *item = NULL; + + if (service_id_to_layer2_id == NULL) { + ogs_error("OpenAPI_service_id_to_layer2_id_convertToJSON() failed [ServiceIdToLayer2Id]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!service_id_to_layer2_id->ser_ids) { + ogs_error("OpenAPI_service_id_to_layer2_id_convertToJSON() failed [ser_ids]"); + goto end; + } + cJSON *ser_ids = cJSON_AddArrayToObject(item, "serIds"); + if (ser_ids == NULL) { + ogs_error("OpenAPI_service_id_to_layer2_id_convertToJSON() failed [ser_ids]"); + goto end; + } + + OpenAPI_lnode_t *ser_ids_node; + OpenAPI_list_for_each(service_id_to_layer2_id->ser_ids, ser_ids_node) { + if (cJSON_AddStringToObject(ser_ids, "", (char*)ser_ids_node->data) == NULL) { + ogs_error("OpenAPI_service_id_to_layer2_id_convertToJSON() failed [ser_ids]"); + goto end; + } + } + + if (!service_id_to_layer2_id->des_layer2_id) { + ogs_error("OpenAPI_service_id_to_layer2_id_convertToJSON() failed [des_layer2_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "desLayer2Id", service_id_to_layer2_id->des_layer2_id) == NULL) { + ogs_error("OpenAPI_service_id_to_layer2_id_convertToJSON() failed [des_layer2_id]"); + goto end; + } + +end: + return item; +} + +OpenAPI_service_id_to_layer2_id_t *OpenAPI_service_id_to_layer2_id_parseFromJSON(cJSON *service_id_to_layer2_idJSON) +{ + OpenAPI_service_id_to_layer2_id_t *service_id_to_layer2_id_local_var = NULL; + cJSON *ser_ids = cJSON_GetObjectItemCaseSensitive(service_id_to_layer2_idJSON, "serIds"); + if (!ser_ids) { + ogs_error("OpenAPI_service_id_to_layer2_id_parseFromJSON() failed [ser_ids]"); + goto end; + } + + OpenAPI_list_t *ser_idsList; + + cJSON *ser_ids_local; + if (!cJSON_IsArray(ser_ids)) { + ogs_error("OpenAPI_service_id_to_layer2_id_parseFromJSON() failed [ser_ids]"); + goto end; + } + ser_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ser_ids_local, ser_ids) { + if (!cJSON_IsString(ser_ids_local)) { + ogs_error("OpenAPI_service_id_to_layer2_id_parseFromJSON() failed [ser_ids]"); + goto end; + } + OpenAPI_list_add(ser_idsList, ogs_strdup(ser_ids_local->valuestring)); + } + + cJSON *des_layer2_id = cJSON_GetObjectItemCaseSensitive(service_id_to_layer2_idJSON, "desLayer2Id"); + if (!des_layer2_id) { + ogs_error("OpenAPI_service_id_to_layer2_id_parseFromJSON() failed [des_layer2_id]"); + goto end; + } + + + if (!cJSON_IsString(des_layer2_id)) { + ogs_error("OpenAPI_service_id_to_layer2_id_parseFromJSON() failed [des_layer2_id]"); + goto end; + } + + service_id_to_layer2_id_local_var = OpenAPI_service_id_to_layer2_id_create ( + ser_idsList, + ogs_strdup(des_layer2_id->valuestring) + ); + + return service_id_to_layer2_id_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/service_id_to_layer2_id.h b/lib/sbi/openapi/model/service_id_to_layer2_id.h new file mode 100644 index 0000000000..c297df0b6f --- /dev/null +++ b/lib/sbi/openapi/model/service_id_to_layer2_id.h @@ -0,0 +1,39 @@ +/* + * service_id_to_layer2_id.h + * + * + */ + +#ifndef _OpenAPI_service_id_to_layer2_id_H_ +#define _OpenAPI_service_id_to_layer2_id_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_service_id_to_layer2_id_s OpenAPI_service_id_to_layer2_id_t; +typedef struct OpenAPI_service_id_to_layer2_id_s { + OpenAPI_list_t *ser_ids; + char *des_layer2_id; +} OpenAPI_service_id_to_layer2_id_t; + +OpenAPI_service_id_to_layer2_id_t *OpenAPI_service_id_to_layer2_id_create( + OpenAPI_list_t *ser_ids, + char *des_layer2_id + ); +void OpenAPI_service_id_to_layer2_id_free(OpenAPI_service_id_to_layer2_id_t *service_id_to_layer2_id); +OpenAPI_service_id_to_layer2_id_t *OpenAPI_service_id_to_layer2_id_parseFromJSON(cJSON *service_id_to_layer2_idJSON); +cJSON *OpenAPI_service_id_to_layer2_id_convertToJSON(OpenAPI_service_id_to_layer2_id_t *service_id_to_layer2_id); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_service_id_to_layer2_id_H_ */ + diff --git a/lib/sbi/openapi/model/service_id_to_pppr.c b/lib/sbi/openapi/model/service_id_to_pppr.c new file mode 100644 index 0000000000..6b8b507fb3 --- /dev/null +++ b/lib/sbi/openapi/model/service_id_to_pppr.c @@ -0,0 +1,123 @@ + +#include +#include +#include +#include "service_id_to_pppr.h" + +OpenAPI_service_id_to_pppr_t *OpenAPI_service_id_to_pppr_create( + OpenAPI_list_t *ser_ids, + int pppr + ) +{ + OpenAPI_service_id_to_pppr_t *service_id_to_pppr_local_var = OpenAPI_malloc(sizeof(OpenAPI_service_id_to_pppr_t)); + if (!service_id_to_pppr_local_var) { + return NULL; + } + service_id_to_pppr_local_var->ser_ids = ser_ids; + service_id_to_pppr_local_var->pppr = pppr; + + return service_id_to_pppr_local_var; +} + +void OpenAPI_service_id_to_pppr_free(OpenAPI_service_id_to_pppr_t *service_id_to_pppr) +{ + if (NULL == service_id_to_pppr) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(service_id_to_pppr->ser_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(service_id_to_pppr->ser_ids); + ogs_free(service_id_to_pppr); +} + +cJSON *OpenAPI_service_id_to_pppr_convertToJSON(OpenAPI_service_id_to_pppr_t *service_id_to_pppr) +{ + cJSON *item = NULL; + + if (service_id_to_pppr == NULL) { + ogs_error("OpenAPI_service_id_to_pppr_convertToJSON() failed [ServiceIdToPppr]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!service_id_to_pppr->ser_ids) { + ogs_error("OpenAPI_service_id_to_pppr_convertToJSON() failed [ser_ids]"); + goto end; + } + cJSON *ser_ids = cJSON_AddArrayToObject(item, "serIds"); + if (ser_ids == NULL) { + ogs_error("OpenAPI_service_id_to_pppr_convertToJSON() failed [ser_ids]"); + goto end; + } + + OpenAPI_lnode_t *ser_ids_node; + OpenAPI_list_for_each(service_id_to_pppr->ser_ids, ser_ids_node) { + if (cJSON_AddStringToObject(ser_ids, "", (char*)ser_ids_node->data) == NULL) { + ogs_error("OpenAPI_service_id_to_pppr_convertToJSON() failed [ser_ids]"); + goto end; + } + } + + if (!service_id_to_pppr->pppr) { + ogs_error("OpenAPI_service_id_to_pppr_convertToJSON() failed [pppr]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "pppr", service_id_to_pppr->pppr) == NULL) { + ogs_error("OpenAPI_service_id_to_pppr_convertToJSON() failed [pppr]"); + goto end; + } + +end: + return item; +} + +OpenAPI_service_id_to_pppr_t *OpenAPI_service_id_to_pppr_parseFromJSON(cJSON *service_id_to_ppprJSON) +{ + OpenAPI_service_id_to_pppr_t *service_id_to_pppr_local_var = NULL; + cJSON *ser_ids = cJSON_GetObjectItemCaseSensitive(service_id_to_ppprJSON, "serIds"); + if (!ser_ids) { + ogs_error("OpenAPI_service_id_to_pppr_parseFromJSON() failed [ser_ids]"); + goto end; + } + + OpenAPI_list_t *ser_idsList; + + cJSON *ser_ids_local; + if (!cJSON_IsArray(ser_ids)) { + ogs_error("OpenAPI_service_id_to_pppr_parseFromJSON() failed [ser_ids]"); + goto end; + } + ser_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ser_ids_local, ser_ids) { + if (!cJSON_IsString(ser_ids_local)) { + ogs_error("OpenAPI_service_id_to_pppr_parseFromJSON() failed [ser_ids]"); + goto end; + } + OpenAPI_list_add(ser_idsList, ogs_strdup(ser_ids_local->valuestring)); + } + + cJSON *pppr = cJSON_GetObjectItemCaseSensitive(service_id_to_ppprJSON, "pppr"); + if (!pppr) { + ogs_error("OpenAPI_service_id_to_pppr_parseFromJSON() failed [pppr]"); + goto end; + } + + + if (!cJSON_IsNumber(pppr)) { + ogs_error("OpenAPI_service_id_to_pppr_parseFromJSON() failed [pppr]"); + goto end; + } + + service_id_to_pppr_local_var = OpenAPI_service_id_to_pppr_create ( + ser_idsList, + pppr->valuedouble + ); + + return service_id_to_pppr_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/service_id_to_pppr.h b/lib/sbi/openapi/model/service_id_to_pppr.h new file mode 100644 index 0000000000..9250e60b29 --- /dev/null +++ b/lib/sbi/openapi/model/service_id_to_pppr.h @@ -0,0 +1,39 @@ +/* + * service_id_to_pppr.h + * + * + */ + +#ifndef _OpenAPI_service_id_to_pppr_H_ +#define _OpenAPI_service_id_to_pppr_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_service_id_to_pppr_s OpenAPI_service_id_to_pppr_t; +typedef struct OpenAPI_service_id_to_pppr_s { + OpenAPI_list_t *ser_ids; + int pppr; +} OpenAPI_service_id_to_pppr_t; + +OpenAPI_service_id_to_pppr_t *OpenAPI_service_id_to_pppr_create( + OpenAPI_list_t *ser_ids, + int pppr + ); +void OpenAPI_service_id_to_pppr_free(OpenAPI_service_id_to_pppr_t *service_id_to_pppr); +OpenAPI_service_id_to_pppr_t *OpenAPI_service_id_to_pppr_parseFromJSON(cJSON *service_id_to_ppprJSON); +cJSON *OpenAPI_service_id_to_pppr_convertToJSON(OpenAPI_service_id_to_pppr_t *service_id_to_pppr); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_service_id_to_pppr_H_ */ + diff --git a/lib/sbi/openapi/model/service_name_cond.h b/lib/sbi/openapi/model/service_name_cond.h index 995ce9bba8..6274ebf307 100644 --- a/lib/sbi/openapi/model/service_name_cond.h +++ b/lib/sbi/openapi/model/service_name_cond.h @@ -1,7 +1,7 @@ /* * service_name_cond.h * - * + * Subscription to a set of NFs based on their support for a given Service Name */ #ifndef _OpenAPI_service_name_cond_H_ diff --git a/lib/sbi/openapi/model/service_parameter_data.c b/lib/sbi/openapi/model/service_parameter_data.c new file mode 100644 index 0000000000..c72be0036e --- /dev/null +++ b/lib/sbi/openapi/model/service_parameter_data.c @@ -0,0 +1,283 @@ + +#include +#include +#include +#include "service_parameter_data.h" + +OpenAPI_service_parameter_data_t *OpenAPI_service_parameter_data_create( + char *app_id, + char *dnn, + OpenAPI_snssai_t *snssai, + char *inter_group_id, + char *supi, + char *ipv4_addr, + char *ipv6_addr, + char *mac_addr, + OpenAPI_parameter_over_pc5_t *param_over_pc5, + OpenAPI_parameter_over_uu_t *param_over_uu, + char *supp_feat + ) +{ + OpenAPI_service_parameter_data_t *service_parameter_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_service_parameter_data_t)); + if (!service_parameter_data_local_var) { + return NULL; + } + service_parameter_data_local_var->app_id = app_id; + service_parameter_data_local_var->dnn = dnn; + service_parameter_data_local_var->snssai = snssai; + service_parameter_data_local_var->inter_group_id = inter_group_id; + service_parameter_data_local_var->supi = supi; + service_parameter_data_local_var->ipv4_addr = ipv4_addr; + service_parameter_data_local_var->ipv6_addr = ipv6_addr; + service_parameter_data_local_var->mac_addr = mac_addr; + service_parameter_data_local_var->param_over_pc5 = param_over_pc5; + service_parameter_data_local_var->param_over_uu = param_over_uu; + service_parameter_data_local_var->supp_feat = supp_feat; + + return service_parameter_data_local_var; +} + +void OpenAPI_service_parameter_data_free(OpenAPI_service_parameter_data_t *service_parameter_data) +{ + if (NULL == service_parameter_data) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(service_parameter_data->app_id); + ogs_free(service_parameter_data->dnn); + OpenAPI_snssai_free(service_parameter_data->snssai); + ogs_free(service_parameter_data->inter_group_id); + ogs_free(service_parameter_data->supi); + ogs_free(service_parameter_data->ipv4_addr); + ogs_free(service_parameter_data->ipv6_addr); + ogs_free(service_parameter_data->mac_addr); + OpenAPI_parameter_over_pc5_free(service_parameter_data->param_over_pc5); + OpenAPI_parameter_over_uu_free(service_parameter_data->param_over_uu); + ogs_free(service_parameter_data->supp_feat); + ogs_free(service_parameter_data); +} + +cJSON *OpenAPI_service_parameter_data_convertToJSON(OpenAPI_service_parameter_data_t *service_parameter_data) +{ + cJSON *item = NULL; + + if (service_parameter_data == NULL) { + ogs_error("OpenAPI_service_parameter_data_convertToJSON() failed [ServiceParameterData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (service_parameter_data->app_id) { + if (cJSON_AddStringToObject(item, "appId", service_parameter_data->app_id) == NULL) { + ogs_error("OpenAPI_service_parameter_data_convertToJSON() failed [app_id]"); + goto end; + } + } + + if (service_parameter_data->dnn) { + if (cJSON_AddStringToObject(item, "dnn", service_parameter_data->dnn) == NULL) { + ogs_error("OpenAPI_service_parameter_data_convertToJSON() failed [dnn]"); + goto end; + } + } + + if (service_parameter_data->snssai) { + cJSON *snssai_local_JSON = OpenAPI_snssai_convertToJSON(service_parameter_data->snssai); + if (snssai_local_JSON == NULL) { + ogs_error("OpenAPI_service_parameter_data_convertToJSON() failed [snssai]"); + goto end; + } + cJSON_AddItemToObject(item, "snssai", snssai_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_service_parameter_data_convertToJSON() failed [snssai]"); + goto end; + } + } + + if (service_parameter_data->inter_group_id) { + if (cJSON_AddStringToObject(item, "interGroupId", service_parameter_data->inter_group_id) == NULL) { + ogs_error("OpenAPI_service_parameter_data_convertToJSON() failed [inter_group_id]"); + goto end; + } + } + + if (service_parameter_data->supi) { + if (cJSON_AddStringToObject(item, "supi", service_parameter_data->supi) == NULL) { + ogs_error("OpenAPI_service_parameter_data_convertToJSON() failed [supi]"); + goto end; + } + } + + if (service_parameter_data->ipv4_addr) { + if (cJSON_AddStringToObject(item, "ipv4Addr", service_parameter_data->ipv4_addr) == NULL) { + ogs_error("OpenAPI_service_parameter_data_convertToJSON() failed [ipv4_addr]"); + goto end; + } + } + + if (service_parameter_data->ipv6_addr) { + if (cJSON_AddStringToObject(item, "ipv6Addr", service_parameter_data->ipv6_addr) == NULL) { + ogs_error("OpenAPI_service_parameter_data_convertToJSON() failed [ipv6_addr]"); + goto end; + } + } + + if (service_parameter_data->mac_addr) { + if (cJSON_AddStringToObject(item, "macAddr", service_parameter_data->mac_addr) == NULL) { + ogs_error("OpenAPI_service_parameter_data_convertToJSON() failed [mac_addr]"); + goto end; + } + } + + if (service_parameter_data->param_over_pc5) { + cJSON *param_over_pc5_local_JSON = OpenAPI_parameter_over_pc5_convertToJSON(service_parameter_data->param_over_pc5); + if (param_over_pc5_local_JSON == NULL) { + ogs_error("OpenAPI_service_parameter_data_convertToJSON() failed [param_over_pc5]"); + goto end; + } + cJSON_AddItemToObject(item, "paramOverPc5", param_over_pc5_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_service_parameter_data_convertToJSON() failed [param_over_pc5]"); + goto end; + } + } + + if (service_parameter_data->param_over_uu) { + cJSON *param_over_uu_local_JSON = OpenAPI_parameter_over_uu_convertToJSON(service_parameter_data->param_over_uu); + if (param_over_uu_local_JSON == NULL) { + ogs_error("OpenAPI_service_parameter_data_convertToJSON() failed [param_over_uu]"); + goto end; + } + cJSON_AddItemToObject(item, "paramOverUu", param_over_uu_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_service_parameter_data_convertToJSON() failed [param_over_uu]"); + goto end; + } + } + + if (service_parameter_data->supp_feat) { + if (cJSON_AddStringToObject(item, "suppFeat", service_parameter_data->supp_feat) == NULL) { + ogs_error("OpenAPI_service_parameter_data_convertToJSON() failed [supp_feat]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_service_parameter_data_t *OpenAPI_service_parameter_data_parseFromJSON(cJSON *service_parameter_dataJSON) +{ + OpenAPI_service_parameter_data_t *service_parameter_data_local_var = NULL; + cJSON *app_id = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "appId"); + + if (app_id) { + if (!cJSON_IsString(app_id)) { + ogs_error("OpenAPI_service_parameter_data_parseFromJSON() failed [app_id]"); + goto end; + } + } + + cJSON *dnn = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "dnn"); + + if (dnn) { + if (!cJSON_IsString(dnn)) { + ogs_error("OpenAPI_service_parameter_data_parseFromJSON() failed [dnn]"); + goto end; + } + } + + cJSON *snssai = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "snssai"); + + OpenAPI_snssai_t *snssai_local_nonprim = NULL; + if (snssai) { + snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(snssai); + } + + cJSON *inter_group_id = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "interGroupId"); + + if (inter_group_id) { + if (!cJSON_IsString(inter_group_id)) { + ogs_error("OpenAPI_service_parameter_data_parseFromJSON() failed [inter_group_id]"); + goto end; + } + } + + cJSON *supi = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "supi"); + + if (supi) { + if (!cJSON_IsString(supi)) { + ogs_error("OpenAPI_service_parameter_data_parseFromJSON() failed [supi]"); + goto end; + } + } + + cJSON *ipv4_addr = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "ipv4Addr"); + + if (ipv4_addr) { + if (!cJSON_IsString(ipv4_addr)) { + ogs_error("OpenAPI_service_parameter_data_parseFromJSON() failed [ipv4_addr]"); + goto end; + } + } + + cJSON *ipv6_addr = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "ipv6Addr"); + + if (ipv6_addr) { + if (!cJSON_IsString(ipv6_addr)) { + ogs_error("OpenAPI_service_parameter_data_parseFromJSON() failed [ipv6_addr]"); + goto end; + } + } + + cJSON *mac_addr = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "macAddr"); + + if (mac_addr) { + if (!cJSON_IsString(mac_addr)) { + ogs_error("OpenAPI_service_parameter_data_parseFromJSON() failed [mac_addr]"); + goto end; + } + } + + cJSON *param_over_pc5 = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "paramOverPc5"); + + OpenAPI_parameter_over_pc5_t *param_over_pc5_local_nonprim = NULL; + if (param_over_pc5) { + param_over_pc5_local_nonprim = OpenAPI_parameter_over_pc5_parseFromJSON(param_over_pc5); + } + + cJSON *param_over_uu = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "paramOverUu"); + + OpenAPI_parameter_over_uu_t *param_over_uu_local_nonprim = NULL; + if (param_over_uu) { + param_over_uu_local_nonprim = OpenAPI_parameter_over_uu_parseFromJSON(param_over_uu); + } + + cJSON *supp_feat = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "suppFeat"); + + if (supp_feat) { + if (!cJSON_IsString(supp_feat)) { + ogs_error("OpenAPI_service_parameter_data_parseFromJSON() failed [supp_feat]"); + goto end; + } + } + + service_parameter_data_local_var = OpenAPI_service_parameter_data_create ( + app_id ? ogs_strdup(app_id->valuestring) : NULL, + dnn ? ogs_strdup(dnn->valuestring) : NULL, + snssai ? snssai_local_nonprim : NULL, + inter_group_id ? ogs_strdup(inter_group_id->valuestring) : NULL, + supi ? ogs_strdup(supi->valuestring) : NULL, + ipv4_addr ? ogs_strdup(ipv4_addr->valuestring) : NULL, + ipv6_addr ? ogs_strdup(ipv6_addr->valuestring) : NULL, + mac_addr ? ogs_strdup(mac_addr->valuestring) : NULL, + param_over_pc5 ? param_over_pc5_local_nonprim : NULL, + param_over_uu ? param_over_uu_local_nonprim : NULL, + supp_feat ? ogs_strdup(supp_feat->valuestring) : NULL + ); + + return service_parameter_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/service_parameter_data.h b/lib/sbi/openapi/model/service_parameter_data.h new file mode 100644 index 0000000000..cbeb7137d9 --- /dev/null +++ b/lib/sbi/openapi/model/service_parameter_data.h @@ -0,0 +1,60 @@ +/* + * service_parameter_data.h + * + * + */ + +#ifndef _OpenAPI_service_parameter_data_H_ +#define _OpenAPI_service_parameter_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "parameter_over_pc5.h" +#include "parameter_over_uu.h" +#include "snssai.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_service_parameter_data_s OpenAPI_service_parameter_data_t; +typedef struct OpenAPI_service_parameter_data_s { + char *app_id; + char *dnn; + struct OpenAPI_snssai_s *snssai; + char *inter_group_id; + char *supi; + char *ipv4_addr; + char *ipv6_addr; + char *mac_addr; + struct OpenAPI_parameter_over_pc5_s *param_over_pc5; + struct OpenAPI_parameter_over_uu_s *param_over_uu; + char *supp_feat; +} OpenAPI_service_parameter_data_t; + +OpenAPI_service_parameter_data_t *OpenAPI_service_parameter_data_create( + char *app_id, + char *dnn, + OpenAPI_snssai_t *snssai, + char *inter_group_id, + char *supi, + char *ipv4_addr, + char *ipv6_addr, + char *mac_addr, + OpenAPI_parameter_over_pc5_t *param_over_pc5, + OpenAPI_parameter_over_uu_t *param_over_uu, + char *supp_feat + ); +void OpenAPI_service_parameter_data_free(OpenAPI_service_parameter_data_t *service_parameter_data); +OpenAPI_service_parameter_data_t *OpenAPI_service_parameter_data_parseFromJSON(cJSON *service_parameter_dataJSON); +cJSON *OpenAPI_service_parameter_data_convertToJSON(OpenAPI_service_parameter_data_t *service_parameter_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_service_parameter_data_H_ */ + diff --git a/lib/sbi/openapi/model/service_to_pdu_session.c b/lib/sbi/openapi/model/service_to_pdu_session.c new file mode 100644 index 0000000000..058a40c773 --- /dev/null +++ b/lib/sbi/openapi/model/service_to_pdu_session.c @@ -0,0 +1,240 @@ + +#include +#include +#include +#include "service_to_pdu_session.h" + +OpenAPI_service_to_pdu_session_t *OpenAPI_service_to_pdu_session_create( + OpenAPI_list_t *ser_ids, + OpenAPI_pdu_session_type_t *pdu_session_type, + OpenAPI_ssc_mode_t *ssc_mode, + OpenAPI_list_t *slice_info, + OpenAPI_list_t *dnns + ) +{ + OpenAPI_service_to_pdu_session_t *service_to_pdu_session_local_var = OpenAPI_malloc(sizeof(OpenAPI_service_to_pdu_session_t)); + if (!service_to_pdu_session_local_var) { + return NULL; + } + service_to_pdu_session_local_var->ser_ids = ser_ids; + service_to_pdu_session_local_var->pdu_session_type = pdu_session_type; + service_to_pdu_session_local_var->ssc_mode = ssc_mode; + service_to_pdu_session_local_var->slice_info = slice_info; + service_to_pdu_session_local_var->dnns = dnns; + + return service_to_pdu_session_local_var; +} + +void OpenAPI_service_to_pdu_session_free(OpenAPI_service_to_pdu_session_t *service_to_pdu_session) +{ + if (NULL == service_to_pdu_session) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(service_to_pdu_session->ser_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(service_to_pdu_session->ser_ids); + OpenAPI_pdu_session_type_free(service_to_pdu_session->pdu_session_type); + OpenAPI_ssc_mode_free(service_to_pdu_session->ssc_mode); + OpenAPI_list_for_each(service_to_pdu_session->slice_info, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(service_to_pdu_session->slice_info); + OpenAPI_list_for_each(service_to_pdu_session->dnns, node) { + ogs_free(node->data); + } + OpenAPI_list_free(service_to_pdu_session->dnns); + ogs_free(service_to_pdu_session); +} + +cJSON *OpenAPI_service_to_pdu_session_convertToJSON(OpenAPI_service_to_pdu_session_t *service_to_pdu_session) +{ + cJSON *item = NULL; + + if (service_to_pdu_session == NULL) { + ogs_error("OpenAPI_service_to_pdu_session_convertToJSON() failed [ServiceToPduSession]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!service_to_pdu_session->ser_ids) { + ogs_error("OpenAPI_service_to_pdu_session_convertToJSON() failed [ser_ids]"); + goto end; + } + cJSON *ser_ids = cJSON_AddArrayToObject(item, "serIds"); + if (ser_ids == NULL) { + ogs_error("OpenAPI_service_to_pdu_session_convertToJSON() failed [ser_ids]"); + goto end; + } + + OpenAPI_lnode_t *ser_ids_node; + OpenAPI_list_for_each(service_to_pdu_session->ser_ids, ser_ids_node) { + if (cJSON_AddStringToObject(ser_ids, "", (char*)ser_ids_node->data) == NULL) { + ogs_error("OpenAPI_service_to_pdu_session_convertToJSON() failed [ser_ids]"); + goto end; + } + } + + if (service_to_pdu_session->pdu_session_type) { + cJSON *pdu_session_type_local_JSON = OpenAPI_pdu_session_type_convertToJSON(service_to_pdu_session->pdu_session_type); + if (pdu_session_type_local_JSON == NULL) { + ogs_error("OpenAPI_service_to_pdu_session_convertToJSON() failed [pdu_session_type]"); + goto end; + } + cJSON_AddItemToObject(item, "pduSessionType", pdu_session_type_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_service_to_pdu_session_convertToJSON() failed [pdu_session_type]"); + goto end; + } + } + + if (service_to_pdu_session->ssc_mode) { + cJSON *ssc_mode_local_JSON = OpenAPI_ssc_mode_convertToJSON(service_to_pdu_session->ssc_mode); + if (ssc_mode_local_JSON == NULL) { + ogs_error("OpenAPI_service_to_pdu_session_convertToJSON() failed [ssc_mode]"); + goto end; + } + cJSON_AddItemToObject(item, "sscMode", ssc_mode_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_service_to_pdu_session_convertToJSON() failed [ssc_mode]"); + goto end; + } + } + + if (service_to_pdu_session->slice_info) { + cJSON *slice_infoList = cJSON_AddArrayToObject(item, "sliceInfo"); + if (slice_infoList == NULL) { + ogs_error("OpenAPI_service_to_pdu_session_convertToJSON() failed [slice_info]"); + goto end; + } + + OpenAPI_lnode_t *slice_info_node; + if (service_to_pdu_session->slice_info) { + OpenAPI_list_for_each(service_to_pdu_session->slice_info, slice_info_node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(slice_info_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_service_to_pdu_session_convertToJSON() failed [slice_info]"); + goto end; + } + cJSON_AddItemToArray(slice_infoList, itemLocal); + } + } + } + + if (service_to_pdu_session->dnns) { + cJSON *dnns = cJSON_AddArrayToObject(item, "dnns"); + if (dnns == NULL) { + ogs_error("OpenAPI_service_to_pdu_session_convertToJSON() failed [dnns]"); + goto end; + } + + OpenAPI_lnode_t *dnns_node; + OpenAPI_list_for_each(service_to_pdu_session->dnns, dnns_node) { + if (cJSON_AddStringToObject(dnns, "", (char*)dnns_node->data) == NULL) { + ogs_error("OpenAPI_service_to_pdu_session_convertToJSON() failed [dnns]"); + goto end; + } + } + } + +end: + return item; +} + +OpenAPI_service_to_pdu_session_t *OpenAPI_service_to_pdu_session_parseFromJSON(cJSON *service_to_pdu_sessionJSON) +{ + OpenAPI_service_to_pdu_session_t *service_to_pdu_session_local_var = NULL; + cJSON *ser_ids = cJSON_GetObjectItemCaseSensitive(service_to_pdu_sessionJSON, "serIds"); + if (!ser_ids) { + ogs_error("OpenAPI_service_to_pdu_session_parseFromJSON() failed [ser_ids]"); + goto end; + } + + OpenAPI_list_t *ser_idsList; + + cJSON *ser_ids_local; + if (!cJSON_IsArray(ser_ids)) { + ogs_error("OpenAPI_service_to_pdu_session_parseFromJSON() failed [ser_ids]"); + goto end; + } + ser_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ser_ids_local, ser_ids) { + if (!cJSON_IsString(ser_ids_local)) { + ogs_error("OpenAPI_service_to_pdu_session_parseFromJSON() failed [ser_ids]"); + goto end; + } + OpenAPI_list_add(ser_idsList, ogs_strdup(ser_ids_local->valuestring)); + } + + cJSON *pdu_session_type = cJSON_GetObjectItemCaseSensitive(service_to_pdu_sessionJSON, "pduSessionType"); + + OpenAPI_pdu_session_type_t *pdu_session_type_local_nonprim = NULL; + if (pdu_session_type) { + pdu_session_type_local_nonprim = OpenAPI_pdu_session_type_parseFromJSON(pdu_session_type); + } + + cJSON *ssc_mode = cJSON_GetObjectItemCaseSensitive(service_to_pdu_sessionJSON, "sscMode"); + + OpenAPI_ssc_mode_t *ssc_mode_local_nonprim = NULL; + if (ssc_mode) { + ssc_mode_local_nonprim = OpenAPI_ssc_mode_parseFromJSON(ssc_mode); + } + + cJSON *slice_info = cJSON_GetObjectItemCaseSensitive(service_to_pdu_sessionJSON, "sliceInfo"); + + OpenAPI_list_t *slice_infoList; + if (slice_info) { + cJSON *slice_info_local_nonprimitive; + if (!cJSON_IsArray(slice_info)) { + ogs_error("OpenAPI_service_to_pdu_session_parseFromJSON() failed [slice_info]"); + goto end; + } + + slice_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(slice_info_local_nonprimitive, slice_info ) { + if (!cJSON_IsObject(slice_info_local_nonprimitive)) { + ogs_error("OpenAPI_service_to_pdu_session_parseFromJSON() failed [slice_info]"); + goto end; + } + OpenAPI_snssai_t *slice_infoItem = OpenAPI_snssai_parseFromJSON(slice_info_local_nonprimitive); + + OpenAPI_list_add(slice_infoList, slice_infoItem); + } + } + + cJSON *dnns = cJSON_GetObjectItemCaseSensitive(service_to_pdu_sessionJSON, "dnns"); + + OpenAPI_list_t *dnnsList; + if (dnns) { + cJSON *dnns_local; + if (!cJSON_IsArray(dnns)) { + ogs_error("OpenAPI_service_to_pdu_session_parseFromJSON() failed [dnns]"); + goto end; + } + dnnsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(dnns_local, dnns) { + if (!cJSON_IsString(dnns_local)) { + ogs_error("OpenAPI_service_to_pdu_session_parseFromJSON() failed [dnns]"); + goto end; + } + OpenAPI_list_add(dnnsList, ogs_strdup(dnns_local->valuestring)); + } + } + + service_to_pdu_session_local_var = OpenAPI_service_to_pdu_session_create ( + ser_idsList, + pdu_session_type ? pdu_session_type_local_nonprim : NULL, + ssc_mode ? ssc_mode_local_nonprim : NULL, + slice_info ? slice_infoList : NULL, + dnns ? dnnsList : NULL + ); + + return service_to_pdu_session_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/service_to_pdu_session.h b/lib/sbi/openapi/model/service_to_pdu_session.h new file mode 100644 index 0000000000..eb3969786b --- /dev/null +++ b/lib/sbi/openapi/model/service_to_pdu_session.h @@ -0,0 +1,48 @@ +/* + * service_to_pdu_session.h + * + * + */ + +#ifndef _OpenAPI_service_to_pdu_session_H_ +#define _OpenAPI_service_to_pdu_session_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "pdu_session_type.h" +#include "snssai.h" +#include "ssc_mode.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_service_to_pdu_session_s OpenAPI_service_to_pdu_session_t; +typedef struct OpenAPI_service_to_pdu_session_s { + OpenAPI_list_t *ser_ids; + struct OpenAPI_pdu_session_type_s *pdu_session_type; + struct OpenAPI_ssc_mode_s *ssc_mode; + OpenAPI_list_t *slice_info; + OpenAPI_list_t *dnns; +} OpenAPI_service_to_pdu_session_t; + +OpenAPI_service_to_pdu_session_t *OpenAPI_service_to_pdu_session_create( + OpenAPI_list_t *ser_ids, + OpenAPI_pdu_session_type_t *pdu_session_type, + OpenAPI_ssc_mode_t *ssc_mode, + OpenAPI_list_t *slice_info, + OpenAPI_list_t *dnns + ); +void OpenAPI_service_to_pdu_session_free(OpenAPI_service_to_pdu_session_t *service_to_pdu_session); +OpenAPI_service_to_pdu_session_t *OpenAPI_service_to_pdu_session_parseFromJSON(cJSON *service_to_pdu_sessionJSON); +cJSON *OpenAPI_service_to_pdu_session_convertToJSON(OpenAPI_service_to_pdu_session_t *service_to_pdu_session); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_service_to_pdu_session_H_ */ + diff --git a/lib/sbi/openapi/model/service_to_tx.c b/lib/sbi/openapi/model/service_to_tx.c new file mode 100644 index 0000000000..0bfd661838 --- /dev/null +++ b/lib/sbi/openapi/model/service_to_tx.c @@ -0,0 +1,153 @@ + +#include +#include +#include +#include "service_to_tx.h" + +OpenAPI_service_to_tx_t *OpenAPI_service_to_tx_create( + OpenAPI_list_t *ser_ids, + char *tx_profile, + OpenAPI_v2x_rat_type_t *rat + ) +{ + OpenAPI_service_to_tx_t *service_to_tx_local_var = OpenAPI_malloc(sizeof(OpenAPI_service_to_tx_t)); + if (!service_to_tx_local_var) { + return NULL; + } + service_to_tx_local_var->ser_ids = ser_ids; + service_to_tx_local_var->tx_profile = tx_profile; + service_to_tx_local_var->rat = rat; + + return service_to_tx_local_var; +} + +void OpenAPI_service_to_tx_free(OpenAPI_service_to_tx_t *service_to_tx) +{ + if (NULL == service_to_tx) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(service_to_tx->ser_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(service_to_tx->ser_ids); + ogs_free(service_to_tx->tx_profile); + OpenAPI_v2x_rat_type_free(service_to_tx->rat); + ogs_free(service_to_tx); +} + +cJSON *OpenAPI_service_to_tx_convertToJSON(OpenAPI_service_to_tx_t *service_to_tx) +{ + cJSON *item = NULL; + + if (service_to_tx == NULL) { + ogs_error("OpenAPI_service_to_tx_convertToJSON() failed [ServiceToTx]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!service_to_tx->ser_ids) { + ogs_error("OpenAPI_service_to_tx_convertToJSON() failed [ser_ids]"); + goto end; + } + cJSON *ser_ids = cJSON_AddArrayToObject(item, "serIds"); + if (ser_ids == NULL) { + ogs_error("OpenAPI_service_to_tx_convertToJSON() failed [ser_ids]"); + goto end; + } + + OpenAPI_lnode_t *ser_ids_node; + OpenAPI_list_for_each(service_to_tx->ser_ids, ser_ids_node) { + if (cJSON_AddStringToObject(ser_ids, "", (char*)ser_ids_node->data) == NULL) { + ogs_error("OpenAPI_service_to_tx_convertToJSON() failed [ser_ids]"); + goto end; + } + } + + if (!service_to_tx->tx_profile) { + ogs_error("OpenAPI_service_to_tx_convertToJSON() failed [tx_profile]"); + goto end; + } + if (cJSON_AddStringToObject(item, "txProfile", service_to_tx->tx_profile) == NULL) { + ogs_error("OpenAPI_service_to_tx_convertToJSON() failed [tx_profile]"); + goto end; + } + + if (!service_to_tx->rat) { + ogs_error("OpenAPI_service_to_tx_convertToJSON() failed [rat]"); + goto end; + } + cJSON *rat_local_JSON = OpenAPI_v2x_rat_type_convertToJSON(service_to_tx->rat); + if (rat_local_JSON == NULL) { + ogs_error("OpenAPI_service_to_tx_convertToJSON() failed [rat]"); + goto end; + } + cJSON_AddItemToObject(item, "rat", rat_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_service_to_tx_convertToJSON() failed [rat]"); + goto end; + } + +end: + return item; +} + +OpenAPI_service_to_tx_t *OpenAPI_service_to_tx_parseFromJSON(cJSON *service_to_txJSON) +{ + OpenAPI_service_to_tx_t *service_to_tx_local_var = NULL; + cJSON *ser_ids = cJSON_GetObjectItemCaseSensitive(service_to_txJSON, "serIds"); + if (!ser_ids) { + ogs_error("OpenAPI_service_to_tx_parseFromJSON() failed [ser_ids]"); + goto end; + } + + OpenAPI_list_t *ser_idsList; + + cJSON *ser_ids_local; + if (!cJSON_IsArray(ser_ids)) { + ogs_error("OpenAPI_service_to_tx_parseFromJSON() failed [ser_ids]"); + goto end; + } + ser_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ser_ids_local, ser_ids) { + if (!cJSON_IsString(ser_ids_local)) { + ogs_error("OpenAPI_service_to_tx_parseFromJSON() failed [ser_ids]"); + goto end; + } + OpenAPI_list_add(ser_idsList, ogs_strdup(ser_ids_local->valuestring)); + } + + cJSON *tx_profile = cJSON_GetObjectItemCaseSensitive(service_to_txJSON, "txProfile"); + if (!tx_profile) { + ogs_error("OpenAPI_service_to_tx_parseFromJSON() failed [tx_profile]"); + goto end; + } + + + if (!cJSON_IsString(tx_profile)) { + ogs_error("OpenAPI_service_to_tx_parseFromJSON() failed [tx_profile]"); + goto end; + } + + cJSON *rat = cJSON_GetObjectItemCaseSensitive(service_to_txJSON, "rat"); + if (!rat) { + ogs_error("OpenAPI_service_to_tx_parseFromJSON() failed [rat]"); + goto end; + } + + OpenAPI_v2x_rat_type_t *rat_local_nonprim = NULL; + + rat_local_nonprim = OpenAPI_v2x_rat_type_parseFromJSON(rat); + + service_to_tx_local_var = OpenAPI_service_to_tx_create ( + ser_idsList, + ogs_strdup(tx_profile->valuestring), + rat_local_nonprim + ); + + return service_to_tx_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/service_to_tx.h b/lib/sbi/openapi/model/service_to_tx.h new file mode 100644 index 0000000000..cfbb363d1d --- /dev/null +++ b/lib/sbi/openapi/model/service_to_tx.h @@ -0,0 +1,42 @@ +/* + * service_to_tx.h + * + * + */ + +#ifndef _OpenAPI_service_to_tx_H_ +#define _OpenAPI_service_to_tx_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "v2x_rat_type.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_service_to_tx_s OpenAPI_service_to_tx_t; +typedef struct OpenAPI_service_to_tx_s { + OpenAPI_list_t *ser_ids; + char *tx_profile; + struct OpenAPI_v2x_rat_type_s *rat; +} OpenAPI_service_to_tx_t; + +OpenAPI_service_to_tx_t *OpenAPI_service_to_tx_create( + OpenAPI_list_t *ser_ids, + char *tx_profile, + OpenAPI_v2x_rat_type_t *rat + ); +void OpenAPI_service_to_tx_free(OpenAPI_service_to_tx_t *service_to_tx); +OpenAPI_service_to_tx_t *OpenAPI_service_to_tx_parseFromJSON(cJSON *service_to_txJSON); +cJSON *OpenAPI_service_to_tx_convertToJSON(OpenAPI_service_to_tx_t *service_to_tx); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_service_to_tx_H_ */ + diff --git a/lib/sbi/openapi/model/service_type_unrelated_class.c b/lib/sbi/openapi/model/service_type_unrelated_class.c new file mode 100644 index 0000000000..ced490a26b --- /dev/null +++ b/lib/sbi/openapi/model/service_type_unrelated_class.c @@ -0,0 +1,191 @@ + +#include +#include +#include +#include "service_type_unrelated_class.h" + +OpenAPI_service_type_unrelated_class_t *OpenAPI_service_type_unrelated_class_create( + int service_type, + 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_service_type_unrelated_class_t *service_type_unrelated_class_local_var = OpenAPI_malloc(sizeof(OpenAPI_service_type_unrelated_class_t)); + if (!service_type_unrelated_class_local_var) { + return NULL; + } + service_type_unrelated_class_local_var->service_type = service_type; + service_type_unrelated_class_local_var->allowed_geographic_area = allowed_geographic_area; + service_type_unrelated_class_local_var->privacy_check_related_action = privacy_check_related_action; + service_type_unrelated_class_local_var->code_word_ind = code_word_ind; + service_type_unrelated_class_local_var->valid_time_period = valid_time_period; + + return service_type_unrelated_class_local_var; +} + +void OpenAPI_service_type_unrelated_class_free(OpenAPI_service_type_unrelated_class_t *service_type_unrelated_class) +{ + if (NULL == service_type_unrelated_class) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(service_type_unrelated_class->allowed_geographic_area, node) { + OpenAPI_geographic_area_free(node->data); + } + OpenAPI_list_free(service_type_unrelated_class->allowed_geographic_area); + OpenAPI_valid_time_period_free(service_type_unrelated_class->valid_time_period); + ogs_free(service_type_unrelated_class); +} + +cJSON *OpenAPI_service_type_unrelated_class_convertToJSON(OpenAPI_service_type_unrelated_class_t *service_type_unrelated_class) +{ + cJSON *item = NULL; + + if (service_type_unrelated_class == NULL) { + ogs_error("OpenAPI_service_type_unrelated_class_convertToJSON() failed [ServiceTypeUnrelatedClass]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!service_type_unrelated_class->service_type) { + ogs_error("OpenAPI_service_type_unrelated_class_convertToJSON() failed [service_type]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "serviceType", service_type_unrelated_class->service_type) == NULL) { + ogs_error("OpenAPI_service_type_unrelated_class_convertToJSON() failed [service_type]"); + goto end; + } + + if (service_type_unrelated_class->allowed_geographic_area) { + cJSON *allowed_geographic_areaList = cJSON_AddArrayToObject(item, "allowedGeographicArea"); + if (allowed_geographic_areaList == NULL) { + ogs_error("OpenAPI_service_type_unrelated_class_convertToJSON() failed [allowed_geographic_area]"); + goto end; + } + + OpenAPI_lnode_t *allowed_geographic_area_node; + if (service_type_unrelated_class->allowed_geographic_area) { + OpenAPI_list_for_each(service_type_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_service_type_unrelated_class_convertToJSON() failed [allowed_geographic_area]"); + goto end; + } + cJSON_AddItemToArray(allowed_geographic_areaList, itemLocal); + } + } + } + + if (service_type_unrelated_class->privacy_check_related_action) { + if (cJSON_AddStringToObject(item, "privacyCheckRelatedAction", OpenAPI_privacy_check_related_action_ToString(service_type_unrelated_class->privacy_check_related_action)) == NULL) { + ogs_error("OpenAPI_service_type_unrelated_class_convertToJSON() failed [privacy_check_related_action]"); + goto end; + } + } + + if (service_type_unrelated_class->code_word_ind) { + if (cJSON_AddStringToObject(item, "codeWordInd", OpenAPI_code_word_ind_ToString(service_type_unrelated_class->code_word_ind)) == NULL) { + ogs_error("OpenAPI_service_type_unrelated_class_convertToJSON() failed [code_word_ind]"); + goto end; + } + } + + if (service_type_unrelated_class->valid_time_period) { + cJSON *valid_time_period_local_JSON = OpenAPI_valid_time_period_convertToJSON(service_type_unrelated_class->valid_time_period); + if (valid_time_period_local_JSON == NULL) { + ogs_error("OpenAPI_service_type_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_service_type_unrelated_class_convertToJSON() failed [valid_time_period]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_service_type_unrelated_class_t *OpenAPI_service_type_unrelated_class_parseFromJSON(cJSON *service_type_unrelated_classJSON) +{ + OpenAPI_service_type_unrelated_class_t *service_type_unrelated_class_local_var = NULL; + cJSON *service_type = cJSON_GetObjectItemCaseSensitive(service_type_unrelated_classJSON, "serviceType"); + if (!service_type) { + ogs_error("OpenAPI_service_type_unrelated_class_parseFromJSON() failed [service_type]"); + goto end; + } + + + if (!cJSON_IsNumber(service_type)) { + ogs_error("OpenAPI_service_type_unrelated_class_parseFromJSON() failed [service_type]"); + goto end; + } + + cJSON *allowed_geographic_area = cJSON_GetObjectItemCaseSensitive(service_type_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_service_type_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_service_type_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(service_type_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_service_type_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(service_type_unrelated_classJSON, "codeWordInd"); + + OpenAPI_code_word_ind_e code_word_indVariable; + if (code_word_ind) { + if (!cJSON_IsString(code_word_ind)) { + ogs_error("OpenAPI_service_type_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(service_type_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); + } + + service_type_unrelated_class_local_var = OpenAPI_service_type_unrelated_class_create ( + service_type->valuedouble, + 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 service_type_unrelated_class_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/service_type_unrelated_class.h b/lib/sbi/openapi/model/service_type_unrelated_class.h new file mode 100644 index 0000000000..04cbe84172 --- /dev/null +++ b/lib/sbi/openapi/model/service_type_unrelated_class.h @@ -0,0 +1,49 @@ +/* + * service_type_unrelated_class.h + * + * + */ + +#ifndef _OpenAPI_service_type_unrelated_class_H_ +#define _OpenAPI_service_type_unrelated_class_H_ + +#include +#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_service_type_unrelated_class_s OpenAPI_service_type_unrelated_class_t; +typedef struct OpenAPI_service_type_unrelated_class_s { + int service_type; + 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_service_type_unrelated_class_t; + +OpenAPI_service_type_unrelated_class_t *OpenAPI_service_type_unrelated_class_create( + int service_type, + 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_service_type_unrelated_class_free(OpenAPI_service_type_unrelated_class_t *service_type_unrelated_class); +OpenAPI_service_type_unrelated_class_t *OpenAPI_service_type_unrelated_class_parseFromJSON(cJSON *service_type_unrelated_classJSON); +cJSON *OpenAPI_service_type_unrelated_class_convertToJSON(OpenAPI_service_type_unrelated_class_t *service_type_unrelated_class); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_service_type_unrelated_class_H_ */ + diff --git a/lib/sbi/openapi/model/session_management_subscription_data.c b/lib/sbi/openapi/model/session_management_subscription_data.c new file mode 100644 index 0000000000..740ed03601 --- /dev/null +++ b/lib/sbi/openapi/model/session_management_subscription_data.c @@ -0,0 +1,484 @@ + +#include +#include +#include +#include "session_management_subscription_data.h" + +OpenAPI_session_management_subscription_data_t *OpenAPI_session_management_subscription_data_create( + OpenAPI_snssai_t *single_nssai, + OpenAPI_list_t* dnn_configurations, + OpenAPI_list_t *internal_group_ids, + OpenAPI_list_t* vn_group_info, + OpenAPI_list_t* shared_vn_group_data_ids, + char *shared_dnn_configurations_id, + OpenAPI_odb_packet_services_t *odb_packet_services, + OpenAPI_trace_data_t *trace_data, + char *shared_trace_data_id, + OpenAPI_list_t* expected_ue_behaviours_list, + OpenAPI_list_t* suggested_packet_num_dl_list, + char *_3gpp_charging_characteristics + ) +{ + OpenAPI_session_management_subscription_data_t *session_management_subscription_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_session_management_subscription_data_t)); + if (!session_management_subscription_data_local_var) { + return NULL; + } + session_management_subscription_data_local_var->single_nssai = single_nssai; + session_management_subscription_data_local_var->dnn_configurations = dnn_configurations; + session_management_subscription_data_local_var->internal_group_ids = internal_group_ids; + session_management_subscription_data_local_var->vn_group_info = vn_group_info; + session_management_subscription_data_local_var->shared_vn_group_data_ids = shared_vn_group_data_ids; + session_management_subscription_data_local_var->shared_dnn_configurations_id = shared_dnn_configurations_id; + session_management_subscription_data_local_var->odb_packet_services = odb_packet_services; + session_management_subscription_data_local_var->trace_data = trace_data; + session_management_subscription_data_local_var->shared_trace_data_id = shared_trace_data_id; + session_management_subscription_data_local_var->expected_ue_behaviours_list = expected_ue_behaviours_list; + session_management_subscription_data_local_var->suggested_packet_num_dl_list = suggested_packet_num_dl_list; + session_management_subscription_data_local_var->_3gpp_charging_characteristics = _3gpp_charging_characteristics; + + return session_management_subscription_data_local_var; +} + +void OpenAPI_session_management_subscription_data_free(OpenAPI_session_management_subscription_data_t *session_management_subscription_data) +{ + if (NULL == session_management_subscription_data) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_snssai_free(session_management_subscription_data->single_nssai); + OpenAPI_list_for_each(session_management_subscription_data->dnn_configurations, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_dnn_configuration_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(session_management_subscription_data->dnn_configurations); + OpenAPI_list_for_each(session_management_subscription_data->internal_group_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(session_management_subscription_data->internal_group_ids); + OpenAPI_list_for_each(session_management_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(session_management_subscription_data->vn_group_info); + OpenAPI_list_for_each(session_management_subscription_data->shared_vn_group_data_ids, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(session_management_subscription_data->shared_vn_group_data_ids); + ogs_free(session_management_subscription_data->shared_dnn_configurations_id); + OpenAPI_odb_packet_services_free(session_management_subscription_data->odb_packet_services); + OpenAPI_trace_data_free(session_management_subscription_data->trace_data); + ogs_free(session_management_subscription_data->shared_trace_data_id); + OpenAPI_list_for_each(session_management_subscription_data->expected_ue_behaviours_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_expected_ue_behaviour_data_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(session_management_subscription_data->expected_ue_behaviours_list); + OpenAPI_list_for_each(session_management_subscription_data->suggested_packet_num_dl_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_suggested_packet_num_dl_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(session_management_subscription_data->suggested_packet_num_dl_list); + ogs_free(session_management_subscription_data->_3gpp_charging_characteristics); + ogs_free(session_management_subscription_data); +} + +cJSON *OpenAPI_session_management_subscription_data_convertToJSON(OpenAPI_session_management_subscription_data_t *session_management_subscription_data) +{ + cJSON *item = NULL; + + if (session_management_subscription_data == NULL) { + ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [SessionManagementSubscriptionData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!session_management_subscription_data->single_nssai) { + ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [single_nssai]"); + goto end; + } + cJSON *single_nssai_local_JSON = OpenAPI_snssai_convertToJSON(session_management_subscription_data->single_nssai); + if (single_nssai_local_JSON == NULL) { + ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [single_nssai]"); + goto end; + } + cJSON_AddItemToObject(item, "singleNssai", single_nssai_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [single_nssai]"); + goto end; + } + + if (session_management_subscription_data->dnn_configurations) { + cJSON *dnn_configurations = cJSON_AddObjectToObject(item, "dnnConfigurations"); + if (dnn_configurations == NULL) { + ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [dnn_configurations]"); + goto end; + } + cJSON *localMapObject = dnn_configurations; + OpenAPI_lnode_t *dnn_configurations_node; + if (session_management_subscription_data->dnn_configurations) { + OpenAPI_list_for_each(session_management_subscription_data->dnn_configurations, dnn_configurations_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)dnn_configurations_node->data; + cJSON *itemLocal = OpenAPI_dnn_configuration_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [dnn_configurations]"); + goto end; + } + cJSON_AddItemToObject(dnn_configurations, localKeyValue->key, itemLocal); + } + } + } + + if (session_management_subscription_data->internal_group_ids) { + cJSON *internal_group_ids = cJSON_AddArrayToObject(item, "internalGroupIds"); + if (internal_group_ids == NULL) { + ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [internal_group_ids]"); + goto end; + } + + OpenAPI_lnode_t *internal_group_ids_node; + OpenAPI_list_for_each(session_management_subscription_data->internal_group_ids, internal_group_ids_node) { + if (cJSON_AddStringToObject(internal_group_ids, "", (char*)internal_group_ids_node->data) == NULL) { + ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [internal_group_ids]"); + goto end; + } + } + } + + if (session_management_subscription_data->vn_group_info) { + cJSON *vn_group_info = cJSON_AddObjectToObject(item, "vnGroupInfo"); + if (vn_group_info == NULL) { + ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [vn_group_info]"); + goto end; + } + cJSON *localMapObject = vn_group_info; + OpenAPI_lnode_t *vn_group_info_node; + if (session_management_subscription_data->vn_group_info) { + OpenAPI_list_for_each(session_management_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_session_management_subscription_data_convertToJSON() failed [vn_group_info]"); + goto end; + } + cJSON_AddItemToObject(vn_group_info, localKeyValue->key, itemLocal); + } + } + } + + if (session_management_subscription_data->shared_vn_group_data_ids) { + cJSON *shared_vn_group_data_ids = cJSON_AddObjectToObject(item, "sharedVnGroupDataIds"); + if (shared_vn_group_data_ids == NULL) { + ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [shared_vn_group_data_ids]"); + goto end; + } + cJSON *localMapObject = shared_vn_group_data_ids; + OpenAPI_lnode_t *shared_vn_group_data_ids_node; + if (session_management_subscription_data->shared_vn_group_data_ids) { + OpenAPI_list_for_each(session_management_subscription_data->shared_vn_group_data_ids, shared_vn_group_data_ids_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)shared_vn_group_data_ids_node->data; + } + } + } + + if (session_management_subscription_data->shared_dnn_configurations_id) { + if (cJSON_AddStringToObject(item, "sharedDnnConfigurationsId", session_management_subscription_data->shared_dnn_configurations_id) == NULL) { + ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [shared_dnn_configurations_id]"); + goto end; + } + } + + if (session_management_subscription_data->odb_packet_services) { + cJSON *odb_packet_services_local_JSON = OpenAPI_odb_packet_services_convertToJSON(session_management_subscription_data->odb_packet_services); + if (odb_packet_services_local_JSON == NULL) { + ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [odb_packet_services]"); + goto end; + } + cJSON_AddItemToObject(item, "odbPacketServices", odb_packet_services_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [odb_packet_services]"); + goto end; + } + } + + if (session_management_subscription_data->trace_data) { + cJSON *trace_data_local_JSON = OpenAPI_trace_data_convertToJSON(session_management_subscription_data->trace_data); + if (trace_data_local_JSON == NULL) { + ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [trace_data]"); + goto end; + } + cJSON_AddItemToObject(item, "traceData", trace_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [trace_data]"); + goto end; + } + } + + if (session_management_subscription_data->shared_trace_data_id) { + if (cJSON_AddStringToObject(item, "sharedTraceDataId", session_management_subscription_data->shared_trace_data_id) == NULL) { + ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [shared_trace_data_id]"); + goto end; + } + } + + if (session_management_subscription_data->expected_ue_behaviours_list) { + cJSON *expected_ue_behaviours_list = cJSON_AddObjectToObject(item, "expectedUeBehavioursList"); + if (expected_ue_behaviours_list == NULL) { + ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [expected_ue_behaviours_list]"); + goto end; + } + cJSON *localMapObject = expected_ue_behaviours_list; + OpenAPI_lnode_t *expected_ue_behaviours_list_node; + if (session_management_subscription_data->expected_ue_behaviours_list) { + OpenAPI_list_for_each(session_management_subscription_data->expected_ue_behaviours_list, expected_ue_behaviours_list_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)expected_ue_behaviours_list_node->data; + cJSON *itemLocal = OpenAPI_expected_ue_behaviour_data_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [expected_ue_behaviours_list]"); + goto end; + } + cJSON_AddItemToObject(expected_ue_behaviours_list, localKeyValue->key, itemLocal); + } + } + } + + if (session_management_subscription_data->suggested_packet_num_dl_list) { + cJSON *suggested_packet_num_dl_list = cJSON_AddObjectToObject(item, "suggestedPacketNumDlList"); + if (suggested_packet_num_dl_list == NULL) { + ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [suggested_packet_num_dl_list]"); + goto end; + } + cJSON *localMapObject = suggested_packet_num_dl_list; + OpenAPI_lnode_t *suggested_packet_num_dl_list_node; + if (session_management_subscription_data->suggested_packet_num_dl_list) { + OpenAPI_list_for_each(session_management_subscription_data->suggested_packet_num_dl_list, suggested_packet_num_dl_list_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)suggested_packet_num_dl_list_node->data; + cJSON *itemLocal = OpenAPI_suggested_packet_num_dl_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [suggested_packet_num_dl_list]"); + goto end; + } + cJSON_AddItemToObject(suggested_packet_num_dl_list, localKeyValue->key, itemLocal); + } + } + } + + if (session_management_subscription_data->_3gpp_charging_characteristics) { + if (cJSON_AddStringToObject(item, "3gppChargingCharacteristics", session_management_subscription_data->_3gpp_charging_characteristics) == NULL) { + ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [_3gpp_charging_characteristics]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_session_management_subscription_data_t *OpenAPI_session_management_subscription_data_parseFromJSON(cJSON *session_management_subscription_dataJSON) +{ + OpenAPI_session_management_subscription_data_t *session_management_subscription_data_local_var = NULL; + cJSON *single_nssai = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "singleNssai"); + if (!single_nssai) { + ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [single_nssai]"); + goto end; + } + + OpenAPI_snssai_t *single_nssai_local_nonprim = NULL; + + single_nssai_local_nonprim = OpenAPI_snssai_parseFromJSON(single_nssai); + + cJSON *dnn_configurations = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "dnnConfigurations"); + + OpenAPI_list_t *dnn_configurationsList; + if (dnn_configurations) { + cJSON *dnn_configurations_local_map; + if (!cJSON_IsObject(dnn_configurations)) { + ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [dnn_configurations]"); + goto end; + } + dnn_configurationsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(dnn_configurations_local_map, dnn_configurations) { + cJSON *localMapObject = dnn_configurations_local_map; + if (!cJSON_IsObject(dnn_configurations_local_map)) { + ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [dnn_configurations]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_dnn_configuration_parseFromJSON(localMapObject)); + OpenAPI_list_add(dnn_configurationsList, localMapKeyPair); + } + } + + cJSON *internal_group_ids = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "internalGroupIds"); + + OpenAPI_list_t *internal_group_idsList; + if (internal_group_ids) { + cJSON *internal_group_ids_local; + if (!cJSON_IsArray(internal_group_ids)) { + ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [internal_group_ids]"); + goto end; + } + internal_group_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(internal_group_ids_local, internal_group_ids) { + if (!cJSON_IsString(internal_group_ids_local)) { + ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [internal_group_ids]"); + goto end; + } + OpenAPI_list_add(internal_group_idsList, ogs_strdup(internal_group_ids_local->valuestring)); + } + } + + cJSON *vn_group_info = cJSON_GetObjectItemCaseSensitive(session_management_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_session_management_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_session_management_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(session_management_subscription_dataJSON, "sharedVnGroupDataIds"); + + OpenAPI_list_t *shared_vn_group_data_idsList; + if (shared_vn_group_data_ids) { + cJSON *shared_vn_group_data_ids_local_map; + if (!cJSON_IsObject(shared_vn_group_data_ids)) { + ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [shared_vn_group_data_ids]"); + goto end; + } + shared_vn_group_data_idsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(shared_vn_group_data_ids_local_map, shared_vn_group_data_ids) { + cJSON *localMapObject = shared_vn_group_data_ids_local_map; + OpenAPI_list_add(shared_vn_group_data_idsList, localMapKeyPair); + } + } + + cJSON *shared_dnn_configurations_id = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "sharedDnnConfigurationsId"); + + if (shared_dnn_configurations_id) { + if (!cJSON_IsString(shared_dnn_configurations_id)) { + ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [shared_dnn_configurations_id]"); + goto end; + } + } + + cJSON *odb_packet_services = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "odbPacketServices"); + + OpenAPI_odb_packet_services_t *odb_packet_services_local_nonprim = NULL; + if (odb_packet_services) { + odb_packet_services_local_nonprim = OpenAPI_odb_packet_services_parseFromJSON(odb_packet_services); + } + + cJSON *trace_data = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "traceData"); + + OpenAPI_trace_data_t *trace_data_local_nonprim = NULL; + if (trace_data) { + trace_data_local_nonprim = OpenAPI_trace_data_parseFromJSON(trace_data); + } + + cJSON *shared_trace_data_id = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "sharedTraceDataId"); + + if (shared_trace_data_id) { + if (!cJSON_IsString(shared_trace_data_id)) { + ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [shared_trace_data_id]"); + goto end; + } + } + + cJSON *expected_ue_behaviours_list = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "expectedUeBehavioursList"); + + OpenAPI_list_t *expected_ue_behaviours_listList; + if (expected_ue_behaviours_list) { + cJSON *expected_ue_behaviours_list_local_map; + if (!cJSON_IsObject(expected_ue_behaviours_list)) { + ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [expected_ue_behaviours_list]"); + goto end; + } + expected_ue_behaviours_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(expected_ue_behaviours_list_local_map, expected_ue_behaviours_list) { + cJSON *localMapObject = expected_ue_behaviours_list_local_map; + if (!cJSON_IsObject(expected_ue_behaviours_list_local_map)) { + ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [expected_ue_behaviours_list]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_expected_ue_behaviour_data_parseFromJSON(localMapObject)); + OpenAPI_list_add(expected_ue_behaviours_listList, localMapKeyPair); + } + } + + cJSON *suggested_packet_num_dl_list = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "suggestedPacketNumDlList"); + + OpenAPI_list_t *suggested_packet_num_dl_listList; + if (suggested_packet_num_dl_list) { + cJSON *suggested_packet_num_dl_list_local_map; + if (!cJSON_IsObject(suggested_packet_num_dl_list)) { + ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [suggested_packet_num_dl_list]"); + goto end; + } + suggested_packet_num_dl_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(suggested_packet_num_dl_list_local_map, suggested_packet_num_dl_list) { + cJSON *localMapObject = suggested_packet_num_dl_list_local_map; + if (!cJSON_IsObject(suggested_packet_num_dl_list_local_map)) { + ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [suggested_packet_num_dl_list]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_suggested_packet_num_dl_parseFromJSON(localMapObject)); + OpenAPI_list_add(suggested_packet_num_dl_listList, localMapKeyPair); + } + } + + cJSON *_3gpp_charging_characteristics = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "3gppChargingCharacteristics"); + + if (_3gpp_charging_characteristics) { + if (!cJSON_IsString(_3gpp_charging_characteristics)) { + ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [_3gpp_charging_characteristics]"); + goto end; + } + } + + session_management_subscription_data_local_var = OpenAPI_session_management_subscription_data_create ( + single_nssai_local_nonprim, + dnn_configurations ? dnn_configurationsList : 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, + shared_dnn_configurations_id ? ogs_strdup(shared_dnn_configurations_id->valuestring) : NULL, + odb_packet_services ? odb_packet_services_local_nonprim : NULL, + trace_data ? trace_data_local_nonprim : NULL, + shared_trace_data_id ? ogs_strdup(shared_trace_data_id->valuestring) : NULL, + expected_ue_behaviours_list ? expected_ue_behaviours_listList : NULL, + suggested_packet_num_dl_list ? suggested_packet_num_dl_listList : NULL, + _3gpp_charging_characteristics ? ogs_strdup(_3gpp_charging_characteristics->valuestring) : NULL + ); + + return session_management_subscription_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/session_management_subscription_data.h b/lib/sbi/openapi/model/session_management_subscription_data.h new file mode 100644 index 0000000000..a6c41f13d7 --- /dev/null +++ b/lib/sbi/openapi/model/session_management_subscription_data.h @@ -0,0 +1,66 @@ +/* + * session_management_subscription_data.h + * + * + */ + +#ifndef _OpenAPI_session_management_subscription_data_H_ +#define _OpenAPI_session_management_subscription_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "dnn_configuration.h" +#include "expected_ue_behaviour_data.h" +#include "odb_packet_services.h" +#include "snssai.h" +#include "suggested_packet_num_dl.h" +#include "trace_data.h" +#include "vn_group_data.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_session_management_subscription_data_s OpenAPI_session_management_subscription_data_t; +typedef struct OpenAPI_session_management_subscription_data_s { + struct OpenAPI_snssai_s *single_nssai; + OpenAPI_list_t* dnn_configurations; + OpenAPI_list_t *internal_group_ids; + OpenAPI_list_t* vn_group_info; + OpenAPI_list_t* shared_vn_group_data_ids; + char *shared_dnn_configurations_id; + struct OpenAPI_odb_packet_services_s *odb_packet_services; + struct OpenAPI_trace_data_s *trace_data; + char *shared_trace_data_id; + OpenAPI_list_t* expected_ue_behaviours_list; + OpenAPI_list_t* suggested_packet_num_dl_list; + char *_3gpp_charging_characteristics; +} OpenAPI_session_management_subscription_data_t; + +OpenAPI_session_management_subscription_data_t *OpenAPI_session_management_subscription_data_create( + OpenAPI_snssai_t *single_nssai, + OpenAPI_list_t* dnn_configurations, + OpenAPI_list_t *internal_group_ids, + OpenAPI_list_t* vn_group_info, + OpenAPI_list_t* shared_vn_group_data_ids, + char *shared_dnn_configurations_id, + OpenAPI_odb_packet_services_t *odb_packet_services, + OpenAPI_trace_data_t *trace_data, + char *shared_trace_data_id, + OpenAPI_list_t* expected_ue_behaviours_list, + OpenAPI_list_t* suggested_packet_num_dl_list, + char *_3gpp_charging_characteristics + ); +void OpenAPI_session_management_subscription_data_free(OpenAPI_session_management_subscription_data_t *session_management_subscription_data); +OpenAPI_session_management_subscription_data_t *OpenAPI_session_management_subscription_data_parseFromJSON(cJSON *session_management_subscription_dataJSON); +cJSON *OpenAPI_session_management_subscription_data_convertToJSON(OpenAPI_session_management_subscription_data_t *session_management_subscription_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_session_management_subscription_data_H_ */ + diff --git a/lib/sbi/openapi/model/shared_data.c b/lib/sbi/openapi/model/shared_data.c new file mode 100644 index 0000000000..452e8ce578 --- /dev/null +++ b/lib/sbi/openapi/model/shared_data.c @@ -0,0 +1,331 @@ + +#include +#include +#include +#include "shared_data.h" + +OpenAPI_shared_data_t *OpenAPI_shared_data_create( + char *shared_data_id, + OpenAPI_access_and_mobility_subscription_data_t *shared_am_data, + OpenAPI_sms_subscription_data_t *shared_sms_subs_data, + OpenAPI_sms_management_subscription_data_t *shared_sms_mng_subs_data, + OpenAPI_list_t* shared_dnn_configurations, + OpenAPI_trace_data_t *shared_trace_data, + OpenAPI_list_t* shared_snssai_infos, + OpenAPI_list_t* shared_vn_group_datas + ) +{ + OpenAPI_shared_data_t *shared_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_shared_data_t)); + if (!shared_data_local_var) { + return NULL; + } + shared_data_local_var->shared_data_id = shared_data_id; + shared_data_local_var->shared_am_data = shared_am_data; + shared_data_local_var->shared_sms_subs_data = shared_sms_subs_data; + shared_data_local_var->shared_sms_mng_subs_data = shared_sms_mng_subs_data; + shared_data_local_var->shared_dnn_configurations = shared_dnn_configurations; + shared_data_local_var->shared_trace_data = shared_trace_data; + shared_data_local_var->shared_snssai_infos = shared_snssai_infos; + shared_data_local_var->shared_vn_group_datas = shared_vn_group_datas; + + return shared_data_local_var; +} + +void OpenAPI_shared_data_free(OpenAPI_shared_data_t *shared_data) +{ + if (NULL == shared_data) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(shared_data->shared_data_id); + OpenAPI_access_and_mobility_subscription_data_free(shared_data->shared_am_data); + OpenAPI_sms_subscription_data_free(shared_data->shared_sms_subs_data); + OpenAPI_sms_management_subscription_data_free(shared_data->shared_sms_mng_subs_data); + OpenAPI_list_for_each(shared_data->shared_dnn_configurations, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_dnn_configuration_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(shared_data->shared_dnn_configurations); + OpenAPI_trace_data_free(shared_data->shared_trace_data); + OpenAPI_list_for_each(shared_data->shared_snssai_infos, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_snssai_info_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(shared_data->shared_snssai_infos); + OpenAPI_list_for_each(shared_data->shared_vn_group_datas, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_vn_group_data_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(shared_data->shared_vn_group_datas); + ogs_free(shared_data); +} + +cJSON *OpenAPI_shared_data_convertToJSON(OpenAPI_shared_data_t *shared_data) +{ + cJSON *item = NULL; + + if (shared_data == NULL) { + ogs_error("OpenAPI_shared_data_convertToJSON() failed [SharedData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!shared_data->shared_data_id) { + ogs_error("OpenAPI_shared_data_convertToJSON() failed [shared_data_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "sharedDataId", shared_data->shared_data_id) == NULL) { + ogs_error("OpenAPI_shared_data_convertToJSON() failed [shared_data_id]"); + goto end; + } + + if (shared_data->shared_am_data) { + cJSON *shared_am_data_local_JSON = OpenAPI_access_and_mobility_subscription_data_convertToJSON(shared_data->shared_am_data); + if (shared_am_data_local_JSON == NULL) { + ogs_error("OpenAPI_shared_data_convertToJSON() failed [shared_am_data]"); + goto end; + } + cJSON_AddItemToObject(item, "sharedAmData", shared_am_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_shared_data_convertToJSON() failed [shared_am_data]"); + goto end; + } + } + + if (shared_data->shared_sms_subs_data) { + cJSON *shared_sms_subs_data_local_JSON = OpenAPI_sms_subscription_data_convertToJSON(shared_data->shared_sms_subs_data); + if (shared_sms_subs_data_local_JSON == NULL) { + ogs_error("OpenAPI_shared_data_convertToJSON() failed [shared_sms_subs_data]"); + goto end; + } + cJSON_AddItemToObject(item, "sharedSmsSubsData", shared_sms_subs_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_shared_data_convertToJSON() failed [shared_sms_subs_data]"); + goto end; + } + } + + if (shared_data->shared_sms_mng_subs_data) { + cJSON *shared_sms_mng_subs_data_local_JSON = OpenAPI_sms_management_subscription_data_convertToJSON(shared_data->shared_sms_mng_subs_data); + if (shared_sms_mng_subs_data_local_JSON == NULL) { + ogs_error("OpenAPI_shared_data_convertToJSON() failed [shared_sms_mng_subs_data]"); + goto end; + } + cJSON_AddItemToObject(item, "sharedSmsMngSubsData", shared_sms_mng_subs_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_shared_data_convertToJSON() failed [shared_sms_mng_subs_data]"); + goto end; + } + } + + if (shared_data->shared_dnn_configurations) { + cJSON *shared_dnn_configurations = cJSON_AddObjectToObject(item, "sharedDnnConfigurations"); + if (shared_dnn_configurations == NULL) { + ogs_error("OpenAPI_shared_data_convertToJSON() failed [shared_dnn_configurations]"); + goto end; + } + cJSON *localMapObject = shared_dnn_configurations; + OpenAPI_lnode_t *shared_dnn_configurations_node; + if (shared_data->shared_dnn_configurations) { + OpenAPI_list_for_each(shared_data->shared_dnn_configurations, shared_dnn_configurations_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)shared_dnn_configurations_node->data; + cJSON *itemLocal = OpenAPI_dnn_configuration_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_shared_data_convertToJSON() failed [shared_dnn_configurations]"); + goto end; + } + cJSON_AddItemToObject(shared_dnn_configurations, localKeyValue->key, itemLocal); + } + } + } + + if (shared_data->shared_trace_data) { + cJSON *shared_trace_data_local_JSON = OpenAPI_trace_data_convertToJSON(shared_data->shared_trace_data); + if (shared_trace_data_local_JSON == NULL) { + ogs_error("OpenAPI_shared_data_convertToJSON() failed [shared_trace_data]"); + goto end; + } + cJSON_AddItemToObject(item, "sharedTraceData", shared_trace_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_shared_data_convertToJSON() failed [shared_trace_data]"); + goto end; + } + } + + if (shared_data->shared_snssai_infos) { + cJSON *shared_snssai_infos = cJSON_AddObjectToObject(item, "sharedSnssaiInfos"); + if (shared_snssai_infos == NULL) { + ogs_error("OpenAPI_shared_data_convertToJSON() failed [shared_snssai_infos]"); + goto end; + } + cJSON *localMapObject = shared_snssai_infos; + OpenAPI_lnode_t *shared_snssai_infos_node; + if (shared_data->shared_snssai_infos) { + OpenAPI_list_for_each(shared_data->shared_snssai_infos, shared_snssai_infos_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)shared_snssai_infos_node->data; + cJSON *itemLocal = OpenAPI_snssai_info_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_shared_data_convertToJSON() failed [shared_snssai_infos]"); + goto end; + } + cJSON_AddItemToObject(shared_snssai_infos, localKeyValue->key, itemLocal); + } + } + } + + if (shared_data->shared_vn_group_datas) { + cJSON *shared_vn_group_datas = cJSON_AddObjectToObject(item, "sharedVnGroupDatas"); + if (shared_vn_group_datas == NULL) { + ogs_error("OpenAPI_shared_data_convertToJSON() failed [shared_vn_group_datas]"); + goto end; + } + cJSON *localMapObject = shared_vn_group_datas; + OpenAPI_lnode_t *shared_vn_group_datas_node; + if (shared_data->shared_vn_group_datas) { + OpenAPI_list_for_each(shared_data->shared_vn_group_datas, shared_vn_group_datas_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)shared_vn_group_datas_node->data; + cJSON *itemLocal = OpenAPI_vn_group_data_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_shared_data_convertToJSON() failed [shared_vn_group_datas]"); + goto end; + } + cJSON_AddItemToObject(shared_vn_group_datas, localKeyValue->key, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_shared_data_t *OpenAPI_shared_data_parseFromJSON(cJSON *shared_dataJSON) +{ + OpenAPI_shared_data_t *shared_data_local_var = NULL; + cJSON *shared_data_id = cJSON_GetObjectItemCaseSensitive(shared_dataJSON, "sharedDataId"); + if (!shared_data_id) { + ogs_error("OpenAPI_shared_data_parseFromJSON() failed [shared_data_id]"); + goto end; + } + + + if (!cJSON_IsString(shared_data_id)) { + ogs_error("OpenAPI_shared_data_parseFromJSON() failed [shared_data_id]"); + goto end; + } + + cJSON *shared_am_data = cJSON_GetObjectItemCaseSensitive(shared_dataJSON, "sharedAmData"); + + OpenAPI_access_and_mobility_subscription_data_t *shared_am_data_local_nonprim = NULL; + if (shared_am_data) { + shared_am_data_local_nonprim = OpenAPI_access_and_mobility_subscription_data_parseFromJSON(shared_am_data); + } + + cJSON *shared_sms_subs_data = cJSON_GetObjectItemCaseSensitive(shared_dataJSON, "sharedSmsSubsData"); + + OpenAPI_sms_subscription_data_t *shared_sms_subs_data_local_nonprim = NULL; + if (shared_sms_subs_data) { + shared_sms_subs_data_local_nonprim = OpenAPI_sms_subscription_data_parseFromJSON(shared_sms_subs_data); + } + + cJSON *shared_sms_mng_subs_data = cJSON_GetObjectItemCaseSensitive(shared_dataJSON, "sharedSmsMngSubsData"); + + OpenAPI_sms_management_subscription_data_t *shared_sms_mng_subs_data_local_nonprim = NULL; + if (shared_sms_mng_subs_data) { + shared_sms_mng_subs_data_local_nonprim = OpenAPI_sms_management_subscription_data_parseFromJSON(shared_sms_mng_subs_data); + } + + cJSON *shared_dnn_configurations = cJSON_GetObjectItemCaseSensitive(shared_dataJSON, "sharedDnnConfigurations"); + + OpenAPI_list_t *shared_dnn_configurationsList; + if (shared_dnn_configurations) { + cJSON *shared_dnn_configurations_local_map; + if (!cJSON_IsObject(shared_dnn_configurations)) { + ogs_error("OpenAPI_shared_data_parseFromJSON() failed [shared_dnn_configurations]"); + goto end; + } + shared_dnn_configurationsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(shared_dnn_configurations_local_map, shared_dnn_configurations) { + cJSON *localMapObject = shared_dnn_configurations_local_map; + if (!cJSON_IsObject(shared_dnn_configurations_local_map)) { + ogs_error("OpenAPI_shared_data_parseFromJSON() failed [shared_dnn_configurations]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_dnn_configuration_parseFromJSON(localMapObject)); + OpenAPI_list_add(shared_dnn_configurationsList, localMapKeyPair); + } + } + + cJSON *shared_trace_data = cJSON_GetObjectItemCaseSensitive(shared_dataJSON, "sharedTraceData"); + + OpenAPI_trace_data_t *shared_trace_data_local_nonprim = NULL; + if (shared_trace_data) { + shared_trace_data_local_nonprim = OpenAPI_trace_data_parseFromJSON(shared_trace_data); + } + + cJSON *shared_snssai_infos = cJSON_GetObjectItemCaseSensitive(shared_dataJSON, "sharedSnssaiInfos"); + + OpenAPI_list_t *shared_snssai_infosList; + if (shared_snssai_infos) { + cJSON *shared_snssai_infos_local_map; + if (!cJSON_IsObject(shared_snssai_infos)) { + ogs_error("OpenAPI_shared_data_parseFromJSON() failed [shared_snssai_infos]"); + goto end; + } + shared_snssai_infosList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(shared_snssai_infos_local_map, shared_snssai_infos) { + cJSON *localMapObject = shared_snssai_infos_local_map; + if (!cJSON_IsObject(shared_snssai_infos_local_map)) { + ogs_error("OpenAPI_shared_data_parseFromJSON() failed [shared_snssai_infos]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_snssai_info_parseFromJSON(localMapObject)); + OpenAPI_list_add(shared_snssai_infosList, localMapKeyPair); + } + } + + cJSON *shared_vn_group_datas = cJSON_GetObjectItemCaseSensitive(shared_dataJSON, "sharedVnGroupDatas"); + + OpenAPI_list_t *shared_vn_group_datasList; + if (shared_vn_group_datas) { + cJSON *shared_vn_group_datas_local_map; + if (!cJSON_IsObject(shared_vn_group_datas)) { + ogs_error("OpenAPI_shared_data_parseFromJSON() failed [shared_vn_group_datas]"); + goto end; + } + shared_vn_group_datasList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(shared_vn_group_datas_local_map, shared_vn_group_datas) { + cJSON *localMapObject = shared_vn_group_datas_local_map; + if (!cJSON_IsObject(shared_vn_group_datas_local_map)) { + ogs_error("OpenAPI_shared_data_parseFromJSON() failed [shared_vn_group_datas]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_vn_group_data_parseFromJSON(localMapObject)); + OpenAPI_list_add(shared_vn_group_datasList, localMapKeyPair); + } + } + + shared_data_local_var = OpenAPI_shared_data_create ( + ogs_strdup(shared_data_id->valuestring), + shared_am_data ? shared_am_data_local_nonprim : NULL, + shared_sms_subs_data ? shared_sms_subs_data_local_nonprim : NULL, + shared_sms_mng_subs_data ? shared_sms_mng_subs_data_local_nonprim : NULL, + shared_dnn_configurations ? shared_dnn_configurationsList : NULL, + shared_trace_data ? shared_trace_data_local_nonprim : NULL, + shared_snssai_infos ? shared_snssai_infosList : NULL, + shared_vn_group_datas ? shared_vn_group_datasList : NULL + ); + + return shared_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/shared_data.h b/lib/sbi/openapi/model/shared_data.h new file mode 100644 index 0000000000..dbbf7f41d2 --- /dev/null +++ b/lib/sbi/openapi/model/shared_data.h @@ -0,0 +1,58 @@ +/* + * shared_data.h + * + * + */ + +#ifndef _OpenAPI_shared_data_H_ +#define _OpenAPI_shared_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "access_and_mobility_subscription_data.h" +#include "dnn_configuration.h" +#include "sms_management_subscription_data.h" +#include "sms_subscription_data.h" +#include "snssai_info.h" +#include "trace_data.h" +#include "vn_group_data.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_shared_data_s OpenAPI_shared_data_t; +typedef struct OpenAPI_shared_data_s { + char *shared_data_id; + struct OpenAPI_access_and_mobility_subscription_data_s *shared_am_data; + struct OpenAPI_sms_subscription_data_s *shared_sms_subs_data; + struct OpenAPI_sms_management_subscription_data_s *shared_sms_mng_subs_data; + OpenAPI_list_t* shared_dnn_configurations; + struct OpenAPI_trace_data_s *shared_trace_data; + OpenAPI_list_t* shared_snssai_infos; + OpenAPI_list_t* shared_vn_group_datas; +} OpenAPI_shared_data_t; + +OpenAPI_shared_data_t *OpenAPI_shared_data_create( + char *shared_data_id, + OpenAPI_access_and_mobility_subscription_data_t *shared_am_data, + OpenAPI_sms_subscription_data_t *shared_sms_subs_data, + OpenAPI_sms_management_subscription_data_t *shared_sms_mng_subs_data, + OpenAPI_list_t* shared_dnn_configurations, + OpenAPI_trace_data_t *shared_trace_data, + OpenAPI_list_t* shared_snssai_infos, + OpenAPI_list_t* shared_vn_group_datas + ); +void OpenAPI_shared_data_free(OpenAPI_shared_data_t *shared_data); +OpenAPI_shared_data_t *OpenAPI_shared_data_parseFromJSON(cJSON *shared_dataJSON); +cJSON *OpenAPI_shared_data_convertToJSON(OpenAPI_shared_data_t *shared_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_shared_data_H_ */ + diff --git a/lib/sbi/openapi/model/sign.c b/lib/sbi/openapi/model/sign.c new file mode 100644 index 0000000000..1a06fe0780 --- /dev/null +++ b/lib/sbi/openapi/model/sign.c @@ -0,0 +1,30 @@ + +#include +#include +#include +#include "sign.h" + +char* OpenAPI_sign_ToString(OpenAPI_sign_e sign) +{ + const char *signArray[] = { "NULL", "POSITIVE", "NEGATIVE" }; + size_t sizeofArray = sizeof(signArray) / sizeof(signArray[0]); + if (sign < sizeofArray) + return (char *)signArray[sign]; + else + return (char *)"Unknown"; +} + +OpenAPI_sign_e OpenAPI_sign_FromString(char* sign) +{ + int stringToReturn = 0; + const char *signArray[] = { "NULL", "POSITIVE", "NEGATIVE" }; + size_t sizeofArray = sizeof(signArray) / sizeof(signArray[0]); + while (stringToReturn < sizeofArray) { + if (strcmp(sign, signArray[stringToReturn]) == 0) { + return stringToReturn; + } + stringToReturn++; + } + return 0; +} + diff --git a/lib/sbi/openapi/model/sign.h b/lib/sbi/openapi/model/sign.h new file mode 100644 index 0000000000..f5320ea9a7 --- /dev/null +++ b/lib/sbi/openapi/model/sign.h @@ -0,0 +1,31 @@ +/* + * sign.h + * + * + */ + +#ifndef _OpenAPI_sign_H_ +#define _OpenAPI_sign_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { OpenAPI_sign_NULL = 0, OpenAPI_sign_POSITIVE, OpenAPI_sign_NEGATIVE } OpenAPI_sign_e; + +char* OpenAPI_sign_ToString(OpenAPI_sign_e sign); + +OpenAPI_sign_e OpenAPI_sign_FromString(char* sign); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_sign_H_ */ + diff --git a/lib/sbi/openapi/model/slrb_configurations.c b/lib/sbi/openapi/model/slrb_configurations.c new file mode 100644 index 0000000000..6aaf41cc93 --- /dev/null +++ b/lib/sbi/openapi/model/slrb_configurations.c @@ -0,0 +1,105 @@ + +#include +#include +#include +#include "slrb_configurations.h" + +OpenAPI_slrb_configurations_t *OpenAPI_slrb_configurations_create( + OpenAPI_pc5_qo_s_para_t *pc5_qos_para, + char *slrb + ) +{ + OpenAPI_slrb_configurations_t *slrb_configurations_local_var = OpenAPI_malloc(sizeof(OpenAPI_slrb_configurations_t)); + if (!slrb_configurations_local_var) { + return NULL; + } + slrb_configurations_local_var->pc5_qos_para = pc5_qos_para; + slrb_configurations_local_var->slrb = slrb; + + return slrb_configurations_local_var; +} + +void OpenAPI_slrb_configurations_free(OpenAPI_slrb_configurations_t *slrb_configurations) +{ + if (NULL == slrb_configurations) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_pc5_qo_s_para_free(slrb_configurations->pc5_qos_para); + ogs_free(slrb_configurations->slrb); + ogs_free(slrb_configurations); +} + +cJSON *OpenAPI_slrb_configurations_convertToJSON(OpenAPI_slrb_configurations_t *slrb_configurations) +{ + cJSON *item = NULL; + + if (slrb_configurations == NULL) { + ogs_error("OpenAPI_slrb_configurations_convertToJSON() failed [SlrbConfigurations]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!slrb_configurations->pc5_qos_para) { + ogs_error("OpenAPI_slrb_configurations_convertToJSON() failed [pc5_qos_para]"); + goto end; + } + cJSON *pc5_qos_para_local_JSON = OpenAPI_pc5_qo_s_para_convertToJSON(slrb_configurations->pc5_qos_para); + if (pc5_qos_para_local_JSON == NULL) { + ogs_error("OpenAPI_slrb_configurations_convertToJSON() failed [pc5_qos_para]"); + goto end; + } + cJSON_AddItemToObject(item, "pc5QosPara", pc5_qos_para_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_slrb_configurations_convertToJSON() failed [pc5_qos_para]"); + goto end; + } + + if (!slrb_configurations->slrb) { + ogs_error("OpenAPI_slrb_configurations_convertToJSON() failed [slrb]"); + goto end; + } + if (cJSON_AddStringToObject(item, "slrb", slrb_configurations->slrb) == NULL) { + ogs_error("OpenAPI_slrb_configurations_convertToJSON() failed [slrb]"); + goto end; + } + +end: + return item; +} + +OpenAPI_slrb_configurations_t *OpenAPI_slrb_configurations_parseFromJSON(cJSON *slrb_configurationsJSON) +{ + OpenAPI_slrb_configurations_t *slrb_configurations_local_var = NULL; + cJSON *pc5_qos_para = cJSON_GetObjectItemCaseSensitive(slrb_configurationsJSON, "pc5QosPara"); + if (!pc5_qos_para) { + ogs_error("OpenAPI_slrb_configurations_parseFromJSON() failed [pc5_qos_para]"); + goto end; + } + + OpenAPI_pc5_qo_s_para_t *pc5_qos_para_local_nonprim = NULL; + + pc5_qos_para_local_nonprim = OpenAPI_pc5_qo_s_para_parseFromJSON(pc5_qos_para); + + cJSON *slrb = cJSON_GetObjectItemCaseSensitive(slrb_configurationsJSON, "slrb"); + if (!slrb) { + ogs_error("OpenAPI_slrb_configurations_parseFromJSON() failed [slrb]"); + goto end; + } + + + if (!cJSON_IsString(slrb)) { + ogs_error("OpenAPI_slrb_configurations_parseFromJSON() failed [slrb]"); + goto end; + } + + slrb_configurations_local_var = OpenAPI_slrb_configurations_create ( + pc5_qos_para_local_nonprim, + ogs_strdup(slrb->valuestring) + ); + + return slrb_configurations_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/slrb_configurations.h b/lib/sbi/openapi/model/slrb_configurations.h new file mode 100644 index 0000000000..b62955357c --- /dev/null +++ b/lib/sbi/openapi/model/slrb_configurations.h @@ -0,0 +1,40 @@ +/* + * slrb_configurations.h + * + * + */ + +#ifndef _OpenAPI_slrb_configurations_H_ +#define _OpenAPI_slrb_configurations_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "pc5_qo_s_para.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_slrb_configurations_s OpenAPI_slrb_configurations_t; +typedef struct OpenAPI_slrb_configurations_s { + struct OpenAPI_pc5_qo_s_para_s *pc5_qos_para; + char *slrb; +} OpenAPI_slrb_configurations_t; + +OpenAPI_slrb_configurations_t *OpenAPI_slrb_configurations_create( + OpenAPI_pc5_qo_s_para_t *pc5_qos_para, + char *slrb + ); +void OpenAPI_slrb_configurations_free(OpenAPI_slrb_configurations_t *slrb_configurations); +OpenAPI_slrb_configurations_t *OpenAPI_slrb_configurations_parseFromJSON(cJSON *slrb_configurationsJSON); +cJSON *OpenAPI_slrb_configurations_convertToJSON(OpenAPI_slrb_configurations_t *slrb_configurations); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_slrb_configurations_H_ */ + diff --git a/lib/sbi/openapi/model/sm_policy_data.c b/lib/sbi/openapi/model/sm_policy_data.c new file mode 100644 index 0000000000..6d7b4058f6 --- /dev/null +++ b/lib/sbi/openapi/model/sm_policy_data.c @@ -0,0 +1,235 @@ + +#include +#include +#include +#include "sm_policy_data.h" + +OpenAPI_sm_policy_data_t *OpenAPI_sm_policy_data_create( + OpenAPI_list_t* sm_policy_snssai_data, + OpenAPI_list_t* um_data_limits, + OpenAPI_list_t* um_data, + char *supp_feat + ) +{ + OpenAPI_sm_policy_data_t *sm_policy_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_sm_policy_data_t)); + if (!sm_policy_data_local_var) { + return NULL; + } + sm_policy_data_local_var->sm_policy_snssai_data = sm_policy_snssai_data; + sm_policy_data_local_var->um_data_limits = um_data_limits; + sm_policy_data_local_var->um_data = um_data; + sm_policy_data_local_var->supp_feat = supp_feat; + + return sm_policy_data_local_var; +} + +void OpenAPI_sm_policy_data_free(OpenAPI_sm_policy_data_t *sm_policy_data) +{ + if (NULL == sm_policy_data) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(sm_policy_data->sm_policy_snssai_data, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_sm_policy_snssai_data_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_data->sm_policy_snssai_data); + OpenAPI_list_for_each(sm_policy_data->um_data_limits, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_usage_mon_data_limit_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_data->um_data_limits); + OpenAPI_list_for_each(sm_policy_data->um_data, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_usage_mon_data_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_data->um_data); + ogs_free(sm_policy_data->supp_feat); + ogs_free(sm_policy_data); +} + +cJSON *OpenAPI_sm_policy_data_convertToJSON(OpenAPI_sm_policy_data_t *sm_policy_data) +{ + cJSON *item = NULL; + + if (sm_policy_data == NULL) { + ogs_error("OpenAPI_sm_policy_data_convertToJSON() failed [SmPolicyData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!sm_policy_data->sm_policy_snssai_data) { + ogs_error("OpenAPI_sm_policy_data_convertToJSON() failed [sm_policy_snssai_data]"); + goto end; + } + cJSON *sm_policy_snssai_data = cJSON_AddObjectToObject(item, "smPolicySnssaiData"); + if (sm_policy_snssai_data == NULL) { + ogs_error("OpenAPI_sm_policy_data_convertToJSON() failed [sm_policy_snssai_data]"); + goto end; + } + cJSON *localMapObject = sm_policy_snssai_data; + OpenAPI_lnode_t *sm_policy_snssai_data_node; + if (sm_policy_data->sm_policy_snssai_data) { + OpenAPI_list_for_each(sm_policy_data->sm_policy_snssai_data, sm_policy_snssai_data_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)sm_policy_snssai_data_node->data; + cJSON *itemLocal = OpenAPI_sm_policy_snssai_data_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_data_convertToJSON() failed [sm_policy_snssai_data]"); + goto end; + } + cJSON_AddItemToObject(sm_policy_snssai_data, localKeyValue->key, itemLocal); + } + } + + if (sm_policy_data->um_data_limits) { + cJSON *um_data_limits = cJSON_AddObjectToObject(item, "umDataLimits"); + if (um_data_limits == NULL) { + ogs_error("OpenAPI_sm_policy_data_convertToJSON() failed [um_data_limits]"); + goto end; + } + cJSON *localMapObject = um_data_limits; + OpenAPI_lnode_t *um_data_limits_node; + if (sm_policy_data->um_data_limits) { + OpenAPI_list_for_each(sm_policy_data->um_data_limits, um_data_limits_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)um_data_limits_node->data; + cJSON *itemLocal = OpenAPI_usage_mon_data_limit_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_data_convertToJSON() failed [um_data_limits]"); + goto end; + } + cJSON_AddItemToObject(um_data_limits, localKeyValue->key, itemLocal); + } + } + } + + if (sm_policy_data->um_data) { + cJSON *um_data = cJSON_AddObjectToObject(item, "umData"); + if (um_data == NULL) { + ogs_error("OpenAPI_sm_policy_data_convertToJSON() failed [um_data]"); + goto end; + } + cJSON *localMapObject = um_data; + OpenAPI_lnode_t *um_data_node; + if (sm_policy_data->um_data) { + OpenAPI_list_for_each(sm_policy_data->um_data, um_data_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)um_data_node->data; + cJSON *itemLocal = OpenAPI_usage_mon_data_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_data_convertToJSON() failed [um_data]"); + goto end; + } + cJSON_AddItemToObject(um_data, localKeyValue->key, itemLocal); + } + } + } + + if (sm_policy_data->supp_feat) { + if (cJSON_AddStringToObject(item, "suppFeat", sm_policy_data->supp_feat) == NULL) { + ogs_error("OpenAPI_sm_policy_data_convertToJSON() failed [supp_feat]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_sm_policy_data_t *OpenAPI_sm_policy_data_parseFromJSON(cJSON *sm_policy_dataJSON) +{ + OpenAPI_sm_policy_data_t *sm_policy_data_local_var = NULL; + cJSON *sm_policy_snssai_data = cJSON_GetObjectItemCaseSensitive(sm_policy_dataJSON, "smPolicySnssaiData"); + if (!sm_policy_snssai_data) { + ogs_error("OpenAPI_sm_policy_data_parseFromJSON() failed [sm_policy_snssai_data]"); + goto end; + } + + OpenAPI_list_t *sm_policy_snssai_dataList; + + cJSON *sm_policy_snssai_data_local_map; + if (!cJSON_IsObject(sm_policy_snssai_data)) { + ogs_error("OpenAPI_sm_policy_data_parseFromJSON() failed [sm_policy_snssai_data]"); + goto end; + } + sm_policy_snssai_dataList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(sm_policy_snssai_data_local_map, sm_policy_snssai_data) { + cJSON *localMapObject = sm_policy_snssai_data_local_map; + if (!cJSON_IsObject(sm_policy_snssai_data_local_map)) { + ogs_error("OpenAPI_sm_policy_data_parseFromJSON() failed [sm_policy_snssai_data]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_sm_policy_snssai_data_parseFromJSON(localMapObject)); + OpenAPI_list_add(sm_policy_snssai_dataList, localMapKeyPair); + } + + cJSON *um_data_limits = cJSON_GetObjectItemCaseSensitive(sm_policy_dataJSON, "umDataLimits"); + + OpenAPI_list_t *um_data_limitsList; + if (um_data_limits) { + cJSON *um_data_limits_local_map; + if (!cJSON_IsObject(um_data_limits)) { + ogs_error("OpenAPI_sm_policy_data_parseFromJSON() failed [um_data_limits]"); + goto end; + } + um_data_limitsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(um_data_limits_local_map, um_data_limits) { + cJSON *localMapObject = um_data_limits_local_map; + if (!cJSON_IsObject(um_data_limits_local_map)) { + ogs_error("OpenAPI_sm_policy_data_parseFromJSON() failed [um_data_limits]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_usage_mon_data_limit_parseFromJSON(localMapObject)); + OpenAPI_list_add(um_data_limitsList, localMapKeyPair); + } + } + + cJSON *um_data = cJSON_GetObjectItemCaseSensitive(sm_policy_dataJSON, "umData"); + + OpenAPI_list_t *um_dataList; + if (um_data) { + cJSON *um_data_local_map; + if (!cJSON_IsObject(um_data)) { + ogs_error("OpenAPI_sm_policy_data_parseFromJSON() failed [um_data]"); + goto end; + } + um_dataList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(um_data_local_map, um_data) { + cJSON *localMapObject = um_data_local_map; + if (!cJSON_IsObject(um_data_local_map)) { + ogs_error("OpenAPI_sm_policy_data_parseFromJSON() failed [um_data]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_usage_mon_data_parseFromJSON(localMapObject)); + OpenAPI_list_add(um_dataList, localMapKeyPair); + } + } + + cJSON *supp_feat = cJSON_GetObjectItemCaseSensitive(sm_policy_dataJSON, "suppFeat"); + + if (supp_feat) { + if (!cJSON_IsString(supp_feat)) { + ogs_error("OpenAPI_sm_policy_data_parseFromJSON() failed [supp_feat]"); + goto end; + } + } + + sm_policy_data_local_var = OpenAPI_sm_policy_data_create ( + sm_policy_snssai_dataList, + um_data_limits ? um_data_limitsList : NULL, + um_data ? um_dataList : NULL, + supp_feat ? ogs_strdup(supp_feat->valuestring) : NULL + ); + + return sm_policy_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/sm_policy_data.h b/lib/sbi/openapi/model/sm_policy_data.h new file mode 100644 index 0000000000..7ffe2d8ca4 --- /dev/null +++ b/lib/sbi/openapi/model/sm_policy_data.h @@ -0,0 +1,46 @@ +/* + * sm_policy_data.h + * + * Contains the SM policy data for a given subscriber. + */ + +#ifndef _OpenAPI_sm_policy_data_H_ +#define _OpenAPI_sm_policy_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "sm_policy_snssai_data.h" +#include "usage_mon_data.h" +#include "usage_mon_data_limit.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_sm_policy_data_s OpenAPI_sm_policy_data_t; +typedef struct OpenAPI_sm_policy_data_s { + OpenAPI_list_t* sm_policy_snssai_data; + OpenAPI_list_t* um_data_limits; + OpenAPI_list_t* um_data; + char *supp_feat; +} OpenAPI_sm_policy_data_t; + +OpenAPI_sm_policy_data_t *OpenAPI_sm_policy_data_create( + OpenAPI_list_t* sm_policy_snssai_data, + OpenAPI_list_t* um_data_limits, + OpenAPI_list_t* um_data, + char *supp_feat + ); +void OpenAPI_sm_policy_data_free(OpenAPI_sm_policy_data_t *sm_policy_data); +OpenAPI_sm_policy_data_t *OpenAPI_sm_policy_data_parseFromJSON(cJSON *sm_policy_dataJSON); +cJSON *OpenAPI_sm_policy_data_convertToJSON(OpenAPI_sm_policy_data_t *sm_policy_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_sm_policy_data_H_ */ + diff --git a/lib/sbi/openapi/model/sm_policy_data_patch.c b/lib/sbi/openapi/model/sm_policy_data_patch.c new file mode 100644 index 0000000000..e6f6e6251f --- /dev/null +++ b/lib/sbi/openapi/model/sm_policy_data_patch.c @@ -0,0 +1,157 @@ + +#include +#include +#include +#include "sm_policy_data_patch.h" + +OpenAPI_sm_policy_data_patch_t *OpenAPI_sm_policy_data_patch_create( + OpenAPI_list_t* um_data, + OpenAPI_list_t* sm_policy_snssai_data + ) +{ + OpenAPI_sm_policy_data_patch_t *sm_policy_data_patch_local_var = OpenAPI_malloc(sizeof(OpenAPI_sm_policy_data_patch_t)); + if (!sm_policy_data_patch_local_var) { + return NULL; + } + sm_policy_data_patch_local_var->um_data = um_data; + sm_policy_data_patch_local_var->sm_policy_snssai_data = sm_policy_snssai_data; + + return sm_policy_data_patch_local_var; +} + +void OpenAPI_sm_policy_data_patch_free(OpenAPI_sm_policy_data_patch_t *sm_policy_data_patch) +{ + if (NULL == sm_policy_data_patch) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(sm_policy_data_patch->um_data, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_usage_mon_data_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_data_patch->um_data); + OpenAPI_list_for_each(sm_policy_data_patch->sm_policy_snssai_data, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_sm_policy_snssai_data_patch_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_data_patch->sm_policy_snssai_data); + ogs_free(sm_policy_data_patch); +} + +cJSON *OpenAPI_sm_policy_data_patch_convertToJSON(OpenAPI_sm_policy_data_patch_t *sm_policy_data_patch) +{ + cJSON *item = NULL; + + if (sm_policy_data_patch == NULL) { + ogs_error("OpenAPI_sm_policy_data_patch_convertToJSON() failed [SmPolicyDataPatch]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (sm_policy_data_patch->um_data) { + cJSON *um_data = cJSON_AddObjectToObject(item, "umData"); + if (um_data == NULL) { + ogs_error("OpenAPI_sm_policy_data_patch_convertToJSON() failed [um_data]"); + goto end; + } + cJSON *localMapObject = um_data; + OpenAPI_lnode_t *um_data_node; + if (sm_policy_data_patch->um_data) { + OpenAPI_list_for_each(sm_policy_data_patch->um_data, um_data_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)um_data_node->data; + cJSON *itemLocal = OpenAPI_usage_mon_data_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_data_patch_convertToJSON() failed [um_data]"); + goto end; + } + cJSON_AddItemToObject(um_data, localKeyValue->key, itemLocal); + } + } + } + + if (sm_policy_data_patch->sm_policy_snssai_data) { + cJSON *sm_policy_snssai_data = cJSON_AddObjectToObject(item, "smPolicySnssaiData"); + if (sm_policy_snssai_data == NULL) { + ogs_error("OpenAPI_sm_policy_data_patch_convertToJSON() failed [sm_policy_snssai_data]"); + goto end; + } + cJSON *localMapObject = sm_policy_snssai_data; + OpenAPI_lnode_t *sm_policy_snssai_data_node; + if (sm_policy_data_patch->sm_policy_snssai_data) { + OpenAPI_list_for_each(sm_policy_data_patch->sm_policy_snssai_data, sm_policy_snssai_data_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)sm_policy_snssai_data_node->data; + cJSON *itemLocal = OpenAPI_sm_policy_snssai_data_patch_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_data_patch_convertToJSON() failed [sm_policy_snssai_data]"); + goto end; + } + cJSON_AddItemToObject(sm_policy_snssai_data, localKeyValue->key, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_sm_policy_data_patch_t *OpenAPI_sm_policy_data_patch_parseFromJSON(cJSON *sm_policy_data_patchJSON) +{ + OpenAPI_sm_policy_data_patch_t *sm_policy_data_patch_local_var = NULL; + cJSON *um_data = cJSON_GetObjectItemCaseSensitive(sm_policy_data_patchJSON, "umData"); + + OpenAPI_list_t *um_dataList; + if (um_data) { + cJSON *um_data_local_map; + if (!cJSON_IsObject(um_data)) { + ogs_error("OpenAPI_sm_policy_data_patch_parseFromJSON() failed [um_data]"); + goto end; + } + um_dataList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(um_data_local_map, um_data) { + cJSON *localMapObject = um_data_local_map; + if (!cJSON_IsObject(um_data_local_map)) { + ogs_error("OpenAPI_sm_policy_data_patch_parseFromJSON() failed [um_data]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_usage_mon_data_parseFromJSON(localMapObject)); + OpenAPI_list_add(um_dataList, localMapKeyPair); + } + } + + cJSON *sm_policy_snssai_data = cJSON_GetObjectItemCaseSensitive(sm_policy_data_patchJSON, "smPolicySnssaiData"); + + OpenAPI_list_t *sm_policy_snssai_dataList; + if (sm_policy_snssai_data) { + cJSON *sm_policy_snssai_data_local_map; + if (!cJSON_IsObject(sm_policy_snssai_data)) { + ogs_error("OpenAPI_sm_policy_data_patch_parseFromJSON() failed [sm_policy_snssai_data]"); + goto end; + } + sm_policy_snssai_dataList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(sm_policy_snssai_data_local_map, sm_policy_snssai_data) { + cJSON *localMapObject = sm_policy_snssai_data_local_map; + if (!cJSON_IsObject(sm_policy_snssai_data_local_map)) { + ogs_error("OpenAPI_sm_policy_data_patch_parseFromJSON() failed [sm_policy_snssai_data]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_sm_policy_snssai_data_patch_parseFromJSON(localMapObject)); + OpenAPI_list_add(sm_policy_snssai_dataList, localMapKeyPair); + } + } + + sm_policy_data_patch_local_var = OpenAPI_sm_policy_data_patch_create ( + um_data ? um_dataList : NULL, + sm_policy_snssai_data ? sm_policy_snssai_dataList : NULL + ); + + return sm_policy_data_patch_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/sm_policy_data_patch.h b/lib/sbi/openapi/model/sm_policy_data_patch.h new file mode 100644 index 0000000000..bf9b70b8fa --- /dev/null +++ b/lib/sbi/openapi/model/sm_policy_data_patch.h @@ -0,0 +1,41 @@ +/* + * sm_policy_data_patch.h + * + * Contains the SM policy data for a given subscriber. + */ + +#ifndef _OpenAPI_sm_policy_data_patch_H_ +#define _OpenAPI_sm_policy_data_patch_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "sm_policy_snssai_data_patch.h" +#include "usage_mon_data.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_sm_policy_data_patch_s OpenAPI_sm_policy_data_patch_t; +typedef struct OpenAPI_sm_policy_data_patch_s { + OpenAPI_list_t* um_data; + OpenAPI_list_t* sm_policy_snssai_data; +} OpenAPI_sm_policy_data_patch_t; + +OpenAPI_sm_policy_data_patch_t *OpenAPI_sm_policy_data_patch_create( + OpenAPI_list_t* um_data, + OpenAPI_list_t* sm_policy_snssai_data + ); +void OpenAPI_sm_policy_data_patch_free(OpenAPI_sm_policy_data_patch_t *sm_policy_data_patch); +OpenAPI_sm_policy_data_patch_t *OpenAPI_sm_policy_data_patch_parseFromJSON(cJSON *sm_policy_data_patchJSON); +cJSON *OpenAPI_sm_policy_data_patch_convertToJSON(OpenAPI_sm_policy_data_patch_t *sm_policy_data_patch); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_sm_policy_data_patch_H_ */ + diff --git a/lib/sbi/openapi/model/sm_policy_dnn_data.c b/lib/sbi/openapi/model/sm_policy_dnn_data.c new file mode 100644 index 0000000000..b7ff7aacc0 --- /dev/null +++ b/lib/sbi/openapi/model/sm_policy_dnn_data.c @@ -0,0 +1,582 @@ + +#include +#include +#include +#include "sm_policy_dnn_data.h" + +OpenAPI_sm_policy_dnn_data_t *OpenAPI_sm_policy_dnn_data_create( + char *dnn, + OpenAPI_list_t *allowed_services, + OpenAPI_list_t *subsc_cats, + char *gbr_ul, + char *gbr_dl, + int adc_support, + int subsc_spending_limits, + int ipv4_index, + int ipv6_index, + int offline, + int online, + OpenAPI_charging_information_t *chf_info, + OpenAPI_list_t* ref_um_data_limit_ids, + int mps_priority, + int mcs_priority, + int ims_signalling_prio, + int mps_priority_level, + int mcs_priority_level, + OpenAPI_list_t* pra_infos, + OpenAPI_list_t* bdt_ref_ids + ) +{ + OpenAPI_sm_policy_dnn_data_t *sm_policy_dnn_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_sm_policy_dnn_data_t)); + if (!sm_policy_dnn_data_local_var) { + return NULL; + } + sm_policy_dnn_data_local_var->dnn = dnn; + sm_policy_dnn_data_local_var->allowed_services = allowed_services; + sm_policy_dnn_data_local_var->subsc_cats = subsc_cats; + sm_policy_dnn_data_local_var->gbr_ul = gbr_ul; + sm_policy_dnn_data_local_var->gbr_dl = gbr_dl; + sm_policy_dnn_data_local_var->adc_support = adc_support; + sm_policy_dnn_data_local_var->subsc_spending_limits = subsc_spending_limits; + sm_policy_dnn_data_local_var->ipv4_index = ipv4_index; + sm_policy_dnn_data_local_var->ipv6_index = ipv6_index; + sm_policy_dnn_data_local_var->offline = offline; + sm_policy_dnn_data_local_var->online = online; + sm_policy_dnn_data_local_var->chf_info = chf_info; + sm_policy_dnn_data_local_var->ref_um_data_limit_ids = ref_um_data_limit_ids; + sm_policy_dnn_data_local_var->mps_priority = mps_priority; + sm_policy_dnn_data_local_var->mcs_priority = mcs_priority; + sm_policy_dnn_data_local_var->ims_signalling_prio = ims_signalling_prio; + sm_policy_dnn_data_local_var->mps_priority_level = mps_priority_level; + sm_policy_dnn_data_local_var->mcs_priority_level = mcs_priority_level; + sm_policy_dnn_data_local_var->pra_infos = pra_infos; + sm_policy_dnn_data_local_var->bdt_ref_ids = bdt_ref_ids; + + return sm_policy_dnn_data_local_var; +} + +void OpenAPI_sm_policy_dnn_data_free(OpenAPI_sm_policy_dnn_data_t *sm_policy_dnn_data) +{ + if (NULL == sm_policy_dnn_data) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(sm_policy_dnn_data->dnn); + OpenAPI_list_for_each(sm_policy_dnn_data->allowed_services, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sm_policy_dnn_data->allowed_services); + OpenAPI_list_for_each(sm_policy_dnn_data->subsc_cats, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sm_policy_dnn_data->subsc_cats); + ogs_free(sm_policy_dnn_data->gbr_ul); + ogs_free(sm_policy_dnn_data->gbr_dl); + OpenAPI_charging_information_free(sm_policy_dnn_data->chf_info); + OpenAPI_list_for_each(sm_policy_dnn_data->ref_um_data_limit_ids, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_limit_id_to_monitoring_key_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_dnn_data->ref_um_data_limit_ids); + OpenAPI_list_for_each(sm_policy_dnn_data->pra_infos, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_presence_info_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_dnn_data->pra_infos); + OpenAPI_list_for_each(sm_policy_dnn_data->bdt_ref_ids, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_dnn_data->bdt_ref_ids); + ogs_free(sm_policy_dnn_data); +} + +cJSON *OpenAPI_sm_policy_dnn_data_convertToJSON(OpenAPI_sm_policy_dnn_data_t *sm_policy_dnn_data) +{ + cJSON *item = NULL; + + if (sm_policy_dnn_data == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [SmPolicyDnnData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!sm_policy_dnn_data->dnn) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [dnn]"); + goto end; + } + if (cJSON_AddStringToObject(item, "dnn", sm_policy_dnn_data->dnn) == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [dnn]"); + goto end; + } + + if (sm_policy_dnn_data->allowed_services) { + cJSON *allowed_services = cJSON_AddArrayToObject(item, "allowedServices"); + if (allowed_services == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [allowed_services]"); + goto end; + } + + OpenAPI_lnode_t *allowed_services_node; + OpenAPI_list_for_each(sm_policy_dnn_data->allowed_services, allowed_services_node) { + if (cJSON_AddStringToObject(allowed_services, "", (char*)allowed_services_node->data) == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [allowed_services]"); + goto end; + } + } + } + + if (sm_policy_dnn_data->subsc_cats) { + cJSON *subsc_cats = cJSON_AddArrayToObject(item, "subscCats"); + if (subsc_cats == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [subsc_cats]"); + goto end; + } + + OpenAPI_lnode_t *subsc_cats_node; + OpenAPI_list_for_each(sm_policy_dnn_data->subsc_cats, subsc_cats_node) { + if (cJSON_AddStringToObject(subsc_cats, "", (char*)subsc_cats_node->data) == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [subsc_cats]"); + goto end; + } + } + } + + if (sm_policy_dnn_data->gbr_ul) { + if (cJSON_AddStringToObject(item, "gbrUl", sm_policy_dnn_data->gbr_ul) == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [gbr_ul]"); + goto end; + } + } + + if (sm_policy_dnn_data->gbr_dl) { + if (cJSON_AddStringToObject(item, "gbrDl", sm_policy_dnn_data->gbr_dl) == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [gbr_dl]"); + goto end; + } + } + + if (sm_policy_dnn_data->adc_support >= 0) { + if (cJSON_AddBoolToObject(item, "adcSupport", sm_policy_dnn_data->adc_support) == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [adc_support]"); + goto end; + } + } + + if (sm_policy_dnn_data->subsc_spending_limits >= 0) { + if (cJSON_AddBoolToObject(item, "subscSpendingLimits", sm_policy_dnn_data->subsc_spending_limits) == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [subsc_spending_limits]"); + goto end; + } + } + + if (sm_policy_dnn_data->ipv4_index) { + if (cJSON_AddNumberToObject(item, "ipv4Index", sm_policy_dnn_data->ipv4_index) == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [ipv4_index]"); + goto end; + } + } + + if (sm_policy_dnn_data->ipv6_index) { + if (cJSON_AddNumberToObject(item, "ipv6Index", sm_policy_dnn_data->ipv6_index) == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [ipv6_index]"); + goto end; + } + } + + if (sm_policy_dnn_data->offline >= 0) { + if (cJSON_AddBoolToObject(item, "offline", sm_policy_dnn_data->offline) == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [offline]"); + goto end; + } + } + + if (sm_policy_dnn_data->online >= 0) { + if (cJSON_AddBoolToObject(item, "online", sm_policy_dnn_data->online) == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [online]"); + goto end; + } + } + + if (sm_policy_dnn_data->chf_info) { + cJSON *chf_info_local_JSON = OpenAPI_charging_information_convertToJSON(sm_policy_dnn_data->chf_info); + if (chf_info_local_JSON == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [chf_info]"); + goto end; + } + cJSON_AddItemToObject(item, "chfInfo", chf_info_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [chf_info]"); + goto end; + } + } + + if (sm_policy_dnn_data->ref_um_data_limit_ids) { + cJSON *ref_um_data_limit_ids = cJSON_AddObjectToObject(item, "refUmDataLimitIds"); + if (ref_um_data_limit_ids == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [ref_um_data_limit_ids]"); + goto end; + } + cJSON *localMapObject = ref_um_data_limit_ids; + OpenAPI_lnode_t *ref_um_data_limit_ids_node; + if (sm_policy_dnn_data->ref_um_data_limit_ids) { + OpenAPI_list_for_each(sm_policy_dnn_data->ref_um_data_limit_ids, ref_um_data_limit_ids_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)ref_um_data_limit_ids_node->data; + cJSON *itemLocal = OpenAPI_limit_id_to_monitoring_key_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [ref_um_data_limit_ids]"); + goto end; + } + cJSON_AddItemToObject(ref_um_data_limit_ids, localKeyValue->key, itemLocal); + } + } + } + + if (sm_policy_dnn_data->mps_priority >= 0) { + if (cJSON_AddBoolToObject(item, "mpsPriority", sm_policy_dnn_data->mps_priority) == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [mps_priority]"); + goto end; + } + } + + if (sm_policy_dnn_data->mcs_priority >= 0) { + if (cJSON_AddBoolToObject(item, "mcsPriority", sm_policy_dnn_data->mcs_priority) == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [mcs_priority]"); + goto end; + } + } + + if (sm_policy_dnn_data->ims_signalling_prio >= 0) { + if (cJSON_AddBoolToObject(item, "imsSignallingPrio", sm_policy_dnn_data->ims_signalling_prio) == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [ims_signalling_prio]"); + goto end; + } + } + + if (sm_policy_dnn_data->mps_priority_level) { + if (cJSON_AddNumberToObject(item, "mpsPriorityLevel", sm_policy_dnn_data->mps_priority_level) == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [mps_priority_level]"); + goto end; + } + } + + if (sm_policy_dnn_data->mcs_priority_level) { + if (cJSON_AddNumberToObject(item, "mcsPriorityLevel", sm_policy_dnn_data->mcs_priority_level) == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [mcs_priority_level]"); + goto end; + } + } + + if (sm_policy_dnn_data->pra_infos) { + cJSON *pra_infos = cJSON_AddObjectToObject(item, "praInfos"); + if (pra_infos == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [pra_infos]"); + goto end; + } + cJSON *localMapObject = pra_infos; + OpenAPI_lnode_t *pra_infos_node; + if (sm_policy_dnn_data->pra_infos) { + OpenAPI_list_for_each(sm_policy_dnn_data->pra_infos, pra_infos_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)pra_infos_node->data; + cJSON *itemLocal = OpenAPI_presence_info_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [pra_infos]"); + goto end; + } + cJSON_AddItemToObject(pra_infos, localKeyValue->key, itemLocal); + } + } + } + + if (sm_policy_dnn_data->bdt_ref_ids) { + cJSON *bdt_ref_ids = cJSON_AddObjectToObject(item, "bdtRefIds"); + if (bdt_ref_ids == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [bdt_ref_ids]"); + goto end; + } + cJSON *localMapObject = bdt_ref_ids; + OpenAPI_lnode_t *bdt_ref_ids_node; + if (sm_policy_dnn_data->bdt_ref_ids) { + OpenAPI_list_for_each(sm_policy_dnn_data->bdt_ref_ids, bdt_ref_ids_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)bdt_ref_ids_node->data; + } + } + } + +end: + return item; +} + +OpenAPI_sm_policy_dnn_data_t *OpenAPI_sm_policy_dnn_data_parseFromJSON(cJSON *sm_policy_dnn_dataJSON) +{ + OpenAPI_sm_policy_dnn_data_t *sm_policy_dnn_data_local_var = NULL; + cJSON *dnn = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "dnn"); + if (!dnn) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [dnn]"); + goto end; + } + + + if (!cJSON_IsString(dnn)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [dnn]"); + goto end; + } + + cJSON *allowed_services = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "allowedServices"); + + OpenAPI_list_t *allowed_servicesList; + if (allowed_services) { + cJSON *allowed_services_local; + if (!cJSON_IsArray(allowed_services)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [allowed_services]"); + goto end; + } + allowed_servicesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_services_local, allowed_services) { + if (!cJSON_IsString(allowed_services_local)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [allowed_services]"); + goto end; + } + OpenAPI_list_add(allowed_servicesList, ogs_strdup(allowed_services_local->valuestring)); + } + } + + cJSON *subsc_cats = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "subscCats"); + + OpenAPI_list_t *subsc_catsList; + if (subsc_cats) { + cJSON *subsc_cats_local; + if (!cJSON_IsArray(subsc_cats)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [subsc_cats]"); + goto end; + } + subsc_catsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(subsc_cats_local, subsc_cats) { + if (!cJSON_IsString(subsc_cats_local)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [subsc_cats]"); + goto end; + } + OpenAPI_list_add(subsc_catsList, ogs_strdup(subsc_cats_local->valuestring)); + } + } + + cJSON *gbr_ul = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "gbrUl"); + + if (gbr_ul) { + if (!cJSON_IsString(gbr_ul)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [gbr_ul]"); + goto end; + } + } + + cJSON *gbr_dl = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "gbrDl"); + + if (gbr_dl) { + if (!cJSON_IsString(gbr_dl)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [gbr_dl]"); + goto end; + } + } + + cJSON *adc_support = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "adcSupport"); + + if (adc_support) { + if (!cJSON_IsBool(adc_support)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [adc_support]"); + goto end; + } + } + + cJSON *subsc_spending_limits = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "subscSpendingLimits"); + + if (subsc_spending_limits) { + if (!cJSON_IsBool(subsc_spending_limits)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [subsc_spending_limits]"); + goto end; + } + } + + cJSON *ipv4_index = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "ipv4Index"); + + if (ipv4_index) { + if (!cJSON_IsNumber(ipv4_index)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [ipv4_index]"); + goto end; + } + } + + cJSON *ipv6_index = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "ipv6Index"); + + if (ipv6_index) { + if (!cJSON_IsNumber(ipv6_index)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [ipv6_index]"); + goto end; + } + } + + cJSON *offline = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "offline"); + + if (offline) { + if (!cJSON_IsBool(offline)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [offline]"); + goto end; + } + } + + cJSON *online = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "online"); + + if (online) { + if (!cJSON_IsBool(online)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [online]"); + goto end; + } + } + + cJSON *chf_info = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "chfInfo"); + + OpenAPI_charging_information_t *chf_info_local_nonprim = NULL; + if (chf_info) { + chf_info_local_nonprim = OpenAPI_charging_information_parseFromJSON(chf_info); + } + + cJSON *ref_um_data_limit_ids = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "refUmDataLimitIds"); + + OpenAPI_list_t *ref_um_data_limit_idsList; + if (ref_um_data_limit_ids) { + cJSON *ref_um_data_limit_ids_local_map; + if (!cJSON_IsObject(ref_um_data_limit_ids)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [ref_um_data_limit_ids]"); + goto end; + } + ref_um_data_limit_idsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(ref_um_data_limit_ids_local_map, ref_um_data_limit_ids) { + cJSON *localMapObject = ref_um_data_limit_ids_local_map; + if (!cJSON_IsObject(ref_um_data_limit_ids_local_map)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [ref_um_data_limit_ids]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_limit_id_to_monitoring_key_parseFromJSON(localMapObject)); + OpenAPI_list_add(ref_um_data_limit_idsList, localMapKeyPair); + } + } + + cJSON *mps_priority = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "mpsPriority"); + + if (mps_priority) { + if (!cJSON_IsBool(mps_priority)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [mps_priority]"); + goto end; + } + } + + cJSON *mcs_priority = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "mcsPriority"); + + if (mcs_priority) { + if (!cJSON_IsBool(mcs_priority)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [mcs_priority]"); + goto end; + } + } + + cJSON *ims_signalling_prio = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "imsSignallingPrio"); + + if (ims_signalling_prio) { + if (!cJSON_IsBool(ims_signalling_prio)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [ims_signalling_prio]"); + goto end; + } + } + + cJSON *mps_priority_level = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "mpsPriorityLevel"); + + if (mps_priority_level) { + if (!cJSON_IsNumber(mps_priority_level)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [mps_priority_level]"); + goto end; + } + } + + cJSON *mcs_priority_level = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "mcsPriorityLevel"); + + if (mcs_priority_level) { + if (!cJSON_IsNumber(mcs_priority_level)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [mcs_priority_level]"); + goto end; + } + } + + cJSON *pra_infos = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "praInfos"); + + OpenAPI_list_t *pra_infosList; + if (pra_infos) { + cJSON *pra_infos_local_map; + if (!cJSON_IsObject(pra_infos)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [pra_infos]"); + goto end; + } + pra_infosList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(pra_infos_local_map, pra_infos) { + cJSON *localMapObject = pra_infos_local_map; + if (!cJSON_IsObject(pra_infos_local_map)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [pra_infos]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_presence_info_parseFromJSON(localMapObject)); + OpenAPI_list_add(pra_infosList, localMapKeyPair); + } + } + + cJSON *bdt_ref_ids = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "bdtRefIds"); + + OpenAPI_list_t *bdt_ref_idsList; + if (bdt_ref_ids) { + cJSON *bdt_ref_ids_local_map; + if (!cJSON_IsObject(bdt_ref_ids)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [bdt_ref_ids]"); + goto end; + } + bdt_ref_idsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(bdt_ref_ids_local_map, bdt_ref_ids) { + cJSON *localMapObject = bdt_ref_ids_local_map; + OpenAPI_list_add(bdt_ref_idsList, localMapKeyPair); + } + } + + sm_policy_dnn_data_local_var = OpenAPI_sm_policy_dnn_data_create ( + ogs_strdup(dnn->valuestring), + allowed_services ? allowed_servicesList : NULL, + subsc_cats ? subsc_catsList : NULL, + gbr_ul ? ogs_strdup(gbr_ul->valuestring) : NULL, + gbr_dl ? ogs_strdup(gbr_dl->valuestring) : NULL, + adc_support ? adc_support->valueint : 0, + subsc_spending_limits ? subsc_spending_limits->valueint : 0, + ipv4_index ? ipv4_index->valuedouble : 0, + ipv6_index ? ipv6_index->valuedouble : 0, + offline ? offline->valueint : 0, + online ? online->valueint : 0, + chf_info ? chf_info_local_nonprim : NULL, + ref_um_data_limit_ids ? ref_um_data_limit_idsList : NULL, + mps_priority ? mps_priority->valueint : 0, + mcs_priority ? mcs_priority->valueint : 0, + ims_signalling_prio ? ims_signalling_prio->valueint : 0, + mps_priority_level ? mps_priority_level->valuedouble : 0, + mcs_priority_level ? mcs_priority_level->valuedouble : 0, + pra_infos ? pra_infosList : NULL, + bdt_ref_ids ? bdt_ref_idsList : NULL + ); + + return sm_policy_dnn_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/sm_policy_dnn_data.h b/lib/sbi/openapi/model/sm_policy_dnn_data.h new file mode 100644 index 0000000000..4bbb2ff5e7 --- /dev/null +++ b/lib/sbi/openapi/model/sm_policy_dnn_data.h @@ -0,0 +1,78 @@ +/* + * sm_policy_dnn_data.h + * + * Contains the SM policy data for a given DNN (and S-NSSAI). + */ + +#ifndef _OpenAPI_sm_policy_dnn_data_H_ +#define _OpenAPI_sm_policy_dnn_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "charging_information.h" +#include "limit_id_to_monitoring_key.h" +#include "presence_info.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_sm_policy_dnn_data_s OpenAPI_sm_policy_dnn_data_t; +typedef struct OpenAPI_sm_policy_dnn_data_s { + char *dnn; + OpenAPI_list_t *allowed_services; + OpenAPI_list_t *subsc_cats; + char *gbr_ul; + char *gbr_dl; + int adc_support; + int subsc_spending_limits; + int ipv4_index; + int ipv6_index; + int offline; + int online; + struct OpenAPI_charging_information_s *chf_info; + OpenAPI_list_t* ref_um_data_limit_ids; + int mps_priority; + int mcs_priority; + int ims_signalling_prio; + int mps_priority_level; + int mcs_priority_level; + OpenAPI_list_t* pra_infos; + OpenAPI_list_t* bdt_ref_ids; +} OpenAPI_sm_policy_dnn_data_t; + +OpenAPI_sm_policy_dnn_data_t *OpenAPI_sm_policy_dnn_data_create( + char *dnn, + OpenAPI_list_t *allowed_services, + OpenAPI_list_t *subsc_cats, + char *gbr_ul, + char *gbr_dl, + int adc_support, + int subsc_spending_limits, + int ipv4_index, + int ipv6_index, + int offline, + int online, + OpenAPI_charging_information_t *chf_info, + OpenAPI_list_t* ref_um_data_limit_ids, + int mps_priority, + int mcs_priority, + int ims_signalling_prio, + int mps_priority_level, + int mcs_priority_level, + OpenAPI_list_t* pra_infos, + OpenAPI_list_t* bdt_ref_ids + ); +void OpenAPI_sm_policy_dnn_data_free(OpenAPI_sm_policy_dnn_data_t *sm_policy_dnn_data); +OpenAPI_sm_policy_dnn_data_t *OpenAPI_sm_policy_dnn_data_parseFromJSON(cJSON *sm_policy_dnn_dataJSON); +cJSON *OpenAPI_sm_policy_dnn_data_convertToJSON(OpenAPI_sm_policy_dnn_data_t *sm_policy_dnn_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_sm_policy_dnn_data_H_ */ + diff --git a/lib/sbi/openapi/model/sm_policy_dnn_data_patch.c b/lib/sbi/openapi/model/sm_policy_dnn_data_patch.c new file mode 100644 index 0000000000..028c548270 --- /dev/null +++ b/lib/sbi/openapi/model/sm_policy_dnn_data_patch.c @@ -0,0 +1,117 @@ + +#include +#include +#include +#include "sm_policy_dnn_data_patch.h" + +OpenAPI_sm_policy_dnn_data_patch_t *OpenAPI_sm_policy_dnn_data_patch_create( + char *dnn, + OpenAPI_list_t* bdt_ref_ids + ) +{ + OpenAPI_sm_policy_dnn_data_patch_t *sm_policy_dnn_data_patch_local_var = OpenAPI_malloc(sizeof(OpenAPI_sm_policy_dnn_data_patch_t)); + if (!sm_policy_dnn_data_patch_local_var) { + return NULL; + } + sm_policy_dnn_data_patch_local_var->dnn = dnn; + sm_policy_dnn_data_patch_local_var->bdt_ref_ids = bdt_ref_ids; + + return sm_policy_dnn_data_patch_local_var; +} + +void OpenAPI_sm_policy_dnn_data_patch_free(OpenAPI_sm_policy_dnn_data_patch_t *sm_policy_dnn_data_patch) +{ + if (NULL == sm_policy_dnn_data_patch) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(sm_policy_dnn_data_patch->dnn); + OpenAPI_list_for_each(sm_policy_dnn_data_patch->bdt_ref_ids, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_dnn_data_patch->bdt_ref_ids); + ogs_free(sm_policy_dnn_data_patch); +} + +cJSON *OpenAPI_sm_policy_dnn_data_patch_convertToJSON(OpenAPI_sm_policy_dnn_data_patch_t *sm_policy_dnn_data_patch) +{ + cJSON *item = NULL; + + if (sm_policy_dnn_data_patch == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_patch_convertToJSON() failed [SmPolicyDnnDataPatch]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!sm_policy_dnn_data_patch->dnn) { + ogs_error("OpenAPI_sm_policy_dnn_data_patch_convertToJSON() failed [dnn]"); + goto end; + } + if (cJSON_AddStringToObject(item, "dnn", sm_policy_dnn_data_patch->dnn) == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_patch_convertToJSON() failed [dnn]"); + goto end; + } + + if (sm_policy_dnn_data_patch->bdt_ref_ids) { + cJSON *bdt_ref_ids = cJSON_AddObjectToObject(item, "bdtRefIds"); + if (bdt_ref_ids == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_patch_convertToJSON() failed [bdt_ref_ids]"); + goto end; + } + cJSON *localMapObject = bdt_ref_ids; + OpenAPI_lnode_t *bdt_ref_ids_node; + if (sm_policy_dnn_data_patch->bdt_ref_ids) { + OpenAPI_list_for_each(sm_policy_dnn_data_patch->bdt_ref_ids, bdt_ref_ids_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)bdt_ref_ids_node->data; + } + } + } + +end: + return item; +} + +OpenAPI_sm_policy_dnn_data_patch_t *OpenAPI_sm_policy_dnn_data_patch_parseFromJSON(cJSON *sm_policy_dnn_data_patchJSON) +{ + OpenAPI_sm_policy_dnn_data_patch_t *sm_policy_dnn_data_patch_local_var = NULL; + cJSON *dnn = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_data_patchJSON, "dnn"); + if (!dnn) { + ogs_error("OpenAPI_sm_policy_dnn_data_patch_parseFromJSON() failed [dnn]"); + goto end; + } + + + if (!cJSON_IsString(dnn)) { + ogs_error("OpenAPI_sm_policy_dnn_data_patch_parseFromJSON() failed [dnn]"); + goto end; + } + + cJSON *bdt_ref_ids = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_data_patchJSON, "bdtRefIds"); + + OpenAPI_list_t *bdt_ref_idsList; + if (bdt_ref_ids) { + cJSON *bdt_ref_ids_local_map; + if (!cJSON_IsObject(bdt_ref_ids)) { + ogs_error("OpenAPI_sm_policy_dnn_data_patch_parseFromJSON() failed [bdt_ref_ids]"); + goto end; + } + bdt_ref_idsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(bdt_ref_ids_local_map, bdt_ref_ids) { + cJSON *localMapObject = bdt_ref_ids_local_map; + OpenAPI_list_add(bdt_ref_idsList, localMapKeyPair); + } + } + + sm_policy_dnn_data_patch_local_var = OpenAPI_sm_policy_dnn_data_patch_create ( + ogs_strdup(dnn->valuestring), + bdt_ref_ids ? bdt_ref_idsList : NULL + ); + + return sm_policy_dnn_data_patch_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/sm_policy_dnn_data_patch.h b/lib/sbi/openapi/model/sm_policy_dnn_data_patch.h new file mode 100644 index 0000000000..f27c7a38da --- /dev/null +++ b/lib/sbi/openapi/model/sm_policy_dnn_data_patch.h @@ -0,0 +1,39 @@ +/* + * sm_policy_dnn_data_patch.h + * + * Contains the SM policy data for a given DNN (and S-NSSAI). + */ + +#ifndef _OpenAPI_sm_policy_dnn_data_patch_H_ +#define _OpenAPI_sm_policy_dnn_data_patch_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_sm_policy_dnn_data_patch_s OpenAPI_sm_policy_dnn_data_patch_t; +typedef struct OpenAPI_sm_policy_dnn_data_patch_s { + char *dnn; + OpenAPI_list_t* bdt_ref_ids; +} OpenAPI_sm_policy_dnn_data_patch_t; + +OpenAPI_sm_policy_dnn_data_patch_t *OpenAPI_sm_policy_dnn_data_patch_create( + char *dnn, + OpenAPI_list_t* bdt_ref_ids + ); +void OpenAPI_sm_policy_dnn_data_patch_free(OpenAPI_sm_policy_dnn_data_patch_t *sm_policy_dnn_data_patch); +OpenAPI_sm_policy_dnn_data_patch_t *OpenAPI_sm_policy_dnn_data_patch_parseFromJSON(cJSON *sm_policy_dnn_data_patchJSON); +cJSON *OpenAPI_sm_policy_dnn_data_patch_convertToJSON(OpenAPI_sm_policy_dnn_data_patch_t *sm_policy_dnn_data_patch); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_sm_policy_dnn_data_patch_H_ */ + diff --git a/lib/sbi/openapi/model/sm_policy_snssai_data.c b/lib/sbi/openapi/model/sm_policy_snssai_data.c new file mode 100644 index 0000000000..8e71c795e8 --- /dev/null +++ b/lib/sbi/openapi/model/sm_policy_snssai_data.c @@ -0,0 +1,133 @@ + +#include +#include +#include +#include "sm_policy_snssai_data.h" + +OpenAPI_sm_policy_snssai_data_t *OpenAPI_sm_policy_snssai_data_create( + OpenAPI_snssai_t *snssai, + OpenAPI_list_t* sm_policy_dnn_data + ) +{ + OpenAPI_sm_policy_snssai_data_t *sm_policy_snssai_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_sm_policy_snssai_data_t)); + if (!sm_policy_snssai_data_local_var) { + return NULL; + } + sm_policy_snssai_data_local_var->snssai = snssai; + sm_policy_snssai_data_local_var->sm_policy_dnn_data = sm_policy_dnn_data; + + return sm_policy_snssai_data_local_var; +} + +void OpenAPI_sm_policy_snssai_data_free(OpenAPI_sm_policy_snssai_data_t *sm_policy_snssai_data) +{ + if (NULL == sm_policy_snssai_data) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_snssai_free(sm_policy_snssai_data->snssai); + OpenAPI_list_for_each(sm_policy_snssai_data->sm_policy_dnn_data, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_sm_policy_dnn_data_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_snssai_data->sm_policy_dnn_data); + ogs_free(sm_policy_snssai_data); +} + +cJSON *OpenAPI_sm_policy_snssai_data_convertToJSON(OpenAPI_sm_policy_snssai_data_t *sm_policy_snssai_data) +{ + cJSON *item = NULL; + + if (sm_policy_snssai_data == NULL) { + ogs_error("OpenAPI_sm_policy_snssai_data_convertToJSON() failed [SmPolicySnssaiData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!sm_policy_snssai_data->snssai) { + ogs_error("OpenAPI_sm_policy_snssai_data_convertToJSON() failed [snssai]"); + goto end; + } + cJSON *snssai_local_JSON = OpenAPI_snssai_convertToJSON(sm_policy_snssai_data->snssai); + if (snssai_local_JSON == NULL) { + ogs_error("OpenAPI_sm_policy_snssai_data_convertToJSON() failed [snssai]"); + goto end; + } + cJSON_AddItemToObject(item, "snssai", snssai_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_sm_policy_snssai_data_convertToJSON() failed [snssai]"); + goto end; + } + + if (sm_policy_snssai_data->sm_policy_dnn_data) { + cJSON *sm_policy_dnn_data = cJSON_AddObjectToObject(item, "smPolicyDnnData"); + if (sm_policy_dnn_data == NULL) { + ogs_error("OpenAPI_sm_policy_snssai_data_convertToJSON() failed [sm_policy_dnn_data]"); + goto end; + } + cJSON *localMapObject = sm_policy_dnn_data; + OpenAPI_lnode_t *sm_policy_dnn_data_node; + if (sm_policy_snssai_data->sm_policy_dnn_data) { + OpenAPI_list_for_each(sm_policy_snssai_data->sm_policy_dnn_data, sm_policy_dnn_data_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)sm_policy_dnn_data_node->data; + cJSON *itemLocal = OpenAPI_sm_policy_dnn_data_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_snssai_data_convertToJSON() failed [sm_policy_dnn_data]"); + goto end; + } + cJSON_AddItemToObject(sm_policy_dnn_data, localKeyValue->key, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_sm_policy_snssai_data_t *OpenAPI_sm_policy_snssai_data_parseFromJSON(cJSON *sm_policy_snssai_dataJSON) +{ + OpenAPI_sm_policy_snssai_data_t *sm_policy_snssai_data_local_var = NULL; + cJSON *snssai = cJSON_GetObjectItemCaseSensitive(sm_policy_snssai_dataJSON, "snssai"); + if (!snssai) { + ogs_error("OpenAPI_sm_policy_snssai_data_parseFromJSON() failed [snssai]"); + goto end; + } + + OpenAPI_snssai_t *snssai_local_nonprim = NULL; + + snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(snssai); + + cJSON *sm_policy_dnn_data = cJSON_GetObjectItemCaseSensitive(sm_policy_snssai_dataJSON, "smPolicyDnnData"); + + OpenAPI_list_t *sm_policy_dnn_dataList; + if (sm_policy_dnn_data) { + cJSON *sm_policy_dnn_data_local_map; + if (!cJSON_IsObject(sm_policy_dnn_data)) { + ogs_error("OpenAPI_sm_policy_snssai_data_parseFromJSON() failed [sm_policy_dnn_data]"); + goto end; + } + sm_policy_dnn_dataList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(sm_policy_dnn_data_local_map, sm_policy_dnn_data) { + cJSON *localMapObject = sm_policy_dnn_data_local_map; + if (!cJSON_IsObject(sm_policy_dnn_data_local_map)) { + ogs_error("OpenAPI_sm_policy_snssai_data_parseFromJSON() failed [sm_policy_dnn_data]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_sm_policy_dnn_data_parseFromJSON(localMapObject)); + OpenAPI_list_add(sm_policy_dnn_dataList, localMapKeyPair); + } + } + + sm_policy_snssai_data_local_var = OpenAPI_sm_policy_snssai_data_create ( + snssai_local_nonprim, + sm_policy_dnn_data ? sm_policy_dnn_dataList : NULL + ); + + return sm_policy_snssai_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/sm_policy_snssai_data.h b/lib/sbi/openapi/model/sm_policy_snssai_data.h new file mode 100644 index 0000000000..aca968fd2e --- /dev/null +++ b/lib/sbi/openapi/model/sm_policy_snssai_data.h @@ -0,0 +1,41 @@ +/* + * sm_policy_snssai_data.h + * + * Contains the SM policy data for a given subscriber and S-NSSAI. + */ + +#ifndef _OpenAPI_sm_policy_snssai_data_H_ +#define _OpenAPI_sm_policy_snssai_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "sm_policy_dnn_data.h" +#include "snssai.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_sm_policy_snssai_data_s OpenAPI_sm_policy_snssai_data_t; +typedef struct OpenAPI_sm_policy_snssai_data_s { + struct OpenAPI_snssai_s *snssai; + OpenAPI_list_t* sm_policy_dnn_data; +} OpenAPI_sm_policy_snssai_data_t; + +OpenAPI_sm_policy_snssai_data_t *OpenAPI_sm_policy_snssai_data_create( + OpenAPI_snssai_t *snssai, + OpenAPI_list_t* sm_policy_dnn_data + ); +void OpenAPI_sm_policy_snssai_data_free(OpenAPI_sm_policy_snssai_data_t *sm_policy_snssai_data); +OpenAPI_sm_policy_snssai_data_t *OpenAPI_sm_policy_snssai_data_parseFromJSON(cJSON *sm_policy_snssai_dataJSON); +cJSON *OpenAPI_sm_policy_snssai_data_convertToJSON(OpenAPI_sm_policy_snssai_data_t *sm_policy_snssai_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_sm_policy_snssai_data_H_ */ + diff --git a/lib/sbi/openapi/model/sm_policy_snssai_data_patch.c b/lib/sbi/openapi/model/sm_policy_snssai_data_patch.c new file mode 100644 index 0000000000..a8b50c62d6 --- /dev/null +++ b/lib/sbi/openapi/model/sm_policy_snssai_data_patch.c @@ -0,0 +1,133 @@ + +#include +#include +#include +#include "sm_policy_snssai_data_patch.h" + +OpenAPI_sm_policy_snssai_data_patch_t *OpenAPI_sm_policy_snssai_data_patch_create( + OpenAPI_snssai_t *snssai, + OpenAPI_list_t* sm_policy_dnn_data + ) +{ + OpenAPI_sm_policy_snssai_data_patch_t *sm_policy_snssai_data_patch_local_var = OpenAPI_malloc(sizeof(OpenAPI_sm_policy_snssai_data_patch_t)); + if (!sm_policy_snssai_data_patch_local_var) { + return NULL; + } + sm_policy_snssai_data_patch_local_var->snssai = snssai; + sm_policy_snssai_data_patch_local_var->sm_policy_dnn_data = sm_policy_dnn_data; + + return sm_policy_snssai_data_patch_local_var; +} + +void OpenAPI_sm_policy_snssai_data_patch_free(OpenAPI_sm_policy_snssai_data_patch_t *sm_policy_snssai_data_patch) +{ + if (NULL == sm_policy_snssai_data_patch) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_snssai_free(sm_policy_snssai_data_patch->snssai); + OpenAPI_list_for_each(sm_policy_snssai_data_patch->sm_policy_dnn_data, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_sm_policy_dnn_data_patch_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_snssai_data_patch->sm_policy_dnn_data); + ogs_free(sm_policy_snssai_data_patch); +} + +cJSON *OpenAPI_sm_policy_snssai_data_patch_convertToJSON(OpenAPI_sm_policy_snssai_data_patch_t *sm_policy_snssai_data_patch) +{ + cJSON *item = NULL; + + if (sm_policy_snssai_data_patch == NULL) { + ogs_error("OpenAPI_sm_policy_snssai_data_patch_convertToJSON() failed [SmPolicySnssaiDataPatch]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!sm_policy_snssai_data_patch->snssai) { + ogs_error("OpenAPI_sm_policy_snssai_data_patch_convertToJSON() failed [snssai]"); + goto end; + } + cJSON *snssai_local_JSON = OpenAPI_snssai_convertToJSON(sm_policy_snssai_data_patch->snssai); + if (snssai_local_JSON == NULL) { + ogs_error("OpenAPI_sm_policy_snssai_data_patch_convertToJSON() failed [snssai]"); + goto end; + } + cJSON_AddItemToObject(item, "snssai", snssai_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_sm_policy_snssai_data_patch_convertToJSON() failed [snssai]"); + goto end; + } + + if (sm_policy_snssai_data_patch->sm_policy_dnn_data) { + cJSON *sm_policy_dnn_data = cJSON_AddObjectToObject(item, "smPolicyDnnData"); + if (sm_policy_dnn_data == NULL) { + ogs_error("OpenAPI_sm_policy_snssai_data_patch_convertToJSON() failed [sm_policy_dnn_data]"); + goto end; + } + cJSON *localMapObject = sm_policy_dnn_data; + OpenAPI_lnode_t *sm_policy_dnn_data_node; + if (sm_policy_snssai_data_patch->sm_policy_dnn_data) { + OpenAPI_list_for_each(sm_policy_snssai_data_patch->sm_policy_dnn_data, sm_policy_dnn_data_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)sm_policy_dnn_data_node->data; + cJSON *itemLocal = OpenAPI_sm_policy_dnn_data_patch_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_snssai_data_patch_convertToJSON() failed [sm_policy_dnn_data]"); + goto end; + } + cJSON_AddItemToObject(sm_policy_dnn_data, localKeyValue->key, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_sm_policy_snssai_data_patch_t *OpenAPI_sm_policy_snssai_data_patch_parseFromJSON(cJSON *sm_policy_snssai_data_patchJSON) +{ + OpenAPI_sm_policy_snssai_data_patch_t *sm_policy_snssai_data_patch_local_var = NULL; + cJSON *snssai = cJSON_GetObjectItemCaseSensitive(sm_policy_snssai_data_patchJSON, "snssai"); + if (!snssai) { + ogs_error("OpenAPI_sm_policy_snssai_data_patch_parseFromJSON() failed [snssai]"); + goto end; + } + + OpenAPI_snssai_t *snssai_local_nonprim = NULL; + + snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(snssai); + + cJSON *sm_policy_dnn_data = cJSON_GetObjectItemCaseSensitive(sm_policy_snssai_data_patchJSON, "smPolicyDnnData"); + + OpenAPI_list_t *sm_policy_dnn_dataList; + if (sm_policy_dnn_data) { + cJSON *sm_policy_dnn_data_local_map; + if (!cJSON_IsObject(sm_policy_dnn_data)) { + ogs_error("OpenAPI_sm_policy_snssai_data_patch_parseFromJSON() failed [sm_policy_dnn_data]"); + goto end; + } + sm_policy_dnn_dataList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(sm_policy_dnn_data_local_map, sm_policy_dnn_data) { + cJSON *localMapObject = sm_policy_dnn_data_local_map; + if (!cJSON_IsObject(sm_policy_dnn_data_local_map)) { + ogs_error("OpenAPI_sm_policy_snssai_data_patch_parseFromJSON() failed [sm_policy_dnn_data]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_sm_policy_dnn_data_patch_parseFromJSON(localMapObject)); + OpenAPI_list_add(sm_policy_dnn_dataList, localMapKeyPair); + } + } + + sm_policy_snssai_data_patch_local_var = OpenAPI_sm_policy_snssai_data_patch_create ( + snssai_local_nonprim, + sm_policy_dnn_data ? sm_policy_dnn_dataList : NULL + ); + + return sm_policy_snssai_data_patch_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/sm_policy_snssai_data_patch.h b/lib/sbi/openapi/model/sm_policy_snssai_data_patch.h new file mode 100644 index 0000000000..e605f037b6 --- /dev/null +++ b/lib/sbi/openapi/model/sm_policy_snssai_data_patch.h @@ -0,0 +1,41 @@ +/* + * sm_policy_snssai_data_patch.h + * + * Contains the SM policy data for a given subscriber and S-NSSAI. + */ + +#ifndef _OpenAPI_sm_policy_snssai_data_patch_H_ +#define _OpenAPI_sm_policy_snssai_data_patch_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "sm_policy_dnn_data_patch.h" +#include "snssai.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_sm_policy_snssai_data_patch_s OpenAPI_sm_policy_snssai_data_patch_t; +typedef struct OpenAPI_sm_policy_snssai_data_patch_s { + struct OpenAPI_snssai_s *snssai; + OpenAPI_list_t* sm_policy_dnn_data; +} OpenAPI_sm_policy_snssai_data_patch_t; + +OpenAPI_sm_policy_snssai_data_patch_t *OpenAPI_sm_policy_snssai_data_patch_create( + OpenAPI_snssai_t *snssai, + OpenAPI_list_t* sm_policy_dnn_data + ); +void OpenAPI_sm_policy_snssai_data_patch_free(OpenAPI_sm_policy_snssai_data_patch_t *sm_policy_snssai_data_patch); +OpenAPI_sm_policy_snssai_data_patch_t *OpenAPI_sm_policy_snssai_data_patch_parseFromJSON(cJSON *sm_policy_snssai_data_patchJSON); +cJSON *OpenAPI_sm_policy_snssai_data_patch_convertToJSON(OpenAPI_sm_policy_snssai_data_patch_t *sm_policy_snssai_data_patch); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_sm_policy_snssai_data_patch_H_ */ + diff --git a/lib/sbi/openapi/model/smf_info.c b/lib/sbi/openapi/model/smf_info.c index 40f0c6784c..85ae1864f6 100644 --- a/lib/sbi/openapi/model/smf_info.c +++ b/lib/sbi/openapi/model/smf_info.c @@ -9,7 +9,8 @@ OpenAPI_smf_info_t *OpenAPI_smf_info_create( OpenAPI_list_t *tai_list, OpenAPI_list_t *tai_range_list, char *pgw_fqdn, - OpenAPI_list_t *access_type + OpenAPI_list_t *access_type, + int priority ) { OpenAPI_smf_info_t *smf_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_smf_info_t)); @@ -21,6 +22,7 @@ OpenAPI_smf_info_t *OpenAPI_smf_info_create( smf_info_local_var->tai_range_list = tai_range_list; smf_info_local_var->pgw_fqdn = pgw_fqdn; smf_info_local_var->access_type = access_type; + smf_info_local_var->priority = priority; return smf_info_local_var; } @@ -142,6 +144,13 @@ cJSON *OpenAPI_smf_info_convertToJSON(OpenAPI_smf_info_t *smf_info) } } + if (smf_info->priority) { + if (cJSON_AddNumberToObject(item, "priority", smf_info->priority) == NULL) { + ogs_error("OpenAPI_smf_info_convertToJSON() failed [priority]"); + goto end; + } + } + end: return item; } @@ -252,12 +261,22 @@ OpenAPI_smf_info_t *OpenAPI_smf_info_parseFromJSON(cJSON *smf_infoJSON) } } + cJSON *priority = cJSON_GetObjectItemCaseSensitive(smf_infoJSON, "priority"); + + if (priority) { + if (!cJSON_IsNumber(priority)) { + ogs_error("OpenAPI_smf_info_parseFromJSON() failed [priority]"); + goto end; + } + } + smf_info_local_var = OpenAPI_smf_info_create ( s_nssai_smf_info_listList, tai_list ? tai_listList : NULL, tai_range_list ? tai_range_listList : NULL, pgw_fqdn ? ogs_strdup(pgw_fqdn->valuestring) : NULL, - access_type ? access_typeList : NULL + access_type ? access_typeList : NULL, + priority ? priority->valuedouble : 0 ); return smf_info_local_var; diff --git a/lib/sbi/openapi/model/smf_info.h b/lib/sbi/openapi/model/smf_info.h index 8ef8c67ac0..ad6db49d5d 100644 --- a/lib/sbi/openapi/model/smf_info.h +++ b/lib/sbi/openapi/model/smf_info.h @@ -1,7 +1,7 @@ /* * smf_info.h * - * + * Information of an SMF NF Instance */ #ifndef _OpenAPI_smf_info_H_ @@ -28,6 +28,7 @@ typedef struct OpenAPI_smf_info_s { OpenAPI_list_t *tai_range_list; char *pgw_fqdn; OpenAPI_list_t *access_type; + int priority; } OpenAPI_smf_info_t; OpenAPI_smf_info_t *OpenAPI_smf_info_create( @@ -35,7 +36,8 @@ OpenAPI_smf_info_t *OpenAPI_smf_info_create( OpenAPI_list_t *tai_list, OpenAPI_list_t *tai_range_list, char *pgw_fqdn, - OpenAPI_list_t *access_type + OpenAPI_list_t *access_type, + int priority ); void OpenAPI_smf_info_free(OpenAPI_smf_info_t *smf_info); OpenAPI_smf_info_t *OpenAPI_smf_info_parseFromJSON(cJSON *smf_infoJSON); diff --git a/lib/sbi/openapi/model/smf_registration.c b/lib/sbi/openapi/model/smf_registration.c new file mode 100644 index 0000000000..ea28582321 --- /dev/null +++ b/lib/sbi/openapi/model/smf_registration.c @@ -0,0 +1,360 @@ + +#include +#include +#include +#include "smf_registration.h" + +OpenAPI_smf_registration_t *OpenAPI_smf_registration_create( + char *smf_instance_id, + char *smf_set_id, + char *supported_features, + int pdu_session_id, + OpenAPI_snssai_t *single_nssai, + char *dnn, + int emergency_services, + char *pcscf_restoration_callback_uri, + OpenAPI_plmn_id_t *plmn_id, + char *pgw_fqdn, + int epdg_ind, + char *dereg_callback_uri, + OpenAPI_registration_reason_t *registration_reason, + char *registration_time + ) +{ + OpenAPI_smf_registration_t *smf_registration_local_var = OpenAPI_malloc(sizeof(OpenAPI_smf_registration_t)); + if (!smf_registration_local_var) { + return NULL; + } + smf_registration_local_var->smf_instance_id = smf_instance_id; + smf_registration_local_var->smf_set_id = smf_set_id; + smf_registration_local_var->supported_features = supported_features; + smf_registration_local_var->pdu_session_id = pdu_session_id; + smf_registration_local_var->single_nssai = single_nssai; + smf_registration_local_var->dnn = dnn; + smf_registration_local_var->emergency_services = emergency_services; + smf_registration_local_var->pcscf_restoration_callback_uri = pcscf_restoration_callback_uri; + smf_registration_local_var->plmn_id = plmn_id; + smf_registration_local_var->pgw_fqdn = pgw_fqdn; + smf_registration_local_var->epdg_ind = epdg_ind; + smf_registration_local_var->dereg_callback_uri = dereg_callback_uri; + smf_registration_local_var->registration_reason = registration_reason; + smf_registration_local_var->registration_time = registration_time; + + return smf_registration_local_var; +} + +void OpenAPI_smf_registration_free(OpenAPI_smf_registration_t *smf_registration) +{ + if (NULL == smf_registration) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(smf_registration->smf_instance_id); + ogs_free(smf_registration->smf_set_id); + ogs_free(smf_registration->supported_features); + OpenAPI_snssai_free(smf_registration->single_nssai); + ogs_free(smf_registration->dnn); + ogs_free(smf_registration->pcscf_restoration_callback_uri); + OpenAPI_plmn_id_free(smf_registration->plmn_id); + ogs_free(smf_registration->pgw_fqdn); + ogs_free(smf_registration->dereg_callback_uri); + OpenAPI_registration_reason_free(smf_registration->registration_reason); + ogs_free(smf_registration->registration_time); + ogs_free(smf_registration); +} + +cJSON *OpenAPI_smf_registration_convertToJSON(OpenAPI_smf_registration_t *smf_registration) +{ + cJSON *item = NULL; + + if (smf_registration == NULL) { + ogs_error("OpenAPI_smf_registration_convertToJSON() failed [SmfRegistration]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!smf_registration->smf_instance_id) { + ogs_error("OpenAPI_smf_registration_convertToJSON() failed [smf_instance_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "smfInstanceId", smf_registration->smf_instance_id) == NULL) { + ogs_error("OpenAPI_smf_registration_convertToJSON() failed [smf_instance_id]"); + goto end; + } + + if (smf_registration->smf_set_id) { + if (cJSON_AddStringToObject(item, "smfSetId", smf_registration->smf_set_id) == NULL) { + ogs_error("OpenAPI_smf_registration_convertToJSON() failed [smf_set_id]"); + goto end; + } + } + + if (smf_registration->supported_features) { + if (cJSON_AddStringToObject(item, "supportedFeatures", smf_registration->supported_features) == NULL) { + ogs_error("OpenAPI_smf_registration_convertToJSON() failed [supported_features]"); + goto end; + } + } + + if (!smf_registration->pdu_session_id) { + ogs_error("OpenAPI_smf_registration_convertToJSON() failed [pdu_session_id]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "pduSessionId", smf_registration->pdu_session_id) == NULL) { + ogs_error("OpenAPI_smf_registration_convertToJSON() failed [pdu_session_id]"); + goto end; + } + + if (!smf_registration->single_nssai) { + ogs_error("OpenAPI_smf_registration_convertToJSON() failed [single_nssai]"); + goto end; + } + cJSON *single_nssai_local_JSON = OpenAPI_snssai_convertToJSON(smf_registration->single_nssai); + if (single_nssai_local_JSON == NULL) { + ogs_error("OpenAPI_smf_registration_convertToJSON() failed [single_nssai]"); + goto end; + } + cJSON_AddItemToObject(item, "singleNssai", single_nssai_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_smf_registration_convertToJSON() failed [single_nssai]"); + goto end; + } + + if (smf_registration->dnn) { + if (cJSON_AddStringToObject(item, "dnn", smf_registration->dnn) == NULL) { + ogs_error("OpenAPI_smf_registration_convertToJSON() failed [dnn]"); + goto end; + } + } + + if (smf_registration->emergency_services >= 0) { + if (cJSON_AddBoolToObject(item, "emergencyServices", smf_registration->emergency_services) == NULL) { + ogs_error("OpenAPI_smf_registration_convertToJSON() failed [emergency_services]"); + goto end; + } + } + + if (smf_registration->pcscf_restoration_callback_uri) { + if (cJSON_AddStringToObject(item, "pcscfRestorationCallbackUri", smf_registration->pcscf_restoration_callback_uri) == NULL) { + ogs_error("OpenAPI_smf_registration_convertToJSON() failed [pcscf_restoration_callback_uri]"); + goto end; + } + } + + if (!smf_registration->plmn_id) { + ogs_error("OpenAPI_smf_registration_convertToJSON() failed [plmn_id]"); + goto end; + } + cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_convertToJSON(smf_registration->plmn_id); + if (plmn_id_local_JSON == NULL) { + ogs_error("OpenAPI_smf_registration_convertToJSON() failed [plmn_id]"); + goto end; + } + cJSON_AddItemToObject(item, "plmnId", plmn_id_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_smf_registration_convertToJSON() failed [plmn_id]"); + goto end; + } + + if (smf_registration->pgw_fqdn) { + if (cJSON_AddStringToObject(item, "pgwFqdn", smf_registration->pgw_fqdn) == NULL) { + ogs_error("OpenAPI_smf_registration_convertToJSON() failed [pgw_fqdn]"); + goto end; + } + } + + if (smf_registration->epdg_ind >= 0) { + if (cJSON_AddBoolToObject(item, "epdgInd", smf_registration->epdg_ind) == NULL) { + ogs_error("OpenAPI_smf_registration_convertToJSON() failed [epdg_ind]"); + goto end; + } + } + + if (smf_registration->dereg_callback_uri) { + if (cJSON_AddStringToObject(item, "deregCallbackUri", smf_registration->dereg_callback_uri) == NULL) { + ogs_error("OpenAPI_smf_registration_convertToJSON() failed [dereg_callback_uri]"); + goto end; + } + } + + if (smf_registration->registration_reason) { + cJSON *registration_reason_local_JSON = OpenAPI_registration_reason_convertToJSON(smf_registration->registration_reason); + if (registration_reason_local_JSON == NULL) { + ogs_error("OpenAPI_smf_registration_convertToJSON() failed [registration_reason]"); + goto end; + } + cJSON_AddItemToObject(item, "registrationReason", registration_reason_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_smf_registration_convertToJSON() failed [registration_reason]"); + goto end; + } + } + + if (smf_registration->registration_time) { + if (cJSON_AddStringToObject(item, "registrationTime", smf_registration->registration_time) == NULL) { + ogs_error("OpenAPI_smf_registration_convertToJSON() failed [registration_time]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_smf_registration_t *OpenAPI_smf_registration_parseFromJSON(cJSON *smf_registrationJSON) +{ + OpenAPI_smf_registration_t *smf_registration_local_var = NULL; + cJSON *smf_instance_id = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "smfInstanceId"); + if (!smf_instance_id) { + ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [smf_instance_id]"); + goto end; + } + + + if (!cJSON_IsString(smf_instance_id)) { + ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [smf_instance_id]"); + goto end; + } + + cJSON *smf_set_id = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "smfSetId"); + + if (smf_set_id) { + if (!cJSON_IsString(smf_set_id)) { + ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [smf_set_id]"); + goto end; + } + } + + cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "supportedFeatures"); + + if (supported_features) { + if (!cJSON_IsString(supported_features)) { + ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [supported_features]"); + goto end; + } + } + + cJSON *pdu_session_id = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "pduSessionId"); + if (!pdu_session_id) { + ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [pdu_session_id]"); + goto end; + } + + + if (!cJSON_IsNumber(pdu_session_id)) { + ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [pdu_session_id]"); + goto end; + } + + cJSON *single_nssai = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "singleNssai"); + if (!single_nssai) { + ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [single_nssai]"); + goto end; + } + + OpenAPI_snssai_t *single_nssai_local_nonprim = NULL; + + single_nssai_local_nonprim = OpenAPI_snssai_parseFromJSON(single_nssai); + + cJSON *dnn = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "dnn"); + + if (dnn) { + if (!cJSON_IsString(dnn)) { + ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [dnn]"); + goto end; + } + } + + cJSON *emergency_services = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "emergencyServices"); + + if (emergency_services) { + if (!cJSON_IsBool(emergency_services)) { + ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [emergency_services]"); + goto end; + } + } + + cJSON *pcscf_restoration_callback_uri = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "pcscfRestorationCallbackUri"); + + if (pcscf_restoration_callback_uri) { + if (!cJSON_IsString(pcscf_restoration_callback_uri)) { + ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [pcscf_restoration_callback_uri]"); + goto end; + } + } + + cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "plmnId"); + if (!plmn_id) { + ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [plmn_id]"); + goto end; + } + + OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + + plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); + + cJSON *pgw_fqdn = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "pgwFqdn"); + + if (pgw_fqdn) { + if (!cJSON_IsString(pgw_fqdn)) { + ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [pgw_fqdn]"); + goto end; + } + } + + cJSON *epdg_ind = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "epdgInd"); + + if (epdg_ind) { + if (!cJSON_IsBool(epdg_ind)) { + ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [epdg_ind]"); + goto end; + } + } + + cJSON *dereg_callback_uri = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "deregCallbackUri"); + + if (dereg_callback_uri) { + if (!cJSON_IsString(dereg_callback_uri)) { + ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [dereg_callback_uri]"); + goto end; + } + } + + cJSON *registration_reason = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "registrationReason"); + + OpenAPI_registration_reason_t *registration_reason_local_nonprim = NULL; + if (registration_reason) { + registration_reason_local_nonprim = OpenAPI_registration_reason_parseFromJSON(registration_reason); + } + + cJSON *registration_time = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "registrationTime"); + + if (registration_time) { + if (!cJSON_IsString(registration_time)) { + ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [registration_time]"); + goto end; + } + } + + smf_registration_local_var = OpenAPI_smf_registration_create ( + ogs_strdup(smf_instance_id->valuestring), + smf_set_id ? ogs_strdup(smf_set_id->valuestring) : NULL, + supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + pdu_session_id->valuedouble, + single_nssai_local_nonprim, + dnn ? ogs_strdup(dnn->valuestring) : NULL, + emergency_services ? emergency_services->valueint : 0, + pcscf_restoration_callback_uri ? ogs_strdup(pcscf_restoration_callback_uri->valuestring) : NULL, + plmn_id_local_nonprim, + pgw_fqdn ? ogs_strdup(pgw_fqdn->valuestring) : NULL, + epdg_ind ? epdg_ind->valueint : 0, + dereg_callback_uri ? ogs_strdup(dereg_callback_uri->valuestring) : NULL, + registration_reason ? registration_reason_local_nonprim : NULL, + registration_time ? ogs_strdup(registration_time->valuestring) : NULL + ); + + return smf_registration_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/smf_registration.h b/lib/sbi/openapi/model/smf_registration.h new file mode 100644 index 0000000000..0ea9574420 --- /dev/null +++ b/lib/sbi/openapi/model/smf_registration.h @@ -0,0 +1,66 @@ +/* + * smf_registration.h + * + * + */ + +#ifndef _OpenAPI_smf_registration_H_ +#define _OpenAPI_smf_registration_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "plmn_id.h" +#include "registration_reason.h" +#include "snssai.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_smf_registration_s OpenAPI_smf_registration_t; +typedef struct OpenAPI_smf_registration_s { + char *smf_instance_id; + char *smf_set_id; + char *supported_features; + int pdu_session_id; + struct OpenAPI_snssai_s *single_nssai; + char *dnn; + int emergency_services; + char *pcscf_restoration_callback_uri; + struct OpenAPI_plmn_id_s *plmn_id; + char *pgw_fqdn; + int epdg_ind; + char *dereg_callback_uri; + struct OpenAPI_registration_reason_s *registration_reason; + char *registration_time; +} OpenAPI_smf_registration_t; + +OpenAPI_smf_registration_t *OpenAPI_smf_registration_create( + char *smf_instance_id, + char *smf_set_id, + char *supported_features, + int pdu_session_id, + OpenAPI_snssai_t *single_nssai, + char *dnn, + int emergency_services, + char *pcscf_restoration_callback_uri, + OpenAPI_plmn_id_t *plmn_id, + char *pgw_fqdn, + int epdg_ind, + char *dereg_callback_uri, + OpenAPI_registration_reason_t *registration_reason, + char *registration_time + ); +void OpenAPI_smf_registration_free(OpenAPI_smf_registration_t *smf_registration); +OpenAPI_smf_registration_t *OpenAPI_smf_registration_parseFromJSON(cJSON *smf_registrationJSON); +cJSON *OpenAPI_smf_registration_convertToJSON(OpenAPI_smf_registration_t *smf_registration); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_smf_registration_H_ */ + diff --git a/lib/sbi/openapi/model/smf_registration_info.c b/lib/sbi/openapi/model/smf_registration_info.c new file mode 100644 index 0000000000..436d2a672d --- /dev/null +++ b/lib/sbi/openapi/model/smf_registration_info.c @@ -0,0 +1,106 @@ + +#include +#include +#include +#include "smf_registration_info.h" + +OpenAPI_smf_registration_info_t *OpenAPI_smf_registration_info_create( + OpenAPI_list_t *smf_registration_list + ) +{ + OpenAPI_smf_registration_info_t *smf_registration_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_smf_registration_info_t)); + if (!smf_registration_info_local_var) { + return NULL; + } + smf_registration_info_local_var->smf_registration_list = smf_registration_list; + + return smf_registration_info_local_var; +} + +void OpenAPI_smf_registration_info_free(OpenAPI_smf_registration_info_t *smf_registration_info) +{ + if (NULL == smf_registration_info) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(smf_registration_info->smf_registration_list, node) { + OpenAPI_smf_registration_free(node->data); + } + OpenAPI_list_free(smf_registration_info->smf_registration_list); + ogs_free(smf_registration_info); +} + +cJSON *OpenAPI_smf_registration_info_convertToJSON(OpenAPI_smf_registration_info_t *smf_registration_info) +{ + cJSON *item = NULL; + + if (smf_registration_info == NULL) { + ogs_error("OpenAPI_smf_registration_info_convertToJSON() failed [SmfRegistrationInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!smf_registration_info->smf_registration_list) { + ogs_error("OpenAPI_smf_registration_info_convertToJSON() failed [smf_registration_list]"); + goto end; + } + cJSON *smf_registration_listList = cJSON_AddArrayToObject(item, "smfRegistrationList"); + if (smf_registration_listList == NULL) { + ogs_error("OpenAPI_smf_registration_info_convertToJSON() failed [smf_registration_list]"); + goto end; + } + + OpenAPI_lnode_t *smf_registration_list_node; + if (smf_registration_info->smf_registration_list) { + OpenAPI_list_for_each(smf_registration_info->smf_registration_list, smf_registration_list_node) { + cJSON *itemLocal = OpenAPI_smf_registration_convertToJSON(smf_registration_list_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_smf_registration_info_convertToJSON() failed [smf_registration_list]"); + goto end; + } + cJSON_AddItemToArray(smf_registration_listList, itemLocal); + } + } + +end: + return item; +} + +OpenAPI_smf_registration_info_t *OpenAPI_smf_registration_info_parseFromJSON(cJSON *smf_registration_infoJSON) +{ + OpenAPI_smf_registration_info_t *smf_registration_info_local_var = NULL; + cJSON *smf_registration_list = cJSON_GetObjectItemCaseSensitive(smf_registration_infoJSON, "smfRegistrationList"); + if (!smf_registration_list) { + ogs_error("OpenAPI_smf_registration_info_parseFromJSON() failed [smf_registration_list]"); + goto end; + } + + OpenAPI_list_t *smf_registration_listList; + + cJSON *smf_registration_list_local_nonprimitive; + if (!cJSON_IsArray(smf_registration_list)) { + ogs_error("OpenAPI_smf_registration_info_parseFromJSON() failed [smf_registration_list]"); + goto end; + } + + smf_registration_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(smf_registration_list_local_nonprimitive, smf_registration_list ) { + if (!cJSON_IsObject(smf_registration_list_local_nonprimitive)) { + ogs_error("OpenAPI_smf_registration_info_parseFromJSON() failed [smf_registration_list]"); + goto end; + } + OpenAPI_smf_registration_t *smf_registration_listItem = OpenAPI_smf_registration_parseFromJSON(smf_registration_list_local_nonprimitive); + + OpenAPI_list_add(smf_registration_listList, smf_registration_listItem); + } + + smf_registration_info_local_var = OpenAPI_smf_registration_info_create ( + smf_registration_listList + ); + + return smf_registration_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/smf_registration_info.h b/lib/sbi/openapi/model/smf_registration_info.h new file mode 100644 index 0000000000..f784d6b41b --- /dev/null +++ b/lib/sbi/openapi/model/smf_registration_info.h @@ -0,0 +1,38 @@ +/* + * smf_registration_info.h + * + * + */ + +#ifndef _OpenAPI_smf_registration_info_H_ +#define _OpenAPI_smf_registration_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "smf_registration.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_smf_registration_info_s OpenAPI_smf_registration_info_t; +typedef struct OpenAPI_smf_registration_info_s { + OpenAPI_list_t *smf_registration_list; +} OpenAPI_smf_registration_info_t; + +OpenAPI_smf_registration_info_t *OpenAPI_smf_registration_info_create( + OpenAPI_list_t *smf_registration_list + ); +void OpenAPI_smf_registration_info_free(OpenAPI_smf_registration_info_t *smf_registration_info); +OpenAPI_smf_registration_info_t *OpenAPI_smf_registration_info_parseFromJSON(cJSON *smf_registration_infoJSON); +cJSON *OpenAPI_smf_registration_info_convertToJSON(OpenAPI_smf_registration_info_t *smf_registration_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_smf_registration_info_H_ */ + diff --git a/lib/sbi/openapi/model/smf_selection_subscription_data.c b/lib/sbi/openapi/model/smf_selection_subscription_data.c new file mode 100644 index 0000000000..e8f69aed00 --- /dev/null +++ b/lib/sbi/openapi/model/smf_selection_subscription_data.c @@ -0,0 +1,144 @@ + +#include +#include +#include +#include "smf_selection_subscription_data.h" + +OpenAPI_smf_selection_subscription_data_t *OpenAPI_smf_selection_subscription_data_create( + char *supported_features, + OpenAPI_list_t* subscribed_snssai_infos, + char *shared_snssai_infos_id + ) +{ + OpenAPI_smf_selection_subscription_data_t *smf_selection_subscription_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_smf_selection_subscription_data_t)); + if (!smf_selection_subscription_data_local_var) { + return NULL; + } + smf_selection_subscription_data_local_var->supported_features = supported_features; + smf_selection_subscription_data_local_var->subscribed_snssai_infos = subscribed_snssai_infos; + smf_selection_subscription_data_local_var->shared_snssai_infos_id = shared_snssai_infos_id; + + return smf_selection_subscription_data_local_var; +} + +void OpenAPI_smf_selection_subscription_data_free(OpenAPI_smf_selection_subscription_data_t *smf_selection_subscription_data) +{ + if (NULL == smf_selection_subscription_data) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(smf_selection_subscription_data->supported_features); + OpenAPI_list_for_each(smf_selection_subscription_data->subscribed_snssai_infos, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_snssai_info_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(smf_selection_subscription_data->subscribed_snssai_infos); + ogs_free(smf_selection_subscription_data->shared_snssai_infos_id); + ogs_free(smf_selection_subscription_data); +} + +cJSON *OpenAPI_smf_selection_subscription_data_convertToJSON(OpenAPI_smf_selection_subscription_data_t *smf_selection_subscription_data) +{ + cJSON *item = NULL; + + if (smf_selection_subscription_data == NULL) { + ogs_error("OpenAPI_smf_selection_subscription_data_convertToJSON() failed [SmfSelectionSubscriptionData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (smf_selection_subscription_data->supported_features) { + if (cJSON_AddStringToObject(item, "supportedFeatures", smf_selection_subscription_data->supported_features) == NULL) { + ogs_error("OpenAPI_smf_selection_subscription_data_convertToJSON() failed [supported_features]"); + goto end; + } + } + + if (smf_selection_subscription_data->subscribed_snssai_infos) { + cJSON *subscribed_snssai_infos = cJSON_AddObjectToObject(item, "subscribedSnssaiInfos"); + if (subscribed_snssai_infos == NULL) { + ogs_error("OpenAPI_smf_selection_subscription_data_convertToJSON() failed [subscribed_snssai_infos]"); + goto end; + } + cJSON *localMapObject = subscribed_snssai_infos; + OpenAPI_lnode_t *subscribed_snssai_infos_node; + if (smf_selection_subscription_data->subscribed_snssai_infos) { + OpenAPI_list_for_each(smf_selection_subscription_data->subscribed_snssai_infos, subscribed_snssai_infos_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)subscribed_snssai_infos_node->data; + cJSON *itemLocal = OpenAPI_snssai_info_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_smf_selection_subscription_data_convertToJSON() failed [subscribed_snssai_infos]"); + goto end; + } + cJSON_AddItemToObject(subscribed_snssai_infos, localKeyValue->key, itemLocal); + } + } + } + + if (smf_selection_subscription_data->shared_snssai_infos_id) { + if (cJSON_AddStringToObject(item, "sharedSnssaiInfosId", smf_selection_subscription_data->shared_snssai_infos_id) == NULL) { + ogs_error("OpenAPI_smf_selection_subscription_data_convertToJSON() failed [shared_snssai_infos_id]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_smf_selection_subscription_data_t *OpenAPI_smf_selection_subscription_data_parseFromJSON(cJSON *smf_selection_subscription_dataJSON) +{ + OpenAPI_smf_selection_subscription_data_t *smf_selection_subscription_data_local_var = NULL; + cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(smf_selection_subscription_dataJSON, "supportedFeatures"); + + if (supported_features) { + if (!cJSON_IsString(supported_features)) { + ogs_error("OpenAPI_smf_selection_subscription_data_parseFromJSON() failed [supported_features]"); + goto end; + } + } + + cJSON *subscribed_snssai_infos = cJSON_GetObjectItemCaseSensitive(smf_selection_subscription_dataJSON, "subscribedSnssaiInfos"); + + OpenAPI_list_t *subscribed_snssai_infosList; + if (subscribed_snssai_infos) { + cJSON *subscribed_snssai_infos_local_map; + if (!cJSON_IsObject(subscribed_snssai_infos)) { + ogs_error("OpenAPI_smf_selection_subscription_data_parseFromJSON() failed [subscribed_snssai_infos]"); + goto end; + } + subscribed_snssai_infosList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(subscribed_snssai_infos_local_map, subscribed_snssai_infos) { + cJSON *localMapObject = subscribed_snssai_infos_local_map; + if (!cJSON_IsObject(subscribed_snssai_infos_local_map)) { + ogs_error("OpenAPI_smf_selection_subscription_data_parseFromJSON() failed [subscribed_snssai_infos]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_snssai_info_parseFromJSON(localMapObject)); + OpenAPI_list_add(subscribed_snssai_infosList, localMapKeyPair); + } + } + + cJSON *shared_snssai_infos_id = cJSON_GetObjectItemCaseSensitive(smf_selection_subscription_dataJSON, "sharedSnssaiInfosId"); + + if (shared_snssai_infos_id) { + if (!cJSON_IsString(shared_snssai_infos_id)) { + ogs_error("OpenAPI_smf_selection_subscription_data_parseFromJSON() failed [shared_snssai_infos_id]"); + goto end; + } + } + + smf_selection_subscription_data_local_var = OpenAPI_smf_selection_subscription_data_create ( + supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + subscribed_snssai_infos ? subscribed_snssai_infosList : NULL, + shared_snssai_infos_id ? ogs_strdup(shared_snssai_infos_id->valuestring) : NULL + ); + + return smf_selection_subscription_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/smf_selection_subscription_data.h b/lib/sbi/openapi/model/smf_selection_subscription_data.h new file mode 100644 index 0000000000..a43a59385a --- /dev/null +++ b/lib/sbi/openapi/model/smf_selection_subscription_data.h @@ -0,0 +1,42 @@ +/* + * smf_selection_subscription_data.h + * + * + */ + +#ifndef _OpenAPI_smf_selection_subscription_data_H_ +#define _OpenAPI_smf_selection_subscription_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "snssai_info.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_smf_selection_subscription_data_s OpenAPI_smf_selection_subscription_data_t; +typedef struct OpenAPI_smf_selection_subscription_data_s { + char *supported_features; + OpenAPI_list_t* subscribed_snssai_infos; + char *shared_snssai_infos_id; +} OpenAPI_smf_selection_subscription_data_t; + +OpenAPI_smf_selection_subscription_data_t *OpenAPI_smf_selection_subscription_data_create( + char *supported_features, + OpenAPI_list_t* subscribed_snssai_infos, + char *shared_snssai_infos_id + ); +void OpenAPI_smf_selection_subscription_data_free(OpenAPI_smf_selection_subscription_data_t *smf_selection_subscription_data); +OpenAPI_smf_selection_subscription_data_t *OpenAPI_smf_selection_subscription_data_parseFromJSON(cJSON *smf_selection_subscription_dataJSON); +cJSON *OpenAPI_smf_selection_subscription_data_convertToJSON(OpenAPI_smf_selection_subscription_data_t *smf_selection_subscription_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_smf_selection_subscription_data_H_ */ + diff --git a/lib/sbi/openapi/model/sms_management_subscription_data.c b/lib/sbi/openapi/model/sms_management_subscription_data.c new file mode 100644 index 0000000000..cb719d17a0 --- /dev/null +++ b/lib/sbi/openapi/model/sms_management_subscription_data.c @@ -0,0 +1,252 @@ + +#include +#include +#include +#include "sms_management_subscription_data.h" + +OpenAPI_sms_management_subscription_data_t *OpenAPI_sms_management_subscription_data_create( + char *supported_features, + int mt_sms_subscribed, + int mt_sms_barring_all, + int mt_sms_barring_roaming, + int mo_sms_subscribed, + int mo_sms_barring_all, + int mo_sms_barring_roaming, + OpenAPI_list_t *shared_sms_mng_data_ids, + OpenAPI_trace_data_t *trace_data + ) +{ + OpenAPI_sms_management_subscription_data_t *sms_management_subscription_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_sms_management_subscription_data_t)); + if (!sms_management_subscription_data_local_var) { + return NULL; + } + sms_management_subscription_data_local_var->supported_features = supported_features; + sms_management_subscription_data_local_var->mt_sms_subscribed = mt_sms_subscribed; + sms_management_subscription_data_local_var->mt_sms_barring_all = mt_sms_barring_all; + sms_management_subscription_data_local_var->mt_sms_barring_roaming = mt_sms_barring_roaming; + sms_management_subscription_data_local_var->mo_sms_subscribed = mo_sms_subscribed; + sms_management_subscription_data_local_var->mo_sms_barring_all = mo_sms_barring_all; + sms_management_subscription_data_local_var->mo_sms_barring_roaming = mo_sms_barring_roaming; + sms_management_subscription_data_local_var->shared_sms_mng_data_ids = shared_sms_mng_data_ids; + sms_management_subscription_data_local_var->trace_data = trace_data; + + return sms_management_subscription_data_local_var; +} + +void OpenAPI_sms_management_subscription_data_free(OpenAPI_sms_management_subscription_data_t *sms_management_subscription_data) +{ + if (NULL == sms_management_subscription_data) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(sms_management_subscription_data->supported_features); + OpenAPI_list_for_each(sms_management_subscription_data->shared_sms_mng_data_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sms_management_subscription_data->shared_sms_mng_data_ids); + OpenAPI_trace_data_free(sms_management_subscription_data->trace_data); + ogs_free(sms_management_subscription_data); +} + +cJSON *OpenAPI_sms_management_subscription_data_convertToJSON(OpenAPI_sms_management_subscription_data_t *sms_management_subscription_data) +{ + cJSON *item = NULL; + + if (sms_management_subscription_data == NULL) { + ogs_error("OpenAPI_sms_management_subscription_data_convertToJSON() failed [SmsManagementSubscriptionData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (sms_management_subscription_data->supported_features) { + if (cJSON_AddStringToObject(item, "supportedFeatures", sms_management_subscription_data->supported_features) == NULL) { + ogs_error("OpenAPI_sms_management_subscription_data_convertToJSON() failed [supported_features]"); + goto end; + } + } + + if (sms_management_subscription_data->mt_sms_subscribed >= 0) { + if (cJSON_AddBoolToObject(item, "mtSmsSubscribed", sms_management_subscription_data->mt_sms_subscribed) == NULL) { + ogs_error("OpenAPI_sms_management_subscription_data_convertToJSON() failed [mt_sms_subscribed]"); + goto end; + } + } + + if (sms_management_subscription_data->mt_sms_barring_all >= 0) { + if (cJSON_AddBoolToObject(item, "mtSmsBarringAll", sms_management_subscription_data->mt_sms_barring_all) == NULL) { + ogs_error("OpenAPI_sms_management_subscription_data_convertToJSON() failed [mt_sms_barring_all]"); + goto end; + } + } + + if (sms_management_subscription_data->mt_sms_barring_roaming >= 0) { + if (cJSON_AddBoolToObject(item, "mtSmsBarringRoaming", sms_management_subscription_data->mt_sms_barring_roaming) == NULL) { + ogs_error("OpenAPI_sms_management_subscription_data_convertToJSON() failed [mt_sms_barring_roaming]"); + goto end; + } + } + + if (sms_management_subscription_data->mo_sms_subscribed >= 0) { + if (cJSON_AddBoolToObject(item, "moSmsSubscribed", sms_management_subscription_data->mo_sms_subscribed) == NULL) { + ogs_error("OpenAPI_sms_management_subscription_data_convertToJSON() failed [mo_sms_subscribed]"); + goto end; + } + } + + if (sms_management_subscription_data->mo_sms_barring_all >= 0) { + if (cJSON_AddBoolToObject(item, "moSmsBarringAll", sms_management_subscription_data->mo_sms_barring_all) == NULL) { + ogs_error("OpenAPI_sms_management_subscription_data_convertToJSON() failed [mo_sms_barring_all]"); + goto end; + } + } + + if (sms_management_subscription_data->mo_sms_barring_roaming >= 0) { + if (cJSON_AddBoolToObject(item, "moSmsBarringRoaming", sms_management_subscription_data->mo_sms_barring_roaming) == NULL) { + ogs_error("OpenAPI_sms_management_subscription_data_convertToJSON() failed [mo_sms_barring_roaming]"); + goto end; + } + } + + if (sms_management_subscription_data->shared_sms_mng_data_ids) { + cJSON *shared_sms_mng_data_ids = cJSON_AddArrayToObject(item, "sharedSmsMngDataIds"); + if (shared_sms_mng_data_ids == NULL) { + ogs_error("OpenAPI_sms_management_subscription_data_convertToJSON() failed [shared_sms_mng_data_ids]"); + goto end; + } + + OpenAPI_lnode_t *shared_sms_mng_data_ids_node; + OpenAPI_list_for_each(sms_management_subscription_data->shared_sms_mng_data_ids, shared_sms_mng_data_ids_node) { + if (cJSON_AddStringToObject(shared_sms_mng_data_ids, "", (char*)shared_sms_mng_data_ids_node->data) == NULL) { + ogs_error("OpenAPI_sms_management_subscription_data_convertToJSON() failed [shared_sms_mng_data_ids]"); + goto end; + } + } + } + + if (sms_management_subscription_data->trace_data) { + cJSON *trace_data_local_JSON = OpenAPI_trace_data_convertToJSON(sms_management_subscription_data->trace_data); + if (trace_data_local_JSON == NULL) { + ogs_error("OpenAPI_sms_management_subscription_data_convertToJSON() failed [trace_data]"); + goto end; + } + cJSON_AddItemToObject(item, "traceData", trace_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_sms_management_subscription_data_convertToJSON() failed [trace_data]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_sms_management_subscription_data_t *OpenAPI_sms_management_subscription_data_parseFromJSON(cJSON *sms_management_subscription_dataJSON) +{ + OpenAPI_sms_management_subscription_data_t *sms_management_subscription_data_local_var = NULL; + cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_dataJSON, "supportedFeatures"); + + if (supported_features) { + if (!cJSON_IsString(supported_features)) { + ogs_error("OpenAPI_sms_management_subscription_data_parseFromJSON() failed [supported_features]"); + goto end; + } + } + + cJSON *mt_sms_subscribed = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_dataJSON, "mtSmsSubscribed"); + + if (mt_sms_subscribed) { + if (!cJSON_IsBool(mt_sms_subscribed)) { + ogs_error("OpenAPI_sms_management_subscription_data_parseFromJSON() failed [mt_sms_subscribed]"); + goto end; + } + } + + cJSON *mt_sms_barring_all = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_dataJSON, "mtSmsBarringAll"); + + if (mt_sms_barring_all) { + if (!cJSON_IsBool(mt_sms_barring_all)) { + ogs_error("OpenAPI_sms_management_subscription_data_parseFromJSON() failed [mt_sms_barring_all]"); + goto end; + } + } + + cJSON *mt_sms_barring_roaming = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_dataJSON, "mtSmsBarringRoaming"); + + if (mt_sms_barring_roaming) { + if (!cJSON_IsBool(mt_sms_barring_roaming)) { + ogs_error("OpenAPI_sms_management_subscription_data_parseFromJSON() failed [mt_sms_barring_roaming]"); + goto end; + } + } + + cJSON *mo_sms_subscribed = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_dataJSON, "moSmsSubscribed"); + + if (mo_sms_subscribed) { + if (!cJSON_IsBool(mo_sms_subscribed)) { + ogs_error("OpenAPI_sms_management_subscription_data_parseFromJSON() failed [mo_sms_subscribed]"); + goto end; + } + } + + cJSON *mo_sms_barring_all = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_dataJSON, "moSmsBarringAll"); + + if (mo_sms_barring_all) { + if (!cJSON_IsBool(mo_sms_barring_all)) { + ogs_error("OpenAPI_sms_management_subscription_data_parseFromJSON() failed [mo_sms_barring_all]"); + goto end; + } + } + + cJSON *mo_sms_barring_roaming = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_dataJSON, "moSmsBarringRoaming"); + + if (mo_sms_barring_roaming) { + if (!cJSON_IsBool(mo_sms_barring_roaming)) { + ogs_error("OpenAPI_sms_management_subscription_data_parseFromJSON() failed [mo_sms_barring_roaming]"); + goto end; + } + } + + cJSON *shared_sms_mng_data_ids = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_dataJSON, "sharedSmsMngDataIds"); + + OpenAPI_list_t *shared_sms_mng_data_idsList; + if (shared_sms_mng_data_ids) { + cJSON *shared_sms_mng_data_ids_local; + if (!cJSON_IsArray(shared_sms_mng_data_ids)) { + ogs_error("OpenAPI_sms_management_subscription_data_parseFromJSON() failed [shared_sms_mng_data_ids]"); + goto end; + } + shared_sms_mng_data_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(shared_sms_mng_data_ids_local, shared_sms_mng_data_ids) { + if (!cJSON_IsString(shared_sms_mng_data_ids_local)) { + ogs_error("OpenAPI_sms_management_subscription_data_parseFromJSON() failed [shared_sms_mng_data_ids]"); + goto end; + } + OpenAPI_list_add(shared_sms_mng_data_idsList, ogs_strdup(shared_sms_mng_data_ids_local->valuestring)); + } + } + + cJSON *trace_data = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_dataJSON, "traceData"); + + OpenAPI_trace_data_t *trace_data_local_nonprim = NULL; + if (trace_data) { + trace_data_local_nonprim = OpenAPI_trace_data_parseFromJSON(trace_data); + } + + sms_management_subscription_data_local_var = OpenAPI_sms_management_subscription_data_create ( + supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + mt_sms_subscribed ? mt_sms_subscribed->valueint : 0, + mt_sms_barring_all ? mt_sms_barring_all->valueint : 0, + mt_sms_barring_roaming ? mt_sms_barring_roaming->valueint : 0, + mo_sms_subscribed ? mo_sms_subscribed->valueint : 0, + mo_sms_barring_all ? mo_sms_barring_all->valueint : 0, + mo_sms_barring_roaming ? mo_sms_barring_roaming->valueint : 0, + shared_sms_mng_data_ids ? shared_sms_mng_data_idsList : NULL, + trace_data ? trace_data_local_nonprim : NULL + ); + + return sms_management_subscription_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/sms_management_subscription_data.h b/lib/sbi/openapi/model/sms_management_subscription_data.h new file mode 100644 index 0000000000..af48fce32c --- /dev/null +++ b/lib/sbi/openapi/model/sms_management_subscription_data.h @@ -0,0 +1,54 @@ +/* + * sms_management_subscription_data.h + * + * + */ + +#ifndef _OpenAPI_sms_management_subscription_data_H_ +#define _OpenAPI_sms_management_subscription_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "trace_data.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_sms_management_subscription_data_s OpenAPI_sms_management_subscription_data_t; +typedef struct OpenAPI_sms_management_subscription_data_s { + char *supported_features; + int mt_sms_subscribed; + int mt_sms_barring_all; + int mt_sms_barring_roaming; + int mo_sms_subscribed; + int mo_sms_barring_all; + int mo_sms_barring_roaming; + OpenAPI_list_t *shared_sms_mng_data_ids; + struct OpenAPI_trace_data_s *trace_data; +} OpenAPI_sms_management_subscription_data_t; + +OpenAPI_sms_management_subscription_data_t *OpenAPI_sms_management_subscription_data_create( + char *supported_features, + int mt_sms_subscribed, + int mt_sms_barring_all, + int mt_sms_barring_roaming, + int mo_sms_subscribed, + int mo_sms_barring_all, + int mo_sms_barring_roaming, + OpenAPI_list_t *shared_sms_mng_data_ids, + OpenAPI_trace_data_t *trace_data + ); +void OpenAPI_sms_management_subscription_data_free(OpenAPI_sms_management_subscription_data_t *sms_management_subscription_data); +OpenAPI_sms_management_subscription_data_t *OpenAPI_sms_management_subscription_data_parseFromJSON(cJSON *sms_management_subscription_dataJSON); +cJSON *OpenAPI_sms_management_subscription_data_convertToJSON(OpenAPI_sms_management_subscription_data_t *sms_management_subscription_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_sms_management_subscription_data_H_ */ + diff --git a/lib/sbi/openapi/model/sms_subscription_data.c b/lib/sbi/openapi/model/sms_subscription_data.c new file mode 100644 index 0000000000..2ec7291576 --- /dev/null +++ b/lib/sbi/openapi/model/sms_subscription_data.c @@ -0,0 +1,90 @@ + +#include +#include +#include +#include "sms_subscription_data.h" + +OpenAPI_sms_subscription_data_t *OpenAPI_sms_subscription_data_create( + int sms_subscribed, + char *shared_sms_subs_data_id + ) +{ + OpenAPI_sms_subscription_data_t *sms_subscription_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_sms_subscription_data_t)); + if (!sms_subscription_data_local_var) { + return NULL; + } + sms_subscription_data_local_var->sms_subscribed = sms_subscribed; + sms_subscription_data_local_var->shared_sms_subs_data_id = shared_sms_subs_data_id; + + return sms_subscription_data_local_var; +} + +void OpenAPI_sms_subscription_data_free(OpenAPI_sms_subscription_data_t *sms_subscription_data) +{ + if (NULL == sms_subscription_data) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(sms_subscription_data->shared_sms_subs_data_id); + ogs_free(sms_subscription_data); +} + +cJSON *OpenAPI_sms_subscription_data_convertToJSON(OpenAPI_sms_subscription_data_t *sms_subscription_data) +{ + cJSON *item = NULL; + + if (sms_subscription_data == NULL) { + ogs_error("OpenAPI_sms_subscription_data_convertToJSON() failed [SmsSubscriptionData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (sms_subscription_data->sms_subscribed >= 0) { + if (cJSON_AddBoolToObject(item, "smsSubscribed", sms_subscription_data->sms_subscribed) == NULL) { + ogs_error("OpenAPI_sms_subscription_data_convertToJSON() failed [sms_subscribed]"); + goto end; + } + } + + if (sms_subscription_data->shared_sms_subs_data_id) { + if (cJSON_AddStringToObject(item, "sharedSmsSubsDataId", sms_subscription_data->shared_sms_subs_data_id) == NULL) { + ogs_error("OpenAPI_sms_subscription_data_convertToJSON() failed [shared_sms_subs_data_id]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_sms_subscription_data_t *OpenAPI_sms_subscription_data_parseFromJSON(cJSON *sms_subscription_dataJSON) +{ + OpenAPI_sms_subscription_data_t *sms_subscription_data_local_var = NULL; + cJSON *sms_subscribed = cJSON_GetObjectItemCaseSensitive(sms_subscription_dataJSON, "smsSubscribed"); + + if (sms_subscribed) { + if (!cJSON_IsBool(sms_subscribed)) { + ogs_error("OpenAPI_sms_subscription_data_parseFromJSON() failed [sms_subscribed]"); + goto end; + } + } + + cJSON *shared_sms_subs_data_id = cJSON_GetObjectItemCaseSensitive(sms_subscription_dataJSON, "sharedSmsSubsDataId"); + + if (shared_sms_subs_data_id) { + if (!cJSON_IsString(shared_sms_subs_data_id)) { + ogs_error("OpenAPI_sms_subscription_data_parseFromJSON() failed [shared_sms_subs_data_id]"); + goto end; + } + } + + sms_subscription_data_local_var = OpenAPI_sms_subscription_data_create ( + sms_subscribed ? sms_subscribed->valueint : 0, + shared_sms_subs_data_id ? ogs_strdup(shared_sms_subs_data_id->valuestring) : NULL + ); + + return sms_subscription_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/sms_subscription_data.h b/lib/sbi/openapi/model/sms_subscription_data.h new file mode 100644 index 0000000000..c7d7680f90 --- /dev/null +++ b/lib/sbi/openapi/model/sms_subscription_data.h @@ -0,0 +1,39 @@ +/* + * sms_subscription_data.h + * + * + */ + +#ifndef _OpenAPI_sms_subscription_data_H_ +#define _OpenAPI_sms_subscription_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_sms_subscription_data_s OpenAPI_sms_subscription_data_t; +typedef struct OpenAPI_sms_subscription_data_s { + int sms_subscribed; + char *shared_sms_subs_data_id; +} OpenAPI_sms_subscription_data_t; + +OpenAPI_sms_subscription_data_t *OpenAPI_sms_subscription_data_create( + int sms_subscribed, + char *shared_sms_subs_data_id + ); +void OpenAPI_sms_subscription_data_free(OpenAPI_sms_subscription_data_t *sms_subscription_data); +OpenAPI_sms_subscription_data_t *OpenAPI_sms_subscription_data_parseFromJSON(cJSON *sms_subscription_dataJSON); +cJSON *OpenAPI_sms_subscription_data_convertToJSON(OpenAPI_sms_subscription_data_t *sms_subscription_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_sms_subscription_data_H_ */ + diff --git a/lib/sbi/openapi/model/sms_support.c b/lib/sbi/openapi/model/sms_support.c new file mode 100644 index 0000000000..8cd62620d6 --- /dev/null +++ b/lib/sbi/openapi/model/sms_support.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "sms_support.h" + +OpenAPI_sms_support_t *OpenAPI_sms_support_create( + ) +{ + OpenAPI_sms_support_t *sms_support_local_var = OpenAPI_malloc(sizeof(OpenAPI_sms_support_t)); + if (!sms_support_local_var) { + return NULL; + } + + return sms_support_local_var; +} + +void OpenAPI_sms_support_free(OpenAPI_sms_support_t *sms_support) +{ + if (NULL == sms_support) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(sms_support); +} + +cJSON *OpenAPI_sms_support_convertToJSON(OpenAPI_sms_support_t *sms_support) +{ + cJSON *item = NULL; + + if (sms_support == NULL) { + ogs_error("OpenAPI_sms_support_convertToJSON() failed [SmsSupport]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_sms_support_t *OpenAPI_sms_support_parseFromJSON(cJSON *sms_supportJSON) +{ + OpenAPI_sms_support_t *sms_support_local_var = NULL; + sms_support_local_var = OpenAPI_sms_support_create ( + ); + + return sms_support_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/sms_support.h b/lib/sbi/openapi/model/sms_support.h new file mode 100644 index 0000000000..65429787c0 --- /dev/null +++ b/lib/sbi/openapi/model/sms_support.h @@ -0,0 +1,35 @@ +/* + * sms_support.h + * + * + */ + +#ifndef _OpenAPI_sms_support_H_ +#define _OpenAPI_sms_support_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_sms_support_s OpenAPI_sms_support_t; +typedef struct OpenAPI_sms_support_s { +} OpenAPI_sms_support_t; + +OpenAPI_sms_support_t *OpenAPI_sms_support_create( + ); +void OpenAPI_sms_support_free(OpenAPI_sms_support_t *sms_support); +OpenAPI_sms_support_t *OpenAPI_sms_support_parseFromJSON(cJSON *sms_supportJSON); +cJSON *OpenAPI_sms_support_convertToJSON(OpenAPI_sms_support_t *sms_support); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_sms_support_H_ */ + diff --git a/lib/sbi/openapi/model/smsf_info.c b/lib/sbi/openapi/model/smsf_info.c new file mode 100644 index 0000000000..4137c2bce5 --- /dev/null +++ b/lib/sbi/openapi/model/smsf_info.c @@ -0,0 +1,105 @@ + +#include +#include +#include +#include "smsf_info.h" + +OpenAPI_smsf_info_t *OpenAPI_smsf_info_create( + char *smsf_instance_id, + OpenAPI_plmn_id_t *plmn_id + ) +{ + OpenAPI_smsf_info_t *smsf_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_smsf_info_t)); + if (!smsf_info_local_var) { + return NULL; + } + smsf_info_local_var->smsf_instance_id = smsf_instance_id; + smsf_info_local_var->plmn_id = plmn_id; + + return smsf_info_local_var; +} + +void OpenAPI_smsf_info_free(OpenAPI_smsf_info_t *smsf_info) +{ + if (NULL == smsf_info) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(smsf_info->smsf_instance_id); + OpenAPI_plmn_id_free(smsf_info->plmn_id); + ogs_free(smsf_info); +} + +cJSON *OpenAPI_smsf_info_convertToJSON(OpenAPI_smsf_info_t *smsf_info) +{ + cJSON *item = NULL; + + if (smsf_info == NULL) { + ogs_error("OpenAPI_smsf_info_convertToJSON() failed [SmsfInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!smsf_info->smsf_instance_id) { + ogs_error("OpenAPI_smsf_info_convertToJSON() failed [smsf_instance_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "smsfInstanceId", smsf_info->smsf_instance_id) == NULL) { + ogs_error("OpenAPI_smsf_info_convertToJSON() failed [smsf_instance_id]"); + goto end; + } + + if (!smsf_info->plmn_id) { + ogs_error("OpenAPI_smsf_info_convertToJSON() failed [plmn_id]"); + goto end; + } + cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_convertToJSON(smsf_info->plmn_id); + if (plmn_id_local_JSON == NULL) { + ogs_error("OpenAPI_smsf_info_convertToJSON() failed [plmn_id]"); + goto end; + } + cJSON_AddItemToObject(item, "plmnId", plmn_id_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_smsf_info_convertToJSON() failed [plmn_id]"); + goto end; + } + +end: + return item; +} + +OpenAPI_smsf_info_t *OpenAPI_smsf_info_parseFromJSON(cJSON *smsf_infoJSON) +{ + OpenAPI_smsf_info_t *smsf_info_local_var = NULL; + cJSON *smsf_instance_id = cJSON_GetObjectItemCaseSensitive(smsf_infoJSON, "smsfInstanceId"); + if (!smsf_instance_id) { + ogs_error("OpenAPI_smsf_info_parseFromJSON() failed [smsf_instance_id]"); + goto end; + } + + + if (!cJSON_IsString(smsf_instance_id)) { + ogs_error("OpenAPI_smsf_info_parseFromJSON() failed [smsf_instance_id]"); + goto end; + } + + cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(smsf_infoJSON, "plmnId"); + if (!plmn_id) { + ogs_error("OpenAPI_smsf_info_parseFromJSON() failed [plmn_id]"); + goto end; + } + + OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + + plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); + + smsf_info_local_var = OpenAPI_smsf_info_create ( + ogs_strdup(smsf_instance_id->valuestring), + plmn_id_local_nonprim + ); + + return smsf_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/smsf_info.h b/lib/sbi/openapi/model/smsf_info.h new file mode 100644 index 0000000000..d20e72c2ed --- /dev/null +++ b/lib/sbi/openapi/model/smsf_info.h @@ -0,0 +1,40 @@ +/* + * smsf_info.h + * + * + */ + +#ifndef _OpenAPI_smsf_info_H_ +#define _OpenAPI_smsf_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "plmn_id.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_smsf_info_s OpenAPI_smsf_info_t; +typedef struct OpenAPI_smsf_info_s { + char *smsf_instance_id; + struct OpenAPI_plmn_id_s *plmn_id; +} OpenAPI_smsf_info_t; + +OpenAPI_smsf_info_t *OpenAPI_smsf_info_create( + char *smsf_instance_id, + OpenAPI_plmn_id_t *plmn_id + ); +void OpenAPI_smsf_info_free(OpenAPI_smsf_info_t *smsf_info); +OpenAPI_smsf_info_t *OpenAPI_smsf_info_parseFromJSON(cJSON *smsf_infoJSON); +cJSON *OpenAPI_smsf_info_convertToJSON(OpenAPI_smsf_info_t *smsf_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_smsf_info_H_ */ + diff --git a/lib/sbi/openapi/model/smsf_registration.c b/lib/sbi/openapi/model/smsf_registration.c new file mode 100644 index 0000000000..bc28ae50f9 --- /dev/null +++ b/lib/sbi/openapi/model/smsf_registration.c @@ -0,0 +1,209 @@ + +#include +#include +#include +#include "smsf_registration.h" + +OpenAPI_smsf_registration_t *OpenAPI_smsf_registration_create( + char *smsf_instance_id, + char *smsf_set_id, + char *supported_features, + OpenAPI_plmn_id_t *plmn_id, + char *smsf_map_address, + OpenAPI_network_node_diameter_address_t *smsf_diameter_address, + char *registration_time + ) +{ + OpenAPI_smsf_registration_t *smsf_registration_local_var = OpenAPI_malloc(sizeof(OpenAPI_smsf_registration_t)); + if (!smsf_registration_local_var) { + return NULL; + } + smsf_registration_local_var->smsf_instance_id = smsf_instance_id; + smsf_registration_local_var->smsf_set_id = smsf_set_id; + smsf_registration_local_var->supported_features = supported_features; + smsf_registration_local_var->plmn_id = plmn_id; + smsf_registration_local_var->smsf_map_address = smsf_map_address; + smsf_registration_local_var->smsf_diameter_address = smsf_diameter_address; + smsf_registration_local_var->registration_time = registration_time; + + return smsf_registration_local_var; +} + +void OpenAPI_smsf_registration_free(OpenAPI_smsf_registration_t *smsf_registration) +{ + if (NULL == smsf_registration) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(smsf_registration->smsf_instance_id); + ogs_free(smsf_registration->smsf_set_id); + ogs_free(smsf_registration->supported_features); + OpenAPI_plmn_id_free(smsf_registration->plmn_id); + ogs_free(smsf_registration->smsf_map_address); + OpenAPI_network_node_diameter_address_free(smsf_registration->smsf_diameter_address); + ogs_free(smsf_registration->registration_time); + ogs_free(smsf_registration); +} + +cJSON *OpenAPI_smsf_registration_convertToJSON(OpenAPI_smsf_registration_t *smsf_registration) +{ + cJSON *item = NULL; + + if (smsf_registration == NULL) { + ogs_error("OpenAPI_smsf_registration_convertToJSON() failed [SmsfRegistration]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!smsf_registration->smsf_instance_id) { + ogs_error("OpenAPI_smsf_registration_convertToJSON() failed [smsf_instance_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "smsfInstanceId", smsf_registration->smsf_instance_id) == NULL) { + ogs_error("OpenAPI_smsf_registration_convertToJSON() failed [smsf_instance_id]"); + goto end; + } + + if (smsf_registration->smsf_set_id) { + if (cJSON_AddStringToObject(item, "smsfSetId", smsf_registration->smsf_set_id) == NULL) { + ogs_error("OpenAPI_smsf_registration_convertToJSON() failed [smsf_set_id]"); + goto end; + } + } + + if (smsf_registration->supported_features) { + if (cJSON_AddStringToObject(item, "supportedFeatures", smsf_registration->supported_features) == NULL) { + ogs_error("OpenAPI_smsf_registration_convertToJSON() failed [supported_features]"); + goto end; + } + } + + if (!smsf_registration->plmn_id) { + ogs_error("OpenAPI_smsf_registration_convertToJSON() failed [plmn_id]"); + goto end; + } + cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_convertToJSON(smsf_registration->plmn_id); + if (plmn_id_local_JSON == NULL) { + ogs_error("OpenAPI_smsf_registration_convertToJSON() failed [plmn_id]"); + goto end; + } + cJSON_AddItemToObject(item, "plmnId", plmn_id_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_smsf_registration_convertToJSON() failed [plmn_id]"); + goto end; + } + + if (smsf_registration->smsf_map_address) { + if (cJSON_AddStringToObject(item, "smsfMAPAddress", smsf_registration->smsf_map_address) == NULL) { + ogs_error("OpenAPI_smsf_registration_convertToJSON() failed [smsf_map_address]"); + goto end; + } + } + + if (smsf_registration->smsf_diameter_address) { + cJSON *smsf_diameter_address_local_JSON = OpenAPI_network_node_diameter_address_convertToJSON(smsf_registration->smsf_diameter_address); + if (smsf_diameter_address_local_JSON == NULL) { + ogs_error("OpenAPI_smsf_registration_convertToJSON() failed [smsf_diameter_address]"); + goto end; + } + cJSON_AddItemToObject(item, "smsfDiameterAddress", smsf_diameter_address_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_smsf_registration_convertToJSON() failed [smsf_diameter_address]"); + goto end; + } + } + + if (smsf_registration->registration_time) { + if (cJSON_AddStringToObject(item, "registrationTime", smsf_registration->registration_time) == NULL) { + ogs_error("OpenAPI_smsf_registration_convertToJSON() failed [registration_time]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_smsf_registration_t *OpenAPI_smsf_registration_parseFromJSON(cJSON *smsf_registrationJSON) +{ + OpenAPI_smsf_registration_t *smsf_registration_local_var = NULL; + cJSON *smsf_instance_id = cJSON_GetObjectItemCaseSensitive(smsf_registrationJSON, "smsfInstanceId"); + if (!smsf_instance_id) { + ogs_error("OpenAPI_smsf_registration_parseFromJSON() failed [smsf_instance_id]"); + goto end; + } + + + if (!cJSON_IsString(smsf_instance_id)) { + ogs_error("OpenAPI_smsf_registration_parseFromJSON() failed [smsf_instance_id]"); + goto end; + } + + cJSON *smsf_set_id = cJSON_GetObjectItemCaseSensitive(smsf_registrationJSON, "smsfSetId"); + + if (smsf_set_id) { + if (!cJSON_IsString(smsf_set_id)) { + ogs_error("OpenAPI_smsf_registration_parseFromJSON() failed [smsf_set_id]"); + goto end; + } + } + + cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(smsf_registrationJSON, "supportedFeatures"); + + if (supported_features) { + if (!cJSON_IsString(supported_features)) { + ogs_error("OpenAPI_smsf_registration_parseFromJSON() failed [supported_features]"); + goto end; + } + } + + cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(smsf_registrationJSON, "plmnId"); + if (!plmn_id) { + ogs_error("OpenAPI_smsf_registration_parseFromJSON() failed [plmn_id]"); + goto end; + } + + OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + + plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); + + cJSON *smsf_map_address = cJSON_GetObjectItemCaseSensitive(smsf_registrationJSON, "smsfMAPAddress"); + + if (smsf_map_address) { + if (!cJSON_IsString(smsf_map_address)) { + ogs_error("OpenAPI_smsf_registration_parseFromJSON() failed [smsf_map_address]"); + goto end; + } + } + + cJSON *smsf_diameter_address = cJSON_GetObjectItemCaseSensitive(smsf_registrationJSON, "smsfDiameterAddress"); + + OpenAPI_network_node_diameter_address_t *smsf_diameter_address_local_nonprim = NULL; + if (smsf_diameter_address) { + smsf_diameter_address_local_nonprim = OpenAPI_network_node_diameter_address_parseFromJSON(smsf_diameter_address); + } + + cJSON *registration_time = cJSON_GetObjectItemCaseSensitive(smsf_registrationJSON, "registrationTime"); + + if (registration_time) { + if (!cJSON_IsString(registration_time)) { + ogs_error("OpenAPI_smsf_registration_parseFromJSON() failed [registration_time]"); + goto end; + } + } + + smsf_registration_local_var = OpenAPI_smsf_registration_create ( + ogs_strdup(smsf_instance_id->valuestring), + smsf_set_id ? ogs_strdup(smsf_set_id->valuestring) : NULL, + supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + plmn_id_local_nonprim, + smsf_map_address ? ogs_strdup(smsf_map_address->valuestring) : NULL, + smsf_diameter_address ? smsf_diameter_address_local_nonprim : NULL, + registration_time ? ogs_strdup(registration_time->valuestring) : NULL + ); + + return smsf_registration_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/smsf_registration.h b/lib/sbi/openapi/model/smsf_registration.h new file mode 100644 index 0000000000..bf9d91ea3d --- /dev/null +++ b/lib/sbi/openapi/model/smsf_registration.h @@ -0,0 +1,51 @@ +/* + * smsf_registration.h + * + * + */ + +#ifndef _OpenAPI_smsf_registration_H_ +#define _OpenAPI_smsf_registration_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "network_node_diameter_address.h" +#include "plmn_id.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_smsf_registration_s OpenAPI_smsf_registration_t; +typedef struct OpenAPI_smsf_registration_s { + char *smsf_instance_id; + char *smsf_set_id; + char *supported_features; + struct OpenAPI_plmn_id_s *plmn_id; + char *smsf_map_address; + struct OpenAPI_network_node_diameter_address_s *smsf_diameter_address; + char *registration_time; +} OpenAPI_smsf_registration_t; + +OpenAPI_smsf_registration_t *OpenAPI_smsf_registration_create( + char *smsf_instance_id, + char *smsf_set_id, + char *supported_features, + OpenAPI_plmn_id_t *plmn_id, + char *smsf_map_address, + OpenAPI_network_node_diameter_address_t *smsf_diameter_address, + char *registration_time + ); +void OpenAPI_smsf_registration_free(OpenAPI_smsf_registration_t *smsf_registration); +OpenAPI_smsf_registration_t *OpenAPI_smsf_registration_parseFromJSON(cJSON *smsf_registrationJSON); +cJSON *OpenAPI_smsf_registration_convertToJSON(OpenAPI_smsf_registration_t *smsf_registration); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_smsf_registration_H_ */ + diff --git a/lib/sbi/openapi/model/snssai_info.c b/lib/sbi/openapi/model/snssai_info.c new file mode 100644 index 0000000000..aab894ddee --- /dev/null +++ b/lib/sbi/openapi/model/snssai_info.c @@ -0,0 +1,106 @@ + +#include +#include +#include +#include "snssai_info.h" + +OpenAPI_snssai_info_t *OpenAPI_snssai_info_create( + OpenAPI_list_t *dnn_infos + ) +{ + OpenAPI_snssai_info_t *snssai_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_snssai_info_t)); + if (!snssai_info_local_var) { + return NULL; + } + snssai_info_local_var->dnn_infos = dnn_infos; + + return snssai_info_local_var; +} + +void OpenAPI_snssai_info_free(OpenAPI_snssai_info_t *snssai_info) +{ + if (NULL == snssai_info) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(snssai_info->dnn_infos, node) { + OpenAPI_dnn_info_free(node->data); + } + OpenAPI_list_free(snssai_info->dnn_infos); + ogs_free(snssai_info); +} + +cJSON *OpenAPI_snssai_info_convertToJSON(OpenAPI_snssai_info_t *snssai_info) +{ + cJSON *item = NULL; + + if (snssai_info == NULL) { + ogs_error("OpenAPI_snssai_info_convertToJSON() failed [SnssaiInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!snssai_info->dnn_infos) { + ogs_error("OpenAPI_snssai_info_convertToJSON() failed [dnn_infos]"); + goto end; + } + cJSON *dnn_infosList = cJSON_AddArrayToObject(item, "dnnInfos"); + if (dnn_infosList == NULL) { + ogs_error("OpenAPI_snssai_info_convertToJSON() failed [dnn_infos]"); + goto end; + } + + OpenAPI_lnode_t *dnn_infos_node; + if (snssai_info->dnn_infos) { + OpenAPI_list_for_each(snssai_info->dnn_infos, dnn_infos_node) { + cJSON *itemLocal = OpenAPI_dnn_info_convertToJSON(dnn_infos_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_snssai_info_convertToJSON() failed [dnn_infos]"); + goto end; + } + cJSON_AddItemToArray(dnn_infosList, itemLocal); + } + } + +end: + return item; +} + +OpenAPI_snssai_info_t *OpenAPI_snssai_info_parseFromJSON(cJSON *snssai_infoJSON) +{ + OpenAPI_snssai_info_t *snssai_info_local_var = NULL; + cJSON *dnn_infos = cJSON_GetObjectItemCaseSensitive(snssai_infoJSON, "dnnInfos"); + if (!dnn_infos) { + ogs_error("OpenAPI_snssai_info_parseFromJSON() failed [dnn_infos]"); + goto end; + } + + OpenAPI_list_t *dnn_infosList; + + cJSON *dnn_infos_local_nonprimitive; + if (!cJSON_IsArray(dnn_infos)) { + ogs_error("OpenAPI_snssai_info_parseFromJSON() failed [dnn_infos]"); + goto end; + } + + dnn_infosList = OpenAPI_list_create(); + + cJSON_ArrayForEach(dnn_infos_local_nonprimitive, dnn_infos ) { + if (!cJSON_IsObject(dnn_infos_local_nonprimitive)) { + ogs_error("OpenAPI_snssai_info_parseFromJSON() failed [dnn_infos]"); + goto end; + } + OpenAPI_dnn_info_t *dnn_infosItem = OpenAPI_dnn_info_parseFromJSON(dnn_infos_local_nonprimitive); + + OpenAPI_list_add(dnn_infosList, dnn_infosItem); + } + + snssai_info_local_var = OpenAPI_snssai_info_create ( + dnn_infosList + ); + + return snssai_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/snssai_info.h b/lib/sbi/openapi/model/snssai_info.h new file mode 100644 index 0000000000..cea31d3ac8 --- /dev/null +++ b/lib/sbi/openapi/model/snssai_info.h @@ -0,0 +1,38 @@ +/* + * snssai_info.h + * + * + */ + +#ifndef _OpenAPI_snssai_info_H_ +#define _OpenAPI_snssai_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "dnn_info.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_snssai_info_s OpenAPI_snssai_info_t; +typedef struct OpenAPI_snssai_info_s { + OpenAPI_list_t *dnn_infos; +} OpenAPI_snssai_info_t; + +OpenAPI_snssai_info_t *OpenAPI_snssai_info_create( + OpenAPI_list_t *dnn_infos + ); +void OpenAPI_snssai_info_free(OpenAPI_snssai_info_t *snssai_info); +OpenAPI_snssai_info_t *OpenAPI_snssai_info_parseFromJSON(cJSON *snssai_infoJSON); +cJSON *OpenAPI_snssai_info_convertToJSON(OpenAPI_snssai_info_t *snssai_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_snssai_info_H_ */ + diff --git a/lib/sbi/openapi/model/snssai_route_selection_descriptor.c b/lib/sbi/openapi/model/snssai_route_selection_descriptor.c new file mode 100644 index 0000000000..10b1025bc7 --- /dev/null +++ b/lib/sbi/openapi/model/snssai_route_selection_descriptor.c @@ -0,0 +1,130 @@ + +#include +#include +#include +#include "snssai_route_selection_descriptor.h" + +OpenAPI_snssai_route_selection_descriptor_t *OpenAPI_snssai_route_selection_descriptor_create( + OpenAPI_snssai_t *snssai, + OpenAPI_list_t *dnn_route_sel_descs + ) +{ + OpenAPI_snssai_route_selection_descriptor_t *snssai_route_selection_descriptor_local_var = OpenAPI_malloc(sizeof(OpenAPI_snssai_route_selection_descriptor_t)); + if (!snssai_route_selection_descriptor_local_var) { + return NULL; + } + snssai_route_selection_descriptor_local_var->snssai = snssai; + snssai_route_selection_descriptor_local_var->dnn_route_sel_descs = dnn_route_sel_descs; + + return snssai_route_selection_descriptor_local_var; +} + +void OpenAPI_snssai_route_selection_descriptor_free(OpenAPI_snssai_route_selection_descriptor_t *snssai_route_selection_descriptor) +{ + if (NULL == snssai_route_selection_descriptor) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_snssai_free(snssai_route_selection_descriptor->snssai); + OpenAPI_list_for_each(snssai_route_selection_descriptor->dnn_route_sel_descs, node) { + OpenAPI_dnn_route_selection_descriptor_free(node->data); + } + OpenAPI_list_free(snssai_route_selection_descriptor->dnn_route_sel_descs); + ogs_free(snssai_route_selection_descriptor); +} + +cJSON *OpenAPI_snssai_route_selection_descriptor_convertToJSON(OpenAPI_snssai_route_selection_descriptor_t *snssai_route_selection_descriptor) +{ + cJSON *item = NULL; + + if (snssai_route_selection_descriptor == NULL) { + ogs_error("OpenAPI_snssai_route_selection_descriptor_convertToJSON() failed [SnssaiRouteSelectionDescriptor]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!snssai_route_selection_descriptor->snssai) { + ogs_error("OpenAPI_snssai_route_selection_descriptor_convertToJSON() failed [snssai]"); + goto end; + } + cJSON *snssai_local_JSON = OpenAPI_snssai_convertToJSON(snssai_route_selection_descriptor->snssai); + if (snssai_local_JSON == NULL) { + ogs_error("OpenAPI_snssai_route_selection_descriptor_convertToJSON() failed [snssai]"); + goto end; + } + cJSON_AddItemToObject(item, "snssai", snssai_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_snssai_route_selection_descriptor_convertToJSON() failed [snssai]"); + goto end; + } + + if (snssai_route_selection_descriptor->dnn_route_sel_descs) { + cJSON *dnn_route_sel_descsList = cJSON_AddArrayToObject(item, "dnnRouteSelDescs"); + if (dnn_route_sel_descsList == NULL) { + ogs_error("OpenAPI_snssai_route_selection_descriptor_convertToJSON() failed [dnn_route_sel_descs]"); + goto end; + } + + OpenAPI_lnode_t *dnn_route_sel_descs_node; + if (snssai_route_selection_descriptor->dnn_route_sel_descs) { + OpenAPI_list_for_each(snssai_route_selection_descriptor->dnn_route_sel_descs, dnn_route_sel_descs_node) { + cJSON *itemLocal = OpenAPI_dnn_route_selection_descriptor_convertToJSON(dnn_route_sel_descs_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_snssai_route_selection_descriptor_convertToJSON() failed [dnn_route_sel_descs]"); + goto end; + } + cJSON_AddItemToArray(dnn_route_sel_descsList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_snssai_route_selection_descriptor_t *OpenAPI_snssai_route_selection_descriptor_parseFromJSON(cJSON *snssai_route_selection_descriptorJSON) +{ + OpenAPI_snssai_route_selection_descriptor_t *snssai_route_selection_descriptor_local_var = NULL; + cJSON *snssai = cJSON_GetObjectItemCaseSensitive(snssai_route_selection_descriptorJSON, "snssai"); + if (!snssai) { + ogs_error("OpenAPI_snssai_route_selection_descriptor_parseFromJSON() failed [snssai]"); + goto end; + } + + OpenAPI_snssai_t *snssai_local_nonprim = NULL; + + snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(snssai); + + cJSON *dnn_route_sel_descs = cJSON_GetObjectItemCaseSensitive(snssai_route_selection_descriptorJSON, "dnnRouteSelDescs"); + + OpenAPI_list_t *dnn_route_sel_descsList; + if (dnn_route_sel_descs) { + cJSON *dnn_route_sel_descs_local_nonprimitive; + if (!cJSON_IsArray(dnn_route_sel_descs)) { + ogs_error("OpenAPI_snssai_route_selection_descriptor_parseFromJSON() failed [dnn_route_sel_descs]"); + goto end; + } + + dnn_route_sel_descsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(dnn_route_sel_descs_local_nonprimitive, dnn_route_sel_descs ) { + if (!cJSON_IsObject(dnn_route_sel_descs_local_nonprimitive)) { + ogs_error("OpenAPI_snssai_route_selection_descriptor_parseFromJSON() failed [dnn_route_sel_descs]"); + goto end; + } + OpenAPI_dnn_route_selection_descriptor_t *dnn_route_sel_descsItem = OpenAPI_dnn_route_selection_descriptor_parseFromJSON(dnn_route_sel_descs_local_nonprimitive); + + OpenAPI_list_add(dnn_route_sel_descsList, dnn_route_sel_descsItem); + } + } + + snssai_route_selection_descriptor_local_var = OpenAPI_snssai_route_selection_descriptor_create ( + snssai_local_nonprim, + dnn_route_sel_descs ? dnn_route_sel_descsList : NULL + ); + + return snssai_route_selection_descriptor_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/snssai_route_selection_descriptor.h b/lib/sbi/openapi/model/snssai_route_selection_descriptor.h new file mode 100644 index 0000000000..41f204b810 --- /dev/null +++ b/lib/sbi/openapi/model/snssai_route_selection_descriptor.h @@ -0,0 +1,41 @@ +/* + * snssai_route_selection_descriptor.h + * + * Contains the route selector parameters (DNNs, PDU session types and SSC modes) per SNSSAI + */ + +#ifndef _OpenAPI_snssai_route_selection_descriptor_H_ +#define _OpenAPI_snssai_route_selection_descriptor_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "dnn_route_selection_descriptor.h" +#include "snssai.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_snssai_route_selection_descriptor_s OpenAPI_snssai_route_selection_descriptor_t; +typedef struct OpenAPI_snssai_route_selection_descriptor_s { + struct OpenAPI_snssai_s *snssai; + OpenAPI_list_t *dnn_route_sel_descs; +} OpenAPI_snssai_route_selection_descriptor_t; + +OpenAPI_snssai_route_selection_descriptor_t *OpenAPI_snssai_route_selection_descriptor_create( + OpenAPI_snssai_t *snssai, + OpenAPI_list_t *dnn_route_sel_descs + ); +void OpenAPI_snssai_route_selection_descriptor_free(OpenAPI_snssai_route_selection_descriptor_t *snssai_route_selection_descriptor); +OpenAPI_snssai_route_selection_descriptor_t *OpenAPI_snssai_route_selection_descriptor_parseFromJSON(cJSON *snssai_route_selection_descriptorJSON); +cJSON *OpenAPI_snssai_route_selection_descriptor_convertToJSON(OpenAPI_snssai_route_selection_descriptor_t *snssai_route_selection_descriptor); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_snssai_route_selection_descriptor_H_ */ + diff --git a/lib/sbi/openapi/model/snssai_smf_info_item.h b/lib/sbi/openapi/model/snssai_smf_info_item.h index ad1a170f38..2a20a17a9f 100644 --- a/lib/sbi/openapi/model/snssai_smf_info_item.h +++ b/lib/sbi/openapi/model/snssai_smf_info_item.h @@ -1,7 +1,7 @@ /* * snssai_smf_info_item.h * - * + * Set of parameters supported by SMF for a given S-NSSAI */ #ifndef _OpenAPI_snssai_smf_info_item_H_ diff --git a/lib/sbi/openapi/model/snssai_upf_info_item.c b/lib/sbi/openapi/model/snssai_upf_info_item.c index 79376eeea3..ddaf5d76f4 100644 --- a/lib/sbi/openapi/model/snssai_upf_info_item.c +++ b/lib/sbi/openapi/model/snssai_upf_info_item.c @@ -6,7 +6,8 @@ OpenAPI_snssai_upf_info_item_t *OpenAPI_snssai_upf_info_item_create( OpenAPI_snssai_t *s_nssai, - OpenAPI_list_t *dnn_upf_info_list + OpenAPI_list_t *dnn_upf_info_list, + int redundant_transport ) { OpenAPI_snssai_upf_info_item_t *snssai_upf_info_item_local_var = OpenAPI_malloc(sizeof(OpenAPI_snssai_upf_info_item_t)); @@ -15,6 +16,7 @@ OpenAPI_snssai_upf_info_item_t *OpenAPI_snssai_upf_info_item_create( } snssai_upf_info_item_local_var->s_nssai = s_nssai; snssai_upf_info_item_local_var->dnn_upf_info_list = dnn_upf_info_list; + snssai_upf_info_item_local_var->redundant_transport = redundant_transport; return snssai_upf_info_item_local_var; } @@ -80,6 +82,13 @@ cJSON *OpenAPI_snssai_upf_info_item_convertToJSON(OpenAPI_snssai_upf_info_item_t } } + if (snssai_upf_info_item->redundant_transport >= 0) { + if (cJSON_AddBoolToObject(item, "redundantTransport", snssai_upf_info_item->redundant_transport) == NULL) { + ogs_error("OpenAPI_snssai_upf_info_item_convertToJSON() failed [redundant_transport]"); + goto end; + } + } + end: return item; } @@ -123,9 +132,19 @@ OpenAPI_snssai_upf_info_item_t *OpenAPI_snssai_upf_info_item_parseFromJSON(cJSON OpenAPI_list_add(dnn_upf_info_listList, dnn_upf_info_listItem); } + cJSON *redundant_transport = cJSON_GetObjectItemCaseSensitive(snssai_upf_info_itemJSON, "redundantTransport"); + + if (redundant_transport) { + if (!cJSON_IsBool(redundant_transport)) { + ogs_error("OpenAPI_snssai_upf_info_item_parseFromJSON() failed [redundant_transport]"); + goto end; + } + } + snssai_upf_info_item_local_var = OpenAPI_snssai_upf_info_item_create ( s_nssai_local_nonprim, - dnn_upf_info_listList + dnn_upf_info_listList, + redundant_transport ? redundant_transport->valueint : 0 ); return snssai_upf_info_item_local_var; diff --git a/lib/sbi/openapi/model/snssai_upf_info_item.h b/lib/sbi/openapi/model/snssai_upf_info_item.h index 5bd6399ef1..533a62fb06 100644 --- a/lib/sbi/openapi/model/snssai_upf_info_item.h +++ b/lib/sbi/openapi/model/snssai_upf_info_item.h @@ -1,7 +1,7 @@ /* * snssai_upf_info_item.h * - * + * Set of parameters supported by UPF for a given S-NSSAI */ #ifndef _OpenAPI_snssai_upf_info_item_H_ @@ -23,11 +23,13 @@ typedef struct OpenAPI_snssai_upf_info_item_s OpenAPI_snssai_upf_info_item_t; typedef struct OpenAPI_snssai_upf_info_item_s { struct OpenAPI_snssai_s *s_nssai; OpenAPI_list_t *dnn_upf_info_list; + int redundant_transport; } OpenAPI_snssai_upf_info_item_t; OpenAPI_snssai_upf_info_item_t *OpenAPI_snssai_upf_info_item_create( OpenAPI_snssai_t *s_nssai, - OpenAPI_list_t *dnn_upf_info_list + OpenAPI_list_t *dnn_upf_info_list, + int redundant_transport ); void OpenAPI_snssai_upf_info_item_free(OpenAPI_snssai_upf_info_item_t *snssai_upf_info_item); OpenAPI_snssai_upf_info_item_t *OpenAPI_snssai_upf_info_item_parseFromJSON(cJSON *snssai_upf_info_itemJSON); diff --git a/lib/sbi/openapi/model/sor_data.c b/lib/sbi/openapi/model/sor_data.c new file mode 100644 index 0000000000..e134ee8f82 --- /dev/null +++ b/lib/sbi/openapi/model/sor_data.c @@ -0,0 +1,142 @@ + +#include +#include +#include +#include "sor_data.h" + +OpenAPI_sor_data_t *OpenAPI_sor_data_create( + char *provisioning_time, + OpenAPI_ue_update_status_e ue_update_status, + char *sor_xmac_iue, + char *sor_mac_iue + ) +{ + OpenAPI_sor_data_t *sor_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_sor_data_t)); + if (!sor_data_local_var) { + return NULL; + } + sor_data_local_var->provisioning_time = provisioning_time; + sor_data_local_var->ue_update_status = ue_update_status; + sor_data_local_var->sor_xmac_iue = sor_xmac_iue; + sor_data_local_var->sor_mac_iue = sor_mac_iue; + + return sor_data_local_var; +} + +void OpenAPI_sor_data_free(OpenAPI_sor_data_t *sor_data) +{ + if (NULL == sor_data) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(sor_data->provisioning_time); + ogs_free(sor_data->sor_xmac_iue); + ogs_free(sor_data->sor_mac_iue); + ogs_free(sor_data); +} + +cJSON *OpenAPI_sor_data_convertToJSON(OpenAPI_sor_data_t *sor_data) +{ + cJSON *item = NULL; + + if (sor_data == NULL) { + ogs_error("OpenAPI_sor_data_convertToJSON() failed [SorData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!sor_data->provisioning_time) { + ogs_error("OpenAPI_sor_data_convertToJSON() failed [provisioning_time]"); + goto end; + } + if (cJSON_AddStringToObject(item, "provisioningTime", sor_data->provisioning_time) == NULL) { + ogs_error("OpenAPI_sor_data_convertToJSON() failed [provisioning_time]"); + goto end; + } + + if (!sor_data->ue_update_status) { + ogs_error("OpenAPI_sor_data_convertToJSON() failed [ue_update_status]"); + goto end; + } + if (cJSON_AddStringToObject(item, "ueUpdateStatus", OpenAPI_ue_update_status_ToString(sor_data->ue_update_status)) == NULL) { + ogs_error("OpenAPI_sor_data_convertToJSON() failed [ue_update_status]"); + goto end; + } + + if (sor_data->sor_xmac_iue) { + if (cJSON_AddStringToObject(item, "sorXmacIue", sor_data->sor_xmac_iue) == NULL) { + ogs_error("OpenAPI_sor_data_convertToJSON() failed [sor_xmac_iue]"); + goto end; + } + } + + if (sor_data->sor_mac_iue) { + if (cJSON_AddStringToObject(item, "sorMacIue", sor_data->sor_mac_iue) == NULL) { + ogs_error("OpenAPI_sor_data_convertToJSON() failed [sor_mac_iue]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_sor_data_t *OpenAPI_sor_data_parseFromJSON(cJSON *sor_dataJSON) +{ + OpenAPI_sor_data_t *sor_data_local_var = NULL; + cJSON *provisioning_time = cJSON_GetObjectItemCaseSensitive(sor_dataJSON, "provisioningTime"); + if (!provisioning_time) { + ogs_error("OpenAPI_sor_data_parseFromJSON() failed [provisioning_time]"); + goto end; + } + + + if (!cJSON_IsString(provisioning_time)) { + ogs_error("OpenAPI_sor_data_parseFromJSON() failed [provisioning_time]"); + goto end; + } + + cJSON *ue_update_status = cJSON_GetObjectItemCaseSensitive(sor_dataJSON, "ueUpdateStatus"); + if (!ue_update_status) { + ogs_error("OpenAPI_sor_data_parseFromJSON() failed [ue_update_status]"); + goto end; + } + + OpenAPI_ue_update_status_e ue_update_statusVariable; + + if (!cJSON_IsString(ue_update_status)) { + ogs_error("OpenAPI_sor_data_parseFromJSON() failed [ue_update_status]"); + goto end; + } + ue_update_statusVariable = OpenAPI_ue_update_status_FromString(ue_update_status->valuestring); + + cJSON *sor_xmac_iue = cJSON_GetObjectItemCaseSensitive(sor_dataJSON, "sorXmacIue"); + + if (sor_xmac_iue) { + if (!cJSON_IsString(sor_xmac_iue)) { + ogs_error("OpenAPI_sor_data_parseFromJSON() failed [sor_xmac_iue]"); + goto end; + } + } + + cJSON *sor_mac_iue = cJSON_GetObjectItemCaseSensitive(sor_dataJSON, "sorMacIue"); + + if (sor_mac_iue) { + if (!cJSON_IsString(sor_mac_iue)) { + ogs_error("OpenAPI_sor_data_parseFromJSON() failed [sor_mac_iue]"); + goto end; + } + } + + sor_data_local_var = OpenAPI_sor_data_create ( + ogs_strdup(provisioning_time->valuestring), + ue_update_statusVariable, + sor_xmac_iue ? ogs_strdup(sor_xmac_iue->valuestring) : NULL, + sor_mac_iue ? ogs_strdup(sor_mac_iue->valuestring) : NULL + ); + + return sor_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/sor_data.h b/lib/sbi/openapi/model/sor_data.h new file mode 100644 index 0000000000..061167305c --- /dev/null +++ b/lib/sbi/openapi/model/sor_data.h @@ -0,0 +1,44 @@ +/* + * sor_data.h + * + * + */ + +#ifndef _OpenAPI_sor_data_H_ +#define _OpenAPI_sor_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "ue_update_status.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_sor_data_s OpenAPI_sor_data_t; +typedef struct OpenAPI_sor_data_s { + char *provisioning_time; + OpenAPI_ue_update_status_e ue_update_status; + char *sor_xmac_iue; + char *sor_mac_iue; +} OpenAPI_sor_data_t; + +OpenAPI_sor_data_t *OpenAPI_sor_data_create( + char *provisioning_time, + OpenAPI_ue_update_status_e ue_update_status, + char *sor_xmac_iue, + char *sor_mac_iue + ); +void OpenAPI_sor_data_free(OpenAPI_sor_data_t *sor_data); +OpenAPI_sor_data_t *OpenAPI_sor_data_parseFromJSON(cJSON *sor_dataJSON); +cJSON *OpenAPI_sor_data_convertToJSON(OpenAPI_sor_data_t *sor_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_sor_data_H_ */ + diff --git a/lib/sbi/openapi/model/sor_info.c b/lib/sbi/openapi/model/sor_info.c new file mode 100644 index 0000000000..f87a3d1b22 --- /dev/null +++ b/lib/sbi/openapi/model/sor_info.c @@ -0,0 +1,160 @@ + +#include +#include +#include +#include "sor_info.h" + +OpenAPI_sor_info_t *OpenAPI_sor_info_create( + OpenAPI_steering_container_t *steering_container, + int ack_ind, + char *sor_mac_iausf, + char *countersor, + char *provisioning_time + ) +{ + OpenAPI_sor_info_t *sor_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_sor_info_t)); + if (!sor_info_local_var) { + return NULL; + } + sor_info_local_var->steering_container = steering_container; + sor_info_local_var->ack_ind = ack_ind; + sor_info_local_var->sor_mac_iausf = sor_mac_iausf; + sor_info_local_var->countersor = countersor; + sor_info_local_var->provisioning_time = provisioning_time; + + return sor_info_local_var; +} + +void OpenAPI_sor_info_free(OpenAPI_sor_info_t *sor_info) +{ + if (NULL == sor_info) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_steering_container_free(sor_info->steering_container); + ogs_free(sor_info->sor_mac_iausf); + ogs_free(sor_info->countersor); + ogs_free(sor_info->provisioning_time); + ogs_free(sor_info); +} + +cJSON *OpenAPI_sor_info_convertToJSON(OpenAPI_sor_info_t *sor_info) +{ + cJSON *item = NULL; + + if (sor_info == NULL) { + ogs_error("OpenAPI_sor_info_convertToJSON() failed [SorInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (sor_info->steering_container) { + cJSON *steering_container_local_JSON = OpenAPI_steering_container_convertToJSON(sor_info->steering_container); + if (steering_container_local_JSON == NULL) { + ogs_error("OpenAPI_sor_info_convertToJSON() failed [steering_container]"); + goto end; + } + cJSON_AddItemToObject(item, "steeringContainer", steering_container_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_sor_info_convertToJSON() failed [steering_container]"); + goto end; + } + } + + if (cJSON_AddBoolToObject(item, "ackInd", sor_info->ack_ind) == NULL) { + ogs_error("OpenAPI_sor_info_convertToJSON() failed [ack_ind]"); + goto end; + } + + if (sor_info->sor_mac_iausf) { + if (cJSON_AddStringToObject(item, "sorMacIausf", sor_info->sor_mac_iausf) == NULL) { + ogs_error("OpenAPI_sor_info_convertToJSON() failed [sor_mac_iausf]"); + goto end; + } + } + + if (sor_info->countersor) { + if (cJSON_AddStringToObject(item, "countersor", sor_info->countersor) == NULL) { + ogs_error("OpenAPI_sor_info_convertToJSON() failed [countersor]"); + goto end; + } + } + + if (!sor_info->provisioning_time) { + ogs_error("OpenAPI_sor_info_convertToJSON() failed [provisioning_time]"); + goto end; + } + if (cJSON_AddStringToObject(item, "provisioningTime", sor_info->provisioning_time) == NULL) { + ogs_error("OpenAPI_sor_info_convertToJSON() failed [provisioning_time]"); + goto end; + } + +end: + return item; +} + +OpenAPI_sor_info_t *OpenAPI_sor_info_parseFromJSON(cJSON *sor_infoJSON) +{ + OpenAPI_sor_info_t *sor_info_local_var = NULL; + cJSON *steering_container = cJSON_GetObjectItemCaseSensitive(sor_infoJSON, "steeringContainer"); + + OpenAPI_steering_container_t *steering_container_local_nonprim = NULL; + if (steering_container) { + steering_container_local_nonprim = OpenAPI_steering_container_parseFromJSON(steering_container); + } + + cJSON *ack_ind = cJSON_GetObjectItemCaseSensitive(sor_infoJSON, "ackInd"); + if (!ack_ind) { + ogs_error("OpenAPI_sor_info_parseFromJSON() failed [ack_ind]"); + goto end; + } + + + if (!cJSON_IsBool(ack_ind)) { + ogs_error("OpenAPI_sor_info_parseFromJSON() failed [ack_ind]"); + goto end; + } + + cJSON *sor_mac_iausf = cJSON_GetObjectItemCaseSensitive(sor_infoJSON, "sorMacIausf"); + + if (sor_mac_iausf) { + if (!cJSON_IsString(sor_mac_iausf)) { + ogs_error("OpenAPI_sor_info_parseFromJSON() failed [sor_mac_iausf]"); + goto end; + } + } + + cJSON *countersor = cJSON_GetObjectItemCaseSensitive(sor_infoJSON, "countersor"); + + if (countersor) { + if (!cJSON_IsString(countersor)) { + ogs_error("OpenAPI_sor_info_parseFromJSON() failed [countersor]"); + goto end; + } + } + + cJSON *provisioning_time = cJSON_GetObjectItemCaseSensitive(sor_infoJSON, "provisioningTime"); + if (!provisioning_time) { + ogs_error("OpenAPI_sor_info_parseFromJSON() failed [provisioning_time]"); + goto end; + } + + + if (!cJSON_IsString(provisioning_time)) { + ogs_error("OpenAPI_sor_info_parseFromJSON() failed [provisioning_time]"); + goto end; + } + + sor_info_local_var = OpenAPI_sor_info_create ( + steering_container ? steering_container_local_nonprim : NULL, + ack_ind->valueint, + sor_mac_iausf ? ogs_strdup(sor_mac_iausf->valuestring) : NULL, + countersor ? ogs_strdup(countersor->valuestring) : NULL, + ogs_strdup(provisioning_time->valuestring) + ); + + return sor_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/sor_info.h b/lib/sbi/openapi/model/sor_info.h new file mode 100644 index 0000000000..825bf08c16 --- /dev/null +++ b/lib/sbi/openapi/model/sor_info.h @@ -0,0 +1,46 @@ +/* + * sor_info.h + * + * + */ + +#ifndef _OpenAPI_sor_info_H_ +#define _OpenAPI_sor_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "steering_container.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_sor_info_s OpenAPI_sor_info_t; +typedef struct OpenAPI_sor_info_s { + struct OpenAPI_steering_container_s *steering_container; + int ack_ind; + char *sor_mac_iausf; + char *countersor; + char *provisioning_time; +} OpenAPI_sor_info_t; + +OpenAPI_sor_info_t *OpenAPI_sor_info_create( + OpenAPI_steering_container_t *steering_container, + int ack_ind, + char *sor_mac_iausf, + char *countersor, + char *provisioning_time + ); +void OpenAPI_sor_info_free(OpenAPI_sor_info_t *sor_info); +OpenAPI_sor_info_t *OpenAPI_sor_info_parseFromJSON(cJSON *sor_infoJSON); +cJSON *OpenAPI_sor_info_convertToJSON(OpenAPI_sor_info_t *sor_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_sor_info_H_ */ + diff --git a/lib/sbi/openapi/model/sor_update_indicator.c b/lib/sbi/openapi/model/sor_update_indicator.c new file mode 100644 index 0000000000..fe8e474a2a --- /dev/null +++ b/lib/sbi/openapi/model/sor_update_indicator.c @@ -0,0 +1,30 @@ + +#include +#include +#include +#include "sor_update_indicator.h" + +char* OpenAPI_sor_update_indicator_ToString(OpenAPI_sor_update_indicator_e sor_update_indicator) +{ + const char *sor_update_indicatorArray[] = { "NULL", "INITIAL_REGISTRATION", "EMERGENCY_REGISTRATION" }; + size_t sizeofArray = sizeof(sor_update_indicatorArray) / sizeof(sor_update_indicatorArray[0]); + if (sor_update_indicator < sizeofArray) + return (char *)sor_update_indicatorArray[sor_update_indicator]; + else + return (char *)"Unknown"; +} + +OpenAPI_sor_update_indicator_e OpenAPI_sor_update_indicator_FromString(char* sor_update_indicator) +{ + int stringToReturn = 0; + const char *sor_update_indicatorArray[] = { "NULL", "INITIAL_REGISTRATION", "EMERGENCY_REGISTRATION" }; + size_t sizeofArray = sizeof(sor_update_indicatorArray) / sizeof(sor_update_indicatorArray[0]); + while (stringToReturn < sizeofArray) { + if (strcmp(sor_update_indicator, sor_update_indicatorArray[stringToReturn]) == 0) { + return stringToReturn; + } + stringToReturn++; + } + return 0; +} + diff --git a/lib/sbi/openapi/model/sor_update_indicator.h b/lib/sbi/openapi/model/sor_update_indicator.h new file mode 100644 index 0000000000..41bf804232 --- /dev/null +++ b/lib/sbi/openapi/model/sor_update_indicator.h @@ -0,0 +1,31 @@ +/* + * sor_update_indicator.h + * + * + */ + +#ifndef _OpenAPI_sor_update_indicator_H_ +#define _OpenAPI_sor_update_indicator_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { OpenAPI_sor_update_indicator_NULL = 0, OpenAPI_sor_update_indicator_INITIAL_REGISTRATION, OpenAPI_sor_update_indicator_EMERGENCY_REGISTRATION } OpenAPI_sor_update_indicator_e; + +char* OpenAPI_sor_update_indicator_ToString(OpenAPI_sor_update_indicator_e sor_update_indicator); + +OpenAPI_sor_update_indicator_e OpenAPI_sor_update_indicator_FromString(char* sor_update_indicator); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_sor_update_indicator_H_ */ + diff --git a/lib/sbi/openapi/model/sor_update_info.c b/lib/sbi/openapi/model/sor_update_info.c new file mode 100644 index 0000000000..7e31faf899 --- /dev/null +++ b/lib/sbi/openapi/model/sor_update_info.c @@ -0,0 +1,80 @@ + +#include +#include +#include +#include "sor_update_info.h" + +OpenAPI_sor_update_info_t *OpenAPI_sor_update_info_create( + OpenAPI_plmn_id_t *vplmn_id + ) +{ + OpenAPI_sor_update_info_t *sor_update_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_sor_update_info_t)); + if (!sor_update_info_local_var) { + return NULL; + } + sor_update_info_local_var->vplmn_id = vplmn_id; + + return sor_update_info_local_var; +} + +void OpenAPI_sor_update_info_free(OpenAPI_sor_update_info_t *sor_update_info) +{ + if (NULL == sor_update_info) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_plmn_id_free(sor_update_info->vplmn_id); + ogs_free(sor_update_info); +} + +cJSON *OpenAPI_sor_update_info_convertToJSON(OpenAPI_sor_update_info_t *sor_update_info) +{ + cJSON *item = NULL; + + if (sor_update_info == NULL) { + ogs_error("OpenAPI_sor_update_info_convertToJSON() failed [SorUpdateInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!sor_update_info->vplmn_id) { + ogs_error("OpenAPI_sor_update_info_convertToJSON() failed [vplmn_id]"); + goto end; + } + cJSON *vplmn_id_local_JSON = OpenAPI_plmn_id_convertToJSON(sor_update_info->vplmn_id); + if (vplmn_id_local_JSON == NULL) { + ogs_error("OpenAPI_sor_update_info_convertToJSON() failed [vplmn_id]"); + goto end; + } + cJSON_AddItemToObject(item, "vplmnId", vplmn_id_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_sor_update_info_convertToJSON() failed [vplmn_id]"); + goto end; + } + +end: + return item; +} + +OpenAPI_sor_update_info_t *OpenAPI_sor_update_info_parseFromJSON(cJSON *sor_update_infoJSON) +{ + OpenAPI_sor_update_info_t *sor_update_info_local_var = NULL; + cJSON *vplmn_id = cJSON_GetObjectItemCaseSensitive(sor_update_infoJSON, "vplmnId"); + if (!vplmn_id) { + ogs_error("OpenAPI_sor_update_info_parseFromJSON() failed [vplmn_id]"); + goto end; + } + + OpenAPI_plmn_id_t *vplmn_id_local_nonprim = NULL; + + vplmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(vplmn_id); + + sor_update_info_local_var = OpenAPI_sor_update_info_create ( + vplmn_id_local_nonprim + ); + + return sor_update_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/sor_update_info.h b/lib/sbi/openapi/model/sor_update_info.h new file mode 100644 index 0000000000..45be44e4f8 --- /dev/null +++ b/lib/sbi/openapi/model/sor_update_info.h @@ -0,0 +1,38 @@ +/* + * sor_update_info.h + * + * + */ + +#ifndef _OpenAPI_sor_update_info_H_ +#define _OpenAPI_sor_update_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "plmn_id.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_sor_update_info_s OpenAPI_sor_update_info_t; +typedef struct OpenAPI_sor_update_info_s { + struct OpenAPI_plmn_id_s *vplmn_id; +} OpenAPI_sor_update_info_t; + +OpenAPI_sor_update_info_t *OpenAPI_sor_update_info_create( + OpenAPI_plmn_id_t *vplmn_id + ); +void OpenAPI_sor_update_info_free(OpenAPI_sor_update_info_t *sor_update_info); +OpenAPI_sor_update_info_t *OpenAPI_sor_update_info_parseFromJSON(cJSON *sor_update_infoJSON); +cJSON *OpenAPI_sor_update_info_convertToJSON(OpenAPI_sor_update_info_t *sor_update_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_sor_update_info_H_ */ + diff --git a/lib/sbi/openapi/model/sponsor_connectivity_data.c b/lib/sbi/openapi/model/sponsor_connectivity_data.c new file mode 100644 index 0000000000..81e5682bac --- /dev/null +++ b/lib/sbi/openapi/model/sponsor_connectivity_data.c @@ -0,0 +1,99 @@ + +#include +#include +#include +#include "sponsor_connectivity_data.h" + +OpenAPI_sponsor_connectivity_data_t *OpenAPI_sponsor_connectivity_data_create( + OpenAPI_list_t *asp_ids + ) +{ + OpenAPI_sponsor_connectivity_data_t *sponsor_connectivity_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_sponsor_connectivity_data_t)); + if (!sponsor_connectivity_data_local_var) { + return NULL; + } + sponsor_connectivity_data_local_var->asp_ids = asp_ids; + + return sponsor_connectivity_data_local_var; +} + +void OpenAPI_sponsor_connectivity_data_free(OpenAPI_sponsor_connectivity_data_t *sponsor_connectivity_data) +{ + if (NULL == sponsor_connectivity_data) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(sponsor_connectivity_data->asp_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sponsor_connectivity_data->asp_ids); + ogs_free(sponsor_connectivity_data); +} + +cJSON *OpenAPI_sponsor_connectivity_data_convertToJSON(OpenAPI_sponsor_connectivity_data_t *sponsor_connectivity_data) +{ + cJSON *item = NULL; + + if (sponsor_connectivity_data == NULL) { + ogs_error("OpenAPI_sponsor_connectivity_data_convertToJSON() failed [SponsorConnectivityData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!sponsor_connectivity_data->asp_ids) { + ogs_error("OpenAPI_sponsor_connectivity_data_convertToJSON() failed [asp_ids]"); + goto end; + } + cJSON *asp_ids = cJSON_AddArrayToObject(item, "aspIds"); + if (asp_ids == NULL) { + ogs_error("OpenAPI_sponsor_connectivity_data_convertToJSON() failed [asp_ids]"); + goto end; + } + + OpenAPI_lnode_t *asp_ids_node; + OpenAPI_list_for_each(sponsor_connectivity_data->asp_ids, asp_ids_node) { + if (cJSON_AddStringToObject(asp_ids, "", (char*)asp_ids_node->data) == NULL) { + ogs_error("OpenAPI_sponsor_connectivity_data_convertToJSON() failed [asp_ids]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_sponsor_connectivity_data_t *OpenAPI_sponsor_connectivity_data_parseFromJSON(cJSON *sponsor_connectivity_dataJSON) +{ + OpenAPI_sponsor_connectivity_data_t *sponsor_connectivity_data_local_var = NULL; + cJSON *asp_ids = cJSON_GetObjectItemCaseSensitive(sponsor_connectivity_dataJSON, "aspIds"); + if (!asp_ids) { + ogs_error("OpenAPI_sponsor_connectivity_data_parseFromJSON() failed [asp_ids]"); + goto end; + } + + OpenAPI_list_t *asp_idsList; + + cJSON *asp_ids_local; + if (!cJSON_IsArray(asp_ids)) { + ogs_error("OpenAPI_sponsor_connectivity_data_parseFromJSON() failed [asp_ids]"); + goto end; + } + asp_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(asp_ids_local, asp_ids) { + if (!cJSON_IsString(asp_ids_local)) { + ogs_error("OpenAPI_sponsor_connectivity_data_parseFromJSON() failed [asp_ids]"); + goto end; + } + OpenAPI_list_add(asp_idsList, ogs_strdup(asp_ids_local->valuestring)); + } + + sponsor_connectivity_data_local_var = OpenAPI_sponsor_connectivity_data_create ( + asp_idsList + ); + + return sponsor_connectivity_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/sponsor_connectivity_data.h b/lib/sbi/openapi/model/sponsor_connectivity_data.h new file mode 100644 index 0000000000..ce191f33f8 --- /dev/null +++ b/lib/sbi/openapi/model/sponsor_connectivity_data.h @@ -0,0 +1,37 @@ +/* + * sponsor_connectivity_data.h + * + * Contains the sponsored data connectivity related information for a sponsor identifier. + */ + +#ifndef _OpenAPI_sponsor_connectivity_data_H_ +#define _OpenAPI_sponsor_connectivity_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_sponsor_connectivity_data_s OpenAPI_sponsor_connectivity_data_t; +typedef struct OpenAPI_sponsor_connectivity_data_s { + OpenAPI_list_t *asp_ids; +} OpenAPI_sponsor_connectivity_data_t; + +OpenAPI_sponsor_connectivity_data_t *OpenAPI_sponsor_connectivity_data_create( + OpenAPI_list_t *asp_ids + ); +void OpenAPI_sponsor_connectivity_data_free(OpenAPI_sponsor_connectivity_data_t *sponsor_connectivity_data); +OpenAPI_sponsor_connectivity_data_t *OpenAPI_sponsor_connectivity_data_parseFromJSON(cJSON *sponsor_connectivity_dataJSON); +cJSON *OpenAPI_sponsor_connectivity_data_convertToJSON(OpenAPI_sponsor_connectivity_data_t *sponsor_connectivity_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_sponsor_connectivity_data_H_ */ + diff --git a/lib/sbi/openapi/model/sqn_scheme.c b/lib/sbi/openapi/model/sqn_scheme.c new file mode 100644 index 0000000000..6fa1df0d9a --- /dev/null +++ b/lib/sbi/openapi/model/sqn_scheme.c @@ -0,0 +1,30 @@ + +#include +#include +#include +#include "sqn_scheme.h" + +char* OpenAPI_sqn_scheme_ToString(OpenAPI_sqn_scheme_e sqn_scheme) +{ + const char *sqn_schemeArray[] = { "NULL", "GENERAL", "NON_TIME_BASED", "TIME_BASED" }; + size_t sizeofArray = sizeof(sqn_schemeArray) / sizeof(sqn_schemeArray[0]); + if (sqn_scheme < sizeofArray) + return (char *)sqn_schemeArray[sqn_scheme]; + else + return (char *)"Unknown"; +} + +OpenAPI_sqn_scheme_e OpenAPI_sqn_scheme_FromString(char* sqn_scheme) +{ + int stringToReturn = 0; + const char *sqn_schemeArray[] = { "NULL", "GENERAL", "NON_TIME_BASED", "TIME_BASED" }; + size_t sizeofArray = sizeof(sqn_schemeArray) / sizeof(sqn_schemeArray[0]); + while (stringToReturn < sizeofArray) { + if (strcmp(sqn_scheme, sqn_schemeArray[stringToReturn]) == 0) { + return stringToReturn; + } + stringToReturn++; + } + return 0; +} + diff --git a/lib/sbi/openapi/model/sqn_scheme.h b/lib/sbi/openapi/model/sqn_scheme.h new file mode 100644 index 0000000000..ef5619e386 --- /dev/null +++ b/lib/sbi/openapi/model/sqn_scheme.h @@ -0,0 +1,31 @@ +/* + * sqn_scheme.h + * + * + */ + +#ifndef _OpenAPI_sqn_scheme_H_ +#define _OpenAPI_sqn_scheme_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { OpenAPI_sqn_scheme_NULL = 0, OpenAPI_sqn_scheme_GENERAL, OpenAPI_sqn_scheme_NON_TIME_BASED, OpenAPI_sqn_scheme_TIME_BASED } OpenAPI_sqn_scheme_e; + +char* OpenAPI_sqn_scheme_ToString(OpenAPI_sqn_scheme_e sqn_scheme); + +OpenAPI_sqn_scheme_e OpenAPI_sqn_scheme_FromString(char* sqn_scheme); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_sqn_scheme_H_ */ + diff --git a/lib/sbi/openapi/model/ssc_mode.c b/lib/sbi/openapi/model/ssc_mode.c new file mode 100644 index 0000000000..bc3d113b43 --- /dev/null +++ b/lib/sbi/openapi/model/ssc_mode.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "ssc_mode.h" + +OpenAPI_ssc_mode_t *OpenAPI_ssc_mode_create( + ) +{ + OpenAPI_ssc_mode_t *ssc_mode_local_var = OpenAPI_malloc(sizeof(OpenAPI_ssc_mode_t)); + if (!ssc_mode_local_var) { + return NULL; + } + + return ssc_mode_local_var; +} + +void OpenAPI_ssc_mode_free(OpenAPI_ssc_mode_t *ssc_mode) +{ + if (NULL == ssc_mode) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(ssc_mode); +} + +cJSON *OpenAPI_ssc_mode_convertToJSON(OpenAPI_ssc_mode_t *ssc_mode) +{ + cJSON *item = NULL; + + if (ssc_mode == NULL) { + ogs_error("OpenAPI_ssc_mode_convertToJSON() failed [SscMode]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_ssc_mode_t *OpenAPI_ssc_mode_parseFromJSON(cJSON *ssc_modeJSON) +{ + OpenAPI_ssc_mode_t *ssc_mode_local_var = NULL; + ssc_mode_local_var = OpenAPI_ssc_mode_create ( + ); + + return ssc_mode_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/ssc_mode.h b/lib/sbi/openapi/model/ssc_mode.h new file mode 100644 index 0000000000..1baac93b8f --- /dev/null +++ b/lib/sbi/openapi/model/ssc_mode.h @@ -0,0 +1,35 @@ +/* + * ssc_mode.h + * + * + */ + +#ifndef _OpenAPI_ssc_mode_H_ +#define _OpenAPI_ssc_mode_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_ssc_mode_s OpenAPI_ssc_mode_t; +typedef struct OpenAPI_ssc_mode_s { +} OpenAPI_ssc_mode_t; + +OpenAPI_ssc_mode_t *OpenAPI_ssc_mode_create( + ); +void OpenAPI_ssc_mode_free(OpenAPI_ssc_mode_t *ssc_mode); +OpenAPI_ssc_mode_t *OpenAPI_ssc_mode_parseFromJSON(cJSON *ssc_modeJSON); +cJSON *OpenAPI_ssc_mode_convertToJSON(OpenAPI_ssc_mode_t *ssc_mode); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_ssc_mode_H_ */ + diff --git a/lib/sbi/openapi/model/ssc_modes.c b/lib/sbi/openapi/model/ssc_modes.c new file mode 100644 index 0000000000..c3cece1555 --- /dev/null +++ b/lib/sbi/openapi/model/ssc_modes.c @@ -0,0 +1,130 @@ + +#include +#include +#include +#include "ssc_modes.h" + +OpenAPI_ssc_modes_t *OpenAPI_ssc_modes_create( + OpenAPI_ssc_mode_t *default_ssc_mode, + OpenAPI_list_t *allowed_ssc_modes + ) +{ + OpenAPI_ssc_modes_t *ssc_modes_local_var = OpenAPI_malloc(sizeof(OpenAPI_ssc_modes_t)); + if (!ssc_modes_local_var) { + return NULL; + } + ssc_modes_local_var->default_ssc_mode = default_ssc_mode; + ssc_modes_local_var->allowed_ssc_modes = allowed_ssc_modes; + + return ssc_modes_local_var; +} + +void OpenAPI_ssc_modes_free(OpenAPI_ssc_modes_t *ssc_modes) +{ + if (NULL == ssc_modes) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_ssc_mode_free(ssc_modes->default_ssc_mode); + OpenAPI_list_for_each(ssc_modes->allowed_ssc_modes, node) { + OpenAPI_ssc_mode_free(node->data); + } + OpenAPI_list_free(ssc_modes->allowed_ssc_modes); + ogs_free(ssc_modes); +} + +cJSON *OpenAPI_ssc_modes_convertToJSON(OpenAPI_ssc_modes_t *ssc_modes) +{ + cJSON *item = NULL; + + if (ssc_modes == NULL) { + ogs_error("OpenAPI_ssc_modes_convertToJSON() failed [SscModes]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!ssc_modes->default_ssc_mode) { + ogs_error("OpenAPI_ssc_modes_convertToJSON() failed [default_ssc_mode]"); + goto end; + } + cJSON *default_ssc_mode_local_JSON = OpenAPI_ssc_mode_convertToJSON(ssc_modes->default_ssc_mode); + if (default_ssc_mode_local_JSON == NULL) { + ogs_error("OpenAPI_ssc_modes_convertToJSON() failed [default_ssc_mode]"); + goto end; + } + cJSON_AddItemToObject(item, "defaultSscMode", default_ssc_mode_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_ssc_modes_convertToJSON() failed [default_ssc_mode]"); + goto end; + } + + if (ssc_modes->allowed_ssc_modes) { + cJSON *allowed_ssc_modesList = cJSON_AddArrayToObject(item, "allowedSscModes"); + if (allowed_ssc_modesList == NULL) { + ogs_error("OpenAPI_ssc_modes_convertToJSON() failed [allowed_ssc_modes]"); + goto end; + } + + OpenAPI_lnode_t *allowed_ssc_modes_node; + if (ssc_modes->allowed_ssc_modes) { + OpenAPI_list_for_each(ssc_modes->allowed_ssc_modes, allowed_ssc_modes_node) { + cJSON *itemLocal = OpenAPI_ssc_mode_convertToJSON(allowed_ssc_modes_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ssc_modes_convertToJSON() failed [allowed_ssc_modes]"); + goto end; + } + cJSON_AddItemToArray(allowed_ssc_modesList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_ssc_modes_t *OpenAPI_ssc_modes_parseFromJSON(cJSON *ssc_modesJSON) +{ + OpenAPI_ssc_modes_t *ssc_modes_local_var = NULL; + cJSON *default_ssc_mode = cJSON_GetObjectItemCaseSensitive(ssc_modesJSON, "defaultSscMode"); + if (!default_ssc_mode) { + ogs_error("OpenAPI_ssc_modes_parseFromJSON() failed [default_ssc_mode]"); + goto end; + } + + OpenAPI_ssc_mode_t *default_ssc_mode_local_nonprim = NULL; + + default_ssc_mode_local_nonprim = OpenAPI_ssc_mode_parseFromJSON(default_ssc_mode); + + cJSON *allowed_ssc_modes = cJSON_GetObjectItemCaseSensitive(ssc_modesJSON, "allowedSscModes"); + + OpenAPI_list_t *allowed_ssc_modesList; + if (allowed_ssc_modes) { + cJSON *allowed_ssc_modes_local_nonprimitive; + if (!cJSON_IsArray(allowed_ssc_modes)) { + ogs_error("OpenAPI_ssc_modes_parseFromJSON() failed [allowed_ssc_modes]"); + goto end; + } + + allowed_ssc_modesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_ssc_modes_local_nonprimitive, allowed_ssc_modes ) { + if (!cJSON_IsObject(allowed_ssc_modes_local_nonprimitive)) { + ogs_error("OpenAPI_ssc_modes_parseFromJSON() failed [allowed_ssc_modes]"); + goto end; + } + OpenAPI_ssc_mode_t *allowed_ssc_modesItem = OpenAPI_ssc_mode_parseFromJSON(allowed_ssc_modes_local_nonprimitive); + + OpenAPI_list_add(allowed_ssc_modesList, allowed_ssc_modesItem); + } + } + + ssc_modes_local_var = OpenAPI_ssc_modes_create ( + default_ssc_mode_local_nonprim, + allowed_ssc_modes ? allowed_ssc_modesList : NULL + ); + + return ssc_modes_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/ssc_modes.h b/lib/sbi/openapi/model/ssc_modes.h new file mode 100644 index 0000000000..4fe565af0f --- /dev/null +++ b/lib/sbi/openapi/model/ssc_modes.h @@ -0,0 +1,40 @@ +/* + * ssc_modes.h + * + * + */ + +#ifndef _OpenAPI_ssc_modes_H_ +#define _OpenAPI_ssc_modes_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "ssc_mode.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_ssc_modes_s OpenAPI_ssc_modes_t; +typedef struct OpenAPI_ssc_modes_s { + struct OpenAPI_ssc_mode_s *default_ssc_mode; + OpenAPI_list_t *allowed_ssc_modes; +} OpenAPI_ssc_modes_t; + +OpenAPI_ssc_modes_t *OpenAPI_ssc_modes_create( + OpenAPI_ssc_mode_t *default_ssc_mode, + OpenAPI_list_t *allowed_ssc_modes + ); +void OpenAPI_ssc_modes_free(OpenAPI_ssc_modes_t *ssc_modes); +OpenAPI_ssc_modes_t *OpenAPI_ssc_modes_parseFromJSON(cJSON *ssc_modesJSON); +cJSON *OpenAPI_ssc_modes_convertToJSON(OpenAPI_ssc_modes_t *ssc_modes); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_ssc_modes_H_ */ + diff --git a/lib/sbi/openapi/model/stationary_indication.c b/lib/sbi/openapi/model/stationary_indication.c new file mode 100644 index 0000000000..f84dbc2d08 --- /dev/null +++ b/lib/sbi/openapi/model/stationary_indication.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "stationary_indication.h" + +OpenAPI_stationary_indication_t *OpenAPI_stationary_indication_create( + ) +{ + OpenAPI_stationary_indication_t *stationary_indication_local_var = OpenAPI_malloc(sizeof(OpenAPI_stationary_indication_t)); + if (!stationary_indication_local_var) { + return NULL; + } + + return stationary_indication_local_var; +} + +void OpenAPI_stationary_indication_free(OpenAPI_stationary_indication_t *stationary_indication) +{ + if (NULL == stationary_indication) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(stationary_indication); +} + +cJSON *OpenAPI_stationary_indication_convertToJSON(OpenAPI_stationary_indication_t *stationary_indication) +{ + cJSON *item = NULL; + + if (stationary_indication == NULL) { + ogs_error("OpenAPI_stationary_indication_convertToJSON() failed [StationaryIndication]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_stationary_indication_t *OpenAPI_stationary_indication_parseFromJSON(cJSON *stationary_indicationJSON) +{ + OpenAPI_stationary_indication_t *stationary_indication_local_var = NULL; + stationary_indication_local_var = OpenAPI_stationary_indication_create ( + ); + + return stationary_indication_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/stationary_indication.h b/lib/sbi/openapi/model/stationary_indication.h new file mode 100644 index 0000000000..f442d04d0c --- /dev/null +++ b/lib/sbi/openapi/model/stationary_indication.h @@ -0,0 +1,35 @@ +/* + * stationary_indication.h + * + * Possible values are - STATIONARY: Identifies the UE is stationary - MOBILE: Identifies the UE is mobile + */ + +#ifndef _OpenAPI_stationary_indication_H_ +#define _OpenAPI_stationary_indication_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_stationary_indication_s OpenAPI_stationary_indication_t; +typedef struct OpenAPI_stationary_indication_s { +} OpenAPI_stationary_indication_t; + +OpenAPI_stationary_indication_t *OpenAPI_stationary_indication_create( + ); +void OpenAPI_stationary_indication_free(OpenAPI_stationary_indication_t *stationary_indication); +OpenAPI_stationary_indication_t *OpenAPI_stationary_indication_parseFromJSON(cJSON *stationary_indicationJSON); +cJSON *OpenAPI_stationary_indication_convertToJSON(OpenAPI_stationary_indication_t *stationary_indication); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_stationary_indication_H_ */ + diff --git a/lib/sbi/openapi/model/stationary_indication_rm.c b/lib/sbi/openapi/model/stationary_indication_rm.c new file mode 100644 index 0000000000..e722175365 --- /dev/null +++ b/lib/sbi/openapi/model/stationary_indication_rm.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "stationary_indication_rm.h" + +OpenAPI_stationary_indication_rm_t *OpenAPI_stationary_indication_rm_create( + ) +{ + OpenAPI_stationary_indication_rm_t *stationary_indication_rm_local_var = OpenAPI_malloc(sizeof(OpenAPI_stationary_indication_rm_t)); + if (!stationary_indication_rm_local_var) { + return NULL; + } + + return stationary_indication_rm_local_var; +} + +void OpenAPI_stationary_indication_rm_free(OpenAPI_stationary_indication_rm_t *stationary_indication_rm) +{ + if (NULL == stationary_indication_rm) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(stationary_indication_rm); +} + +cJSON *OpenAPI_stationary_indication_rm_convertToJSON(OpenAPI_stationary_indication_rm_t *stationary_indication_rm) +{ + cJSON *item = NULL; + + if (stationary_indication_rm == NULL) { + ogs_error("OpenAPI_stationary_indication_rm_convertToJSON() failed [StationaryIndicationRm]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_stationary_indication_rm_t *OpenAPI_stationary_indication_rm_parseFromJSON(cJSON *stationary_indication_rmJSON) +{ + OpenAPI_stationary_indication_rm_t *stationary_indication_rm_local_var = NULL; + stationary_indication_rm_local_var = OpenAPI_stationary_indication_rm_create ( + ); + + return stationary_indication_rm_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/stationary_indication_rm.h b/lib/sbi/openapi/model/stationary_indication_rm.h new file mode 100644 index 0000000000..71c3cc42b2 --- /dev/null +++ b/lib/sbi/openapi/model/stationary_indication_rm.h @@ -0,0 +1,37 @@ +/* + * stationary_indication_rm.h + * + * + */ + +#ifndef _OpenAPI_stationary_indication_rm_H_ +#define _OpenAPI_stationary_indication_rm_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "null_value.h" +#include "stationary_indication.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_stationary_indication_rm_s OpenAPI_stationary_indication_rm_t; +typedef struct OpenAPI_stationary_indication_rm_s { +} OpenAPI_stationary_indication_rm_t; + +OpenAPI_stationary_indication_rm_t *OpenAPI_stationary_indication_rm_create( + ); +void OpenAPI_stationary_indication_rm_free(OpenAPI_stationary_indication_rm_t *stationary_indication_rm); +OpenAPI_stationary_indication_rm_t *OpenAPI_stationary_indication_rm_parseFromJSON(cJSON *stationary_indication_rmJSON); +cJSON *OpenAPI_stationary_indication_rm_convertToJSON(OpenAPI_stationary_indication_rm_t *stationary_indication_rm); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_stationary_indication_rm_H_ */ + diff --git a/lib/sbi/openapi/model/steering_container.c b/lib/sbi/openapi/model/steering_container.c new file mode 100644 index 0000000000..b27a35d1a6 --- /dev/null +++ b/lib/sbi/openapi/model/steering_container.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "steering_container.h" + +OpenAPI_steering_container_t *OpenAPI_steering_container_create( + ) +{ + OpenAPI_steering_container_t *steering_container_local_var = OpenAPI_malloc(sizeof(OpenAPI_steering_container_t)); + if (!steering_container_local_var) { + return NULL; + } + + return steering_container_local_var; +} + +void OpenAPI_steering_container_free(OpenAPI_steering_container_t *steering_container) +{ + if (NULL == steering_container) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(steering_container); +} + +cJSON *OpenAPI_steering_container_convertToJSON(OpenAPI_steering_container_t *steering_container) +{ + cJSON *item = NULL; + + if (steering_container == NULL) { + ogs_error("OpenAPI_steering_container_convertToJSON() failed [SteeringContainer]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_steering_container_t *OpenAPI_steering_container_parseFromJSON(cJSON *steering_containerJSON) +{ + OpenAPI_steering_container_t *steering_container_local_var = NULL; + steering_container_local_var = OpenAPI_steering_container_create ( + ); + + return steering_container_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/steering_container.h b/lib/sbi/openapi/model/steering_container.h new file mode 100644 index 0000000000..f4e4bbc9f6 --- /dev/null +++ b/lib/sbi/openapi/model/steering_container.h @@ -0,0 +1,35 @@ +/* + * steering_container.h + * + * + */ + +#ifndef _OpenAPI_steering_container_H_ +#define _OpenAPI_steering_container_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_steering_container_s OpenAPI_steering_container_t; +typedef struct OpenAPI_steering_container_s { +} OpenAPI_steering_container_t; + +OpenAPI_steering_container_t *OpenAPI_steering_container_create( + ); +void OpenAPI_steering_container_free(OpenAPI_steering_container_t *steering_container); +OpenAPI_steering_container_t *OpenAPI_steering_container_parseFromJSON(cJSON *steering_containerJSON); +cJSON *OpenAPI_steering_container_convertToJSON(OpenAPI_steering_container_t *steering_container); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_steering_container_H_ */ + diff --git a/lib/sbi/openapi/model/steering_info.c b/lib/sbi/openapi/model/steering_info.c new file mode 100644 index 0000000000..4b3891d6f9 --- /dev/null +++ b/lib/sbi/openapi/model/steering_info.c @@ -0,0 +1,130 @@ + +#include +#include +#include +#include "steering_info.h" + +OpenAPI_steering_info_t *OpenAPI_steering_info_create( + OpenAPI_plmn_id_t *plmn_id, + OpenAPI_list_t *access_tech_list + ) +{ + OpenAPI_steering_info_t *steering_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_steering_info_t)); + if (!steering_info_local_var) { + return NULL; + } + steering_info_local_var->plmn_id = plmn_id; + steering_info_local_var->access_tech_list = access_tech_list; + + return steering_info_local_var; +} + +void OpenAPI_steering_info_free(OpenAPI_steering_info_t *steering_info) +{ + if (NULL == steering_info) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_plmn_id_free(steering_info->plmn_id); + OpenAPI_list_for_each(steering_info->access_tech_list, node) { + OpenAPI_access_tech_free(node->data); + } + OpenAPI_list_free(steering_info->access_tech_list); + ogs_free(steering_info); +} + +cJSON *OpenAPI_steering_info_convertToJSON(OpenAPI_steering_info_t *steering_info) +{ + cJSON *item = NULL; + + if (steering_info == NULL) { + ogs_error("OpenAPI_steering_info_convertToJSON() failed [SteeringInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!steering_info->plmn_id) { + ogs_error("OpenAPI_steering_info_convertToJSON() failed [plmn_id]"); + goto end; + } + cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_convertToJSON(steering_info->plmn_id); + if (plmn_id_local_JSON == NULL) { + ogs_error("OpenAPI_steering_info_convertToJSON() failed [plmn_id]"); + goto end; + } + cJSON_AddItemToObject(item, "plmnId", plmn_id_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_steering_info_convertToJSON() failed [plmn_id]"); + goto end; + } + + if (steering_info->access_tech_list) { + cJSON *access_tech_listList = cJSON_AddArrayToObject(item, "accessTechList"); + if (access_tech_listList == NULL) { + ogs_error("OpenAPI_steering_info_convertToJSON() failed [access_tech_list]"); + goto end; + } + + OpenAPI_lnode_t *access_tech_list_node; + if (steering_info->access_tech_list) { + OpenAPI_list_for_each(steering_info->access_tech_list, access_tech_list_node) { + cJSON *itemLocal = OpenAPI_access_tech_convertToJSON(access_tech_list_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_steering_info_convertToJSON() failed [access_tech_list]"); + goto end; + } + cJSON_AddItemToArray(access_tech_listList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_steering_info_t *OpenAPI_steering_info_parseFromJSON(cJSON *steering_infoJSON) +{ + OpenAPI_steering_info_t *steering_info_local_var = NULL; + cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(steering_infoJSON, "plmnId"); + if (!plmn_id) { + ogs_error("OpenAPI_steering_info_parseFromJSON() failed [plmn_id]"); + goto end; + } + + OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + + plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); + + cJSON *access_tech_list = cJSON_GetObjectItemCaseSensitive(steering_infoJSON, "accessTechList"); + + OpenAPI_list_t *access_tech_listList; + if (access_tech_list) { + cJSON *access_tech_list_local_nonprimitive; + if (!cJSON_IsArray(access_tech_list)) { + ogs_error("OpenAPI_steering_info_parseFromJSON() failed [access_tech_list]"); + goto end; + } + + access_tech_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(access_tech_list_local_nonprimitive, access_tech_list ) { + if (!cJSON_IsObject(access_tech_list_local_nonprimitive)) { + ogs_error("OpenAPI_steering_info_parseFromJSON() failed [access_tech_list]"); + goto end; + } + OpenAPI_access_tech_t *access_tech_listItem = OpenAPI_access_tech_parseFromJSON(access_tech_list_local_nonprimitive); + + OpenAPI_list_add(access_tech_listList, access_tech_listItem); + } + } + + steering_info_local_var = OpenAPI_steering_info_create ( + plmn_id_local_nonprim, + access_tech_list ? access_tech_listList : NULL + ); + + return steering_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/steering_info.h b/lib/sbi/openapi/model/steering_info.h new file mode 100644 index 0000000000..4c444489f9 --- /dev/null +++ b/lib/sbi/openapi/model/steering_info.h @@ -0,0 +1,41 @@ +/* + * steering_info.h + * + * + */ + +#ifndef _OpenAPI_steering_info_H_ +#define _OpenAPI_steering_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "access_tech.h" +#include "plmn_id.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_steering_info_s OpenAPI_steering_info_t; +typedef struct OpenAPI_steering_info_s { + struct OpenAPI_plmn_id_s *plmn_id; + OpenAPI_list_t *access_tech_list; +} OpenAPI_steering_info_t; + +OpenAPI_steering_info_t *OpenAPI_steering_info_create( + OpenAPI_plmn_id_t *plmn_id, + OpenAPI_list_t *access_tech_list + ); +void OpenAPI_steering_info_free(OpenAPI_steering_info_t *steering_info); +OpenAPI_steering_info_t *OpenAPI_steering_info_parseFromJSON(cJSON *steering_infoJSON); +cJSON *OpenAPI_steering_info_convertToJSON(OpenAPI_steering_info_t *steering_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_steering_info_H_ */ + diff --git a/lib/sbi/openapi/model/stored_search_result.h b/lib/sbi/openapi/model/stored_search_result.h index 4c6bd0be40..fc1c7b11d0 100644 --- a/lib/sbi/openapi/model/stored_search_result.h +++ b/lib/sbi/openapi/model/stored_search_result.h @@ -1,7 +1,7 @@ /* * stored_search_result.h * - * + * Contains a complete search result (i.e. a number of discovered NF Instances), stored by NRF as a consequence of a prior search result */ #ifndef _OpenAPI_stored_search_result_H_ diff --git a/lib/sbi/openapi/model/subscribed_default_qos.c b/lib/sbi/openapi/model/subscribed_default_qos.c new file mode 100644 index 0000000000..6f54340101 --- /dev/null +++ b/lib/sbi/openapi/model/subscribed_default_qos.c @@ -0,0 +1,123 @@ + +#include +#include +#include +#include "subscribed_default_qos.h" + +OpenAPI_subscribed_default_qos_t *OpenAPI_subscribed_default_qos_create( + int _5qi, + OpenAPI_arp_t *arp, + int priority_level + ) +{ + OpenAPI_subscribed_default_qos_t *subscribed_default_qos_local_var = OpenAPI_malloc(sizeof(OpenAPI_subscribed_default_qos_t)); + if (!subscribed_default_qos_local_var) { + return NULL; + } + subscribed_default_qos_local_var->_5qi = _5qi; + subscribed_default_qos_local_var->arp = arp; + subscribed_default_qos_local_var->priority_level = priority_level; + + return subscribed_default_qos_local_var; +} + +void OpenAPI_subscribed_default_qos_free(OpenAPI_subscribed_default_qos_t *subscribed_default_qos) +{ + if (NULL == subscribed_default_qos) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_arp_free(subscribed_default_qos->arp); + ogs_free(subscribed_default_qos); +} + +cJSON *OpenAPI_subscribed_default_qos_convertToJSON(OpenAPI_subscribed_default_qos_t *subscribed_default_qos) +{ + cJSON *item = NULL; + + if (subscribed_default_qos == NULL) { + ogs_error("OpenAPI_subscribed_default_qos_convertToJSON() failed [SubscribedDefaultQos]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!subscribed_default_qos->_5qi) { + ogs_error("OpenAPI_subscribed_default_qos_convertToJSON() failed [_5qi]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "5qi", subscribed_default_qos->_5qi) == NULL) { + ogs_error("OpenAPI_subscribed_default_qos_convertToJSON() failed [_5qi]"); + goto end; + } + + if (!subscribed_default_qos->arp) { + ogs_error("OpenAPI_subscribed_default_qos_convertToJSON() failed [arp]"); + goto end; + } + cJSON *arp_local_JSON = OpenAPI_arp_convertToJSON(subscribed_default_qos->arp); + if (arp_local_JSON == NULL) { + ogs_error("OpenAPI_subscribed_default_qos_convertToJSON() failed [arp]"); + goto end; + } + cJSON_AddItemToObject(item, "arp", arp_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_subscribed_default_qos_convertToJSON() failed [arp]"); + goto end; + } + + if (subscribed_default_qos->priority_level) { + if (cJSON_AddNumberToObject(item, "priorityLevel", subscribed_default_qos->priority_level) == NULL) { + ogs_error("OpenAPI_subscribed_default_qos_convertToJSON() failed [priority_level]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_subscribed_default_qos_t *OpenAPI_subscribed_default_qos_parseFromJSON(cJSON *subscribed_default_qosJSON) +{ + OpenAPI_subscribed_default_qos_t *subscribed_default_qos_local_var = NULL; + cJSON *_5qi = cJSON_GetObjectItemCaseSensitive(subscribed_default_qosJSON, "5qi"); + if (!_5qi) { + ogs_error("OpenAPI_subscribed_default_qos_parseFromJSON() failed [_5qi]"); + goto end; + } + + + if (!cJSON_IsNumber(_5qi)) { + ogs_error("OpenAPI_subscribed_default_qos_parseFromJSON() failed [_5qi]"); + goto end; + } + + cJSON *arp = cJSON_GetObjectItemCaseSensitive(subscribed_default_qosJSON, "arp"); + if (!arp) { + ogs_error("OpenAPI_subscribed_default_qos_parseFromJSON() failed [arp]"); + goto end; + } + + OpenAPI_arp_t *arp_local_nonprim = NULL; + + arp_local_nonprim = OpenAPI_arp_parseFromJSON(arp); + + cJSON *priority_level = cJSON_GetObjectItemCaseSensitive(subscribed_default_qosJSON, "priorityLevel"); + + if (priority_level) { + if (!cJSON_IsNumber(priority_level)) { + ogs_error("OpenAPI_subscribed_default_qos_parseFromJSON() failed [priority_level]"); + goto end; + } + } + + subscribed_default_qos_local_var = OpenAPI_subscribed_default_qos_create ( + _5qi->valuedouble, + arp_local_nonprim, + priority_level ? priority_level->valuedouble : 0 + ); + + return subscribed_default_qos_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/subscribed_default_qos.h b/lib/sbi/openapi/model/subscribed_default_qos.h new file mode 100644 index 0000000000..76944a4d10 --- /dev/null +++ b/lib/sbi/openapi/model/subscribed_default_qos.h @@ -0,0 +1,42 @@ +/* + * subscribed_default_qos.h + * + * + */ + +#ifndef _OpenAPI_subscribed_default_qos_H_ +#define _OpenAPI_subscribed_default_qos_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "arp.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_subscribed_default_qos_s OpenAPI_subscribed_default_qos_t; +typedef struct OpenAPI_subscribed_default_qos_s { + int _5qi; + struct OpenAPI_arp_s *arp; + int priority_level; +} OpenAPI_subscribed_default_qos_t; + +OpenAPI_subscribed_default_qos_t *OpenAPI_subscribed_default_qos_create( + int _5qi, + OpenAPI_arp_t *arp, + int priority_level + ); +void OpenAPI_subscribed_default_qos_free(OpenAPI_subscribed_default_qos_t *subscribed_default_qos); +OpenAPI_subscribed_default_qos_t *OpenAPI_subscribed_default_qos_parseFromJSON(cJSON *subscribed_default_qosJSON); +cJSON *OpenAPI_subscribed_default_qos_convertToJSON(OpenAPI_subscribed_default_qos_t *subscribed_default_qos); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_subscribed_default_qos_H_ */ + diff --git a/lib/sbi/openapi/model/subscribed_event.c b/lib/sbi/openapi/model/subscribed_event.c new file mode 100644 index 0000000000..04d4fe7723 --- /dev/null +++ b/lib/sbi/openapi/model/subscribed_event.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "subscribed_event.h" + +OpenAPI_subscribed_event_t *OpenAPI_subscribed_event_create( + ) +{ + OpenAPI_subscribed_event_t *subscribed_event_local_var = OpenAPI_malloc(sizeof(OpenAPI_subscribed_event_t)); + if (!subscribed_event_local_var) { + return NULL; + } + + return subscribed_event_local_var; +} + +void OpenAPI_subscribed_event_free(OpenAPI_subscribed_event_t *subscribed_event) +{ + if (NULL == subscribed_event) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(subscribed_event); +} + +cJSON *OpenAPI_subscribed_event_convertToJSON(OpenAPI_subscribed_event_t *subscribed_event) +{ + cJSON *item = NULL; + + if (subscribed_event == NULL) { + ogs_error("OpenAPI_subscribed_event_convertToJSON() failed [SubscribedEvent]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_subscribed_event_t *OpenAPI_subscribed_event_parseFromJSON(cJSON *subscribed_eventJSON) +{ + OpenAPI_subscribed_event_t *subscribed_event_local_var = NULL; + subscribed_event_local_var = OpenAPI_subscribed_event_create ( + ); + + return subscribed_event_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/subscribed_event.h b/lib/sbi/openapi/model/subscribed_event.h new file mode 100644 index 0000000000..a36da7cf03 --- /dev/null +++ b/lib/sbi/openapi/model/subscribed_event.h @@ -0,0 +1,35 @@ +/* + * subscribed_event.h + * + * Possible values are - UP_PATH_CHANGE: The AF requests to be notified when the UP path changes for the PDU session. + */ + +#ifndef _OpenAPI_subscribed_event_H_ +#define _OpenAPI_subscribed_event_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_subscribed_event_s OpenAPI_subscribed_event_t; +typedef struct OpenAPI_subscribed_event_s { +} OpenAPI_subscribed_event_t; + +OpenAPI_subscribed_event_t *OpenAPI_subscribed_event_create( + ); +void OpenAPI_subscribed_event_free(OpenAPI_subscribed_event_t *subscribed_event); +OpenAPI_subscribed_event_t *OpenAPI_subscribed_event_parseFromJSON(cJSON *subscribed_eventJSON); +cJSON *OpenAPI_subscribed_event_convertToJSON(OpenAPI_subscribed_event_t *subscribed_event); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_subscribed_event_H_ */ + diff --git a/lib/sbi/openapi/model/subscription_data.c b/lib/sbi/openapi/model/subscription_data.c index 1cc986e428..92685bebb9 100644 --- a/lib/sbi/openapi/model/subscription_data.c +++ b/lib/sbi/openapi/model/subscription_data.c @@ -11,10 +11,12 @@ OpenAPI_subscription_data_t *OpenAPI_subscription_data_create( char *validity_time, OpenAPI_list_t *req_notif_events, OpenAPI_plmn_id_t *plmn_id, + char *nid, OpenAPI_notif_condition_t *notif_condition, OpenAPI_nf_type_e req_nf_type, char *req_nf_fqdn, - OpenAPI_list_t *req_snssais + OpenAPI_list_t *req_snssais, + OpenAPI_list_t *req_plmn_list ) { OpenAPI_subscription_data_t *subscription_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_subscription_data_t)); @@ -27,10 +29,12 @@ OpenAPI_subscription_data_t *OpenAPI_subscription_data_create( subscription_data_local_var->validity_time = validity_time; subscription_data_local_var->req_notif_events = req_notif_events; subscription_data_local_var->plmn_id = plmn_id; + subscription_data_local_var->nid = nid; subscription_data_local_var->notif_condition = notif_condition; subscription_data_local_var->req_nf_type = req_nf_type; subscription_data_local_var->req_nf_fqdn = req_nf_fqdn; subscription_data_local_var->req_snssais = req_snssais; + subscription_data_local_var->req_plmn_list = req_plmn_list; return subscription_data_local_var; } @@ -47,12 +51,17 @@ void OpenAPI_subscription_data_free(OpenAPI_subscription_data_t *subscription_da ogs_free(subscription_data->validity_time); OpenAPI_list_free(subscription_data->req_notif_events); OpenAPI_plmn_id_free(subscription_data->plmn_id); + ogs_free(subscription_data->nid); OpenAPI_notif_condition_free(subscription_data->notif_condition); ogs_free(subscription_data->req_nf_fqdn); OpenAPI_list_for_each(subscription_data->req_snssais, node) { OpenAPI_snssai_free(node->data); } OpenAPI_list_free(subscription_data->req_snssais); + OpenAPI_list_for_each(subscription_data->req_plmn_list, node) { + OpenAPI_plmn_id_free(node->data); + } + OpenAPI_list_free(subscription_data->req_plmn_list); ogs_free(subscription_data); } @@ -124,6 +133,13 @@ cJSON *OpenAPI_subscription_data_convertToJSON(OpenAPI_subscription_data_t *subs } } + if (subscription_data->nid) { + if (cJSON_AddStringToObject(item, "nid", subscription_data->nid) == NULL) { + ogs_error("OpenAPI_subscription_data_convertToJSON() failed [nid]"); + goto end; + } + } + if (subscription_data->notif_condition) { cJSON *notif_condition_local_JSON = OpenAPI_notif_condition_convertToJSON(subscription_data->notif_condition); if (notif_condition_local_JSON == NULL) { @@ -171,6 +187,26 @@ cJSON *OpenAPI_subscription_data_convertToJSON(OpenAPI_subscription_data_t *subs } } + if (subscription_data->req_plmn_list) { + cJSON *req_plmn_listList = cJSON_AddArrayToObject(item, "reqPlmnList"); + if (req_plmn_listList == NULL) { + ogs_error("OpenAPI_subscription_data_convertToJSON() failed [req_plmn_list]"); + goto end; + } + + OpenAPI_lnode_t *req_plmn_list_node; + if (subscription_data->req_plmn_list) { + OpenAPI_list_for_each(subscription_data->req_plmn_list, req_plmn_list_node) { + cJSON *itemLocal = OpenAPI_plmn_id_convertToJSON(req_plmn_list_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_subscription_data_convertToJSON() failed [req_plmn_list]"); + goto end; + } + cJSON_AddItemToArray(req_plmn_listList, itemLocal); + } + } + } + end: return item; } @@ -246,6 +282,15 @@ OpenAPI_subscription_data_t *OpenAPI_subscription_data_parseFromJSON(cJSON *subs plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); } + cJSON *nid = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "nid"); + + if (nid) { + if (!cJSON_IsString(nid)) { + ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [nid]"); + goto end; + } + } + cJSON *notif_condition = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "notifCondition"); OpenAPI_notif_condition_t *notif_condition_local_nonprim = NULL; @@ -296,6 +341,29 @@ OpenAPI_subscription_data_t *OpenAPI_subscription_data_parseFromJSON(cJSON *subs } } + cJSON *req_plmn_list = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "reqPlmnList"); + + OpenAPI_list_t *req_plmn_listList; + if (req_plmn_list) { + cJSON *req_plmn_list_local_nonprimitive; + if (!cJSON_IsArray(req_plmn_list)) { + ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [req_plmn_list]"); + goto end; + } + + req_plmn_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(req_plmn_list_local_nonprimitive, req_plmn_list ) { + if (!cJSON_IsObject(req_plmn_list_local_nonprimitive)) { + ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [req_plmn_list]"); + goto end; + } + OpenAPI_plmn_id_t *req_plmn_listItem = OpenAPI_plmn_id_parseFromJSON(req_plmn_list_local_nonprimitive); + + OpenAPI_list_add(req_plmn_listList, req_plmn_listItem); + } + } + subscription_data_local_var = OpenAPI_subscription_data_create ( ogs_strdup(nf_status_notification_uri->valuestring), req_nf_instance_id ? ogs_strdup(req_nf_instance_id->valuestring) : NULL, @@ -303,10 +371,12 @@ OpenAPI_subscription_data_t *OpenAPI_subscription_data_parseFromJSON(cJSON *subs validity_time ? ogs_strdup(validity_time->valuestring) : NULL, req_notif_events ? req_notif_eventsList : NULL, plmn_id ? plmn_id_local_nonprim : NULL, + nid ? ogs_strdup(nid->valuestring) : NULL, notif_condition ? notif_condition_local_nonprim : NULL, req_nf_type ? req_nf_typeVariable : 0, req_nf_fqdn ? ogs_strdup(req_nf_fqdn->valuestring) : NULL, - req_snssais ? req_snssaisList : NULL + req_snssais ? req_snssaisList : NULL, + req_plmn_list ? req_plmn_listList : NULL ); return subscription_data_local_var; diff --git a/lib/sbi/openapi/model/subscription_data.h b/lib/sbi/openapi/model/subscription_data.h index 90c3db399a..6c91818451 100644 --- a/lib/sbi/openapi/model/subscription_data.h +++ b/lib/sbi/openapi/model/subscription_data.h @@ -1,7 +1,7 @@ /* * subscription_data.h * - * + * Information of a subscription to notifications to NRF events, included in subscription requests and responses */ #ifndef _OpenAPI_subscription_data_H_ @@ -30,10 +30,12 @@ typedef struct OpenAPI_subscription_data_s { char *validity_time; OpenAPI_list_t *req_notif_events; struct OpenAPI_plmn_id_s *plmn_id; + char *nid; struct OpenAPI_notif_condition_s *notif_condition; OpenAPI_nf_type_e req_nf_type; char *req_nf_fqdn; OpenAPI_list_t *req_snssais; + OpenAPI_list_t *req_plmn_list; } OpenAPI_subscription_data_t; OpenAPI_subscription_data_t *OpenAPI_subscription_data_create( @@ -43,10 +45,12 @@ OpenAPI_subscription_data_t *OpenAPI_subscription_data_create( char *validity_time, OpenAPI_list_t *req_notif_events, OpenAPI_plmn_id_t *plmn_id, + char *nid, OpenAPI_notif_condition_t *notif_condition, OpenAPI_nf_type_e req_nf_type, char *req_nf_fqdn, - OpenAPI_list_t *req_snssais + OpenAPI_list_t *req_snssais, + OpenAPI_list_t *req_plmn_list ); void OpenAPI_subscription_data_free(OpenAPI_subscription_data_t *subscription_data); OpenAPI_subscription_data_t *OpenAPI_subscription_data_parseFromJSON(cJSON *subscription_dataJSON); diff --git a/lib/sbi/openapi/model/subscription_data_sets.c b/lib/sbi/openapi/model/subscription_data_sets.c new file mode 100644 index 0000000000..3ffeb7f2e5 --- /dev/null +++ b/lib/sbi/openapi/model/subscription_data_sets.c @@ -0,0 +1,317 @@ + +#include +#include +#include +#include "subscription_data_sets.h" + +OpenAPI_subscription_data_sets_t *OpenAPI_subscription_data_sets_create( + OpenAPI_access_and_mobility_subscription_data_t *am_data, + OpenAPI_smf_selection_subscription_data_t *smf_sel_data, + OpenAPI_ue_context_in_smf_data_t *uec_smf_data, + OpenAPI_ue_context_in_smsf_data_t *uec_smsf_data, + OpenAPI_sms_subscription_data_t *sms_subs_data, + OpenAPI_list_t *sm_data, + OpenAPI_trace_data_t *trace_data, + OpenAPI_sms_management_subscription_data_t *sms_mng_data, + OpenAPI_lcs_privacy_data_t *lcs_privacy_data, + OpenAPI_lcs_mo_data_t *lcs_mo_data + ) +{ + OpenAPI_subscription_data_sets_t *subscription_data_sets_local_var = OpenAPI_malloc(sizeof(OpenAPI_subscription_data_sets_t)); + if (!subscription_data_sets_local_var) { + return NULL; + } + subscription_data_sets_local_var->am_data = am_data; + subscription_data_sets_local_var->smf_sel_data = smf_sel_data; + subscription_data_sets_local_var->uec_smf_data = uec_smf_data; + subscription_data_sets_local_var->uec_smsf_data = uec_smsf_data; + subscription_data_sets_local_var->sms_subs_data = sms_subs_data; + subscription_data_sets_local_var->sm_data = sm_data; + subscription_data_sets_local_var->trace_data = trace_data; + subscription_data_sets_local_var->sms_mng_data = sms_mng_data; + subscription_data_sets_local_var->lcs_privacy_data = lcs_privacy_data; + subscription_data_sets_local_var->lcs_mo_data = lcs_mo_data; + + return subscription_data_sets_local_var; +} + +void OpenAPI_subscription_data_sets_free(OpenAPI_subscription_data_sets_t *subscription_data_sets) +{ + if (NULL == subscription_data_sets) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_access_and_mobility_subscription_data_free(subscription_data_sets->am_data); + OpenAPI_smf_selection_subscription_data_free(subscription_data_sets->smf_sel_data); + OpenAPI_ue_context_in_smf_data_free(subscription_data_sets->uec_smf_data); + OpenAPI_ue_context_in_smsf_data_free(subscription_data_sets->uec_smsf_data); + OpenAPI_sms_subscription_data_free(subscription_data_sets->sms_subs_data); + OpenAPI_list_for_each(subscription_data_sets->sm_data, node) { + OpenAPI_session_management_subscription_data_free(node->data); + } + OpenAPI_list_free(subscription_data_sets->sm_data); + OpenAPI_trace_data_free(subscription_data_sets->trace_data); + OpenAPI_sms_management_subscription_data_free(subscription_data_sets->sms_mng_data); + OpenAPI_lcs_privacy_data_free(subscription_data_sets->lcs_privacy_data); + OpenAPI_lcs_mo_data_free(subscription_data_sets->lcs_mo_data); + ogs_free(subscription_data_sets); +} + +cJSON *OpenAPI_subscription_data_sets_convertToJSON(OpenAPI_subscription_data_sets_t *subscription_data_sets) +{ + cJSON *item = NULL; + + if (subscription_data_sets == NULL) { + ogs_error("OpenAPI_subscription_data_sets_convertToJSON() failed [SubscriptionDataSets]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (subscription_data_sets->am_data) { + cJSON *am_data_local_JSON = OpenAPI_access_and_mobility_subscription_data_convertToJSON(subscription_data_sets->am_data); + if (am_data_local_JSON == NULL) { + ogs_error("OpenAPI_subscription_data_sets_convertToJSON() failed [am_data]"); + goto end; + } + cJSON_AddItemToObject(item, "amData", am_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_subscription_data_sets_convertToJSON() failed [am_data]"); + goto end; + } + } + + if (subscription_data_sets->smf_sel_data) { + cJSON *smf_sel_data_local_JSON = OpenAPI_smf_selection_subscription_data_convertToJSON(subscription_data_sets->smf_sel_data); + if (smf_sel_data_local_JSON == NULL) { + ogs_error("OpenAPI_subscription_data_sets_convertToJSON() failed [smf_sel_data]"); + goto end; + } + cJSON_AddItemToObject(item, "smfSelData", smf_sel_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_subscription_data_sets_convertToJSON() failed [smf_sel_data]"); + goto end; + } + } + + if (subscription_data_sets->uec_smf_data) { + cJSON *uec_smf_data_local_JSON = OpenAPI_ue_context_in_smf_data_convertToJSON(subscription_data_sets->uec_smf_data); + if (uec_smf_data_local_JSON == NULL) { + ogs_error("OpenAPI_subscription_data_sets_convertToJSON() failed [uec_smf_data]"); + goto end; + } + cJSON_AddItemToObject(item, "uecSmfData", uec_smf_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_subscription_data_sets_convertToJSON() failed [uec_smf_data]"); + goto end; + } + } + + if (subscription_data_sets->uec_smsf_data) { + cJSON *uec_smsf_data_local_JSON = OpenAPI_ue_context_in_smsf_data_convertToJSON(subscription_data_sets->uec_smsf_data); + if (uec_smsf_data_local_JSON == NULL) { + ogs_error("OpenAPI_subscription_data_sets_convertToJSON() failed [uec_smsf_data]"); + goto end; + } + cJSON_AddItemToObject(item, "uecSmsfData", uec_smsf_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_subscription_data_sets_convertToJSON() failed [uec_smsf_data]"); + goto end; + } + } + + if (subscription_data_sets->sms_subs_data) { + cJSON *sms_subs_data_local_JSON = OpenAPI_sms_subscription_data_convertToJSON(subscription_data_sets->sms_subs_data); + if (sms_subs_data_local_JSON == NULL) { + ogs_error("OpenAPI_subscription_data_sets_convertToJSON() failed [sms_subs_data]"); + goto end; + } + cJSON_AddItemToObject(item, "smsSubsData", sms_subs_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_subscription_data_sets_convertToJSON() failed [sms_subs_data]"); + goto end; + } + } + + if (subscription_data_sets->sm_data) { + cJSON *sm_dataList = cJSON_AddArrayToObject(item, "smData"); + if (sm_dataList == NULL) { + ogs_error("OpenAPI_subscription_data_sets_convertToJSON() failed [sm_data]"); + goto end; + } + + OpenAPI_lnode_t *sm_data_node; + if (subscription_data_sets->sm_data) { + OpenAPI_list_for_each(subscription_data_sets->sm_data, sm_data_node) { + cJSON *itemLocal = OpenAPI_session_management_subscription_data_convertToJSON(sm_data_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_subscription_data_sets_convertToJSON() failed [sm_data]"); + goto end; + } + cJSON_AddItemToArray(sm_dataList, itemLocal); + } + } + } + + if (subscription_data_sets->trace_data) { + cJSON *trace_data_local_JSON = OpenAPI_trace_data_convertToJSON(subscription_data_sets->trace_data); + if (trace_data_local_JSON == NULL) { + ogs_error("OpenAPI_subscription_data_sets_convertToJSON() failed [trace_data]"); + goto end; + } + cJSON_AddItemToObject(item, "traceData", trace_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_subscription_data_sets_convertToJSON() failed [trace_data]"); + goto end; + } + } + + if (subscription_data_sets->sms_mng_data) { + cJSON *sms_mng_data_local_JSON = OpenAPI_sms_management_subscription_data_convertToJSON(subscription_data_sets->sms_mng_data); + if (sms_mng_data_local_JSON == NULL) { + ogs_error("OpenAPI_subscription_data_sets_convertToJSON() failed [sms_mng_data]"); + goto end; + } + cJSON_AddItemToObject(item, "smsMngData", sms_mng_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_subscription_data_sets_convertToJSON() failed [sms_mng_data]"); + goto end; + } + } + + if (subscription_data_sets->lcs_privacy_data) { + cJSON *lcs_privacy_data_local_JSON = OpenAPI_lcs_privacy_data_convertToJSON(subscription_data_sets->lcs_privacy_data); + if (lcs_privacy_data_local_JSON == NULL) { + ogs_error("OpenAPI_subscription_data_sets_convertToJSON() failed [lcs_privacy_data]"); + goto end; + } + cJSON_AddItemToObject(item, "lcsPrivacyData", lcs_privacy_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_subscription_data_sets_convertToJSON() failed [lcs_privacy_data]"); + goto end; + } + } + + if (subscription_data_sets->lcs_mo_data) { + cJSON *lcs_mo_data_local_JSON = OpenAPI_lcs_mo_data_convertToJSON(subscription_data_sets->lcs_mo_data); + if (lcs_mo_data_local_JSON == NULL) { + ogs_error("OpenAPI_subscription_data_sets_convertToJSON() failed [lcs_mo_data]"); + goto end; + } + cJSON_AddItemToObject(item, "lcsMoData", lcs_mo_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_subscription_data_sets_convertToJSON() failed [lcs_mo_data]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_subscription_data_sets_t *OpenAPI_subscription_data_sets_parseFromJSON(cJSON *subscription_data_setsJSON) +{ + OpenAPI_subscription_data_sets_t *subscription_data_sets_local_var = NULL; + cJSON *am_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "amData"); + + OpenAPI_access_and_mobility_subscription_data_t *am_data_local_nonprim = NULL; + if (am_data) { + am_data_local_nonprim = OpenAPI_access_and_mobility_subscription_data_parseFromJSON(am_data); + } + + cJSON *smf_sel_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "smfSelData"); + + OpenAPI_smf_selection_subscription_data_t *smf_sel_data_local_nonprim = NULL; + if (smf_sel_data) { + smf_sel_data_local_nonprim = OpenAPI_smf_selection_subscription_data_parseFromJSON(smf_sel_data); + } + + cJSON *uec_smf_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "uecSmfData"); + + OpenAPI_ue_context_in_smf_data_t *uec_smf_data_local_nonprim = NULL; + if (uec_smf_data) { + uec_smf_data_local_nonprim = OpenAPI_ue_context_in_smf_data_parseFromJSON(uec_smf_data); + } + + cJSON *uec_smsf_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "uecSmsfData"); + + OpenAPI_ue_context_in_smsf_data_t *uec_smsf_data_local_nonprim = NULL; + if (uec_smsf_data) { + uec_smsf_data_local_nonprim = OpenAPI_ue_context_in_smsf_data_parseFromJSON(uec_smsf_data); + } + + cJSON *sms_subs_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "smsSubsData"); + + OpenAPI_sms_subscription_data_t *sms_subs_data_local_nonprim = NULL; + if (sms_subs_data) { + sms_subs_data_local_nonprim = OpenAPI_sms_subscription_data_parseFromJSON(sms_subs_data); + } + + cJSON *sm_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "smData"); + + OpenAPI_list_t *sm_dataList; + if (sm_data) { + cJSON *sm_data_local_nonprimitive; + if (!cJSON_IsArray(sm_data)) { + ogs_error("OpenAPI_subscription_data_sets_parseFromJSON() failed [sm_data]"); + goto end; + } + + sm_dataList = OpenAPI_list_create(); + + cJSON_ArrayForEach(sm_data_local_nonprimitive, sm_data ) { + if (!cJSON_IsObject(sm_data_local_nonprimitive)) { + ogs_error("OpenAPI_subscription_data_sets_parseFromJSON() failed [sm_data]"); + goto end; + } + OpenAPI_session_management_subscription_data_t *sm_dataItem = OpenAPI_session_management_subscription_data_parseFromJSON(sm_data_local_nonprimitive); + + OpenAPI_list_add(sm_dataList, sm_dataItem); + } + } + + cJSON *trace_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "traceData"); + + OpenAPI_trace_data_t *trace_data_local_nonprim = NULL; + if (trace_data) { + trace_data_local_nonprim = OpenAPI_trace_data_parseFromJSON(trace_data); + } + + cJSON *sms_mng_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "smsMngData"); + + OpenAPI_sms_management_subscription_data_t *sms_mng_data_local_nonprim = NULL; + if (sms_mng_data) { + sms_mng_data_local_nonprim = OpenAPI_sms_management_subscription_data_parseFromJSON(sms_mng_data); + } + + cJSON *lcs_privacy_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "lcsPrivacyData"); + + OpenAPI_lcs_privacy_data_t *lcs_privacy_data_local_nonprim = NULL; + if (lcs_privacy_data) { + lcs_privacy_data_local_nonprim = OpenAPI_lcs_privacy_data_parseFromJSON(lcs_privacy_data); + } + + cJSON *lcs_mo_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "lcsMoData"); + + OpenAPI_lcs_mo_data_t *lcs_mo_data_local_nonprim = NULL; + if (lcs_mo_data) { + lcs_mo_data_local_nonprim = OpenAPI_lcs_mo_data_parseFromJSON(lcs_mo_data); + } + + subscription_data_sets_local_var = OpenAPI_subscription_data_sets_create ( + am_data ? am_data_local_nonprim : NULL, + smf_sel_data ? smf_sel_data_local_nonprim : NULL, + uec_smf_data ? uec_smf_data_local_nonprim : NULL, + uec_smsf_data ? uec_smsf_data_local_nonprim : NULL, + sms_subs_data ? sms_subs_data_local_nonprim : NULL, + sm_data ? sm_dataList : NULL, + trace_data ? trace_data_local_nonprim : NULL, + sms_mng_data ? sms_mng_data_local_nonprim : NULL, + lcs_privacy_data ? lcs_privacy_data_local_nonprim : NULL, + lcs_mo_data ? lcs_mo_data_local_nonprim : NULL + ); + + return subscription_data_sets_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/subscription_data_sets.h b/lib/sbi/openapi/model/subscription_data_sets.h new file mode 100644 index 0000000000..3d2cca04a5 --- /dev/null +++ b/lib/sbi/openapi/model/subscription_data_sets.h @@ -0,0 +1,65 @@ +/* + * subscription_data_sets.h + * + * + */ + +#ifndef _OpenAPI_subscription_data_sets_H_ +#define _OpenAPI_subscription_data_sets_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "access_and_mobility_subscription_data.h" +#include "lcs_mo_data.h" +#include "lcs_privacy_data.h" +#include "session_management_subscription_data.h" +#include "smf_selection_subscription_data.h" +#include "sms_management_subscription_data.h" +#include "sms_subscription_data.h" +#include "trace_data.h" +#include "ue_context_in_smf_data.h" +#include "ue_context_in_smsf_data.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_subscription_data_sets_s OpenAPI_subscription_data_sets_t; +typedef struct OpenAPI_subscription_data_sets_s { + struct OpenAPI_access_and_mobility_subscription_data_s *am_data; + struct OpenAPI_smf_selection_subscription_data_s *smf_sel_data; + struct OpenAPI_ue_context_in_smf_data_s *uec_smf_data; + struct OpenAPI_ue_context_in_smsf_data_s *uec_smsf_data; + struct OpenAPI_sms_subscription_data_s *sms_subs_data; + OpenAPI_list_t *sm_data; + struct OpenAPI_trace_data_s *trace_data; + struct OpenAPI_sms_management_subscription_data_s *sms_mng_data; + struct OpenAPI_lcs_privacy_data_s *lcs_privacy_data; + struct OpenAPI_lcs_mo_data_s *lcs_mo_data; +} OpenAPI_subscription_data_sets_t; + +OpenAPI_subscription_data_sets_t *OpenAPI_subscription_data_sets_create( + OpenAPI_access_and_mobility_subscription_data_t *am_data, + OpenAPI_smf_selection_subscription_data_t *smf_sel_data, + OpenAPI_ue_context_in_smf_data_t *uec_smf_data, + OpenAPI_ue_context_in_smsf_data_t *uec_smsf_data, + OpenAPI_sms_subscription_data_t *sms_subs_data, + OpenAPI_list_t *sm_data, + OpenAPI_trace_data_t *trace_data, + OpenAPI_sms_management_subscription_data_t *sms_mng_data, + OpenAPI_lcs_privacy_data_t *lcs_privacy_data, + OpenAPI_lcs_mo_data_t *lcs_mo_data + ); +void OpenAPI_subscription_data_sets_free(OpenAPI_subscription_data_sets_t *subscription_data_sets); +OpenAPI_subscription_data_sets_t *OpenAPI_subscription_data_sets_parseFromJSON(cJSON *subscription_data_setsJSON); +cJSON *OpenAPI_subscription_data_sets_convertToJSON(OpenAPI_subscription_data_sets_t *subscription_data_sets); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_subscription_data_sets_H_ */ + diff --git a/lib/sbi/openapi/model/subscription_data_subscriptions.c b/lib/sbi/openapi/model/subscription_data_subscriptions.c new file mode 100644 index 0000000000..55670622bd --- /dev/null +++ b/lib/sbi/openapi/model/subscription_data_subscriptions.c @@ -0,0 +1,248 @@ + +#include +#include +#include +#include "subscription_data_subscriptions.h" + +OpenAPI_subscription_data_subscriptions_t *OpenAPI_subscription_data_subscriptions_create( + char *ue_id, + char *callback_reference, + char *original_callback_reference, + OpenAPI_list_t *monitored_resource_uris, + char *expiry, + OpenAPI_sdm_subscription_t *sdm_subscription, + char *subscription_id, + char *supported_features + ) +{ + OpenAPI_subscription_data_subscriptions_t *subscription_data_subscriptions_local_var = OpenAPI_malloc(sizeof(OpenAPI_subscription_data_subscriptions_t)); + if (!subscription_data_subscriptions_local_var) { + return NULL; + } + subscription_data_subscriptions_local_var->ue_id = ue_id; + subscription_data_subscriptions_local_var->callback_reference = callback_reference; + subscription_data_subscriptions_local_var->original_callback_reference = original_callback_reference; + subscription_data_subscriptions_local_var->monitored_resource_uris = monitored_resource_uris; + subscription_data_subscriptions_local_var->expiry = expiry; + subscription_data_subscriptions_local_var->sdm_subscription = sdm_subscription; + subscription_data_subscriptions_local_var->subscription_id = subscription_id; + subscription_data_subscriptions_local_var->supported_features = supported_features; + + return subscription_data_subscriptions_local_var; +} + +void OpenAPI_subscription_data_subscriptions_free(OpenAPI_subscription_data_subscriptions_t *subscription_data_subscriptions) +{ + if (NULL == subscription_data_subscriptions) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(subscription_data_subscriptions->ue_id); + ogs_free(subscription_data_subscriptions->callback_reference); + ogs_free(subscription_data_subscriptions->original_callback_reference); + OpenAPI_list_for_each(subscription_data_subscriptions->monitored_resource_uris, node) { + ogs_free(node->data); + } + OpenAPI_list_free(subscription_data_subscriptions->monitored_resource_uris); + ogs_free(subscription_data_subscriptions->expiry); + OpenAPI_sdm_subscription_free(subscription_data_subscriptions->sdm_subscription); + ogs_free(subscription_data_subscriptions->subscription_id); + ogs_free(subscription_data_subscriptions->supported_features); + ogs_free(subscription_data_subscriptions); +} + +cJSON *OpenAPI_subscription_data_subscriptions_convertToJSON(OpenAPI_subscription_data_subscriptions_t *subscription_data_subscriptions) +{ + cJSON *item = NULL; + + if (subscription_data_subscriptions == NULL) { + ogs_error("OpenAPI_subscription_data_subscriptions_convertToJSON() failed [SubscriptionDataSubscriptions]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (subscription_data_subscriptions->ue_id) { + if (cJSON_AddStringToObject(item, "ueId", subscription_data_subscriptions->ue_id) == NULL) { + ogs_error("OpenAPI_subscription_data_subscriptions_convertToJSON() failed [ue_id]"); + goto end; + } + } + + if (!subscription_data_subscriptions->callback_reference) { + ogs_error("OpenAPI_subscription_data_subscriptions_convertToJSON() failed [callback_reference]"); + goto end; + } + if (cJSON_AddStringToObject(item, "callbackReference", subscription_data_subscriptions->callback_reference) == NULL) { + ogs_error("OpenAPI_subscription_data_subscriptions_convertToJSON() failed [callback_reference]"); + goto end; + } + + if (subscription_data_subscriptions->original_callback_reference) { + if (cJSON_AddStringToObject(item, "originalCallbackReference", subscription_data_subscriptions->original_callback_reference) == NULL) { + ogs_error("OpenAPI_subscription_data_subscriptions_convertToJSON() failed [original_callback_reference]"); + goto end; + } + } + + if (!subscription_data_subscriptions->monitored_resource_uris) { + ogs_error("OpenAPI_subscription_data_subscriptions_convertToJSON() failed [monitored_resource_uris]"); + goto end; + } + cJSON *monitored_resource_uris = cJSON_AddArrayToObject(item, "monitoredResourceUris"); + if (monitored_resource_uris == NULL) { + ogs_error("OpenAPI_subscription_data_subscriptions_convertToJSON() failed [monitored_resource_uris]"); + goto end; + } + + OpenAPI_lnode_t *monitored_resource_uris_node; + OpenAPI_list_for_each(subscription_data_subscriptions->monitored_resource_uris, monitored_resource_uris_node) { + if (cJSON_AddStringToObject(monitored_resource_uris, "", (char*)monitored_resource_uris_node->data) == NULL) { + ogs_error("OpenAPI_subscription_data_subscriptions_convertToJSON() failed [monitored_resource_uris]"); + goto end; + } + } + + if (subscription_data_subscriptions->expiry) { + if (cJSON_AddStringToObject(item, "expiry", subscription_data_subscriptions->expiry) == NULL) { + ogs_error("OpenAPI_subscription_data_subscriptions_convertToJSON() failed [expiry]"); + goto end; + } + } + + if (subscription_data_subscriptions->sdm_subscription) { + cJSON *sdm_subscription_local_JSON = OpenAPI_sdm_subscription_convertToJSON(subscription_data_subscriptions->sdm_subscription); + if (sdm_subscription_local_JSON == NULL) { + ogs_error("OpenAPI_subscription_data_subscriptions_convertToJSON() failed [sdm_subscription]"); + goto end; + } + cJSON_AddItemToObject(item, "sdmSubscription", sdm_subscription_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_subscription_data_subscriptions_convertToJSON() failed [sdm_subscription]"); + goto end; + } + } + + if (subscription_data_subscriptions->subscription_id) { + if (cJSON_AddStringToObject(item, "subscriptionId", subscription_data_subscriptions->subscription_id) == NULL) { + ogs_error("OpenAPI_subscription_data_subscriptions_convertToJSON() failed [subscription_id]"); + goto end; + } + } + + if (subscription_data_subscriptions->supported_features) { + if (cJSON_AddStringToObject(item, "supported-features", subscription_data_subscriptions->supported_features) == NULL) { + ogs_error("OpenAPI_subscription_data_subscriptions_convertToJSON() failed [supported_features]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_subscription_data_subscriptions_t *OpenAPI_subscription_data_subscriptions_parseFromJSON(cJSON *subscription_data_subscriptionsJSON) +{ + OpenAPI_subscription_data_subscriptions_t *subscription_data_subscriptions_local_var = NULL; + cJSON *ue_id = cJSON_GetObjectItemCaseSensitive(subscription_data_subscriptionsJSON, "ueId"); + + if (ue_id) { + if (!cJSON_IsString(ue_id)) { + ogs_error("OpenAPI_subscription_data_subscriptions_parseFromJSON() failed [ue_id]"); + goto end; + } + } + + cJSON *callback_reference = cJSON_GetObjectItemCaseSensitive(subscription_data_subscriptionsJSON, "callbackReference"); + if (!callback_reference) { + ogs_error("OpenAPI_subscription_data_subscriptions_parseFromJSON() failed [callback_reference]"); + goto end; + } + + + if (!cJSON_IsString(callback_reference)) { + ogs_error("OpenAPI_subscription_data_subscriptions_parseFromJSON() failed [callback_reference]"); + goto end; + } + + cJSON *original_callback_reference = cJSON_GetObjectItemCaseSensitive(subscription_data_subscriptionsJSON, "originalCallbackReference"); + + if (original_callback_reference) { + if (!cJSON_IsString(original_callback_reference)) { + ogs_error("OpenAPI_subscription_data_subscriptions_parseFromJSON() failed [original_callback_reference]"); + goto end; + } + } + + cJSON *monitored_resource_uris = cJSON_GetObjectItemCaseSensitive(subscription_data_subscriptionsJSON, "monitoredResourceUris"); + if (!monitored_resource_uris) { + ogs_error("OpenAPI_subscription_data_subscriptions_parseFromJSON() failed [monitored_resource_uris]"); + goto end; + } + + OpenAPI_list_t *monitored_resource_urisList; + + cJSON *monitored_resource_uris_local; + if (!cJSON_IsArray(monitored_resource_uris)) { + ogs_error("OpenAPI_subscription_data_subscriptions_parseFromJSON() failed [monitored_resource_uris]"); + goto end; + } + monitored_resource_urisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(monitored_resource_uris_local, monitored_resource_uris) { + if (!cJSON_IsString(monitored_resource_uris_local)) { + ogs_error("OpenAPI_subscription_data_subscriptions_parseFromJSON() failed [monitored_resource_uris]"); + goto end; + } + OpenAPI_list_add(monitored_resource_urisList, ogs_strdup(monitored_resource_uris_local->valuestring)); + } + + cJSON *expiry = cJSON_GetObjectItemCaseSensitive(subscription_data_subscriptionsJSON, "expiry"); + + if (expiry) { + if (!cJSON_IsString(expiry)) { + ogs_error("OpenAPI_subscription_data_subscriptions_parseFromJSON() failed [expiry]"); + goto end; + } + } + + cJSON *sdm_subscription = cJSON_GetObjectItemCaseSensitive(subscription_data_subscriptionsJSON, "sdmSubscription"); + + OpenAPI_sdm_subscription_t *sdm_subscription_local_nonprim = NULL; + if (sdm_subscription) { + sdm_subscription_local_nonprim = OpenAPI_sdm_subscription_parseFromJSON(sdm_subscription); + } + + cJSON *subscription_id = cJSON_GetObjectItemCaseSensitive(subscription_data_subscriptionsJSON, "subscriptionId"); + + if (subscription_id) { + if (!cJSON_IsString(subscription_id)) { + ogs_error("OpenAPI_subscription_data_subscriptions_parseFromJSON() failed [subscription_id]"); + goto end; + } + } + + cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(subscription_data_subscriptionsJSON, "supported-features"); + + if (supported_features) { + if (!cJSON_IsString(supported_features)) { + ogs_error("OpenAPI_subscription_data_subscriptions_parseFromJSON() failed [supported_features]"); + goto end; + } + } + + subscription_data_subscriptions_local_var = OpenAPI_subscription_data_subscriptions_create ( + ue_id ? ogs_strdup(ue_id->valuestring) : NULL, + ogs_strdup(callback_reference->valuestring), + original_callback_reference ? ogs_strdup(original_callback_reference->valuestring) : NULL, + monitored_resource_urisList, + expiry ? ogs_strdup(expiry->valuestring) : NULL, + sdm_subscription ? sdm_subscription_local_nonprim : NULL, + subscription_id ? ogs_strdup(subscription_id->valuestring) : NULL, + supported_features ? ogs_strdup(supported_features->valuestring) : NULL + ); + + return subscription_data_subscriptions_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/subscription_data_subscriptions.h b/lib/sbi/openapi/model/subscription_data_subscriptions.h new file mode 100644 index 0000000000..3bbf84969a --- /dev/null +++ b/lib/sbi/openapi/model/subscription_data_subscriptions.h @@ -0,0 +1,52 @@ +/* + * subscription_data_subscriptions.h + * + * + */ + +#ifndef _OpenAPI_subscription_data_subscriptions_H_ +#define _OpenAPI_subscription_data_subscriptions_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "sdm_subscription.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_subscription_data_subscriptions_s OpenAPI_subscription_data_subscriptions_t; +typedef struct OpenAPI_subscription_data_subscriptions_s { + char *ue_id; + char *callback_reference; + char *original_callback_reference; + OpenAPI_list_t *monitored_resource_uris; + char *expiry; + struct OpenAPI_sdm_subscription_s *sdm_subscription; + char *subscription_id; + char *supported_features; +} OpenAPI_subscription_data_subscriptions_t; + +OpenAPI_subscription_data_subscriptions_t *OpenAPI_subscription_data_subscriptions_create( + char *ue_id, + char *callback_reference, + char *original_callback_reference, + OpenAPI_list_t *monitored_resource_uris, + char *expiry, + OpenAPI_sdm_subscription_t *sdm_subscription, + char *subscription_id, + char *supported_features + ); +void OpenAPI_subscription_data_subscriptions_free(OpenAPI_subscription_data_subscriptions_t *subscription_data_subscriptions); +OpenAPI_subscription_data_subscriptions_t *OpenAPI_subscription_data_subscriptions_parseFromJSON(cJSON *subscription_data_subscriptionsJSON); +cJSON *OpenAPI_subscription_data_subscriptions_convertToJSON(OpenAPI_subscription_data_subscriptions_t *subscription_data_subscriptions); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_subscription_data_subscriptions_H_ */ + diff --git a/lib/sbi/openapi/model/suggested_packet_num_dl.c b/lib/sbi/openapi/model/suggested_packet_num_dl.c new file mode 100644 index 0000000000..32f0190fff --- /dev/null +++ b/lib/sbi/openapi/model/suggested_packet_num_dl.c @@ -0,0 +1,95 @@ + +#include +#include +#include +#include "suggested_packet_num_dl.h" + +OpenAPI_suggested_packet_num_dl_t *OpenAPI_suggested_packet_num_dl_create( + int suggested_packet_num_dl, + char *validity_time + ) +{ + OpenAPI_suggested_packet_num_dl_t *suggested_packet_num_dl_local_var = OpenAPI_malloc(sizeof(OpenAPI_suggested_packet_num_dl_t)); + if (!suggested_packet_num_dl_local_var) { + return NULL; + } + suggested_packet_num_dl_local_var->suggested_packet_num_dl = suggested_packet_num_dl; + suggested_packet_num_dl_local_var->validity_time = validity_time; + + return suggested_packet_num_dl_local_var; +} + +void OpenAPI_suggested_packet_num_dl_free(OpenAPI_suggested_packet_num_dl_t *suggested_packet_num_dl) +{ + if (NULL == suggested_packet_num_dl) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(suggested_packet_num_dl->validity_time); + ogs_free(suggested_packet_num_dl); +} + +cJSON *OpenAPI_suggested_packet_num_dl_convertToJSON(OpenAPI_suggested_packet_num_dl_t *suggested_packet_num_dl) +{ + cJSON *item = NULL; + + if (suggested_packet_num_dl == NULL) { + ogs_error("OpenAPI_suggested_packet_num_dl_convertToJSON() failed [SuggestedPacketNumDl]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!suggested_packet_num_dl->suggested_packet_num_dl) { + ogs_error("OpenAPI_suggested_packet_num_dl_convertToJSON() failed [suggested_packet_num_dl]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "suggestedPacketNumDl", suggested_packet_num_dl->suggested_packet_num_dl) == NULL) { + ogs_error("OpenAPI_suggested_packet_num_dl_convertToJSON() failed [suggested_packet_num_dl]"); + goto end; + } + + if (suggested_packet_num_dl->validity_time) { + if (cJSON_AddStringToObject(item, "validityTime", suggested_packet_num_dl->validity_time) == NULL) { + ogs_error("OpenAPI_suggested_packet_num_dl_convertToJSON() failed [validity_time]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_suggested_packet_num_dl_t *OpenAPI_suggested_packet_num_dl_parseFromJSON(cJSON *suggested_packet_num_dlJSON) +{ + OpenAPI_suggested_packet_num_dl_t *suggested_packet_num_dl_local_var = NULL; + cJSON *suggested_packet_num_dl = cJSON_GetObjectItemCaseSensitive(suggested_packet_num_dlJSON, "suggestedPacketNumDl"); + if (!suggested_packet_num_dl) { + ogs_error("OpenAPI_suggested_packet_num_dl_parseFromJSON() failed [suggested_packet_num_dl]"); + goto end; + } + + + if (!cJSON_IsNumber(suggested_packet_num_dl)) { + ogs_error("OpenAPI_suggested_packet_num_dl_parseFromJSON() failed [suggested_packet_num_dl]"); + goto end; + } + + cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(suggested_packet_num_dlJSON, "validityTime"); + + if (validity_time) { + if (!cJSON_IsString(validity_time)) { + ogs_error("OpenAPI_suggested_packet_num_dl_parseFromJSON() failed [validity_time]"); + goto end; + } + } + + suggested_packet_num_dl_local_var = OpenAPI_suggested_packet_num_dl_create ( + suggested_packet_num_dl->valuedouble, + validity_time ? ogs_strdup(validity_time->valuestring) : NULL + ); + + return suggested_packet_num_dl_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/suggested_packet_num_dl.h b/lib/sbi/openapi/model/suggested_packet_num_dl.h new file mode 100644 index 0000000000..9134fbdece --- /dev/null +++ b/lib/sbi/openapi/model/suggested_packet_num_dl.h @@ -0,0 +1,39 @@ +/* + * suggested_packet_num_dl.h + * + * + */ + +#ifndef _OpenAPI_suggested_packet_num_dl_H_ +#define _OpenAPI_suggested_packet_num_dl_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_suggested_packet_num_dl_s OpenAPI_suggested_packet_num_dl_t; +typedef struct OpenAPI_suggested_packet_num_dl_s { + int suggested_packet_num_dl; + char *validity_time; +} OpenAPI_suggested_packet_num_dl_t; + +OpenAPI_suggested_packet_num_dl_t *OpenAPI_suggested_packet_num_dl_create( + int suggested_packet_num_dl, + char *validity_time + ); +void OpenAPI_suggested_packet_num_dl_free(OpenAPI_suggested_packet_num_dl_t *suggested_packet_num_dl); +OpenAPI_suggested_packet_num_dl_t *OpenAPI_suggested_packet_num_dl_parseFromJSON(cJSON *suggested_packet_num_dlJSON); +cJSON *OpenAPI_suggested_packet_num_dl_convertToJSON(OpenAPI_suggested_packet_num_dl_t *suggested_packet_num_dl); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_suggested_packet_num_dl_H_ */ + diff --git a/lib/sbi/openapi/model/supi_range.h b/lib/sbi/openapi/model/supi_range.h index ce9e179334..e49b894bfb 100644 --- a/lib/sbi/openapi/model/supi_range.h +++ b/lib/sbi/openapi/model/supi_range.h @@ -1,7 +1,7 @@ /* * supi_range.h * - * + * A range of SUPIs (subscriber identities), either based on a numeric range, or based on regular-expression matching */ #ifndef _OpenAPI_supi_range_H_ diff --git a/lib/sbi/openapi/model/supported_gad_shapes.c b/lib/sbi/openapi/model/supported_gad_shapes.c new file mode 100644 index 0000000000..dd1f239110 --- /dev/null +++ b/lib/sbi/openapi/model/supported_gad_shapes.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "supported_gad_shapes.h" + +OpenAPI_supported_gad_shapes_t *OpenAPI_supported_gad_shapes_create( + ) +{ + OpenAPI_supported_gad_shapes_t *supported_gad_shapes_local_var = OpenAPI_malloc(sizeof(OpenAPI_supported_gad_shapes_t)); + if (!supported_gad_shapes_local_var) { + return NULL; + } + + return supported_gad_shapes_local_var; +} + +void OpenAPI_supported_gad_shapes_free(OpenAPI_supported_gad_shapes_t *supported_gad_shapes) +{ + if (NULL == supported_gad_shapes) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(supported_gad_shapes); +} + +cJSON *OpenAPI_supported_gad_shapes_convertToJSON(OpenAPI_supported_gad_shapes_t *supported_gad_shapes) +{ + cJSON *item = NULL; + + if (supported_gad_shapes == NULL) { + ogs_error("OpenAPI_supported_gad_shapes_convertToJSON() failed [SupportedGADShapes]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_supported_gad_shapes_t *OpenAPI_supported_gad_shapes_parseFromJSON(cJSON *supported_gad_shapesJSON) +{ + OpenAPI_supported_gad_shapes_t *supported_gad_shapes_local_var = NULL; + supported_gad_shapes_local_var = OpenAPI_supported_gad_shapes_create ( + ); + + return supported_gad_shapes_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/supported_gad_shapes.h b/lib/sbi/openapi/model/supported_gad_shapes.h new file mode 100644 index 0000000000..848b645597 --- /dev/null +++ b/lib/sbi/openapi/model/supported_gad_shapes.h @@ -0,0 +1,35 @@ +/* + * supported_gad_shapes.h + * + * + */ + +#ifndef _OpenAPI_supported_gad_shapes_H_ +#define _OpenAPI_supported_gad_shapes_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_supported_gad_shapes_s OpenAPI_supported_gad_shapes_t; +typedef struct OpenAPI_supported_gad_shapes_s { +} OpenAPI_supported_gad_shapes_t; + +OpenAPI_supported_gad_shapes_t *OpenAPI_supported_gad_shapes_create( + ); +void OpenAPI_supported_gad_shapes_free(OpenAPI_supported_gad_shapes_t *supported_gad_shapes); +OpenAPI_supported_gad_shapes_t *OpenAPI_supported_gad_shapes_parseFromJSON(cJSON *supported_gad_shapesJSON); +cJSON *OpenAPI_supported_gad_shapes_convertToJSON(OpenAPI_supported_gad_shapes_t *supported_gad_shapes); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_supported_gad_shapes_H_ */ + diff --git a/lib/sbi/openapi/model/tac_range.h b/lib/sbi/openapi/model/tac_range.h index f71be7a6fd..993f6cea4f 100644 --- a/lib/sbi/openapi/model/tac_range.h +++ b/lib/sbi/openapi/model/tac_range.h @@ -1,7 +1,7 @@ /* * tac_range.h * - * + * Range of TACs (Tracking Area Codes) */ #ifndef _OpenAPI_tac_range_H_ diff --git a/lib/sbi/openapi/model/tai.c b/lib/sbi/openapi/model/tai.c index c239b0af15..672545e135 100644 --- a/lib/sbi/openapi/model/tai.c +++ b/lib/sbi/openapi/model/tai.c @@ -6,7 +6,8 @@ OpenAPI_tai_t *OpenAPI_tai_create( OpenAPI_plmn_id_t *plmn_id, - char *tac + char *tac, + char *nid ) { OpenAPI_tai_t *tai_local_var = OpenAPI_malloc(sizeof(OpenAPI_tai_t)); @@ -15,6 +16,7 @@ OpenAPI_tai_t *OpenAPI_tai_create( } tai_local_var->plmn_id = plmn_id; tai_local_var->tac = tac; + tai_local_var->nid = nid; return tai_local_var; } @@ -27,6 +29,7 @@ void OpenAPI_tai_free(OpenAPI_tai_t *tai) OpenAPI_lnode_t *node; OpenAPI_plmn_id_free(tai->plmn_id); ogs_free(tai->tac); + ogs_free(tai->nid); ogs_free(tai); } @@ -64,6 +67,13 @@ cJSON *OpenAPI_tai_convertToJSON(OpenAPI_tai_t *tai) goto end; } + if (tai->nid) { + if (cJSON_AddStringToObject(item, "nid", tai->nid) == NULL) { + ogs_error("OpenAPI_tai_convertToJSON() failed [nid]"); + goto end; + } + } + end: return item; } @@ -93,9 +103,19 @@ OpenAPI_tai_t *OpenAPI_tai_parseFromJSON(cJSON *taiJSON) goto end; } + cJSON *nid = cJSON_GetObjectItemCaseSensitive(taiJSON, "nid"); + + if (nid) { + if (!cJSON_IsString(nid)) { + ogs_error("OpenAPI_tai_parseFromJSON() failed [nid]"); + goto end; + } + } + tai_local_var = OpenAPI_tai_create ( plmn_id_local_nonprim, - ogs_strdup(tac->valuestring) + ogs_strdup(tac->valuestring), + nid ? ogs_strdup(nid->valuestring) : NULL ); return tai_local_var; diff --git a/lib/sbi/openapi/model/tai.h b/lib/sbi/openapi/model/tai.h index 6a7041e7b9..8e39c6bcd4 100644 --- a/lib/sbi/openapi/model/tai.h +++ b/lib/sbi/openapi/model/tai.h @@ -22,11 +22,13 @@ typedef struct OpenAPI_tai_s OpenAPI_tai_t; typedef struct OpenAPI_tai_s { struct OpenAPI_plmn_id_s *plmn_id; char *tac; + char *nid; } OpenAPI_tai_t; OpenAPI_tai_t *OpenAPI_tai_create( OpenAPI_plmn_id_t *plmn_id, - char *tac + char *tac, + char *nid ); void OpenAPI_tai_free(OpenAPI_tai_t *tai); OpenAPI_tai_t *OpenAPI_tai_parseFromJSON(cJSON *taiJSON); diff --git a/lib/sbi/openapi/model/tai_range.c b/lib/sbi/openapi/model/tai_range.c index 96a35ffd5f..75cc6df547 100644 --- a/lib/sbi/openapi/model/tai_range.c +++ b/lib/sbi/openapi/model/tai_range.c @@ -6,7 +6,8 @@ OpenAPI_tai_range_t *OpenAPI_tai_range_create( OpenAPI_plmn_id_t *plmn_id, - OpenAPI_list_t *tac_range_list + OpenAPI_list_t *tac_range_list, + char *nid ) { OpenAPI_tai_range_t *tai_range_local_var = OpenAPI_malloc(sizeof(OpenAPI_tai_range_t)); @@ -15,6 +16,7 @@ OpenAPI_tai_range_t *OpenAPI_tai_range_create( } tai_range_local_var->plmn_id = plmn_id; tai_range_local_var->tac_range_list = tac_range_list; + tai_range_local_var->nid = nid; return tai_range_local_var; } @@ -30,6 +32,7 @@ void OpenAPI_tai_range_free(OpenAPI_tai_range_t *tai_range) OpenAPI_tac_range_free(node->data); } OpenAPI_list_free(tai_range->tac_range_list); + ogs_free(tai_range->nid); ogs_free(tai_range); } @@ -80,6 +83,13 @@ cJSON *OpenAPI_tai_range_convertToJSON(OpenAPI_tai_range_t *tai_range) } } + if (tai_range->nid) { + if (cJSON_AddStringToObject(item, "nid", tai_range->nid) == NULL) { + ogs_error("OpenAPI_tai_range_convertToJSON() failed [nid]"); + goto end; + } + } + end: return item; } @@ -123,9 +133,19 @@ OpenAPI_tai_range_t *OpenAPI_tai_range_parseFromJSON(cJSON *tai_rangeJSON) OpenAPI_list_add(tac_range_listList, tac_range_listItem); } + cJSON *nid = cJSON_GetObjectItemCaseSensitive(tai_rangeJSON, "nid"); + + if (nid) { + if (!cJSON_IsString(nid)) { + ogs_error("OpenAPI_tai_range_parseFromJSON() failed [nid]"); + goto end; + } + } + tai_range_local_var = OpenAPI_tai_range_create ( plmn_id_local_nonprim, - tac_range_listList + tac_range_listList, + nid ? ogs_strdup(nid->valuestring) : NULL ); return tai_range_local_var; diff --git a/lib/sbi/openapi/model/tai_range.h b/lib/sbi/openapi/model/tai_range.h index 0aaf301c19..dc9dc4aea8 100644 --- a/lib/sbi/openapi/model/tai_range.h +++ b/lib/sbi/openapi/model/tai_range.h @@ -1,7 +1,7 @@ /* * tai_range.h * - * + * Range of TAIs (Tracking Area Identities) */ #ifndef _OpenAPI_tai_range_H_ @@ -23,11 +23,13 @@ typedef struct OpenAPI_tai_range_s OpenAPI_tai_range_t; typedef struct OpenAPI_tai_range_s { struct OpenAPI_plmn_id_s *plmn_id; OpenAPI_list_t *tac_range_list; + char *nid; } OpenAPI_tai_range_t; OpenAPI_tai_range_t *OpenAPI_tai_range_create( OpenAPI_plmn_id_t *plmn_id, - OpenAPI_list_t *tac_range_list + OpenAPI_list_t *tac_range_list, + char *nid ); void OpenAPI_tai_range_free(OpenAPI_tai_range_t *tai_range); OpenAPI_tai_range_t *OpenAPI_tai_range_parseFromJSON(cJSON *tai_rangeJSON); diff --git a/lib/sbi/openapi/model/temporal_validity.c b/lib/sbi/openapi/model/temporal_validity.c new file mode 100644 index 0000000000..4013da1e6a --- /dev/null +++ b/lib/sbi/openapi/model/temporal_validity.c @@ -0,0 +1,91 @@ + +#include +#include +#include +#include "temporal_validity.h" + +OpenAPI_temporal_validity_t *OpenAPI_temporal_validity_create( + char *start_time, + char *stop_time + ) +{ + OpenAPI_temporal_validity_t *temporal_validity_local_var = OpenAPI_malloc(sizeof(OpenAPI_temporal_validity_t)); + if (!temporal_validity_local_var) { + return NULL; + } + temporal_validity_local_var->start_time = start_time; + temporal_validity_local_var->stop_time = stop_time; + + return temporal_validity_local_var; +} + +void OpenAPI_temporal_validity_free(OpenAPI_temporal_validity_t *temporal_validity) +{ + if (NULL == temporal_validity) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(temporal_validity->start_time); + ogs_free(temporal_validity->stop_time); + ogs_free(temporal_validity); +} + +cJSON *OpenAPI_temporal_validity_convertToJSON(OpenAPI_temporal_validity_t *temporal_validity) +{ + cJSON *item = NULL; + + if (temporal_validity == NULL) { + ogs_error("OpenAPI_temporal_validity_convertToJSON() failed [TemporalValidity]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (temporal_validity->start_time) { + if (cJSON_AddStringToObject(item, "startTime", temporal_validity->start_time) == NULL) { + ogs_error("OpenAPI_temporal_validity_convertToJSON() failed [start_time]"); + goto end; + } + } + + if (temporal_validity->stop_time) { + if (cJSON_AddStringToObject(item, "stopTime", temporal_validity->stop_time) == NULL) { + ogs_error("OpenAPI_temporal_validity_convertToJSON() failed [stop_time]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_temporal_validity_t *OpenAPI_temporal_validity_parseFromJSON(cJSON *temporal_validityJSON) +{ + OpenAPI_temporal_validity_t *temporal_validity_local_var = NULL; + cJSON *start_time = cJSON_GetObjectItemCaseSensitive(temporal_validityJSON, "startTime"); + + if (start_time) { + if (!cJSON_IsString(start_time)) { + ogs_error("OpenAPI_temporal_validity_parseFromJSON() failed [start_time]"); + goto end; + } + } + + cJSON *stop_time = cJSON_GetObjectItemCaseSensitive(temporal_validityJSON, "stopTime"); + + if (stop_time) { + if (!cJSON_IsString(stop_time)) { + ogs_error("OpenAPI_temporal_validity_parseFromJSON() failed [stop_time]"); + goto end; + } + } + + temporal_validity_local_var = OpenAPI_temporal_validity_create ( + start_time ? ogs_strdup(start_time->valuestring) : NULL, + stop_time ? ogs_strdup(stop_time->valuestring) : NULL + ); + + return temporal_validity_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/temporal_validity.h b/lib/sbi/openapi/model/temporal_validity.h new file mode 100644 index 0000000000..3132788ae4 --- /dev/null +++ b/lib/sbi/openapi/model/temporal_validity.h @@ -0,0 +1,39 @@ +/* + * temporal_validity.h + * + * Indicates the time interval(s) during which the AF request is to be applied + */ + +#ifndef _OpenAPI_temporal_validity_H_ +#define _OpenAPI_temporal_validity_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_temporal_validity_s OpenAPI_temporal_validity_t; +typedef struct OpenAPI_temporal_validity_s { + char *start_time; + char *stop_time; +} OpenAPI_temporal_validity_t; + +OpenAPI_temporal_validity_t *OpenAPI_temporal_validity_create( + char *start_time, + char *stop_time + ); +void OpenAPI_temporal_validity_free(OpenAPI_temporal_validity_t *temporal_validity); +OpenAPI_temporal_validity_t *OpenAPI_temporal_validity_parseFromJSON(cJSON *temporal_validityJSON); +cJSON *OpenAPI_temporal_validity_convertToJSON(OpenAPI_temporal_validity_t *temporal_validity); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_temporal_validity_H_ */ + diff --git a/lib/sbi/openapi/model/time_period.c b/lib/sbi/openapi/model/time_period.c new file mode 100644 index 0000000000..6d9ada6a68 --- /dev/null +++ b/lib/sbi/openapi/model/time_period.c @@ -0,0 +1,99 @@ + +#include +#include +#include +#include "time_period.h" + +OpenAPI_time_period_t *OpenAPI_time_period_create( + OpenAPI_periodicity_t *period, + int max_num_period + ) +{ + OpenAPI_time_period_t *time_period_local_var = OpenAPI_malloc(sizeof(OpenAPI_time_period_t)); + if (!time_period_local_var) { + return NULL; + } + time_period_local_var->period = period; + time_period_local_var->max_num_period = max_num_period; + + return time_period_local_var; +} + +void OpenAPI_time_period_free(OpenAPI_time_period_t *time_period) +{ + if (NULL == time_period) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_periodicity_free(time_period->period); + ogs_free(time_period); +} + +cJSON *OpenAPI_time_period_convertToJSON(OpenAPI_time_period_t *time_period) +{ + cJSON *item = NULL; + + if (time_period == NULL) { + ogs_error("OpenAPI_time_period_convertToJSON() failed [TimePeriod]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!time_period->period) { + ogs_error("OpenAPI_time_period_convertToJSON() failed [period]"); + goto end; + } + cJSON *period_local_JSON = OpenAPI_periodicity_convertToJSON(time_period->period); + if (period_local_JSON == NULL) { + ogs_error("OpenAPI_time_period_convertToJSON() failed [period]"); + goto end; + } + cJSON_AddItemToObject(item, "period", period_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_time_period_convertToJSON() failed [period]"); + goto end; + } + + if (time_period->max_num_period) { + if (cJSON_AddNumberToObject(item, "maxNumPeriod", time_period->max_num_period) == NULL) { + ogs_error("OpenAPI_time_period_convertToJSON() failed [max_num_period]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_time_period_t *OpenAPI_time_period_parseFromJSON(cJSON *time_periodJSON) +{ + OpenAPI_time_period_t *time_period_local_var = NULL; + cJSON *period = cJSON_GetObjectItemCaseSensitive(time_periodJSON, "period"); + if (!period) { + ogs_error("OpenAPI_time_period_parseFromJSON() failed [period]"); + goto end; + } + + OpenAPI_periodicity_t *period_local_nonprim = NULL; + + period_local_nonprim = OpenAPI_periodicity_parseFromJSON(period); + + cJSON *max_num_period = cJSON_GetObjectItemCaseSensitive(time_periodJSON, "maxNumPeriod"); + + if (max_num_period) { + if (!cJSON_IsNumber(max_num_period)) { + ogs_error("OpenAPI_time_period_parseFromJSON() failed [max_num_period]"); + goto end; + } + } + + time_period_local_var = OpenAPI_time_period_create ( + period_local_nonprim, + max_num_period ? max_num_period->valuedouble : 0 + ); + + return time_period_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/time_period.h b/lib/sbi/openapi/model/time_period.h new file mode 100644 index 0000000000..590d9eddfb --- /dev/null +++ b/lib/sbi/openapi/model/time_period.h @@ -0,0 +1,40 @@ +/* + * time_period.h + * + * Contains the periodicity for the defined usage monitoring data limits. + */ + +#ifndef _OpenAPI_time_period_H_ +#define _OpenAPI_time_period_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "periodicity.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_time_period_s OpenAPI_time_period_t; +typedef struct OpenAPI_time_period_s { + struct OpenAPI_periodicity_s *period; + int max_num_period; +} OpenAPI_time_period_t; + +OpenAPI_time_period_t *OpenAPI_time_period_create( + OpenAPI_periodicity_t *period, + int max_num_period + ); +void OpenAPI_time_period_free(OpenAPI_time_period_t *time_period); +OpenAPI_time_period_t *OpenAPI_time_period_parseFromJSON(cJSON *time_periodJSON); +cJSON *OpenAPI_time_period_convertToJSON(OpenAPI_time_period_t *time_period); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_time_period_H_ */ + diff --git a/lib/sbi/openapi/model/time_window.c b/lib/sbi/openapi/model/time_window.c new file mode 100644 index 0000000000..ca975b71fb --- /dev/null +++ b/lib/sbi/openapi/model/time_window.c @@ -0,0 +1,101 @@ + +#include +#include +#include +#include "time_window.h" + +OpenAPI_time_window_t *OpenAPI_time_window_create( + char *start_time, + char *stop_time + ) +{ + OpenAPI_time_window_t *time_window_local_var = OpenAPI_malloc(sizeof(OpenAPI_time_window_t)); + if (!time_window_local_var) { + return NULL; + } + time_window_local_var->start_time = start_time; + time_window_local_var->stop_time = stop_time; + + return time_window_local_var; +} + +void OpenAPI_time_window_free(OpenAPI_time_window_t *time_window) +{ + if (NULL == time_window) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(time_window->start_time); + ogs_free(time_window->stop_time); + ogs_free(time_window); +} + +cJSON *OpenAPI_time_window_convertToJSON(OpenAPI_time_window_t *time_window) +{ + cJSON *item = NULL; + + if (time_window == NULL) { + ogs_error("OpenAPI_time_window_convertToJSON() failed [TimeWindow]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!time_window->start_time) { + ogs_error("OpenAPI_time_window_convertToJSON() failed [start_time]"); + goto end; + } + if (cJSON_AddStringToObject(item, "startTime", time_window->start_time) == NULL) { + ogs_error("OpenAPI_time_window_convertToJSON() failed [start_time]"); + goto end; + } + + if (!time_window->stop_time) { + ogs_error("OpenAPI_time_window_convertToJSON() failed [stop_time]"); + goto end; + } + if (cJSON_AddStringToObject(item, "stopTime", time_window->stop_time) == NULL) { + ogs_error("OpenAPI_time_window_convertToJSON() failed [stop_time]"); + goto end; + } + +end: + return item; +} + +OpenAPI_time_window_t *OpenAPI_time_window_parseFromJSON(cJSON *time_windowJSON) +{ + OpenAPI_time_window_t *time_window_local_var = NULL; + cJSON *start_time = cJSON_GetObjectItemCaseSensitive(time_windowJSON, "startTime"); + if (!start_time) { + ogs_error("OpenAPI_time_window_parseFromJSON() failed [start_time]"); + goto end; + } + + + if (!cJSON_IsString(start_time)) { + ogs_error("OpenAPI_time_window_parseFromJSON() failed [start_time]"); + goto end; + } + + cJSON *stop_time = cJSON_GetObjectItemCaseSensitive(time_windowJSON, "stopTime"); + if (!stop_time) { + ogs_error("OpenAPI_time_window_parseFromJSON() failed [stop_time]"); + goto end; + } + + + if (!cJSON_IsString(stop_time)) { + ogs_error("OpenAPI_time_window_parseFromJSON() failed [stop_time]"); + goto end; + } + + time_window_local_var = OpenAPI_time_window_create ( + ogs_strdup(start_time->valuestring), + ogs_strdup(stop_time->valuestring) + ); + + return time_window_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/time_window.h b/lib/sbi/openapi/model/time_window.h new file mode 100644 index 0000000000..f71f32e2c5 --- /dev/null +++ b/lib/sbi/openapi/model/time_window.h @@ -0,0 +1,39 @@ +/* + * time_window.h + * + * + */ + +#ifndef _OpenAPI_time_window_H_ +#define _OpenAPI_time_window_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_time_window_s OpenAPI_time_window_t; +typedef struct OpenAPI_time_window_s { + char *start_time; + char *stop_time; +} OpenAPI_time_window_t; + +OpenAPI_time_window_t *OpenAPI_time_window_create( + char *start_time, + char *stop_time + ); +void OpenAPI_time_window_free(OpenAPI_time_window_t *time_window); +OpenAPI_time_window_t *OpenAPI_time_window_parseFromJSON(cJSON *time_windowJSON); +cJSON *OpenAPI_time_window_convertToJSON(OpenAPI_time_window_t *time_window); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_time_window_H_ */ + diff --git a/lib/sbi/openapi/model/tmbr.c b/lib/sbi/openapi/model/tmbr.c new file mode 100644 index 0000000000..7a235bc09e --- /dev/null +++ b/lib/sbi/openapi/model/tmbr.c @@ -0,0 +1,101 @@ + +#include +#include +#include +#include "tmbr.h" + +OpenAPI_tmbr_t *OpenAPI_tmbr_create( + char *uplink, + char *downlink + ) +{ + OpenAPI_tmbr_t *tmbr_local_var = OpenAPI_malloc(sizeof(OpenAPI_tmbr_t)); + if (!tmbr_local_var) { + return NULL; + } + tmbr_local_var->uplink = uplink; + tmbr_local_var->downlink = downlink; + + return tmbr_local_var; +} + +void OpenAPI_tmbr_free(OpenAPI_tmbr_t *tmbr) +{ + if (NULL == tmbr) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(tmbr->uplink); + ogs_free(tmbr->downlink); + ogs_free(tmbr); +} + +cJSON *OpenAPI_tmbr_convertToJSON(OpenAPI_tmbr_t *tmbr) +{ + cJSON *item = NULL; + + if (tmbr == NULL) { + ogs_error("OpenAPI_tmbr_convertToJSON() failed [Tmbr]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!tmbr->uplink) { + ogs_error("OpenAPI_tmbr_convertToJSON() failed [uplink]"); + goto end; + } + if (cJSON_AddStringToObject(item, "uplink", tmbr->uplink) == NULL) { + ogs_error("OpenAPI_tmbr_convertToJSON() failed [uplink]"); + goto end; + } + + if (!tmbr->downlink) { + ogs_error("OpenAPI_tmbr_convertToJSON() failed [downlink]"); + goto end; + } + if (cJSON_AddStringToObject(item, "downlink", tmbr->downlink) == NULL) { + ogs_error("OpenAPI_tmbr_convertToJSON() failed [downlink]"); + goto end; + } + +end: + return item; +} + +OpenAPI_tmbr_t *OpenAPI_tmbr_parseFromJSON(cJSON *tmbrJSON) +{ + OpenAPI_tmbr_t *tmbr_local_var = NULL; + cJSON *uplink = cJSON_GetObjectItemCaseSensitive(tmbrJSON, "uplink"); + if (!uplink) { + ogs_error("OpenAPI_tmbr_parseFromJSON() failed [uplink]"); + goto end; + } + + + if (!cJSON_IsString(uplink)) { + ogs_error("OpenAPI_tmbr_parseFromJSON() failed [uplink]"); + goto end; + } + + cJSON *downlink = cJSON_GetObjectItemCaseSensitive(tmbrJSON, "downlink"); + if (!downlink) { + ogs_error("OpenAPI_tmbr_parseFromJSON() failed [downlink]"); + goto end; + } + + + if (!cJSON_IsString(downlink)) { + ogs_error("OpenAPI_tmbr_parseFromJSON() failed [downlink]"); + goto end; + } + + tmbr_local_var = OpenAPI_tmbr_create ( + ogs_strdup(uplink->valuestring), + ogs_strdup(downlink->valuestring) + ); + + return tmbr_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/tmbr.h b/lib/sbi/openapi/model/tmbr.h new file mode 100644 index 0000000000..8e272502f3 --- /dev/null +++ b/lib/sbi/openapi/model/tmbr.h @@ -0,0 +1,39 @@ +/* + * tmbr.h + * + * + */ + +#ifndef _OpenAPI_tmbr_H_ +#define _OpenAPI_tmbr_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_tmbr_s OpenAPI_tmbr_t; +typedef struct OpenAPI_tmbr_s { + char *uplink; + char *downlink; +} OpenAPI_tmbr_t; + +OpenAPI_tmbr_t *OpenAPI_tmbr_create( + char *uplink, + char *downlink + ); +void OpenAPI_tmbr_free(OpenAPI_tmbr_t *tmbr); +OpenAPI_tmbr_t *OpenAPI_tmbr_parseFromJSON(cJSON *tmbrJSON); +cJSON *OpenAPI_tmbr_convertToJSON(OpenAPI_tmbr_t *tmbr); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_tmbr_H_ */ + diff --git a/lib/sbi/openapi/model/tngf_info.c b/lib/sbi/openapi/model/tngf_info.c new file mode 100644 index 0000000000..b4f95c75d9 --- /dev/null +++ b/lib/sbi/openapi/model/tngf_info.c @@ -0,0 +1,157 @@ + +#include +#include +#include +#include "tngf_info.h" + +OpenAPI_tngf_info_t *OpenAPI_tngf_info_create( + OpenAPI_list_t *ipv4_endpoint_addresses, + OpenAPI_list_t *ipv6_endpoint_addresses, + char *endpoint_fqdn + ) +{ + OpenAPI_tngf_info_t *tngf_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_tngf_info_t)); + if (!tngf_info_local_var) { + return NULL; + } + tngf_info_local_var->ipv4_endpoint_addresses = ipv4_endpoint_addresses; + tngf_info_local_var->ipv6_endpoint_addresses = ipv6_endpoint_addresses; + tngf_info_local_var->endpoint_fqdn = endpoint_fqdn; + + return tngf_info_local_var; +} + +void OpenAPI_tngf_info_free(OpenAPI_tngf_info_t *tngf_info) +{ + if (NULL == tngf_info) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(tngf_info->ipv4_endpoint_addresses, node) { + ogs_free(node->data); + } + OpenAPI_list_free(tngf_info->ipv4_endpoint_addresses); + OpenAPI_list_for_each(tngf_info->ipv6_endpoint_addresses, node) { + ogs_free(node->data); + } + OpenAPI_list_free(tngf_info->ipv6_endpoint_addresses); + ogs_free(tngf_info->endpoint_fqdn); + ogs_free(tngf_info); +} + +cJSON *OpenAPI_tngf_info_convertToJSON(OpenAPI_tngf_info_t *tngf_info) +{ + cJSON *item = NULL; + + if (tngf_info == NULL) { + ogs_error("OpenAPI_tngf_info_convertToJSON() failed [TngfInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (tngf_info->ipv4_endpoint_addresses) { + cJSON *ipv4_endpoint_addresses = cJSON_AddArrayToObject(item, "ipv4EndpointAddresses"); + if (ipv4_endpoint_addresses == NULL) { + ogs_error("OpenAPI_tngf_info_convertToJSON() failed [ipv4_endpoint_addresses]"); + goto end; + } + + OpenAPI_lnode_t *ipv4_endpoint_addresses_node; + OpenAPI_list_for_each(tngf_info->ipv4_endpoint_addresses, ipv4_endpoint_addresses_node) { + if (cJSON_AddStringToObject(ipv4_endpoint_addresses, "", (char*)ipv4_endpoint_addresses_node->data) == NULL) { + ogs_error("OpenAPI_tngf_info_convertToJSON() failed [ipv4_endpoint_addresses]"); + goto end; + } + } + } + + if (tngf_info->ipv6_endpoint_addresses) { + cJSON *ipv6_endpoint_addresses = cJSON_AddArrayToObject(item, "ipv6EndpointAddresses"); + if (ipv6_endpoint_addresses == NULL) { + ogs_error("OpenAPI_tngf_info_convertToJSON() failed [ipv6_endpoint_addresses]"); + goto end; + } + + OpenAPI_lnode_t *ipv6_endpoint_addresses_node; + OpenAPI_list_for_each(tngf_info->ipv6_endpoint_addresses, ipv6_endpoint_addresses_node) { + if (cJSON_AddStringToObject(ipv6_endpoint_addresses, "", (char*)ipv6_endpoint_addresses_node->data) == NULL) { + ogs_error("OpenAPI_tngf_info_convertToJSON() failed [ipv6_endpoint_addresses]"); + goto end; + } + } + } + + if (tngf_info->endpoint_fqdn) { + if (cJSON_AddStringToObject(item, "endpointFqdn", tngf_info->endpoint_fqdn) == NULL) { + ogs_error("OpenAPI_tngf_info_convertToJSON() failed [endpoint_fqdn]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_tngf_info_t *OpenAPI_tngf_info_parseFromJSON(cJSON *tngf_infoJSON) +{ + OpenAPI_tngf_info_t *tngf_info_local_var = NULL; + cJSON *ipv4_endpoint_addresses = cJSON_GetObjectItemCaseSensitive(tngf_infoJSON, "ipv4EndpointAddresses"); + + OpenAPI_list_t *ipv4_endpoint_addressesList; + if (ipv4_endpoint_addresses) { + cJSON *ipv4_endpoint_addresses_local; + if (!cJSON_IsArray(ipv4_endpoint_addresses)) { + ogs_error("OpenAPI_tngf_info_parseFromJSON() failed [ipv4_endpoint_addresses]"); + goto end; + } + ipv4_endpoint_addressesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv4_endpoint_addresses_local, ipv4_endpoint_addresses) { + if (!cJSON_IsString(ipv4_endpoint_addresses_local)) { + ogs_error("OpenAPI_tngf_info_parseFromJSON() failed [ipv4_endpoint_addresses]"); + goto end; + } + OpenAPI_list_add(ipv4_endpoint_addressesList, ogs_strdup(ipv4_endpoint_addresses_local->valuestring)); + } + } + + cJSON *ipv6_endpoint_addresses = cJSON_GetObjectItemCaseSensitive(tngf_infoJSON, "ipv6EndpointAddresses"); + + OpenAPI_list_t *ipv6_endpoint_addressesList; + if (ipv6_endpoint_addresses) { + cJSON *ipv6_endpoint_addresses_local; + if (!cJSON_IsArray(ipv6_endpoint_addresses)) { + ogs_error("OpenAPI_tngf_info_parseFromJSON() failed [ipv6_endpoint_addresses]"); + goto end; + } + ipv6_endpoint_addressesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv6_endpoint_addresses_local, ipv6_endpoint_addresses) { + if (!cJSON_IsString(ipv6_endpoint_addresses_local)) { + ogs_error("OpenAPI_tngf_info_parseFromJSON() failed [ipv6_endpoint_addresses]"); + goto end; + } + OpenAPI_list_add(ipv6_endpoint_addressesList, ogs_strdup(ipv6_endpoint_addresses_local->valuestring)); + } + } + + cJSON *endpoint_fqdn = cJSON_GetObjectItemCaseSensitive(tngf_infoJSON, "endpointFqdn"); + + if (endpoint_fqdn) { + if (!cJSON_IsString(endpoint_fqdn)) { + ogs_error("OpenAPI_tngf_info_parseFromJSON() failed [endpoint_fqdn]"); + goto end; + } + } + + tngf_info_local_var = OpenAPI_tngf_info_create ( + ipv4_endpoint_addresses ? ipv4_endpoint_addressesList : NULL, + ipv6_endpoint_addresses ? ipv6_endpoint_addressesList : NULL, + endpoint_fqdn ? ogs_strdup(endpoint_fqdn->valuestring) : NULL + ); + + return tngf_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/tngf_info.h b/lib/sbi/openapi/model/tngf_info.h new file mode 100644 index 0000000000..080201a449 --- /dev/null +++ b/lib/sbi/openapi/model/tngf_info.h @@ -0,0 +1,41 @@ +/* + * tngf_info.h + * + * Infomation of the TNGF endpoints + */ + +#ifndef _OpenAPI_tngf_info_H_ +#define _OpenAPI_tngf_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_tngf_info_s OpenAPI_tngf_info_t; +typedef struct OpenAPI_tngf_info_s { + OpenAPI_list_t *ipv4_endpoint_addresses; + OpenAPI_list_t *ipv6_endpoint_addresses; + char *endpoint_fqdn; +} OpenAPI_tngf_info_t; + +OpenAPI_tngf_info_t *OpenAPI_tngf_info_create( + OpenAPI_list_t *ipv4_endpoint_addresses, + OpenAPI_list_t *ipv6_endpoint_addresses, + char *endpoint_fqdn + ); +void OpenAPI_tngf_info_free(OpenAPI_tngf_info_t *tngf_info); +OpenAPI_tngf_info_t *OpenAPI_tngf_info_parseFromJSON(cJSON *tngf_infoJSON); +cJSON *OpenAPI_tngf_info_convertToJSON(OpenAPI_tngf_info_t *tngf_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_tngf_info_H_ */ + diff --git a/lib/sbi/openapi/model/trace_data.c b/lib/sbi/openapi/model/trace_data.c new file mode 100644 index 0000000000..dbdd1a6f7a --- /dev/null +++ b/lib/sbi/openapi/model/trace_data.c @@ -0,0 +1,215 @@ + +#include +#include +#include +#include "trace_data.h" + +OpenAPI_trace_data_t *OpenAPI_trace_data_create( + char *trace_ref, + OpenAPI_trace_depth_t *trace_depth, + char *ne_type_list, + char *event_list, + char *collection_entity_ipv4_addr, + char *collection_entity_ipv6_addr, + char *interface_list + ) +{ + OpenAPI_trace_data_t *trace_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_trace_data_t)); + if (!trace_data_local_var) { + return NULL; + } + trace_data_local_var->trace_ref = trace_ref; + trace_data_local_var->trace_depth = trace_depth; + trace_data_local_var->ne_type_list = ne_type_list; + trace_data_local_var->event_list = event_list; + trace_data_local_var->collection_entity_ipv4_addr = collection_entity_ipv4_addr; + trace_data_local_var->collection_entity_ipv6_addr = collection_entity_ipv6_addr; + trace_data_local_var->interface_list = interface_list; + + return trace_data_local_var; +} + +void OpenAPI_trace_data_free(OpenAPI_trace_data_t *trace_data) +{ + if (NULL == trace_data) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(trace_data->trace_ref); + OpenAPI_trace_depth_free(trace_data->trace_depth); + ogs_free(trace_data->ne_type_list); + ogs_free(trace_data->event_list); + ogs_free(trace_data->collection_entity_ipv4_addr); + ogs_free(trace_data->collection_entity_ipv6_addr); + ogs_free(trace_data->interface_list); + ogs_free(trace_data); +} + +cJSON *OpenAPI_trace_data_convertToJSON(OpenAPI_trace_data_t *trace_data) +{ + cJSON *item = NULL; + + if (trace_data == NULL) { + ogs_error("OpenAPI_trace_data_convertToJSON() failed [TraceData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!trace_data->trace_ref) { + ogs_error("OpenAPI_trace_data_convertToJSON() failed [trace_ref]"); + goto end; + } + if (cJSON_AddStringToObject(item, "traceRef", trace_data->trace_ref) == NULL) { + ogs_error("OpenAPI_trace_data_convertToJSON() failed [trace_ref]"); + goto end; + } + + if (!trace_data->trace_depth) { + ogs_error("OpenAPI_trace_data_convertToJSON() failed [trace_depth]"); + goto end; + } + cJSON *trace_depth_local_JSON = OpenAPI_trace_depth_convertToJSON(trace_data->trace_depth); + if (trace_depth_local_JSON == NULL) { + ogs_error("OpenAPI_trace_data_convertToJSON() failed [trace_depth]"); + goto end; + } + cJSON_AddItemToObject(item, "traceDepth", trace_depth_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_trace_data_convertToJSON() failed [trace_depth]"); + goto end; + } + + if (!trace_data->ne_type_list) { + ogs_error("OpenAPI_trace_data_convertToJSON() failed [ne_type_list]"); + goto end; + } + if (cJSON_AddStringToObject(item, "neTypeList", trace_data->ne_type_list) == NULL) { + ogs_error("OpenAPI_trace_data_convertToJSON() failed [ne_type_list]"); + goto end; + } + + if (!trace_data->event_list) { + ogs_error("OpenAPI_trace_data_convertToJSON() failed [event_list]"); + goto end; + } + if (cJSON_AddStringToObject(item, "eventList", trace_data->event_list) == NULL) { + ogs_error("OpenAPI_trace_data_convertToJSON() failed [event_list]"); + goto end; + } + + if (trace_data->collection_entity_ipv4_addr) { + if (cJSON_AddStringToObject(item, "collectionEntityIpv4Addr", trace_data->collection_entity_ipv4_addr) == NULL) { + ogs_error("OpenAPI_trace_data_convertToJSON() failed [collection_entity_ipv4_addr]"); + goto end; + } + } + + if (trace_data->collection_entity_ipv6_addr) { + if (cJSON_AddStringToObject(item, "collectionEntityIpv6Addr", trace_data->collection_entity_ipv6_addr) == NULL) { + ogs_error("OpenAPI_trace_data_convertToJSON() failed [collection_entity_ipv6_addr]"); + goto end; + } + } + + if (trace_data->interface_list) { + if (cJSON_AddStringToObject(item, "interfaceList", trace_data->interface_list) == NULL) { + ogs_error("OpenAPI_trace_data_convertToJSON() failed [interface_list]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_trace_data_t *OpenAPI_trace_data_parseFromJSON(cJSON *trace_dataJSON) +{ + OpenAPI_trace_data_t *trace_data_local_var = NULL; + cJSON *trace_ref = cJSON_GetObjectItemCaseSensitive(trace_dataJSON, "traceRef"); + if (!trace_ref) { + ogs_error("OpenAPI_trace_data_parseFromJSON() failed [trace_ref]"); + goto end; + } + + + if (!cJSON_IsString(trace_ref)) { + ogs_error("OpenAPI_trace_data_parseFromJSON() failed [trace_ref]"); + goto end; + } + + cJSON *trace_depth = cJSON_GetObjectItemCaseSensitive(trace_dataJSON, "traceDepth"); + if (!trace_depth) { + ogs_error("OpenAPI_trace_data_parseFromJSON() failed [trace_depth]"); + goto end; + } + + OpenAPI_trace_depth_t *trace_depth_local_nonprim = NULL; + + trace_depth_local_nonprim = OpenAPI_trace_depth_parseFromJSON(trace_depth); + + cJSON *ne_type_list = cJSON_GetObjectItemCaseSensitive(trace_dataJSON, "neTypeList"); + if (!ne_type_list) { + ogs_error("OpenAPI_trace_data_parseFromJSON() failed [ne_type_list]"); + goto end; + } + + + if (!cJSON_IsString(ne_type_list)) { + ogs_error("OpenAPI_trace_data_parseFromJSON() failed [ne_type_list]"); + goto end; + } + + cJSON *event_list = cJSON_GetObjectItemCaseSensitive(trace_dataJSON, "eventList"); + if (!event_list) { + ogs_error("OpenAPI_trace_data_parseFromJSON() failed [event_list]"); + goto end; + } + + + if (!cJSON_IsString(event_list)) { + ogs_error("OpenAPI_trace_data_parseFromJSON() failed [event_list]"); + goto end; + } + + cJSON *collection_entity_ipv4_addr = cJSON_GetObjectItemCaseSensitive(trace_dataJSON, "collectionEntityIpv4Addr"); + + if (collection_entity_ipv4_addr) { + if (!cJSON_IsString(collection_entity_ipv4_addr)) { + ogs_error("OpenAPI_trace_data_parseFromJSON() failed [collection_entity_ipv4_addr]"); + goto end; + } + } + + cJSON *collection_entity_ipv6_addr = cJSON_GetObjectItemCaseSensitive(trace_dataJSON, "collectionEntityIpv6Addr"); + + if (collection_entity_ipv6_addr) { + if (!cJSON_IsString(collection_entity_ipv6_addr)) { + ogs_error("OpenAPI_trace_data_parseFromJSON() failed [collection_entity_ipv6_addr]"); + goto end; + } + } + + cJSON *interface_list = cJSON_GetObjectItemCaseSensitive(trace_dataJSON, "interfaceList"); + + if (interface_list) { + if (!cJSON_IsString(interface_list)) { + ogs_error("OpenAPI_trace_data_parseFromJSON() failed [interface_list]"); + goto end; + } + } + + trace_data_local_var = OpenAPI_trace_data_create ( + ogs_strdup(trace_ref->valuestring), + trace_depth_local_nonprim, + ogs_strdup(ne_type_list->valuestring), + ogs_strdup(event_list->valuestring), + collection_entity_ipv4_addr ? ogs_strdup(collection_entity_ipv4_addr->valuestring) : NULL, + collection_entity_ipv6_addr ? ogs_strdup(collection_entity_ipv6_addr->valuestring) : NULL, + interface_list ? ogs_strdup(interface_list->valuestring) : NULL + ); + + return trace_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/trace_data.h b/lib/sbi/openapi/model/trace_data.h new file mode 100644 index 0000000000..caab892972 --- /dev/null +++ b/lib/sbi/openapi/model/trace_data.h @@ -0,0 +1,50 @@ +/* + * trace_data.h + * + * + */ + +#ifndef _OpenAPI_trace_data_H_ +#define _OpenAPI_trace_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "trace_depth.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_trace_data_s OpenAPI_trace_data_t; +typedef struct OpenAPI_trace_data_s { + char *trace_ref; + struct OpenAPI_trace_depth_s *trace_depth; + char *ne_type_list; + char *event_list; + char *collection_entity_ipv4_addr; + char *collection_entity_ipv6_addr; + char *interface_list; +} OpenAPI_trace_data_t; + +OpenAPI_trace_data_t *OpenAPI_trace_data_create( + char *trace_ref, + OpenAPI_trace_depth_t *trace_depth, + char *ne_type_list, + char *event_list, + char *collection_entity_ipv4_addr, + char *collection_entity_ipv6_addr, + char *interface_list + ); +void OpenAPI_trace_data_free(OpenAPI_trace_data_t *trace_data); +OpenAPI_trace_data_t *OpenAPI_trace_data_parseFromJSON(cJSON *trace_dataJSON); +cJSON *OpenAPI_trace_data_convertToJSON(OpenAPI_trace_data_t *trace_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_trace_data_H_ */ + diff --git a/lib/sbi/openapi/model/trace_data_response.c b/lib/sbi/openapi/model/trace_data_response.c new file mode 100644 index 0000000000..57430336d6 --- /dev/null +++ b/lib/sbi/openapi/model/trace_data_response.c @@ -0,0 +1,95 @@ + +#include +#include +#include +#include "trace_data_response.h" + +OpenAPI_trace_data_response_t *OpenAPI_trace_data_response_create( + OpenAPI_trace_data_t *trace_data, + char *shared_trace_data_id + ) +{ + OpenAPI_trace_data_response_t *trace_data_response_local_var = OpenAPI_malloc(sizeof(OpenAPI_trace_data_response_t)); + if (!trace_data_response_local_var) { + return NULL; + } + trace_data_response_local_var->trace_data = trace_data; + trace_data_response_local_var->shared_trace_data_id = shared_trace_data_id; + + return trace_data_response_local_var; +} + +void OpenAPI_trace_data_response_free(OpenAPI_trace_data_response_t *trace_data_response) +{ + if (NULL == trace_data_response) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_trace_data_free(trace_data_response->trace_data); + ogs_free(trace_data_response->shared_trace_data_id); + ogs_free(trace_data_response); +} + +cJSON *OpenAPI_trace_data_response_convertToJSON(OpenAPI_trace_data_response_t *trace_data_response) +{ + cJSON *item = NULL; + + if (trace_data_response == NULL) { + ogs_error("OpenAPI_trace_data_response_convertToJSON() failed [TraceDataResponse]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (trace_data_response->trace_data) { + cJSON *trace_data_local_JSON = OpenAPI_trace_data_convertToJSON(trace_data_response->trace_data); + if (trace_data_local_JSON == NULL) { + ogs_error("OpenAPI_trace_data_response_convertToJSON() failed [trace_data]"); + goto end; + } + cJSON_AddItemToObject(item, "traceData", trace_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_trace_data_response_convertToJSON() failed [trace_data]"); + goto end; + } + } + + if (trace_data_response->shared_trace_data_id) { + if (cJSON_AddStringToObject(item, "sharedTraceDataId", trace_data_response->shared_trace_data_id) == NULL) { + ogs_error("OpenAPI_trace_data_response_convertToJSON() failed [shared_trace_data_id]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_trace_data_response_t *OpenAPI_trace_data_response_parseFromJSON(cJSON *trace_data_responseJSON) +{ + OpenAPI_trace_data_response_t *trace_data_response_local_var = NULL; + cJSON *trace_data = cJSON_GetObjectItemCaseSensitive(trace_data_responseJSON, "traceData"); + + OpenAPI_trace_data_t *trace_data_local_nonprim = NULL; + if (trace_data) { + trace_data_local_nonprim = OpenAPI_trace_data_parseFromJSON(trace_data); + } + + cJSON *shared_trace_data_id = cJSON_GetObjectItemCaseSensitive(trace_data_responseJSON, "sharedTraceDataId"); + + if (shared_trace_data_id) { + if (!cJSON_IsString(shared_trace_data_id)) { + ogs_error("OpenAPI_trace_data_response_parseFromJSON() failed [shared_trace_data_id]"); + goto end; + } + } + + trace_data_response_local_var = OpenAPI_trace_data_response_create ( + trace_data ? trace_data_local_nonprim : NULL, + shared_trace_data_id ? ogs_strdup(shared_trace_data_id->valuestring) : NULL + ); + + return trace_data_response_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/trace_data_response.h b/lib/sbi/openapi/model/trace_data_response.h new file mode 100644 index 0000000000..c53b8918ef --- /dev/null +++ b/lib/sbi/openapi/model/trace_data_response.h @@ -0,0 +1,40 @@ +/* + * trace_data_response.h + * + * + */ + +#ifndef _OpenAPI_trace_data_response_H_ +#define _OpenAPI_trace_data_response_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "trace_data.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_trace_data_response_s OpenAPI_trace_data_response_t; +typedef struct OpenAPI_trace_data_response_s { + struct OpenAPI_trace_data_s *trace_data; + char *shared_trace_data_id; +} OpenAPI_trace_data_response_t; + +OpenAPI_trace_data_response_t *OpenAPI_trace_data_response_create( + OpenAPI_trace_data_t *trace_data, + char *shared_trace_data_id + ); +void OpenAPI_trace_data_response_free(OpenAPI_trace_data_response_t *trace_data_response); +OpenAPI_trace_data_response_t *OpenAPI_trace_data_response_parseFromJSON(cJSON *trace_data_responseJSON); +cJSON *OpenAPI_trace_data_response_convertToJSON(OpenAPI_trace_data_response_t *trace_data_response); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_trace_data_response_H_ */ + diff --git a/lib/sbi/openapi/model/trace_depth.c b/lib/sbi/openapi/model/trace_depth.c new file mode 100644 index 0000000000..d9eaaf8424 --- /dev/null +++ b/lib/sbi/openapi/model/trace_depth.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "trace_depth.h" + +OpenAPI_trace_depth_t *OpenAPI_trace_depth_create( + ) +{ + OpenAPI_trace_depth_t *trace_depth_local_var = OpenAPI_malloc(sizeof(OpenAPI_trace_depth_t)); + if (!trace_depth_local_var) { + return NULL; + } + + return trace_depth_local_var; +} + +void OpenAPI_trace_depth_free(OpenAPI_trace_depth_t *trace_depth) +{ + if (NULL == trace_depth) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(trace_depth); +} + +cJSON *OpenAPI_trace_depth_convertToJSON(OpenAPI_trace_depth_t *trace_depth) +{ + cJSON *item = NULL; + + if (trace_depth == NULL) { + ogs_error("OpenAPI_trace_depth_convertToJSON() failed [TraceDepth]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_trace_depth_t *OpenAPI_trace_depth_parseFromJSON(cJSON *trace_depthJSON) +{ + OpenAPI_trace_depth_t *trace_depth_local_var = NULL; + trace_depth_local_var = OpenAPI_trace_depth_create ( + ); + + return trace_depth_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/trace_depth.h b/lib/sbi/openapi/model/trace_depth.h new file mode 100644 index 0000000000..f35bf5d29e --- /dev/null +++ b/lib/sbi/openapi/model/trace_depth.h @@ -0,0 +1,35 @@ +/* + * trace_depth.h + * + * + */ + +#ifndef _OpenAPI_trace_depth_H_ +#define _OpenAPI_trace_depth_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_trace_depth_s OpenAPI_trace_depth_t; +typedef struct OpenAPI_trace_depth_s { +} OpenAPI_trace_depth_t; + +OpenAPI_trace_depth_t *OpenAPI_trace_depth_create( + ); +void OpenAPI_trace_depth_free(OpenAPI_trace_depth_t *trace_depth); +OpenAPI_trace_depth_t *OpenAPI_trace_depth_parseFromJSON(cJSON *trace_depthJSON); +cJSON *OpenAPI_trace_depth_convertToJSON(OpenAPI_trace_depth_t *trace_depth); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_trace_depth_H_ */ + diff --git a/lib/sbi/openapi/model/traffic_influ_data.c b/lib/sbi/openapi/model/traffic_influ_data.c new file mode 100644 index 0000000000..53f602688a --- /dev/null +++ b/lib/sbi/openapi/model/traffic_influ_data.c @@ -0,0 +1,629 @@ + +#include +#include +#include +#include "traffic_influ_data.h" + +OpenAPI_traffic_influ_data_t *OpenAPI_traffic_influ_data_create( + char *up_path_chg_notif_corre_id, + int app_relo_ind, + char *af_app_id, + char *dnn, + OpenAPI_list_t *eth_traffic_filters, + OpenAPI_snssai_t *snssai, + char *inter_group_id, + char *supi, + OpenAPI_list_t *traffic_filters, + OpenAPI_list_t *traffic_routes, + int traff_corre_ind, + char *valid_start_time, + char *valid_end_time, + OpenAPI_list_t *temp_validities, + OpenAPI_network_area_info_2_t *nw_area_info, + char *up_path_chg_notif_uri, + OpenAPI_list_t *subscribed_events, + OpenAPI_dnai_change_type_t *dnai_chg_type, + int af_ack_ind, + int addr_preser_ind, + char *supported_features + ) +{ + OpenAPI_traffic_influ_data_t *traffic_influ_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_traffic_influ_data_t)); + if (!traffic_influ_data_local_var) { + return NULL; + } + traffic_influ_data_local_var->up_path_chg_notif_corre_id = up_path_chg_notif_corre_id; + traffic_influ_data_local_var->app_relo_ind = app_relo_ind; + traffic_influ_data_local_var->af_app_id = af_app_id; + traffic_influ_data_local_var->dnn = dnn; + traffic_influ_data_local_var->eth_traffic_filters = eth_traffic_filters; + traffic_influ_data_local_var->snssai = snssai; + traffic_influ_data_local_var->inter_group_id = inter_group_id; + traffic_influ_data_local_var->supi = supi; + traffic_influ_data_local_var->traffic_filters = traffic_filters; + traffic_influ_data_local_var->traffic_routes = traffic_routes; + traffic_influ_data_local_var->traff_corre_ind = traff_corre_ind; + traffic_influ_data_local_var->valid_start_time = valid_start_time; + traffic_influ_data_local_var->valid_end_time = valid_end_time; + traffic_influ_data_local_var->temp_validities = temp_validities; + traffic_influ_data_local_var->nw_area_info = nw_area_info; + traffic_influ_data_local_var->up_path_chg_notif_uri = up_path_chg_notif_uri; + traffic_influ_data_local_var->subscribed_events = subscribed_events; + traffic_influ_data_local_var->dnai_chg_type = dnai_chg_type; + traffic_influ_data_local_var->af_ack_ind = af_ack_ind; + traffic_influ_data_local_var->addr_preser_ind = addr_preser_ind; + traffic_influ_data_local_var->supported_features = supported_features; + + return traffic_influ_data_local_var; +} + +void OpenAPI_traffic_influ_data_free(OpenAPI_traffic_influ_data_t *traffic_influ_data) +{ + if (NULL == traffic_influ_data) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(traffic_influ_data->up_path_chg_notif_corre_id); + ogs_free(traffic_influ_data->af_app_id); + ogs_free(traffic_influ_data->dnn); + OpenAPI_list_for_each(traffic_influ_data->eth_traffic_filters, node) { + OpenAPI_eth_flow_description_free(node->data); + } + OpenAPI_list_free(traffic_influ_data->eth_traffic_filters); + OpenAPI_snssai_free(traffic_influ_data->snssai); + ogs_free(traffic_influ_data->inter_group_id); + ogs_free(traffic_influ_data->supi); + OpenAPI_list_for_each(traffic_influ_data->traffic_filters, node) { + OpenAPI_flow_info_free(node->data); + } + OpenAPI_list_free(traffic_influ_data->traffic_filters); + OpenAPI_list_for_each(traffic_influ_data->traffic_routes, node) { + OpenAPI_route_to_location_free(node->data); + } + OpenAPI_list_free(traffic_influ_data->traffic_routes); + ogs_free(traffic_influ_data->valid_start_time); + ogs_free(traffic_influ_data->valid_end_time); + OpenAPI_list_for_each(traffic_influ_data->temp_validities, node) { + OpenAPI_temporal_validity_free(node->data); + } + OpenAPI_list_free(traffic_influ_data->temp_validities); + OpenAPI_network_area_info_2_free(traffic_influ_data->nw_area_info); + ogs_free(traffic_influ_data->up_path_chg_notif_uri); + OpenAPI_list_for_each(traffic_influ_data->subscribed_events, node) { + OpenAPI_subscribed_event_free(node->data); + } + OpenAPI_list_free(traffic_influ_data->subscribed_events); + OpenAPI_dnai_change_type_free(traffic_influ_data->dnai_chg_type); + ogs_free(traffic_influ_data->supported_features); + ogs_free(traffic_influ_data); +} + +cJSON *OpenAPI_traffic_influ_data_convertToJSON(OpenAPI_traffic_influ_data_t *traffic_influ_data) +{ + cJSON *item = NULL; + + if (traffic_influ_data == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [TrafficInfluData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (traffic_influ_data->up_path_chg_notif_corre_id) { + if (cJSON_AddStringToObject(item, "upPathChgNotifCorreId", traffic_influ_data->up_path_chg_notif_corre_id) == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [up_path_chg_notif_corre_id]"); + goto end; + } + } + + if (traffic_influ_data->app_relo_ind >= 0) { + if (cJSON_AddBoolToObject(item, "appReloInd", traffic_influ_data->app_relo_ind) == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [app_relo_ind]"); + goto end; + } + } + + if (traffic_influ_data->af_app_id) { + if (cJSON_AddStringToObject(item, "afAppId", traffic_influ_data->af_app_id) == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [af_app_id]"); + goto end; + } + } + + if (traffic_influ_data->dnn) { + if (cJSON_AddStringToObject(item, "dnn", traffic_influ_data->dnn) == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [dnn]"); + goto end; + } + } + + if (traffic_influ_data->eth_traffic_filters) { + cJSON *eth_traffic_filtersList = cJSON_AddArrayToObject(item, "ethTrafficFilters"); + if (eth_traffic_filtersList == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [eth_traffic_filters]"); + goto end; + } + + OpenAPI_lnode_t *eth_traffic_filters_node; + if (traffic_influ_data->eth_traffic_filters) { + OpenAPI_list_for_each(traffic_influ_data->eth_traffic_filters, eth_traffic_filters_node) { + cJSON *itemLocal = OpenAPI_eth_flow_description_convertToJSON(eth_traffic_filters_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [eth_traffic_filters]"); + goto end; + } + cJSON_AddItemToArray(eth_traffic_filtersList, itemLocal); + } + } + } + + if (traffic_influ_data->snssai) { + cJSON *snssai_local_JSON = OpenAPI_snssai_convertToJSON(traffic_influ_data->snssai); + if (snssai_local_JSON == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [snssai]"); + goto end; + } + cJSON_AddItemToObject(item, "snssai", snssai_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [snssai]"); + goto end; + } + } + + if (traffic_influ_data->inter_group_id) { + if (cJSON_AddStringToObject(item, "interGroupId", traffic_influ_data->inter_group_id) == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [inter_group_id]"); + goto end; + } + } + + if (traffic_influ_data->supi) { + if (cJSON_AddStringToObject(item, "supi", traffic_influ_data->supi) == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [supi]"); + goto end; + } + } + + if (traffic_influ_data->traffic_filters) { + cJSON *traffic_filtersList = cJSON_AddArrayToObject(item, "trafficFilters"); + if (traffic_filtersList == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [traffic_filters]"); + goto end; + } + + OpenAPI_lnode_t *traffic_filters_node; + if (traffic_influ_data->traffic_filters) { + OpenAPI_list_for_each(traffic_influ_data->traffic_filters, traffic_filters_node) { + cJSON *itemLocal = OpenAPI_flow_info_convertToJSON(traffic_filters_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [traffic_filters]"); + goto end; + } + cJSON_AddItemToArray(traffic_filtersList, itemLocal); + } + } + } + + if (traffic_influ_data->traffic_routes) { + cJSON *traffic_routesList = cJSON_AddArrayToObject(item, "trafficRoutes"); + if (traffic_routesList == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [traffic_routes]"); + goto end; + } + + OpenAPI_lnode_t *traffic_routes_node; + if (traffic_influ_data->traffic_routes) { + OpenAPI_list_for_each(traffic_influ_data->traffic_routes, traffic_routes_node) { + cJSON *itemLocal = OpenAPI_route_to_location_convertToJSON(traffic_routes_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [traffic_routes]"); + goto end; + } + cJSON_AddItemToArray(traffic_routesList, itemLocal); + } + } + } + + if (traffic_influ_data->traff_corre_ind >= 0) { + if (cJSON_AddBoolToObject(item, "traffCorreInd", traffic_influ_data->traff_corre_ind) == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [traff_corre_ind]"); + goto end; + } + } + + if (traffic_influ_data->valid_start_time) { + if (cJSON_AddStringToObject(item, "validStartTime", traffic_influ_data->valid_start_time) == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [valid_start_time]"); + goto end; + } + } + + if (traffic_influ_data->valid_end_time) { + if (cJSON_AddStringToObject(item, "validEndTime", traffic_influ_data->valid_end_time) == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [valid_end_time]"); + goto end; + } + } + + if (traffic_influ_data->temp_validities) { + cJSON *temp_validitiesList = cJSON_AddArrayToObject(item, "tempValidities"); + if (temp_validitiesList == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [temp_validities]"); + goto end; + } + + OpenAPI_lnode_t *temp_validities_node; + if (traffic_influ_data->temp_validities) { + OpenAPI_list_for_each(traffic_influ_data->temp_validities, temp_validities_node) { + cJSON *itemLocal = OpenAPI_temporal_validity_convertToJSON(temp_validities_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [temp_validities]"); + goto end; + } + cJSON_AddItemToArray(temp_validitiesList, itemLocal); + } + } + } + + if (traffic_influ_data->nw_area_info) { + cJSON *nw_area_info_local_JSON = OpenAPI_network_area_info_2_convertToJSON(traffic_influ_data->nw_area_info); + if (nw_area_info_local_JSON == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [nw_area_info]"); + goto end; + } + cJSON_AddItemToObject(item, "nwAreaInfo", nw_area_info_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [nw_area_info]"); + goto end; + } + } + + if (traffic_influ_data->up_path_chg_notif_uri) { + if (cJSON_AddStringToObject(item, "upPathChgNotifUri", traffic_influ_data->up_path_chg_notif_uri) == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [up_path_chg_notif_uri]"); + goto end; + } + } + + if (traffic_influ_data->subscribed_events) { + cJSON *subscribed_eventsList = cJSON_AddArrayToObject(item, "subscribedEvents"); + if (subscribed_eventsList == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [subscribed_events]"); + goto end; + } + + OpenAPI_lnode_t *subscribed_events_node; + if (traffic_influ_data->subscribed_events) { + OpenAPI_list_for_each(traffic_influ_data->subscribed_events, subscribed_events_node) { + cJSON *itemLocal = OpenAPI_subscribed_event_convertToJSON(subscribed_events_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [subscribed_events]"); + goto end; + } + cJSON_AddItemToArray(subscribed_eventsList, itemLocal); + } + } + } + + if (traffic_influ_data->dnai_chg_type) { + cJSON *dnai_chg_type_local_JSON = OpenAPI_dnai_change_type_convertToJSON(traffic_influ_data->dnai_chg_type); + if (dnai_chg_type_local_JSON == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [dnai_chg_type]"); + goto end; + } + cJSON_AddItemToObject(item, "dnaiChgType", dnai_chg_type_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [dnai_chg_type]"); + goto end; + } + } + + if (traffic_influ_data->af_ack_ind >= 0) { + if (cJSON_AddBoolToObject(item, "afAckInd", traffic_influ_data->af_ack_ind) == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [af_ack_ind]"); + goto end; + } + } + + if (traffic_influ_data->addr_preser_ind >= 0) { + if (cJSON_AddBoolToObject(item, "addrPreserInd", traffic_influ_data->addr_preser_ind) == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [addr_preser_ind]"); + goto end; + } + } + + if (traffic_influ_data->supported_features) { + if (cJSON_AddStringToObject(item, "supportedFeatures", traffic_influ_data->supported_features) == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [supported_features]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_traffic_influ_data_t *OpenAPI_traffic_influ_data_parseFromJSON(cJSON *traffic_influ_dataJSON) +{ + OpenAPI_traffic_influ_data_t *traffic_influ_data_local_var = NULL; + cJSON *up_path_chg_notif_corre_id = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "upPathChgNotifCorreId"); + + if (up_path_chg_notif_corre_id) { + if (!cJSON_IsString(up_path_chg_notif_corre_id)) { + ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [up_path_chg_notif_corre_id]"); + goto end; + } + } + + cJSON *app_relo_ind = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "appReloInd"); + + if (app_relo_ind) { + if (!cJSON_IsBool(app_relo_ind)) { + ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [app_relo_ind]"); + goto end; + } + } + + cJSON *af_app_id = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "afAppId"); + + if (af_app_id) { + if (!cJSON_IsString(af_app_id)) { + ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [af_app_id]"); + goto end; + } + } + + cJSON *dnn = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "dnn"); + + if (dnn) { + if (!cJSON_IsString(dnn)) { + ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [dnn]"); + goto end; + } + } + + cJSON *eth_traffic_filters = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "ethTrafficFilters"); + + OpenAPI_list_t *eth_traffic_filtersList; + if (eth_traffic_filters) { + cJSON *eth_traffic_filters_local_nonprimitive; + if (!cJSON_IsArray(eth_traffic_filters)) { + ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [eth_traffic_filters]"); + goto end; + } + + eth_traffic_filtersList = OpenAPI_list_create(); + + cJSON_ArrayForEach(eth_traffic_filters_local_nonprimitive, eth_traffic_filters ) { + if (!cJSON_IsObject(eth_traffic_filters_local_nonprimitive)) { + ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [eth_traffic_filters]"); + goto end; + } + OpenAPI_eth_flow_description_t *eth_traffic_filtersItem = OpenAPI_eth_flow_description_parseFromJSON(eth_traffic_filters_local_nonprimitive); + + OpenAPI_list_add(eth_traffic_filtersList, eth_traffic_filtersItem); + } + } + + cJSON *snssai = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "snssai"); + + OpenAPI_snssai_t *snssai_local_nonprim = NULL; + if (snssai) { + snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(snssai); + } + + cJSON *inter_group_id = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "interGroupId"); + + if (inter_group_id) { + if (!cJSON_IsString(inter_group_id)) { + ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [inter_group_id]"); + goto end; + } + } + + cJSON *supi = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "supi"); + + if (supi) { + if (!cJSON_IsString(supi)) { + ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [supi]"); + goto end; + } + } + + cJSON *traffic_filters = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "trafficFilters"); + + OpenAPI_list_t *traffic_filtersList; + if (traffic_filters) { + cJSON *traffic_filters_local_nonprimitive; + if (!cJSON_IsArray(traffic_filters)) { + ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [traffic_filters]"); + goto end; + } + + traffic_filtersList = OpenAPI_list_create(); + + cJSON_ArrayForEach(traffic_filters_local_nonprimitive, traffic_filters ) { + if (!cJSON_IsObject(traffic_filters_local_nonprimitive)) { + ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [traffic_filters]"); + goto end; + } + OpenAPI_flow_info_t *traffic_filtersItem = OpenAPI_flow_info_parseFromJSON(traffic_filters_local_nonprimitive); + + OpenAPI_list_add(traffic_filtersList, traffic_filtersItem); + } + } + + cJSON *traffic_routes = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "trafficRoutes"); + + OpenAPI_list_t *traffic_routesList; + if (traffic_routes) { + cJSON *traffic_routes_local_nonprimitive; + if (!cJSON_IsArray(traffic_routes)) { + ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [traffic_routes]"); + goto end; + } + + traffic_routesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(traffic_routes_local_nonprimitive, traffic_routes ) { + if (!cJSON_IsObject(traffic_routes_local_nonprimitive)) { + ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [traffic_routes]"); + goto end; + } + OpenAPI_route_to_location_t *traffic_routesItem = OpenAPI_route_to_location_parseFromJSON(traffic_routes_local_nonprimitive); + + OpenAPI_list_add(traffic_routesList, traffic_routesItem); + } + } + + cJSON *traff_corre_ind = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "traffCorreInd"); + + if (traff_corre_ind) { + if (!cJSON_IsBool(traff_corre_ind)) { + ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [traff_corre_ind]"); + goto end; + } + } + + cJSON *valid_start_time = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "validStartTime"); + + if (valid_start_time) { + if (!cJSON_IsString(valid_start_time)) { + ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [valid_start_time]"); + goto end; + } + } + + cJSON *valid_end_time = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "validEndTime"); + + if (valid_end_time) { + if (!cJSON_IsString(valid_end_time)) { + ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [valid_end_time]"); + goto end; + } + } + + cJSON *temp_validities = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "tempValidities"); + + OpenAPI_list_t *temp_validitiesList; + if (temp_validities) { + cJSON *temp_validities_local_nonprimitive; + if (!cJSON_IsArray(temp_validities)) { + ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [temp_validities]"); + goto end; + } + + temp_validitiesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(temp_validities_local_nonprimitive, temp_validities ) { + if (!cJSON_IsObject(temp_validities_local_nonprimitive)) { + ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [temp_validities]"); + goto end; + } + OpenAPI_temporal_validity_t *temp_validitiesItem = OpenAPI_temporal_validity_parseFromJSON(temp_validities_local_nonprimitive); + + OpenAPI_list_add(temp_validitiesList, temp_validitiesItem); + } + } + + cJSON *nw_area_info = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "nwAreaInfo"); + + OpenAPI_network_area_info_2_t *nw_area_info_local_nonprim = NULL; + if (nw_area_info) { + nw_area_info_local_nonprim = OpenAPI_network_area_info_2_parseFromJSON(nw_area_info); + } + + cJSON *up_path_chg_notif_uri = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "upPathChgNotifUri"); + + if (up_path_chg_notif_uri) { + if (!cJSON_IsString(up_path_chg_notif_uri)) { + ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [up_path_chg_notif_uri]"); + goto end; + } + } + + cJSON *subscribed_events = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "subscribedEvents"); + + OpenAPI_list_t *subscribed_eventsList; + if (subscribed_events) { + cJSON *subscribed_events_local_nonprimitive; + if (!cJSON_IsArray(subscribed_events)) { + ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [subscribed_events]"); + goto end; + } + + subscribed_eventsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(subscribed_events_local_nonprimitive, subscribed_events ) { + if (!cJSON_IsObject(subscribed_events_local_nonprimitive)) { + ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [subscribed_events]"); + goto end; + } + OpenAPI_subscribed_event_t *subscribed_eventsItem = OpenAPI_subscribed_event_parseFromJSON(subscribed_events_local_nonprimitive); + + OpenAPI_list_add(subscribed_eventsList, subscribed_eventsItem); + } + } + + cJSON *dnai_chg_type = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "dnaiChgType"); + + OpenAPI_dnai_change_type_t *dnai_chg_type_local_nonprim = NULL; + if (dnai_chg_type) { + dnai_chg_type_local_nonprim = OpenAPI_dnai_change_type_parseFromJSON(dnai_chg_type); + } + + cJSON *af_ack_ind = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "afAckInd"); + + if (af_ack_ind) { + if (!cJSON_IsBool(af_ack_ind)) { + ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [af_ack_ind]"); + goto end; + } + } + + cJSON *addr_preser_ind = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "addrPreserInd"); + + if (addr_preser_ind) { + if (!cJSON_IsBool(addr_preser_ind)) { + ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [addr_preser_ind]"); + goto end; + } + } + + cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "supportedFeatures"); + + if (supported_features) { + if (!cJSON_IsString(supported_features)) { + ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [supported_features]"); + goto end; + } + } + + traffic_influ_data_local_var = OpenAPI_traffic_influ_data_create ( + up_path_chg_notif_corre_id ? ogs_strdup(up_path_chg_notif_corre_id->valuestring) : NULL, + app_relo_ind ? app_relo_ind->valueint : 0, + af_app_id ? ogs_strdup(af_app_id->valuestring) : NULL, + dnn ? ogs_strdup(dnn->valuestring) : NULL, + eth_traffic_filters ? eth_traffic_filtersList : NULL, + snssai ? snssai_local_nonprim : NULL, + inter_group_id ? ogs_strdup(inter_group_id->valuestring) : NULL, + supi ? ogs_strdup(supi->valuestring) : NULL, + traffic_filters ? traffic_filtersList : NULL, + traffic_routes ? traffic_routesList : NULL, + traff_corre_ind ? traff_corre_ind->valueint : 0, + valid_start_time ? ogs_strdup(valid_start_time->valuestring) : NULL, + valid_end_time ? ogs_strdup(valid_end_time->valuestring) : NULL, + temp_validities ? temp_validitiesList : NULL, + nw_area_info ? nw_area_info_local_nonprim : NULL, + up_path_chg_notif_uri ? ogs_strdup(up_path_chg_notif_uri->valuestring) : NULL, + subscribed_events ? subscribed_eventsList : NULL, + dnai_chg_type ? dnai_chg_type_local_nonprim : NULL, + af_ack_ind ? af_ack_ind->valueint : 0, + addr_preser_ind ? addr_preser_ind->valueint : 0, + supported_features ? ogs_strdup(supported_features->valuestring) : NULL + ); + + return traffic_influ_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/traffic_influ_data.h b/lib/sbi/openapi/model/traffic_influ_data.h new file mode 100644 index 0000000000..e14e5e1ee7 --- /dev/null +++ b/lib/sbi/openapi/model/traffic_influ_data.h @@ -0,0 +1,85 @@ +/* + * traffic_influ_data.h + * + * + */ + +#ifndef _OpenAPI_traffic_influ_data_H_ +#define _OpenAPI_traffic_influ_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "dnai_change_type.h" +#include "eth_flow_description.h" +#include "flow_info.h" +#include "network_area_info_2.h" +#include "route_to_location.h" +#include "snssai.h" +#include "subscribed_event.h" +#include "temporal_validity.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_traffic_influ_data_s OpenAPI_traffic_influ_data_t; +typedef struct OpenAPI_traffic_influ_data_s { + char *up_path_chg_notif_corre_id; + int app_relo_ind; + char *af_app_id; + char *dnn; + OpenAPI_list_t *eth_traffic_filters; + struct OpenAPI_snssai_s *snssai; + char *inter_group_id; + char *supi; + OpenAPI_list_t *traffic_filters; + OpenAPI_list_t *traffic_routes; + int traff_corre_ind; + char *valid_start_time; + char *valid_end_time; + OpenAPI_list_t *temp_validities; + struct OpenAPI_network_area_info_2_s *nw_area_info; + char *up_path_chg_notif_uri; + OpenAPI_list_t *subscribed_events; + struct OpenAPI_dnai_change_type_s *dnai_chg_type; + int af_ack_ind; + int addr_preser_ind; + char *supported_features; +} OpenAPI_traffic_influ_data_t; + +OpenAPI_traffic_influ_data_t *OpenAPI_traffic_influ_data_create( + char *up_path_chg_notif_corre_id, + int app_relo_ind, + char *af_app_id, + char *dnn, + OpenAPI_list_t *eth_traffic_filters, + OpenAPI_snssai_t *snssai, + char *inter_group_id, + char *supi, + OpenAPI_list_t *traffic_filters, + OpenAPI_list_t *traffic_routes, + int traff_corre_ind, + char *valid_start_time, + char *valid_end_time, + OpenAPI_list_t *temp_validities, + OpenAPI_network_area_info_2_t *nw_area_info, + char *up_path_chg_notif_uri, + OpenAPI_list_t *subscribed_events, + OpenAPI_dnai_change_type_t *dnai_chg_type, + int af_ack_ind, + int addr_preser_ind, + char *supported_features + ); +void OpenAPI_traffic_influ_data_free(OpenAPI_traffic_influ_data_t *traffic_influ_data); +OpenAPI_traffic_influ_data_t *OpenAPI_traffic_influ_data_parseFromJSON(cJSON *traffic_influ_dataJSON); +cJSON *OpenAPI_traffic_influ_data_convertToJSON(OpenAPI_traffic_influ_data_t *traffic_influ_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_traffic_influ_data_H_ */ + diff --git a/lib/sbi/openapi/model/traffic_influ_data_notif.c b/lib/sbi/openapi/model/traffic_influ_data_notif.c new file mode 100644 index 0000000000..4a5d53ee2f --- /dev/null +++ b/lib/sbi/openapi/model/traffic_influ_data_notif.c @@ -0,0 +1,95 @@ + +#include +#include +#include +#include "traffic_influ_data_notif.h" + +OpenAPI_traffic_influ_data_notif_t *OpenAPI_traffic_influ_data_notif_create( + char *res_uri, + OpenAPI_traffic_influ_data_t *traffic_influ_data + ) +{ + OpenAPI_traffic_influ_data_notif_t *traffic_influ_data_notif_local_var = OpenAPI_malloc(sizeof(OpenAPI_traffic_influ_data_notif_t)); + if (!traffic_influ_data_notif_local_var) { + return NULL; + } + traffic_influ_data_notif_local_var->res_uri = res_uri; + traffic_influ_data_notif_local_var->traffic_influ_data = traffic_influ_data; + + return traffic_influ_data_notif_local_var; +} + +void OpenAPI_traffic_influ_data_notif_free(OpenAPI_traffic_influ_data_notif_t *traffic_influ_data_notif) +{ + if (NULL == traffic_influ_data_notif) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(traffic_influ_data_notif->res_uri); + OpenAPI_traffic_influ_data_free(traffic_influ_data_notif->traffic_influ_data); + ogs_free(traffic_influ_data_notif); +} + +cJSON *OpenAPI_traffic_influ_data_notif_convertToJSON(OpenAPI_traffic_influ_data_notif_t *traffic_influ_data_notif) +{ + cJSON *item = NULL; + + if (traffic_influ_data_notif == NULL) { + ogs_error("OpenAPI_traffic_influ_data_notif_convertToJSON() failed [TrafficInfluDataNotif]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (traffic_influ_data_notif->res_uri) { + if (cJSON_AddStringToObject(item, "resUri", traffic_influ_data_notif->res_uri) == NULL) { + ogs_error("OpenAPI_traffic_influ_data_notif_convertToJSON() failed [res_uri]"); + goto end; + } + } + + if (traffic_influ_data_notif->traffic_influ_data) { + cJSON *traffic_influ_data_local_JSON = OpenAPI_traffic_influ_data_convertToJSON(traffic_influ_data_notif->traffic_influ_data); + if (traffic_influ_data_local_JSON == NULL) { + ogs_error("OpenAPI_traffic_influ_data_notif_convertToJSON() failed [traffic_influ_data]"); + goto end; + } + cJSON_AddItemToObject(item, "trafficInfluData", traffic_influ_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_traffic_influ_data_notif_convertToJSON() failed [traffic_influ_data]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_traffic_influ_data_notif_t *OpenAPI_traffic_influ_data_notif_parseFromJSON(cJSON *traffic_influ_data_notifJSON) +{ + OpenAPI_traffic_influ_data_notif_t *traffic_influ_data_notif_local_var = NULL; + cJSON *res_uri = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_notifJSON, "resUri"); + + if (res_uri) { + if (!cJSON_IsString(res_uri)) { + ogs_error("OpenAPI_traffic_influ_data_notif_parseFromJSON() failed [res_uri]"); + goto end; + } + } + + cJSON *traffic_influ_data = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_notifJSON, "trafficInfluData"); + + OpenAPI_traffic_influ_data_t *traffic_influ_data_local_nonprim = NULL; + if (traffic_influ_data) { + traffic_influ_data_local_nonprim = OpenAPI_traffic_influ_data_parseFromJSON(traffic_influ_data); + } + + traffic_influ_data_notif_local_var = OpenAPI_traffic_influ_data_notif_create ( + res_uri ? ogs_strdup(res_uri->valuestring) : NULL, + traffic_influ_data ? traffic_influ_data_local_nonprim : NULL + ); + + return traffic_influ_data_notif_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/traffic_influ_data_notif.h b/lib/sbi/openapi/model/traffic_influ_data_notif.h new file mode 100644 index 0000000000..e00fd8e7c9 --- /dev/null +++ b/lib/sbi/openapi/model/traffic_influ_data_notif.h @@ -0,0 +1,40 @@ +/* + * traffic_influ_data_notif.h + * + * + */ + +#ifndef _OpenAPI_traffic_influ_data_notif_H_ +#define _OpenAPI_traffic_influ_data_notif_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "traffic_influ_data.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_traffic_influ_data_notif_s OpenAPI_traffic_influ_data_notif_t; +typedef struct OpenAPI_traffic_influ_data_notif_s { + char *res_uri; + struct OpenAPI_traffic_influ_data_s *traffic_influ_data; +} OpenAPI_traffic_influ_data_notif_t; + +OpenAPI_traffic_influ_data_notif_t *OpenAPI_traffic_influ_data_notif_create( + char *res_uri, + OpenAPI_traffic_influ_data_t *traffic_influ_data + ); +void OpenAPI_traffic_influ_data_notif_free(OpenAPI_traffic_influ_data_notif_t *traffic_influ_data_notif); +OpenAPI_traffic_influ_data_notif_t *OpenAPI_traffic_influ_data_notif_parseFromJSON(cJSON *traffic_influ_data_notifJSON); +cJSON *OpenAPI_traffic_influ_data_notif_convertToJSON(OpenAPI_traffic_influ_data_notif_t *traffic_influ_data_notif); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_traffic_influ_data_notif_H_ */ + diff --git a/lib/sbi/openapi/model/traffic_influ_data_patch.c b/lib/sbi/openapi/model/traffic_influ_data_patch.c new file mode 100644 index 0000000000..2be3398d09 --- /dev/null +++ b/lib/sbi/openapi/model/traffic_influ_data_patch.c @@ -0,0 +1,515 @@ + +#include +#include +#include +#include "traffic_influ_data_patch.h" + +OpenAPI_traffic_influ_data_patch_t *OpenAPI_traffic_influ_data_patch_create( + char *up_path_chg_notif_corre_id, + int app_relo_ind, + char *dnn, + OpenAPI_list_t *eth_traffic_filters, + OpenAPI_snssai_t *snssai, + char *internal_group_id, + char *supi, + OpenAPI_list_t *traffic_filters, + OpenAPI_list_t *traffic_routes, + int traff_corre_ind, + char *valid_start_time, + char *valid_end_time, + OpenAPI_list_t *temp_validities, + OpenAPI_network_area_info_2_t *nw_area_info, + char *up_path_chg_notif_uri, + int af_ack_ind, + int addr_preser_ind + ) +{ + OpenAPI_traffic_influ_data_patch_t *traffic_influ_data_patch_local_var = OpenAPI_malloc(sizeof(OpenAPI_traffic_influ_data_patch_t)); + if (!traffic_influ_data_patch_local_var) { + return NULL; + } + traffic_influ_data_patch_local_var->up_path_chg_notif_corre_id = up_path_chg_notif_corre_id; + traffic_influ_data_patch_local_var->app_relo_ind = app_relo_ind; + traffic_influ_data_patch_local_var->dnn = dnn; + traffic_influ_data_patch_local_var->eth_traffic_filters = eth_traffic_filters; + traffic_influ_data_patch_local_var->snssai = snssai; + traffic_influ_data_patch_local_var->internal_group_id = internal_group_id; + traffic_influ_data_patch_local_var->supi = supi; + traffic_influ_data_patch_local_var->traffic_filters = traffic_filters; + traffic_influ_data_patch_local_var->traffic_routes = traffic_routes; + traffic_influ_data_patch_local_var->traff_corre_ind = traff_corre_ind; + traffic_influ_data_patch_local_var->valid_start_time = valid_start_time; + traffic_influ_data_patch_local_var->valid_end_time = valid_end_time; + traffic_influ_data_patch_local_var->temp_validities = temp_validities; + traffic_influ_data_patch_local_var->nw_area_info = nw_area_info; + traffic_influ_data_patch_local_var->up_path_chg_notif_uri = up_path_chg_notif_uri; + traffic_influ_data_patch_local_var->af_ack_ind = af_ack_ind; + traffic_influ_data_patch_local_var->addr_preser_ind = addr_preser_ind; + + return traffic_influ_data_patch_local_var; +} + +void OpenAPI_traffic_influ_data_patch_free(OpenAPI_traffic_influ_data_patch_t *traffic_influ_data_patch) +{ + if (NULL == traffic_influ_data_patch) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(traffic_influ_data_patch->up_path_chg_notif_corre_id); + ogs_free(traffic_influ_data_patch->dnn); + OpenAPI_list_for_each(traffic_influ_data_patch->eth_traffic_filters, node) { + OpenAPI_eth_flow_description_free(node->data); + } + OpenAPI_list_free(traffic_influ_data_patch->eth_traffic_filters); + OpenAPI_snssai_free(traffic_influ_data_patch->snssai); + ogs_free(traffic_influ_data_patch->internal_group_id); + ogs_free(traffic_influ_data_patch->supi); + OpenAPI_list_for_each(traffic_influ_data_patch->traffic_filters, node) { + OpenAPI_flow_info_free(node->data); + } + OpenAPI_list_free(traffic_influ_data_patch->traffic_filters); + OpenAPI_list_for_each(traffic_influ_data_patch->traffic_routes, node) { + OpenAPI_route_to_location_free(node->data); + } + OpenAPI_list_free(traffic_influ_data_patch->traffic_routes); + ogs_free(traffic_influ_data_patch->valid_start_time); + ogs_free(traffic_influ_data_patch->valid_end_time); + OpenAPI_list_for_each(traffic_influ_data_patch->temp_validities, node) { + OpenAPI_temporal_validity_free(node->data); + } + OpenAPI_list_free(traffic_influ_data_patch->temp_validities); + OpenAPI_network_area_info_2_free(traffic_influ_data_patch->nw_area_info); + ogs_free(traffic_influ_data_patch->up_path_chg_notif_uri); + ogs_free(traffic_influ_data_patch); +} + +cJSON *OpenAPI_traffic_influ_data_patch_convertToJSON(OpenAPI_traffic_influ_data_patch_t *traffic_influ_data_patch) +{ + cJSON *item = NULL; + + if (traffic_influ_data_patch == NULL) { + ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [TrafficInfluDataPatch]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (traffic_influ_data_patch->up_path_chg_notif_corre_id) { + if (cJSON_AddStringToObject(item, "upPathChgNotifCorreId", traffic_influ_data_patch->up_path_chg_notif_corre_id) == NULL) { + ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [up_path_chg_notif_corre_id]"); + goto end; + } + } + + if (traffic_influ_data_patch->app_relo_ind >= 0) { + if (cJSON_AddBoolToObject(item, "appReloInd", traffic_influ_data_patch->app_relo_ind) == NULL) { + ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [app_relo_ind]"); + goto end; + } + } + + if (traffic_influ_data_patch->dnn) { + if (cJSON_AddStringToObject(item, "dnn", traffic_influ_data_patch->dnn) == NULL) { + ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [dnn]"); + goto end; + } + } + + if (traffic_influ_data_patch->eth_traffic_filters) { + cJSON *eth_traffic_filtersList = cJSON_AddArrayToObject(item, "ethTrafficFilters"); + if (eth_traffic_filtersList == NULL) { + ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [eth_traffic_filters]"); + goto end; + } + + OpenAPI_lnode_t *eth_traffic_filters_node; + if (traffic_influ_data_patch->eth_traffic_filters) { + OpenAPI_list_for_each(traffic_influ_data_patch->eth_traffic_filters, eth_traffic_filters_node) { + cJSON *itemLocal = OpenAPI_eth_flow_description_convertToJSON(eth_traffic_filters_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [eth_traffic_filters]"); + goto end; + } + cJSON_AddItemToArray(eth_traffic_filtersList, itemLocal); + } + } + } + + if (traffic_influ_data_patch->snssai) { + cJSON *snssai_local_JSON = OpenAPI_snssai_convertToJSON(traffic_influ_data_patch->snssai); + if (snssai_local_JSON == NULL) { + ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [snssai]"); + goto end; + } + cJSON_AddItemToObject(item, "snssai", snssai_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [snssai]"); + goto end; + } + } + + if (traffic_influ_data_patch->internal_group_id) { + if (cJSON_AddStringToObject(item, "internalGroupId", traffic_influ_data_patch->internal_group_id) == NULL) { + ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [internal_group_id]"); + goto end; + } + } + + if (traffic_influ_data_patch->supi) { + if (cJSON_AddStringToObject(item, "supi", traffic_influ_data_patch->supi) == NULL) { + ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [supi]"); + goto end; + } + } + + if (traffic_influ_data_patch->traffic_filters) { + cJSON *traffic_filtersList = cJSON_AddArrayToObject(item, "trafficFilters"); + if (traffic_filtersList == NULL) { + ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [traffic_filters]"); + goto end; + } + + OpenAPI_lnode_t *traffic_filters_node; + if (traffic_influ_data_patch->traffic_filters) { + OpenAPI_list_for_each(traffic_influ_data_patch->traffic_filters, traffic_filters_node) { + cJSON *itemLocal = OpenAPI_flow_info_convertToJSON(traffic_filters_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [traffic_filters]"); + goto end; + } + cJSON_AddItemToArray(traffic_filtersList, itemLocal); + } + } + } + + if (traffic_influ_data_patch->traffic_routes) { + cJSON *traffic_routesList = cJSON_AddArrayToObject(item, "trafficRoutes"); + if (traffic_routesList == NULL) { + ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [traffic_routes]"); + goto end; + } + + OpenAPI_lnode_t *traffic_routes_node; + if (traffic_influ_data_patch->traffic_routes) { + OpenAPI_list_for_each(traffic_influ_data_patch->traffic_routes, traffic_routes_node) { + cJSON *itemLocal = OpenAPI_route_to_location_convertToJSON(traffic_routes_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [traffic_routes]"); + goto end; + } + cJSON_AddItemToArray(traffic_routesList, itemLocal); + } + } + } + + if (traffic_influ_data_patch->traff_corre_ind >= 0) { + if (cJSON_AddBoolToObject(item, "traffCorreInd", traffic_influ_data_patch->traff_corre_ind) == NULL) { + ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [traff_corre_ind]"); + goto end; + } + } + + if (traffic_influ_data_patch->valid_start_time) { + if (cJSON_AddStringToObject(item, "validStartTime", traffic_influ_data_patch->valid_start_time) == NULL) { + ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [valid_start_time]"); + goto end; + } + } + + if (traffic_influ_data_patch->valid_end_time) { + if (cJSON_AddStringToObject(item, "validEndTime", traffic_influ_data_patch->valid_end_time) == NULL) { + ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [valid_end_time]"); + goto end; + } + } + + if (traffic_influ_data_patch->temp_validities) { + cJSON *temp_validitiesList = cJSON_AddArrayToObject(item, "tempValidities"); + if (temp_validitiesList == NULL) { + ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [temp_validities]"); + goto end; + } + + OpenAPI_lnode_t *temp_validities_node; + if (traffic_influ_data_patch->temp_validities) { + OpenAPI_list_for_each(traffic_influ_data_patch->temp_validities, temp_validities_node) { + cJSON *itemLocal = OpenAPI_temporal_validity_convertToJSON(temp_validities_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [temp_validities]"); + goto end; + } + cJSON_AddItemToArray(temp_validitiesList, itemLocal); + } + } + } + + if (traffic_influ_data_patch->nw_area_info) { + cJSON *nw_area_info_local_JSON = OpenAPI_network_area_info_2_convertToJSON(traffic_influ_data_patch->nw_area_info); + if (nw_area_info_local_JSON == NULL) { + ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [nw_area_info]"); + goto end; + } + cJSON_AddItemToObject(item, "nwAreaInfo", nw_area_info_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [nw_area_info]"); + goto end; + } + } + + if (traffic_influ_data_patch->up_path_chg_notif_uri) { + if (cJSON_AddStringToObject(item, "upPathChgNotifUri", traffic_influ_data_patch->up_path_chg_notif_uri) == NULL) { + ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [up_path_chg_notif_uri]"); + goto end; + } + } + + if (traffic_influ_data_patch->af_ack_ind >= 0) { + if (cJSON_AddBoolToObject(item, "afAckInd", traffic_influ_data_patch->af_ack_ind) == NULL) { + ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [af_ack_ind]"); + goto end; + } + } + + if (traffic_influ_data_patch->addr_preser_ind >= 0) { + if (cJSON_AddBoolToObject(item, "addrPreserInd", traffic_influ_data_patch->addr_preser_ind) == NULL) { + ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [addr_preser_ind]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_traffic_influ_data_patch_t *OpenAPI_traffic_influ_data_patch_parseFromJSON(cJSON *traffic_influ_data_patchJSON) +{ + OpenAPI_traffic_influ_data_patch_t *traffic_influ_data_patch_local_var = NULL; + cJSON *up_path_chg_notif_corre_id = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "upPathChgNotifCorreId"); + + if (up_path_chg_notif_corre_id) { + if (!cJSON_IsString(up_path_chg_notif_corre_id)) { + ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [up_path_chg_notif_corre_id]"); + goto end; + } + } + + cJSON *app_relo_ind = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "appReloInd"); + + if (app_relo_ind) { + if (!cJSON_IsBool(app_relo_ind)) { + ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [app_relo_ind]"); + goto end; + } + } + + cJSON *dnn = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "dnn"); + + if (dnn) { + if (!cJSON_IsString(dnn)) { + ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [dnn]"); + goto end; + } + } + + cJSON *eth_traffic_filters = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "ethTrafficFilters"); + + OpenAPI_list_t *eth_traffic_filtersList; + if (eth_traffic_filters) { + cJSON *eth_traffic_filters_local_nonprimitive; + if (!cJSON_IsArray(eth_traffic_filters)) { + ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [eth_traffic_filters]"); + goto end; + } + + eth_traffic_filtersList = OpenAPI_list_create(); + + cJSON_ArrayForEach(eth_traffic_filters_local_nonprimitive, eth_traffic_filters ) { + if (!cJSON_IsObject(eth_traffic_filters_local_nonprimitive)) { + ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [eth_traffic_filters]"); + goto end; + } + OpenAPI_eth_flow_description_t *eth_traffic_filtersItem = OpenAPI_eth_flow_description_parseFromJSON(eth_traffic_filters_local_nonprimitive); + + OpenAPI_list_add(eth_traffic_filtersList, eth_traffic_filtersItem); + } + } + + cJSON *snssai = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "snssai"); + + OpenAPI_snssai_t *snssai_local_nonprim = NULL; + if (snssai) { + snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(snssai); + } + + cJSON *internal_group_id = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "internalGroupId"); + + if (internal_group_id) { + if (!cJSON_IsString(internal_group_id)) { + ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [internal_group_id]"); + goto end; + } + } + + cJSON *supi = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "supi"); + + if (supi) { + if (!cJSON_IsString(supi)) { + ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [supi]"); + goto end; + } + } + + cJSON *traffic_filters = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "trafficFilters"); + + OpenAPI_list_t *traffic_filtersList; + if (traffic_filters) { + cJSON *traffic_filters_local_nonprimitive; + if (!cJSON_IsArray(traffic_filters)) { + ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [traffic_filters]"); + goto end; + } + + traffic_filtersList = OpenAPI_list_create(); + + cJSON_ArrayForEach(traffic_filters_local_nonprimitive, traffic_filters ) { + if (!cJSON_IsObject(traffic_filters_local_nonprimitive)) { + ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [traffic_filters]"); + goto end; + } + OpenAPI_flow_info_t *traffic_filtersItem = OpenAPI_flow_info_parseFromJSON(traffic_filters_local_nonprimitive); + + OpenAPI_list_add(traffic_filtersList, traffic_filtersItem); + } + } + + cJSON *traffic_routes = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "trafficRoutes"); + + OpenAPI_list_t *traffic_routesList; + if (traffic_routes) { + cJSON *traffic_routes_local_nonprimitive; + if (!cJSON_IsArray(traffic_routes)) { + ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [traffic_routes]"); + goto end; + } + + traffic_routesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(traffic_routes_local_nonprimitive, traffic_routes ) { + if (!cJSON_IsObject(traffic_routes_local_nonprimitive)) { + ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [traffic_routes]"); + goto end; + } + OpenAPI_route_to_location_t *traffic_routesItem = OpenAPI_route_to_location_parseFromJSON(traffic_routes_local_nonprimitive); + + OpenAPI_list_add(traffic_routesList, traffic_routesItem); + } + } + + cJSON *traff_corre_ind = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "traffCorreInd"); + + if (traff_corre_ind) { + if (!cJSON_IsBool(traff_corre_ind)) { + ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [traff_corre_ind]"); + goto end; + } + } + + cJSON *valid_start_time = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "validStartTime"); + + if (valid_start_time) { + if (!cJSON_IsString(valid_start_time)) { + ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [valid_start_time]"); + goto end; + } + } + + cJSON *valid_end_time = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "validEndTime"); + + if (valid_end_time) { + if (!cJSON_IsString(valid_end_time)) { + ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [valid_end_time]"); + goto end; + } + } + + cJSON *temp_validities = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "tempValidities"); + + OpenAPI_list_t *temp_validitiesList; + if (temp_validities) { + cJSON *temp_validities_local_nonprimitive; + if (!cJSON_IsArray(temp_validities)) { + ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [temp_validities]"); + goto end; + } + + temp_validitiesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(temp_validities_local_nonprimitive, temp_validities ) { + if (!cJSON_IsObject(temp_validities_local_nonprimitive)) { + ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [temp_validities]"); + goto end; + } + OpenAPI_temporal_validity_t *temp_validitiesItem = OpenAPI_temporal_validity_parseFromJSON(temp_validities_local_nonprimitive); + + OpenAPI_list_add(temp_validitiesList, temp_validitiesItem); + } + } + + cJSON *nw_area_info = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "nwAreaInfo"); + + OpenAPI_network_area_info_2_t *nw_area_info_local_nonprim = NULL; + if (nw_area_info) { + nw_area_info_local_nonprim = OpenAPI_network_area_info_2_parseFromJSON(nw_area_info); + } + + cJSON *up_path_chg_notif_uri = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "upPathChgNotifUri"); + + if (up_path_chg_notif_uri) { + if (!cJSON_IsString(up_path_chg_notif_uri)) { + ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [up_path_chg_notif_uri]"); + goto end; + } + } + + cJSON *af_ack_ind = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "afAckInd"); + + if (af_ack_ind) { + if (!cJSON_IsBool(af_ack_ind)) { + ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [af_ack_ind]"); + goto end; + } + } + + cJSON *addr_preser_ind = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "addrPreserInd"); + + if (addr_preser_ind) { + if (!cJSON_IsBool(addr_preser_ind)) { + ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [addr_preser_ind]"); + goto end; + } + } + + traffic_influ_data_patch_local_var = OpenAPI_traffic_influ_data_patch_create ( + up_path_chg_notif_corre_id ? ogs_strdup(up_path_chg_notif_corre_id->valuestring) : NULL, + app_relo_ind ? app_relo_ind->valueint : 0, + dnn ? ogs_strdup(dnn->valuestring) : NULL, + eth_traffic_filters ? eth_traffic_filtersList : NULL, + snssai ? snssai_local_nonprim : NULL, + internal_group_id ? ogs_strdup(internal_group_id->valuestring) : NULL, + supi ? ogs_strdup(supi->valuestring) : NULL, + traffic_filters ? traffic_filtersList : NULL, + traffic_routes ? traffic_routesList : NULL, + traff_corre_ind ? traff_corre_ind->valueint : 0, + valid_start_time ? ogs_strdup(valid_start_time->valuestring) : NULL, + valid_end_time ? ogs_strdup(valid_end_time->valuestring) : NULL, + temp_validities ? temp_validitiesList : NULL, + nw_area_info ? nw_area_info_local_nonprim : NULL, + up_path_chg_notif_uri ? ogs_strdup(up_path_chg_notif_uri->valuestring) : NULL, + af_ack_ind ? af_ack_ind->valueint : 0, + addr_preser_ind ? addr_preser_ind->valueint : 0 + ); + + return traffic_influ_data_patch_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/traffic_influ_data_patch.h b/lib/sbi/openapi/model/traffic_influ_data_patch.h new file mode 100644 index 0000000000..397474c866 --- /dev/null +++ b/lib/sbi/openapi/model/traffic_influ_data_patch.h @@ -0,0 +1,75 @@ +/* + * traffic_influ_data_patch.h + * + * + */ + +#ifndef _OpenAPI_traffic_influ_data_patch_H_ +#define _OpenAPI_traffic_influ_data_patch_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "eth_flow_description.h" +#include "flow_info.h" +#include "network_area_info_2.h" +#include "route_to_location.h" +#include "snssai.h" +#include "temporal_validity.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_traffic_influ_data_patch_s OpenAPI_traffic_influ_data_patch_t; +typedef struct OpenAPI_traffic_influ_data_patch_s { + char *up_path_chg_notif_corre_id; + int app_relo_ind; + char *dnn; + OpenAPI_list_t *eth_traffic_filters; + struct OpenAPI_snssai_s *snssai; + char *internal_group_id; + char *supi; + OpenAPI_list_t *traffic_filters; + OpenAPI_list_t *traffic_routes; + int traff_corre_ind; + char *valid_start_time; + char *valid_end_time; + OpenAPI_list_t *temp_validities; + struct OpenAPI_network_area_info_2_s *nw_area_info; + char *up_path_chg_notif_uri; + int af_ack_ind; + int addr_preser_ind; +} OpenAPI_traffic_influ_data_patch_t; + +OpenAPI_traffic_influ_data_patch_t *OpenAPI_traffic_influ_data_patch_create( + char *up_path_chg_notif_corre_id, + int app_relo_ind, + char *dnn, + OpenAPI_list_t *eth_traffic_filters, + OpenAPI_snssai_t *snssai, + char *internal_group_id, + char *supi, + OpenAPI_list_t *traffic_filters, + OpenAPI_list_t *traffic_routes, + int traff_corre_ind, + char *valid_start_time, + char *valid_end_time, + OpenAPI_list_t *temp_validities, + OpenAPI_network_area_info_2_t *nw_area_info, + char *up_path_chg_notif_uri, + int af_ack_ind, + int addr_preser_ind + ); +void OpenAPI_traffic_influ_data_patch_free(OpenAPI_traffic_influ_data_patch_t *traffic_influ_data_patch); +OpenAPI_traffic_influ_data_patch_t *OpenAPI_traffic_influ_data_patch_parseFromJSON(cJSON *traffic_influ_data_patchJSON); +cJSON *OpenAPI_traffic_influ_data_patch_convertToJSON(OpenAPI_traffic_influ_data_patch_t *traffic_influ_data_patch); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_traffic_influ_data_patch_H_ */ + diff --git a/lib/sbi/openapi/model/traffic_influ_sub.c b/lib/sbi/openapi/model/traffic_influ_sub.c new file mode 100644 index 0000000000..96b867c198 --- /dev/null +++ b/lib/sbi/openapi/model/traffic_influ_sub.c @@ -0,0 +1,295 @@ + +#include +#include +#include +#include "traffic_influ_sub.h" + +OpenAPI_traffic_influ_sub_t *OpenAPI_traffic_influ_sub_create( + OpenAPI_list_t *dnns, + OpenAPI_list_t *snssais, + OpenAPI_list_t *internal_group_ids, + OpenAPI_list_t *supis, + char *notification_uri, + char *expiry, + char *supported_features + ) +{ + OpenAPI_traffic_influ_sub_t *traffic_influ_sub_local_var = OpenAPI_malloc(sizeof(OpenAPI_traffic_influ_sub_t)); + if (!traffic_influ_sub_local_var) { + return NULL; + } + traffic_influ_sub_local_var->dnns = dnns; + traffic_influ_sub_local_var->snssais = snssais; + traffic_influ_sub_local_var->internal_group_ids = internal_group_ids; + traffic_influ_sub_local_var->supis = supis; + traffic_influ_sub_local_var->notification_uri = notification_uri; + traffic_influ_sub_local_var->expiry = expiry; + traffic_influ_sub_local_var->supported_features = supported_features; + + return traffic_influ_sub_local_var; +} + +void OpenAPI_traffic_influ_sub_free(OpenAPI_traffic_influ_sub_t *traffic_influ_sub) +{ + if (NULL == traffic_influ_sub) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(traffic_influ_sub->dnns, node) { + ogs_free(node->data); + } + OpenAPI_list_free(traffic_influ_sub->dnns); + OpenAPI_list_for_each(traffic_influ_sub->snssais, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(traffic_influ_sub->snssais); + OpenAPI_list_for_each(traffic_influ_sub->internal_group_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(traffic_influ_sub->internal_group_ids); + OpenAPI_list_for_each(traffic_influ_sub->supis, node) { + ogs_free(node->data); + } + OpenAPI_list_free(traffic_influ_sub->supis); + ogs_free(traffic_influ_sub->notification_uri); + ogs_free(traffic_influ_sub->expiry); + ogs_free(traffic_influ_sub->supported_features); + ogs_free(traffic_influ_sub); +} + +cJSON *OpenAPI_traffic_influ_sub_convertToJSON(OpenAPI_traffic_influ_sub_t *traffic_influ_sub) +{ + cJSON *item = NULL; + + if (traffic_influ_sub == NULL) { + ogs_error("OpenAPI_traffic_influ_sub_convertToJSON() failed [TrafficInfluSub]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (traffic_influ_sub->dnns) { + cJSON *dnns = cJSON_AddArrayToObject(item, "dnns"); + if (dnns == NULL) { + ogs_error("OpenAPI_traffic_influ_sub_convertToJSON() failed [dnns]"); + goto end; + } + + OpenAPI_lnode_t *dnns_node; + OpenAPI_list_for_each(traffic_influ_sub->dnns, dnns_node) { + if (cJSON_AddStringToObject(dnns, "", (char*)dnns_node->data) == NULL) { + ogs_error("OpenAPI_traffic_influ_sub_convertToJSON() failed [dnns]"); + goto end; + } + } + } + + if (traffic_influ_sub->snssais) { + cJSON *snssaisList = cJSON_AddArrayToObject(item, "snssais"); + if (snssaisList == NULL) { + ogs_error("OpenAPI_traffic_influ_sub_convertToJSON() failed [snssais]"); + goto end; + } + + OpenAPI_lnode_t *snssais_node; + if (traffic_influ_sub->snssais) { + OpenAPI_list_for_each(traffic_influ_sub->snssais, snssais_node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(snssais_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_traffic_influ_sub_convertToJSON() failed [snssais]"); + goto end; + } + cJSON_AddItemToArray(snssaisList, itemLocal); + } + } + } + + if (traffic_influ_sub->internal_group_ids) { + cJSON *internal_group_ids = cJSON_AddArrayToObject(item, "internalGroupIds"); + if (internal_group_ids == NULL) { + ogs_error("OpenAPI_traffic_influ_sub_convertToJSON() failed [internal_group_ids]"); + goto end; + } + + OpenAPI_lnode_t *internal_group_ids_node; + OpenAPI_list_for_each(traffic_influ_sub->internal_group_ids, internal_group_ids_node) { + if (cJSON_AddStringToObject(internal_group_ids, "", (char*)internal_group_ids_node->data) == NULL) { + ogs_error("OpenAPI_traffic_influ_sub_convertToJSON() failed [internal_group_ids]"); + goto end; + } + } + } + + if (traffic_influ_sub->supis) { + cJSON *supis = cJSON_AddArrayToObject(item, "supis"); + if (supis == NULL) { + ogs_error("OpenAPI_traffic_influ_sub_convertToJSON() failed [supis]"); + goto end; + } + + OpenAPI_lnode_t *supis_node; + OpenAPI_list_for_each(traffic_influ_sub->supis, supis_node) { + if (cJSON_AddStringToObject(supis, "", (char*)supis_node->data) == NULL) { + ogs_error("OpenAPI_traffic_influ_sub_convertToJSON() failed [supis]"); + goto end; + } + } + } + + if (!traffic_influ_sub->notification_uri) { + ogs_error("OpenAPI_traffic_influ_sub_convertToJSON() failed [notification_uri]"); + goto end; + } + if (cJSON_AddStringToObject(item, "notificationUri", traffic_influ_sub->notification_uri) == NULL) { + ogs_error("OpenAPI_traffic_influ_sub_convertToJSON() failed [notification_uri]"); + goto end; + } + + if (traffic_influ_sub->expiry) { + if (cJSON_AddStringToObject(item, "expiry", traffic_influ_sub->expiry) == NULL) { + ogs_error("OpenAPI_traffic_influ_sub_convertToJSON() failed [expiry]"); + goto end; + } + } + + if (traffic_influ_sub->supported_features) { + if (cJSON_AddStringToObject(item, "supportedFeatures", traffic_influ_sub->supported_features) == NULL) { + ogs_error("OpenAPI_traffic_influ_sub_convertToJSON() failed [supported_features]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_traffic_influ_sub_t *OpenAPI_traffic_influ_sub_parseFromJSON(cJSON *traffic_influ_subJSON) +{ + OpenAPI_traffic_influ_sub_t *traffic_influ_sub_local_var = NULL; + cJSON *dnns = cJSON_GetObjectItemCaseSensitive(traffic_influ_subJSON, "dnns"); + + OpenAPI_list_t *dnnsList; + if (dnns) { + cJSON *dnns_local; + if (!cJSON_IsArray(dnns)) { + ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [dnns]"); + goto end; + } + dnnsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(dnns_local, dnns) { + if (!cJSON_IsString(dnns_local)) { + ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [dnns]"); + goto end; + } + OpenAPI_list_add(dnnsList, ogs_strdup(dnns_local->valuestring)); + } + } + + cJSON *snssais = cJSON_GetObjectItemCaseSensitive(traffic_influ_subJSON, "snssais"); + + OpenAPI_list_t *snssaisList; + if (snssais) { + cJSON *snssais_local_nonprimitive; + if (!cJSON_IsArray(snssais)) { + ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [snssais]"); + goto end; + } + + snssaisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(snssais_local_nonprimitive, snssais ) { + if (!cJSON_IsObject(snssais_local_nonprimitive)) { + ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [snssais]"); + goto end; + } + OpenAPI_snssai_t *snssaisItem = OpenAPI_snssai_parseFromJSON(snssais_local_nonprimitive); + + OpenAPI_list_add(snssaisList, snssaisItem); + } + } + + cJSON *internal_group_ids = cJSON_GetObjectItemCaseSensitive(traffic_influ_subJSON, "internalGroupIds"); + + OpenAPI_list_t *internal_group_idsList; + if (internal_group_ids) { + cJSON *internal_group_ids_local; + if (!cJSON_IsArray(internal_group_ids)) { + ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [internal_group_ids]"); + goto end; + } + internal_group_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(internal_group_ids_local, internal_group_ids) { + if (!cJSON_IsString(internal_group_ids_local)) { + ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [internal_group_ids]"); + goto end; + } + OpenAPI_list_add(internal_group_idsList, ogs_strdup(internal_group_ids_local->valuestring)); + } + } + + cJSON *supis = cJSON_GetObjectItemCaseSensitive(traffic_influ_subJSON, "supis"); + + OpenAPI_list_t *supisList; + if (supis) { + cJSON *supis_local; + if (!cJSON_IsArray(supis)) { + ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [supis]"); + goto end; + } + supisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(supis_local, supis) { + if (!cJSON_IsString(supis_local)) { + ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [supis]"); + goto end; + } + OpenAPI_list_add(supisList, ogs_strdup(supis_local->valuestring)); + } + } + + cJSON *notification_uri = cJSON_GetObjectItemCaseSensitive(traffic_influ_subJSON, "notificationUri"); + if (!notification_uri) { + ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [notification_uri]"); + goto end; + } + + + if (!cJSON_IsString(notification_uri)) { + ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [notification_uri]"); + goto end; + } + + cJSON *expiry = cJSON_GetObjectItemCaseSensitive(traffic_influ_subJSON, "expiry"); + + if (expiry) { + if (!cJSON_IsString(expiry)) { + ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [expiry]"); + goto end; + } + } + + cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(traffic_influ_subJSON, "supportedFeatures"); + + if (supported_features) { + if (!cJSON_IsString(supported_features)) { + ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [supported_features]"); + goto end; + } + } + + traffic_influ_sub_local_var = OpenAPI_traffic_influ_sub_create ( + dnns ? dnnsList : NULL, + snssais ? snssaisList : NULL, + internal_group_ids ? internal_group_idsList : NULL, + supis ? supisList : NULL, + ogs_strdup(notification_uri->valuestring), + expiry ? ogs_strdup(expiry->valuestring) : NULL, + supported_features ? ogs_strdup(supported_features->valuestring) : NULL + ); + + return traffic_influ_sub_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/traffic_influ_sub.h b/lib/sbi/openapi/model/traffic_influ_sub.h new file mode 100644 index 0000000000..5496e21341 --- /dev/null +++ b/lib/sbi/openapi/model/traffic_influ_sub.h @@ -0,0 +1,50 @@ +/* + * traffic_influ_sub.h + * + * + */ + +#ifndef _OpenAPI_traffic_influ_sub_H_ +#define _OpenAPI_traffic_influ_sub_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "snssai.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_traffic_influ_sub_s OpenAPI_traffic_influ_sub_t; +typedef struct OpenAPI_traffic_influ_sub_s { + OpenAPI_list_t *dnns; + OpenAPI_list_t *snssais; + OpenAPI_list_t *internal_group_ids; + OpenAPI_list_t *supis; + char *notification_uri; + char *expiry; + char *supported_features; +} OpenAPI_traffic_influ_sub_t; + +OpenAPI_traffic_influ_sub_t *OpenAPI_traffic_influ_sub_create( + OpenAPI_list_t *dnns, + OpenAPI_list_t *snssais, + OpenAPI_list_t *internal_group_ids, + OpenAPI_list_t *supis, + char *notification_uri, + char *expiry, + char *supported_features + ); +void OpenAPI_traffic_influ_sub_free(OpenAPI_traffic_influ_sub_t *traffic_influ_sub); +OpenAPI_traffic_influ_sub_t *OpenAPI_traffic_influ_sub_parseFromJSON(cJSON *traffic_influ_subJSON); +cJSON *OpenAPI_traffic_influ_sub_convertToJSON(OpenAPI_traffic_influ_sub_t *traffic_influ_sub); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_traffic_influ_sub_H_ */ + diff --git a/lib/sbi/openapi/model/traffic_profile.c b/lib/sbi/openapi/model/traffic_profile.c new file mode 100644 index 0000000000..32ac540e26 --- /dev/null +++ b/lib/sbi/openapi/model/traffic_profile.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "traffic_profile.h" + +OpenAPI_traffic_profile_t *OpenAPI_traffic_profile_create( + ) +{ + OpenAPI_traffic_profile_t *traffic_profile_local_var = OpenAPI_malloc(sizeof(OpenAPI_traffic_profile_t)); + if (!traffic_profile_local_var) { + return NULL; + } + + return traffic_profile_local_var; +} + +void OpenAPI_traffic_profile_free(OpenAPI_traffic_profile_t *traffic_profile) +{ + if (NULL == traffic_profile) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(traffic_profile); +} + +cJSON *OpenAPI_traffic_profile_convertToJSON(OpenAPI_traffic_profile_t *traffic_profile) +{ + cJSON *item = NULL; + + if (traffic_profile == NULL) { + ogs_error("OpenAPI_traffic_profile_convertToJSON() failed [TrafficProfile]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_traffic_profile_t *OpenAPI_traffic_profile_parseFromJSON(cJSON *traffic_profileJSON) +{ + OpenAPI_traffic_profile_t *traffic_profile_local_var = NULL; + traffic_profile_local_var = OpenAPI_traffic_profile_create ( + ); + + return traffic_profile_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/traffic_profile.h b/lib/sbi/openapi/model/traffic_profile.h new file mode 100644 index 0000000000..62f0528dc1 --- /dev/null +++ b/lib/sbi/openapi/model/traffic_profile.h @@ -0,0 +1,35 @@ +/* + * traffic_profile.h + * + * Possible values are - SINGLE_TRANS_UL: Uplink single packet transmission. - SINGLE_TRANS_DL: Downlink single packet transmission. - DUAL_TRANS_UL_FIRST: Dual packet transmission, firstly uplink packet transmission with subsequent downlink packet transmission. - DUAL_TRANS_DL_FIRST: Dual packet transmission, firstly downlink packet transmission with subsequent uplink packet transmission. + */ + +#ifndef _OpenAPI_traffic_profile_H_ +#define _OpenAPI_traffic_profile_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_traffic_profile_s OpenAPI_traffic_profile_t; +typedef struct OpenAPI_traffic_profile_s { +} OpenAPI_traffic_profile_t; + +OpenAPI_traffic_profile_t *OpenAPI_traffic_profile_create( + ); +void OpenAPI_traffic_profile_free(OpenAPI_traffic_profile_t *traffic_profile); +OpenAPI_traffic_profile_t *OpenAPI_traffic_profile_parseFromJSON(cJSON *traffic_profileJSON); +cJSON *OpenAPI_traffic_profile_convertToJSON(OpenAPI_traffic_profile_t *traffic_profile); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_traffic_profile_H_ */ + diff --git a/lib/sbi/openapi/model/traffic_profile_rm.c b/lib/sbi/openapi/model/traffic_profile_rm.c new file mode 100644 index 0000000000..929d108d28 --- /dev/null +++ b/lib/sbi/openapi/model/traffic_profile_rm.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "traffic_profile_rm.h" + +OpenAPI_traffic_profile_rm_t *OpenAPI_traffic_profile_rm_create( + ) +{ + OpenAPI_traffic_profile_rm_t *traffic_profile_rm_local_var = OpenAPI_malloc(sizeof(OpenAPI_traffic_profile_rm_t)); + if (!traffic_profile_rm_local_var) { + return NULL; + } + + return traffic_profile_rm_local_var; +} + +void OpenAPI_traffic_profile_rm_free(OpenAPI_traffic_profile_rm_t *traffic_profile_rm) +{ + if (NULL == traffic_profile_rm) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(traffic_profile_rm); +} + +cJSON *OpenAPI_traffic_profile_rm_convertToJSON(OpenAPI_traffic_profile_rm_t *traffic_profile_rm) +{ + cJSON *item = NULL; + + if (traffic_profile_rm == NULL) { + ogs_error("OpenAPI_traffic_profile_rm_convertToJSON() failed [TrafficProfileRm]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_traffic_profile_rm_t *OpenAPI_traffic_profile_rm_parseFromJSON(cJSON *traffic_profile_rmJSON) +{ + OpenAPI_traffic_profile_rm_t *traffic_profile_rm_local_var = NULL; + traffic_profile_rm_local_var = OpenAPI_traffic_profile_rm_create ( + ); + + return traffic_profile_rm_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/traffic_profile_rm.h b/lib/sbi/openapi/model/traffic_profile_rm.h new file mode 100644 index 0000000000..efddf8b306 --- /dev/null +++ b/lib/sbi/openapi/model/traffic_profile_rm.h @@ -0,0 +1,37 @@ +/* + * traffic_profile_rm.h + * + * + */ + +#ifndef _OpenAPI_traffic_profile_rm_H_ +#define _OpenAPI_traffic_profile_rm_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "null_value.h" +#include "traffic_profile.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_traffic_profile_rm_s OpenAPI_traffic_profile_rm_t; +typedef struct OpenAPI_traffic_profile_rm_s { +} OpenAPI_traffic_profile_rm_t; + +OpenAPI_traffic_profile_rm_t *OpenAPI_traffic_profile_rm_create( + ); +void OpenAPI_traffic_profile_rm_free(OpenAPI_traffic_profile_rm_t *traffic_profile_rm); +OpenAPI_traffic_profile_rm_t *OpenAPI_traffic_profile_rm_parseFromJSON(cJSON *traffic_profile_rmJSON); +cJSON *OpenAPI_traffic_profile_rm_convertToJSON(OpenAPI_traffic_profile_rm_t *traffic_profile_rm); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_traffic_profile_rm_H_ */ + diff --git a/lib/sbi/openapi/model/transfer_policy.c b/lib/sbi/openapi/model/transfer_policy.c new file mode 100644 index 0000000000..4c7d6ce787 --- /dev/null +++ b/lib/sbi/openapi/model/transfer_policy.c @@ -0,0 +1,168 @@ + +#include +#include +#include +#include "transfer_policy.h" + +OpenAPI_transfer_policy_t *OpenAPI_transfer_policy_create( + char *max_bit_rate_dl, + char *max_bit_rate_ul, + int rating_group, + OpenAPI_time_window_t *rec_time_int, + int trans_policy_id + ) +{ + OpenAPI_transfer_policy_t *transfer_policy_local_var = OpenAPI_malloc(sizeof(OpenAPI_transfer_policy_t)); + if (!transfer_policy_local_var) { + return NULL; + } + transfer_policy_local_var->max_bit_rate_dl = max_bit_rate_dl; + transfer_policy_local_var->max_bit_rate_ul = max_bit_rate_ul; + transfer_policy_local_var->rating_group = rating_group; + transfer_policy_local_var->rec_time_int = rec_time_int; + transfer_policy_local_var->trans_policy_id = trans_policy_id; + + return transfer_policy_local_var; +} + +void OpenAPI_transfer_policy_free(OpenAPI_transfer_policy_t *transfer_policy) +{ + if (NULL == transfer_policy) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(transfer_policy->max_bit_rate_dl); + ogs_free(transfer_policy->max_bit_rate_ul); + OpenAPI_time_window_free(transfer_policy->rec_time_int); + ogs_free(transfer_policy); +} + +cJSON *OpenAPI_transfer_policy_convertToJSON(OpenAPI_transfer_policy_t *transfer_policy) +{ + cJSON *item = NULL; + + if (transfer_policy == NULL) { + ogs_error("OpenAPI_transfer_policy_convertToJSON() failed [TransferPolicy]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (transfer_policy->max_bit_rate_dl) { + if (cJSON_AddStringToObject(item, "maxBitRateDl", transfer_policy->max_bit_rate_dl) == NULL) { + ogs_error("OpenAPI_transfer_policy_convertToJSON() failed [max_bit_rate_dl]"); + goto end; + } + } + + if (transfer_policy->max_bit_rate_ul) { + if (cJSON_AddStringToObject(item, "maxBitRateUl", transfer_policy->max_bit_rate_ul) == NULL) { + ogs_error("OpenAPI_transfer_policy_convertToJSON() failed [max_bit_rate_ul]"); + goto end; + } + } + + if (!transfer_policy->rating_group) { + ogs_error("OpenAPI_transfer_policy_convertToJSON() failed [rating_group]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "ratingGroup", transfer_policy->rating_group) == NULL) { + ogs_error("OpenAPI_transfer_policy_convertToJSON() failed [rating_group]"); + goto end; + } + + if (!transfer_policy->rec_time_int) { + ogs_error("OpenAPI_transfer_policy_convertToJSON() failed [rec_time_int]"); + goto end; + } + cJSON *rec_time_int_local_JSON = OpenAPI_time_window_convertToJSON(transfer_policy->rec_time_int); + if (rec_time_int_local_JSON == NULL) { + ogs_error("OpenAPI_transfer_policy_convertToJSON() failed [rec_time_int]"); + goto end; + } + cJSON_AddItemToObject(item, "recTimeInt", rec_time_int_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_transfer_policy_convertToJSON() failed [rec_time_int]"); + goto end; + } + + if (!transfer_policy->trans_policy_id) { + ogs_error("OpenAPI_transfer_policy_convertToJSON() failed [trans_policy_id]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "transPolicyId", transfer_policy->trans_policy_id) == NULL) { + ogs_error("OpenAPI_transfer_policy_convertToJSON() failed [trans_policy_id]"); + goto end; + } + +end: + return item; +} + +OpenAPI_transfer_policy_t *OpenAPI_transfer_policy_parseFromJSON(cJSON *transfer_policyJSON) +{ + OpenAPI_transfer_policy_t *transfer_policy_local_var = NULL; + cJSON *max_bit_rate_dl = cJSON_GetObjectItemCaseSensitive(transfer_policyJSON, "maxBitRateDl"); + + if (max_bit_rate_dl) { + if (!cJSON_IsString(max_bit_rate_dl)) { + ogs_error("OpenAPI_transfer_policy_parseFromJSON() failed [max_bit_rate_dl]"); + goto end; + } + } + + cJSON *max_bit_rate_ul = cJSON_GetObjectItemCaseSensitive(transfer_policyJSON, "maxBitRateUl"); + + if (max_bit_rate_ul) { + if (!cJSON_IsString(max_bit_rate_ul)) { + ogs_error("OpenAPI_transfer_policy_parseFromJSON() failed [max_bit_rate_ul]"); + goto end; + } + } + + cJSON *rating_group = cJSON_GetObjectItemCaseSensitive(transfer_policyJSON, "ratingGroup"); + if (!rating_group) { + ogs_error("OpenAPI_transfer_policy_parseFromJSON() failed [rating_group]"); + goto end; + } + + + if (!cJSON_IsNumber(rating_group)) { + ogs_error("OpenAPI_transfer_policy_parseFromJSON() failed [rating_group]"); + goto end; + } + + cJSON *rec_time_int = cJSON_GetObjectItemCaseSensitive(transfer_policyJSON, "recTimeInt"); + if (!rec_time_int) { + ogs_error("OpenAPI_transfer_policy_parseFromJSON() failed [rec_time_int]"); + goto end; + } + + OpenAPI_time_window_t *rec_time_int_local_nonprim = NULL; + + rec_time_int_local_nonprim = OpenAPI_time_window_parseFromJSON(rec_time_int); + + cJSON *trans_policy_id = cJSON_GetObjectItemCaseSensitive(transfer_policyJSON, "transPolicyId"); + if (!trans_policy_id) { + ogs_error("OpenAPI_transfer_policy_parseFromJSON() failed [trans_policy_id]"); + goto end; + } + + + if (!cJSON_IsNumber(trans_policy_id)) { + ogs_error("OpenAPI_transfer_policy_parseFromJSON() failed [trans_policy_id]"); + goto end; + } + + transfer_policy_local_var = OpenAPI_transfer_policy_create ( + max_bit_rate_dl ? ogs_strdup(max_bit_rate_dl->valuestring) : NULL, + max_bit_rate_ul ? ogs_strdup(max_bit_rate_ul->valuestring) : NULL, + rating_group->valuedouble, + rec_time_int_local_nonprim, + trans_policy_id->valuedouble + ); + + return transfer_policy_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/transfer_policy.h b/lib/sbi/openapi/model/transfer_policy.h new file mode 100644 index 0000000000..d357b48168 --- /dev/null +++ b/lib/sbi/openapi/model/transfer_policy.h @@ -0,0 +1,46 @@ +/* + * transfer_policy.h + * + * Describes a transfer policy. + */ + +#ifndef _OpenAPI_transfer_policy_H_ +#define _OpenAPI_transfer_policy_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "time_window.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_transfer_policy_s OpenAPI_transfer_policy_t; +typedef struct OpenAPI_transfer_policy_s { + char *max_bit_rate_dl; + char *max_bit_rate_ul; + int rating_group; + struct OpenAPI_time_window_s *rec_time_int; + int trans_policy_id; +} OpenAPI_transfer_policy_t; + +OpenAPI_transfer_policy_t *OpenAPI_transfer_policy_create( + char *max_bit_rate_dl, + char *max_bit_rate_ul, + int rating_group, + OpenAPI_time_window_t *rec_time_int, + int trans_policy_id + ); +void OpenAPI_transfer_policy_free(OpenAPI_transfer_policy_t *transfer_policy); +OpenAPI_transfer_policy_t *OpenAPI_transfer_policy_parseFromJSON(cJSON *transfer_policyJSON); +cJSON *OpenAPI_transfer_policy_convertToJSON(OpenAPI_transfer_policy_t *transfer_policy); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_transfer_policy_H_ */ + diff --git a/lib/sbi/openapi/model/transport_protocol.c b/lib/sbi/openapi/model/transport_protocol.c index 89ac22f102..f2002ef560 100644 --- a/lib/sbi/openapi/model/transport_protocol.c +++ b/lib/sbi/openapi/model/transport_protocol.c @@ -4,27 +4,48 @@ #include #include "transport_protocol.h" -char* OpenAPI_transport_protocol_ToString(OpenAPI_transport_protocol_e transport_protocol) +OpenAPI_transport_protocol_t *OpenAPI_transport_protocol_create( + ) { - const char *transport_protocolArray[] = { "NULL", "TCP" }; - size_t sizeofArray = sizeof(transport_protocolArray) / sizeof(transport_protocolArray[0]); - if (transport_protocol < sizeofArray) - return (char *)transport_protocolArray[transport_protocol]; - else - return (char *)"Unknown"; -} - -OpenAPI_transport_protocol_e OpenAPI_transport_protocol_FromString(char* transport_protocol) -{ - int stringToReturn = 0; - const char *transport_protocolArray[] = { "NULL", "TCP" }; - size_t sizeofArray = sizeof(transport_protocolArray) / sizeof(transport_protocolArray[0]); - while (stringToReturn < sizeofArray) { - if (strcmp(transport_protocol, transport_protocolArray[stringToReturn]) == 0) { - return stringToReturn; - } - stringToReturn++; + OpenAPI_transport_protocol_t *transport_protocol_local_var = OpenAPI_malloc(sizeof(OpenAPI_transport_protocol_t)); + if (!transport_protocol_local_var) { + return NULL; } - return 0; + + return transport_protocol_local_var; +} + +void OpenAPI_transport_protocol_free(OpenAPI_transport_protocol_t *transport_protocol) +{ + if (NULL == transport_protocol) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(transport_protocol); +} + +cJSON *OpenAPI_transport_protocol_convertToJSON(OpenAPI_transport_protocol_t *transport_protocol) +{ + cJSON *item = NULL; + + if (transport_protocol == NULL) { + ogs_error("OpenAPI_transport_protocol_convertToJSON() failed [TransportProtocol]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_transport_protocol_t *OpenAPI_transport_protocol_parseFromJSON(cJSON *transport_protocolJSON) +{ + OpenAPI_transport_protocol_t *transport_protocol_local_var = NULL; + transport_protocol_local_var = OpenAPI_transport_protocol_create ( + ); + + return transport_protocol_local_var; +end: + return NULL; } diff --git a/lib/sbi/openapi/model/transport_protocol.h b/lib/sbi/openapi/model/transport_protocol.h index bdf4885506..bbfa3f4acb 100644 --- a/lib/sbi/openapi/model/transport_protocol.h +++ b/lib/sbi/openapi/model/transport_protocol.h @@ -1,7 +1,7 @@ /* * transport_protocol.h * - * + * Types of transport protocol used in a given IP endpoint of an NF Service Instance */ #ifndef _OpenAPI_transport_protocol_H_ @@ -17,11 +17,15 @@ extern "C" { #endif -typedef enum { OpenAPI_transport_protocol_NULL = 0, OpenAPI_transport_protocol_TCP } OpenAPI_transport_protocol_e; +typedef struct OpenAPI_transport_protocol_s OpenAPI_transport_protocol_t; +typedef struct OpenAPI_transport_protocol_s { +} OpenAPI_transport_protocol_t; -char* OpenAPI_transport_protocol_ToString(OpenAPI_transport_protocol_e transport_protocol); - -OpenAPI_transport_protocol_e OpenAPI_transport_protocol_FromString(char* transport_protocol); +OpenAPI_transport_protocol_t *OpenAPI_transport_protocol_create( + ); +void OpenAPI_transport_protocol_free(OpenAPI_transport_protocol_t *transport_protocol); +OpenAPI_transport_protocol_t *OpenAPI_transport_protocol_parseFromJSON(cJSON *transport_protocolJSON); +cJSON *OpenAPI_transport_protocol_convertToJSON(OpenAPI_transport_protocol_t *transport_protocol); #ifdef __cplusplus } diff --git a/lib/sbi/openapi/model/trigger_request.c b/lib/sbi/openapi/model/trigger_request.c new file mode 100644 index 0000000000..0f2269ed12 --- /dev/null +++ b/lib/sbi/openapi/model/trigger_request.c @@ -0,0 +1,76 @@ + +#include +#include +#include +#include "trigger_request.h" + +OpenAPI_trigger_request_t *OpenAPI_trigger_request_create( + char *supi + ) +{ + OpenAPI_trigger_request_t *trigger_request_local_var = OpenAPI_malloc(sizeof(OpenAPI_trigger_request_t)); + if (!trigger_request_local_var) { + return NULL; + } + trigger_request_local_var->supi = supi; + + return trigger_request_local_var; +} + +void OpenAPI_trigger_request_free(OpenAPI_trigger_request_t *trigger_request) +{ + if (NULL == trigger_request) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(trigger_request->supi); + ogs_free(trigger_request); +} + +cJSON *OpenAPI_trigger_request_convertToJSON(OpenAPI_trigger_request_t *trigger_request) +{ + cJSON *item = NULL; + + if (trigger_request == NULL) { + ogs_error("OpenAPI_trigger_request_convertToJSON() failed [TriggerRequest]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!trigger_request->supi) { + ogs_error("OpenAPI_trigger_request_convertToJSON() failed [supi]"); + goto end; + } + if (cJSON_AddStringToObject(item, "supi", trigger_request->supi) == NULL) { + ogs_error("OpenAPI_trigger_request_convertToJSON() failed [supi]"); + goto end; + } + +end: + return item; +} + +OpenAPI_trigger_request_t *OpenAPI_trigger_request_parseFromJSON(cJSON *trigger_requestJSON) +{ + OpenAPI_trigger_request_t *trigger_request_local_var = NULL; + cJSON *supi = cJSON_GetObjectItemCaseSensitive(trigger_requestJSON, "supi"); + if (!supi) { + ogs_error("OpenAPI_trigger_request_parseFromJSON() failed [supi]"); + goto end; + } + + + if (!cJSON_IsString(supi)) { + ogs_error("OpenAPI_trigger_request_parseFromJSON() failed [supi]"); + goto end; + } + + trigger_request_local_var = OpenAPI_trigger_request_create ( + ogs_strdup(supi->valuestring) + ); + + return trigger_request_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/trigger_request.h b/lib/sbi/openapi/model/trigger_request.h new file mode 100644 index 0000000000..56569c43ce --- /dev/null +++ b/lib/sbi/openapi/model/trigger_request.h @@ -0,0 +1,37 @@ +/* + * trigger_request.h + * + * + */ + +#ifndef _OpenAPI_trigger_request_H_ +#define _OpenAPI_trigger_request_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_trigger_request_s OpenAPI_trigger_request_t; +typedef struct OpenAPI_trigger_request_s { + char *supi; +} OpenAPI_trigger_request_t; + +OpenAPI_trigger_request_t *OpenAPI_trigger_request_create( + char *supi + ); +void OpenAPI_trigger_request_free(OpenAPI_trigger_request_t *trigger_request); +OpenAPI_trigger_request_t *OpenAPI_trigger_request_parseFromJSON(cJSON *trigger_requestJSON); +cJSON *OpenAPI_trigger_request_convertToJSON(OpenAPI_trigger_request_t *trigger_request); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_trigger_request_H_ */ + diff --git a/lib/sbi/openapi/model/twif_info.c b/lib/sbi/openapi/model/twif_info.c new file mode 100644 index 0000000000..c3903bda40 --- /dev/null +++ b/lib/sbi/openapi/model/twif_info.c @@ -0,0 +1,157 @@ + +#include +#include +#include +#include "twif_info.h" + +OpenAPI_twif_info_t *OpenAPI_twif_info_create( + OpenAPI_list_t *ipv4_endpoint_addresses, + OpenAPI_list_t *ipv6_endpoint_addresses, + char *endpoint_fqdn + ) +{ + OpenAPI_twif_info_t *twif_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_twif_info_t)); + if (!twif_info_local_var) { + return NULL; + } + twif_info_local_var->ipv4_endpoint_addresses = ipv4_endpoint_addresses; + twif_info_local_var->ipv6_endpoint_addresses = ipv6_endpoint_addresses; + twif_info_local_var->endpoint_fqdn = endpoint_fqdn; + + return twif_info_local_var; +} + +void OpenAPI_twif_info_free(OpenAPI_twif_info_t *twif_info) +{ + if (NULL == twif_info) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(twif_info->ipv4_endpoint_addresses, node) { + ogs_free(node->data); + } + OpenAPI_list_free(twif_info->ipv4_endpoint_addresses); + OpenAPI_list_for_each(twif_info->ipv6_endpoint_addresses, node) { + ogs_free(node->data); + } + OpenAPI_list_free(twif_info->ipv6_endpoint_addresses); + ogs_free(twif_info->endpoint_fqdn); + ogs_free(twif_info); +} + +cJSON *OpenAPI_twif_info_convertToJSON(OpenAPI_twif_info_t *twif_info) +{ + cJSON *item = NULL; + + if (twif_info == NULL) { + ogs_error("OpenAPI_twif_info_convertToJSON() failed [TwifInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (twif_info->ipv4_endpoint_addresses) { + cJSON *ipv4_endpoint_addresses = cJSON_AddArrayToObject(item, "ipv4EndpointAddresses"); + if (ipv4_endpoint_addresses == NULL) { + ogs_error("OpenAPI_twif_info_convertToJSON() failed [ipv4_endpoint_addresses]"); + goto end; + } + + OpenAPI_lnode_t *ipv4_endpoint_addresses_node; + OpenAPI_list_for_each(twif_info->ipv4_endpoint_addresses, ipv4_endpoint_addresses_node) { + if (cJSON_AddStringToObject(ipv4_endpoint_addresses, "", (char*)ipv4_endpoint_addresses_node->data) == NULL) { + ogs_error("OpenAPI_twif_info_convertToJSON() failed [ipv4_endpoint_addresses]"); + goto end; + } + } + } + + if (twif_info->ipv6_endpoint_addresses) { + cJSON *ipv6_endpoint_addresses = cJSON_AddArrayToObject(item, "ipv6EndpointAddresses"); + if (ipv6_endpoint_addresses == NULL) { + ogs_error("OpenAPI_twif_info_convertToJSON() failed [ipv6_endpoint_addresses]"); + goto end; + } + + OpenAPI_lnode_t *ipv6_endpoint_addresses_node; + OpenAPI_list_for_each(twif_info->ipv6_endpoint_addresses, ipv6_endpoint_addresses_node) { + if (cJSON_AddStringToObject(ipv6_endpoint_addresses, "", (char*)ipv6_endpoint_addresses_node->data) == NULL) { + ogs_error("OpenAPI_twif_info_convertToJSON() failed [ipv6_endpoint_addresses]"); + goto end; + } + } + } + + if (twif_info->endpoint_fqdn) { + if (cJSON_AddStringToObject(item, "endpointFqdn", twif_info->endpoint_fqdn) == NULL) { + ogs_error("OpenAPI_twif_info_convertToJSON() failed [endpoint_fqdn]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_twif_info_t *OpenAPI_twif_info_parseFromJSON(cJSON *twif_infoJSON) +{ + OpenAPI_twif_info_t *twif_info_local_var = NULL; + cJSON *ipv4_endpoint_addresses = cJSON_GetObjectItemCaseSensitive(twif_infoJSON, "ipv4EndpointAddresses"); + + OpenAPI_list_t *ipv4_endpoint_addressesList; + if (ipv4_endpoint_addresses) { + cJSON *ipv4_endpoint_addresses_local; + if (!cJSON_IsArray(ipv4_endpoint_addresses)) { + ogs_error("OpenAPI_twif_info_parseFromJSON() failed [ipv4_endpoint_addresses]"); + goto end; + } + ipv4_endpoint_addressesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv4_endpoint_addresses_local, ipv4_endpoint_addresses) { + if (!cJSON_IsString(ipv4_endpoint_addresses_local)) { + ogs_error("OpenAPI_twif_info_parseFromJSON() failed [ipv4_endpoint_addresses]"); + goto end; + } + OpenAPI_list_add(ipv4_endpoint_addressesList, ogs_strdup(ipv4_endpoint_addresses_local->valuestring)); + } + } + + cJSON *ipv6_endpoint_addresses = cJSON_GetObjectItemCaseSensitive(twif_infoJSON, "ipv6EndpointAddresses"); + + OpenAPI_list_t *ipv6_endpoint_addressesList; + if (ipv6_endpoint_addresses) { + cJSON *ipv6_endpoint_addresses_local; + if (!cJSON_IsArray(ipv6_endpoint_addresses)) { + ogs_error("OpenAPI_twif_info_parseFromJSON() failed [ipv6_endpoint_addresses]"); + goto end; + } + ipv6_endpoint_addressesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv6_endpoint_addresses_local, ipv6_endpoint_addresses) { + if (!cJSON_IsString(ipv6_endpoint_addresses_local)) { + ogs_error("OpenAPI_twif_info_parseFromJSON() failed [ipv6_endpoint_addresses]"); + goto end; + } + OpenAPI_list_add(ipv6_endpoint_addressesList, ogs_strdup(ipv6_endpoint_addresses_local->valuestring)); + } + } + + cJSON *endpoint_fqdn = cJSON_GetObjectItemCaseSensitive(twif_infoJSON, "endpointFqdn"); + + if (endpoint_fqdn) { + if (!cJSON_IsString(endpoint_fqdn)) { + ogs_error("OpenAPI_twif_info_parseFromJSON() failed [endpoint_fqdn]"); + goto end; + } + } + + twif_info_local_var = OpenAPI_twif_info_create ( + ipv4_endpoint_addresses ? ipv4_endpoint_addressesList : NULL, + ipv6_endpoint_addresses ? ipv6_endpoint_addressesList : NULL, + endpoint_fqdn ? ogs_strdup(endpoint_fqdn->valuestring) : NULL + ); + + return twif_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/twif_info.h b/lib/sbi/openapi/model/twif_info.h new file mode 100644 index 0000000000..d00679f3ed --- /dev/null +++ b/lib/sbi/openapi/model/twif_info.h @@ -0,0 +1,41 @@ +/* + * twif_info.h + * + * + */ + +#ifndef _OpenAPI_twif_info_H_ +#define _OpenAPI_twif_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_twif_info_s OpenAPI_twif_info_t; +typedef struct OpenAPI_twif_info_s { + OpenAPI_list_t *ipv4_endpoint_addresses; + OpenAPI_list_t *ipv6_endpoint_addresses; + char *endpoint_fqdn; +} OpenAPI_twif_info_t; + +OpenAPI_twif_info_t *OpenAPI_twif_info_create( + OpenAPI_list_t *ipv4_endpoint_addresses, + OpenAPI_list_t *ipv6_endpoint_addresses, + char *endpoint_fqdn + ); +void OpenAPI_twif_info_free(OpenAPI_twif_info_t *twif_info); +OpenAPI_twif_info_t *OpenAPI_twif_info_parseFromJSON(cJSON *twif_infoJSON); +cJSON *OpenAPI_twif_info_convertToJSON(OpenAPI_twif_info_t *twif_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_twif_info_H_ */ + diff --git a/lib/sbi/openapi/model/udm_info.c b/lib/sbi/openapi/model/udm_info.c index b0e7214813..49e005b61d 100644 --- a/lib/sbi/openapi/model/udm_info.c +++ b/lib/sbi/openapi/model/udm_info.c @@ -9,7 +9,8 @@ OpenAPI_udm_info_t *OpenAPI_udm_info_create( OpenAPI_list_t *supi_ranges, OpenAPI_list_t *gpsi_ranges, OpenAPI_list_t *external_group_identifiers_ranges, - OpenAPI_list_t *routing_indicators + OpenAPI_list_t *routing_indicators, + OpenAPI_list_t *internal_group_identifiers_ranges ) { OpenAPI_udm_info_t *udm_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_udm_info_t)); @@ -21,6 +22,7 @@ OpenAPI_udm_info_t *OpenAPI_udm_info_create( udm_info_local_var->gpsi_ranges = gpsi_ranges; udm_info_local_var->external_group_identifiers_ranges = external_group_identifiers_ranges; udm_info_local_var->routing_indicators = routing_indicators; + udm_info_local_var->internal_group_identifiers_ranges = internal_group_identifiers_ranges; return udm_info_local_var; } @@ -48,6 +50,10 @@ void OpenAPI_udm_info_free(OpenAPI_udm_info_t *udm_info) ogs_free(node->data); } OpenAPI_list_free(udm_info->routing_indicators); + OpenAPI_list_for_each(udm_info->internal_group_identifiers_ranges, node) { + OpenAPI_internal_group_id_range_free(node->data); + } + OpenAPI_list_free(udm_info->internal_group_identifiers_ranges); ogs_free(udm_info); } @@ -144,6 +150,26 @@ cJSON *OpenAPI_udm_info_convertToJSON(OpenAPI_udm_info_t *udm_info) } } + if (udm_info->internal_group_identifiers_ranges) { + cJSON *internal_group_identifiers_rangesList = cJSON_AddArrayToObject(item, "internalGroupIdentifiersRanges"); + if (internal_group_identifiers_rangesList == NULL) { + ogs_error("OpenAPI_udm_info_convertToJSON() failed [internal_group_identifiers_ranges]"); + goto end; + } + + OpenAPI_lnode_t *internal_group_identifiers_ranges_node; + if (udm_info->internal_group_identifiers_ranges) { + OpenAPI_list_for_each(udm_info->internal_group_identifiers_ranges, internal_group_identifiers_ranges_node) { + cJSON *itemLocal = OpenAPI_internal_group_id_range_convertToJSON(internal_group_identifiers_ranges_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_udm_info_convertToJSON() failed [internal_group_identifiers_ranges]"); + goto end; + } + cJSON_AddItemToArray(internal_group_identifiers_rangesList, itemLocal); + } + } + } + end: return item; } @@ -249,12 +275,36 @@ OpenAPI_udm_info_t *OpenAPI_udm_info_parseFromJSON(cJSON *udm_infoJSON) } } + cJSON *internal_group_identifiers_ranges = cJSON_GetObjectItemCaseSensitive(udm_infoJSON, "internalGroupIdentifiersRanges"); + + OpenAPI_list_t *internal_group_identifiers_rangesList; + if (internal_group_identifiers_ranges) { + cJSON *internal_group_identifiers_ranges_local_nonprimitive; + if (!cJSON_IsArray(internal_group_identifiers_ranges)) { + ogs_error("OpenAPI_udm_info_parseFromJSON() failed [internal_group_identifiers_ranges]"); + goto end; + } + + internal_group_identifiers_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(internal_group_identifiers_ranges_local_nonprimitive, internal_group_identifiers_ranges ) { + if (!cJSON_IsObject(internal_group_identifiers_ranges_local_nonprimitive)) { + ogs_error("OpenAPI_udm_info_parseFromJSON() failed [internal_group_identifiers_ranges]"); + goto end; + } + OpenAPI_internal_group_id_range_t *internal_group_identifiers_rangesItem = OpenAPI_internal_group_id_range_parseFromJSON(internal_group_identifiers_ranges_local_nonprimitive); + + OpenAPI_list_add(internal_group_identifiers_rangesList, internal_group_identifiers_rangesItem); + } + } + udm_info_local_var = OpenAPI_udm_info_create ( group_id ? ogs_strdup(group_id->valuestring) : NULL, supi_ranges ? supi_rangesList : NULL, gpsi_ranges ? gpsi_rangesList : NULL, external_group_identifiers_ranges ? external_group_identifiers_rangesList : NULL, - routing_indicators ? routing_indicatorsList : NULL + routing_indicators ? routing_indicatorsList : NULL, + internal_group_identifiers_ranges ? internal_group_identifiers_rangesList : NULL ); return udm_info_local_var; diff --git a/lib/sbi/openapi/model/udm_info.h b/lib/sbi/openapi/model/udm_info.h index 978c2c5e57..f85eec5d51 100644 --- a/lib/sbi/openapi/model/udm_info.h +++ b/lib/sbi/openapi/model/udm_info.h @@ -1,7 +1,7 @@ /* * udm_info.h * - * + * Information of an UDM NF Instance */ #ifndef _OpenAPI_udm_info_H_ @@ -13,6 +13,7 @@ #include "../include/keyValuePair.h" #include "../include/binary.h" #include "identity_range.h" +#include "internal_group_id_range.h" #include "supi_range.h" #ifdef __cplusplus @@ -26,6 +27,7 @@ typedef struct OpenAPI_udm_info_s { OpenAPI_list_t *gpsi_ranges; OpenAPI_list_t *external_group_identifiers_ranges; OpenAPI_list_t *routing_indicators; + OpenAPI_list_t *internal_group_identifiers_ranges; } OpenAPI_udm_info_t; OpenAPI_udm_info_t *OpenAPI_udm_info_create( @@ -33,7 +35,8 @@ OpenAPI_udm_info_t *OpenAPI_udm_info_create( OpenAPI_list_t *supi_ranges, OpenAPI_list_t *gpsi_ranges, OpenAPI_list_t *external_group_identifiers_ranges, - OpenAPI_list_t *routing_indicators + OpenAPI_list_t *routing_indicators, + OpenAPI_list_t *internal_group_identifiers_ranges ); void OpenAPI_udm_info_free(OpenAPI_udm_info_t *udm_info); OpenAPI_udm_info_t *OpenAPI_udm_info_parseFromJSON(cJSON *udm_infoJSON); diff --git a/lib/sbi/openapi/model/udr_info.h b/lib/sbi/openapi/model/udr_info.h index d09a8f277b..3845cf4d31 100644 --- a/lib/sbi/openapi/model/udr_info.h +++ b/lib/sbi/openapi/model/udr_info.h @@ -1,7 +1,7 @@ /* * udr_info.h * - * + * Information of an UDR NF Instance */ #ifndef _OpenAPI_udr_info_H_ diff --git a/lib/sbi/openapi/model/udsf_info.c b/lib/sbi/openapi/model/udsf_info.c new file mode 100644 index 0000000000..3a3a08d04c --- /dev/null +++ b/lib/sbi/openapi/model/udsf_info.c @@ -0,0 +1,121 @@ + +#include +#include +#include +#include "udsf_info.h" + +OpenAPI_udsf_info_t *OpenAPI_udsf_info_create( + char *group_id, + OpenAPI_list_t *supi_ranges + ) +{ + OpenAPI_udsf_info_t *udsf_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_udsf_info_t)); + if (!udsf_info_local_var) { + return NULL; + } + udsf_info_local_var->group_id = group_id; + udsf_info_local_var->supi_ranges = supi_ranges; + + return udsf_info_local_var; +} + +void OpenAPI_udsf_info_free(OpenAPI_udsf_info_t *udsf_info) +{ + if (NULL == udsf_info) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(udsf_info->group_id); + OpenAPI_list_for_each(udsf_info->supi_ranges, node) { + OpenAPI_supi_range_free(node->data); + } + OpenAPI_list_free(udsf_info->supi_ranges); + ogs_free(udsf_info); +} + +cJSON *OpenAPI_udsf_info_convertToJSON(OpenAPI_udsf_info_t *udsf_info) +{ + cJSON *item = NULL; + + if (udsf_info == NULL) { + ogs_error("OpenAPI_udsf_info_convertToJSON() failed [UdsfInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (udsf_info->group_id) { + if (cJSON_AddStringToObject(item, "groupId", udsf_info->group_id) == NULL) { + ogs_error("OpenAPI_udsf_info_convertToJSON() failed [group_id]"); + goto end; + } + } + + if (udsf_info->supi_ranges) { + cJSON *supi_rangesList = cJSON_AddArrayToObject(item, "supiRanges"); + if (supi_rangesList == NULL) { + ogs_error("OpenAPI_udsf_info_convertToJSON() failed [supi_ranges]"); + goto end; + } + + OpenAPI_lnode_t *supi_ranges_node; + if (udsf_info->supi_ranges) { + OpenAPI_list_for_each(udsf_info->supi_ranges, supi_ranges_node) { + cJSON *itemLocal = OpenAPI_supi_range_convertToJSON(supi_ranges_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_udsf_info_convertToJSON() failed [supi_ranges]"); + goto end; + } + cJSON_AddItemToArray(supi_rangesList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_udsf_info_t *OpenAPI_udsf_info_parseFromJSON(cJSON *udsf_infoJSON) +{ + OpenAPI_udsf_info_t *udsf_info_local_var = NULL; + cJSON *group_id = cJSON_GetObjectItemCaseSensitive(udsf_infoJSON, "groupId"); + + if (group_id) { + if (!cJSON_IsString(group_id)) { + ogs_error("OpenAPI_udsf_info_parseFromJSON() failed [group_id]"); + goto end; + } + } + + cJSON *supi_ranges = cJSON_GetObjectItemCaseSensitive(udsf_infoJSON, "supiRanges"); + + OpenAPI_list_t *supi_rangesList; + if (supi_ranges) { + cJSON *supi_ranges_local_nonprimitive; + if (!cJSON_IsArray(supi_ranges)) { + ogs_error("OpenAPI_udsf_info_parseFromJSON() failed [supi_ranges]"); + goto end; + } + + supi_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(supi_ranges_local_nonprimitive, supi_ranges ) { + if (!cJSON_IsObject(supi_ranges_local_nonprimitive)) { + ogs_error("OpenAPI_udsf_info_parseFromJSON() failed [supi_ranges]"); + goto end; + } + OpenAPI_supi_range_t *supi_rangesItem = OpenAPI_supi_range_parseFromJSON(supi_ranges_local_nonprimitive); + + OpenAPI_list_add(supi_rangesList, supi_rangesItem); + } + } + + udsf_info_local_var = OpenAPI_udsf_info_create ( + group_id ? ogs_strdup(group_id->valuestring) : NULL, + supi_ranges ? supi_rangesList : NULL + ); + + return udsf_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/udsf_info.h b/lib/sbi/openapi/model/udsf_info.h new file mode 100644 index 0000000000..0476a8bcf9 --- /dev/null +++ b/lib/sbi/openapi/model/udsf_info.h @@ -0,0 +1,40 @@ +/* + * udsf_info.h + * + * + */ + +#ifndef _OpenAPI_udsf_info_H_ +#define _OpenAPI_udsf_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "supi_range.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_udsf_info_s OpenAPI_udsf_info_t; +typedef struct OpenAPI_udsf_info_s { + char *group_id; + OpenAPI_list_t *supi_ranges; +} OpenAPI_udsf_info_t; + +OpenAPI_udsf_info_t *OpenAPI_udsf_info_create( + char *group_id, + OpenAPI_list_t *supi_ranges + ); +void OpenAPI_udsf_info_free(OpenAPI_udsf_info_t *udsf_info); +OpenAPI_udsf_info_t *OpenAPI_udsf_info_parseFromJSON(cJSON *udsf_infoJSON); +cJSON *OpenAPI_udsf_info_convertToJSON(OpenAPI_udsf_info_t *udsf_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_udsf_info_H_ */ + diff --git a/lib/sbi/openapi/model/ue_auth.c b/lib/sbi/openapi/model/ue_auth.c new file mode 100644 index 0000000000..9fba8bba81 --- /dev/null +++ b/lib/sbi/openapi/model/ue_auth.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "ue_auth.h" + +OpenAPI_ue_auth_t *OpenAPI_ue_auth_create( + ) +{ + OpenAPI_ue_auth_t *ue_auth_local_var = OpenAPI_malloc(sizeof(OpenAPI_ue_auth_t)); + if (!ue_auth_local_var) { + return NULL; + } + + return ue_auth_local_var; +} + +void OpenAPI_ue_auth_free(OpenAPI_ue_auth_t *ue_auth) +{ + if (NULL == ue_auth) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(ue_auth); +} + +cJSON *OpenAPI_ue_auth_convertToJSON(OpenAPI_ue_auth_t *ue_auth) +{ + cJSON *item = NULL; + + if (ue_auth == NULL) { + ogs_error("OpenAPI_ue_auth_convertToJSON() failed [UeAuth]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_ue_auth_t *OpenAPI_ue_auth_parseFromJSON(cJSON *ue_authJSON) +{ + OpenAPI_ue_auth_t *ue_auth_local_var = NULL; + ue_auth_local_var = OpenAPI_ue_auth_create ( + ); + + return ue_auth_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/ue_auth.h b/lib/sbi/openapi/model/ue_auth.h new file mode 100644 index 0000000000..c1ca50f694 --- /dev/null +++ b/lib/sbi/openapi/model/ue_auth.h @@ -0,0 +1,35 @@ +/* + * ue_auth.h + * + * + */ + +#ifndef _OpenAPI_ue_auth_H_ +#define _OpenAPI_ue_auth_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_ue_auth_s OpenAPI_ue_auth_t; +typedef struct OpenAPI_ue_auth_s { +} OpenAPI_ue_auth_t; + +OpenAPI_ue_auth_t *OpenAPI_ue_auth_create( + ); +void OpenAPI_ue_auth_free(OpenAPI_ue_auth_t *ue_auth); +OpenAPI_ue_auth_t *OpenAPI_ue_auth_parseFromJSON(cJSON *ue_authJSON); +cJSON *OpenAPI_ue_auth_convertToJSON(OpenAPI_ue_auth_t *ue_auth); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_ue_auth_H_ */ + diff --git a/lib/sbi/openapi/model/ue_authentication_ctx.c b/lib/sbi/openapi/model/ue_authentication_ctx.c new file mode 100644 index 0000000000..d238bb3168 --- /dev/null +++ b/lib/sbi/openapi/model/ue_authentication_ctx.c @@ -0,0 +1,184 @@ + +#include +#include +#include +#include "ue_authentication_ctx.h" + +OpenAPI_ue_authentication_ctx_t *OpenAPI_ue_authentication_ctx_create( + OpenAPI_auth_type_e auth_type, + OpenAPI_av5g_aka_t *_5g_auth_data, + OpenAPI_list_t* _links, + char *serving_network_name + ) +{ + OpenAPI_ue_authentication_ctx_t *ue_authentication_ctx_local_var = OpenAPI_malloc(sizeof(OpenAPI_ue_authentication_ctx_t)); + if (!ue_authentication_ctx_local_var) { + return NULL; + } + ue_authentication_ctx_local_var->auth_type = auth_type; + ue_authentication_ctx_local_var->_5g_auth_data = _5g_auth_data; + ue_authentication_ctx_local_var->_links = _links; + ue_authentication_ctx_local_var->serving_network_name = serving_network_name; + + return ue_authentication_ctx_local_var; +} + +void OpenAPI_ue_authentication_ctx_free(OpenAPI_ue_authentication_ctx_t *ue_authentication_ctx) +{ + if (NULL == ue_authentication_ctx) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_av5g_aka_free(ue_authentication_ctx->_5g_auth_data); + OpenAPI_list_for_each(ue_authentication_ctx->_links, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_links_value_schema_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(ue_authentication_ctx->_links); + ogs_free(ue_authentication_ctx->serving_network_name); + ogs_free(ue_authentication_ctx); +} + +cJSON *OpenAPI_ue_authentication_ctx_convertToJSON(OpenAPI_ue_authentication_ctx_t *ue_authentication_ctx) +{ + cJSON *item = NULL; + + if (ue_authentication_ctx == NULL) { + ogs_error("OpenAPI_ue_authentication_ctx_convertToJSON() failed [UEAuthenticationCtx]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!ue_authentication_ctx->auth_type) { + ogs_error("OpenAPI_ue_authentication_ctx_convertToJSON() failed [auth_type]"); + goto end; + } + if (cJSON_AddStringToObject(item, "authType", OpenAPI_auth_type_ToString(ue_authentication_ctx->auth_type)) == NULL) { + ogs_error("OpenAPI_ue_authentication_ctx_convertToJSON() failed [auth_type]"); + goto end; + } + + if (!ue_authentication_ctx->_5g_auth_data) { + ogs_error("OpenAPI_ue_authentication_ctx_convertToJSON() failed [_5g_auth_data]"); + goto end; + } + cJSON *_5g_auth_data_local_JSON = OpenAPI_av5g_aka_convertToJSON(ue_authentication_ctx->_5g_auth_data); + if (_5g_auth_data_local_JSON == NULL) { + ogs_error("OpenAPI_ue_authentication_ctx_convertToJSON() failed [_5g_auth_data]"); + goto end; + } + cJSON_AddItemToObject(item, "5gAuthData", _5g_auth_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_ue_authentication_ctx_convertToJSON() failed [_5g_auth_data]"); + goto end; + } + + if (!ue_authentication_ctx->_links) { + ogs_error("OpenAPI_ue_authentication_ctx_convertToJSON() failed [_links]"); + goto end; + } + cJSON *_links = cJSON_AddObjectToObject(item, "_links"); + if (_links == NULL) { + ogs_error("OpenAPI_ue_authentication_ctx_convertToJSON() failed [_links]"); + goto end; + } + cJSON *localMapObject = _links; + OpenAPI_lnode_t *_links_node; + if (ue_authentication_ctx->_links) { + OpenAPI_list_for_each(ue_authentication_ctx->_links, _links_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)_links_node->data; + cJSON *itemLocal = OpenAPI_links_value_schema_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ue_authentication_ctx_convertToJSON() failed [_links]"); + goto end; + } + cJSON_AddItemToObject(_links, localKeyValue->key, itemLocal); + } + } + + if (ue_authentication_ctx->serving_network_name) { + if (cJSON_AddStringToObject(item, "servingNetworkName", ue_authentication_ctx->serving_network_name) == NULL) { + ogs_error("OpenAPI_ue_authentication_ctx_convertToJSON() failed [serving_network_name]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_ue_authentication_ctx_t *OpenAPI_ue_authentication_ctx_parseFromJSON(cJSON *ue_authentication_ctxJSON) +{ + OpenAPI_ue_authentication_ctx_t *ue_authentication_ctx_local_var = NULL; + cJSON *auth_type = cJSON_GetObjectItemCaseSensitive(ue_authentication_ctxJSON, "authType"); + if (!auth_type) { + ogs_error("OpenAPI_ue_authentication_ctx_parseFromJSON() failed [auth_type]"); + goto end; + } + + OpenAPI_auth_type_e auth_typeVariable; + + if (!cJSON_IsString(auth_type)) { + ogs_error("OpenAPI_ue_authentication_ctx_parseFromJSON() failed [auth_type]"); + goto end; + } + auth_typeVariable = OpenAPI_auth_type_FromString(auth_type->valuestring); + + cJSON *_5g_auth_data = cJSON_GetObjectItemCaseSensitive(ue_authentication_ctxJSON, "5gAuthData"); + if (!_5g_auth_data) { + ogs_error("OpenAPI_ue_authentication_ctx_parseFromJSON() failed [_5g_auth_data]"); + goto end; + } + + OpenAPI_av5g_aka_t *_5g_auth_data_local_nonprim = NULL; + + _5g_auth_data_local_nonprim = OpenAPI_av5g_aka_parseFromJSON(_5g_auth_data); + + cJSON *_links = cJSON_GetObjectItemCaseSensitive(ue_authentication_ctxJSON, "_links"); + if (!_links) { + ogs_error("OpenAPI_ue_authentication_ctx_parseFromJSON() failed [_links]"); + goto end; + } + + OpenAPI_list_t *_linksList; + + cJSON *_links_local_map; + if (!cJSON_IsObject(_links)) { + ogs_error("OpenAPI_ue_authentication_ctx_parseFromJSON() failed [_links]"); + goto end; + } + _linksList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(_links_local_map, _links) { + cJSON *localMapObject = _links_local_map; + if (!cJSON_IsObject(_links_local_map)) { + ogs_error("OpenAPI_ue_authentication_ctx_parseFromJSON() failed [_links]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_links_value_schema_parseFromJSON(localMapObject)); + OpenAPI_list_add(_linksList, localMapKeyPair); + } + + cJSON *serving_network_name = cJSON_GetObjectItemCaseSensitive(ue_authentication_ctxJSON, "servingNetworkName"); + + if (serving_network_name) { + if (!cJSON_IsString(serving_network_name)) { + ogs_error("OpenAPI_ue_authentication_ctx_parseFromJSON() failed [serving_network_name]"); + goto end; + } + } + + ue_authentication_ctx_local_var = OpenAPI_ue_authentication_ctx_create ( + auth_typeVariable, + _5g_auth_data_local_nonprim, + _linksList, + serving_network_name ? ogs_strdup(serving_network_name->valuestring) : NULL + ); + + return ue_authentication_ctx_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/ue_authentication_ctx.h b/lib/sbi/openapi/model/ue_authentication_ctx.h new file mode 100644 index 0000000000..ddc4ed5076 --- /dev/null +++ b/lib/sbi/openapi/model/ue_authentication_ctx.h @@ -0,0 +1,46 @@ +/* + * ue_authentication_ctx.h + * + * + */ + +#ifndef _OpenAPI_ue_authentication_ctx_H_ +#define _OpenAPI_ue_authentication_ctx_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "auth_type.h" +#include "av5g_aka.h" +#include "links_value_schema.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_ue_authentication_ctx_s OpenAPI_ue_authentication_ctx_t; +typedef struct OpenAPI_ue_authentication_ctx_s { + OpenAPI_auth_type_e auth_type; + struct OpenAPI_av5g_aka_s *_5g_auth_data; + OpenAPI_list_t* _links; + char *serving_network_name; +} OpenAPI_ue_authentication_ctx_t; + +OpenAPI_ue_authentication_ctx_t *OpenAPI_ue_authentication_ctx_create( + OpenAPI_auth_type_e auth_type, + OpenAPI_av5g_aka_t *_5g_auth_data, + OpenAPI_list_t* _links, + char *serving_network_name + ); +void OpenAPI_ue_authentication_ctx_free(OpenAPI_ue_authentication_ctx_t *ue_authentication_ctx); +OpenAPI_ue_authentication_ctx_t *OpenAPI_ue_authentication_ctx_parseFromJSON(cJSON *ue_authentication_ctxJSON); +cJSON *OpenAPI_ue_authentication_ctx_convertToJSON(OpenAPI_ue_authentication_ctx_t *ue_authentication_ctx); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_ue_authentication_ctx_H_ */ + diff --git a/lib/sbi/openapi/model/ue_context_in_smf_data.c b/lib/sbi/openapi/model/ue_context_in_smf_data.c new file mode 100644 index 0000000000..4b90e022ff --- /dev/null +++ b/lib/sbi/openapi/model/ue_context_in_smf_data.c @@ -0,0 +1,178 @@ + +#include +#include +#include +#include "ue_context_in_smf_data.h" + +OpenAPI_ue_context_in_smf_data_t *OpenAPI_ue_context_in_smf_data_create( + OpenAPI_list_t* pdu_sessions, + OpenAPI_list_t *pgw_info, + OpenAPI_emergency_info_t *emergency_info + ) +{ + OpenAPI_ue_context_in_smf_data_t *ue_context_in_smf_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_ue_context_in_smf_data_t)); + if (!ue_context_in_smf_data_local_var) { + return NULL; + } + ue_context_in_smf_data_local_var->pdu_sessions = pdu_sessions; + ue_context_in_smf_data_local_var->pgw_info = pgw_info; + ue_context_in_smf_data_local_var->emergency_info = emergency_info; + + return ue_context_in_smf_data_local_var; +} + +void OpenAPI_ue_context_in_smf_data_free(OpenAPI_ue_context_in_smf_data_t *ue_context_in_smf_data) +{ + if (NULL == ue_context_in_smf_data) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(ue_context_in_smf_data->pdu_sessions, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_pdu_session_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(ue_context_in_smf_data->pdu_sessions); + OpenAPI_list_for_each(ue_context_in_smf_data->pgw_info, node) { + OpenAPI_pgw_info_free(node->data); + } + OpenAPI_list_free(ue_context_in_smf_data->pgw_info); + OpenAPI_emergency_info_free(ue_context_in_smf_data->emergency_info); + ogs_free(ue_context_in_smf_data); +} + +cJSON *OpenAPI_ue_context_in_smf_data_convertToJSON(OpenAPI_ue_context_in_smf_data_t *ue_context_in_smf_data) +{ + cJSON *item = NULL; + + if (ue_context_in_smf_data == NULL) { + ogs_error("OpenAPI_ue_context_in_smf_data_convertToJSON() failed [UeContextInSmfData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (ue_context_in_smf_data->pdu_sessions) { + cJSON *pdu_sessions = cJSON_AddObjectToObject(item, "pduSessions"); + if (pdu_sessions == NULL) { + ogs_error("OpenAPI_ue_context_in_smf_data_convertToJSON() failed [pdu_sessions]"); + goto end; + } + cJSON *localMapObject = pdu_sessions; + OpenAPI_lnode_t *pdu_sessions_node; + if (ue_context_in_smf_data->pdu_sessions) { + OpenAPI_list_for_each(ue_context_in_smf_data->pdu_sessions, pdu_sessions_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)pdu_sessions_node->data; + cJSON *itemLocal = OpenAPI_pdu_session_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ue_context_in_smf_data_convertToJSON() failed [pdu_sessions]"); + goto end; + } + cJSON_AddItemToObject(pdu_sessions, localKeyValue->key, itemLocal); + } + } + } + + if (ue_context_in_smf_data->pgw_info) { + cJSON *pgw_infoList = cJSON_AddArrayToObject(item, "pgwInfo"); + if (pgw_infoList == NULL) { + ogs_error("OpenAPI_ue_context_in_smf_data_convertToJSON() failed [pgw_info]"); + goto end; + } + + OpenAPI_lnode_t *pgw_info_node; + if (ue_context_in_smf_data->pgw_info) { + OpenAPI_list_for_each(ue_context_in_smf_data->pgw_info, pgw_info_node) { + cJSON *itemLocal = OpenAPI_pgw_info_convertToJSON(pgw_info_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ue_context_in_smf_data_convertToJSON() failed [pgw_info]"); + goto end; + } + cJSON_AddItemToArray(pgw_infoList, itemLocal); + } + } + } + + if (ue_context_in_smf_data->emergency_info) { + cJSON *emergency_info_local_JSON = OpenAPI_emergency_info_convertToJSON(ue_context_in_smf_data->emergency_info); + if (emergency_info_local_JSON == NULL) { + ogs_error("OpenAPI_ue_context_in_smf_data_convertToJSON() failed [emergency_info]"); + goto end; + } + cJSON_AddItemToObject(item, "emergencyInfo", emergency_info_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_ue_context_in_smf_data_convertToJSON() failed [emergency_info]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_ue_context_in_smf_data_t *OpenAPI_ue_context_in_smf_data_parseFromJSON(cJSON *ue_context_in_smf_dataJSON) +{ + OpenAPI_ue_context_in_smf_data_t *ue_context_in_smf_data_local_var = NULL; + cJSON *pdu_sessions = cJSON_GetObjectItemCaseSensitive(ue_context_in_smf_dataJSON, "pduSessions"); + + OpenAPI_list_t *pdu_sessionsList; + if (pdu_sessions) { + cJSON *pdu_sessions_local_map; + if (!cJSON_IsObject(pdu_sessions)) { + ogs_error("OpenAPI_ue_context_in_smf_data_parseFromJSON() failed [pdu_sessions]"); + goto end; + } + pdu_sessionsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(pdu_sessions_local_map, pdu_sessions) { + cJSON *localMapObject = pdu_sessions_local_map; + if (!cJSON_IsObject(pdu_sessions_local_map)) { + ogs_error("OpenAPI_ue_context_in_smf_data_parseFromJSON() failed [pdu_sessions]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_pdu_session_parseFromJSON(localMapObject)); + OpenAPI_list_add(pdu_sessionsList, localMapKeyPair); + } + } + + cJSON *pgw_info = cJSON_GetObjectItemCaseSensitive(ue_context_in_smf_dataJSON, "pgwInfo"); + + OpenAPI_list_t *pgw_infoList; + if (pgw_info) { + cJSON *pgw_info_local_nonprimitive; + if (!cJSON_IsArray(pgw_info)) { + ogs_error("OpenAPI_ue_context_in_smf_data_parseFromJSON() failed [pgw_info]"); + goto end; + } + + pgw_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pgw_info_local_nonprimitive, pgw_info ) { + if (!cJSON_IsObject(pgw_info_local_nonprimitive)) { + ogs_error("OpenAPI_ue_context_in_smf_data_parseFromJSON() failed [pgw_info]"); + goto end; + } + OpenAPI_pgw_info_t *pgw_infoItem = OpenAPI_pgw_info_parseFromJSON(pgw_info_local_nonprimitive); + + OpenAPI_list_add(pgw_infoList, pgw_infoItem); + } + } + + cJSON *emergency_info = cJSON_GetObjectItemCaseSensitive(ue_context_in_smf_dataJSON, "emergencyInfo"); + + OpenAPI_emergency_info_t *emergency_info_local_nonprim = NULL; + if (emergency_info) { + emergency_info_local_nonprim = OpenAPI_emergency_info_parseFromJSON(emergency_info); + } + + ue_context_in_smf_data_local_var = OpenAPI_ue_context_in_smf_data_create ( + pdu_sessions ? pdu_sessionsList : NULL, + pgw_info ? pgw_infoList : NULL, + emergency_info ? emergency_info_local_nonprim : NULL + ); + + return ue_context_in_smf_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/ue_context_in_smf_data.h b/lib/sbi/openapi/model/ue_context_in_smf_data.h new file mode 100644 index 0000000000..5e08c1642a --- /dev/null +++ b/lib/sbi/openapi/model/ue_context_in_smf_data.h @@ -0,0 +1,44 @@ +/* + * ue_context_in_smf_data.h + * + * + */ + +#ifndef _OpenAPI_ue_context_in_smf_data_H_ +#define _OpenAPI_ue_context_in_smf_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "emergency_info.h" +#include "pdu_session.h" +#include "pgw_info.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_ue_context_in_smf_data_s OpenAPI_ue_context_in_smf_data_t; +typedef struct OpenAPI_ue_context_in_smf_data_s { + OpenAPI_list_t* pdu_sessions; + OpenAPI_list_t *pgw_info; + struct OpenAPI_emergency_info_s *emergency_info; +} OpenAPI_ue_context_in_smf_data_t; + +OpenAPI_ue_context_in_smf_data_t *OpenAPI_ue_context_in_smf_data_create( + OpenAPI_list_t* pdu_sessions, + OpenAPI_list_t *pgw_info, + OpenAPI_emergency_info_t *emergency_info + ); +void OpenAPI_ue_context_in_smf_data_free(OpenAPI_ue_context_in_smf_data_t *ue_context_in_smf_data); +OpenAPI_ue_context_in_smf_data_t *OpenAPI_ue_context_in_smf_data_parseFromJSON(cJSON *ue_context_in_smf_dataJSON); +cJSON *OpenAPI_ue_context_in_smf_data_convertToJSON(OpenAPI_ue_context_in_smf_data_t *ue_context_in_smf_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_ue_context_in_smf_data_H_ */ + diff --git a/lib/sbi/openapi/model/ue_context_in_smsf_data.c b/lib/sbi/openapi/model/ue_context_in_smsf_data.c new file mode 100644 index 0000000000..9506d1afa4 --- /dev/null +++ b/lib/sbi/openapi/model/ue_context_in_smsf_data.c @@ -0,0 +1,99 @@ + +#include +#include +#include +#include "ue_context_in_smsf_data.h" + +OpenAPI_ue_context_in_smsf_data_t *OpenAPI_ue_context_in_smsf_data_create( + OpenAPI_smsf_info_t *smsf_info3_gpp_access, + OpenAPI_smsf_info_t *smsf_info_non3_gpp_access + ) +{ + OpenAPI_ue_context_in_smsf_data_t *ue_context_in_smsf_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_ue_context_in_smsf_data_t)); + if (!ue_context_in_smsf_data_local_var) { + return NULL; + } + ue_context_in_smsf_data_local_var->smsf_info3_gpp_access = smsf_info3_gpp_access; + ue_context_in_smsf_data_local_var->smsf_info_non3_gpp_access = smsf_info_non3_gpp_access; + + return ue_context_in_smsf_data_local_var; +} + +void OpenAPI_ue_context_in_smsf_data_free(OpenAPI_ue_context_in_smsf_data_t *ue_context_in_smsf_data) +{ + if (NULL == ue_context_in_smsf_data) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_smsf_info_free(ue_context_in_smsf_data->smsf_info3_gpp_access); + OpenAPI_smsf_info_free(ue_context_in_smsf_data->smsf_info_non3_gpp_access); + ogs_free(ue_context_in_smsf_data); +} + +cJSON *OpenAPI_ue_context_in_smsf_data_convertToJSON(OpenAPI_ue_context_in_smsf_data_t *ue_context_in_smsf_data) +{ + cJSON *item = NULL; + + if (ue_context_in_smsf_data == NULL) { + ogs_error("OpenAPI_ue_context_in_smsf_data_convertToJSON() failed [UeContextInSmsfData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (ue_context_in_smsf_data->smsf_info3_gpp_access) { + cJSON *smsf_info3_gpp_access_local_JSON = OpenAPI_smsf_info_convertToJSON(ue_context_in_smsf_data->smsf_info3_gpp_access); + if (smsf_info3_gpp_access_local_JSON == NULL) { + ogs_error("OpenAPI_ue_context_in_smsf_data_convertToJSON() failed [smsf_info3_gpp_access]"); + goto end; + } + cJSON_AddItemToObject(item, "smsfInfo3GppAccess", smsf_info3_gpp_access_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_ue_context_in_smsf_data_convertToJSON() failed [smsf_info3_gpp_access]"); + goto end; + } + } + + if (ue_context_in_smsf_data->smsf_info_non3_gpp_access) { + cJSON *smsf_info_non3_gpp_access_local_JSON = OpenAPI_smsf_info_convertToJSON(ue_context_in_smsf_data->smsf_info_non3_gpp_access); + if (smsf_info_non3_gpp_access_local_JSON == NULL) { + ogs_error("OpenAPI_ue_context_in_smsf_data_convertToJSON() failed [smsf_info_non3_gpp_access]"); + goto end; + } + cJSON_AddItemToObject(item, "smsfInfoNon3GppAccess", smsf_info_non3_gpp_access_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_ue_context_in_smsf_data_convertToJSON() failed [smsf_info_non3_gpp_access]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_ue_context_in_smsf_data_t *OpenAPI_ue_context_in_smsf_data_parseFromJSON(cJSON *ue_context_in_smsf_dataJSON) +{ + OpenAPI_ue_context_in_smsf_data_t *ue_context_in_smsf_data_local_var = NULL; + cJSON *smsf_info3_gpp_access = cJSON_GetObjectItemCaseSensitive(ue_context_in_smsf_dataJSON, "smsfInfo3GppAccess"); + + OpenAPI_smsf_info_t *smsf_info3_gpp_access_local_nonprim = NULL; + if (smsf_info3_gpp_access) { + smsf_info3_gpp_access_local_nonprim = OpenAPI_smsf_info_parseFromJSON(smsf_info3_gpp_access); + } + + cJSON *smsf_info_non3_gpp_access = cJSON_GetObjectItemCaseSensitive(ue_context_in_smsf_dataJSON, "smsfInfoNon3GppAccess"); + + OpenAPI_smsf_info_t *smsf_info_non3_gpp_access_local_nonprim = NULL; + if (smsf_info_non3_gpp_access) { + smsf_info_non3_gpp_access_local_nonprim = OpenAPI_smsf_info_parseFromJSON(smsf_info_non3_gpp_access); + } + + ue_context_in_smsf_data_local_var = OpenAPI_ue_context_in_smsf_data_create ( + smsf_info3_gpp_access ? smsf_info3_gpp_access_local_nonprim : NULL, + smsf_info_non3_gpp_access ? smsf_info_non3_gpp_access_local_nonprim : NULL + ); + + return ue_context_in_smsf_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/ue_context_in_smsf_data.h b/lib/sbi/openapi/model/ue_context_in_smsf_data.h new file mode 100644 index 0000000000..25b1647bce --- /dev/null +++ b/lib/sbi/openapi/model/ue_context_in_smsf_data.h @@ -0,0 +1,40 @@ +/* + * ue_context_in_smsf_data.h + * + * + */ + +#ifndef _OpenAPI_ue_context_in_smsf_data_H_ +#define _OpenAPI_ue_context_in_smsf_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "smsf_info.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_ue_context_in_smsf_data_s OpenAPI_ue_context_in_smsf_data_t; +typedef struct OpenAPI_ue_context_in_smsf_data_s { + struct OpenAPI_smsf_info_s *smsf_info3_gpp_access; + struct OpenAPI_smsf_info_s *smsf_info_non3_gpp_access; +} OpenAPI_ue_context_in_smsf_data_t; + +OpenAPI_ue_context_in_smsf_data_t *OpenAPI_ue_context_in_smsf_data_create( + OpenAPI_smsf_info_t *smsf_info3_gpp_access, + OpenAPI_smsf_info_t *smsf_info_non3_gpp_access + ); +void OpenAPI_ue_context_in_smsf_data_free(OpenAPI_ue_context_in_smsf_data_t *ue_context_in_smsf_data); +OpenAPI_ue_context_in_smsf_data_t *OpenAPI_ue_context_in_smsf_data_parseFromJSON(cJSON *ue_context_in_smsf_dataJSON); +cJSON *OpenAPI_ue_context_in_smsf_data_convertToJSON(OpenAPI_ue_context_in_smsf_data_t *ue_context_in_smsf_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_ue_context_in_smsf_data_H_ */ + diff --git a/lib/sbi/openapi/model/ue_id.c b/lib/sbi/openapi/model/ue_id.c new file mode 100644 index 0000000000..15dba508ad --- /dev/null +++ b/lib/sbi/openapi/model/ue_id.c @@ -0,0 +1,119 @@ + +#include +#include +#include +#include "ue_id.h" + +OpenAPI_ue_id_t *OpenAPI_ue_id_create( + char *supi, + OpenAPI_list_t *gpsi_list + ) +{ + OpenAPI_ue_id_t *ue_id_local_var = OpenAPI_malloc(sizeof(OpenAPI_ue_id_t)); + if (!ue_id_local_var) { + return NULL; + } + ue_id_local_var->supi = supi; + ue_id_local_var->gpsi_list = gpsi_list; + + return ue_id_local_var; +} + +void OpenAPI_ue_id_free(OpenAPI_ue_id_t *ue_id) +{ + if (NULL == ue_id) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(ue_id->supi); + OpenAPI_list_for_each(ue_id->gpsi_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ue_id->gpsi_list); + ogs_free(ue_id); +} + +cJSON *OpenAPI_ue_id_convertToJSON(OpenAPI_ue_id_t *ue_id) +{ + cJSON *item = NULL; + + if (ue_id == NULL) { + ogs_error("OpenAPI_ue_id_convertToJSON() failed [UeId]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!ue_id->supi) { + ogs_error("OpenAPI_ue_id_convertToJSON() failed [supi]"); + goto end; + } + if (cJSON_AddStringToObject(item, "supi", ue_id->supi) == NULL) { + ogs_error("OpenAPI_ue_id_convertToJSON() failed [supi]"); + goto end; + } + + if (ue_id->gpsi_list) { + cJSON *gpsi_list = cJSON_AddArrayToObject(item, "gpsiList"); + if (gpsi_list == NULL) { + ogs_error("OpenAPI_ue_id_convertToJSON() failed [gpsi_list]"); + goto end; + } + + OpenAPI_lnode_t *gpsi_list_node; + OpenAPI_list_for_each(ue_id->gpsi_list, gpsi_list_node) { + if (cJSON_AddStringToObject(gpsi_list, "", (char*)gpsi_list_node->data) == NULL) { + ogs_error("OpenAPI_ue_id_convertToJSON() failed [gpsi_list]"); + goto end; + } + } + } + +end: + return item; +} + +OpenAPI_ue_id_t *OpenAPI_ue_id_parseFromJSON(cJSON *ue_idJSON) +{ + OpenAPI_ue_id_t *ue_id_local_var = NULL; + cJSON *supi = cJSON_GetObjectItemCaseSensitive(ue_idJSON, "supi"); + if (!supi) { + ogs_error("OpenAPI_ue_id_parseFromJSON() failed [supi]"); + goto end; + } + + + if (!cJSON_IsString(supi)) { + ogs_error("OpenAPI_ue_id_parseFromJSON() failed [supi]"); + goto end; + } + + cJSON *gpsi_list = cJSON_GetObjectItemCaseSensitive(ue_idJSON, "gpsiList"); + + OpenAPI_list_t *gpsi_listList; + if (gpsi_list) { + cJSON *gpsi_list_local; + if (!cJSON_IsArray(gpsi_list)) { + ogs_error("OpenAPI_ue_id_parseFromJSON() failed [gpsi_list]"); + goto end; + } + gpsi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(gpsi_list_local, gpsi_list) { + if (!cJSON_IsString(gpsi_list_local)) { + ogs_error("OpenAPI_ue_id_parseFromJSON() failed [gpsi_list]"); + goto end; + } + OpenAPI_list_add(gpsi_listList, ogs_strdup(gpsi_list_local->valuestring)); + } + } + + ue_id_local_var = OpenAPI_ue_id_create ( + ogs_strdup(supi->valuestring), + gpsi_list ? gpsi_listList : NULL + ); + + return ue_id_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/ue_id.h b/lib/sbi/openapi/model/ue_id.h new file mode 100644 index 0000000000..534fa5b78c --- /dev/null +++ b/lib/sbi/openapi/model/ue_id.h @@ -0,0 +1,39 @@ +/* + * ue_id.h + * + * + */ + +#ifndef _OpenAPI_ue_id_H_ +#define _OpenAPI_ue_id_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_ue_id_s OpenAPI_ue_id_t; +typedef struct OpenAPI_ue_id_s { + char *supi; + OpenAPI_list_t *gpsi_list; +} OpenAPI_ue_id_t; + +OpenAPI_ue_id_t *OpenAPI_ue_id_create( + char *supi, + OpenAPI_list_t *gpsi_list + ); +void OpenAPI_ue_id_free(OpenAPI_ue_id_t *ue_id); +OpenAPI_ue_id_t *OpenAPI_ue_id_parseFromJSON(cJSON *ue_idJSON); +cJSON *OpenAPI_ue_id_convertToJSON(OpenAPI_ue_id_t *ue_id); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_ue_id_H_ */ + diff --git a/lib/sbi/openapi/model/ue_policy_section.c b/lib/sbi/openapi/model/ue_policy_section.c new file mode 100644 index 0000000000..0c66962d21 --- /dev/null +++ b/lib/sbi/openapi/model/ue_policy_section.c @@ -0,0 +1,100 @@ + +#include +#include +#include +#include "ue_policy_section.h" + +OpenAPI_ue_policy_section_t *OpenAPI_ue_policy_section_create( + char ue_policy_section_info, + char *upsi + ) +{ + OpenAPI_ue_policy_section_t *ue_policy_section_local_var = OpenAPI_malloc(sizeof(OpenAPI_ue_policy_section_t)); + if (!ue_policy_section_local_var) { + return NULL; + } + ue_policy_section_local_var->ue_policy_section_info = ue_policy_section_info; + ue_policy_section_local_var->upsi = upsi; + + return ue_policy_section_local_var; +} + +void OpenAPI_ue_policy_section_free(OpenAPI_ue_policy_section_t *ue_policy_section) +{ + if (NULL == ue_policy_section) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(ue_policy_section->upsi); + ogs_free(ue_policy_section); +} + +cJSON *OpenAPI_ue_policy_section_convertToJSON(OpenAPI_ue_policy_section_t *ue_policy_section) +{ + cJSON *item = NULL; + + if (ue_policy_section == NULL) { + ogs_error("OpenAPI_ue_policy_section_convertToJSON() failed [UePolicySection]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!ue_policy_section->ue_policy_section_info) { + ogs_error("OpenAPI_ue_policy_section_convertToJSON() failed [ue_policy_section_info]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "uePolicySectionInfo", ue_policy_section->ue_policy_section_info) == NULL) { + ogs_error("OpenAPI_ue_policy_section_convertToJSON() failed [ue_policy_section_info]"); + goto end; + } + + if (!ue_policy_section->upsi) { + ogs_error("OpenAPI_ue_policy_section_convertToJSON() failed [upsi]"); + goto end; + } + if (cJSON_AddStringToObject(item, "upsi", ue_policy_section->upsi) == NULL) { + ogs_error("OpenAPI_ue_policy_section_convertToJSON() failed [upsi]"); + goto end; + } + +end: + return item; +} + +OpenAPI_ue_policy_section_t *OpenAPI_ue_policy_section_parseFromJSON(cJSON *ue_policy_sectionJSON) +{ + OpenAPI_ue_policy_section_t *ue_policy_section_local_var = NULL; + cJSON *ue_policy_section_info = cJSON_GetObjectItemCaseSensitive(ue_policy_sectionJSON, "uePolicySectionInfo"); + if (!ue_policy_section_info) { + ogs_error("OpenAPI_ue_policy_section_parseFromJSON() failed [ue_policy_section_info]"); + goto end; + } + + + if (!cJSON_IsNumber(ue_policy_section_info)) { + ogs_error("OpenAPI_ue_policy_section_parseFromJSON() failed [ue_policy_section_info]"); + goto end; + } + + cJSON *upsi = cJSON_GetObjectItemCaseSensitive(ue_policy_sectionJSON, "upsi"); + if (!upsi) { + ogs_error("OpenAPI_ue_policy_section_parseFromJSON() failed [upsi]"); + goto end; + } + + + if (!cJSON_IsString(upsi)) { + ogs_error("OpenAPI_ue_policy_section_parseFromJSON() failed [upsi]"); + goto end; + } + + ue_policy_section_local_var = OpenAPI_ue_policy_section_create ( + ue_policy_section_info->valueint, + ogs_strdup(upsi->valuestring) + ); + + return ue_policy_section_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/ue_policy_section.h b/lib/sbi/openapi/model/ue_policy_section.h new file mode 100644 index 0000000000..c5ea80b34f --- /dev/null +++ b/lib/sbi/openapi/model/ue_policy_section.h @@ -0,0 +1,39 @@ +/* + * ue_policy_section.h + * + * Contains the UE policy section. + */ + +#ifndef _OpenAPI_ue_policy_section_H_ +#define _OpenAPI_ue_policy_section_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_ue_policy_section_s OpenAPI_ue_policy_section_t; +typedef struct OpenAPI_ue_policy_section_s { + char ue_policy_section_info; + char *upsi; +} OpenAPI_ue_policy_section_t; + +OpenAPI_ue_policy_section_t *OpenAPI_ue_policy_section_create( + char ue_policy_section_info, + char *upsi + ); +void OpenAPI_ue_policy_section_free(OpenAPI_ue_policy_section_t *ue_policy_section); +OpenAPI_ue_policy_section_t *OpenAPI_ue_policy_section_parseFromJSON(cJSON *ue_policy_sectionJSON); +cJSON *OpenAPI_ue_policy_section_convertToJSON(OpenAPI_ue_policy_section_t *ue_policy_section); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_ue_policy_section_H_ */ + diff --git a/lib/sbi/openapi/model/ue_policy_set.c b/lib/sbi/openapi/model/ue_policy_set.c new file mode 100644 index 0000000000..2c974a9cbf --- /dev/null +++ b/lib/sbi/openapi/model/ue_policy_set.c @@ -0,0 +1,378 @@ + +#include +#include +#include +#include "ue_policy_set.h" + +OpenAPI_ue_policy_set_t *OpenAPI_ue_policy_set_create( + OpenAPI_list_t* pra_infos, + OpenAPI_list_t *subsc_cats, + OpenAPI_list_t* ue_policy_sections, + OpenAPI_list_t *upsis, + OpenAPI_list_t* allowed_route_sel_descs, + int andsp_ind, + char *pei, + OpenAPI_list_t *os_ids + ) +{ + OpenAPI_ue_policy_set_t *ue_policy_set_local_var = OpenAPI_malloc(sizeof(OpenAPI_ue_policy_set_t)); + if (!ue_policy_set_local_var) { + return NULL; + } + ue_policy_set_local_var->pra_infos = pra_infos; + ue_policy_set_local_var->subsc_cats = subsc_cats; + ue_policy_set_local_var->ue_policy_sections = ue_policy_sections; + ue_policy_set_local_var->upsis = upsis; + ue_policy_set_local_var->allowed_route_sel_descs = allowed_route_sel_descs; + ue_policy_set_local_var->andsp_ind = andsp_ind; + ue_policy_set_local_var->pei = pei; + ue_policy_set_local_var->os_ids = os_ids; + + return ue_policy_set_local_var; +} + +void OpenAPI_ue_policy_set_free(OpenAPI_ue_policy_set_t *ue_policy_set) +{ + if (NULL == ue_policy_set) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(ue_policy_set->pra_infos, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_presence_info_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(ue_policy_set->pra_infos); + OpenAPI_list_for_each(ue_policy_set->subsc_cats, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ue_policy_set->subsc_cats); + OpenAPI_list_for_each(ue_policy_set->ue_policy_sections, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_ue_policy_section_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(ue_policy_set->ue_policy_sections); + OpenAPI_list_for_each(ue_policy_set->upsis, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ue_policy_set->upsis); + OpenAPI_list_for_each(ue_policy_set->allowed_route_sel_descs, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_plmn_route_selection_descriptor_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(ue_policy_set->allowed_route_sel_descs); + ogs_free(ue_policy_set->pei); + OpenAPI_list_for_each(ue_policy_set->os_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ue_policy_set->os_ids); + ogs_free(ue_policy_set); +} + +cJSON *OpenAPI_ue_policy_set_convertToJSON(OpenAPI_ue_policy_set_t *ue_policy_set) +{ + cJSON *item = NULL; + + if (ue_policy_set == NULL) { + ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [UePolicySet]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (ue_policy_set->pra_infos) { + cJSON *pra_infos = cJSON_AddObjectToObject(item, "praInfos"); + if (pra_infos == NULL) { + ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [pra_infos]"); + goto end; + } + cJSON *localMapObject = pra_infos; + OpenAPI_lnode_t *pra_infos_node; + if (ue_policy_set->pra_infos) { + OpenAPI_list_for_each(ue_policy_set->pra_infos, pra_infos_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)pra_infos_node->data; + cJSON *itemLocal = OpenAPI_presence_info_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [pra_infos]"); + goto end; + } + cJSON_AddItemToObject(pra_infos, localKeyValue->key, itemLocal); + } + } + } + + if (ue_policy_set->subsc_cats) { + cJSON *subsc_cats = cJSON_AddArrayToObject(item, "subscCats"); + if (subsc_cats == NULL) { + ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [subsc_cats]"); + goto end; + } + + OpenAPI_lnode_t *subsc_cats_node; + OpenAPI_list_for_each(ue_policy_set->subsc_cats, subsc_cats_node) { + if (cJSON_AddStringToObject(subsc_cats, "", (char*)subsc_cats_node->data) == NULL) { + ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [subsc_cats]"); + goto end; + } + } + } + + if (ue_policy_set->ue_policy_sections) { + cJSON *ue_policy_sections = cJSON_AddObjectToObject(item, "uePolicySections"); + if (ue_policy_sections == NULL) { + ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [ue_policy_sections]"); + goto end; + } + cJSON *localMapObject = ue_policy_sections; + OpenAPI_lnode_t *ue_policy_sections_node; + if (ue_policy_set->ue_policy_sections) { + OpenAPI_list_for_each(ue_policy_set->ue_policy_sections, ue_policy_sections_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)ue_policy_sections_node->data; + cJSON *itemLocal = OpenAPI_ue_policy_section_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [ue_policy_sections]"); + goto end; + } + cJSON_AddItemToObject(ue_policy_sections, localKeyValue->key, itemLocal); + } + } + } + + if (ue_policy_set->upsis) { + cJSON *upsis = cJSON_AddArrayToObject(item, "upsis"); + if (upsis == NULL) { + ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [upsis]"); + goto end; + } + + OpenAPI_lnode_t *upsis_node; + OpenAPI_list_for_each(ue_policy_set->upsis, upsis_node) { + if (cJSON_AddStringToObject(upsis, "", (char*)upsis_node->data) == NULL) { + ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [upsis]"); + goto end; + } + } + } + + if (ue_policy_set->allowed_route_sel_descs) { + cJSON *allowed_route_sel_descs = cJSON_AddObjectToObject(item, "allowedRouteSelDescs"); + if (allowed_route_sel_descs == NULL) { + ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [allowed_route_sel_descs]"); + goto end; + } + cJSON *localMapObject = allowed_route_sel_descs; + OpenAPI_lnode_t *allowed_route_sel_descs_node; + if (ue_policy_set->allowed_route_sel_descs) { + OpenAPI_list_for_each(ue_policy_set->allowed_route_sel_descs, allowed_route_sel_descs_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)allowed_route_sel_descs_node->data; + cJSON *itemLocal = OpenAPI_plmn_route_selection_descriptor_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [allowed_route_sel_descs]"); + goto end; + } + cJSON_AddItemToObject(allowed_route_sel_descs, localKeyValue->key, itemLocal); + } + } + } + + if (ue_policy_set->andsp_ind >= 0) { + if (cJSON_AddBoolToObject(item, "andspInd", ue_policy_set->andsp_ind) == NULL) { + ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [andsp_ind]"); + goto end; + } + } + + if (ue_policy_set->pei) { + if (cJSON_AddStringToObject(item, "pei", ue_policy_set->pei) == NULL) { + ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [pei]"); + goto end; + } + } + + if (ue_policy_set->os_ids) { + cJSON *os_ids = cJSON_AddArrayToObject(item, "osIds"); + if (os_ids == NULL) { + ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [os_ids]"); + goto end; + } + + OpenAPI_lnode_t *os_ids_node; + OpenAPI_list_for_each(ue_policy_set->os_ids, os_ids_node) { + if (cJSON_AddStringToObject(os_ids, "", (char*)os_ids_node->data) == NULL) { + ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [os_ids]"); + goto end; + } + } + } + +end: + return item; +} + +OpenAPI_ue_policy_set_t *OpenAPI_ue_policy_set_parseFromJSON(cJSON *ue_policy_setJSON) +{ + OpenAPI_ue_policy_set_t *ue_policy_set_local_var = NULL; + cJSON *pra_infos = cJSON_GetObjectItemCaseSensitive(ue_policy_setJSON, "praInfos"); + + OpenAPI_list_t *pra_infosList; + if (pra_infos) { + cJSON *pra_infos_local_map; + if (!cJSON_IsObject(pra_infos)) { + ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [pra_infos]"); + goto end; + } + pra_infosList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(pra_infos_local_map, pra_infos) { + cJSON *localMapObject = pra_infos_local_map; + if (!cJSON_IsObject(pra_infos_local_map)) { + ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [pra_infos]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_presence_info_parseFromJSON(localMapObject)); + OpenAPI_list_add(pra_infosList, localMapKeyPair); + } + } + + cJSON *subsc_cats = cJSON_GetObjectItemCaseSensitive(ue_policy_setJSON, "subscCats"); + + OpenAPI_list_t *subsc_catsList; + if (subsc_cats) { + cJSON *subsc_cats_local; + if (!cJSON_IsArray(subsc_cats)) { + ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [subsc_cats]"); + goto end; + } + subsc_catsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(subsc_cats_local, subsc_cats) { + if (!cJSON_IsString(subsc_cats_local)) { + ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [subsc_cats]"); + goto end; + } + OpenAPI_list_add(subsc_catsList, ogs_strdup(subsc_cats_local->valuestring)); + } + } + + cJSON *ue_policy_sections = cJSON_GetObjectItemCaseSensitive(ue_policy_setJSON, "uePolicySections"); + + OpenAPI_list_t *ue_policy_sectionsList; + if (ue_policy_sections) { + cJSON *ue_policy_sections_local_map; + if (!cJSON_IsObject(ue_policy_sections)) { + ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [ue_policy_sections]"); + goto end; + } + ue_policy_sectionsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(ue_policy_sections_local_map, ue_policy_sections) { + cJSON *localMapObject = ue_policy_sections_local_map; + if (!cJSON_IsObject(ue_policy_sections_local_map)) { + ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [ue_policy_sections]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_ue_policy_section_parseFromJSON(localMapObject)); + OpenAPI_list_add(ue_policy_sectionsList, localMapKeyPair); + } + } + + cJSON *upsis = cJSON_GetObjectItemCaseSensitive(ue_policy_setJSON, "upsis"); + + OpenAPI_list_t *upsisList; + if (upsis) { + cJSON *upsis_local; + if (!cJSON_IsArray(upsis)) { + ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [upsis]"); + goto end; + } + upsisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(upsis_local, upsis) { + if (!cJSON_IsString(upsis_local)) { + ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [upsis]"); + goto end; + } + OpenAPI_list_add(upsisList, ogs_strdup(upsis_local->valuestring)); + } + } + + cJSON *allowed_route_sel_descs = cJSON_GetObjectItemCaseSensitive(ue_policy_setJSON, "allowedRouteSelDescs"); + + OpenAPI_list_t *allowed_route_sel_descsList; + if (allowed_route_sel_descs) { + cJSON *allowed_route_sel_descs_local_map; + if (!cJSON_IsObject(allowed_route_sel_descs)) { + ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [allowed_route_sel_descs]"); + goto end; + } + allowed_route_sel_descsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(allowed_route_sel_descs_local_map, allowed_route_sel_descs) { + cJSON *localMapObject = allowed_route_sel_descs_local_map; + if (!cJSON_IsObject(allowed_route_sel_descs_local_map)) { + ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [allowed_route_sel_descs]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_plmn_route_selection_descriptor_parseFromJSON(localMapObject)); + OpenAPI_list_add(allowed_route_sel_descsList, localMapKeyPair); + } + } + + cJSON *andsp_ind = cJSON_GetObjectItemCaseSensitive(ue_policy_setJSON, "andspInd"); + + if (andsp_ind) { + if (!cJSON_IsBool(andsp_ind)) { + ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [andsp_ind]"); + goto end; + } + } + + cJSON *pei = cJSON_GetObjectItemCaseSensitive(ue_policy_setJSON, "pei"); + + if (pei) { + if (!cJSON_IsString(pei)) { + ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [pei]"); + goto end; + } + } + + cJSON *os_ids = cJSON_GetObjectItemCaseSensitive(ue_policy_setJSON, "osIds"); + + OpenAPI_list_t *os_idsList; + if (os_ids) { + cJSON *os_ids_local; + if (!cJSON_IsArray(os_ids)) { + ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [os_ids]"); + goto end; + } + os_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(os_ids_local, os_ids) { + if (!cJSON_IsString(os_ids_local)) { + ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [os_ids]"); + goto end; + } + OpenAPI_list_add(os_idsList, ogs_strdup(os_ids_local->valuestring)); + } + } + + ue_policy_set_local_var = OpenAPI_ue_policy_set_create ( + pra_infos ? pra_infosList : NULL, + subsc_cats ? subsc_catsList : NULL, + ue_policy_sections ? ue_policy_sectionsList : NULL, + upsis ? upsisList : NULL, + allowed_route_sel_descs ? allowed_route_sel_descsList : NULL, + andsp_ind ? andsp_ind->valueint : 0, + pei ? ogs_strdup(pei->valuestring) : NULL, + os_ids ? os_idsList : NULL + ); + + return ue_policy_set_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/ue_policy_set.h b/lib/sbi/openapi/model/ue_policy_set.h new file mode 100644 index 0000000000..6b0d526350 --- /dev/null +++ b/lib/sbi/openapi/model/ue_policy_set.h @@ -0,0 +1,54 @@ +/* + * ue_policy_set.h + * + * Contains the UE policy data for a given subscriber. + */ + +#ifndef _OpenAPI_ue_policy_set_H_ +#define _OpenAPI_ue_policy_set_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "plmn_route_selection_descriptor.h" +#include "presence_info.h" +#include "ue_policy_section.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_ue_policy_set_s OpenAPI_ue_policy_set_t; +typedef struct OpenAPI_ue_policy_set_s { + OpenAPI_list_t* pra_infos; + OpenAPI_list_t *subsc_cats; + OpenAPI_list_t* ue_policy_sections; + OpenAPI_list_t *upsis; + OpenAPI_list_t* allowed_route_sel_descs; + int andsp_ind; + char *pei; + OpenAPI_list_t *os_ids; +} OpenAPI_ue_policy_set_t; + +OpenAPI_ue_policy_set_t *OpenAPI_ue_policy_set_create( + OpenAPI_list_t* pra_infos, + OpenAPI_list_t *subsc_cats, + OpenAPI_list_t* ue_policy_sections, + OpenAPI_list_t *upsis, + OpenAPI_list_t* allowed_route_sel_descs, + int andsp_ind, + char *pei, + OpenAPI_list_t *os_ids + ); +void OpenAPI_ue_policy_set_free(OpenAPI_ue_policy_set_t *ue_policy_set); +OpenAPI_ue_policy_set_t *OpenAPI_ue_policy_set_parseFromJSON(cJSON *ue_policy_setJSON); +cJSON *OpenAPI_ue_policy_set_convertToJSON(OpenAPI_ue_policy_set_t *ue_policy_set); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_ue_policy_set_H_ */ + diff --git a/lib/sbi/openapi/model/ue_policy_set_patch.c b/lib/sbi/openapi/model/ue_policy_set_patch.c new file mode 100644 index 0000000000..7391dfbed5 --- /dev/null +++ b/lib/sbi/openapi/model/ue_policy_set_patch.c @@ -0,0 +1,229 @@ + +#include +#include +#include +#include "ue_policy_set_patch.h" + +OpenAPI_ue_policy_set_patch_t *OpenAPI_ue_policy_set_patch_create( + OpenAPI_list_t* ue_policy_sections, + OpenAPI_list_t *upsis, + int andsp_ind, + char *pei, + OpenAPI_list_t *os_ids + ) +{ + OpenAPI_ue_policy_set_patch_t *ue_policy_set_patch_local_var = OpenAPI_malloc(sizeof(OpenAPI_ue_policy_set_patch_t)); + if (!ue_policy_set_patch_local_var) { + return NULL; + } + ue_policy_set_patch_local_var->ue_policy_sections = ue_policy_sections; + ue_policy_set_patch_local_var->upsis = upsis; + ue_policy_set_patch_local_var->andsp_ind = andsp_ind; + ue_policy_set_patch_local_var->pei = pei; + ue_policy_set_patch_local_var->os_ids = os_ids; + + return ue_policy_set_patch_local_var; +} + +void OpenAPI_ue_policy_set_patch_free(OpenAPI_ue_policy_set_patch_t *ue_policy_set_patch) +{ + if (NULL == ue_policy_set_patch) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(ue_policy_set_patch->ue_policy_sections, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_ue_policy_section_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(ue_policy_set_patch->ue_policy_sections); + OpenAPI_list_for_each(ue_policy_set_patch->upsis, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ue_policy_set_patch->upsis); + ogs_free(ue_policy_set_patch->pei); + OpenAPI_list_for_each(ue_policy_set_patch->os_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ue_policy_set_patch->os_ids); + ogs_free(ue_policy_set_patch); +} + +cJSON *OpenAPI_ue_policy_set_patch_convertToJSON(OpenAPI_ue_policy_set_patch_t *ue_policy_set_patch) +{ + cJSON *item = NULL; + + if (ue_policy_set_patch == NULL) { + ogs_error("OpenAPI_ue_policy_set_patch_convertToJSON() failed [UePolicySetPatch]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (ue_policy_set_patch->ue_policy_sections) { + cJSON *ue_policy_sections = cJSON_AddObjectToObject(item, "uePolicySections"); + if (ue_policy_sections == NULL) { + ogs_error("OpenAPI_ue_policy_set_patch_convertToJSON() failed [ue_policy_sections]"); + goto end; + } + cJSON *localMapObject = ue_policy_sections; + OpenAPI_lnode_t *ue_policy_sections_node; + if (ue_policy_set_patch->ue_policy_sections) { + OpenAPI_list_for_each(ue_policy_set_patch->ue_policy_sections, ue_policy_sections_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)ue_policy_sections_node->data; + cJSON *itemLocal = OpenAPI_ue_policy_section_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ue_policy_set_patch_convertToJSON() failed [ue_policy_sections]"); + goto end; + } + cJSON_AddItemToObject(ue_policy_sections, localKeyValue->key, itemLocal); + } + } + } + + if (ue_policy_set_patch->upsis) { + cJSON *upsis = cJSON_AddArrayToObject(item, "upsis"); + if (upsis == NULL) { + ogs_error("OpenAPI_ue_policy_set_patch_convertToJSON() failed [upsis]"); + goto end; + } + + OpenAPI_lnode_t *upsis_node; + OpenAPI_list_for_each(ue_policy_set_patch->upsis, upsis_node) { + if (cJSON_AddStringToObject(upsis, "", (char*)upsis_node->data) == NULL) { + ogs_error("OpenAPI_ue_policy_set_patch_convertToJSON() failed [upsis]"); + goto end; + } + } + } + + if (ue_policy_set_patch->andsp_ind >= 0) { + if (cJSON_AddBoolToObject(item, "andspInd", ue_policy_set_patch->andsp_ind) == NULL) { + ogs_error("OpenAPI_ue_policy_set_patch_convertToJSON() failed [andsp_ind]"); + goto end; + } + } + + if (ue_policy_set_patch->pei) { + if (cJSON_AddStringToObject(item, "pei", ue_policy_set_patch->pei) == NULL) { + ogs_error("OpenAPI_ue_policy_set_patch_convertToJSON() failed [pei]"); + goto end; + } + } + + if (ue_policy_set_patch->os_ids) { + cJSON *os_ids = cJSON_AddArrayToObject(item, "osIds"); + if (os_ids == NULL) { + ogs_error("OpenAPI_ue_policy_set_patch_convertToJSON() failed [os_ids]"); + goto end; + } + + OpenAPI_lnode_t *os_ids_node; + OpenAPI_list_for_each(ue_policy_set_patch->os_ids, os_ids_node) { + if (cJSON_AddStringToObject(os_ids, "", (char*)os_ids_node->data) == NULL) { + ogs_error("OpenAPI_ue_policy_set_patch_convertToJSON() failed [os_ids]"); + goto end; + } + } + } + +end: + return item; +} + +OpenAPI_ue_policy_set_patch_t *OpenAPI_ue_policy_set_patch_parseFromJSON(cJSON *ue_policy_set_patchJSON) +{ + OpenAPI_ue_policy_set_patch_t *ue_policy_set_patch_local_var = NULL; + cJSON *ue_policy_sections = cJSON_GetObjectItemCaseSensitive(ue_policy_set_patchJSON, "uePolicySections"); + + OpenAPI_list_t *ue_policy_sectionsList; + if (ue_policy_sections) { + cJSON *ue_policy_sections_local_map; + if (!cJSON_IsObject(ue_policy_sections)) { + ogs_error("OpenAPI_ue_policy_set_patch_parseFromJSON() failed [ue_policy_sections]"); + goto end; + } + ue_policy_sectionsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(ue_policy_sections_local_map, ue_policy_sections) { + cJSON *localMapObject = ue_policy_sections_local_map; + if (!cJSON_IsObject(ue_policy_sections_local_map)) { + ogs_error("OpenAPI_ue_policy_set_patch_parseFromJSON() failed [ue_policy_sections]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_ue_policy_section_parseFromJSON(localMapObject)); + OpenAPI_list_add(ue_policy_sectionsList, localMapKeyPair); + } + } + + cJSON *upsis = cJSON_GetObjectItemCaseSensitive(ue_policy_set_patchJSON, "upsis"); + + OpenAPI_list_t *upsisList; + if (upsis) { + cJSON *upsis_local; + if (!cJSON_IsArray(upsis)) { + ogs_error("OpenAPI_ue_policy_set_patch_parseFromJSON() failed [upsis]"); + goto end; + } + upsisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(upsis_local, upsis) { + if (!cJSON_IsString(upsis_local)) { + ogs_error("OpenAPI_ue_policy_set_patch_parseFromJSON() failed [upsis]"); + goto end; + } + OpenAPI_list_add(upsisList, ogs_strdup(upsis_local->valuestring)); + } + } + + cJSON *andsp_ind = cJSON_GetObjectItemCaseSensitive(ue_policy_set_patchJSON, "andspInd"); + + if (andsp_ind) { + if (!cJSON_IsBool(andsp_ind)) { + ogs_error("OpenAPI_ue_policy_set_patch_parseFromJSON() failed [andsp_ind]"); + goto end; + } + } + + cJSON *pei = cJSON_GetObjectItemCaseSensitive(ue_policy_set_patchJSON, "pei"); + + if (pei) { + if (!cJSON_IsString(pei)) { + ogs_error("OpenAPI_ue_policy_set_patch_parseFromJSON() failed [pei]"); + goto end; + } + } + + cJSON *os_ids = cJSON_GetObjectItemCaseSensitive(ue_policy_set_patchJSON, "osIds"); + + OpenAPI_list_t *os_idsList; + if (os_ids) { + cJSON *os_ids_local; + if (!cJSON_IsArray(os_ids)) { + ogs_error("OpenAPI_ue_policy_set_patch_parseFromJSON() failed [os_ids]"); + goto end; + } + os_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(os_ids_local, os_ids) { + if (!cJSON_IsString(os_ids_local)) { + ogs_error("OpenAPI_ue_policy_set_patch_parseFromJSON() failed [os_ids]"); + goto end; + } + OpenAPI_list_add(os_idsList, ogs_strdup(os_ids_local->valuestring)); + } + } + + ue_policy_set_patch_local_var = OpenAPI_ue_policy_set_patch_create ( + ue_policy_sections ? ue_policy_sectionsList : NULL, + upsis ? upsisList : NULL, + andsp_ind ? andsp_ind->valueint : 0, + pei ? ogs_strdup(pei->valuestring) : NULL, + os_ids ? os_idsList : NULL + ); + + return ue_policy_set_patch_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/ue_policy_set_patch.h b/lib/sbi/openapi/model/ue_policy_set_patch.h new file mode 100644 index 0000000000..5994b56466 --- /dev/null +++ b/lib/sbi/openapi/model/ue_policy_set_patch.h @@ -0,0 +1,46 @@ +/* + * ue_policy_set_patch.h + * + * Contains the UE policy set for a given subscriber. + */ + +#ifndef _OpenAPI_ue_policy_set_patch_H_ +#define _OpenAPI_ue_policy_set_patch_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "ue_policy_section.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_ue_policy_set_patch_s OpenAPI_ue_policy_set_patch_t; +typedef struct OpenAPI_ue_policy_set_patch_s { + OpenAPI_list_t* ue_policy_sections; + OpenAPI_list_t *upsis; + int andsp_ind; + char *pei; + OpenAPI_list_t *os_ids; +} OpenAPI_ue_policy_set_patch_t; + +OpenAPI_ue_policy_set_patch_t *OpenAPI_ue_policy_set_patch_create( + OpenAPI_list_t* ue_policy_sections, + OpenAPI_list_t *upsis, + int andsp_ind, + char *pei, + OpenAPI_list_t *os_ids + ); +void OpenAPI_ue_policy_set_patch_free(OpenAPI_ue_policy_set_patch_t *ue_policy_set_patch); +OpenAPI_ue_policy_set_patch_t *OpenAPI_ue_policy_set_patch_parseFromJSON(cJSON *ue_policy_set_patchJSON); +cJSON *OpenAPI_ue_policy_set_patch_convertToJSON(OpenAPI_ue_policy_set_patch_t *ue_policy_set_patch); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_ue_policy_set_patch_H_ */ + diff --git a/lib/sbi/openapi/model/ue_reachability.c b/lib/sbi/openapi/model/ue_reachability.c new file mode 100644 index 0000000000..450288dd2a --- /dev/null +++ b/lib/sbi/openapi/model/ue_reachability.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "ue_reachability.h" + +OpenAPI_ue_reachability_t *OpenAPI_ue_reachability_create( + ) +{ + OpenAPI_ue_reachability_t *ue_reachability_local_var = OpenAPI_malloc(sizeof(OpenAPI_ue_reachability_t)); + if (!ue_reachability_local_var) { + return NULL; + } + + return ue_reachability_local_var; +} + +void OpenAPI_ue_reachability_free(OpenAPI_ue_reachability_t *ue_reachability) +{ + if (NULL == ue_reachability) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(ue_reachability); +} + +cJSON *OpenAPI_ue_reachability_convertToJSON(OpenAPI_ue_reachability_t *ue_reachability) +{ + cJSON *item = NULL; + + if (ue_reachability == NULL) { + ogs_error("OpenAPI_ue_reachability_convertToJSON() failed [UeReachability]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_ue_reachability_t *OpenAPI_ue_reachability_parseFromJSON(cJSON *ue_reachabilityJSON) +{ + OpenAPI_ue_reachability_t *ue_reachability_local_var = NULL; + ue_reachability_local_var = OpenAPI_ue_reachability_create ( + ); + + return ue_reachability_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/ue_reachability.h b/lib/sbi/openapi/model/ue_reachability.h new file mode 100644 index 0000000000..6c2c3b3584 --- /dev/null +++ b/lib/sbi/openapi/model/ue_reachability.h @@ -0,0 +1,35 @@ +/* + * ue_reachability.h + * + * + */ + +#ifndef _OpenAPI_ue_reachability_H_ +#define _OpenAPI_ue_reachability_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_ue_reachability_s OpenAPI_ue_reachability_t; +typedef struct OpenAPI_ue_reachability_s { +} OpenAPI_ue_reachability_t; + +OpenAPI_ue_reachability_t *OpenAPI_ue_reachability_create( + ); +void OpenAPI_ue_reachability_free(OpenAPI_ue_reachability_t *ue_reachability); +OpenAPI_ue_reachability_t *OpenAPI_ue_reachability_parseFromJSON(cJSON *ue_reachabilityJSON); +cJSON *OpenAPI_ue_reachability_convertToJSON(OpenAPI_ue_reachability_t *ue_reachability); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_ue_reachability_H_ */ + diff --git a/lib/sbi/openapi/model/ue_update_status.c b/lib/sbi/openapi/model/ue_update_status.c new file mode 100644 index 0000000000..c5706a3b17 --- /dev/null +++ b/lib/sbi/openapi/model/ue_update_status.c @@ -0,0 +1,30 @@ + +#include +#include +#include +#include "ue_update_status.h" + +char* OpenAPI_ue_update_status_ToString(OpenAPI_ue_update_status_e ue_update_status) +{ + const char *ue_update_statusArray[] = { "NULL", "NOT_SENT", "SENT_NO_ACK_REQUIRED", "WAITING_FOR_ACK", "ACK_RECEIVED" }; + size_t sizeofArray = sizeof(ue_update_statusArray) / sizeof(ue_update_statusArray[0]); + if (ue_update_status < sizeofArray) + return (char *)ue_update_statusArray[ue_update_status]; + else + return (char *)"Unknown"; +} + +OpenAPI_ue_update_status_e OpenAPI_ue_update_status_FromString(char* ue_update_status) +{ + int stringToReturn = 0; + const char *ue_update_statusArray[] = { "NULL", "NOT_SENT", "SENT_NO_ACK_REQUIRED", "WAITING_FOR_ACK", "ACK_RECEIVED" }; + size_t sizeofArray = sizeof(ue_update_statusArray) / sizeof(ue_update_statusArray[0]); + while (stringToReturn < sizeofArray) { + if (strcmp(ue_update_status, ue_update_statusArray[stringToReturn]) == 0) { + return stringToReturn; + } + stringToReturn++; + } + return 0; +} + diff --git a/lib/sbi/openapi/model/ue_update_status.h b/lib/sbi/openapi/model/ue_update_status.h new file mode 100644 index 0000000000..a11ade2704 --- /dev/null +++ b/lib/sbi/openapi/model/ue_update_status.h @@ -0,0 +1,31 @@ +/* + * ue_update_status.h + * + * + */ + +#ifndef _OpenAPI_ue_update_status_H_ +#define _OpenAPI_ue_update_status_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { OpenAPI_ue_update_status_NULL = 0, OpenAPI_ue_update_status_NOT_SENT, OpenAPI_ue_update_status_SENT_NO_ACK_REQUIRED, OpenAPI_ue_update_status_WAITING_FOR_ACK, OpenAPI_ue_update_status_ACK_RECEIVED } OpenAPI_ue_update_status_e; + +char* OpenAPI_ue_update_status_ToString(OpenAPI_ue_update_status_e ue_update_status); + +OpenAPI_ue_update_status_e OpenAPI_ue_update_status_FromString(char* ue_update_status); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_ue_update_status_H_ */ + diff --git a/lib/sbi/openapi/model/uncertainty_ellipse.c b/lib/sbi/openapi/model/uncertainty_ellipse.c new file mode 100644 index 0000000000..841747838b --- /dev/null +++ b/lib/sbi/openapi/model/uncertainty_ellipse.c @@ -0,0 +1,123 @@ + +#include +#include +#include +#include "uncertainty_ellipse.h" + +OpenAPI_uncertainty_ellipse_t *OpenAPI_uncertainty_ellipse_create( + float semi_major, + float semi_minor, + int orientation_major + ) +{ + OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse_local_var = OpenAPI_malloc(sizeof(OpenAPI_uncertainty_ellipse_t)); + if (!uncertainty_ellipse_local_var) { + return NULL; + } + uncertainty_ellipse_local_var->semi_major = semi_major; + uncertainty_ellipse_local_var->semi_minor = semi_minor; + uncertainty_ellipse_local_var->orientation_major = orientation_major; + + return uncertainty_ellipse_local_var; +} + +void OpenAPI_uncertainty_ellipse_free(OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse) +{ + if (NULL == uncertainty_ellipse) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(uncertainty_ellipse); +} + +cJSON *OpenAPI_uncertainty_ellipse_convertToJSON(OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse) +{ + cJSON *item = NULL; + + if (uncertainty_ellipse == NULL) { + ogs_error("OpenAPI_uncertainty_ellipse_convertToJSON() failed [UncertaintyEllipse]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!uncertainty_ellipse->semi_major) { + ogs_error("OpenAPI_uncertainty_ellipse_convertToJSON() failed [semi_major]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "semiMajor", uncertainty_ellipse->semi_major) == NULL) { + ogs_error("OpenAPI_uncertainty_ellipse_convertToJSON() failed [semi_major]"); + goto end; + } + + if (!uncertainty_ellipse->semi_minor) { + ogs_error("OpenAPI_uncertainty_ellipse_convertToJSON() failed [semi_minor]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "semiMinor", uncertainty_ellipse->semi_minor) == NULL) { + ogs_error("OpenAPI_uncertainty_ellipse_convertToJSON() failed [semi_minor]"); + goto end; + } + + if (!uncertainty_ellipse->orientation_major) { + ogs_error("OpenAPI_uncertainty_ellipse_convertToJSON() failed [orientation_major]"); + goto end; + } + if (cJSON_AddNumberToObject(item, "orientationMajor", uncertainty_ellipse->orientation_major) == NULL) { + ogs_error("OpenAPI_uncertainty_ellipse_convertToJSON() failed [orientation_major]"); + goto end; + } + +end: + return item; +} + +OpenAPI_uncertainty_ellipse_t *OpenAPI_uncertainty_ellipse_parseFromJSON(cJSON *uncertainty_ellipseJSON) +{ + OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse_local_var = NULL; + cJSON *semi_major = cJSON_GetObjectItemCaseSensitive(uncertainty_ellipseJSON, "semiMajor"); + if (!semi_major) { + ogs_error("OpenAPI_uncertainty_ellipse_parseFromJSON() failed [semi_major]"); + goto end; + } + + + if (!cJSON_IsNumber(semi_major)) { + ogs_error("OpenAPI_uncertainty_ellipse_parseFromJSON() failed [semi_major]"); + goto end; + } + + cJSON *semi_minor = cJSON_GetObjectItemCaseSensitive(uncertainty_ellipseJSON, "semiMinor"); + if (!semi_minor) { + ogs_error("OpenAPI_uncertainty_ellipse_parseFromJSON() failed [semi_minor]"); + goto end; + } + + + if (!cJSON_IsNumber(semi_minor)) { + ogs_error("OpenAPI_uncertainty_ellipse_parseFromJSON() failed [semi_minor]"); + goto end; + } + + cJSON *orientation_major = cJSON_GetObjectItemCaseSensitive(uncertainty_ellipseJSON, "orientationMajor"); + if (!orientation_major) { + ogs_error("OpenAPI_uncertainty_ellipse_parseFromJSON() failed [orientation_major]"); + goto end; + } + + + if (!cJSON_IsNumber(orientation_major)) { + ogs_error("OpenAPI_uncertainty_ellipse_parseFromJSON() failed [orientation_major]"); + goto end; + } + + uncertainty_ellipse_local_var = OpenAPI_uncertainty_ellipse_create ( + semi_major->valuedouble, + semi_minor->valuedouble, + orientation_major->valuedouble + ); + + return uncertainty_ellipse_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/uncertainty_ellipse.h b/lib/sbi/openapi/model/uncertainty_ellipse.h new file mode 100644 index 0000000000..fbca8fc4b5 --- /dev/null +++ b/lib/sbi/openapi/model/uncertainty_ellipse.h @@ -0,0 +1,41 @@ +/* + * uncertainty_ellipse.h + * + * + */ + +#ifndef _OpenAPI_uncertainty_ellipse_H_ +#define _OpenAPI_uncertainty_ellipse_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_uncertainty_ellipse_s OpenAPI_uncertainty_ellipse_t; +typedef struct OpenAPI_uncertainty_ellipse_s { + float semi_major; + float semi_minor; + int orientation_major; +} OpenAPI_uncertainty_ellipse_t; + +OpenAPI_uncertainty_ellipse_t *OpenAPI_uncertainty_ellipse_create( + float semi_major, + float semi_minor, + int orientation_major + ); +void OpenAPI_uncertainty_ellipse_free(OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse); +OpenAPI_uncertainty_ellipse_t *OpenAPI_uncertainty_ellipse_parseFromJSON(cJSON *uncertainty_ellipseJSON); +cJSON *OpenAPI_uncertainty_ellipse_convertToJSON(OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_uncertainty_ellipse_H_ */ + diff --git a/lib/sbi/openapi/model/unrelated_class.c b/lib/sbi/openapi/model/unrelated_class.c new file mode 100644 index 0000000000..d27ebf8f52 --- /dev/null +++ b/lib/sbi/openapi/model/unrelated_class.c @@ -0,0 +1,154 @@ + +#include +#include +#include +#include "unrelated_class.h" + +OpenAPI_unrelated_class_t *OpenAPI_unrelated_class_create( + OpenAPI_non_external_unrelated_class_t *non_external_unrelated_class, + OpenAPI_external_unrelated_class_t *external_unrelated_class, + OpenAPI_list_t *service_type_unrelated_classes + ) +{ + OpenAPI_unrelated_class_t *unrelated_class_local_var = OpenAPI_malloc(sizeof(OpenAPI_unrelated_class_t)); + if (!unrelated_class_local_var) { + return NULL; + } + unrelated_class_local_var->non_external_unrelated_class = non_external_unrelated_class; + unrelated_class_local_var->external_unrelated_class = external_unrelated_class; + unrelated_class_local_var->service_type_unrelated_classes = service_type_unrelated_classes; + + return unrelated_class_local_var; +} + +void OpenAPI_unrelated_class_free(OpenAPI_unrelated_class_t *unrelated_class) +{ + if (NULL == unrelated_class) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_non_external_unrelated_class_free(unrelated_class->non_external_unrelated_class); + OpenAPI_external_unrelated_class_free(unrelated_class->external_unrelated_class); + OpenAPI_list_for_each(unrelated_class->service_type_unrelated_classes, node) { + OpenAPI_service_type_unrelated_class_free(node->data); + } + OpenAPI_list_free(unrelated_class->service_type_unrelated_classes); + ogs_free(unrelated_class); +} + +cJSON *OpenAPI_unrelated_class_convertToJSON(OpenAPI_unrelated_class_t *unrelated_class) +{ + cJSON *item = NULL; + + if (unrelated_class == NULL) { + ogs_error("OpenAPI_unrelated_class_convertToJSON() failed [UnrelatedClass]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!unrelated_class->non_external_unrelated_class) { + ogs_error("OpenAPI_unrelated_class_convertToJSON() failed [non_external_unrelated_class]"); + goto end; + } + cJSON *non_external_unrelated_class_local_JSON = OpenAPI_non_external_unrelated_class_convertToJSON(unrelated_class->non_external_unrelated_class); + if (non_external_unrelated_class_local_JSON == NULL) { + ogs_error("OpenAPI_unrelated_class_convertToJSON() failed [non_external_unrelated_class]"); + goto end; + } + cJSON_AddItemToObject(item, "nonExternalUnrelatedClass", non_external_unrelated_class_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_unrelated_class_convertToJSON() failed [non_external_unrelated_class]"); + goto end; + } + + if (unrelated_class->external_unrelated_class) { + cJSON *external_unrelated_class_local_JSON = OpenAPI_external_unrelated_class_convertToJSON(unrelated_class->external_unrelated_class); + if (external_unrelated_class_local_JSON == NULL) { + ogs_error("OpenAPI_unrelated_class_convertToJSON() failed [external_unrelated_class]"); + goto end; + } + cJSON_AddItemToObject(item, "externalUnrelatedClass", external_unrelated_class_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_unrelated_class_convertToJSON() failed [external_unrelated_class]"); + goto end; + } + } + + if (unrelated_class->service_type_unrelated_classes) { + cJSON *service_type_unrelated_classesList = cJSON_AddArrayToObject(item, "serviceTypeUnrelatedClasses"); + if (service_type_unrelated_classesList == NULL) { + ogs_error("OpenAPI_unrelated_class_convertToJSON() failed [service_type_unrelated_classes]"); + goto end; + } + + OpenAPI_lnode_t *service_type_unrelated_classes_node; + if (unrelated_class->service_type_unrelated_classes) { + OpenAPI_list_for_each(unrelated_class->service_type_unrelated_classes, service_type_unrelated_classes_node) { + cJSON *itemLocal = OpenAPI_service_type_unrelated_class_convertToJSON(service_type_unrelated_classes_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_unrelated_class_convertToJSON() failed [service_type_unrelated_classes]"); + goto end; + } + cJSON_AddItemToArray(service_type_unrelated_classesList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_unrelated_class_t *OpenAPI_unrelated_class_parseFromJSON(cJSON *unrelated_classJSON) +{ + OpenAPI_unrelated_class_t *unrelated_class_local_var = NULL; + cJSON *non_external_unrelated_class = cJSON_GetObjectItemCaseSensitive(unrelated_classJSON, "nonExternalUnrelatedClass"); + if (!non_external_unrelated_class) { + ogs_error("OpenAPI_unrelated_class_parseFromJSON() failed [non_external_unrelated_class]"); + goto end; + } + + OpenAPI_non_external_unrelated_class_t *non_external_unrelated_class_local_nonprim = NULL; + + non_external_unrelated_class_local_nonprim = OpenAPI_non_external_unrelated_class_parseFromJSON(non_external_unrelated_class); + + cJSON *external_unrelated_class = cJSON_GetObjectItemCaseSensitive(unrelated_classJSON, "externalUnrelatedClass"); + + OpenAPI_external_unrelated_class_t *external_unrelated_class_local_nonprim = NULL; + if (external_unrelated_class) { + external_unrelated_class_local_nonprim = OpenAPI_external_unrelated_class_parseFromJSON(external_unrelated_class); + } + + cJSON *service_type_unrelated_classes = cJSON_GetObjectItemCaseSensitive(unrelated_classJSON, "serviceTypeUnrelatedClasses"); + + OpenAPI_list_t *service_type_unrelated_classesList; + if (service_type_unrelated_classes) { + cJSON *service_type_unrelated_classes_local_nonprimitive; + if (!cJSON_IsArray(service_type_unrelated_classes)) { + ogs_error("OpenAPI_unrelated_class_parseFromJSON() failed [service_type_unrelated_classes]"); + goto end; + } + + service_type_unrelated_classesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(service_type_unrelated_classes_local_nonprimitive, service_type_unrelated_classes ) { + if (!cJSON_IsObject(service_type_unrelated_classes_local_nonprimitive)) { + ogs_error("OpenAPI_unrelated_class_parseFromJSON() failed [service_type_unrelated_classes]"); + goto end; + } + OpenAPI_service_type_unrelated_class_t *service_type_unrelated_classesItem = OpenAPI_service_type_unrelated_class_parseFromJSON(service_type_unrelated_classes_local_nonprimitive); + + OpenAPI_list_add(service_type_unrelated_classesList, service_type_unrelated_classesItem); + } + } + + unrelated_class_local_var = OpenAPI_unrelated_class_create ( + non_external_unrelated_class_local_nonprim, + external_unrelated_class ? external_unrelated_class_local_nonprim : NULL, + service_type_unrelated_classes ? service_type_unrelated_classesList : NULL + ); + + return unrelated_class_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/unrelated_class.h b/lib/sbi/openapi/model/unrelated_class.h new file mode 100644 index 0000000000..c21509da25 --- /dev/null +++ b/lib/sbi/openapi/model/unrelated_class.h @@ -0,0 +1,44 @@ +/* + * unrelated_class.h + * + * + */ + +#ifndef _OpenAPI_unrelated_class_H_ +#define _OpenAPI_unrelated_class_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "external_unrelated_class.h" +#include "non_external_unrelated_class.h" +#include "service_type_unrelated_class.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_unrelated_class_s OpenAPI_unrelated_class_t; +typedef struct OpenAPI_unrelated_class_s { + struct OpenAPI_non_external_unrelated_class_s *non_external_unrelated_class; + struct OpenAPI_external_unrelated_class_s *external_unrelated_class; + OpenAPI_list_t *service_type_unrelated_classes; +} OpenAPI_unrelated_class_t; + +OpenAPI_unrelated_class_t *OpenAPI_unrelated_class_create( + OpenAPI_non_external_unrelated_class_t *non_external_unrelated_class, + OpenAPI_external_unrelated_class_t *external_unrelated_class, + OpenAPI_list_t *service_type_unrelated_classes + ); +void OpenAPI_unrelated_class_free(OpenAPI_unrelated_class_t *unrelated_class); +OpenAPI_unrelated_class_t *OpenAPI_unrelated_class_parseFromJSON(cJSON *unrelated_classJSON); +cJSON *OpenAPI_unrelated_class_convertToJSON(OpenAPI_unrelated_class_t *unrelated_class); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_unrelated_class_H_ */ + diff --git a/lib/sbi/openapi/model/up_confidentiality.c b/lib/sbi/openapi/model/up_confidentiality.c new file mode 100644 index 0000000000..7fa208fa30 --- /dev/null +++ b/lib/sbi/openapi/model/up_confidentiality.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "up_confidentiality.h" + +OpenAPI_up_confidentiality_t *OpenAPI_up_confidentiality_create( + ) +{ + OpenAPI_up_confidentiality_t *up_confidentiality_local_var = OpenAPI_malloc(sizeof(OpenAPI_up_confidentiality_t)); + if (!up_confidentiality_local_var) { + return NULL; + } + + return up_confidentiality_local_var; +} + +void OpenAPI_up_confidentiality_free(OpenAPI_up_confidentiality_t *up_confidentiality) +{ + if (NULL == up_confidentiality) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(up_confidentiality); +} + +cJSON *OpenAPI_up_confidentiality_convertToJSON(OpenAPI_up_confidentiality_t *up_confidentiality) +{ + cJSON *item = NULL; + + if (up_confidentiality == NULL) { + ogs_error("OpenAPI_up_confidentiality_convertToJSON() failed [UpConfidentiality]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_up_confidentiality_t *OpenAPI_up_confidentiality_parseFromJSON(cJSON *up_confidentialityJSON) +{ + OpenAPI_up_confidentiality_t *up_confidentiality_local_var = NULL; + up_confidentiality_local_var = OpenAPI_up_confidentiality_create ( + ); + + return up_confidentiality_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/up_confidentiality.h b/lib/sbi/openapi/model/up_confidentiality.h new file mode 100644 index 0000000000..501a043a1a --- /dev/null +++ b/lib/sbi/openapi/model/up_confidentiality.h @@ -0,0 +1,35 @@ +/* + * up_confidentiality.h + * + * + */ + +#ifndef _OpenAPI_up_confidentiality_H_ +#define _OpenAPI_up_confidentiality_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_up_confidentiality_s OpenAPI_up_confidentiality_t; +typedef struct OpenAPI_up_confidentiality_s { +} OpenAPI_up_confidentiality_t; + +OpenAPI_up_confidentiality_t *OpenAPI_up_confidentiality_create( + ); +void OpenAPI_up_confidentiality_free(OpenAPI_up_confidentiality_t *up_confidentiality); +OpenAPI_up_confidentiality_t *OpenAPI_up_confidentiality_parseFromJSON(cJSON *up_confidentialityJSON); +cJSON *OpenAPI_up_confidentiality_convertToJSON(OpenAPI_up_confidentiality_t *up_confidentiality); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_up_confidentiality_H_ */ + diff --git a/lib/sbi/openapi/model/up_integrity.c b/lib/sbi/openapi/model/up_integrity.c new file mode 100644 index 0000000000..d06e5b4b81 --- /dev/null +++ b/lib/sbi/openapi/model/up_integrity.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "up_integrity.h" + +OpenAPI_up_integrity_t *OpenAPI_up_integrity_create( + ) +{ + OpenAPI_up_integrity_t *up_integrity_local_var = OpenAPI_malloc(sizeof(OpenAPI_up_integrity_t)); + if (!up_integrity_local_var) { + return NULL; + } + + return up_integrity_local_var; +} + +void OpenAPI_up_integrity_free(OpenAPI_up_integrity_t *up_integrity) +{ + if (NULL == up_integrity) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(up_integrity); +} + +cJSON *OpenAPI_up_integrity_convertToJSON(OpenAPI_up_integrity_t *up_integrity) +{ + cJSON *item = NULL; + + if (up_integrity == NULL) { + ogs_error("OpenAPI_up_integrity_convertToJSON() failed [UpIntegrity]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_up_integrity_t *OpenAPI_up_integrity_parseFromJSON(cJSON *up_integrityJSON) +{ + OpenAPI_up_integrity_t *up_integrity_local_var = NULL; + up_integrity_local_var = OpenAPI_up_integrity_create ( + ); + + return up_integrity_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/up_integrity.h b/lib/sbi/openapi/model/up_integrity.h new file mode 100644 index 0000000000..c71d54a673 --- /dev/null +++ b/lib/sbi/openapi/model/up_integrity.h @@ -0,0 +1,35 @@ +/* + * up_integrity.h + * + * + */ + +#ifndef _OpenAPI_up_integrity_H_ +#define _OpenAPI_up_integrity_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_up_integrity_s OpenAPI_up_integrity_t; +typedef struct OpenAPI_up_integrity_s { +} OpenAPI_up_integrity_t; + +OpenAPI_up_integrity_t *OpenAPI_up_integrity_create( + ); +void OpenAPI_up_integrity_free(OpenAPI_up_integrity_t *up_integrity); +OpenAPI_up_integrity_t *OpenAPI_up_integrity_parseFromJSON(cJSON *up_integrityJSON); +cJSON *OpenAPI_up_integrity_convertToJSON(OpenAPI_up_integrity_t *up_integrity); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_up_integrity_H_ */ + diff --git a/lib/sbi/openapi/model/up_interface_type.h b/lib/sbi/openapi/model/up_interface_type.h index 28ebd09ede..b185e4b0f0 100644 --- a/lib/sbi/openapi/model/up_interface_type.h +++ b/lib/sbi/openapi/model/up_interface_type.h @@ -1,7 +1,7 @@ /* * up_interface_type.h * - * + * Types of User-Plane interfaces of the UPF */ #ifndef _OpenAPI_up_interface_type_H_ diff --git a/lib/sbi/openapi/model/up_security.c b/lib/sbi/openapi/model/up_security.c new file mode 100644 index 0000000000..e4ee49385f --- /dev/null +++ b/lib/sbi/openapi/model/up_security.c @@ -0,0 +1,109 @@ + +#include +#include +#include +#include "up_security.h" + +OpenAPI_up_security_t *OpenAPI_up_security_create( + OpenAPI_up_integrity_t *up_integr, + OpenAPI_up_confidentiality_t *up_confid + ) +{ + OpenAPI_up_security_t *up_security_local_var = OpenAPI_malloc(sizeof(OpenAPI_up_security_t)); + if (!up_security_local_var) { + return NULL; + } + up_security_local_var->up_integr = up_integr; + up_security_local_var->up_confid = up_confid; + + return up_security_local_var; +} + +void OpenAPI_up_security_free(OpenAPI_up_security_t *up_security) +{ + if (NULL == up_security) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_up_integrity_free(up_security->up_integr); + OpenAPI_up_confidentiality_free(up_security->up_confid); + ogs_free(up_security); +} + +cJSON *OpenAPI_up_security_convertToJSON(OpenAPI_up_security_t *up_security) +{ + cJSON *item = NULL; + + if (up_security == NULL) { + ogs_error("OpenAPI_up_security_convertToJSON() failed [UpSecurity]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!up_security->up_integr) { + ogs_error("OpenAPI_up_security_convertToJSON() failed [up_integr]"); + goto end; + } + cJSON *up_integr_local_JSON = OpenAPI_up_integrity_convertToJSON(up_security->up_integr); + if (up_integr_local_JSON == NULL) { + ogs_error("OpenAPI_up_security_convertToJSON() failed [up_integr]"); + goto end; + } + cJSON_AddItemToObject(item, "upIntegr", up_integr_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_up_security_convertToJSON() failed [up_integr]"); + goto end; + } + + if (!up_security->up_confid) { + ogs_error("OpenAPI_up_security_convertToJSON() failed [up_confid]"); + goto end; + } + cJSON *up_confid_local_JSON = OpenAPI_up_confidentiality_convertToJSON(up_security->up_confid); + if (up_confid_local_JSON == NULL) { + ogs_error("OpenAPI_up_security_convertToJSON() failed [up_confid]"); + goto end; + } + cJSON_AddItemToObject(item, "upConfid", up_confid_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_up_security_convertToJSON() failed [up_confid]"); + goto end; + } + +end: + return item; +} + +OpenAPI_up_security_t *OpenAPI_up_security_parseFromJSON(cJSON *up_securityJSON) +{ + OpenAPI_up_security_t *up_security_local_var = NULL; + cJSON *up_integr = cJSON_GetObjectItemCaseSensitive(up_securityJSON, "upIntegr"); + if (!up_integr) { + ogs_error("OpenAPI_up_security_parseFromJSON() failed [up_integr]"); + goto end; + } + + OpenAPI_up_integrity_t *up_integr_local_nonprim = NULL; + + up_integr_local_nonprim = OpenAPI_up_integrity_parseFromJSON(up_integr); + + cJSON *up_confid = cJSON_GetObjectItemCaseSensitive(up_securityJSON, "upConfid"); + if (!up_confid) { + ogs_error("OpenAPI_up_security_parseFromJSON() failed [up_confid]"); + goto end; + } + + OpenAPI_up_confidentiality_t *up_confid_local_nonprim = NULL; + + up_confid_local_nonprim = OpenAPI_up_confidentiality_parseFromJSON(up_confid); + + up_security_local_var = OpenAPI_up_security_create ( + up_integr_local_nonprim, + up_confid_local_nonprim + ); + + return up_security_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/up_security.h b/lib/sbi/openapi/model/up_security.h new file mode 100644 index 0000000000..3578b691b4 --- /dev/null +++ b/lib/sbi/openapi/model/up_security.h @@ -0,0 +1,41 @@ +/* + * up_security.h + * + * + */ + +#ifndef _OpenAPI_up_security_H_ +#define _OpenAPI_up_security_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "up_confidentiality.h" +#include "up_integrity.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_up_security_s OpenAPI_up_security_t; +typedef struct OpenAPI_up_security_s { + struct OpenAPI_up_integrity_s *up_integr; + struct OpenAPI_up_confidentiality_s *up_confid; +} OpenAPI_up_security_t; + +OpenAPI_up_security_t *OpenAPI_up_security_create( + OpenAPI_up_integrity_t *up_integr, + OpenAPI_up_confidentiality_t *up_confid + ); +void OpenAPI_up_security_free(OpenAPI_up_security_t *up_security); +OpenAPI_up_security_t *OpenAPI_up_security_parseFromJSON(cJSON *up_securityJSON); +cJSON *OpenAPI_up_security_convertToJSON(OpenAPI_up_security_t *up_security); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_up_security_H_ */ + diff --git a/lib/sbi/openapi/model/updated_item.c b/lib/sbi/openapi/model/updated_item.c new file mode 100644 index 0000000000..70bfbcf8d2 --- /dev/null +++ b/lib/sbi/openapi/model/updated_item.c @@ -0,0 +1,101 @@ + +#include +#include +#include +#include "updated_item.h" + +OpenAPI_updated_item_t *OpenAPI_updated_item_create( + char *item, + char *value + ) +{ + OpenAPI_updated_item_t *updated_item_local_var = OpenAPI_malloc(sizeof(OpenAPI_updated_item_t)); + if (!updated_item_local_var) { + return NULL; + } + updated_item_local_var->item = item; + updated_item_local_var->value = value; + + return updated_item_local_var; +} + +void OpenAPI_updated_item_free(OpenAPI_updated_item_t *updated_item) +{ + if (NULL == updated_item) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(updated_item->item); + ogs_free(updated_item->value); + ogs_free(updated_item); +} + +cJSON *OpenAPI_updated_item_convertToJSON(OpenAPI_updated_item_t *updated_item) +{ + cJSON *item = NULL; + + if (updated_item == NULL) { + ogs_error("OpenAPI_updated_item_convertToJSON() failed [UpdatedItem]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!updated_item->item) { + ogs_error("OpenAPI_updated_item_convertToJSON() failed [item]"); + goto end; + } + if (cJSON_AddStringToObject(item, "item", updated_item->item) == NULL) { + ogs_error("OpenAPI_updated_item_convertToJSON() failed [item]"); + goto end; + } + + if (!updated_item->value) { + ogs_error("OpenAPI_updated_item_convertToJSON() failed [value]"); + goto end; + } + if (cJSON_AddStringToObject(item, "value", updated_item->value) == NULL) { + ogs_error("OpenAPI_updated_item_convertToJSON() failed [value]"); + goto end; + } + +end: + return item; +} + +OpenAPI_updated_item_t *OpenAPI_updated_item_parseFromJSON(cJSON *updated_itemJSON) +{ + OpenAPI_updated_item_t *updated_item_local_var = NULL; + cJSON *item = cJSON_GetObjectItemCaseSensitive(updated_itemJSON, "item"); + if (!item) { + ogs_error("OpenAPI_updated_item_parseFromJSON() failed [item]"); + goto end; + } + + + if (!cJSON_IsString(item)) { + ogs_error("OpenAPI_updated_item_parseFromJSON() failed [item]"); + goto end; + } + + cJSON *value = cJSON_GetObjectItemCaseSensitive(updated_itemJSON, "value"); + if (!value) { + ogs_error("OpenAPI_updated_item_parseFromJSON() failed [value]"); + goto end; + } + + + if (!cJSON_IsString(value)) { + ogs_error("OpenAPI_updated_item_parseFromJSON() failed [value]"); + goto end; + } + + updated_item_local_var = OpenAPI_updated_item_create ( + ogs_strdup(item->valuestring), + ogs_strdup(value->valuestring) + ); + + return updated_item_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/updated_item.h b/lib/sbi/openapi/model/updated_item.h new file mode 100644 index 0000000000..d812372db3 --- /dev/null +++ b/lib/sbi/openapi/model/updated_item.h @@ -0,0 +1,39 @@ +/* + * updated_item.h + * + * Identifies a fragment of a resource. + */ + +#ifndef _OpenAPI_updated_item_H_ +#define _OpenAPI_updated_item_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_updated_item_s OpenAPI_updated_item_t; +typedef struct OpenAPI_updated_item_s { + char *item; + char *value; +} OpenAPI_updated_item_t; + +OpenAPI_updated_item_t *OpenAPI_updated_item_create( + char *item, + char *value + ); +void OpenAPI_updated_item_free(OpenAPI_updated_item_t *updated_item); +OpenAPI_updated_item_t *OpenAPI_updated_item_parseFromJSON(cJSON *updated_itemJSON); +cJSON *OpenAPI_updated_item_convertToJSON(OpenAPI_updated_item_t *updated_item); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_updated_item_H_ */ + diff --git a/lib/sbi/openapi/model/upf_cond.c b/lib/sbi/openapi/model/upf_cond.c new file mode 100644 index 0000000000..8e2c34d54f --- /dev/null +++ b/lib/sbi/openapi/model/upf_cond.c @@ -0,0 +1,144 @@ + +#include +#include +#include +#include "upf_cond.h" + +OpenAPI_upf_cond_t *OpenAPI_upf_cond_create( + OpenAPI_list_t *smf_serving_area, + OpenAPI_list_t *tai_list + ) +{ + OpenAPI_upf_cond_t *upf_cond_local_var = OpenAPI_malloc(sizeof(OpenAPI_upf_cond_t)); + if (!upf_cond_local_var) { + return NULL; + } + upf_cond_local_var->smf_serving_area = smf_serving_area; + upf_cond_local_var->tai_list = tai_list; + + return upf_cond_local_var; +} + +void OpenAPI_upf_cond_free(OpenAPI_upf_cond_t *upf_cond) +{ + if (NULL == upf_cond) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(upf_cond->smf_serving_area, node) { + ogs_free(node->data); + } + OpenAPI_list_free(upf_cond->smf_serving_area); + OpenAPI_list_for_each(upf_cond->tai_list, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(upf_cond->tai_list); + ogs_free(upf_cond); +} + +cJSON *OpenAPI_upf_cond_convertToJSON(OpenAPI_upf_cond_t *upf_cond) +{ + cJSON *item = NULL; + + if (upf_cond == NULL) { + ogs_error("OpenAPI_upf_cond_convertToJSON() failed [UpfCond]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (upf_cond->smf_serving_area) { + cJSON *smf_serving_area = cJSON_AddArrayToObject(item, "smfServingArea"); + if (smf_serving_area == NULL) { + ogs_error("OpenAPI_upf_cond_convertToJSON() failed [smf_serving_area]"); + goto end; + } + + OpenAPI_lnode_t *smf_serving_area_node; + OpenAPI_list_for_each(upf_cond->smf_serving_area, smf_serving_area_node) { + if (cJSON_AddStringToObject(smf_serving_area, "", (char*)smf_serving_area_node->data) == NULL) { + ogs_error("OpenAPI_upf_cond_convertToJSON() failed [smf_serving_area]"); + goto end; + } + } + } + + if (upf_cond->tai_list) { + cJSON *tai_listList = cJSON_AddArrayToObject(item, "taiList"); + if (tai_listList == NULL) { + ogs_error("OpenAPI_upf_cond_convertToJSON() failed [tai_list]"); + goto end; + } + + OpenAPI_lnode_t *tai_list_node; + if (upf_cond->tai_list) { + OpenAPI_list_for_each(upf_cond->tai_list, tai_list_node) { + cJSON *itemLocal = OpenAPI_tai_convertToJSON(tai_list_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_upf_cond_convertToJSON() failed [tai_list]"); + goto end; + } + cJSON_AddItemToArray(tai_listList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_upf_cond_t *OpenAPI_upf_cond_parseFromJSON(cJSON *upf_condJSON) +{ + OpenAPI_upf_cond_t *upf_cond_local_var = NULL; + cJSON *smf_serving_area = cJSON_GetObjectItemCaseSensitive(upf_condJSON, "smfServingArea"); + + OpenAPI_list_t *smf_serving_areaList; + if (smf_serving_area) { + cJSON *smf_serving_area_local; + if (!cJSON_IsArray(smf_serving_area)) { + ogs_error("OpenAPI_upf_cond_parseFromJSON() failed [smf_serving_area]"); + goto end; + } + smf_serving_areaList = OpenAPI_list_create(); + + cJSON_ArrayForEach(smf_serving_area_local, smf_serving_area) { + if (!cJSON_IsString(smf_serving_area_local)) { + ogs_error("OpenAPI_upf_cond_parseFromJSON() failed [smf_serving_area]"); + goto end; + } + OpenAPI_list_add(smf_serving_areaList, ogs_strdup(smf_serving_area_local->valuestring)); + } + } + + cJSON *tai_list = cJSON_GetObjectItemCaseSensitive(upf_condJSON, "taiList"); + + OpenAPI_list_t *tai_listList; + if (tai_list) { + cJSON *tai_list_local_nonprimitive; + if (!cJSON_IsArray(tai_list)) { + ogs_error("OpenAPI_upf_cond_parseFromJSON() failed [tai_list]"); + goto end; + } + + tai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tai_list_local_nonprimitive, tai_list ) { + if (!cJSON_IsObject(tai_list_local_nonprimitive)) { + ogs_error("OpenAPI_upf_cond_parseFromJSON() failed [tai_list]"); + goto end; + } + OpenAPI_tai_t *tai_listItem = OpenAPI_tai_parseFromJSON(tai_list_local_nonprimitive); + + OpenAPI_list_add(tai_listList, tai_listItem); + } + } + + upf_cond_local_var = OpenAPI_upf_cond_create ( + smf_serving_area ? smf_serving_areaList : NULL, + tai_list ? tai_listList : NULL + ); + + return upf_cond_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/upf_cond.h b/lib/sbi/openapi/model/upf_cond.h new file mode 100644 index 0000000000..e333a9496e --- /dev/null +++ b/lib/sbi/openapi/model/upf_cond.h @@ -0,0 +1,40 @@ +/* + * upf_cond.h + * + * + */ + +#ifndef _OpenAPI_upf_cond_H_ +#define _OpenAPI_upf_cond_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "tai.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_upf_cond_s OpenAPI_upf_cond_t; +typedef struct OpenAPI_upf_cond_s { + OpenAPI_list_t *smf_serving_area; + OpenAPI_list_t *tai_list; +} OpenAPI_upf_cond_t; + +OpenAPI_upf_cond_t *OpenAPI_upf_cond_create( + OpenAPI_list_t *smf_serving_area, + OpenAPI_list_t *tai_list + ); +void OpenAPI_upf_cond_free(OpenAPI_upf_cond_t *upf_cond); +OpenAPI_upf_cond_t *OpenAPI_upf_cond_parseFromJSON(cJSON *upf_condJSON); +cJSON *OpenAPI_upf_cond_convertToJSON(OpenAPI_upf_cond_t *upf_cond); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_upf_cond_H_ */ + diff --git a/lib/sbi/openapi/model/upf_info.c b/lib/sbi/openapi/model/upf_info.c index 81223fc390..58933ee78c 100644 --- a/lib/sbi/openapi/model/upf_info.c +++ b/lib/sbi/openapi/model/upf_info.c @@ -11,7 +11,13 @@ OpenAPI_upf_info_t *OpenAPI_upf_info_create( int iwk_eps_ind, OpenAPI_list_t *pdu_session_types, OpenAPI_atsss_capability_t *atsss_capability, - int ue_ip_addr_ind + int ue_ip_addr_ind, + OpenAPI_list_t *tai_list, + OpenAPI_w_agf_info_t *w_agf_info, + OpenAPI_tngf_info_t *tngf_info, + OpenAPI_twif_info_t *twif_info, + int priority, + int redundant_gtpu ) { OpenAPI_upf_info_t *upf_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_upf_info_t)); @@ -25,6 +31,12 @@ OpenAPI_upf_info_t *OpenAPI_upf_info_create( upf_info_local_var->pdu_session_types = pdu_session_types; upf_info_local_var->atsss_capability = atsss_capability; upf_info_local_var->ue_ip_addr_ind = ue_ip_addr_ind; + upf_info_local_var->tai_list = tai_list; + upf_info_local_var->w_agf_info = w_agf_info; + upf_info_local_var->tngf_info = tngf_info; + upf_info_local_var->twif_info = twif_info; + upf_info_local_var->priority = priority; + upf_info_local_var->redundant_gtpu = redundant_gtpu; return upf_info_local_var; } @@ -52,6 +64,13 @@ void OpenAPI_upf_info_free(OpenAPI_upf_info_t *upf_info) } OpenAPI_list_free(upf_info->pdu_session_types); OpenAPI_atsss_capability_free(upf_info->atsss_capability); + OpenAPI_list_for_each(upf_info->tai_list, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(upf_info->tai_list); + OpenAPI_w_agf_info_free(upf_info->w_agf_info); + OpenAPI_tngf_info_free(upf_info->tngf_info); + OpenAPI_twif_info_free(upf_info->twif_info); ogs_free(upf_info); } @@ -123,7 +142,7 @@ cJSON *OpenAPI_upf_info_convertToJSON(OpenAPI_upf_info_t *upf_info) } } - if (upf_info->iwk_eps_ind) { + if (upf_info->iwk_eps_ind >= 0) { if (cJSON_AddBoolToObject(item, "iwkEpsInd", upf_info->iwk_eps_ind) == NULL) { ogs_error("OpenAPI_upf_info_convertToJSON() failed [iwk_eps_ind]"); goto end; @@ -163,13 +182,86 @@ cJSON *OpenAPI_upf_info_convertToJSON(OpenAPI_upf_info_t *upf_info) } } - if (upf_info->ue_ip_addr_ind) { + if (upf_info->ue_ip_addr_ind >= 0) { if (cJSON_AddBoolToObject(item, "ueIpAddrInd", upf_info->ue_ip_addr_ind) == NULL) { ogs_error("OpenAPI_upf_info_convertToJSON() failed [ue_ip_addr_ind]"); goto end; } } + if (upf_info->tai_list) { + cJSON *tai_listList = cJSON_AddArrayToObject(item, "taiList"); + if (tai_listList == NULL) { + ogs_error("OpenAPI_upf_info_convertToJSON() failed [tai_list]"); + goto end; + } + + OpenAPI_lnode_t *tai_list_node; + if (upf_info->tai_list) { + OpenAPI_list_for_each(upf_info->tai_list, tai_list_node) { + cJSON *itemLocal = OpenAPI_tai_convertToJSON(tai_list_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_upf_info_convertToJSON() failed [tai_list]"); + goto end; + } + cJSON_AddItemToArray(tai_listList, itemLocal); + } + } + } + + if (upf_info->w_agf_info) { + cJSON *w_agf_info_local_JSON = OpenAPI_w_agf_info_convertToJSON(upf_info->w_agf_info); + if (w_agf_info_local_JSON == NULL) { + ogs_error("OpenAPI_upf_info_convertToJSON() failed [w_agf_info]"); + goto end; + } + cJSON_AddItemToObject(item, "wAgfInfo", w_agf_info_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_upf_info_convertToJSON() failed [w_agf_info]"); + goto end; + } + } + + if (upf_info->tngf_info) { + cJSON *tngf_info_local_JSON = OpenAPI_tngf_info_convertToJSON(upf_info->tngf_info); + if (tngf_info_local_JSON == NULL) { + ogs_error("OpenAPI_upf_info_convertToJSON() failed [tngf_info]"); + goto end; + } + cJSON_AddItemToObject(item, "tngfInfo", tngf_info_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_upf_info_convertToJSON() failed [tngf_info]"); + goto end; + } + } + + if (upf_info->twif_info) { + cJSON *twif_info_local_JSON = OpenAPI_twif_info_convertToJSON(upf_info->twif_info); + if (twif_info_local_JSON == NULL) { + ogs_error("OpenAPI_upf_info_convertToJSON() failed [twif_info]"); + goto end; + } + cJSON_AddItemToObject(item, "twifInfo", twif_info_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_upf_info_convertToJSON() failed [twif_info]"); + goto end; + } + } + + if (upf_info->priority) { + if (cJSON_AddNumberToObject(item, "priority", upf_info->priority) == NULL) { + ogs_error("OpenAPI_upf_info_convertToJSON() failed [priority]"); + goto end; + } + } + + if (upf_info->redundant_gtpu >= 0) { + if (cJSON_AddBoolToObject(item, "redundantGtpu", upf_info->redundant_gtpu) == NULL) { + ogs_error("OpenAPI_upf_info_convertToJSON() failed [redundant_gtpu]"); + goto end; + } + } + end: return item; } @@ -294,6 +386,68 @@ OpenAPI_upf_info_t *OpenAPI_upf_info_parseFromJSON(cJSON *upf_infoJSON) } } + cJSON *tai_list = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "taiList"); + + OpenAPI_list_t *tai_listList; + if (tai_list) { + cJSON *tai_list_local_nonprimitive; + if (!cJSON_IsArray(tai_list)) { + ogs_error("OpenAPI_upf_info_parseFromJSON() failed [tai_list]"); + goto end; + } + + tai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tai_list_local_nonprimitive, tai_list ) { + if (!cJSON_IsObject(tai_list_local_nonprimitive)) { + ogs_error("OpenAPI_upf_info_parseFromJSON() failed [tai_list]"); + goto end; + } + OpenAPI_tai_t *tai_listItem = OpenAPI_tai_parseFromJSON(tai_list_local_nonprimitive); + + OpenAPI_list_add(tai_listList, tai_listItem); + } + } + + cJSON *w_agf_info = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "wAgfInfo"); + + OpenAPI_w_agf_info_t *w_agf_info_local_nonprim = NULL; + if (w_agf_info) { + w_agf_info_local_nonprim = OpenAPI_w_agf_info_parseFromJSON(w_agf_info); + } + + cJSON *tngf_info = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "tngfInfo"); + + OpenAPI_tngf_info_t *tngf_info_local_nonprim = NULL; + if (tngf_info) { + tngf_info_local_nonprim = OpenAPI_tngf_info_parseFromJSON(tngf_info); + } + + cJSON *twif_info = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "twifInfo"); + + OpenAPI_twif_info_t *twif_info_local_nonprim = NULL; + if (twif_info) { + twif_info_local_nonprim = OpenAPI_twif_info_parseFromJSON(twif_info); + } + + cJSON *priority = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "priority"); + + if (priority) { + if (!cJSON_IsNumber(priority)) { + ogs_error("OpenAPI_upf_info_parseFromJSON() failed [priority]"); + goto end; + } + } + + cJSON *redundant_gtpu = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "redundantGtpu"); + + if (redundant_gtpu) { + if (!cJSON_IsBool(redundant_gtpu)) { + ogs_error("OpenAPI_upf_info_parseFromJSON() failed [redundant_gtpu]"); + goto end; + } + } + upf_info_local_var = OpenAPI_upf_info_create ( s_nssai_upf_info_listList, smf_serving_area ? smf_serving_areaList : NULL, @@ -301,7 +455,13 @@ OpenAPI_upf_info_t *OpenAPI_upf_info_parseFromJSON(cJSON *upf_infoJSON) iwk_eps_ind ? iwk_eps_ind->valueint : 0, pdu_session_types ? pdu_session_typesList : NULL, atsss_capability ? atsss_capability_local_nonprim : NULL, - ue_ip_addr_ind ? ue_ip_addr_ind->valueint : 0 + ue_ip_addr_ind ? ue_ip_addr_ind->valueint : 0, + tai_list ? tai_listList : NULL, + w_agf_info ? w_agf_info_local_nonprim : NULL, + tngf_info ? tngf_info_local_nonprim : NULL, + twif_info ? twif_info_local_nonprim : NULL, + priority ? priority->valuedouble : 0, + redundant_gtpu ? redundant_gtpu->valueint : 0 ); return upf_info_local_var; diff --git a/lib/sbi/openapi/model/upf_info.h b/lib/sbi/openapi/model/upf_info.h index 1633f4d5f0..ffc9bef766 100644 --- a/lib/sbi/openapi/model/upf_info.h +++ b/lib/sbi/openapi/model/upf_info.h @@ -1,7 +1,7 @@ /* * upf_info.h * - * + * Information of an UPF NF Instance */ #ifndef _OpenAPI_upf_info_H_ @@ -16,6 +16,10 @@ #include "interface_upf_info_item.h" #include "pdu_session_type.h" #include "snssai_upf_info_item.h" +#include "tai.h" +#include "tngf_info.h" +#include "twif_info.h" +#include "w_agf_info.h" #ifdef __cplusplus extern "C" { @@ -30,6 +34,12 @@ typedef struct OpenAPI_upf_info_s { OpenAPI_list_t *pdu_session_types; struct OpenAPI_atsss_capability_s *atsss_capability; int ue_ip_addr_ind; + OpenAPI_list_t *tai_list; + struct OpenAPI_w_agf_info_s *w_agf_info; + struct OpenAPI_tngf_info_s *tngf_info; + struct OpenAPI_twif_info_s *twif_info; + int priority; + int redundant_gtpu; } OpenAPI_upf_info_t; OpenAPI_upf_info_t *OpenAPI_upf_info_create( @@ -39,7 +49,13 @@ OpenAPI_upf_info_t *OpenAPI_upf_info_create( int iwk_eps_ind, OpenAPI_list_t *pdu_session_types, OpenAPI_atsss_capability_t *atsss_capability, - int ue_ip_addr_ind + int ue_ip_addr_ind, + OpenAPI_list_t *tai_list, + OpenAPI_w_agf_info_t *w_agf_info, + OpenAPI_tngf_info_t *tngf_info, + OpenAPI_twif_info_t *twif_info, + int priority, + int redundant_gtpu ); void OpenAPI_upf_info_free(OpenAPI_upf_info_t *upf_info); OpenAPI_upf_info_t *OpenAPI_upf_info_parseFromJSON(cJSON *upf_infoJSON); diff --git a/lib/sbi/openapi/model/upu_data.c b/lib/sbi/openapi/model/upu_data.c new file mode 100644 index 0000000000..ad5dcd847b --- /dev/null +++ b/lib/sbi/openapi/model/upu_data.c @@ -0,0 +1,142 @@ + +#include +#include +#include +#include "upu_data.h" + +OpenAPI_upu_data_t *OpenAPI_upu_data_create( + char *provisioning_time, + OpenAPI_ue_update_status_e ue_update_status, + char *upu_xmac_iue, + char *upu_mac_iue + ) +{ + OpenAPI_upu_data_t *upu_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_upu_data_t)); + if (!upu_data_local_var) { + return NULL; + } + upu_data_local_var->provisioning_time = provisioning_time; + upu_data_local_var->ue_update_status = ue_update_status; + upu_data_local_var->upu_xmac_iue = upu_xmac_iue; + upu_data_local_var->upu_mac_iue = upu_mac_iue; + + return upu_data_local_var; +} + +void OpenAPI_upu_data_free(OpenAPI_upu_data_t *upu_data) +{ + if (NULL == upu_data) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(upu_data->provisioning_time); + ogs_free(upu_data->upu_xmac_iue); + ogs_free(upu_data->upu_mac_iue); + ogs_free(upu_data); +} + +cJSON *OpenAPI_upu_data_convertToJSON(OpenAPI_upu_data_t *upu_data) +{ + cJSON *item = NULL; + + if (upu_data == NULL) { + ogs_error("OpenAPI_upu_data_convertToJSON() failed [UpuData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!upu_data->provisioning_time) { + ogs_error("OpenAPI_upu_data_convertToJSON() failed [provisioning_time]"); + goto end; + } + if (cJSON_AddStringToObject(item, "provisioningTime", upu_data->provisioning_time) == NULL) { + ogs_error("OpenAPI_upu_data_convertToJSON() failed [provisioning_time]"); + goto end; + } + + if (!upu_data->ue_update_status) { + ogs_error("OpenAPI_upu_data_convertToJSON() failed [ue_update_status]"); + goto end; + } + if (cJSON_AddStringToObject(item, "ueUpdateStatus", OpenAPI_ue_update_status_ToString(upu_data->ue_update_status)) == NULL) { + ogs_error("OpenAPI_upu_data_convertToJSON() failed [ue_update_status]"); + goto end; + } + + if (upu_data->upu_xmac_iue) { + if (cJSON_AddStringToObject(item, "upuXmacIue", upu_data->upu_xmac_iue) == NULL) { + ogs_error("OpenAPI_upu_data_convertToJSON() failed [upu_xmac_iue]"); + goto end; + } + } + + if (upu_data->upu_mac_iue) { + if (cJSON_AddStringToObject(item, "upuMacIue", upu_data->upu_mac_iue) == NULL) { + ogs_error("OpenAPI_upu_data_convertToJSON() failed [upu_mac_iue]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_upu_data_t *OpenAPI_upu_data_parseFromJSON(cJSON *upu_dataJSON) +{ + OpenAPI_upu_data_t *upu_data_local_var = NULL; + cJSON *provisioning_time = cJSON_GetObjectItemCaseSensitive(upu_dataJSON, "provisioningTime"); + if (!provisioning_time) { + ogs_error("OpenAPI_upu_data_parseFromJSON() failed [provisioning_time]"); + goto end; + } + + + if (!cJSON_IsString(provisioning_time)) { + ogs_error("OpenAPI_upu_data_parseFromJSON() failed [provisioning_time]"); + goto end; + } + + cJSON *ue_update_status = cJSON_GetObjectItemCaseSensitive(upu_dataJSON, "ueUpdateStatus"); + if (!ue_update_status) { + ogs_error("OpenAPI_upu_data_parseFromJSON() failed [ue_update_status]"); + goto end; + } + + OpenAPI_ue_update_status_e ue_update_statusVariable; + + if (!cJSON_IsString(ue_update_status)) { + ogs_error("OpenAPI_upu_data_parseFromJSON() failed [ue_update_status]"); + goto end; + } + ue_update_statusVariable = OpenAPI_ue_update_status_FromString(ue_update_status->valuestring); + + cJSON *upu_xmac_iue = cJSON_GetObjectItemCaseSensitive(upu_dataJSON, "upuXmacIue"); + + if (upu_xmac_iue) { + if (!cJSON_IsString(upu_xmac_iue)) { + ogs_error("OpenAPI_upu_data_parseFromJSON() failed [upu_xmac_iue]"); + goto end; + } + } + + cJSON *upu_mac_iue = cJSON_GetObjectItemCaseSensitive(upu_dataJSON, "upuMacIue"); + + if (upu_mac_iue) { + if (!cJSON_IsString(upu_mac_iue)) { + ogs_error("OpenAPI_upu_data_parseFromJSON() failed [upu_mac_iue]"); + goto end; + } + } + + upu_data_local_var = OpenAPI_upu_data_create ( + ogs_strdup(provisioning_time->valuestring), + ue_update_statusVariable, + upu_xmac_iue ? ogs_strdup(upu_xmac_iue->valuestring) : NULL, + upu_mac_iue ? ogs_strdup(upu_mac_iue->valuestring) : NULL + ); + + return upu_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/upu_data.h b/lib/sbi/openapi/model/upu_data.h new file mode 100644 index 0000000000..85c1365044 --- /dev/null +++ b/lib/sbi/openapi/model/upu_data.h @@ -0,0 +1,44 @@ +/* + * upu_data.h + * + * + */ + +#ifndef _OpenAPI_upu_data_H_ +#define _OpenAPI_upu_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "ue_update_status.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_upu_data_s OpenAPI_upu_data_t; +typedef struct OpenAPI_upu_data_s { + char *provisioning_time; + OpenAPI_ue_update_status_e ue_update_status; + char *upu_xmac_iue; + char *upu_mac_iue; +} OpenAPI_upu_data_t; + +OpenAPI_upu_data_t *OpenAPI_upu_data_create( + char *provisioning_time, + OpenAPI_ue_update_status_e ue_update_status, + char *upu_xmac_iue, + char *upu_mac_iue + ); +void OpenAPI_upu_data_free(OpenAPI_upu_data_t *upu_data); +OpenAPI_upu_data_t *OpenAPI_upu_data_parseFromJSON(cJSON *upu_dataJSON); +cJSON *OpenAPI_upu_data_convertToJSON(OpenAPI_upu_data_t *upu_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_upu_data_H_ */ + diff --git a/lib/sbi/openapi/model/upu_data_2.c b/lib/sbi/openapi/model/upu_data_2.c new file mode 100644 index 0000000000..70cc38f6dd --- /dev/null +++ b/lib/sbi/openapi/model/upu_data_2.c @@ -0,0 +1,141 @@ + +#include +#include +#include +#include "upu_data_2.h" + +OpenAPI_upu_data_2_t *OpenAPI_upu_data_2_create( + char *sec_packet, + OpenAPI_list_t *default_conf_nssai, + char *routing_id + ) +{ + OpenAPI_upu_data_2_t *upu_data_2_local_var = OpenAPI_malloc(sizeof(OpenAPI_upu_data_2_t)); + if (!upu_data_2_local_var) { + return NULL; + } + upu_data_2_local_var->sec_packet = sec_packet; + upu_data_2_local_var->default_conf_nssai = default_conf_nssai; + upu_data_2_local_var->routing_id = routing_id; + + return upu_data_2_local_var; +} + +void OpenAPI_upu_data_2_free(OpenAPI_upu_data_2_t *upu_data_2) +{ + if (NULL == upu_data_2) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(upu_data_2->sec_packet); + OpenAPI_list_for_each(upu_data_2->default_conf_nssai, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(upu_data_2->default_conf_nssai); + ogs_free(upu_data_2->routing_id); + ogs_free(upu_data_2); +} + +cJSON *OpenAPI_upu_data_2_convertToJSON(OpenAPI_upu_data_2_t *upu_data_2) +{ + cJSON *item = NULL; + + if (upu_data_2 == NULL) { + ogs_error("OpenAPI_upu_data_2_convertToJSON() failed [UpuData_2]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (upu_data_2->sec_packet) { + if (cJSON_AddStringToObject(item, "secPacket", upu_data_2->sec_packet) == NULL) { + ogs_error("OpenAPI_upu_data_2_convertToJSON() failed [sec_packet]"); + goto end; + } + } + + if (upu_data_2->default_conf_nssai) { + cJSON *default_conf_nssaiList = cJSON_AddArrayToObject(item, "defaultConfNssai"); + if (default_conf_nssaiList == NULL) { + ogs_error("OpenAPI_upu_data_2_convertToJSON() failed [default_conf_nssai]"); + goto end; + } + + OpenAPI_lnode_t *default_conf_nssai_node; + if (upu_data_2->default_conf_nssai) { + OpenAPI_list_for_each(upu_data_2->default_conf_nssai, default_conf_nssai_node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(default_conf_nssai_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_upu_data_2_convertToJSON() failed [default_conf_nssai]"); + goto end; + } + cJSON_AddItemToArray(default_conf_nssaiList, itemLocal); + } + } + } + + if (upu_data_2->routing_id) { + if (cJSON_AddStringToObject(item, "routingId", upu_data_2->routing_id) == NULL) { + ogs_error("OpenAPI_upu_data_2_convertToJSON() failed [routing_id]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_upu_data_2_t *OpenAPI_upu_data_2_parseFromJSON(cJSON *upu_data_2JSON) +{ + OpenAPI_upu_data_2_t *upu_data_2_local_var = NULL; + cJSON *sec_packet = cJSON_GetObjectItemCaseSensitive(upu_data_2JSON, "secPacket"); + + if (sec_packet) { + if (!cJSON_IsString(sec_packet)) { + ogs_error("OpenAPI_upu_data_2_parseFromJSON() failed [sec_packet]"); + goto end; + } + } + + cJSON *default_conf_nssai = cJSON_GetObjectItemCaseSensitive(upu_data_2JSON, "defaultConfNssai"); + + OpenAPI_list_t *default_conf_nssaiList; + if (default_conf_nssai) { + cJSON *default_conf_nssai_local_nonprimitive; + if (!cJSON_IsArray(default_conf_nssai)) { + ogs_error("OpenAPI_upu_data_2_parseFromJSON() failed [default_conf_nssai]"); + goto end; + } + + default_conf_nssaiList = OpenAPI_list_create(); + + cJSON_ArrayForEach(default_conf_nssai_local_nonprimitive, default_conf_nssai ) { + if (!cJSON_IsObject(default_conf_nssai_local_nonprimitive)) { + ogs_error("OpenAPI_upu_data_2_parseFromJSON() failed [default_conf_nssai]"); + goto end; + } + OpenAPI_snssai_t *default_conf_nssaiItem = OpenAPI_snssai_parseFromJSON(default_conf_nssai_local_nonprimitive); + + OpenAPI_list_add(default_conf_nssaiList, default_conf_nssaiItem); + } + } + + cJSON *routing_id = cJSON_GetObjectItemCaseSensitive(upu_data_2JSON, "routingId"); + + if (routing_id) { + if (!cJSON_IsString(routing_id)) { + ogs_error("OpenAPI_upu_data_2_parseFromJSON() failed [routing_id]"); + goto end; + } + } + + upu_data_2_local_var = OpenAPI_upu_data_2_create ( + sec_packet ? ogs_strdup(sec_packet->valuestring) : NULL, + default_conf_nssai ? default_conf_nssaiList : NULL, + routing_id ? ogs_strdup(routing_id->valuestring) : NULL + ); + + return upu_data_2_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/upu_data_2.h b/lib/sbi/openapi/model/upu_data_2.h new file mode 100644 index 0000000000..65610cfd5b --- /dev/null +++ b/lib/sbi/openapi/model/upu_data_2.h @@ -0,0 +1,42 @@ +/* + * upu_data_2.h + * + * + */ + +#ifndef _OpenAPI_upu_data_2_H_ +#define _OpenAPI_upu_data_2_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "snssai.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_upu_data_2_s OpenAPI_upu_data_2_t; +typedef struct OpenAPI_upu_data_2_s { + char *sec_packet; + OpenAPI_list_t *default_conf_nssai; + char *routing_id; +} OpenAPI_upu_data_2_t; + +OpenAPI_upu_data_2_t *OpenAPI_upu_data_2_create( + char *sec_packet, + OpenAPI_list_t *default_conf_nssai, + char *routing_id + ); +void OpenAPI_upu_data_2_free(OpenAPI_upu_data_2_t *upu_data_2); +OpenAPI_upu_data_2_t *OpenAPI_upu_data_2_parseFromJSON(cJSON *upu_data_2JSON); +cJSON *OpenAPI_upu_data_2_convertToJSON(OpenAPI_upu_data_2_t *upu_data_2); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_upu_data_2_H_ */ + diff --git a/lib/sbi/openapi/model/upu_info.c b/lib/sbi/openapi/model/upu_info.c new file mode 100644 index 0000000000..489fec8162 --- /dev/null +++ b/lib/sbi/openapi/model/upu_info.c @@ -0,0 +1,211 @@ + +#include +#include +#include +#include "upu_info.h" + +OpenAPI_upu_info_t *OpenAPI_upu_info_create( + OpenAPI_list_t *upu_data_list, + int upu_reg_ind, + int upu_ack_ind, + char *upu_mac_iausf, + char *counter_upu, + char *provisioning_time + ) +{ + OpenAPI_upu_info_t *upu_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_upu_info_t)); + if (!upu_info_local_var) { + return NULL; + } + upu_info_local_var->upu_data_list = upu_data_list; + upu_info_local_var->upu_reg_ind = upu_reg_ind; + upu_info_local_var->upu_ack_ind = upu_ack_ind; + upu_info_local_var->upu_mac_iausf = upu_mac_iausf; + upu_info_local_var->counter_upu = counter_upu; + upu_info_local_var->provisioning_time = provisioning_time; + + return upu_info_local_var; +} + +void OpenAPI_upu_info_free(OpenAPI_upu_info_t *upu_info) +{ + if (NULL == upu_info) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(upu_info->upu_data_list, node) { + OpenAPI_upu_data_2_free(node->data); + } + OpenAPI_list_free(upu_info->upu_data_list); + ogs_free(upu_info->upu_mac_iausf); + ogs_free(upu_info->counter_upu); + ogs_free(upu_info->provisioning_time); + ogs_free(upu_info); +} + +cJSON *OpenAPI_upu_info_convertToJSON(OpenAPI_upu_info_t *upu_info) +{ + cJSON *item = NULL; + + if (upu_info == NULL) { + ogs_error("OpenAPI_upu_info_convertToJSON() failed [UpuInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!upu_info->upu_data_list) { + ogs_error("OpenAPI_upu_info_convertToJSON() failed [upu_data_list]"); + goto end; + } + cJSON *upu_data_listList = cJSON_AddArrayToObject(item, "upuDataList"); + if (upu_data_listList == NULL) { + ogs_error("OpenAPI_upu_info_convertToJSON() failed [upu_data_list]"); + goto end; + } + + OpenAPI_lnode_t *upu_data_list_node; + if (upu_info->upu_data_list) { + OpenAPI_list_for_each(upu_info->upu_data_list, upu_data_list_node) { + cJSON *itemLocal = OpenAPI_upu_data_2_convertToJSON(upu_data_list_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_upu_info_convertToJSON() failed [upu_data_list]"); + goto end; + } + cJSON_AddItemToArray(upu_data_listList, itemLocal); + } + } + + if (cJSON_AddBoolToObject(item, "upuRegInd", upu_info->upu_reg_ind) == NULL) { + ogs_error("OpenAPI_upu_info_convertToJSON() failed [upu_reg_ind]"); + goto end; + } + + if (cJSON_AddBoolToObject(item, "upuAckInd", upu_info->upu_ack_ind) == NULL) { + ogs_error("OpenAPI_upu_info_convertToJSON() failed [upu_ack_ind]"); + goto end; + } + + if (upu_info->upu_mac_iausf) { + if (cJSON_AddStringToObject(item, "upuMacIausf", upu_info->upu_mac_iausf) == NULL) { + ogs_error("OpenAPI_upu_info_convertToJSON() failed [upu_mac_iausf]"); + goto end; + } + } + + if (upu_info->counter_upu) { + if (cJSON_AddStringToObject(item, "counterUpu", upu_info->counter_upu) == NULL) { + ogs_error("OpenAPI_upu_info_convertToJSON() failed [counter_upu]"); + goto end; + } + } + + if (!upu_info->provisioning_time) { + ogs_error("OpenAPI_upu_info_convertToJSON() failed [provisioning_time]"); + goto end; + } + if (cJSON_AddStringToObject(item, "provisioningTime", upu_info->provisioning_time) == NULL) { + ogs_error("OpenAPI_upu_info_convertToJSON() failed [provisioning_time]"); + goto end; + } + +end: + return item; +} + +OpenAPI_upu_info_t *OpenAPI_upu_info_parseFromJSON(cJSON *upu_infoJSON) +{ + OpenAPI_upu_info_t *upu_info_local_var = NULL; + cJSON *upu_data_list = cJSON_GetObjectItemCaseSensitive(upu_infoJSON, "upuDataList"); + if (!upu_data_list) { + ogs_error("OpenAPI_upu_info_parseFromJSON() failed [upu_data_list]"); + goto end; + } + + OpenAPI_list_t *upu_data_listList; + + cJSON *upu_data_list_local_nonprimitive; + if (!cJSON_IsArray(upu_data_list)) { + ogs_error("OpenAPI_upu_info_parseFromJSON() failed [upu_data_list]"); + goto end; + } + + upu_data_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(upu_data_list_local_nonprimitive, upu_data_list ) { + if (!cJSON_IsObject(upu_data_list_local_nonprimitive)) { + ogs_error("OpenAPI_upu_info_parseFromJSON() failed [upu_data_list]"); + goto end; + } + OpenAPI_upu_data_2_t *upu_data_listItem = OpenAPI_upu_data_2_parseFromJSON(upu_data_list_local_nonprimitive); + + OpenAPI_list_add(upu_data_listList, upu_data_listItem); + } + + cJSON *upu_reg_ind = cJSON_GetObjectItemCaseSensitive(upu_infoJSON, "upuRegInd"); + if (!upu_reg_ind) { + ogs_error("OpenAPI_upu_info_parseFromJSON() failed [upu_reg_ind]"); + goto end; + } + + + if (!cJSON_IsBool(upu_reg_ind)) { + ogs_error("OpenAPI_upu_info_parseFromJSON() failed [upu_reg_ind]"); + goto end; + } + + cJSON *upu_ack_ind = cJSON_GetObjectItemCaseSensitive(upu_infoJSON, "upuAckInd"); + if (!upu_ack_ind) { + ogs_error("OpenAPI_upu_info_parseFromJSON() failed [upu_ack_ind]"); + goto end; + } + + + if (!cJSON_IsBool(upu_ack_ind)) { + ogs_error("OpenAPI_upu_info_parseFromJSON() failed [upu_ack_ind]"); + goto end; + } + + cJSON *upu_mac_iausf = cJSON_GetObjectItemCaseSensitive(upu_infoJSON, "upuMacIausf"); + + if (upu_mac_iausf) { + if (!cJSON_IsString(upu_mac_iausf)) { + ogs_error("OpenAPI_upu_info_parseFromJSON() failed [upu_mac_iausf]"); + goto end; + } + } + + cJSON *counter_upu = cJSON_GetObjectItemCaseSensitive(upu_infoJSON, "counterUpu"); + + if (counter_upu) { + if (!cJSON_IsString(counter_upu)) { + ogs_error("OpenAPI_upu_info_parseFromJSON() failed [counter_upu]"); + goto end; + } + } + + cJSON *provisioning_time = cJSON_GetObjectItemCaseSensitive(upu_infoJSON, "provisioningTime"); + if (!provisioning_time) { + ogs_error("OpenAPI_upu_info_parseFromJSON() failed [provisioning_time]"); + goto end; + } + + + if (!cJSON_IsString(provisioning_time)) { + ogs_error("OpenAPI_upu_info_parseFromJSON() failed [provisioning_time]"); + goto end; + } + + upu_info_local_var = OpenAPI_upu_info_create ( + upu_data_listList, + upu_reg_ind->valueint, + upu_ack_ind->valueint, + upu_mac_iausf ? ogs_strdup(upu_mac_iausf->valuestring) : NULL, + counter_upu ? ogs_strdup(counter_upu->valuestring) : NULL, + ogs_strdup(provisioning_time->valuestring) + ); + + return upu_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/upu_info.h b/lib/sbi/openapi/model/upu_info.h new file mode 100644 index 0000000000..e479bac3f2 --- /dev/null +++ b/lib/sbi/openapi/model/upu_info.h @@ -0,0 +1,48 @@ +/* + * upu_info.h + * + * + */ + +#ifndef _OpenAPI_upu_info_H_ +#define _OpenAPI_upu_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "upu_data_2.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_upu_info_s OpenAPI_upu_info_t; +typedef struct OpenAPI_upu_info_s { + OpenAPI_list_t *upu_data_list; + int upu_reg_ind; + int upu_ack_ind; + char *upu_mac_iausf; + char *counter_upu; + char *provisioning_time; +} OpenAPI_upu_info_t; + +OpenAPI_upu_info_t *OpenAPI_upu_info_create( + OpenAPI_list_t *upu_data_list, + int upu_reg_ind, + int upu_ack_ind, + char *upu_mac_iausf, + char *counter_upu, + char *provisioning_time + ); +void OpenAPI_upu_info_free(OpenAPI_upu_info_t *upu_info); +OpenAPI_upu_info_t *OpenAPI_upu_info_parseFromJSON(cJSON *upu_infoJSON); +cJSON *OpenAPI_upu_info_convertToJSON(OpenAPI_upu_info_t *upu_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_upu_info_H_ */ + diff --git a/lib/sbi/openapi/model/usage_mon_data.c b/lib/sbi/openapi/model/usage_mon_data.c new file mode 100644 index 0000000000..3dd87cc953 --- /dev/null +++ b/lib/sbi/openapi/model/usage_mon_data.c @@ -0,0 +1,201 @@ + +#include +#include +#include +#include "usage_mon_data.h" + +OpenAPI_usage_mon_data_t *OpenAPI_usage_mon_data_create( + char *limit_id, + OpenAPI_list_t* scopes, + OpenAPI_usage_mon_level_t *um_level, + OpenAPI_usage_threshold_t *allowed_usage, + OpenAPI_time_period_t *reset_time + ) +{ + OpenAPI_usage_mon_data_t *usage_mon_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_usage_mon_data_t)); + if (!usage_mon_data_local_var) { + return NULL; + } + usage_mon_data_local_var->limit_id = limit_id; + usage_mon_data_local_var->scopes = scopes; + usage_mon_data_local_var->um_level = um_level; + usage_mon_data_local_var->allowed_usage = allowed_usage; + usage_mon_data_local_var->reset_time = reset_time; + + return usage_mon_data_local_var; +} + +void OpenAPI_usage_mon_data_free(OpenAPI_usage_mon_data_t *usage_mon_data) +{ + if (NULL == usage_mon_data) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(usage_mon_data->limit_id); + OpenAPI_list_for_each(usage_mon_data->scopes, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_usage_mon_data_scope_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(usage_mon_data->scopes); + OpenAPI_usage_mon_level_free(usage_mon_data->um_level); + OpenAPI_usage_threshold_free(usage_mon_data->allowed_usage); + OpenAPI_time_period_free(usage_mon_data->reset_time); + ogs_free(usage_mon_data); +} + +cJSON *OpenAPI_usage_mon_data_convertToJSON(OpenAPI_usage_mon_data_t *usage_mon_data) +{ + cJSON *item = NULL; + + if (usage_mon_data == NULL) { + ogs_error("OpenAPI_usage_mon_data_convertToJSON() failed [UsageMonData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!usage_mon_data->limit_id) { + ogs_error("OpenAPI_usage_mon_data_convertToJSON() failed [limit_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "limitId", usage_mon_data->limit_id) == NULL) { + ogs_error("OpenAPI_usage_mon_data_convertToJSON() failed [limit_id]"); + goto end; + } + + if (usage_mon_data->scopes) { + cJSON *scopes = cJSON_AddObjectToObject(item, "scopes"); + if (scopes == NULL) { + ogs_error("OpenAPI_usage_mon_data_convertToJSON() failed [scopes]"); + goto end; + } + cJSON *localMapObject = scopes; + OpenAPI_lnode_t *scopes_node; + if (usage_mon_data->scopes) { + OpenAPI_list_for_each(usage_mon_data->scopes, scopes_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)scopes_node->data; + cJSON *itemLocal = OpenAPI_usage_mon_data_scope_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_usage_mon_data_convertToJSON() failed [scopes]"); + goto end; + } + cJSON_AddItemToObject(scopes, localKeyValue->key, itemLocal); + } + } + } + + if (usage_mon_data->um_level) { + cJSON *um_level_local_JSON = OpenAPI_usage_mon_level_convertToJSON(usage_mon_data->um_level); + if (um_level_local_JSON == NULL) { + ogs_error("OpenAPI_usage_mon_data_convertToJSON() failed [um_level]"); + goto end; + } + cJSON_AddItemToObject(item, "umLevel", um_level_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_usage_mon_data_convertToJSON() failed [um_level]"); + goto end; + } + } + + if (usage_mon_data->allowed_usage) { + cJSON *allowed_usage_local_JSON = OpenAPI_usage_threshold_convertToJSON(usage_mon_data->allowed_usage); + if (allowed_usage_local_JSON == NULL) { + ogs_error("OpenAPI_usage_mon_data_convertToJSON() failed [allowed_usage]"); + goto end; + } + cJSON_AddItemToObject(item, "allowedUsage", allowed_usage_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_usage_mon_data_convertToJSON() failed [allowed_usage]"); + goto end; + } + } + + if (usage_mon_data->reset_time) { + cJSON *reset_time_local_JSON = OpenAPI_time_period_convertToJSON(usage_mon_data->reset_time); + if (reset_time_local_JSON == NULL) { + ogs_error("OpenAPI_usage_mon_data_convertToJSON() failed [reset_time]"); + goto end; + } + cJSON_AddItemToObject(item, "resetTime", reset_time_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_usage_mon_data_convertToJSON() failed [reset_time]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_usage_mon_data_t *OpenAPI_usage_mon_data_parseFromJSON(cJSON *usage_mon_dataJSON) +{ + OpenAPI_usage_mon_data_t *usage_mon_data_local_var = NULL; + cJSON *limit_id = cJSON_GetObjectItemCaseSensitive(usage_mon_dataJSON, "limitId"); + if (!limit_id) { + ogs_error("OpenAPI_usage_mon_data_parseFromJSON() failed [limit_id]"); + goto end; + } + + + if (!cJSON_IsString(limit_id)) { + ogs_error("OpenAPI_usage_mon_data_parseFromJSON() failed [limit_id]"); + goto end; + } + + cJSON *scopes = cJSON_GetObjectItemCaseSensitive(usage_mon_dataJSON, "scopes"); + + OpenAPI_list_t *scopesList; + if (scopes) { + cJSON *scopes_local_map; + if (!cJSON_IsObject(scopes)) { + ogs_error("OpenAPI_usage_mon_data_parseFromJSON() failed [scopes]"); + goto end; + } + scopesList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(scopes_local_map, scopes) { + cJSON *localMapObject = scopes_local_map; + if (!cJSON_IsObject(scopes_local_map)) { + ogs_error("OpenAPI_usage_mon_data_parseFromJSON() failed [scopes]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_usage_mon_data_scope_parseFromJSON(localMapObject)); + OpenAPI_list_add(scopesList, localMapKeyPair); + } + } + + cJSON *um_level = cJSON_GetObjectItemCaseSensitive(usage_mon_dataJSON, "umLevel"); + + OpenAPI_usage_mon_level_t *um_level_local_nonprim = NULL; + if (um_level) { + um_level_local_nonprim = OpenAPI_usage_mon_level_parseFromJSON(um_level); + } + + cJSON *allowed_usage = cJSON_GetObjectItemCaseSensitive(usage_mon_dataJSON, "allowedUsage"); + + OpenAPI_usage_threshold_t *allowed_usage_local_nonprim = NULL; + if (allowed_usage) { + allowed_usage_local_nonprim = OpenAPI_usage_threshold_parseFromJSON(allowed_usage); + } + + cJSON *reset_time = cJSON_GetObjectItemCaseSensitive(usage_mon_dataJSON, "resetTime"); + + OpenAPI_time_period_t *reset_time_local_nonprim = NULL; + if (reset_time) { + reset_time_local_nonprim = OpenAPI_time_period_parseFromJSON(reset_time); + } + + usage_mon_data_local_var = OpenAPI_usage_mon_data_create ( + ogs_strdup(limit_id->valuestring), + scopes ? scopesList : NULL, + um_level ? um_level_local_nonprim : NULL, + allowed_usage ? allowed_usage_local_nonprim : NULL, + reset_time ? reset_time_local_nonprim : NULL + ); + + return usage_mon_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/usage_mon_data.h b/lib/sbi/openapi/model/usage_mon_data.h new file mode 100644 index 0000000000..cc7c3c4a5e --- /dev/null +++ b/lib/sbi/openapi/model/usage_mon_data.h @@ -0,0 +1,49 @@ +/* + * usage_mon_data.h + * + * Contains remain allowed usage data for a subscriber. + */ + +#ifndef _OpenAPI_usage_mon_data_H_ +#define _OpenAPI_usage_mon_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "time_period.h" +#include "usage_mon_data_scope.h" +#include "usage_mon_level.h" +#include "usage_threshold.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_usage_mon_data_s OpenAPI_usage_mon_data_t; +typedef struct OpenAPI_usage_mon_data_s { + char *limit_id; + OpenAPI_list_t* scopes; + struct OpenAPI_usage_mon_level_s *um_level; + struct OpenAPI_usage_threshold_s *allowed_usage; + struct OpenAPI_time_period_s *reset_time; +} OpenAPI_usage_mon_data_t; + +OpenAPI_usage_mon_data_t *OpenAPI_usage_mon_data_create( + char *limit_id, + OpenAPI_list_t* scopes, + OpenAPI_usage_mon_level_t *um_level, + OpenAPI_usage_threshold_t *allowed_usage, + OpenAPI_time_period_t *reset_time + ); +void OpenAPI_usage_mon_data_free(OpenAPI_usage_mon_data_t *usage_mon_data); +OpenAPI_usage_mon_data_t *OpenAPI_usage_mon_data_parseFromJSON(cJSON *usage_mon_dataJSON); +cJSON *OpenAPI_usage_mon_data_convertToJSON(OpenAPI_usage_mon_data_t *usage_mon_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_usage_mon_data_H_ */ + diff --git a/lib/sbi/openapi/model/usage_mon_data_limit.c b/lib/sbi/openapi/model/usage_mon_data_limit.c new file mode 100644 index 0000000000..ef215e2695 --- /dev/null +++ b/lib/sbi/openapi/model/usage_mon_data_limit.c @@ -0,0 +1,237 @@ + +#include +#include +#include +#include "usage_mon_data_limit.h" + +OpenAPI_usage_mon_data_limit_t *OpenAPI_usage_mon_data_limit_create( + char *limit_id, + OpenAPI_list_t* scopes, + OpenAPI_usage_mon_level_t *um_level, + char *start_date, + char *end_date, + OpenAPI_usage_threshold_t *usage_limit, + char *reset_period + ) +{ + OpenAPI_usage_mon_data_limit_t *usage_mon_data_limit_local_var = OpenAPI_malloc(sizeof(OpenAPI_usage_mon_data_limit_t)); + if (!usage_mon_data_limit_local_var) { + return NULL; + } + usage_mon_data_limit_local_var->limit_id = limit_id; + usage_mon_data_limit_local_var->scopes = scopes; + usage_mon_data_limit_local_var->um_level = um_level; + usage_mon_data_limit_local_var->start_date = start_date; + usage_mon_data_limit_local_var->end_date = end_date; + usage_mon_data_limit_local_var->usage_limit = usage_limit; + usage_mon_data_limit_local_var->reset_period = reset_period; + + return usage_mon_data_limit_local_var; +} + +void OpenAPI_usage_mon_data_limit_free(OpenAPI_usage_mon_data_limit_t *usage_mon_data_limit) +{ + if (NULL == usage_mon_data_limit) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(usage_mon_data_limit->limit_id); + OpenAPI_list_for_each(usage_mon_data_limit->scopes, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + OpenAPI_usage_mon_data_scope_free(localKeyValue->value); + ogs_free(localKeyValue); + } + OpenAPI_list_free(usage_mon_data_limit->scopes); + OpenAPI_usage_mon_level_free(usage_mon_data_limit->um_level); + ogs_free(usage_mon_data_limit->start_date); + ogs_free(usage_mon_data_limit->end_date); + OpenAPI_usage_threshold_free(usage_mon_data_limit->usage_limit); + ogs_free(usage_mon_data_limit->reset_period); + ogs_free(usage_mon_data_limit); +} + +cJSON *OpenAPI_usage_mon_data_limit_convertToJSON(OpenAPI_usage_mon_data_limit_t *usage_mon_data_limit) +{ + cJSON *item = NULL; + + if (usage_mon_data_limit == NULL) { + ogs_error("OpenAPI_usage_mon_data_limit_convertToJSON() failed [UsageMonDataLimit]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!usage_mon_data_limit->limit_id) { + ogs_error("OpenAPI_usage_mon_data_limit_convertToJSON() failed [limit_id]"); + goto end; + } + if (cJSON_AddStringToObject(item, "limitId", usage_mon_data_limit->limit_id) == NULL) { + ogs_error("OpenAPI_usage_mon_data_limit_convertToJSON() failed [limit_id]"); + goto end; + } + + if (usage_mon_data_limit->scopes) { + cJSON *scopes = cJSON_AddObjectToObject(item, "scopes"); + if (scopes == NULL) { + ogs_error("OpenAPI_usage_mon_data_limit_convertToJSON() failed [scopes]"); + goto end; + } + cJSON *localMapObject = scopes; + OpenAPI_lnode_t *scopes_node; + if (usage_mon_data_limit->scopes) { + OpenAPI_list_for_each(usage_mon_data_limit->scopes, scopes_node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)scopes_node->data; + cJSON *itemLocal = OpenAPI_usage_mon_data_scope_convertToJSON(localKeyValue->value); + if (itemLocal == NULL) { + ogs_error("OpenAPI_usage_mon_data_limit_convertToJSON() failed [scopes]"); + goto end; + } + cJSON_AddItemToObject(scopes, localKeyValue->key, itemLocal); + } + } + } + + if (usage_mon_data_limit->um_level) { + cJSON *um_level_local_JSON = OpenAPI_usage_mon_level_convertToJSON(usage_mon_data_limit->um_level); + if (um_level_local_JSON == NULL) { + ogs_error("OpenAPI_usage_mon_data_limit_convertToJSON() failed [um_level]"); + goto end; + } + cJSON_AddItemToObject(item, "umLevel", um_level_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_usage_mon_data_limit_convertToJSON() failed [um_level]"); + goto end; + } + } + + if (usage_mon_data_limit->start_date) { + if (cJSON_AddStringToObject(item, "startDate", usage_mon_data_limit->start_date) == NULL) { + ogs_error("OpenAPI_usage_mon_data_limit_convertToJSON() failed [start_date]"); + goto end; + } + } + + if (usage_mon_data_limit->end_date) { + if (cJSON_AddStringToObject(item, "endDate", usage_mon_data_limit->end_date) == NULL) { + ogs_error("OpenAPI_usage_mon_data_limit_convertToJSON() failed [end_date]"); + goto end; + } + } + + if (usage_mon_data_limit->usage_limit) { + cJSON *usage_limit_local_JSON = OpenAPI_usage_threshold_convertToJSON(usage_mon_data_limit->usage_limit); + if (usage_limit_local_JSON == NULL) { + ogs_error("OpenAPI_usage_mon_data_limit_convertToJSON() failed [usage_limit]"); + goto end; + } + cJSON_AddItemToObject(item, "usageLimit", usage_limit_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_usage_mon_data_limit_convertToJSON() failed [usage_limit]"); + goto end; + } + } + + if (usage_mon_data_limit->reset_period) { + if (cJSON_AddStringToObject(item, "resetPeriod", usage_mon_data_limit->reset_period) == NULL) { + ogs_error("OpenAPI_usage_mon_data_limit_convertToJSON() failed [reset_period]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_usage_mon_data_limit_t *OpenAPI_usage_mon_data_limit_parseFromJSON(cJSON *usage_mon_data_limitJSON) +{ + OpenAPI_usage_mon_data_limit_t *usage_mon_data_limit_local_var = NULL; + cJSON *limit_id = cJSON_GetObjectItemCaseSensitive(usage_mon_data_limitJSON, "limitId"); + if (!limit_id) { + ogs_error("OpenAPI_usage_mon_data_limit_parseFromJSON() failed [limit_id]"); + goto end; + } + + + if (!cJSON_IsString(limit_id)) { + ogs_error("OpenAPI_usage_mon_data_limit_parseFromJSON() failed [limit_id]"); + goto end; + } + + cJSON *scopes = cJSON_GetObjectItemCaseSensitive(usage_mon_data_limitJSON, "scopes"); + + OpenAPI_list_t *scopesList; + if (scopes) { + cJSON *scopes_local_map; + if (!cJSON_IsObject(scopes)) { + ogs_error("OpenAPI_usage_mon_data_limit_parseFromJSON() failed [scopes]"); + goto end; + } + scopesList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(scopes_local_map, scopes) { + cJSON *localMapObject = scopes_local_map; + if (!cJSON_IsObject(scopes_local_map)) { + ogs_error("OpenAPI_usage_mon_data_limit_parseFromJSON() failed [scopes]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create( + localMapObject->string, OpenAPI_usage_mon_data_scope_parseFromJSON(localMapObject)); + OpenAPI_list_add(scopesList, localMapKeyPair); + } + } + + cJSON *um_level = cJSON_GetObjectItemCaseSensitive(usage_mon_data_limitJSON, "umLevel"); + + OpenAPI_usage_mon_level_t *um_level_local_nonprim = NULL; + if (um_level) { + um_level_local_nonprim = OpenAPI_usage_mon_level_parseFromJSON(um_level); + } + + cJSON *start_date = cJSON_GetObjectItemCaseSensitive(usage_mon_data_limitJSON, "startDate"); + + if (start_date) { + if (!cJSON_IsString(start_date)) { + ogs_error("OpenAPI_usage_mon_data_limit_parseFromJSON() failed [start_date]"); + goto end; + } + } + + cJSON *end_date = cJSON_GetObjectItemCaseSensitive(usage_mon_data_limitJSON, "endDate"); + + if (end_date) { + if (!cJSON_IsString(end_date)) { + ogs_error("OpenAPI_usage_mon_data_limit_parseFromJSON() failed [end_date]"); + goto end; + } + } + + cJSON *usage_limit = cJSON_GetObjectItemCaseSensitive(usage_mon_data_limitJSON, "usageLimit"); + + OpenAPI_usage_threshold_t *usage_limit_local_nonprim = NULL; + if (usage_limit) { + usage_limit_local_nonprim = OpenAPI_usage_threshold_parseFromJSON(usage_limit); + } + + cJSON *reset_period = cJSON_GetObjectItemCaseSensitive(usage_mon_data_limitJSON, "resetPeriod"); + + if (reset_period) { + if (!cJSON_IsString(reset_period)) { + ogs_error("OpenAPI_usage_mon_data_limit_parseFromJSON() failed [reset_period]"); + goto end; + } + } + + usage_mon_data_limit_local_var = OpenAPI_usage_mon_data_limit_create ( + ogs_strdup(limit_id->valuestring), + scopes ? scopesList : NULL, + um_level ? um_level_local_nonprim : NULL, + start_date ? ogs_strdup(start_date->valuestring) : NULL, + end_date ? ogs_strdup(end_date->valuestring) : NULL, + usage_limit ? usage_limit_local_nonprim : NULL, + reset_period ? ogs_strdup(reset_period->valuestring) : NULL + ); + + return usage_mon_data_limit_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/usage_mon_data_limit.h b/lib/sbi/openapi/model/usage_mon_data_limit.h new file mode 100644 index 0000000000..eca1ebb9de --- /dev/null +++ b/lib/sbi/openapi/model/usage_mon_data_limit.h @@ -0,0 +1,52 @@ +/* + * usage_mon_data_limit.h + * + * Contains usage monitoring control data for a subscriber. + */ + +#ifndef _OpenAPI_usage_mon_data_limit_H_ +#define _OpenAPI_usage_mon_data_limit_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "usage_mon_data_scope.h" +#include "usage_mon_level.h" +#include "usage_threshold.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_usage_mon_data_limit_s OpenAPI_usage_mon_data_limit_t; +typedef struct OpenAPI_usage_mon_data_limit_s { + char *limit_id; + OpenAPI_list_t* scopes; + struct OpenAPI_usage_mon_level_s *um_level; + char *start_date; + char *end_date; + struct OpenAPI_usage_threshold_s *usage_limit; + char *reset_period; +} OpenAPI_usage_mon_data_limit_t; + +OpenAPI_usage_mon_data_limit_t *OpenAPI_usage_mon_data_limit_create( + char *limit_id, + OpenAPI_list_t* scopes, + OpenAPI_usage_mon_level_t *um_level, + char *start_date, + char *end_date, + OpenAPI_usage_threshold_t *usage_limit, + char *reset_period + ); +void OpenAPI_usage_mon_data_limit_free(OpenAPI_usage_mon_data_limit_t *usage_mon_data_limit); +OpenAPI_usage_mon_data_limit_t *OpenAPI_usage_mon_data_limit_parseFromJSON(cJSON *usage_mon_data_limitJSON); +cJSON *OpenAPI_usage_mon_data_limit_convertToJSON(OpenAPI_usage_mon_data_limit_t *usage_mon_data_limit); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_usage_mon_data_limit_H_ */ + diff --git a/lib/sbi/openapi/model/usage_mon_data_scope.c b/lib/sbi/openapi/model/usage_mon_data_scope.c new file mode 100644 index 0000000000..3d307d8a29 --- /dev/null +++ b/lib/sbi/openapi/model/usage_mon_data_scope.c @@ -0,0 +1,123 @@ + +#include +#include +#include +#include "usage_mon_data_scope.h" + +OpenAPI_usage_mon_data_scope_t *OpenAPI_usage_mon_data_scope_create( + OpenAPI_snssai_t *snssai, + OpenAPI_list_t *dnn + ) +{ + OpenAPI_usage_mon_data_scope_t *usage_mon_data_scope_local_var = OpenAPI_malloc(sizeof(OpenAPI_usage_mon_data_scope_t)); + if (!usage_mon_data_scope_local_var) { + return NULL; + } + usage_mon_data_scope_local_var->snssai = snssai; + usage_mon_data_scope_local_var->dnn = dnn; + + return usage_mon_data_scope_local_var; +} + +void OpenAPI_usage_mon_data_scope_free(OpenAPI_usage_mon_data_scope_t *usage_mon_data_scope) +{ + if (NULL == usage_mon_data_scope) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_snssai_free(usage_mon_data_scope->snssai); + OpenAPI_list_for_each(usage_mon_data_scope->dnn, node) { + ogs_free(node->data); + } + OpenAPI_list_free(usage_mon_data_scope->dnn); + ogs_free(usage_mon_data_scope); +} + +cJSON *OpenAPI_usage_mon_data_scope_convertToJSON(OpenAPI_usage_mon_data_scope_t *usage_mon_data_scope) +{ + cJSON *item = NULL; + + if (usage_mon_data_scope == NULL) { + ogs_error("OpenAPI_usage_mon_data_scope_convertToJSON() failed [UsageMonDataScope]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!usage_mon_data_scope->snssai) { + ogs_error("OpenAPI_usage_mon_data_scope_convertToJSON() failed [snssai]"); + goto end; + } + cJSON *snssai_local_JSON = OpenAPI_snssai_convertToJSON(usage_mon_data_scope->snssai); + if (snssai_local_JSON == NULL) { + ogs_error("OpenAPI_usage_mon_data_scope_convertToJSON() failed [snssai]"); + goto end; + } + cJSON_AddItemToObject(item, "snssai", snssai_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_usage_mon_data_scope_convertToJSON() failed [snssai]"); + goto end; + } + + if (usage_mon_data_scope->dnn) { + cJSON *dnn = cJSON_AddArrayToObject(item, "dnn"); + if (dnn == NULL) { + ogs_error("OpenAPI_usage_mon_data_scope_convertToJSON() failed [dnn]"); + goto end; + } + + OpenAPI_lnode_t *dnn_node; + OpenAPI_list_for_each(usage_mon_data_scope->dnn, dnn_node) { + if (cJSON_AddStringToObject(dnn, "", (char*)dnn_node->data) == NULL) { + ogs_error("OpenAPI_usage_mon_data_scope_convertToJSON() failed [dnn]"); + goto end; + } + } + } + +end: + return item; +} + +OpenAPI_usage_mon_data_scope_t *OpenAPI_usage_mon_data_scope_parseFromJSON(cJSON *usage_mon_data_scopeJSON) +{ + OpenAPI_usage_mon_data_scope_t *usage_mon_data_scope_local_var = NULL; + cJSON *snssai = cJSON_GetObjectItemCaseSensitive(usage_mon_data_scopeJSON, "snssai"); + if (!snssai) { + ogs_error("OpenAPI_usage_mon_data_scope_parseFromJSON() failed [snssai]"); + goto end; + } + + OpenAPI_snssai_t *snssai_local_nonprim = NULL; + + snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(snssai); + + cJSON *dnn = cJSON_GetObjectItemCaseSensitive(usage_mon_data_scopeJSON, "dnn"); + + OpenAPI_list_t *dnnList; + if (dnn) { + cJSON *dnn_local; + if (!cJSON_IsArray(dnn)) { + ogs_error("OpenAPI_usage_mon_data_scope_parseFromJSON() failed [dnn]"); + goto end; + } + dnnList = OpenAPI_list_create(); + + cJSON_ArrayForEach(dnn_local, dnn) { + if (!cJSON_IsString(dnn_local)) { + ogs_error("OpenAPI_usage_mon_data_scope_parseFromJSON() failed [dnn]"); + goto end; + } + OpenAPI_list_add(dnnList, ogs_strdup(dnn_local->valuestring)); + } + } + + usage_mon_data_scope_local_var = OpenAPI_usage_mon_data_scope_create ( + snssai_local_nonprim, + dnn ? dnnList : NULL + ); + + return usage_mon_data_scope_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/usage_mon_data_scope.h b/lib/sbi/openapi/model/usage_mon_data_scope.h new file mode 100644 index 0000000000..d8777c16f3 --- /dev/null +++ b/lib/sbi/openapi/model/usage_mon_data_scope.h @@ -0,0 +1,40 @@ +/* + * usage_mon_data_scope.h + * + * Contains a SNSSAI and DNN combinations to which the UsageMonData instance belongs to. + */ + +#ifndef _OpenAPI_usage_mon_data_scope_H_ +#define _OpenAPI_usage_mon_data_scope_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "snssai.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_usage_mon_data_scope_s OpenAPI_usage_mon_data_scope_t; +typedef struct OpenAPI_usage_mon_data_scope_s { + struct OpenAPI_snssai_s *snssai; + OpenAPI_list_t *dnn; +} OpenAPI_usage_mon_data_scope_t; + +OpenAPI_usage_mon_data_scope_t *OpenAPI_usage_mon_data_scope_create( + OpenAPI_snssai_t *snssai, + OpenAPI_list_t *dnn + ); +void OpenAPI_usage_mon_data_scope_free(OpenAPI_usage_mon_data_scope_t *usage_mon_data_scope); +OpenAPI_usage_mon_data_scope_t *OpenAPI_usage_mon_data_scope_parseFromJSON(cJSON *usage_mon_data_scopeJSON); +cJSON *OpenAPI_usage_mon_data_scope_convertToJSON(OpenAPI_usage_mon_data_scope_t *usage_mon_data_scope); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_usage_mon_data_scope_H_ */ + diff --git a/lib/sbi/openapi/model/usage_mon_level.c b/lib/sbi/openapi/model/usage_mon_level.c new file mode 100644 index 0000000000..c949f2dc36 --- /dev/null +++ b/lib/sbi/openapi/model/usage_mon_level.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "usage_mon_level.h" + +OpenAPI_usage_mon_level_t *OpenAPI_usage_mon_level_create( + ) +{ + OpenAPI_usage_mon_level_t *usage_mon_level_local_var = OpenAPI_malloc(sizeof(OpenAPI_usage_mon_level_t)); + if (!usage_mon_level_local_var) { + return NULL; + } + + return usage_mon_level_local_var; +} + +void OpenAPI_usage_mon_level_free(OpenAPI_usage_mon_level_t *usage_mon_level) +{ + if (NULL == usage_mon_level) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(usage_mon_level); +} + +cJSON *OpenAPI_usage_mon_level_convertToJSON(OpenAPI_usage_mon_level_t *usage_mon_level) +{ + cJSON *item = NULL; + + if (usage_mon_level == NULL) { + ogs_error("OpenAPI_usage_mon_level_convertToJSON() failed [UsageMonLevel]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_usage_mon_level_t *OpenAPI_usage_mon_level_parseFromJSON(cJSON *usage_mon_levelJSON) +{ + OpenAPI_usage_mon_level_t *usage_mon_level_local_var = NULL; + usage_mon_level_local_var = OpenAPI_usage_mon_level_create ( + ); + + return usage_mon_level_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/usage_mon_level.h b/lib/sbi/openapi/model/usage_mon_level.h new file mode 100644 index 0000000000..2f60384383 --- /dev/null +++ b/lib/sbi/openapi/model/usage_mon_level.h @@ -0,0 +1,35 @@ +/* + * usage_mon_level.h + * + * + */ + +#ifndef _OpenAPI_usage_mon_level_H_ +#define _OpenAPI_usage_mon_level_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_usage_mon_level_s OpenAPI_usage_mon_level_t; +typedef struct OpenAPI_usage_mon_level_s { +} OpenAPI_usage_mon_level_t; + +OpenAPI_usage_mon_level_t *OpenAPI_usage_mon_level_create( + ); +void OpenAPI_usage_mon_level_free(OpenAPI_usage_mon_level_t *usage_mon_level); +OpenAPI_usage_mon_level_t *OpenAPI_usage_mon_level_parseFromJSON(cJSON *usage_mon_levelJSON); +cJSON *OpenAPI_usage_mon_level_convertToJSON(OpenAPI_usage_mon_level_t *usage_mon_level); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_usage_mon_level_H_ */ + diff --git a/lib/sbi/openapi/model/usage_threshold.c b/lib/sbi/openapi/model/usage_threshold.c new file mode 100644 index 0000000000..acd5d2a682 --- /dev/null +++ b/lib/sbi/openapi/model/usage_threshold.c @@ -0,0 +1,127 @@ + +#include +#include +#include +#include "usage_threshold.h" + +OpenAPI_usage_threshold_t *OpenAPI_usage_threshold_create( + int duration, + long total_volume, + long downlink_volume, + long uplink_volume + ) +{ + OpenAPI_usage_threshold_t *usage_threshold_local_var = OpenAPI_malloc(sizeof(OpenAPI_usage_threshold_t)); + if (!usage_threshold_local_var) { + return NULL; + } + usage_threshold_local_var->duration = duration; + usage_threshold_local_var->total_volume = total_volume; + usage_threshold_local_var->downlink_volume = downlink_volume; + usage_threshold_local_var->uplink_volume = uplink_volume; + + return usage_threshold_local_var; +} + +void OpenAPI_usage_threshold_free(OpenAPI_usage_threshold_t *usage_threshold) +{ + if (NULL == usage_threshold) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(usage_threshold); +} + +cJSON *OpenAPI_usage_threshold_convertToJSON(OpenAPI_usage_threshold_t *usage_threshold) +{ + cJSON *item = NULL; + + if (usage_threshold == NULL) { + ogs_error("OpenAPI_usage_threshold_convertToJSON() failed [UsageThreshold]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (usage_threshold->duration) { + if (cJSON_AddNumberToObject(item, "duration", usage_threshold->duration) == NULL) { + ogs_error("OpenAPI_usage_threshold_convertToJSON() failed [duration]"); + goto end; + } + } + + if (usage_threshold->total_volume) { + if (cJSON_AddNumberToObject(item, "totalVolume", usage_threshold->total_volume) == NULL) { + ogs_error("OpenAPI_usage_threshold_convertToJSON() failed [total_volume]"); + goto end; + } + } + + if (usage_threshold->downlink_volume) { + if (cJSON_AddNumberToObject(item, "downlinkVolume", usage_threshold->downlink_volume) == NULL) { + ogs_error("OpenAPI_usage_threshold_convertToJSON() failed [downlink_volume]"); + goto end; + } + } + + if (usage_threshold->uplink_volume) { + if (cJSON_AddNumberToObject(item, "uplinkVolume", usage_threshold->uplink_volume) == NULL) { + ogs_error("OpenAPI_usage_threshold_convertToJSON() failed [uplink_volume]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_usage_threshold_t *OpenAPI_usage_threshold_parseFromJSON(cJSON *usage_thresholdJSON) +{ + OpenAPI_usage_threshold_t *usage_threshold_local_var = NULL; + cJSON *duration = cJSON_GetObjectItemCaseSensitive(usage_thresholdJSON, "duration"); + + if (duration) { + if (!cJSON_IsNumber(duration)) { + ogs_error("OpenAPI_usage_threshold_parseFromJSON() failed [duration]"); + goto end; + } + } + + cJSON *total_volume = cJSON_GetObjectItemCaseSensitive(usage_thresholdJSON, "totalVolume"); + + if (total_volume) { + if (!cJSON_IsNumber(total_volume)) { + ogs_error("OpenAPI_usage_threshold_parseFromJSON() failed [total_volume]"); + goto end; + } + } + + cJSON *downlink_volume = cJSON_GetObjectItemCaseSensitive(usage_thresholdJSON, "downlinkVolume"); + + if (downlink_volume) { + if (!cJSON_IsNumber(downlink_volume)) { + ogs_error("OpenAPI_usage_threshold_parseFromJSON() failed [downlink_volume]"); + goto end; + } + } + + cJSON *uplink_volume = cJSON_GetObjectItemCaseSensitive(usage_thresholdJSON, "uplinkVolume"); + + if (uplink_volume) { + if (!cJSON_IsNumber(uplink_volume)) { + ogs_error("OpenAPI_usage_threshold_parseFromJSON() failed [uplink_volume]"); + goto end; + } + } + + usage_threshold_local_var = OpenAPI_usage_threshold_create ( + duration ? duration->valuedouble : 0, + total_volume ? total_volume->valuedouble : 0, + downlink_volume ? downlink_volume->valuedouble : 0, + uplink_volume ? uplink_volume->valuedouble : 0 + ); + + return usage_threshold_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/usage_threshold.h b/lib/sbi/openapi/model/usage_threshold.h new file mode 100644 index 0000000000..e4b7dd237b --- /dev/null +++ b/lib/sbi/openapi/model/usage_threshold.h @@ -0,0 +1,43 @@ +/* + * usage_threshold.h + * + * + */ + +#ifndef _OpenAPI_usage_threshold_H_ +#define _OpenAPI_usage_threshold_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_usage_threshold_s OpenAPI_usage_threshold_t; +typedef struct OpenAPI_usage_threshold_s { + int duration; + long total_volume; + long downlink_volume; + long uplink_volume; +} OpenAPI_usage_threshold_t; + +OpenAPI_usage_threshold_t *OpenAPI_usage_threshold_create( + int duration, + long total_volume, + long downlink_volume, + long uplink_volume + ); +void OpenAPI_usage_threshold_free(OpenAPI_usage_threshold_t *usage_threshold); +OpenAPI_usage_threshold_t *OpenAPI_usage_threshold_parseFromJSON(cJSON *usage_thresholdJSON); +cJSON *OpenAPI_usage_threshold_convertToJSON(OpenAPI_usage_threshold_t *usage_threshold); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_usage_threshold_H_ */ + diff --git a/lib/sbi/openapi/model/user_identifier.c b/lib/sbi/openapi/model/user_identifier.c new file mode 100644 index 0000000000..8d96261a42 --- /dev/null +++ b/lib/sbi/openapi/model/user_identifier.c @@ -0,0 +1,116 @@ + +#include +#include +#include +#include "user_identifier.h" + +OpenAPI_user_identifier_t *OpenAPI_user_identifier_create( + char *supi, + char *gpsi, + char *validity_time + ) +{ + OpenAPI_user_identifier_t *user_identifier_local_var = OpenAPI_malloc(sizeof(OpenAPI_user_identifier_t)); + if (!user_identifier_local_var) { + return NULL; + } + user_identifier_local_var->supi = supi; + user_identifier_local_var->gpsi = gpsi; + user_identifier_local_var->validity_time = validity_time; + + return user_identifier_local_var; +} + +void OpenAPI_user_identifier_free(OpenAPI_user_identifier_t *user_identifier) +{ + if (NULL == user_identifier) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(user_identifier->supi); + ogs_free(user_identifier->gpsi); + ogs_free(user_identifier->validity_time); + ogs_free(user_identifier); +} + +cJSON *OpenAPI_user_identifier_convertToJSON(OpenAPI_user_identifier_t *user_identifier) +{ + cJSON *item = NULL; + + if (user_identifier == NULL) { + ogs_error("OpenAPI_user_identifier_convertToJSON() failed [UserIdentifier]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!user_identifier->supi) { + ogs_error("OpenAPI_user_identifier_convertToJSON() failed [supi]"); + goto end; + } + if (cJSON_AddStringToObject(item, "supi", user_identifier->supi) == NULL) { + ogs_error("OpenAPI_user_identifier_convertToJSON() failed [supi]"); + goto end; + } + + if (user_identifier->gpsi) { + if (cJSON_AddStringToObject(item, "gpsi", user_identifier->gpsi) == NULL) { + ogs_error("OpenAPI_user_identifier_convertToJSON() failed [gpsi]"); + goto end; + } + } + + if (user_identifier->validity_time) { + if (cJSON_AddStringToObject(item, "validityTime", user_identifier->validity_time) == NULL) { + ogs_error("OpenAPI_user_identifier_convertToJSON() failed [validity_time]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_user_identifier_t *OpenAPI_user_identifier_parseFromJSON(cJSON *user_identifierJSON) +{ + OpenAPI_user_identifier_t *user_identifier_local_var = NULL; + cJSON *supi = cJSON_GetObjectItemCaseSensitive(user_identifierJSON, "supi"); + if (!supi) { + ogs_error("OpenAPI_user_identifier_parseFromJSON() failed [supi]"); + goto end; + } + + + if (!cJSON_IsString(supi)) { + ogs_error("OpenAPI_user_identifier_parseFromJSON() failed [supi]"); + goto end; + } + + cJSON *gpsi = cJSON_GetObjectItemCaseSensitive(user_identifierJSON, "gpsi"); + + if (gpsi) { + if (!cJSON_IsString(gpsi)) { + ogs_error("OpenAPI_user_identifier_parseFromJSON() failed [gpsi]"); + goto end; + } + } + + cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(user_identifierJSON, "validityTime"); + + if (validity_time) { + if (!cJSON_IsString(validity_time)) { + ogs_error("OpenAPI_user_identifier_parseFromJSON() failed [validity_time]"); + goto end; + } + } + + user_identifier_local_var = OpenAPI_user_identifier_create ( + ogs_strdup(supi->valuestring), + gpsi ? ogs_strdup(gpsi->valuestring) : NULL, + validity_time ? ogs_strdup(validity_time->valuestring) : NULL + ); + + return user_identifier_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/user_identifier.h b/lib/sbi/openapi/model/user_identifier.h new file mode 100644 index 0000000000..655c7c6e6c --- /dev/null +++ b/lib/sbi/openapi/model/user_identifier.h @@ -0,0 +1,41 @@ +/* + * user_identifier.h + * + * + */ + +#ifndef _OpenAPI_user_identifier_H_ +#define _OpenAPI_user_identifier_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_user_identifier_s OpenAPI_user_identifier_t; +typedef struct OpenAPI_user_identifier_s { + char *supi; + char *gpsi; + char *validity_time; +} OpenAPI_user_identifier_t; + +OpenAPI_user_identifier_t *OpenAPI_user_identifier_create( + char *supi, + char *gpsi, + char *validity_time + ); +void OpenAPI_user_identifier_free(OpenAPI_user_identifier_t *user_identifier); +OpenAPI_user_identifier_t *OpenAPI_user_identifier_parseFromJSON(cJSON *user_identifierJSON); +cJSON *OpenAPI_user_identifier_convertToJSON(OpenAPI_user_identifier_t *user_identifier); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_user_identifier_H_ */ + diff --git a/lib/sbi/openapi/model/user_location.c b/lib/sbi/openapi/model/user_location.c new file mode 100644 index 0000000000..fa5358144f --- /dev/null +++ b/lib/sbi/openapi/model/user_location.c @@ -0,0 +1,123 @@ + +#include +#include +#include +#include "user_location.h" + +OpenAPI_user_location_t *OpenAPI_user_location_create( + OpenAPI_eutra_location_t *eutra_location, + OpenAPI_nr_location_t *nr_location, + OpenAPI_n3ga_location_t *n3ga_location + ) +{ + OpenAPI_user_location_t *user_location_local_var = OpenAPI_malloc(sizeof(OpenAPI_user_location_t)); + if (!user_location_local_var) { + return NULL; + } + user_location_local_var->eutra_location = eutra_location; + user_location_local_var->nr_location = nr_location; + user_location_local_var->n3ga_location = n3ga_location; + + return user_location_local_var; +} + +void OpenAPI_user_location_free(OpenAPI_user_location_t *user_location) +{ + if (NULL == user_location) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_eutra_location_free(user_location->eutra_location); + OpenAPI_nr_location_free(user_location->nr_location); + OpenAPI_n3ga_location_free(user_location->n3ga_location); + ogs_free(user_location); +} + +cJSON *OpenAPI_user_location_convertToJSON(OpenAPI_user_location_t *user_location) +{ + cJSON *item = NULL; + + if (user_location == NULL) { + ogs_error("OpenAPI_user_location_convertToJSON() failed [UserLocation]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (user_location->eutra_location) { + cJSON *eutra_location_local_JSON = OpenAPI_eutra_location_convertToJSON(user_location->eutra_location); + if (eutra_location_local_JSON == NULL) { + ogs_error("OpenAPI_user_location_convertToJSON() failed [eutra_location]"); + goto end; + } + cJSON_AddItemToObject(item, "eutraLocation", eutra_location_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_user_location_convertToJSON() failed [eutra_location]"); + goto end; + } + } + + if (user_location->nr_location) { + cJSON *nr_location_local_JSON = OpenAPI_nr_location_convertToJSON(user_location->nr_location); + if (nr_location_local_JSON == NULL) { + ogs_error("OpenAPI_user_location_convertToJSON() failed [nr_location]"); + goto end; + } + cJSON_AddItemToObject(item, "nrLocation", nr_location_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_user_location_convertToJSON() failed [nr_location]"); + goto end; + } + } + + if (user_location->n3ga_location) { + cJSON *n3ga_location_local_JSON = OpenAPI_n3ga_location_convertToJSON(user_location->n3ga_location); + if (n3ga_location_local_JSON == NULL) { + ogs_error("OpenAPI_user_location_convertToJSON() failed [n3ga_location]"); + goto end; + } + cJSON_AddItemToObject(item, "n3gaLocation", n3ga_location_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_user_location_convertToJSON() failed [n3ga_location]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_user_location_t *OpenAPI_user_location_parseFromJSON(cJSON *user_locationJSON) +{ + OpenAPI_user_location_t *user_location_local_var = NULL; + cJSON *eutra_location = cJSON_GetObjectItemCaseSensitive(user_locationJSON, "eutraLocation"); + + OpenAPI_eutra_location_t *eutra_location_local_nonprim = NULL; + if (eutra_location) { + eutra_location_local_nonprim = OpenAPI_eutra_location_parseFromJSON(eutra_location); + } + + cJSON *nr_location = cJSON_GetObjectItemCaseSensitive(user_locationJSON, "nrLocation"); + + OpenAPI_nr_location_t *nr_location_local_nonprim = NULL; + if (nr_location) { + nr_location_local_nonprim = OpenAPI_nr_location_parseFromJSON(nr_location); + } + + cJSON *n3ga_location = cJSON_GetObjectItemCaseSensitive(user_locationJSON, "n3gaLocation"); + + OpenAPI_n3ga_location_t *n3ga_location_local_nonprim = NULL; + if (n3ga_location) { + n3ga_location_local_nonprim = OpenAPI_n3ga_location_parseFromJSON(n3ga_location); + } + + user_location_local_var = OpenAPI_user_location_create ( + eutra_location ? eutra_location_local_nonprim : NULL, + nr_location ? nr_location_local_nonprim : NULL, + n3ga_location ? n3ga_location_local_nonprim : NULL + ); + + return user_location_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/user_location.h b/lib/sbi/openapi/model/user_location.h new file mode 100644 index 0000000000..d3c853429e --- /dev/null +++ b/lib/sbi/openapi/model/user_location.h @@ -0,0 +1,44 @@ +/* + * user_location.h + * + * + */ + +#ifndef _OpenAPI_user_location_H_ +#define _OpenAPI_user_location_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "eutra_location.h" +#include "n3ga_location.h" +#include "nr_location.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_user_location_s OpenAPI_user_location_t; +typedef struct OpenAPI_user_location_s { + struct OpenAPI_eutra_location_s *eutra_location; + struct OpenAPI_nr_location_s *nr_location; + struct OpenAPI_n3ga_location_s *n3ga_location; +} OpenAPI_user_location_t; + +OpenAPI_user_location_t *OpenAPI_user_location_create( + OpenAPI_eutra_location_t *eutra_location, + OpenAPI_nr_location_t *nr_location, + OpenAPI_n3ga_location_t *n3ga_location + ); +void OpenAPI_user_location_free(OpenAPI_user_location_t *user_location); +OpenAPI_user_location_t *OpenAPI_user_location_parseFromJSON(cJSON *user_locationJSON); +cJSON *OpenAPI_user_location_convertToJSON(OpenAPI_user_location_t *user_location); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_user_location_H_ */ + diff --git a/lib/sbi/openapi/model/v2x_rat_type.c b/lib/sbi/openapi/model/v2x_rat_type.c new file mode 100644 index 0000000000..96c3d55aec --- /dev/null +++ b/lib/sbi/openapi/model/v2x_rat_type.c @@ -0,0 +1,51 @@ + +#include +#include +#include +#include "v2x_rat_type.h" + +OpenAPI_v2x_rat_type_t *OpenAPI_v2x_rat_type_create( + ) +{ + OpenAPI_v2x_rat_type_t *v2x_rat_type_local_var = OpenAPI_malloc(sizeof(OpenAPI_v2x_rat_type_t)); + if (!v2x_rat_type_local_var) { + return NULL; + } + + return v2x_rat_type_local_var; +} + +void OpenAPI_v2x_rat_type_free(OpenAPI_v2x_rat_type_t *v2x_rat_type) +{ + if (NULL == v2x_rat_type) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(v2x_rat_type); +} + +cJSON *OpenAPI_v2x_rat_type_convertToJSON(OpenAPI_v2x_rat_type_t *v2x_rat_type) +{ + cJSON *item = NULL; + + if (v2x_rat_type == NULL) { + ogs_error("OpenAPI_v2x_rat_type_convertToJSON() failed [V2xRatType]"); + return NULL; + } + + item = cJSON_CreateObject(); +end: + return item; +} + +OpenAPI_v2x_rat_type_t *OpenAPI_v2x_rat_type_parseFromJSON(cJSON *v2x_rat_typeJSON) +{ + OpenAPI_v2x_rat_type_t *v2x_rat_type_local_var = NULL; + v2x_rat_type_local_var = OpenAPI_v2x_rat_type_create ( + ); + + return v2x_rat_type_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/v2x_rat_type.h b/lib/sbi/openapi/model/v2x_rat_type.h new file mode 100644 index 0000000000..29fda89c7b --- /dev/null +++ b/lib/sbi/openapi/model/v2x_rat_type.h @@ -0,0 +1,35 @@ +/* + * v2x_rat_type.h + * + * Possible values are - PC5_LTE: Indicates the LTE RAT type over PC5 interface. - PC5_NR: Indicates the NR RAT type over NR interface. + */ + +#ifndef _OpenAPI_v2x_rat_type_H_ +#define _OpenAPI_v2x_rat_type_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_v2x_rat_type_s OpenAPI_v2x_rat_type_t; +typedef struct OpenAPI_v2x_rat_type_s { +} OpenAPI_v2x_rat_type_t; + +OpenAPI_v2x_rat_type_t *OpenAPI_v2x_rat_type_create( + ); +void OpenAPI_v2x_rat_type_free(OpenAPI_v2x_rat_type_t *v2x_rat_type); +OpenAPI_v2x_rat_type_t *OpenAPI_v2x_rat_type_parseFromJSON(cJSON *v2x_rat_typeJSON); +cJSON *OpenAPI_v2x_rat_type_convertToJSON(OpenAPI_v2x_rat_type_t *v2x_rat_type); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_v2x_rat_type_H_ */ + diff --git a/lib/sbi/openapi/model/valid_time_period.c b/lib/sbi/openapi/model/valid_time_period.c new file mode 100644 index 0000000000..d9d1d028ee --- /dev/null +++ b/lib/sbi/openapi/model/valid_time_period.c @@ -0,0 +1,91 @@ + +#include +#include +#include +#include "valid_time_period.h" + +OpenAPI_valid_time_period_t *OpenAPI_valid_time_period_create( + char *start_time, + char *end_time + ) +{ + OpenAPI_valid_time_period_t *valid_time_period_local_var = OpenAPI_malloc(sizeof(OpenAPI_valid_time_period_t)); + if (!valid_time_period_local_var) { + return NULL; + } + valid_time_period_local_var->start_time = start_time; + valid_time_period_local_var->end_time = end_time; + + return valid_time_period_local_var; +} + +void OpenAPI_valid_time_period_free(OpenAPI_valid_time_period_t *valid_time_period) +{ + if (NULL == valid_time_period) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(valid_time_period->start_time); + ogs_free(valid_time_period->end_time); + ogs_free(valid_time_period); +} + +cJSON *OpenAPI_valid_time_period_convertToJSON(OpenAPI_valid_time_period_t *valid_time_period) +{ + cJSON *item = NULL; + + if (valid_time_period == NULL) { + ogs_error("OpenAPI_valid_time_period_convertToJSON() failed [ValidTimePeriod]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (valid_time_period->start_time) { + if (cJSON_AddStringToObject(item, "startTime", valid_time_period->start_time) == NULL) { + ogs_error("OpenAPI_valid_time_period_convertToJSON() failed [start_time]"); + goto end; + } + } + + if (valid_time_period->end_time) { + if (cJSON_AddStringToObject(item, "endTime", valid_time_period->end_time) == NULL) { + ogs_error("OpenAPI_valid_time_period_convertToJSON() failed [end_time]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_valid_time_period_t *OpenAPI_valid_time_period_parseFromJSON(cJSON *valid_time_periodJSON) +{ + OpenAPI_valid_time_period_t *valid_time_period_local_var = NULL; + cJSON *start_time = cJSON_GetObjectItemCaseSensitive(valid_time_periodJSON, "startTime"); + + if (start_time) { + if (!cJSON_IsString(start_time)) { + ogs_error("OpenAPI_valid_time_period_parseFromJSON() failed [start_time]"); + goto end; + } + } + + cJSON *end_time = cJSON_GetObjectItemCaseSensitive(valid_time_periodJSON, "endTime"); + + if (end_time) { + if (!cJSON_IsString(end_time)) { + ogs_error("OpenAPI_valid_time_period_parseFromJSON() failed [end_time]"); + goto end; + } + } + + valid_time_period_local_var = OpenAPI_valid_time_period_create ( + start_time ? ogs_strdup(start_time->valuestring) : NULL, + end_time ? ogs_strdup(end_time->valuestring) : NULL + ); + + return valid_time_period_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/valid_time_period.h b/lib/sbi/openapi/model/valid_time_period.h new file mode 100644 index 0000000000..937b159a47 --- /dev/null +++ b/lib/sbi/openapi/model/valid_time_period.h @@ -0,0 +1,39 @@ +/* + * valid_time_period.h + * + * + */ + +#ifndef _OpenAPI_valid_time_period_H_ +#define _OpenAPI_valid_time_period_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_valid_time_period_s OpenAPI_valid_time_period_t; +typedef struct OpenAPI_valid_time_period_s { + char *start_time; + char *end_time; +} OpenAPI_valid_time_period_t; + +OpenAPI_valid_time_period_t *OpenAPI_valid_time_period_create( + char *start_time, + char *end_time + ); +void OpenAPI_valid_time_period_free(OpenAPI_valid_time_period_t *valid_time_period); +OpenAPI_valid_time_period_t *OpenAPI_valid_time_period_parseFromJSON(cJSON *valid_time_periodJSON); +cJSON *OpenAPI_valid_time_period_convertToJSON(OpenAPI_valid_time_period_t *valid_time_period); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_valid_time_period_H_ */ + diff --git a/lib/sbi/openapi/model/vendor_specific_feature.c b/lib/sbi/openapi/model/vendor_specific_feature.c new file mode 100644 index 0000000000..ac8eaf0803 --- /dev/null +++ b/lib/sbi/openapi/model/vendor_specific_feature.c @@ -0,0 +1,101 @@ + +#include +#include +#include +#include "vendor_specific_feature.h" + +OpenAPI_vendor_specific_feature_t *OpenAPI_vendor_specific_feature_create( + char *feature_name, + char *feature_version + ) +{ + OpenAPI_vendor_specific_feature_t *vendor_specific_feature_local_var = OpenAPI_malloc(sizeof(OpenAPI_vendor_specific_feature_t)); + if (!vendor_specific_feature_local_var) { + return NULL; + } + vendor_specific_feature_local_var->feature_name = feature_name; + vendor_specific_feature_local_var->feature_version = feature_version; + + return vendor_specific_feature_local_var; +} + +void OpenAPI_vendor_specific_feature_free(OpenAPI_vendor_specific_feature_t *vendor_specific_feature) +{ + if (NULL == vendor_specific_feature) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(vendor_specific_feature->feature_name); + ogs_free(vendor_specific_feature->feature_version); + ogs_free(vendor_specific_feature); +} + +cJSON *OpenAPI_vendor_specific_feature_convertToJSON(OpenAPI_vendor_specific_feature_t *vendor_specific_feature) +{ + cJSON *item = NULL; + + if (vendor_specific_feature == NULL) { + ogs_error("OpenAPI_vendor_specific_feature_convertToJSON() failed [VendorSpecificFeature]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!vendor_specific_feature->feature_name) { + ogs_error("OpenAPI_vendor_specific_feature_convertToJSON() failed [feature_name]"); + goto end; + } + if (cJSON_AddStringToObject(item, "featureName", vendor_specific_feature->feature_name) == NULL) { + ogs_error("OpenAPI_vendor_specific_feature_convertToJSON() failed [feature_name]"); + goto end; + } + + if (!vendor_specific_feature->feature_version) { + ogs_error("OpenAPI_vendor_specific_feature_convertToJSON() failed [feature_version]"); + goto end; + } + if (cJSON_AddStringToObject(item, "featureVersion", vendor_specific_feature->feature_version) == NULL) { + ogs_error("OpenAPI_vendor_specific_feature_convertToJSON() failed [feature_version]"); + goto end; + } + +end: + return item; +} + +OpenAPI_vendor_specific_feature_t *OpenAPI_vendor_specific_feature_parseFromJSON(cJSON *vendor_specific_featureJSON) +{ + OpenAPI_vendor_specific_feature_t *vendor_specific_feature_local_var = NULL; + cJSON *feature_name = cJSON_GetObjectItemCaseSensitive(vendor_specific_featureJSON, "featureName"); + if (!feature_name) { + ogs_error("OpenAPI_vendor_specific_feature_parseFromJSON() failed [feature_name]"); + goto end; + } + + + if (!cJSON_IsString(feature_name)) { + ogs_error("OpenAPI_vendor_specific_feature_parseFromJSON() failed [feature_name]"); + goto end; + } + + cJSON *feature_version = cJSON_GetObjectItemCaseSensitive(vendor_specific_featureJSON, "featureVersion"); + if (!feature_version) { + ogs_error("OpenAPI_vendor_specific_feature_parseFromJSON() failed [feature_version]"); + goto end; + } + + + if (!cJSON_IsString(feature_version)) { + ogs_error("OpenAPI_vendor_specific_feature_parseFromJSON() failed [feature_version]"); + goto end; + } + + vendor_specific_feature_local_var = OpenAPI_vendor_specific_feature_create ( + ogs_strdup(feature_name->valuestring), + ogs_strdup(feature_version->valuestring) + ); + + return vendor_specific_feature_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/vendor_specific_feature.h b/lib/sbi/openapi/model/vendor_specific_feature.h new file mode 100644 index 0000000000..a3a89178d3 --- /dev/null +++ b/lib/sbi/openapi/model/vendor_specific_feature.h @@ -0,0 +1,39 @@ +/* + * vendor_specific_feature.h + * + * Information about a vendor-specific feature + */ + +#ifndef _OpenAPI_vendor_specific_feature_H_ +#define _OpenAPI_vendor_specific_feature_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_vendor_specific_feature_s OpenAPI_vendor_specific_feature_t; +typedef struct OpenAPI_vendor_specific_feature_s { + char *feature_name; + char *feature_version; +} OpenAPI_vendor_specific_feature_t; + +OpenAPI_vendor_specific_feature_t *OpenAPI_vendor_specific_feature_create( + char *feature_name, + char *feature_version + ); +void OpenAPI_vendor_specific_feature_free(OpenAPI_vendor_specific_feature_t *vendor_specific_feature); +OpenAPI_vendor_specific_feature_t *OpenAPI_vendor_specific_feature_parseFromJSON(cJSON *vendor_specific_featureJSON); +cJSON *OpenAPI_vendor_specific_feature_convertToJSON(OpenAPI_vendor_specific_feature_t *vendor_specific_feature); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_vendor_specific_feature_H_ */ + diff --git a/lib/sbi/openapi/model/vgmlc_address.c b/lib/sbi/openapi/model/vgmlc_address.c new file mode 100644 index 0000000000..3170da1568 --- /dev/null +++ b/lib/sbi/openapi/model/vgmlc_address.c @@ -0,0 +1,111 @@ + +#include +#include +#include +#include "vgmlc_address.h" + +OpenAPI_vgmlc_address_t *OpenAPI_vgmlc_address_create( + char *vgmlc_address_ipv4, + char *vgmlc_address_ipv6, + char *vgmlc_fqdn + ) +{ + OpenAPI_vgmlc_address_t *vgmlc_address_local_var = OpenAPI_malloc(sizeof(OpenAPI_vgmlc_address_t)); + if (!vgmlc_address_local_var) { + return NULL; + } + vgmlc_address_local_var->vgmlc_address_ipv4 = vgmlc_address_ipv4; + vgmlc_address_local_var->vgmlc_address_ipv6 = vgmlc_address_ipv6; + vgmlc_address_local_var->vgmlc_fqdn = vgmlc_fqdn; + + return vgmlc_address_local_var; +} + +void OpenAPI_vgmlc_address_free(OpenAPI_vgmlc_address_t *vgmlc_address) +{ + if (NULL == vgmlc_address) { + return; + } + OpenAPI_lnode_t *node; + ogs_free(vgmlc_address->vgmlc_address_ipv4); + ogs_free(vgmlc_address->vgmlc_address_ipv6); + ogs_free(vgmlc_address->vgmlc_fqdn); + ogs_free(vgmlc_address); +} + +cJSON *OpenAPI_vgmlc_address_convertToJSON(OpenAPI_vgmlc_address_t *vgmlc_address) +{ + cJSON *item = NULL; + + if (vgmlc_address == NULL) { + ogs_error("OpenAPI_vgmlc_address_convertToJSON() failed [VgmlcAddress]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (vgmlc_address->vgmlc_address_ipv4) { + if (cJSON_AddStringToObject(item, "vgmlcAddressIpv4", vgmlc_address->vgmlc_address_ipv4) == NULL) { + ogs_error("OpenAPI_vgmlc_address_convertToJSON() failed [vgmlc_address_ipv4]"); + goto end; + } + } + + if (vgmlc_address->vgmlc_address_ipv6) { + if (cJSON_AddStringToObject(item, "vgmlcAddressIpv6", vgmlc_address->vgmlc_address_ipv6) == NULL) { + ogs_error("OpenAPI_vgmlc_address_convertToJSON() failed [vgmlc_address_ipv6]"); + goto end; + } + } + + if (vgmlc_address->vgmlc_fqdn) { + if (cJSON_AddStringToObject(item, "vgmlcFqdn", vgmlc_address->vgmlc_fqdn) == NULL) { + ogs_error("OpenAPI_vgmlc_address_convertToJSON() failed [vgmlc_fqdn]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_vgmlc_address_t *OpenAPI_vgmlc_address_parseFromJSON(cJSON *vgmlc_addressJSON) +{ + OpenAPI_vgmlc_address_t *vgmlc_address_local_var = NULL; + cJSON *vgmlc_address_ipv4 = cJSON_GetObjectItemCaseSensitive(vgmlc_addressJSON, "vgmlcAddressIpv4"); + + if (vgmlc_address_ipv4) { + if (!cJSON_IsString(vgmlc_address_ipv4)) { + ogs_error("OpenAPI_vgmlc_address_parseFromJSON() failed [vgmlc_address_ipv4]"); + goto end; + } + } + + cJSON *vgmlc_address_ipv6 = cJSON_GetObjectItemCaseSensitive(vgmlc_addressJSON, "vgmlcAddressIpv6"); + + if (vgmlc_address_ipv6) { + if (!cJSON_IsString(vgmlc_address_ipv6)) { + ogs_error("OpenAPI_vgmlc_address_parseFromJSON() failed [vgmlc_address_ipv6]"); + goto end; + } + } + + cJSON *vgmlc_fqdn = cJSON_GetObjectItemCaseSensitive(vgmlc_addressJSON, "vgmlcFqdn"); + + if (vgmlc_fqdn) { + if (!cJSON_IsString(vgmlc_fqdn)) { + ogs_error("OpenAPI_vgmlc_address_parseFromJSON() failed [vgmlc_fqdn]"); + goto end; + } + } + + vgmlc_address_local_var = OpenAPI_vgmlc_address_create ( + 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 + ); + + return vgmlc_address_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/vgmlc_address.h b/lib/sbi/openapi/model/vgmlc_address.h new file mode 100644 index 0000000000..fef49a48ff --- /dev/null +++ b/lib/sbi/openapi/model/vgmlc_address.h @@ -0,0 +1,41 @@ +/* + * vgmlc_address.h + * + * + */ + +#ifndef _OpenAPI_vgmlc_address_H_ +#define _OpenAPI_vgmlc_address_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_vgmlc_address_s OpenAPI_vgmlc_address_t; +typedef struct OpenAPI_vgmlc_address_s { + char *vgmlc_address_ipv4; + char *vgmlc_address_ipv6; + char *vgmlc_fqdn; +} OpenAPI_vgmlc_address_t; + +OpenAPI_vgmlc_address_t *OpenAPI_vgmlc_address_create( + char *vgmlc_address_ipv4, + char *vgmlc_address_ipv6, + char *vgmlc_fqdn + ); +void OpenAPI_vgmlc_address_free(OpenAPI_vgmlc_address_t *vgmlc_address); +OpenAPI_vgmlc_address_t *OpenAPI_vgmlc_address_parseFromJSON(cJSON *vgmlc_addressJSON); +cJSON *OpenAPI_vgmlc_address_convertToJSON(OpenAPI_vgmlc_address_t *vgmlc_address); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_vgmlc_address_H_ */ + diff --git a/lib/sbi/openapi/model/vn_group_data.c b/lib/sbi/openapi/model/vn_group_data.c new file mode 100644 index 0000000000..b780f23dfc --- /dev/null +++ b/lib/sbi/openapi/model/vn_group_data.c @@ -0,0 +1,169 @@ + +#include +#include +#include +#include "vn_group_data.h" + +OpenAPI_vn_group_data_t *OpenAPI_vn_group_data_create( + OpenAPI_pdu_session_types_t *pdu_session_types, + char *dnn, + OpenAPI_snssai_t *single_nssai, + OpenAPI_list_t *app_descriptors + ) +{ + OpenAPI_vn_group_data_t *vn_group_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_vn_group_data_t)); + if (!vn_group_data_local_var) { + return NULL; + } + vn_group_data_local_var->pdu_session_types = pdu_session_types; + vn_group_data_local_var->dnn = dnn; + vn_group_data_local_var->single_nssai = single_nssai; + vn_group_data_local_var->app_descriptors = app_descriptors; + + return vn_group_data_local_var; +} + +void OpenAPI_vn_group_data_free(OpenAPI_vn_group_data_t *vn_group_data) +{ + if (NULL == vn_group_data) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_pdu_session_types_free(vn_group_data->pdu_session_types); + ogs_free(vn_group_data->dnn); + OpenAPI_snssai_free(vn_group_data->single_nssai); + OpenAPI_list_for_each(vn_group_data->app_descriptors, node) { + OpenAPI_app_descriptor_free(node->data); + } + OpenAPI_list_free(vn_group_data->app_descriptors); + ogs_free(vn_group_data); +} + +cJSON *OpenAPI_vn_group_data_convertToJSON(OpenAPI_vn_group_data_t *vn_group_data) +{ + cJSON *item = NULL; + + if (vn_group_data == NULL) { + ogs_error("OpenAPI_vn_group_data_convertToJSON() failed [VnGroupData]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (vn_group_data->pdu_session_types) { + cJSON *pdu_session_types_local_JSON = OpenAPI_pdu_session_types_convertToJSON(vn_group_data->pdu_session_types); + if (pdu_session_types_local_JSON == NULL) { + ogs_error("OpenAPI_vn_group_data_convertToJSON() failed [pdu_session_types]"); + goto end; + } + cJSON_AddItemToObject(item, "pduSessionTypes", pdu_session_types_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_vn_group_data_convertToJSON() failed [pdu_session_types]"); + goto end; + } + } + + if (vn_group_data->dnn) { + if (cJSON_AddStringToObject(item, "dnn", vn_group_data->dnn) == NULL) { + ogs_error("OpenAPI_vn_group_data_convertToJSON() failed [dnn]"); + goto end; + } + } + + if (vn_group_data->single_nssai) { + cJSON *single_nssai_local_JSON = OpenAPI_snssai_convertToJSON(vn_group_data->single_nssai); + if (single_nssai_local_JSON == NULL) { + ogs_error("OpenAPI_vn_group_data_convertToJSON() failed [single_nssai]"); + goto end; + } + cJSON_AddItemToObject(item, "singleNssai", single_nssai_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_vn_group_data_convertToJSON() failed [single_nssai]"); + goto end; + } + } + + if (vn_group_data->app_descriptors) { + cJSON *app_descriptorsList = cJSON_AddArrayToObject(item, "appDescriptors"); + if (app_descriptorsList == NULL) { + ogs_error("OpenAPI_vn_group_data_convertToJSON() failed [app_descriptors]"); + goto end; + } + + OpenAPI_lnode_t *app_descriptors_node; + if (vn_group_data->app_descriptors) { + OpenAPI_list_for_each(vn_group_data->app_descriptors, app_descriptors_node) { + cJSON *itemLocal = OpenAPI_app_descriptor_convertToJSON(app_descriptors_node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_vn_group_data_convertToJSON() failed [app_descriptors]"); + goto end; + } + cJSON_AddItemToArray(app_descriptorsList, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_vn_group_data_t *OpenAPI_vn_group_data_parseFromJSON(cJSON *vn_group_dataJSON) +{ + OpenAPI_vn_group_data_t *vn_group_data_local_var = NULL; + cJSON *pdu_session_types = cJSON_GetObjectItemCaseSensitive(vn_group_dataJSON, "pduSessionTypes"); + + OpenAPI_pdu_session_types_t *pdu_session_types_local_nonprim = NULL; + if (pdu_session_types) { + pdu_session_types_local_nonprim = OpenAPI_pdu_session_types_parseFromJSON(pdu_session_types); + } + + cJSON *dnn = cJSON_GetObjectItemCaseSensitive(vn_group_dataJSON, "dnn"); + + if (dnn) { + if (!cJSON_IsString(dnn)) { + ogs_error("OpenAPI_vn_group_data_parseFromJSON() failed [dnn]"); + goto end; + } + } + + cJSON *single_nssai = cJSON_GetObjectItemCaseSensitive(vn_group_dataJSON, "singleNssai"); + + OpenAPI_snssai_t *single_nssai_local_nonprim = NULL; + if (single_nssai) { + single_nssai_local_nonprim = OpenAPI_snssai_parseFromJSON(single_nssai); + } + + cJSON *app_descriptors = cJSON_GetObjectItemCaseSensitive(vn_group_dataJSON, "appDescriptors"); + + OpenAPI_list_t *app_descriptorsList; + if (app_descriptors) { + cJSON *app_descriptors_local_nonprimitive; + if (!cJSON_IsArray(app_descriptors)) { + ogs_error("OpenAPI_vn_group_data_parseFromJSON() failed [app_descriptors]"); + goto end; + } + + app_descriptorsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(app_descriptors_local_nonprimitive, app_descriptors ) { + if (!cJSON_IsObject(app_descriptors_local_nonprimitive)) { + ogs_error("OpenAPI_vn_group_data_parseFromJSON() failed [app_descriptors]"); + goto end; + } + OpenAPI_app_descriptor_t *app_descriptorsItem = OpenAPI_app_descriptor_parseFromJSON(app_descriptors_local_nonprimitive); + + OpenAPI_list_add(app_descriptorsList, app_descriptorsItem); + } + } + + vn_group_data_local_var = OpenAPI_vn_group_data_create ( + pdu_session_types ? pdu_session_types_local_nonprim : NULL, + dnn ? ogs_strdup(dnn->valuestring) : NULL, + single_nssai ? single_nssai_local_nonprim : NULL, + app_descriptors ? app_descriptorsList : NULL + ); + + return vn_group_data_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/vn_group_data.h b/lib/sbi/openapi/model/vn_group_data.h new file mode 100644 index 0000000000..871a096ed8 --- /dev/null +++ b/lib/sbi/openapi/model/vn_group_data.h @@ -0,0 +1,46 @@ +/* + * vn_group_data.h + * + * + */ + +#ifndef _OpenAPI_vn_group_data_H_ +#define _OpenAPI_vn_group_data_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "app_descriptor.h" +#include "pdu_session_types.h" +#include "snssai.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_vn_group_data_s OpenAPI_vn_group_data_t; +typedef struct OpenAPI_vn_group_data_s { + struct OpenAPI_pdu_session_types_s *pdu_session_types; + char *dnn; + struct OpenAPI_snssai_s *single_nssai; + OpenAPI_list_t *app_descriptors; +} OpenAPI_vn_group_data_t; + +OpenAPI_vn_group_data_t *OpenAPI_vn_group_data_create( + OpenAPI_pdu_session_types_t *pdu_session_types, + char *dnn, + OpenAPI_snssai_t *single_nssai, + OpenAPI_list_t *app_descriptors + ); +void OpenAPI_vn_group_data_free(OpenAPI_vn_group_data_t *vn_group_data); +OpenAPI_vn_group_data_t *OpenAPI_vn_group_data_parseFromJSON(cJSON *vn_group_dataJSON); +cJSON *OpenAPI_vn_group_data_convertToJSON(OpenAPI_vn_group_data_t *vn_group_data); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_vn_group_data_H_ */ + diff --git a/lib/sbi/openapi/model/w_agf_info.c b/lib/sbi/openapi/model/w_agf_info.c new file mode 100644 index 0000000000..a0a83f2ebe --- /dev/null +++ b/lib/sbi/openapi/model/w_agf_info.c @@ -0,0 +1,157 @@ + +#include +#include +#include +#include "w_agf_info.h" + +OpenAPI_w_agf_info_t *OpenAPI_w_agf_info_create( + OpenAPI_list_t *ipv4_endpoint_addresses, + OpenAPI_list_t *ipv6_endpoint_addresses, + char *endpoint_fqdn + ) +{ + OpenAPI_w_agf_info_t *w_agf_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_w_agf_info_t)); + if (!w_agf_info_local_var) { + return NULL; + } + w_agf_info_local_var->ipv4_endpoint_addresses = ipv4_endpoint_addresses; + w_agf_info_local_var->ipv6_endpoint_addresses = ipv6_endpoint_addresses; + w_agf_info_local_var->endpoint_fqdn = endpoint_fqdn; + + return w_agf_info_local_var; +} + +void OpenAPI_w_agf_info_free(OpenAPI_w_agf_info_t *w_agf_info) +{ + if (NULL == w_agf_info) { + return; + } + OpenAPI_lnode_t *node; + OpenAPI_list_for_each(w_agf_info->ipv4_endpoint_addresses, node) { + ogs_free(node->data); + } + OpenAPI_list_free(w_agf_info->ipv4_endpoint_addresses); + OpenAPI_list_for_each(w_agf_info->ipv6_endpoint_addresses, node) { + ogs_free(node->data); + } + OpenAPI_list_free(w_agf_info->ipv6_endpoint_addresses); + ogs_free(w_agf_info->endpoint_fqdn); + ogs_free(w_agf_info); +} + +cJSON *OpenAPI_w_agf_info_convertToJSON(OpenAPI_w_agf_info_t *w_agf_info) +{ + cJSON *item = NULL; + + if (w_agf_info == NULL) { + ogs_error("OpenAPI_w_agf_info_convertToJSON() failed [WAgfInfo]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (w_agf_info->ipv4_endpoint_addresses) { + cJSON *ipv4_endpoint_addresses = cJSON_AddArrayToObject(item, "ipv4EndpointAddresses"); + if (ipv4_endpoint_addresses == NULL) { + ogs_error("OpenAPI_w_agf_info_convertToJSON() failed [ipv4_endpoint_addresses]"); + goto end; + } + + OpenAPI_lnode_t *ipv4_endpoint_addresses_node; + OpenAPI_list_for_each(w_agf_info->ipv4_endpoint_addresses, ipv4_endpoint_addresses_node) { + if (cJSON_AddStringToObject(ipv4_endpoint_addresses, "", (char*)ipv4_endpoint_addresses_node->data) == NULL) { + ogs_error("OpenAPI_w_agf_info_convertToJSON() failed [ipv4_endpoint_addresses]"); + goto end; + } + } + } + + if (w_agf_info->ipv6_endpoint_addresses) { + cJSON *ipv6_endpoint_addresses = cJSON_AddArrayToObject(item, "ipv6EndpointAddresses"); + if (ipv6_endpoint_addresses == NULL) { + ogs_error("OpenAPI_w_agf_info_convertToJSON() failed [ipv6_endpoint_addresses]"); + goto end; + } + + OpenAPI_lnode_t *ipv6_endpoint_addresses_node; + OpenAPI_list_for_each(w_agf_info->ipv6_endpoint_addresses, ipv6_endpoint_addresses_node) { + if (cJSON_AddStringToObject(ipv6_endpoint_addresses, "", (char*)ipv6_endpoint_addresses_node->data) == NULL) { + ogs_error("OpenAPI_w_agf_info_convertToJSON() failed [ipv6_endpoint_addresses]"); + goto end; + } + } + } + + if (w_agf_info->endpoint_fqdn) { + if (cJSON_AddStringToObject(item, "endpointFqdn", w_agf_info->endpoint_fqdn) == NULL) { + ogs_error("OpenAPI_w_agf_info_convertToJSON() failed [endpoint_fqdn]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_w_agf_info_t *OpenAPI_w_agf_info_parseFromJSON(cJSON *w_agf_infoJSON) +{ + OpenAPI_w_agf_info_t *w_agf_info_local_var = NULL; + cJSON *ipv4_endpoint_addresses = cJSON_GetObjectItemCaseSensitive(w_agf_infoJSON, "ipv4EndpointAddresses"); + + OpenAPI_list_t *ipv4_endpoint_addressesList; + if (ipv4_endpoint_addresses) { + cJSON *ipv4_endpoint_addresses_local; + if (!cJSON_IsArray(ipv4_endpoint_addresses)) { + ogs_error("OpenAPI_w_agf_info_parseFromJSON() failed [ipv4_endpoint_addresses]"); + goto end; + } + ipv4_endpoint_addressesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv4_endpoint_addresses_local, ipv4_endpoint_addresses) { + if (!cJSON_IsString(ipv4_endpoint_addresses_local)) { + ogs_error("OpenAPI_w_agf_info_parseFromJSON() failed [ipv4_endpoint_addresses]"); + goto end; + } + OpenAPI_list_add(ipv4_endpoint_addressesList, ogs_strdup(ipv4_endpoint_addresses_local->valuestring)); + } + } + + cJSON *ipv6_endpoint_addresses = cJSON_GetObjectItemCaseSensitive(w_agf_infoJSON, "ipv6EndpointAddresses"); + + OpenAPI_list_t *ipv6_endpoint_addressesList; + if (ipv6_endpoint_addresses) { + cJSON *ipv6_endpoint_addresses_local; + if (!cJSON_IsArray(ipv6_endpoint_addresses)) { + ogs_error("OpenAPI_w_agf_info_parseFromJSON() failed [ipv6_endpoint_addresses]"); + goto end; + } + ipv6_endpoint_addressesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv6_endpoint_addresses_local, ipv6_endpoint_addresses) { + if (!cJSON_IsString(ipv6_endpoint_addresses_local)) { + ogs_error("OpenAPI_w_agf_info_parseFromJSON() failed [ipv6_endpoint_addresses]"); + goto end; + } + OpenAPI_list_add(ipv6_endpoint_addressesList, ogs_strdup(ipv6_endpoint_addresses_local->valuestring)); + } + } + + cJSON *endpoint_fqdn = cJSON_GetObjectItemCaseSensitive(w_agf_infoJSON, "endpointFqdn"); + + if (endpoint_fqdn) { + if (!cJSON_IsString(endpoint_fqdn)) { + ogs_error("OpenAPI_w_agf_info_parseFromJSON() failed [endpoint_fqdn]"); + goto end; + } + } + + w_agf_info_local_var = OpenAPI_w_agf_info_create ( + ipv4_endpoint_addresses ? ipv4_endpoint_addressesList : NULL, + ipv6_endpoint_addresses ? ipv6_endpoint_addressesList : NULL, + endpoint_fqdn ? ogs_strdup(endpoint_fqdn->valuestring) : NULL + ); + + return w_agf_info_local_var; +end: + return NULL; +} + diff --git a/lib/sbi/openapi/model/w_agf_info.h b/lib/sbi/openapi/model/w_agf_info.h new file mode 100644 index 0000000000..6de436d01c --- /dev/null +++ b/lib/sbi/openapi/model/w_agf_info.h @@ -0,0 +1,41 @@ +/* + * w_agf_info.h + * + * Information of the W-AGF end-points + */ + +#ifndef _OpenAPI_w_agf_info_H_ +#define _OpenAPI_w_agf_info_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_w_agf_info_s OpenAPI_w_agf_info_t; +typedef struct OpenAPI_w_agf_info_s { + OpenAPI_list_t *ipv4_endpoint_addresses; + OpenAPI_list_t *ipv6_endpoint_addresses; + char *endpoint_fqdn; +} OpenAPI_w_agf_info_t; + +OpenAPI_w_agf_info_t *OpenAPI_w_agf_info_create( + OpenAPI_list_t *ipv4_endpoint_addresses, + OpenAPI_list_t *ipv6_endpoint_addresses, + char *endpoint_fqdn + ); +void OpenAPI_w_agf_info_free(OpenAPI_w_agf_info_t *w_agf_info); +OpenAPI_w_agf_info_t *OpenAPI_w_agf_info_parseFromJSON(cJSON *w_agf_infoJSON); +cJSON *OpenAPI_w_agf_info_convertToJSON(OpenAPI_w_agf_info_t *w_agf_info); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_w_agf_info_H_ */ + diff --git a/lib/sbi/path.c b/lib/sbi/path.c new file mode 100644 index 0000000000..d7b65659d5 --- /dev/null +++ b/lib/sbi/path.c @@ -0,0 +1,114 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "ogs-sbi.h" + +void ogs_nnrf_nfm_send_nf_register(ogs_sbi_nf_instance_t *nf_instance) +{ + ogs_sbi_request_t *request = NULL; + ogs_sbi_client_t *client = NULL; + + ogs_assert(nf_instance); + client = nf_instance->client; + ogs_assert(client); + + request = ogs_nnrf_nfm_build_register(nf_instance); + ogs_assert(request); + ogs_sbi_client_send_request(client, request, nf_instance); +} + +void ogs_nnrf_nfm_send_nf_update(ogs_sbi_nf_instance_t *nf_instance) +{ + ogs_sbi_request_t *request = NULL; + ogs_sbi_client_t *client = NULL; + + ogs_assert(nf_instance); + client = nf_instance->client; + ogs_assert(client); + + request = ogs_nnrf_nfm_build_update(nf_instance); + ogs_assert(request); + ogs_sbi_client_send_request(client, request, nf_instance); +} + +void ogs_nnrf_nfm_send_nf_de_register(ogs_sbi_nf_instance_t *nf_instance) +{ + ogs_sbi_request_t *request = NULL; + ogs_sbi_client_t *client = NULL; + + ogs_assert(nf_instance); + client = nf_instance->client; + ogs_assert(client); + + request = ogs_nnrf_nfm_build_de_register(nf_instance); + ogs_assert(request); + ogs_sbi_client_send_request(client, request, nf_instance); +} + +void ogs_nnrf_nfm_send_nf_status_subscribe(ogs_sbi_client_t *client, + OpenAPI_nf_type_e nf_type, char *nf_instance_id) +{ + ogs_sbi_request_t *request = NULL; + ogs_sbi_subscription_t *subscription = NULL; + + ogs_assert(client); + + subscription = ogs_sbi_subscription_add(); + ogs_assert(subscription); + + OGS_SETUP_SBI_CLIENT(subscription, client); + subscription->nf_type = nf_type; + if (nf_instance_id) + subscription->nf_instance_id = ogs_strdup(nf_instance_id); + + request = ogs_nnrf_nfm_build_status_subscribe(subscription); + ogs_assert(request); + ogs_sbi_client_send_request(client, request, subscription); +} + +void ogs_nnrf_nfm_send_nf_status_unsubscribe( + ogs_sbi_subscription_t *subscription) +{ + ogs_sbi_request_t *request = NULL; + ogs_sbi_client_t *client = NULL; + + ogs_assert(subscription); + client = subscription->client; + ogs_assert(client); + + request = ogs_nnrf_nfm_build_status_unsubscribe(subscription); + ogs_assert(request); + ogs_sbi_client_send_request(client, request, subscription); +} + +void ogs_nnrf_disc_send_nf_discover(ogs_sbi_nf_instance_t *nf_instance, + OpenAPI_nf_type_e target_nf_type, OpenAPI_nf_type_e requester_nf_type, + void *data) +{ + ogs_sbi_client_t *client = NULL; + ogs_sbi_request_t *request = NULL; + + ogs_assert(nf_instance); + client = nf_instance->client; + ogs_assert(client); + + request = ogs_nnrf_disc_build_discover(target_nf_type, requester_nf_type); + ogs_assert(request); + ogs_sbi_client_send_request(client, request, data); +} diff --git a/src/amf/nnrf-build.h b/lib/sbi/path.h similarity index 60% rename from src/amf/nnrf-build.h rename to lib/sbi/path.h index b0eca24418..c849116d01 100644 --- a/src/amf/nnrf-build.h +++ b/lib/sbi/path.h @@ -17,33 +17,30 @@ * along with this program. If not, see . */ -#ifndef AMF_NNRF_BUILD_H -#define AMF_NNRF_BUILD_H +#ifndef OGS_SBI_PATH_H +#define OGS_SBI_PATH_H -#include "ogs-sbi.h" -#include "context.h" +#include "nnrf-build.h" #ifdef __cplusplus extern "C" { #endif -ogs_sbi_request_t *amf_nnrf_build_nf_register( - ogs_sbi_nf_instance_t *nf_instance); -ogs_sbi_request_t *amf_nnrf_build_nf_update( - ogs_sbi_nf_instance_t *nf_instance); -ogs_sbi_request_t *amf_nnrf_build_nf_de_register( - ogs_sbi_nf_instance_t *nf_instance); +void ogs_nnrf_nfm_send_nf_register(ogs_sbi_nf_instance_t *nf_instance); +void ogs_nnrf_nfm_send_nf_update(ogs_sbi_nf_instance_t *nf_instance); +void ogs_nnrf_nfm_send_nf_de_register(ogs_sbi_nf_instance_t *nf_instance); -ogs_sbi_request_t *amf_nnrf_build_nf_status_subscribe( - ogs_sbi_subscription_t *subscription); -ogs_sbi_request_t *amf_nnrf_build_nf_status_unsubscribe( +void ogs_nnrf_nfm_send_nf_status_subscribe(ogs_sbi_client_t *client, + OpenAPI_nf_type_e nf_type, char *nf_instance_id); +void ogs_nnrf_nfm_send_nf_status_unsubscribe( ogs_sbi_subscription_t *subscription); -ogs_sbi_request_t *amf_nnrf_build_nf_discover( - OpenAPI_nf_type_e target_nf_type, OpenAPI_nf_type_e requester_nf_type); +void ogs_nnrf_disc_send_nf_discover(ogs_sbi_nf_instance_t *nf_instance, + OpenAPI_nf_type_e target_nf_type, OpenAPI_nf_type_e requester_nf_type, + void *data); #ifdef __cplusplus } #endif -#endif /* AMF_NNRF_BUILD_H */ +#endif /* OGS_SBI_PATH_H */ diff --git a/lib/sbi/server.c b/lib/sbi/server.c index 33c005b60e..ddb1d90277 100644 --- a/lib/sbi/server.c +++ b/lib/sbi/server.c @@ -45,6 +45,8 @@ typedef struct ogs_sbi_session_s { * terminates the program. */ ogs_timer_t *timer; + + void *data; } ogs_sbi_session_t; static OGS_POOL(server_pool, ogs_sbi_server_t); @@ -75,7 +77,7 @@ static void session_timer_expired(void *data); void ogs_sbi_server_init(int num_of_session_pool) { ogs_list_init(&ogs_sbi_self()->server_list); - ogs_pool_init(&server_pool, ogs_config()->pool.sbi); + ogs_pool_init(&server_pool, ogs_config()->max.nf); ogs_pool_init(&session_pool, num_of_session_pool); } @@ -108,9 +110,9 @@ static ogs_sbi_session_t *session_add(ogs_sbi_server_t *server, ogs_sbi_self()->timer_mgr, session_timer_expired, session); ogs_assert(session->timer); - /* If User does not send http response within 1 second, + /* If User does not send http response within 5 second, * we will assert this program. */ - ogs_timer_start(session->timer, ogs_time_from_sec(1)); + ogs_timer_start(session->timer, ogs_time_from_sec(5)); ogs_list_add(&server->suspended_session_list, session); @@ -327,8 +329,8 @@ void ogs_sbi_server_stop_all(void) ogs_sbi_server_stop(server); } -void ogs_sbi_server_send_response(ogs_sbi_session_t *session, - ogs_sbi_response_t *response, uint32_t status) +void ogs_sbi_server_send_response( + ogs_sbi_session_t *session, ogs_sbi_response_t *response) { int ret; @@ -342,7 +344,6 @@ void ogs_sbi_server_send_response(ogs_sbi_session_t *session, ogs_sbi_request_t *request = NULL; ogs_assert(response); - ogs_assert(status); ogs_assert(session); connection = session->connection; @@ -387,7 +388,7 @@ void ogs_sbi_server_send_response(ogs_sbi_session_t *session, OGS_POLLOUT, mhd_socket, run, mhd_daemon); ogs_assert(request->poll); - ret = MHD_queue_response(connection, status, mhd_response); + ret = MHD_queue_response(connection, response->status, mhd_response); ogs_assert(ret == MHD_YES); MHD_destroy_response(mhd_response); } @@ -406,10 +407,10 @@ void ogs_sbi_server_send_problem( message.http.content_type = (char*)"application/problem+json"; message.ProblemDetails = problem; - response = ogs_sbi_build_response(&message); + response = ogs_sbi_build_response(&message, problem->status); ogs_assert(response); - ogs_sbi_server_send_response(session, response, problem->status); + ogs_sbi_server_send_response(session, response); } void ogs_sbi_server_send_error(ogs_sbi_session_t *session, @@ -425,11 +426,13 @@ void ogs_sbi_server_send_error(ogs_sbi_session_t *session, if (message) { problem.type = ogs_msprintf("/%s/%s", message->h.service.name, message->h.api.version); - if (message->h.resource.id) + if (message->h.resource.component[1]) problem.instance = ogs_msprintf("/%s/%s", - message->h.resource.name, message->h.resource.id); + message->h.resource.component[0], + message->h.resource.component[1]); else - problem.instance = ogs_msprintf("/%s", message->h.resource.name); + problem.instance = + ogs_msprintf("/%s", message->h.resource.component[0]); } problem.status = status; problem.title = (char*)title; @@ -623,3 +626,26 @@ static void notify_completed( ogs_sbi_request_free(request); } + +void ogs_sbi_session_set_data(ogs_sbi_session_t *session, void *data) +{ + ogs_assert(session); + ogs_assert(data); + + session->data = data; +} + +void *ogs_sbi_session_get_data(ogs_sbi_session_t *session) +{ + ogs_assert(session); + + return session->data; +} + +ogs_sbi_server_t *ogs_sbi_session_get_server(ogs_sbi_session_t *session) +{ + ogs_assert(session); + ogs_assert(session->server); + + return session->server; +} diff --git a/lib/sbi/server.h b/lib/sbi/server.h index 4d6a1f5c0b..6a28d237ff 100644 --- a/lib/sbi/server.h +++ b/lib/sbi/server.h @@ -28,6 +28,13 @@ extern "C" { #endif +#define OGS_SETUP_SBI_SESSION(__cTX, __pSESSION) \ + do { \ + ogs_assert((__cTX)); \ + ogs_assert((__pSESSION)); \ + (__cTX)->session = __pSESSION; \ + } while(0) + typedef struct ogs_sbi_server_s ogs_sbi_server_t; typedef struct ogs_sbi_session_s ogs_sbi_session_t; @@ -68,14 +75,18 @@ void ogs_sbi_server_start_all(int (*cb)( void ogs_sbi_server_stop(ogs_sbi_server_t *server); void ogs_sbi_server_stop_all(void); -void ogs_sbi_server_send_response(ogs_sbi_session_t *session, - ogs_sbi_response_t *response, uint32_t status); +void ogs_sbi_server_send_response( + ogs_sbi_session_t *session, ogs_sbi_response_t *response); void ogs_sbi_server_send_error(ogs_sbi_session_t *session, int status, ogs_sbi_message_t *message, const char *title, const char *detail); void ogs_sbi_server_send_problem( ogs_sbi_session_t *session, OpenAPI_problem_details_t *problem); +void ogs_sbi_session_set_data(ogs_sbi_session_t *session, void *data); +void *ogs_sbi_session_get_data(ogs_sbi_session_t *session); +ogs_sbi_server_t *ogs_sbi_session_get_server(ogs_sbi_session_t *session); + #ifdef __cplusplus } #endif diff --git a/lib/sbi/support/3gpp-spec/TS29222_AEF_Security_API.yaml b/lib/sbi/support/3gpp-spec/TS29222_AEF_Security_API.yaml deleted file mode 100644 index 7fd3eff852..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29222_AEF_Security_API.yaml +++ /dev/null @@ -1,133 +0,0 @@ -openapi: 3.0.0 -info: - title: AEF_Security_API - description: | - API for AEF security management. - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. - version: "1.0.1" -externalDocs: - description: 3GPP TS 29.222 V15.4.0 Common API Framework for 3GPP Northbound APIs - url: http://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ -servers: - - url: '{apiRoot}/aef-security/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in subclause 7.5 of 3GPP TS 29.222. -paths: - /check-authentication: - post: - summary: Check authentication. - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CheckAuthenticationReq' - responses: - '200': - description: The request was successful. - content: - application/json: - schema: - $ref: '#/components/schemas/CheckAuthenticationRsp' - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29122_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29122_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29122_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - - /revoke-authorization: - post: - summary: Revoke authorization. - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/RevokeAuthorizationReq' - responses: - '200': - description: The request was successful. - content: - application/json: - schema: - $ref: '#/components/schemas/RevokeAuthorizationRsp' - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29122_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29122_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29122_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - -components: - schemas: - CheckAuthenticationReq: - type: object - properties: - apiInvokerId: - type: string - description: API invoker ID assigned by the CAPIF core function to the API invoker while on-boarding the API invoker. - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - apiInvokerId - - supportedFeatures - CheckAuthenticationRsp: - type: object - properties: - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - supportedFeatures - RevokeAuthorizationReq: - type: object - properties: - revokeInfo: - $ref: 'TS29222_CAPIF_Security_API.yaml#/components/schemas/SecurityNotification' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - revokeInfo - - supportedFeatures - RevokeAuthorizationRsp: - type: object - properties: - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - supportedFeatures \ No newline at end of file diff --git a/lib/sbi/support/3gpp-spec/TS29222_CAPIF_API_Invoker_Management_API.yaml b/lib/sbi/support/3gpp-spec/TS29222_CAPIF_API_Invoker_Management_API.yaml deleted file mode 100644 index 0452fcb9d7..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29222_CAPIF_API_Invoker_Management_API.yaml +++ /dev/null @@ -1,277 +0,0 @@ -openapi: 3.0.0 -info: - title: CAPIF_API_Invoker_Management_API - description: | - API for API invoker management. - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. - version: "1.1.0.alpha-1" -externalDocs: - description: 3GPP TS 29.222 V16.1.0 Common API Framework for 3GPP Northbound APIs - url: http://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ -servers: - - url: '{apiRoot}/api-invoker-management/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in subclause 7.5 of 3GPP TS 29.222 - -paths: - /onboardedInvokers: - post: - description: Creates a new individual API Invoker profile. - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/APIInvokerEnrolmentDetails' - callbacks: - notificationDestination: - '{request.body#/notificationDestination}': - post: - description: Notify the API Invoker about the onboarding completion - requestBody: # contents of the callback message - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OnboardingNotification' - responses: - '204': - description: No Content (successful onboarding notification) - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29122_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29122_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29122_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - responses: - '201': - description: API invoker on-boarded successfully - content: - application/json: - schema: - $ref: '#/components/schemas/APIInvokerEnrolmentDetails' - headers: - Location: - description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/api-invoker-management/v1/onboardedInvokers/{onboardingId}' - required: true - schema: - type: string - '202': - description: The CAPIF core has accepted the Onboarding request and is processing it. - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29122_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29122_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29122_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - - /onboardedInvokers/{onboardingId}: - delete: - description: Deletes an individual API Invoker. - parameters: - - name: onboardingId - in: path - description: String identifying an individual on-boarded API invoker resource - required: true - schema: - type: string - responses: - '204': - description: The individual API Invoker matching onboardingId was offboarded. - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - put: - description: Updates an individual API invoker details. - parameters: - - name: onboardingId - in: path - description: String identifying an individual on-boarded API invoker resource - required: true - schema: - type: string - requestBody: - description: representation of the API invoker details to be updated in CAPIF core function - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/APIInvokerEnrolmentDetails' - callbacks: - notificationDestination: - '{request.body#/notificationDestination}': - post: - description: Notify the API Invoker about the API invoker update completion - requestBody: # contents of the callback message - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OnboardingNotification' - responses: - '204': - description: No Content (successful API invoker update notification) - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29122_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29122_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29122_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - responses: - '200': - description: API invoker details updated successfully - content: - application/json: - schema: - $ref: '#/components/schemas/APIInvokerEnrolmentDetails' - '202': - description: The CAPIF core has accepted the API invoker update details request and is processing it. - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29122_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29122_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29122_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' -components: - schemas: - OnboardingInformation: - type: object - properties: - apiInvokerPublicKey: - type: string - description: The API Invoker's public key - apiInvokerCertificate: - type: string - description: The API Invoker's generic client certificate, provided by the CAPIF core function. - onboardingSecret: - type: string - description: The API Invoker's onboarding secret, provided by the CAPIF core function. - required: - - apiInvokerPublicKey - APIList: - type: array - items: - $ref: 'TS29222_CAPIF_Publish_Service_API.yaml#/components/schemas/ServiceAPIDescription' - minItems: 1 - description: The list of service APIs that the API Invoker is allowed to invoke - APIInvokerEnrolmentDetails: - type: object - properties: - apiInvokerId: - type: string - description: API invoker ID assigned by the CAPIF core function to the API invoker while on-boarding the API invoker. Shall not be present in the HTTP POST request from the API invoker to the CAPIF core function, to on-board itself. Shall be present in all other HTTP requests and responses. - readOnly: true - onboardingInformation: - $ref: '#/components/schemas/OnboardingInformation' - notificationDestination: - $ref: 'TS29122_CommonData.yaml#/components/schemas/Uri' - requestTestNotification: - type: boolean - description: Set to true by Subscriber to request the CAPIF core function to send a test notification as defined in in subclause 7.6. Set to false or omitted otherwise. - websockNotifConfig: - $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' - apiList: - $ref: '#/components/schemas/APIList' - apiInvokerInformation: - type: string - description: Generic information related to the API invoker such as details of the device or the application. - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - onboardingInformation - - notificationDestination - description: Information about the API Invoker that requested to onboard - OnboardingNotification: - type: object - properties: - result: - type: boolean - description: Set to "true" indicate successful on-boarding. Otherwise set to "false" - resourceLocation: - $ref: 'TS29122_CommonData.yaml#/components/schemas/Uri' - apiInvokerEnrolmentDetails: - $ref: '#/components/schemas/APIInvokerEnrolmentDetails' - apiList: - $ref: '#/components/schemas/APIList' - required: - - result \ No newline at end of file diff --git a/lib/sbi/support/3gpp-spec/TS29222_CAPIF_API_Provider_Management_API.yaml b/lib/sbi/support/3gpp-spec/TS29222_CAPIF_API_Provider_Management_API.yaml deleted file mode 100644 index fdd9b1da88..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29222_CAPIF_API_Provider_Management_API.yaml +++ /dev/null @@ -1,208 +0,0 @@ -openapi: 3.0.0 -info: - title: CAPIF_API_Provider_Management_API - description: | - API for API provider domain functions management. - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. - version: "1.0.0.alpha-1" -externalDocs: - description: 3GPP TS 29.222 V16.2.0 Common API Framework for 3GPP Northbound APIs - url: http://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ -servers: - - url: '{apiRoot}/api-provider-management/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in subclause 7.5 of 3GPP TS 29.222 - -paths: - /registrations: - post: - description: Registers a new API Provider domainwith API provider domain functions profiles. - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/APIProviderEnrolmentDetails' - responses: - '201': - description: API provider domain registered successfully - content: - application/json: - schema: - $ref: '#/components/schemas/APIProviderEnrolmentDetails' - headers: - Location: - description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/api-provider-management/v1/registrations/{registrationId}' - required: true - schema: - type: string - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29122_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29122_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29122_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - - /registrations/{registrationId}: - delete: - description: Deregisters API provider domain by deleting API provider domain and functions. - parameters: - - name: registrationId - in: path - description: String identifying an registered API provider domain resource - required: true - schema: - type: string - responses: - '204': - description: The API provider domain matching registrationId is deleted. - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - put: - description: Updates an API provider domain's registration details. - parameters: - - name: registrationId - in: path - description: String identifying an registered API provider domain resource - required: true - schema: - type: string - requestBody: - description: representation of the API provider domain registration details to be updated in CAPIF core function - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/APIProviderEnrolmentDetails' - responses: - '200': - description: API provider domain registration details updated successfully - content: - application/json: - schema: - $ref: '#/components/schemas/APIProviderEnrolmentDetails' - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29122_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29122_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29122_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' -components: - schemas: - APIProviderEnrolmentDetails: - type: object - properties: - apiProviderDomainId: - type: string - description: API provider domain ID assigned by the CAPIF core function to the API management function while registering the API provider domain. Shall not be present in the HTTP POST request from the API Management function to the CAPIF core function, to on-board itself. Shall be present in all other HTTP requests and responses. - readOnly: true - registrationSecret: - type: string - description: Security information necessary for the CAPIF core function to validate the registration of the API provider domain. Shall be present in HTTP POST request from API management function to CAPIF core function for API provider domain registration. - apiProviderFunctionsList: - type: array - items: - $ref: '#/components/schemas/APIProviderFunctionDetails' - minItems: 1 - description: A list of individual API provider domain functions details. When included by the API management function in the HTTP request message, it lists the API provider domain functions that the API management function intends to register/update in registration or update registration procedure. When included by the CAPIF core function in the HTTP response message, it lists the API domain functions details that are registered or updated successfully. - apiProviderDomainInformation: - type: string - description: Generic information related to the API provider domain such as details of the API provider applications. - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - failureReason: - type: string - description: Registration or update specific failure information of failed API provider domain function registrations.Shall be present in the HTTP response body if atleast one of the API provider domain function registration or update registration fails. - required: - - registrationSecret - APIProviderFunctionDetails: - type: object - properties: - apiProviderFuncId: - type: string - description: API provider domain functionID assigned by the CAPIF core function to the API provider domain function while registering/updating the API provider domain. Shall not be present in the HTTP POST request from the API management function to the CAPIF core function, to register itself. Shall be present in all other HTTP requests and responses. - registrationInformation: - $ref: '#/components/schemas/RegistrationInformation' - apiProviderFuncRole: - $ref: '#/components/schemas/ApiProviderFuncRole' - apiProviderFunctionInformation: - type: string - description: Generic information related to the API provider domain function such as details of the API provider applications. - required: - - registrationInformation - - apiProviderFuncRole - RegistrationInformation: - type: object - properties: - apiProviderPublicKey: - type: string - description: Public Key of API Provider domain function. - apiProviderCertificate: - type: string - description: API provider domain function's client certificate - required: - - apiProviderPublicKey - ApiProviderFuncRole: - anyOf: - - type: string - enum: - - AEF - - APF - - AMF - - type: string - description: > - This string provides forward-compatiblity with future extensions to the enumeration but is not used to encode content defined in the present version of this API. - description: > - Possible values are - - AEF: API provider function is API Exposing Function. - - APF: API provider function is API Publishing Function. - - AMF: API Provider function is API Management Function. diff --git a/lib/sbi/support/3gpp-spec/TS29222_CAPIF_Access_Control_Policy_API.yaml b/lib/sbi/support/3gpp-spec/TS29222_CAPIF_Access_Control_Policy_API.yaml deleted file mode 100644 index b7ad931832..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29222_CAPIF_Access_Control_Policy_API.yaml +++ /dev/null @@ -1,111 +0,0 @@ -openapi: 3.0.0 -info: - title: CAPIF_Access_Control_Policy_API - description: | - API for access control policy. - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. - version: "1.0.2" -externalDocs: - description: 3GPP TS 29.222 V16.1.0 Common API Framework for 3GPP Northbound APIs - url: http://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ -servers: - - url: '{apiRoot}/access-control-policy/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in subclause 7.5 of 3GPP TS 29.222 - -paths: - /accessControlPolicyList/{serviceApiId}: - get: - description: Retrieves the access control policy list. - parameters: - - name: serviceApiId - in: path - description: Identifier of a published service API - required: true - schema: - type: string - - name: aef-id - in: query - required: true - description: Identifier of the AEF - schema: - type: string - - name: api-invoker-id - in: query - description: Identifier of the API invoker - schema: - type: string - - name: supported-features - in: query - description: To filter irrelevant responses related to unsupported features - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - responses: - '200': - description: OK. - content: - application/json: - schema: - $ref: '#/components/schemas/AccessControlPolicyList' - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '406': - $ref: 'TS29122_CommonData.yaml#/components/responses/406' - '414': - $ref: 'TS29122_CommonData.yaml#/components/responses/414' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - -components: - schemas: - AccessControlPolicyList: - type: object - properties: - apiInvokerPolicies: - type: array - items: - $ref: '#/components/schemas/ApiInvokerPolicy' - minItems: 0 - description: Policy of each API invoker. - ApiInvokerPolicy: - type: object - properties: - apiInvokerId: - type: string - description: API invoker ID assigned by the CAPIF core function - allowedTotalInvocations: - type: integer - description: Total number of invocations allowed on the service API by the API invoker. - allowedInvocationsPerSecond: - type: integer - description: Invocations per second allowed on the service API by the API invoker. - allowedInvocationTimeRangeList: - type: array - items: - $ref: '#/components/schemas/TimeRangeList' - minItems: 0 - description: The time ranges during which the invocations are allowed on the service API by the API invoker. - required: - - apiInvokerID - TimeRangeList: - type: object - properties: - startTime: - $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' - stopTime: - $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' diff --git a/lib/sbi/support/3gpp-spec/TS29222_CAPIF_Auditing_API.yaml b/lib/sbi/support/3gpp-spec/TS29222_CAPIF_Auditing_API.yaml deleted file mode 100644 index 77de9bf757..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29222_CAPIF_Auditing_API.yaml +++ /dev/null @@ -1,123 +0,0 @@ -openapi: 3.0.0 -info: - title: CAPIF_Auditing_API - description: | - API for auditing. - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. - version: "1.0.1" -externalDocs: - description: 3GPP TS 29.222 V15.4.0 Common API Framework for 3GPP Northbound APIs - url: http://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ -servers: - - url: '{apiRoot}/logs/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in subclause 7.5 of 3GPP TS 29.222. -paths: - /apiInvocationLogs: - get: - description: Query and retrieve service API invocation logs stored on the CAPIF core function. - parameters: - - name: aef-id - in: query - description: String identifying the API exposing function. - schema: - type: string - - name: api-invoker-id - in: query - description: String identifying the API invoker which invoked the service API. - schema: - type: string - - name: time-range-start - in: query - description: Start time of the invocation time range. - schema: - $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' - - name: time-range-end - in: query - description: End time of the invocation time range. - schema: - $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' - - name: api-id - in: query - description: String identifying the API invoked. - schema: - type: string - - name: api-name - in: query - description: API name, it is set as {apiName} part of the URI structure as defined in subclause 4.4 of 3GPP TS 29.501. - schema: - type: string - - name: api-version - in: query - description: Version of the API which was invoked. - schema: - type: string - - name: protocol - in: query - description: Protocol invoked. - schema: - $ref: 'TS29222_CAPIF_Publish_Service_API.yaml#/components/schemas/Protocol' - - name: operation - in: query - description: Operation that was invoked on the API. - schema: - $ref: 'TS29222_CAPIF_Publish_Service_API.yaml#/components/schemas/Operation' - - name: result - in: query - description: Result or output of the invocation. - schema: - type: string - - name: resource-name - in: query - description: Name of the specific resource invoked. - schema: - type: string - - name: src-interface - in: query - description: Interface description of the API invoker. - content: - application/json: - schema: - $ref: 'TS29222_CAPIF_Publish_Service_API.yaml#/components/schemas/InterfaceDescription' - - name: dest-interface - in: query - description: Interface description of the API invoked. - content: - application/json: - schema: - $ref: 'TS29222_CAPIF_Publish_Service_API.yaml#/components/schemas/InterfaceDescription' - - name: supported-features - in: query - description: To filter irrelevant responses related to unsupported features - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - responses: - '200': - description: Result of the query operation along with fetched service API invocation log data. - content: - application/json: - schema: - $ref: 'TS29222_CAPIF_Logging_API_Invocation_API.yaml#/components/schemas/InvocationLog' - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '406': - $ref: 'TS29122_CommonData.yaml#/components/responses/406' - '414': - $ref: 'TS29122_CommonData.yaml#/components/responses/414' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' \ No newline at end of file diff --git a/lib/sbi/support/3gpp-spec/TS29222_CAPIF_Discover_Service_API.yaml b/lib/sbi/support/3gpp-spec/TS29222_CAPIF_Discover_Service_API.yaml deleted file mode 100644 index 6a217aac0b..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29222_CAPIF_Discover_Service_API.yaml +++ /dev/null @@ -1,121 +0,0 @@ -openapi: 3.0.0 -info: - title: CAPIF_Discover_Service_API - description: | - API for discovering service APIs. - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. - version: "1.1.0.alpha-2" -externalDocs: - description: 3GPP TS 29.222 V16.2.0 Common API Framework for 3GPP Northbound APIs - url: http://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ -servers: - - url: '{apiRoot}/service-apis/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in subclause 7.5 of 3GPP TS 29.222. -paths: - /allServiceAPIs: - get: - description: Discover published service APIs and retrieve a collection of APIs according to certain filter criteria. - parameters: - - name: api-invoker-id - in: query - description: String identifying the API invoker assigned by the CAPIF core function. It also represents the CCF identifier in the CAPIF-6/6e interface. - required: true - schema: - type: string - - name: api-name - in: query - description: API name, it is set as {apiName} part of the URI structure as defined in subclause 4.4 of 3GPP TS 29.501 [18]. - schema: - type: string - - name: api-version - in: query - description: API major version the URI (e.g. v1). - schema: - type: string - - name: comm-type - in: query - description: Communication type used by the API (e.g. REQUEST_RESPONSE). - schema: - $ref: 'TS29222_CAPIF_Publish_Service_API.yaml#/components/schemas/CommunicationType' - - name: protocol - in: query - description: Protocol used by the API. - schema: - $ref: 'TS29222_CAPIF_Publish_Service_API.yaml#/components/schemas/Protocol' - - name: aef-id - in: query - description: AEF identifer. - schema: - type: string - - name: data-format - in: query - description: Data formats used by the API (e.g. serialization protocol JSON used). - schema: - $ref: 'TS29222_CAPIF_Publish_Service_API.yaml#/components/schemas/DataFormat' - - name: supported-features - in: query - description: Features supported by the NF consumer for the CAPIF Discover Service API. - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - - name: api-supported-features - in: query - description: Features supported by the discovered service API indicated by api-name parameter. This may only be present if api-name query parameter is present. - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - responses: - '200': - description: The response body contains the result of the search over the list of registered APIs. - content: - application/json: - schema: - $ref: '#/components/schemas/DiscoveredAPIs' - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '406': - $ref: 'TS29122_CommonData.yaml#/components/responses/406' - '414': - $ref: 'TS29122_CommonData.yaml#/components/responses/414' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' -components: - schemas: - DiscoveredAPIs: - type: object - properties: - serviceAPIDescriptions: - type: array - items: - $ref: 'TS29222_CAPIF_Publish_Service_API.yaml#/components/schemas/ServiceAPIDescription' - minItems: 1 - description: Description of the service API as published by the service. Each service API description shall include AEF profiles matching the filter criteria. - ccfServiceCategories: - type: array - items: - $ref: '#/components/schemas/CCFServiceCategory' - minItems: 1 - CCFServiceCategory: - type: object - properties: - serviceAPICategory: - type: string - ccfId: - type: string - required: - - serviceAPICategory - - ccfId diff --git a/lib/sbi/support/3gpp-spec/TS29222_CAPIF_Events_API.yaml b/lib/sbi/support/3gpp-spec/TS29222_CAPIF_Events_API.yaml deleted file mode 100644 index b5d4385d2c..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29222_CAPIF_Events_API.yaml +++ /dev/null @@ -1,277 +0,0 @@ -openapi: 3.0.0 -info: - title: CAPIF_Events_API - description: | - API for event subscription management. - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. - version: "1.1.0.alpha-2" -externalDocs: - description: 3GPP TS 29.222 V16.2.0 Common API Framework for 3GPP Northbound APIs - url: http://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ -servers: - - url: '{apiRoot}/capif-events/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in subclause 7.5 of 3GPP TS 29.222 - -paths: - /{subscriberId}/subscriptions: - post: - description: Creates a new individual CAPIF Event Subscription. - parameters: - - name: subscriberId - in: path - description: Identifier of the Subscriber - required: true - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/EventSubscription' - callbacks: - notificationDestination: - '{request.body#/notificationDestination}': - post: - requestBody: # contents of the callback message - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/EventNotification' - responses: - '204': - description: No Content (successful notification) - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29122_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29122_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29122_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - responses: - '201': - description: Created (Successful creation of subscription) - content: - application/json: - schema: - $ref: '#/components/schemas/EventSubscription' - headers: - Location: - description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/capif-events/v1/{subscriberId}/subscriptions/{subscriptionId}' - required: true - schema: - type: string - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29122_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29122_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29122_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - - /{subscriberId}/subscriptions/{subscriptionId}: - delete: - description: Deletes an individual CAPIF Event Subscription. - parameters: - - name: subscriberId - in: path - description: Identifier of the Subscriber - required: true - schema: - type: string - - name: subscriptionId - in: path - description: Identifier of an individual Events Subscription - required: true - schema: - type: string - responses: - '204': - description: The individual CAPIF Events Subscription matching the subscriptionId is deleted. - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - -components: - schemas: - EventSubscription: - type: object - properties: - events: - type: array - items: - $ref: '#/components/schemas/CAPIFEvent' - minItems: 1 - description: Subscribed events - eventFilters: - type: array - items: - $ref: '#/components/schemas/CAPIFEventFilter' - minItems: 1 - description: Subscribed event filters - eventReq: - $ref: 'TS29523_Npcf_EventExposure.yaml#/components/schemas/ReportingInformation' - notificationDestination: - $ref: 'TS29122_CommonData.yaml#/components/schemas/Uri' - requestTestNotification: - type: boolean - description: Set to true by Subscriber to request the CAPIF core function to send a test notification as defined in in subclause 7.6. Set to false or omitted otherwise. - websockNotifConfig: - $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - events - - notificationDestination - EventNotification: - type: object - properties: - subscriptionId: - type: string - description: Identifier of the subscription resource to which the notification is related - CAPIF resource identifier - events: - $ref: '#/components/schemas/CAPIFEvent' - eventDetail: - $ref: '#/components/schemas/CAPIFEventDetail' - required: - - subscriptionId - - events - CAPIFEventFilter: - type: object - properties: - apiIds: - type: array - items: - type: string - minItems: 1 - description: Identifier of the service API - apiInvokerIds: - type: array - items: - type: string - minItems: 1 - description: Identity of the API invoker - aefIds: - type: array - items: - type: string - minItems: 1 - description: Identifier of the API exposing function - CAPIFEventDetail: - type: object - properties: - serviceAPIDescriptions: - type: array - items: - $ref: 'TS29222_CAPIF_Publish_Service_API.yaml#/components/schemas/ServiceAPIDescription' - minItems: 1 - description: Description of the service API as published by the APF. - apiIds: - type: array - items: - type: string - minItems: 1 - description: Identifier of the service API - apiInvokerIds: - type: array - items: - type: string - minItems: 1 - description: Identity of the API invoker - accCtrlPolList: - $ref: '#/components/schemas/AccessControlPolicyListExt' - invocationLogs: - type: array - items: - $ref: 'TS29222_CAPIF_Logging_API_Invocation_API.yaml#/components/schemas/InvocationLog' - minItems: 1 - description: Invocation logs. - AccessControlPolicyListExt: - allOf: - - $ref: 'TS29222_CAPIF_Access_Control_Policy_API.yaml#/components/schemas/AccessControlPolicyList' - - type: object - properties: - apiId: - type: string - required: - - apiId - CAPIFEvent: - anyOf: - - type: string - enum: - - SERVICE_API_AVAILABLE - - SERVICE_API_UNAVAILABLE - - SERVICE_API_UPDATE - - API_INVOKER_ONBOARDED - - API_INVOKER_OFFBOARDED - - SERVICE_API_INVOCATION_SUCCESS - - SERVICE_API_INVOCATION_FAILURE - - ACCESS_CONTROL_POLICY_UPDATE - - ACCESS_CONTROL_POLICY_UNAVAILABLE - - API_INVOKER_AUTHORIZATION_REVOKED - - API_INVOKER_UPDATED - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - SERVICE_API_AVAILABLE: Events related to the availability of service APIs after the service APIs are published. - - SERVICE_API_UNAVAILABLE: Events related to the unavailability of service APIs after the service APIs are unpublished. - - SERVICE_API_UPDATE: Events related to change in service API information. - - API_INVOKER_ONBOARDED: Events related to API invoker onboarded to CAPIF. - - API_INVOKER_OFFBOARDED: Events related to API invoker offboarded from CAPIF. - - SERVICE_API_INVOCATION_SUCCESS: Events related to the successful invocation of service APIs. - - SERVICE_API_INVOCATION_FAILURE: Events related to the failed invocation of service APIs. - - ACCESS_CONTROL_POLICY_UPDATE: Events related to the update for the access control policy related to the service APIs. - ACCESS_CONTROL_POLICY_UNAVAILABLE: Events related to the unavailability of the access control policy related to the service APIs. - - API_INVOKER_AUTHORIZATION_REVOKED: Events related to the revocation of the authorization of API invokers to access the service APIs. - - API_INVOKER_UPDATED: Events related to API invoker profile updated to CAPIF. diff --git a/lib/sbi/support/3gpp-spec/TS29222_CAPIF_Logging_API_Invocation_API.yaml b/lib/sbi/support/3gpp-spec/TS29222_CAPIF_Logging_API_Invocation_API.yaml deleted file mode 100644 index 08227857ee..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29222_CAPIF_Logging_API_Invocation_API.yaml +++ /dev/null @@ -1,157 +0,0 @@ -openapi: 3.0.0 -info: - title: CAPIF_Logging_API_Invocation_API - description: | - API for invocation logs. - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. - version: "1.0.1" -externalDocs: - description: 3GPP TS 29.222 V15.4.0 Common API Framework for 3GPP Northbound APIs - url: http://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ -servers: - - url: '{apiRoot}/api-invocation-logs/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in subclause 7.5 of 3GPP TS 29.222 -paths: - /{aefId}/logs: - post: - description: Creates a new log entry for service API invocations. - parameters: - - name: aefId - in: path - description: Identifier of the API exposing function - required: true - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/InvocationLog' - responses: - '201': - description: Log of service API invocations provided by API exposing function successfully stored on the CAPIF core function. - content: - application/json: - schema: - $ref: '#/components/schemas/InvocationLog' - headers: - Location: - description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/api-invocation-logs/v1/{aefId}/logs/{logId}' - required: true - schema: - type: string - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29122_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29122_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29122_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - /{aefId}/logs/{logId}: - description: Creates a new log entry for service API invocations. - parameters: - - name: aefId - in: path - description: Identifier of the API exposing function - required: true - schema: - type: string - - name: logId - in: path - description: Identifier of individual log entry - required: true - schema: - type: string -components: - schemas: - InvocationLog: - type: object - properties: - aefId: - type: string - description: Identity information of the API exposing function requesting logging of service API invocations - apiInvokerId: - type: string - description: Identity of the API invoker which invoked the service API - logs: - type: array - items: - $ref: '#/components/schemas/Log' - minItems: 1 - description: Service API invocation log - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - aefId - - apiInvokerId - - log - Log: - type: object - properties: - apiId: - type: string - description: String identifying the API invoked. - apiName: - type: string - description: Name of the API which was invoked, it is set as {apiName} part of the URI structure as defined in subclause 4.4 of 3GPP TS 29.501. - apiVersion: - type: string - description: Version of the API which was invoked - resourceName: - type: string - description: Name of the specific resource invoked - uri: - $ref: 'TS29122_CommonData.yaml#/components/schemas/Uri' - protocol: - $ref: 'TS29222_CAPIF_Publish_Service_API.yaml#/components/schemas/Protocol' - operation: - $ref: 'TS29222_CAPIF_Publish_Service_API.yaml#/components/schemas/Operation' - result: - type: string - description: For HTTP protocol, it contains HTTP status code of the invocation - invocationTime: - $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' - invocationLatency: - $ref: '#/components/schemas/DurationMs' - inputParameters: - description: List of input parameters. Can be any value - string, number, boolean, array or object. - outputParameters: - description: List of output parameters. Can be any value - string, number, boolean, array or object. - srcInterface: - $ref: 'TS29222_CAPIF_Publish_Service_API.yaml#/components/schemas/InterfaceDescription' - destInterface: - $ref: 'TS29222_CAPIF_Publish_Service_API.yaml#/components/schemas/InterfaceDescription' - fwdInterface: - type: string - description: It includes the node identifier (as defined in IETF RFC 7239 of all forwarding entities between the API invoker and the AEF, concatenated with comma and space, e.g. 192.0.2.43:80, unknown:_OBFport, 203.0.113.60 - required: - - apiId - - apiName - - apiVersion - - resourceName - - protocol - - result - DurationMs: - type: integer - description: Unsigned integer identifying a period of time in units of milliseconds. - minimum: 0 \ No newline at end of file diff --git a/lib/sbi/support/3gpp-spec/TS29222_CAPIF_Publish_Service_API.yaml b/lib/sbi/support/3gpp-spec/TS29222_CAPIF_Publish_Service_API.yaml deleted file mode 100644 index 7baa8bc2a4..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29222_CAPIF_Publish_Service_API.yaml +++ /dev/null @@ -1,495 +0,0 @@ -openapi: 3.0.0 -info: - title: CAPIF_Publish_Service_API - description: | - API for publishing service APIs. - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. - version: "1.1.0.alpha-2" -externalDocs: - description: 3GPP TS 29.222 V16.2.0 Common API Framework for 3GPP Northbound APIs - url: http://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ -servers: - - url: '{apiRoot}/published-apis/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in subclause 7.5 of 3GPP TS 29.222. -paths: - -# APF published API - - /{apfId}/service-apis: - post: - description: Publish a new API. - parameters: - - name: apfId - in: path - required: true - schema: - $ref: '#/components/schemas/apfId' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/ServiceAPIDescription' - responses: - '201': - description: Service API published successfully The URI of the created resource shall be returned in the "Location" HTTP header. - content: - application/json: - schema: - $ref: '#/components/schemas/ServiceAPIDescription' - headers: - Location: - description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}' - required: true - schema: - type: string - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29122_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29122_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29122_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - get: - description: Retrieve all published APIs. - parameters: - - name: apfId - in: path - required: true - schema: - $ref: '#/components/schemas/apfId' - responses: - '200': - description: Definition of all service API(s) published by the API publishing function. - content: - application/json: - schema: - $ref: '#/components/schemas/ServiceAPIDescription' - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '406': - $ref: 'TS29122_CommonData.yaml#/components/responses/406' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - -# Individual APF published API - - /{apfId}/service-apis/{serviceApiId}: - get: - description: Retrieve a published service API. - parameters: - - name: serviceApiId - in: path - required: true - schema: - $ref: '#/components/schemas/serviceApiId' - - name: apfId - in: path - required: true - schema: - $ref: '#/components/schemas/apfId' - responses: - '200': - description: Definition of all service API published by the API publishing function. - content: - application/json: - schema: - $ref: '#/components/schemas/ServiceAPIDescription' - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '406': - $ref: 'TS29122_CommonData.yaml#/components/responses/406' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - put: - description: Update a published service API. - parameters: - - name: serviceApiId - in: path - required: true - schema: - $ref: '#/components/schemas/serviceApiId' - - name: apfId - in: path - required: true - schema: - $ref: '#/components/schemas/apfId' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/ServiceAPIDescription' - responses: - '200': - description: Definition of service API updated successfully. - content: - application/json: - schema: - $ref: '#/components/schemas/ServiceAPIDescription' - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29122_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29122_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29122_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - delete: - description: Unpublish a published service API. - parameters: - - name: serviceApiId - in: path - required: true - schema: - $ref: '#/components/schemas/serviceApiId' - - name: apfId - in: path - required: true - schema: - $ref: '#/components/schemas/apfId' - responses: - '204': - description: The individual published service API matching the serviceAPiId is deleted. - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - -# Components - -components: - schemas: -# Data types uses as path variables - apfId: - type: string - description: Identification of the API publishing function. - serviceApiId: - type: string - description: String identifying an individual published service API. -# Data Type for representations - ServiceAPIDescription: - type: object - properties: - apiName: - type: string - description: API name, it is set as {apiName} part of the URI structure as defined in subclause 4.4 of 3GPP TS 29.501. - apiId: - type: string - description: API identifier assigned by the CAPIF core function to the published service API. Shall not be present in the HTTP POST request from the API publishing function to the CAPIF core function. Shall be present in the HTTP POST response from the CAPIF core function to the API publishing function and in the HTTP GET response from the CAPIF core function to the API invoker (discovery API). - aefProfiles: - type: array - items: - $ref: '#/components/schemas/AefProfile' - minItems: 1 - description: AEF profile information, which includes the exposed API details (e.g. protocol). - description: - type: string - description: Text description of the API - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - shareableInfo: - $ref: '#/components/schemas/ShareableInformation' - serviceAPICategory: - type: string - apiSuppFeats: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - pubApiPath: - $ref: '#/components/schemas/PublishedApiPath' - required: - - apiName - InterfaceDescription: - type: object - properties: - ipv4Addr: - $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv4Addr' - ipv6Addr: - $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv6Addr' - port: - $ref: 'TS29122_CommonData.yaml#/components/schemas/Port' - securityMethods: - type: array - items: - $ref: '#/components/schemas/SecurityMethod' - minItems: 1 - description: Security methods supported by the interface, it take precedence over the security methods provided in AefProfile, for this specific interface. - oneOf: - - required: [ipv4Addr] - - required: [ipv6Addr] - AefProfile: - type: object - properties: - aefId: - type: string - description: Identifier of the API exposing function - versions: - type: array - items: - $ref: '#/components/schemas/Version' - minItems: 1 - description: API version - protocol: - $ref: '#/components/schemas/Protocol' - dataFormat: - $ref: '#/components/schemas/DataFormat' - securityMethods: - type: array - items: - $ref: '#/components/schemas/SecurityMethod' - minItems: 1 - description: Security methods supported by the AEF - domainName: - type: string - description: Domain to which API belongs to - interfaceDescriptions: - type: array - items: - $ref: '#/components/schemas/InterfaceDescription' - minItems: 1 - description: Interface details - required: - - aefId - - versions - oneOf: - - required: [domainName] - - required: [interfaceDescriptions] - Resource: - type: object - properties: - resourceName: - type: string - description: Resource name - commType: - $ref: '#/components/schemas/CommunicationType' - uri: - type: string - description: Relative URI of the API resource, it is set as {apiSpecificResourceUriPart} part of the URI structure as defined in subclause 4.4 of 3GPP TS 29.501. - custOpName: - type: string - description: it is set as {custOpName} part of the URI structure for a custom operation associated with a resource as defined in subclause 4.4 of 3GPP TS 29.501. - operations: - type: array - items: - $ref: '#/components/schemas/Operation' - minItems: 1 - description: Supported HTTP methods for the API resource. Only applicable when the protocol in AefProfile indicates HTTP. - description: - type: string - description: Text description of the API resource - required: - - resourceName - - commType - - uri - CustomOperation: - type: object - properties: - commType: - $ref: '#/components/schemas/CommunicationType' - custOpName: - type: string - description: it is set as {custOpName} part of the URI structure for a custom operation without resource association as defined in subclause 4.4 of 3GPP TS 29.501. - operations: - type: array - items: - $ref: '#/components/schemas/Operation' - minItems: 1 - description: Supported HTTP methods for the API resource. Only applicable when the protocol in AefProfile indicates HTTP. - description: - type: string - description: Text description of the custom operation - required: - - commType - - custOpName - Version: - type: object - properties: - apiVersion: - type: string - description: API major version in URI (e.g. v1) - expiry: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - resources: - type: array - items: - $ref: '#/components/schemas/Resource' - minItems: 1 - description: Resources supported by the API. - custOperations: - type: array - items: - $ref: '#/components/schemas/CustomOperation' - minItems: 1 - description: Custom operations without resource association. - required: - - apiVersion - ShareableInformation: - type: object - properties: - isShareable: - type: boolean - ccfProviderDomains: - type: array - items: - type: string - minItems: 1 - required: - - isShareable - PublishedApiPath: - type: object - properties: - ccfIds: - type: array - items: - type: string - minItems: 1 - description: A list of CCF identifiers where the service API is already published. - Protocol: - anyOf: - - type: string - enum: - - HTTP_1_1 - - HTTP_2 - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - HTTP_1_1: HTTP version 1.1 - - HTTP_2: HTTP version 2 - CommunicationType: - anyOf: - - type: string - enum: - - REQUEST_RESPONSE - - SUBSCRIBE_NOTIFY - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - REQUEST_RESPONSE: The communication is of the type request-response - - SUBSCRIBE_NOTIFY: The communication is of the type subscribe-notify - DataFormat: - anyOf: - - type: string - enum: - - JSON - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - JSON: JavaScript Object Notation - SecurityMethod: - anyOf: - - type: string - enum: - - PSK - - PKI - - OAUTH - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - PSK: Security method 1 (Using TLS-PSK) as described in 3GPP TS 33.122 - - PKI: Security method 2 (Using PKI) as described in 3GPP TS 33.122 - - OAUTH: Security method 3 (TLS with OAuth token) as described in 3GPP TS 33.122 - Operation: - anyOf: - - type: string - enum: - - GET - - POST - - PUT - - PATCH - - DELETE - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - GET: HTTP GET method - - POST: HTTP POST method - - PUT: HTTP PUT method - - PATCH: HTTP PATCH method - - DELETE: HTTP DELETE method diff --git a/lib/sbi/support/3gpp-spec/TS29222_CAPIF_Security_API.yaml b/lib/sbi/support/3gpp-spec/TS29222_CAPIF_Security_API.yaml deleted file mode 100644 index e9cdf3eee4..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29222_CAPIF_Security_API.yaml +++ /dev/null @@ -1,444 +0,0 @@ -openapi: 3.0.0 -info: - title: CAPIF_Security_API - description: | - API for CAPIF security management. - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. - version: "1.0.2" -externalDocs: - description: 3GPP TS 29.222 V16.1.0 Common API Framework for 3GPP Northbound APIs - url: http://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ -servers: - - url: '{apiRoot}/capif-security/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in subclause 7.5 of 3GPP TS 29.222. -paths: - - /trustedInvokers/{apiInvokerId}: - get: - parameters: - - name: apiInvokerId - in: path - description: Identifier of an individual API invoker - required: true - schema: - type: string - - name: authenticationInfo - in: query - description: When set to 'true', it indicates the CAPIF core function to send the authentication information of the API invoker. Set to false or omitted otherwise. - schema: - type: boolean - - name: authorizationInfo - in: query - description: When set to 'true', it indicates the CAPIF core function to send the authorization information of the API invoker. Set to false or omitted otherwise. - schema: - type: boolean - responses: - '200': - description: The security related information of the API Invoker based on the request from the API exposing function. - content: - application/json: - schema: - $ref: '#/components/schemas/ServiceSecurity' - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '406': - $ref: 'TS29122_CommonData.yaml#/components/responses/406' - '414': - $ref: 'TS29122_CommonData.yaml#/components/responses/414' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - put: - parameters: - - name: apiInvokerId - in: path - description: Identifier of an individual API invoker - required: true - schema: - type: string - requestBody: - description: create a security context for an API invoker - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/ServiceSecurity' - callbacks: - notificationDestination: - '{request.body#/notificationDestination}': - post: - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/SecurityNotification' - responses: - '204': - description: No Content (successful notification) - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29122_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29122_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29122_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - responses: - '201': - description: Successful created. - content: - application/json: - schema: - $ref: '#/components/schemas/ServiceSecurity' - headers: - Location: - description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/capif-security/v1/trustedInvokers/{apiInvokerId}' - required: true - schema: - type: string - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '411': - $ref: 'TS29122_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29122_CommonData.yaml#/components/responses/413' - '414': - $ref: 'TS29122_CommonData.yaml#/components/responses/414' - '415': - $ref: 'TS29122_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - delete: - parameters: - - name: apiInvokerId - in: path - description: Identifier of an individual API invoker - required: true - schema: - type: string - responses: - '204': - description: No Content (Successful deletion of the existing subscription) - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - /trustedInvokers/{apiInvokerId}/update: - post: - parameters: - - name: apiInvokerId - in: path - description: Identifier of an individual API invoker - required: true - schema: - type: string - requestBody: - description: Update the security context (e.g. re-negotiate the security methods). - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/ServiceSecurity' - responses: - '200': - description: Successful updated. - content: - application/json: - schema: - $ref: '#/components/schemas/ServiceSecurity' - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29122_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29122_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29122_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - - /trustedInvokers/{apiInvokerId}/delete: - post: - parameters: - - name: apiInvokerId - in: path - description: Identifier of an individual API invoker - required: true - schema: - type: string - requestBody: - description: Revoke the authorization of the API invoker for APIs. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/SecurityNotification' - responses: - '204': - description: Successful revoked. - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29122_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29122_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29122_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - - /securities/{securityId}/token: - post: - parameters: - - name: securityId - in: path - description: Identifier of an individual security instance - required: true - schema: - type: string - requestBody: - required: true - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/AccessTokenReq' - responses: - '200': - description: Successful Access Token Request - content: - application/json: - schema: - $ref: '#/components/schemas/AccessTokenRsp' - '400': - description: Error in the Access Token Request - content: - application/json: - schema: - $ref: '#/components/schemas/AccessTokenErr' - -components: - schemas: - ServiceSecurity: - type: object - properties: - securityInfo: - type: array - items: - $ref: '#/components/schemas/SecurityInformation' - minimum: 1 - notificationDestination: - $ref: 'TS29122_CommonData.yaml#/components/schemas/Uri' - requestTestNotification: - type: boolean - description: Set to true by API invoker to request the CAPIF core function to send a test notification as defined in in subclause 7.6. Set to false or omitted otherwise. - websockNotifConfig: - $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - securityInfo - - notificationDestination - SecurityInformation: - type: object - properties: - interfaceDetails: - $ref: 'TS29222_CAPIF_Publish_Service_API.yaml#/components/schemas/InterfaceDescription' - aefId: - type: string - description: Identifier of the API exposing function - prefSecurityMethods: - type: array - items: - $ref: 'TS29222_CAPIF_Publish_Service_API.yaml#/components/schemas/SecurityMethod' - minItems: 1 - description: Security methods preferred by the API invoker for the API interface. - selSecurityMethod: - $ref: 'TS29222_CAPIF_Publish_Service_API.yaml#/components/schemas/SecurityMethod' - authenticationInfo: - type: string - description: Authentication related information - authorizationInfo: - type: string - description: Authorization related information - required: - - prefSecurityMethods - oneOf: - - required: [interfaceDetails] - - required: [aefId] - SecurityNotification: - type: object - properties: - apiInvokerId: - type: string - description: String identifying the API invoker assigned by the CAPIF core function - aefId: - type: string - description: String identifying the AEF. - apiIds: - type: array - items: - type: string - minItems: 1 - description: Identifier of the service API - cause: - $ref: '#/components/schemas/Cause' - required: - - apiInvokerId - - apiIds - - cause - AccessTokenReq: - format: x-www-form-urlencoded - properties: - grant_type: - type: string - enum: - - client_credentials - client_id: - type: string - client_secret: - type: string - scope: - type: string - required: - - grant_type - - client_id - AccessTokenRsp: - type: object - properties: - access_token: - type: string - description: JWS Compact Serialized representation of JWS signed JSON object (AccessTokenClaims) - token_type: - type: string - enum: - - Bearer - expires_in: - $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' - scope: - type: string - required: - - access_token - - token_type - - expires_in - AccessTokenClaims: - type: object - properties: - iss: - type: string - scope: - type: string - exp: - $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' - required: - - iss - - scope - - exp - AccessTokenErr: - type: object - properties: - error: - type: string - enum: - - invalid_request - - invalid_client - - invalid_grant - - unauthorized_client - - unsupported_grant_type - - invalid_scope - error_description: - type: string - error_uri: - type: string - required: - - error - Cause: - anyOf: - - type: string - enum: - - OVERLIMIT_USAGE - - UNEXPECTED_REASON - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - OVERLIMIT_USAGE: The revocation of the authorization of the API invoker is due to the overlimit usage of the service API - - UNEXPECTED_REASON: The revocation of the authorization of the API invoker is due to unexpected reason. \ No newline at end of file diff --git a/lib/sbi/support/3gpp-spec/TS29486_VAE_ApplicationRequirement.yaml b/lib/sbi/support/3gpp-spec/TS29486_VAE_ApplicationRequirement.yaml deleted file mode 100644 index 431447813f..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29486_VAE_ApplicationRequirement.yaml +++ /dev/null @@ -1,237 +0,0 @@ -openapi: 3.0.0 -info: - version: 1.0.0.alpha-2 - title: VAE_ApplicationRequirement - description: | - API for VAE Application Requirement Service - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. -externalDocs: - description: 3GPP TS 29.486 V16.0.0 V2X Application Enabler (VAE) Services - url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.486/' -security: - - {} - - oAuth2ClientCredentials: [] -servers: - - url: '{apiRoot}/vae-app-req/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 -paths: - /application-requirements: - post: - summary: VAE_Application_Requirements resource create service Operation - tags: - - application requirements collection (Document) - operationId: CreateApplicationRequirement - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ApplicationRequirementData' - required: true - responses: - '201': - description: Application Requirement Resource Created - headers: - Location: - description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/vae-app-req/v1/application-requirements/{requirementId}' - required: true - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/ApplicationRequirementData' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - callbacks: - NotifyNetworkResource: - '{$request.body#/notifUri}': - post: - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/AppReqNotification' - responses: - '204': - description: No Content, Notification was succesfull - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - /application-requirement/{requirementId}: - get: - summary: VAE Application Requirement resource read service Operation - tags: - - Individual application requirement (Document) - operationId: ReadApplicationRequirement - parameters: - - name: requirementId - in: path - description: Identifier of an application requirement resource - required: true - schema: - type: string - responses: - '200': - description: OK. Resource representation is returned - content: - application/json: - schema: - $ref: '#/components/schemas/ApplicationRequirementData' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '406': - $ref: 'TS29571_CommonData.yaml#/components/responses/406' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - delete: - summary: VAE Application Requirement resource delete service Operation - tags: - - Individual application requirement (Document) - operationId: DeleteApplicationRequirement - parameters: - - name: requirementId - in: path - required: true - description: Unique ID of the application requirement to be deleted - schema: - type: string - responses: - '204': - description: The subscription was terminated successfully. - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' -components: - securitySchemes: - oAuth2ClientCredentials: - type: oauth2 - flows: - clientCredentials: - tokenUrl: '{tokenUrl}' - scopes: {} - schemas: - ApplicationRequirementData: - type: object - properties: - ueId: - $ref: 'TS29486_VAE_MessageDelivery.yaml#/components/schemas/V2xUeId' - groupId: - $ref: 'TS29486_VAE_MessageDelivery.yaml#/components/schemas/V2xGroupId' - duration: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - serviceId: - $ref: 'TS29486_VAE_MessageDelivery.yaml#/components/schemas/V2xServiceId' - appRequirement: - $ref: '#/components/schemas/ApplicationRequirement' - notifUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - requestTestNotification: - type: boolean - description: Set to true by the NF service consumer to request the VAE server to send a test notification as defined in subclause 6.3.5.3. Set to false or omitted otherwise. - websockNotifConfig: - $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' - suppFeat: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - serviceId - - appRequirement - - notifUri - ApplicationRequirement: - type: object - properties: - serviceLevel: - $ref: '#/components/schemas/ServiceLevel' - AppReqNotification: - type: object - properties: - resourceUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - result: - $ref: '#/components/schemas/ReservationResult' - required: - - resourceUri - - result - ServiceLevel: - anyOf: - - type: string - enum: - - HIGH - - MEDIUM - - LOW - - type: string - ReservationResult: - anyOf: - - type: string - enum: - - SUCCESSFUL - - FAILURE - - type: string diff --git a/lib/sbi/support/3gpp-spec/TS29486_VAE_DynamicGroup.yaml b/lib/sbi/support/3gpp-spec/TS29486_VAE_DynamicGroup.yaml deleted file mode 100644 index 16d61d453e..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29486_VAE_DynamicGroup.yaml +++ /dev/null @@ -1,223 +0,0 @@ -openapi: 3.0.0 -info: - version: 1.0.0.alpha-1 - title: VAE_DynamicGroup - description: | - VAE_Dynamic_Group Service - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. -externalDocs: - description: 3GPP TS 29.486 V16.0.0 V2X Application Enabler (VAE) Services - url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.486/' -security: - - {} - - oAuth2ClientCredentials: [] -servers: - - url: '{apiRoot}/vae-dynamic-group/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in clause clause 4.4 of 3GPP TS 29.501 -paths: - /group-configurations: - post: - summary: VAE_Dynamice_Group resource create service Operation - tags: - - application requirements collection (Document) - operationId: CreateGroupConfiguration - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GroupConfigurationData' - required: true - responses: - '201': - description: Application Requirement Resource Created - headers: - Location: - description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/vae-group-configuration/v1/group-configurations/{configId}' - required: true - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/GroupConfigurationData' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - callbacks: - NotifyDynamicGroup: - '{$request.body#/notifUri}': - post: - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/DynamicGroupNotification' - responses: - '204': - description: No Content, Notification was succesfull - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - /group-configuration/{configId}: - get: - summary: VAE Group Configuration resource read service Operation - tags: - - Individual Group Configuration(Document) - operationId: ReadDynamicGroupConfiguration - parameters: - - name: configId - in: path - description: Identifier of an group configuration resource - required: true - schema: - type: string - responses: - '200': - description: OK. Resource representation is returned - content: - application/json: - schema: - $ref: '#/components/schemas/GroupConfigurationData' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '406': - $ref: 'TS29571_CommonData.yaml#/components/responses/406' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - delete: - summary: VAE Group Configuration resource delete service Operation - tags: - - Individual group configuration (Document) - operationId: DeleteGroupConfiguration - parameters: - - name: configId - in: path - required: true - description: Unique ID of the group configuration to be deleted - schema: - type: string - responses: - '204': - description: The subscription was terminated successfully. - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' -components: - securitySchemes: - oAuth2ClientCredentials: - type: oauth2 - flows: - clientCredentials: - tokenUrl: '{tokenUrl}' - scopes: {} - schemas: - GroupConfigurationData: - type: object - properties: - groupId: - $ref: 'TS29486_VAE_MessageDelivery.yaml#/components/schemas/V2xGroupId' - definition: - type: string - leaderId: - $ref: 'TS29486_VAE_MessageDelivery.yaml#/components/schemas/V2xUeId' - notifUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - duration: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - requestTestNotification: - type: boolean - description: Set to true by the NF service consumer to request the VAE server to send a test notification as defined in clause 6.4.5.3. Set to false or omitted otherwise. - websockNotifConfig: - $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' - suppFeat: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - groupId - - definition - - leaderId - - notifUri - DynamicGroupNotification: - type: object - properties: - resourceUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - joinedUeIds: - type: array - items: - $ref: 'TS29486_VAE_MessageDelivery.yaml#/components/schemas/V2xUeId' - minItems: 1 - leftUeIds: - type: array - items: - $ref: 'TS29486_VAE_MessageDelivery.yaml#/components/schemas/V2xUeId' - minItems: 1 - required: - - resourceUri diff --git a/lib/sbi/support/3gpp-spec/TS29486_VAE_FileDistribution.yaml b/lib/sbi/support/3gpp-spec/TS29486_VAE_FileDistribution.yaml deleted file mode 100644 index 1ffd8f8137..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29486_VAE_FileDistribution.yaml +++ /dev/null @@ -1,213 +0,0 @@ -openapi: 3.0.0 -info: - version: 1.0.0.alpha-3 - title: VAE_FileDistribution - description: | - API for VAE File Distribution Service - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. -externalDocs: - description: 3GPP TS 29.486 V16.0.0 V2X Application Enabler (VAE) Services - url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.486/' -security: - - {} - - oAuth2ClientCredentials: [] -servers: - - url: '{apiRoot}/vae-file-distribution/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 -paths: - /file-distributions: - post: - summary: VAE File Distributions resource create service Operation - tags: - - file distributions collection (Document) - operationId: CreateFileDistributions - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FileDistributionData' - required: true - responses: - '201': - description: File Distribution Resource Created - headers: - Location: - description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/vae-file-distribution/v1/file-distributions/{distributionId}' - required: true - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/FileDistributionData' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - description: Unexpected error - /file-distributions/{distributionId}: - get: - summary: Get an existing individual file distribution resource - operationId: ReadIndividualFileDistribution - tags: - - Individual File Distribution (Document) - parameters: - - name: distributionId - in: path - description: Identifier of a file distribution resource - required: true - schema: - type: string - responses: - '200': - description: OK. Resource representation is returned - content: - application/json: - schema: - $ref: '#/components/schemas/FileDistributionData' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '406': - $ref: 'TS29571_CommonData.yaml#/components/responses/406' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - delete: - summary: VAE File Distribution resource delete service Operation - tags: - - Individual file distribution (Document) - operationId: DeleteFileDistribution - parameters: - - name: distributionId - in: path - required: true - description: Unique ID of the file distribution to be deleted - schema: - type: string - responses: - '204': - description: The subscription was terminated successfully. - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - description: Unexpected error -components: - securitySchemes: - oAuth2ClientCredentials: - type: oauth2 - flows: - clientCredentials: - tokenUrl: '{tokenUrl}' - scopes: {} - schemas: - FileDistributionData: - type: object - properties: - groupId: - $ref: 'TS29486_VAE_MessageDelivery.yaml#/components/schemas/V2xGroupId' - fileLists: - type: array - items: - $ref: '#/components/schemas/FileList' - minItems: 1 - serviceClass: - type: string - geoArea: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' - maxBitrate: - $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' - maxDelay: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' - suppFeat: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - fileLists - - geoArea - - maxBitrate - - maxDelay - FileList: - type: object - properties: - fileUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - fileDisplayUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - fileEarFetchTime: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - fileLatFetchTime: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - fileSize: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' - fileStatus: - $ref: '#/components/schemas/FileStatus' - completionTime: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - keepUpdateInterval: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' - uniAvailability: - type: boolean - fileRepetition: - type: integer - required: - - fileUri - - fileDisplayUri - - fileEarFetchTime - - fileLatFetchTime - - fileStatus - - completionTime - - keepUpdateInterval - - FileStatus: - anyOf: - - type: string - enum: - - PENDING - - FETCHED - - PREPARED - - TRANSMITTING - - SENT - - type: string diff --git a/lib/sbi/support/3gpp-spec/TS29486_VAE_ServiceContinuity.yaml b/lib/sbi/support/3gpp-spec/TS29486_VAE_ServiceContinuity.yaml deleted file mode 100644 index b2b3e4e032..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29486_VAE_ServiceContinuity.yaml +++ /dev/null @@ -1,91 +0,0 @@ -openapi: 3.0.0 -info: - version: 1.0.0.alpha-1 - title: VAE_Service Continuity - description: | - API for VAE Service Continuity Service - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. -externalDocs: - description: 3GPP TS 29.486 V16.0.0 V2X Application Enabler (VAE) Services - url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.486/' -security: - - {} - - oAuth2ClientCredentials: [] -servers: - - url: '{apiRoot}/vae-service-continuity/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 -paths: - /geo-areas/{geoId}: - get: - summary: VAE service continuity query service operation - tags: - - Individual geographical area (Document) - operationId: QueryServiceContinuity - parameters: - - name: geoId - in: path - description: Identifier of a geographical area - required: true - schema: - type: string - - name: service-id - in: query - description: Identifier of a V2X service - required: true - schema: - $ref: 'TS29486_VAE_MessageDelivery.yaml#/components/schemas/V2xServiceId' - - name: supp-feat - in: query - description: To filter irrelevant responses related to unsupported features - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - responses: - '200': - description: OK. Resource representation is returned - content: - application/json: - schema: - $ref: '#/components/schemas/V2xServiceInfo' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '406': - $ref: 'TS29571_CommonData.yaml#/components/responses/406' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' -components: - securitySchemes: - oAuth2ClientCredentials: - type: oauth2 - flows: - clientCredentials: - tokenUrl: '{tokenUrl}' - scopes: {} - schemas: - V2xServiceInfo: - type: object - properties: - serviceIds: - type: array - items: - $ref: 'TS29486_VAE_MessageDelivery.yaml#/components/schemas/V2xServiceId' - minItems: 1 - suppFeat: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - serviceIds diff --git a/lib/sbi/support/3gpp-spec/TS29502_Nsmf_PDUSession.yaml b/lib/sbi/support/3gpp-spec/TS29502_Nsmf_PDUSession.yaml deleted file mode 100644 index 1d60f1cc1e..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29502_Nsmf_PDUSession.yaml +++ /dev/null @@ -1,2620 +0,0 @@ -openapi: 3.0.0 - -info: - version: '1.1.0.alpha-1' - title: 'Nsmf_PDUSession' - description: | - SMF PDU Session Service. - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. - -externalDocs: - description: 3GPP TS 29.502 V15.3.0; 5G System; Session Management Services; Stage 3 - url: http://www.3gpp.org/ftp/Specs/archive/29_series/29.502/ - -servers: - - url: '{apiRoot}/nsmf-pdusession/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in subclause 4.4 of 3GPP TS 29.501. The sm-contexts and pdu-sessions resources can be distributed on different processing instances or hosts. Thus the authority and/or deployment-specific string of the apiRoot of the created individual sm context and pdu-session resources' URIs may differ from the authority and/or deployment-specific string of the apiRoot of the sm-contexts and pdu-sessions collections' URIs. - -security: - - {} - - oAuth2ClientCredentials: - - nsmf-pdusession - -paths: - /sm-contexts: - post: - summary: Create SM Context - tags: - - SM contexts collection - operationId: PostSmContexts - requestBody: - description: representation of the SM context to be created in the SMF - required: true - content: - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/SmContextCreateData' - binaryDataN1SmMessage: - type: string - format: binary - binaryDataN2SmInformation: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1SmMessage: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - binaryDataN2SmInformation: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - callbacks: - smContextStatusNotification: - '{$request.body#/smContextStatusUri}': - post: - requestBody: # contents of the callback message - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/SmContextStatusNotification' - responses: - '204': - description: successful notification - '307': - description: temporary redirect - headers: - Location: - required: true - description: 'A URI pointing to the endpoint of another NF service consumer to which the notification should be sent' - schema: - type: string - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - - responses: - '201': - description: successful creation of an SM context - content: - application/json: # message without binary body part - schema: - $ref: '#/components/schemas/SmContextCreatedData' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/SmContextCreatedData' - binaryDataN2SmInformation: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN2SmInformation: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - headers: - Location: - description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nsmf-pdusession/{apiVersion}/sm-contexts/{smContextRef}' - required: true - schema: - type: string - - '307': - description: temporary redirect - headers: - Location: - description: 'An alternative URI of the resource located on an alternative service instance within the SMF that was selected by the AMF' - required: true - schema: - type: string - '308': - description: permanent redirect - headers: - Location: - description: 'An alternative URI of the resource located on an alternative service instance within the SMF that was selected by the AMF' - required: true - schema: - type: string - '400': - description: unsuccessful creation of an SM context - bad request - content: - application/json: # message without binary body part - schema: - $ref: '#/components/schemas/SmContextCreateError' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/SmContextCreateError' - binaryDataN1SmMessage: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1SmMessage: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - '403': - description: unsuccessful creation of an SM context - forbidden - content: - application/json: # message without binary body part - schema: - $ref: '#/components/schemas/SmContextCreateError' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/SmContextCreateError' - binaryDataN1SmMessage: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1SmMessage: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - '404': - description: unsuccessful creation of an SM context - not found - content: - application/json: # message without binary body part - schema: - $ref: '#/components/schemas/SmContextCreateError' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/SmContextCreateError' - binaryDataN1SmMessage: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1SmMessage: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - - '500': - description: unsuccessful creation of an SM context - internal server error - content: - application/json: # message without binary body part - schema: - $ref: '#/components/schemas/SmContextCreateError' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/SmContextCreateError' - binaryDataN1SmMessage: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1SmMessage: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - '503': - description: unsuccessful creation of an SM context - service unavailable - content: - application/json: # message without binary body part - schema: - $ref: '#/components/schemas/SmContextCreateError' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/SmContextCreateError' - binaryDataN1SmMessage: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1SmMessage: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - - '504': - description: unsuccessful creation of an SM context - gateway timeout - content: - application/json: # message without binary body part - schema: - $ref: '#/components/schemas/SmContextCreateError' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/SmContextCreateError' - binaryDataN1SmMessage: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1SmMessage: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - - - /sm-contexts/{smContextRef}/retrieve: - post: - summary: Retrieve SM Context - tags: - - Individual SM context - operationId: RetrieveSmContext - parameters: - - name: smContextRef - in: path - description: SM context reference - required: true - schema: - type: string - requestBody: - description: parameters used to retrieve the SM context - required: false - content: - application/json: - schema: - $ref: '#/components/schemas/SmContextRetrieveData' - responses: - '200': - description: successful retrieval of an SM context - content: - application/json: - schema: - $ref: '#/components/schemas/SmContextRetrievedData' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - - /sm-contexts/{smContextRef}/modify: - post: - summary: Update SM Context - tags: - - Individual SM context - operationId: UpdateSmContext - parameters: - - name: smContextRef - in: path - description: SM context reference - required: true - schema: - type: string - requestBody: - description: representation of the updates to apply to the SM context - required: true - content: - application/json: # message without binary body part - schema: - $ref: '#/components/schemas/SmContextUpdateData' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/SmContextUpdateData' - binaryDataN1SmMessage: - type: string - format: binary - binaryDataN2SmInformation: - type: string - format: binary - binaryDataN2SmInformationExt1: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1SmMessage: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - binaryDataN2SmInformation: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2SmInformationExt1: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - responses: - '200': - description: successful update of an SM context with content in the response - content: - application/json: # message without binary body part - schema: - $ref: '#/components/schemas/SmContextUpdatedData' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/SmContextUpdatedData' - binaryDataN1SmMessage: - type: string - format: binary - binaryDataN2SmInformation: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1SmMessage: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - binaryDataN2SmInformation: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - '204': - description: successful update of an SM context without content in the response - '400': - description: unsuccessful update of an SM context - bad request - content: - application/json: # message without binary body part - schema: - $ref: '#/components/schemas/SmContextUpdateError' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/SmContextUpdateError' - binaryDataN1SmMessage: - type: string - format: binary - binaryDataN2SmInformation: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1SmMessage: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - binaryDataN2SmInformation: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - '403': - description: unsuccessful update of an SM context - forbidden - content: - application/json: # message without binary body part - schema: - $ref: '#/components/schemas/SmContextUpdateError' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/SmContextUpdateError' - binaryDataN1SmMessage: - type: string - format: binary - binaryDataN2SmInformation: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1SmMessage: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - binaryDataN2SmInformation: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - '404': - description: unsuccessful update of an SM context - not found - content: - application/json: # message without binary body part - schema: - $ref: '#/components/schemas/SmContextUpdateError' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/SmContextUpdateError' - binaryDataN1SmMessage: - type: string - format: binary - binaryDataN2SmInformation: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1SmMessage: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - binaryDataN2SmInformation: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - description: unsuccessful update of an SM context - Internal server error - content: - application/json: # message without binary body part - schema: - $ref: '#/components/schemas/SmContextUpdateError' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/SmContextUpdateError' - binaryDataN1SmMessage: - type: string - format: binary - binaryDataN2SmInformation: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1SmMessage: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - binaryDataN2SmInformation: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - '503': - description: unsuccessful update of an SM context - Service Unavailable - content: - application/json: # message without binary body part - schema: - $ref: '#/components/schemas/SmContextUpdateError' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/SmContextUpdateError' - binaryDataN1SmMessage: - type: string - format: binary - binaryDataN2SmInformation: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1SmMessage: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - binaryDataN2SmInformation: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - - /sm-contexts/{smContextRef}/release: - post: - summary: Release SM Context - tags: - - Individual SM context - operationId: ReleaseSmContext - parameters: - - name: smContextRef - in: path - description: SM context reference - required: true - schema: - type: string - requestBody: - description: representation of the data to be sent to the SMF when releasing the SM context - required: false - content: - application/json: # message without binary body part - schema: - $ref: '#/components/schemas/SmContextReleaseData' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/SmContextReleaseData' - binaryDataN2SmInformation: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN2SmInformation: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - - responses: - '204': - description: successful release of an SM context without content in the response - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - - - /pdu-sessions: - post: - summary: Create - tags: - - PDU sessions collection - operationId: PostPduSessions - requestBody: - description: representation of the PDU session to be created in the H-SMF - required: true - content: - application/json: # message without binary body part - schema: - $ref: '#/components/schemas/PduSessionCreateData' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/PduSessionCreateData' - binaryDataN1SmInfoFromUe: - type: string - format: binary - binaryDataUnknownN1SmInfo: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1SmInfoFromUe: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - binaryDataUnknownN1SmInfo: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - callbacks: - statusNotification: - '{$request.body#/vsmfPduSessionUri}': - post: - summary: Notify Status - tags: - - Individual PDU session (V-SMF) - operationId: NotifyStatus - requestBody: - description: representation of the status notification - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/StatusNotification' - responses: - '204': - description: successful notificationof the status change - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - - - update: - '{$request.body#/vsmfPduSessionUri}/modify': - post: - summary: Update (initiated by H-SMF) - tags: - - Individual PDU session (V-SMF) - operationId: ModifyPduSession - requestBody: - description: representation of updates to apply to the PDU session - required: true - content: - application/+json: # message without binary body part - schema: - $ref: '#/components/schemas/VsmfUpdateData' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/VsmfUpdateData' - binaryDataN1SmInfoToUe: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1SmInfoToUe: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - responses: - '200': - description: successful update of a PDU session with content in the response - content: - application/json: # message without binary body part - schema: - $ref: '#/components/schemas/VsmfUpdatedData' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/VsmfUpdatedData' - binaryDataN1SmInfoFromUe: - type: string - format: binary - binaryDataUnknownN1SmInfo: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1SmInfoFromUe: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - binaryDataUnknownN1SmInfo: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - '204': - description: successful update of a PDU session without content in the response - '400': - $ref: '#/components/responses/VsmfUpdateError' - '403': - $ref: '#/components/responses/VsmfUpdateError' - '404': - $ref: '#/components/responses/VsmfUpdateError' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: '#/components/responses/VsmfUpdateError' - '503': - $ref: '#/components/responses/VsmfUpdateError' - '504': - $ref: '#/components/responses/VsmfUpdateError' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - - responses: - '201': - description: successful creation of a PDU session - content: - application/json: # message without binary body part - schema: - $ref: '#/components/schemas/PduSessionCreatedData' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/PduSessionCreatedData' - binaryDataN1SmInfoToUe: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1SmInfoToUe: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - headers: - Location: - description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nsmf-pdusession/{apiVersion}/pdu-sessions/{pduSessionRef}' - required: true - schema: - type: string - '307': - description: temporary redirect - headers: - Location: - description: 'An alternative URI of the resource located on an alternative service instance within the SMF that was selected by the AMF' - required: true - schema: - type: string - '308': - description: permanent redirect - headers: - Location: - description: 'An alternative URI of the resource located on an alternative service instance within the SMF that was selected by the AMF' - required: true - schema: - type: string - '400': - $ref: '#/components/responses/PduSessionCreateError' - '403': - $ref: '#/components/responses/PduSessionCreateError' - '404': - $ref: '#/components/responses/PduSessionCreateError' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: '#/components/responses/PduSessionCreateError' - '503': - $ref: '#/components/responses/PduSessionCreateError' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - - /pdu-sessions/{pduSessionRef}/modify: - post: - summary: Update (initiated by V-SMF) - tags: - - Individual PDU session (H-SMF) - operationId: UpdatePduSession - parameters: - - name: pduSessionRef - in: path - description: PDU session reference - required: true - schema: - type: string - requestBody: - description: representation of the updates to apply to the PDU session - required: true - content: - application/json: # message without binary body part - schema: - $ref: '#/components/schemas/HsmfUpdateData' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/HsmfUpdateData' - binaryDataN1SmInfoFromUe: - type: string - format: binary - binaryDataUnknownN1SmInfo: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1SmInfoFromUe: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - binaryDataUnknownN1SmInfo: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - responses: - '200': - description: successful update of a PDU session with content in the response - content: - application/json: # message without binary body part - schema: - $ref: '#/components/schemas/HsmfUpdatedData' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/HsmfUpdatedData' - binaryDataN1SmInfoToUe: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1SmInfoToUe: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - '204': - description: successful update of a PDU session without content in the response - '400': - $ref: '#/components/responses/HsmfUpdateError' - '403': - $ref: '#/components/responses/HsmfUpdateError' - '404': - $ref: '#/components/responses/HsmfUpdateError' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: '#/components/responses/HsmfUpdateError' - '503': - $ref: '#/components/responses/HsmfUpdateError' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - - /pdu-sessions/{pduSessionRef}/release: - post: - summary: Release - tags: - - Individual PDU session (H-SMF) - operationId: ReleasePduSession - parameters: - - name: pduSessionRef - in: path - description: PDU session reference - required: true - schema: - type: string - requestBody: - description: representation of the data to be sent to H-SMF when releasing the PDU session - required: false - content: - application/json: - schema: - $ref: '#/components/schemas/ReleaseData' - responses: - '204': - description: successful release of a PDU session - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - -components: - securitySchemes: - oAuth2ClientCredentials: - type: oauth2 - flows: - clientCredentials: - tokenUrl: '{nrfApiRoot}/oauth2/token' - scopes: - nsmf-pdusession: Access to the nsmf-pdusession API - - schemas: -# -# STRUCTURED DATA TYPES -# - SmContextCreateData: - type: object - properties: - supi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - unauthenticatedSupi: - type: boolean - default: false - pei: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' - gpsi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' - pduSessionId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' - dnn: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' - sNssai: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - hplmnSnssai: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - servingNfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - guami: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' - serviceName: - $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' - servingNetwork: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' - requestType: - $ref: '#/components/schemas/RequestType' - n1SmMsg: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' - anType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - secondAnType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - ratType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' - presenceInLadn: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceState' - ueLocation: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - ueTimeZone: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' - addUeLocation: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - smContextStatusUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - hSmfUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - additionalHsmfUri: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - minItems: 1 - oldPduSessionId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' - pduSessionsActivateList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' - minItems: 1 - ueEpsPdnConnection: - $ref: '#/components/schemas/EpsPdnCnxContainer' - hoState: - $ref: '#/components/schemas/HoState' - pcfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - nrfUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - selMode: - $ref: '#/components/schemas/DnnSelectionMode' - backupAmfInfo: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/BackupAmfInfo' - minItems: 1 - traceData: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' - udmGroupId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' - routingIndicator: - type: string - epsInterworkingInd: - $ref: '#/components/schemas/EpsInterworkingIndication' - indirectForwardingFlag: - type: boolean - targetId: - $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/NgRanTargetId' - epsBearerCtxStatus: - $ref: '#/components/schemas/EpsBearerContextStatus' - cpCiotEnabled: - type: boolean - default: false - invokeNef: - type: boolean - default: false - maPduIndication: - type: boolean - default: false - n2SmInfo: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' - smContextRef: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - required: - - servingNfId - - servingNetwork - - anType - - smContextStatusUri - - SmContextCreatedData: - type: object - properties: - hSmfUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - pduSessionId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' - sNssai: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - upCnxState: - $ref: '#/components/schemas/UpCnxState' - n2SmInfo: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' - n2SmInfoType: - $ref: '#/components/schemas/N2SmInfoType' - allocatedEbiList: - type: array - items: - $ref: '#/components/schemas/EbiArpMapping' - minItems: 1 - hoState: - $ref: '#/components/schemas/HoState' - gpsi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' - smfServiceInstanceId: - type: string - recoveryTime: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - - SmContextUpdateData: - type: object - properties: - pei: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' - servingNfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - guami: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' - servingNetwork: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' - backupAmfInfo: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/BackupAmfInfo' - minItems: 1 - nullable: true - anType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - secondAnType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - ratType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' - presenceInLadn: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceState' - ueLocation: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - ueTimeZone: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' - addUeLocation: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - upCnxState: - $ref: '#/components/schemas/UpCnxState' - hoState: - $ref: '#/components/schemas/HoState' - toBeSwitched: - type: boolean - default: false - failedToBeSwitched: - type: boolean - n1SmMsg: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' - n2SmInfo: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' - n2SmInfoType: - $ref: '#/components/schemas/N2SmInfoType' - targetId: - $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/NgRanTargetId' - targetServingNfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - smContextStatusUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - dataForwarding: - type: boolean - default: false - epsBearerSetup: - type: array - items: - $ref: '#/components/schemas/EpsBearerContainer' - minItems: 0 - revokeEbiList: - type: array - items: - $ref: '#/components/schemas/EpsBearerId' - minItems: 1 - release: - type: boolean - default: false - cause: - $ref: '#/components/schemas/Cause' - ngApCause: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' - 5gMmCauseValue: - $ref: 'TS29571_CommonData.yaml#/components/schemas/5GMmCause' - sNssai: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - traceData: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' - epsInterworkingInd: - $ref: '#/components/schemas/EpsInterworkingIndication' - anTypeCanBeChanged: - type: boolean - default: false - n2SmInfoExt1: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' - n2SmInfoTypeExt1: - $ref: '#/components/schemas/N2SmInfoType' - maReleaseInd: - $ref: '#/components/schemas/MaReleaseIndication' - exemptionInd: - $ref: '#/components/schemas/ExemptionInd' - - SmContextUpdatedData: - type: object - properties: - upCnxState: - $ref: '#/components/schemas/UpCnxState' - hoState: - $ref: '#/components/schemas/HoState' - releaseEbiList: - type: array - items: - $ref: '#/components/schemas/EpsBearerId' - minItems: 1 - allocatedEbiList: - type: array - items: - $ref: '#/components/schemas/EbiArpMapping' - minItems: 1 - modifiedEbiList: - type: array - items: - $ref: '#/components/schemas/EbiArpMapping' - minItems: 1 - n1SmMsg: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' - n2SmInfo: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' - n2SmInfoType: - $ref: '#/components/schemas/N2SmInfoType' - epsBearerSetup: - type: array - items: - $ref: '#/components/schemas/EpsBearerContainer' - minItems: 1 - dataForwarding: - type: boolean - cause: - $ref: '#/components/schemas/Cause' - - SmContextReleaseData: - type: object - properties: - cause: - $ref: '#/components/schemas/Cause' - ngApCause: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' - 5gMmCauseValue: - $ref: 'TS29571_CommonData.yaml#/components/schemas/5GMmCause' - ueLocation: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - ueTimeZone: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' - addUeLocation: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - vsmfReleaseOnly: - type: boolean - default: false - n2SmInfo: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' - n2SmInfoType: - $ref: '#/components/schemas/N2SmInfoType' - ismfReleaseOnly: - type: boolean - default: false - - SmContextStatusNotification: - type: object - properties: - statusInfo : - $ref: '#/components/schemas/StatusInfo' - required: - - statusInfo - - PduSessionCreateData: - type: object - properties: - supi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - unauthenticatedSupi: - type: boolean - default: false - pei: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' - pduSessionId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' - dnn: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' - sNssai: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - vsmfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - servingNetwork: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' - requestType: - $ref: '#/components/schemas/RequestType' - epsBearerId: - type: array - items: - $ref: '#/components/schemas/EpsBearerId' - minItems: 1 - pgwS8cFteid: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' - vsmfPduSessionUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - vcnTunnelInfo: - $ref: '#/components/schemas/TunnelInfo' - anType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - secondAnType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - ratType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' - ueLocation: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - ueTimeZone: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' - addUeLocation: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - gpsi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' - n1SmInfoFromUe: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' - unknownN1SmInfo: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - hPcfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - hoPreparationIndication: - type: boolean - selMode: - $ref: '#/components/schemas/DnnSelectionMode' - alwaysOnRequested: - type: boolean - default: false - udmGroupId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' - routingIndicator: - type: string - epsInterworkingInd: - $ref: '#/components/schemas/EpsInterworkingIndication' - vSmfServiceInstanceId: - type: string - recoveryTime: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - roamingChargingProfile: - $ref: 'TS32291_Nchf_ConvergedCharging.yaml#/components/schemas/RoamingChargingProfile' - chargingId: - type: string - oldPduSessionId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' - epsBearerCtxStatus: - $ref: '#/components/schemas/EpsBearerContextStatus' - amfNfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - guami: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' - cpCiotEnabled: - type: boolean - default: false - invokeNef: - type: boolean - default: false - maPduIndication: - type: boolean - default: false - required: - - dnn - - vsmfId - - servingNetwork - - vsmfPduSessionUri - - anType - - PduSessionCreatedData: - type: object - properties: - pduSessionType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' - sscMode: - type: string - pattern: '^[0-7]$' - hcnTunnelInfo: - $ref: '#/components/schemas/TunnelInfo' - sessionAmbr: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' - qosFlowsSetupList: - type: array - items: - $ref: '#/components/schemas/QosFlowSetupItem' - minItems: 1 - hSmfInstanceId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - pduSessionId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' - sNssai: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - enablePauseCharging: - type: boolean - default: false - ueIpv4Address: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' - ueIpv6Prefix: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' - n1SmInfoToUe: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' - epsPdnCnxInfo: - $ref: '#/components/schemas/EpsPdnCnxInfo' - epsBearerInfo: - type: array - items: - $ref: '#/components/schemas/EpsBearerInfo' - minItems: 1 - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - maxIntegrityProtectedDataRate: - $ref: '#/components/schemas/MaxIntegrityProtectedDataRate' - alwaysOnGranted: - type: boolean - default: false - gpsi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' - upSecurity: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UpSecurity' - roamingChargingProfile: - $ref: 'TS32291_Nchf_ConvergedCharging.yaml#/components/schemas/RoamingChargingProfile' - hSmfServiceInstanceId: - type: string - recoveryTime: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - required: - - pduSessionType - - sscMode - - hSmfInstanceId - - HsmfUpdateData: - type: object - properties: - requestIndication: - $ref: '#/components/schemas/RequestIndication' - pei: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' - vcnTunnelInfo: - $ref: '#/components/schemas/TunnelInfo' - servingNetwork: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' - anType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - secondAnType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - ratType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' - ueLocation: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - ueTimeZone: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' - addUeLocation: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - pauseCharging: - type: boolean - pti: - $ref: '#/components/schemas/ProcedureTransactionId' - n1SmInfoFromUe: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' - unknownN1SmInfo: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' - qosFlowsRelNotifyList: - type: array - items: - $ref: '#/components/schemas/QosFlowItem' - minItems: 1 - qosFlowsNotifyList: - type: array - items: - $ref: '#/components/schemas/QosFlowNotifyItem' - minItems: 1 - NotifyList: - type: array - items: - $ref: '#/components/schemas/PduSessionNotifyItem' - minItems: 1 - epsBearerId: - type: array - items: - $ref: '#/components/schemas/EpsBearerId' - minItems: 0 - hoPreparationIndication: - type: boolean - revokeEbiList: - type: array - items: - $ref: '#/components/schemas/EpsBearerId' - minItems: 1 - cause: - $ref: '#/components/schemas/Cause' - ngApCause: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' - 5gMmCauseValue: - $ref: 'TS29571_CommonData.yaml#/components/schemas/5GMmCause' - alwaysOnRequested: - type: boolean - default: false - epsInterworkingInd: - $ref: '#/components/schemas/EpsInterworkingIndication' - secondaryRatUsageReport: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SecondaryRatUsageReport' - minItems: 1 - secondaryRatUsageInfo: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SecondaryRatUsageInfo' - minItems: 1 - anTypeCanBeChanged: - type: boolean - default: false - maReleaseInd: - $ref: '#/components/schemas/MaReleaseIndication' - required: - - requestIndication - - HsmfUpdatedData: - type: object - properties: - n1SmInfoToUe: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' - - ReleaseData: - type: object - properties: - cause: - $ref: '#/components/schemas/Cause' - ngApCause: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' - 5gMmCauseValue: - $ref: 'TS29571_CommonData.yaml#/components/schemas/5GMmCause' - ueLocation: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - ueTimeZone: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' - addUeLocation: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - secondaryRatUsageReport: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SecondaryRatUsageReport' - minItems: 1 - secondaryRatUsageInfo: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SecondaryRatUsageInfo' - minItems: 1 - - - VsmfUpdateData: - type: object - properties: - requestIndication: - $ref: '#/components/schemas/RequestIndication' - sessionAmbr: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' - qosFlowsAddModRequestList: - type: array - items: - $ref: '#/components/schemas/QosFlowAddModifyRequestItem' - minItems: 1 - qosFlowsRelRequestList: - type: array - items: - $ref: '#/components/schemas/QosFlowReleaseRequestItem' - minItems: 1 - epsBearerInfo: - type: array - items: - $ref: '#/components/schemas/EpsBearerInfo' - minItems: 1 - assignEbiList: - type: array - items: - $ref: '#/components/schemas/EpsBearerId' - minItems: 1 - revokeEbiList: - type: array - items: - $ref: '#/components/schemas/EpsBearerId' - minItems: 1 - modifiedEbiList: - type: array - items: - $ref: '#/components/schemas/EbiArpMapping' - minItems: 1 - pti: - $ref: '#/components/schemas/ProcedureTransactionId' - n1SmInfoToUe: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' - alwaysOnGranted: - type: boolean - default: false - hsmfPduSessionUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - cause: - $ref: '#/components/schemas/Cause' - n1smCause: - type: string - backOffTimer: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' - maReleaseInd: - $ref: '#/components/schemas/MaReleaseIndication' - required: - - requestIndication - - VsmfUpdatedData: - type: object - properties: - qosFlowsAddModList: - type: array - items: - $ref: '#/components/schemas/QosFlowItem' - minItems: 1 - qosFlowsRelList: - type: array - items: - $ref: '#/components/schemas/QosFlowItem' - minItems: 1 - qosFlowsFailedtoAddModList: - type: array - items: - $ref: '#/components/schemas/QosFlowItem' - minItems: 1 - qosFlowsFailedtoRelList: - type: array - items: - $ref: '#/components/schemas/QosFlowItem' - minItems: 1 - n1SmInfoFromUe: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' - unknownN1SmInfo: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' - ueLocation: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - ueTimeZone: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' - addUeLocation: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - assignedEbiList: - type: array - items: - $ref: '#/components/schemas/EbiArpMapping' - minItems: 1 - failedToAssignEbiList: - type: array - items: - $ref: '#/components/schemas/EpsBearerId' - minItems: 1 - releasedEbiList: - type: array - items: - $ref: '#/components/schemas/EpsBearerId' - minItems: 1 - secondaryRatUsageReport: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SecondaryRatUsageReport' - minItems: 1 - secondaryRatUsageInfo: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SecondaryRatUsageInfo' - minItems: 1 - - StatusNotification: - type: object - properties: - statusInfo : - $ref: '#/components/schemas/StatusInfo' - required: - - statusInfo - - QosFlowItem: - type: object - properties: - qfi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Qfi' - cause: - $ref: '#/components/schemas/Cause' - required: - - qfi - - QosFlowSetupItem: - type: object - properties: - qfi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Qfi' - qosRules: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' - ebi: - $ref: '#/components/schemas/EpsBearerId' - qosFlowDescription: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' - qosFlowProfile: - $ref: '#/components/schemas/QosFlowProfile' - required: - - qfi - - qosRules - - QosFlowAddModifyRequestItem: - type: object - properties: - qfi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Qfi' - ebi: - $ref: '#/components/schemas/EpsBearerId' - qosRules: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' - qosFlowDescription: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' - qosFlowProfile: - $ref: '#/components/schemas/QosFlowProfile' - required: - - qfi - - QosFlowReleaseRequestItem: - type: object - properties: - qfi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Qfi' - qosRules: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' - qosFlowDescription: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' - required: - - qfi - - QosFlowProfile: - type: object - properties: - 5qi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/5Qi' - nonDynamic5Qi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NonDynamic5Qi' - dynamic5Qi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dynamic5Qi' - arp: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' - gbrQosFlowInfo: - $ref: '#/components/schemas/GbrQosFlowInformation' - rqa: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ReflectiveQoSAttribute' - additionalQosFlowInfo: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AdditionalQosFlowInfo' - required: - - 5qi - - GbrQosFlowInformation: - type: object - properties: - maxFbrDl: - $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' - maxFbrUl: - $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' - guaFbrDl: - $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' - guaFbrUl: - $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' - notifControl: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NotificationControl' - maxPacketLossRateDl: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRate' - maxPacketLossRateUl: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRate' - required: - - maxFbrDl - - maxFbrUl - - guaFbrDl - - guaFbrUl - - QosFlowNotifyItem: - type: object - properties: - qfi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Qfi' - notificationCause: - $ref: '#/components/schemas/NotificationCause' - required: - - qfi - - notificationCause - - - SmContextRetrieveData: - type: object - properties: - targetMmeCap: - $ref: '#/components/schemas/MmeCapabilities' - smContextType: - $ref: '#/components/schemas/SmContextType' - - SmContextRetrievedData: - type: object - properties: - ueEpsPdnConnection: - $ref: '#/components/schemas/EpsPdnCnxContainer' - smContext: - $ref: '#/components/schemas/SmContext' - required: - - ueEpsPdnConnection - - MmeCapabilities: - type: object - properties: - nonIpSupported: - type: boolean - default: false - - TunnelInfo: - type: object - properties: - ipv4Addr: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' - ipv6Addr: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' - gtpTeid: - $ref: '#/components/schemas/Teid' - required: - - gtpTeid - - StatusInfo: - type: object - properties: - resourceStatus: - $ref: '#/components/schemas/ResourceStatus' - cause: - $ref: '#/components/schemas/Cause' - required: - - resourceStatus - - - EpsPdnCnxInfo: - type: object - properties: - pgwS8cFteid: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' - pgwNodeName: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' - required: - - pgwS8cFteid - - EpsBearerInfo: - type: object - properties: - ebi: - $ref: '#/components/schemas/EpsBearerId' - pgwS8uFteid: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' - bearerLevelQoS: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' - required: - - ebi - - pgwS8uFteid - - bearerLevelQoS - - PduSessionNotifyItem: - type: object - properties: - notificationCause: - $ref: '#/components/schemas/NotificationCause' - required: - - notificationCause - - EbiArpMapping: - type: object - properties: - epsBearerId: - $ref: '#/components/schemas/EpsBearerId' - arp: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' - required: - - epsBearerId - - arp - - SmContextCreateError: - type: object - properties: - error: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - n1SmMsg: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' - recoveryTime: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - required: - - error - - SmContextUpdateError: - type: object - properties: - error: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - n1SmMsg: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' - n2SmInfo: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' - n2SmInfoType: - $ref: '#/components/schemas/N2SmInfoType' - upCnxState: - $ref: '#/components/schemas/UpCnxState' - recoveryTime: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - required: - - error - - PduSessionCreateError: - type: object - properties: - error: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - n1smCause: - type: string - pattern: '^[A-F0-9]{2}$' - n1SmInfoToUe: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' - backOffTimer: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' - recoveryTime: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - required: - - error - - HsmfUpdateError: - type: object - properties: - error: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - pti: - $ref: '#/components/schemas/ProcedureTransactionId' - n1smCause: - type: string - pattern: '^[A-F0-9]{2}$' - n1SmInfoToUe: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' - backOffTimer: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' - recoveryTime: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - required: - - error - - VsmfUpdateError: - type: object - properties: - error: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - pti: - $ref: '#/components/schemas/ProcedureTransactionId' - n1smCause: - type: string - pattern: '^[A-F0-9]{2}$' - n1SmInfoFromUe: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' - unknownN1SmInfo: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' - failedToAssignEbiList: - type: array - items: - $ref: '#/components/schemas/EpsBearerId' - minItems: 1 - ngApCause: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' - 5gMmCauseValue: - $ref: 'TS29571_CommonData.yaml#/components/schemas/5GMmCause' - recoveryTime: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - required: - - error - - SmContext: - type: object - properties: - supi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - unauthenticatedSupi: - type: boolean - default: false - pei: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' - gpsi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' - pduSessionId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' - dnn: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' - sNssai: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - hplmnSnssai: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - servingNfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - guami: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' - serviceName: - $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' - servingNetwork: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' - anType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - ratType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' - smContextStatusUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - hSmfUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - pcfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - selMode: - $ref: '#/components/schemas/DnnSelectionMode' - traceData: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' - udmGroupId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' - routingIndicator: - type: string - epsInterworkingInd: - $ref: '#/components/schemas/EpsInterworkingIndication' - pduSessionType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' - sscMode: - type: string - pattern: '^[0-7]$' - sessionAmbr: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' - qosFlowsSetupList: - type: array - items: - $ref: '#/components/schemas/QosFlowSetupItem' - minItems: 1 - hSmfInstanceId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - enablePauseCharging: - type: boolean - default: false - ueIpv4Address: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' - ueIpv6Prefix: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' - epsPdnCnxInfo: - $ref: '#/components/schemas/EpsPdnCnxInfo' - epsBearerInfo: - type: array - items: - $ref: '#/components/schemas/EpsBearerInfo' - minItems: 1 - maxIntegrityProtectedDataRate: - $ref: '#/components/schemas/MaxIntegrityProtectedDataRate' - alwaysOnGranted: - type: boolean - default: false - upSecurity: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UpSecurity' - hSmfServiceInstanceId: - type: string - recoveryTime: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - required: - - pduSessionId - - dnn - - sNssai - - servingNfId - - servingNetwork - - anType - - smContextStatusUri - - pduSessionType - - sscMode - - sessionAmbr - - qosFlowsSetupList - - ExemptionInd: - type: object - properties: - dnnCongestion: - type: boolean - default: false - snssaiOnlyCongestion: - type: boolean - default: false - snssaiDnnCongestion: - type: boolean - default: false - -# -# SIMPLE DATA TYPES -# - ProcedureTransactionId: - type: integer - minimum: 0 - maximum: 255 - - EpsBearerId: - type: integer - minimum: 0 - maximum: 15 - - EpsPdnCnxContainer: - type: string - - EpsBearerContainer: - type: string - - Teid: - type: string - pattern: '^[A-F0-9]{8}$' - - EpsBearerContextStatus: - type: string - pattern: '^[A-Fa-f0-9]{4}$' -# -# ENUMERATIONS -# - UpCnxState: - anyOf: - - type: string - enum: - - ACTIVATED - - DEACTIVATED - - ACTIVATING - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - ACTIVATED - - DEACTIVATED - - ACTIVATING - - HoState: - anyOf: - - type: string - enum: - - NONE - - PREPARING - - PREPARED - - COMPLETED - - CANCELLED - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - NONE - - PREPARING - - PREPARED - - COMPLETED - - CANCELLED - - RequestType: - anyOf: - - type: string - enum: - - INITIAL_REQUEST - - EXISTING_PDU_SESSION - - INITIAL_EMERGENCY_REQUEST - - EXISTING_EMERGENCY_PDU_SESSION - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - INITIAL_REQUEST - - EXISTING_PDU_SESSION - - INITIAL_EMERGENCY_REQUEST - - EXISTING_EMERGENCY_PDU_SESSION - - RequestIndication: - anyOf: - - type: string - enum: - - UE_REQ_PDU_SES_MOD - - UE_REQ_PDU_SES_REL - - PDU_SES_MOB - - NW_REQ_PDU_SES_AUTH - - NW_REQ_PDU_SES_MOD - - NW_REQ_PDU_SES_REL - - EBI_ASSIGNMENT_REQ - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - UE_REQ_PDU_SES_MOD - - UE_REQ_PDU_SES_REL - - PDU_SES_MOB - - NW_REQ_PDU_SES_AUTH - - NW_REQ_PDU_SES_MOD - - NW_REQ_PDU_SES_REL - - EBI_ASSIGNMENT_REQ - - NotificationCause: - anyOf: - - type: string - enum: - - QOS_FULFILLED - - QOS_NOT_FULFILLED - - UP_SEC_FULFILLED - - UP_SEC_NOT_FULFILLED - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - QOS_FULFILLED - - QOS_NOT_FULFILLED - - UP_SEC_FULFILLED - - UP_SEC_NOT_FULFILLED - - Cause: - anyOf: - - type: string - enum: - - 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 - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - 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 - - ResourceStatus: - anyOf: - - type: string - enum: - - RELEASED - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - RELEASED - - DnnSelectionMode: - anyOf: - - type: string - enum: - - VERIFIED - - UE_DNN_NOT_VERIFIED - - NW_DNN_NOT_VERIFIED - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - VERIFIED - - UE_DNN_NOT_VERIFIED - - NW_DNN_NOT_VERIFIED - - EpsInterworkingIndication: - anyOf: - - type: string - enum: - - NONE - - WITH_N26 - - WITHOUT_N26 - - IWK_NON_3GPP - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - NONE - - WITH_N26 - - WITHOUT_N26 - - IWK_NON_3GPP - - N2SmInfoType: - anyOf: - - type: string - enum: - - PDU_RES_SETUP_REQ - - PDU_RES_SETUP_RSP - - PDU_RES_SETUP_FAIL - - PDU_RES_REL_CMD - - PDU_RES_REL_RSP - - PDU_RES_MOD_REQ - - PDU_RES_MOD_RSP - - PDU_RES_MOD_FAIL - - PDU_RES_NTY - - PDU_RES_NTY_REL - - PDU_RES_MOD_IND - - PDU_RES_MOD_CFM - - PATH_SWITCH_REQ - - PATH_SWITCH_SETUP_FAIL - - PATH_SWITCH_REQ_ACK - - PATH_SWITCH_REQ_FAIL - - HANDOVER_REQUIRED - - HANDOVER_CMD - - HANDOVER_PREP_FAIL - - HANDOVER_REQ_ACK - - HANDOVER_RES_ALLOC_FAIL - - SECONDARY_RAT_USAGE - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - PDU_RES_SETUP_REQ - - PDU_RES_SETUP_RSP - - PDU_RES_SETUP_FAIL - - PDU_RES_REL_CMD - - PDU_RES_REL_RSP - - PDU_RES_MOD_REQ - - PDU_RES_MOD_RSP - - PDU_RES_MOD_FAIL - - PDU_RES_NTY - - PDU_RES_NTY_REL - - PDU_RES_MOD_IND - - PDU_RES_MOD_CFM - - PATH_SWITCH_REQ - - PATH_SWITCH_SETUP_FAIL - - PATH_SWITCH_REQ_ACK - - PATH_SWITCH_REQ_FAIL - - HANDOVER_REQUIRED - - HANDOVER_CMD - - HANDOVER_PREP_FAIL - - HANDOVER_REQ_ACK - - HANDOVER_RES_ALLOC_FAIL - - SECONDARY_RAT_USAGE - - MaxIntegrityProtectedDataRate: - anyOf: - - type: string - enum: - - 64_KBPS - - MAX_UE_RATE - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - 64_KBPS - - MAX_UE_RATE - - MaReleaseIndication: - anyOf: - - type: string - enum: - - REL_MAPDU_OVER_3GPP - - REL_MAPDU_OVER_N3GPP - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - REL_MAPDU_OVER_3GPP - - REL_MAPDU_OVER_N3GPP - - SmContextType: - anyOf: - - type: string - enum: - - EPS_PDN_CONNECTION - - SM_CONTEXT - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - EPS_PDN_CONNECTION - - SM_CONTEXT - -# -# HTTP responses -# - responses: - 'PduSessionCreateError': - description: unsuccessful creation of a PDU session - content: - application/json: # message without binary body part - schema: - $ref: '#/components/schemas/PduSessionCreateError' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/PduSessionCreateError' - binaryDataN1SmInfoToUe: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1SmInfoToUe: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - - 'HsmfUpdateError': - description: unsuccessful update of a PDU session - content: - application/json: # message without binary body part - schema: - $ref: '#/components/schemas/HsmfUpdateError' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/HsmfUpdateError' - binaryDataN1SmInfoToUe: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1SmInfoToUe: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - - 'VsmfUpdateError': - description: unsuccessful update of a PDU session - content: - application/json: # message without binary body part - schema: - $ref: '#/components/schemas/VsmfUpdateError' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/VsmfUpdateError' - binaryDataN1SmInfoFromUe: - type: string - format: binary - binaryDataUnknownN1SmInfo: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1SmInfoFromUe: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - binaryDataUnknownN1SmInfo: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string diff --git a/lib/sbi/support/3gpp-spec/TS29503_Nudm_EE.yaml b/lib/sbi/support/3gpp-spec/TS29503_Nudm_EE.yaml deleted file mode 100644 index 0274ead747..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29503_Nudm_EE.yaml +++ /dev/null @@ -1,8 +0,0 @@ -openapi: 3.0.0 - -info: - version: '1.1.0.alpha-1' - title: 'Nudm_EE' - description: | - Nudm Event Exposure Service. - \ No newline at end of file diff --git a/lib/sbi/support/3gpp-spec/TS29503_Nudm_NIDDAU.yaml b/lib/sbi/support/3gpp-spec/TS29503_Nudm_NIDDAU.yaml deleted file mode 100644 index 5efdc40ec7..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29503_Nudm_NIDDAU.yaml +++ /dev/null @@ -1,120 +0,0 @@ -openapi: 3.0.0 - -info: - version: '1.0.0.alpha-1' - title: 'Nudm_NIDDAU' - description: 'Nudm NIDD Authorization Service' - -externalDocs: - description: 3GPP TS 29.503 Unified Data Management Services, version 16.0.0 - url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' - -servers: - - url: '{apiRoot}/nudm-niddau/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in subclause subclause 4.4 of 3GPP TS 29.501. - -security: - - oAuth2ClientCredentials: - - nudm-niddau - - {} - -paths: - /{ueIdentity}/authorization: - get: - summary: retrieve multiple data sets - operationId: GetAuthorizationData - tags: - - Retrieval of multiple data sets - parameters: - - name: ueIdentity - in: path - description: Represents the scope of the UE for which the NIDD Authorizations are retrieved. Contains the GPSI of the user or the external group ID. - required: true - schema: - type: string - pattern: '^(msisdn-[0-9]{5,15}|.+|extid-[^@]+@[^@]+|extgroupid-[^@]+@[^@]+)$' - - name: supported-features - in: query - description: Supported Features - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - - name: nssai - in: query - content: - application/json: - schema: - $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/Nssai' - - name: dnn - in: query - description: DNN - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' - - name: mtcProviderInformation - in: query - description: mtcProviderInformation - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' - - name: If-None-Match - in: header - description: Validator for conditional requests, as described in RFC 7232, 3.2 - schema: - type: string - responses: - '200': - description: Expected response to a valid request - content: - application/json: - schema: - $ref: '#/components/schemas/AuthorizationData' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - default: - description: Unexpected error - - -components: - securitySchemes: - oAuth2ClientCredentials: - type: oauth2 - flows: - clientCredentials: - tokenUrl: '{nrfApiRoot}/oauth2/token' - scopes: - nudm-niddau: Access to the nudm-niddau API - - schemas: - -# COMPLEX TYPES: -# - AuthorizationData: - type: array - items: - $ref: '#/components/schemas/UserIdentifier' - minItems: 1 - uniqueItems: true - - UserIdentifier: - type: object - required: - - supi - properties: - supi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - gpsi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' - - - - -# SIMPLE TYPES: - - - -# ENUMS: - - diff --git a/lib/sbi/support/3gpp-spec/TS29503_Nudm_PP.yaml b/lib/sbi/support/3gpp-spec/TS29503_Nudm_PP.yaml deleted file mode 100644 index 2b1ee1a675..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29503_Nudm_PP.yaml +++ /dev/null @@ -1,8 +0,0 @@ -openapi: 3.0.0 - -info: - version: '1.0.1' - title: 'Nudm_PP' - description: | - Nudm Parameter Provision Service. - \ No newline at end of file diff --git a/lib/sbi/support/3gpp-spec/TS29503_Nudm_SDM.yaml b/lib/sbi/support/3gpp-spec/TS29503_Nudm_SDM.yaml deleted file mode 100644 index a34ec3bcc3..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29503_Nudm_SDM.yaml +++ /dev/null @@ -1,8 +0,0 @@ -openapi: 3.0.0 - -info: - version: '2.1.0.alpha-1' - title: 'Nudm_SDM' - description: | - Nudm Subscriber Data Management Service. - \ No newline at end of file diff --git a/lib/sbi/support/3gpp-spec/TS29503_Nudm_UEAU.yaml b/lib/sbi/support/3gpp-spec/TS29503_Nudm_UEAU.yaml deleted file mode 100644 index 637714f4f7..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29503_Nudm_UEAU.yaml +++ /dev/null @@ -1,7 +0,0 @@ -openapi: 3.0.0 -info: - version: '1.0.1' - title: 'NudmUEAU' - description: | - UDM UE Authentication Service. - \ No newline at end of file diff --git a/lib/sbi/support/3gpp-spec/TS29503_Nudm_UECM.yaml b/lib/sbi/support/3gpp-spec/TS29503_Nudm_UECM.yaml deleted file mode 100644 index a9cba6a003..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29503_Nudm_UECM.yaml +++ /dev/null @@ -1,8 +0,0 @@ -openapi: 3.0.0 - -info: - version: '1.0.2' - title: 'Nudm_UECM' - description: | - Nudm Context Management Service. - \ No newline at end of file diff --git a/lib/sbi/support/3gpp-spec/TS29504_Nudr_DR.yaml b/lib/sbi/support/3gpp-spec/TS29504_Nudr_DR.yaml deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/sbi/support/3gpp-spec/TS29507_Npcf_AMPolicyControl.yaml b/lib/sbi/support/3gpp-spec/TS29507_Npcf_AMPolicyControl.yaml deleted file mode 100644 index 4333ea606d..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29507_Npcf_AMPolicyControl.yaml +++ /dev/null @@ -1,586 +0,0 @@ -openapi: 3.0.0 -info: - version: 1.1.0.alpha-4 - title: Npcf_AMPolicyControl - description: | - Access and Mobility Policy Control Service. - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. -externalDocs: - description: 3GPP TS 29.507 V16.3.0; 5G System; Access and Mobility Policy Control Service. - url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.507/' -servers: - - url: '{apiRoot}/npcf-am-policy-control/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in subclause subclause 4.4 of 3GPP TS 29.501 -security: - - {} - - oAuth2ClientCredentials: - - npcf-am-policy-control -paths: - /policies: - post: - operationId: CreateIndividualAMPolicyAssociation - summary: Create individual AM policy association. - tags: - - AM Policy Associations (Collection) - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/PolicyAssociationRequest' - responses: - '201': - description: Created - content: - application/json: - schema: - $ref: '#/components/schemas/PolicyAssociation' - headers: - Location: - description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/npcf-am-policy-control/v1/policies/{polAssoId}' - required: true - schema: - type: string - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - callbacks: - policyUpdateNotification: - '{$request.body#/notificationUri}/update': - post: - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/PolicyUpdate' - responses: - '204': - description: No Content, Notification was succesfull - '307': - description: temporary redirect - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - policyAssocitionTerminationRequestNotification: - '{$request.body#/notificationUri}/terminate': - post: - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/TerminationNotification' - responses: - '204': - description: No Content, Notification was succesfull - '307': - description: temporary redirect - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - /policies/{polAssoId}: - get: - operationId: ReadIndividualAMPolicyAssociation - summary: Read individual AM policy association. - tags: - - Individual AM Policy Association (Document) - parameters: - - name: polAssoId - in: path - description: Identifier of a policy association - required: true - schema: - type: string - responses: - '200': - description: OK. Resource representation is returned - content: - application/json: - schema: - $ref: '#/components/schemas/PolicyAssociation' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '406': - $ref: 'TS29571_CommonData.yaml#/components/responses/406' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - delete: - operationId: DeleteIndividualAMPolicyAssociation - summary: Delete individual AM policy association. - tags: - - Individual AM Policy Association (Document) - parameters: - - name: polAssoId - in: path - description: Identifier of a policy association - required: true - schema: - type: string - responses: - '204': - description: No Content. Resource was succesfully deleted - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - /policies/{polAssoId}/update: - post: - operationId: ReportObservedEventTriggersForIndividualAMPolicyAssociation - summary: Report obeserved event triggers and obtain updated policies for an individual AM policy association. - tags: - - Individual AM Policy Association (Document) - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/PolicyAssociationUpdateRequest' - parameters: - - name: polAssoId - in: path - description: Identifier of a policy association - required: true - schema: - type: string - responses: - '200': - description: OK. Updated policies are returned - content: - application/json: - schema: - $ref: '#/components/schemas/PolicyUpdate' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' -components: - securitySchemes: - oAuth2ClientCredentials: - type: oauth2 - flows: - clientCredentials: - tokenUrl: '{nrfApiRoot}/oauth2/token' - scopes: - npcf-am-policy-control: Access to the Npcf_AMPolicyControl API - schemas: - PolicyAssociation: - type: object - properties: - request: - $ref: '#/components/schemas/PolicyAssociationRequest' - triggers: - type: array - items: - $ref: '#/components/schemas/RequestTrigger' - minItems: 1 - description: Request Triggers that the PCF subscribes. Only values "LOC_CH" and "PRA_CH" are permitted. - servAreaRes: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' - wlServAreaRes: - $ref: 'TS29571_CommonData.yaml#/components/schemas/WirelineServiceAreaRestriction' - rfsp: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndex' - smfSelInfo: - $ref: '#/components/schemas/SmfSelectionData' - ueAmbr: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' - rgTmbr: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' - pras: - type: object - additionalProperties: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' - minProperties: 1 - suppFeat: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - suppFeat - PolicyAssociationRequest: - description: Information which the NF service consumer provides when requesting the creation of a policy association. The serviveName property corresponds to the serviceName in the main body of the specification. - type: object - properties: - notificationUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - altNotifIpv4Addrs: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' - minItems: 1 - description: Alternate or backup IPv4 Address(es) where to send Notifications. - altNotifIpv6Addrs: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' - minItems: 1 - description: Alternate or backup IPv6 Address(es) where to send Notifications. - supi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - gpsi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' - accessType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - accessTypes: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - minItems: 1 - pei: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' - userLoc: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - timeZone: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' - servingPlmn: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' - ratType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' - ratTypes: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' - minItems: 1 - groupIds: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' - minItems: 1 - servAreaRes: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' - wlServAreaRes: - $ref: 'TS29571_CommonData.yaml#/components/schemas/WirelineServiceAreaRestriction' - rfsp: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndex' - ueAmbr: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' - rgTmbr: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' - allowedSnssais: - description: array of allowed S-NSSAIs for the 3GPP access. - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - minItems: 1 - mappingSnssais: - description: mapping of each S-NSSAI of the Allowed NSSAI to the corresponding S-NSSAI of the HPLMN. - type: array - items: - $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/MappingOfSnssai' - minItems: 1 - n3gAllowedSnssais: - description: array of allowed S-NSSAIs for the Non-3GPP access. - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - minItems: 1 - guami: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' - serviveName: - $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' - traceReq: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' - suppFeat: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - notificationUri - - suppFeat - - supi - PolicyAssociationUpdateRequest: - type: object - properties: - notificationUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - altNotifIpv4Addrs: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' - minItems: 1 - description: Alternate or backup IPv4 Address(es) where to send Notifications. - altNotifIpv6Addrs: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' - minItems: 1 - description: Alternate or backup IPv6 Address(es) where to send Notifications. - triggers: - type: array - items: - $ref: '#/components/schemas/RequestTrigger' - minItems: 1 - description: Request Triggers that the NF service consumer observes. - servAreaRes: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' - wlServAreaRes: - $ref: 'TS29571_CommonData.yaml#/components/schemas/WirelineServiceAreaRestriction' - rfsp: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndex' - smfSelInfo: - $ref: '#/components/schemas/SmfSelectionData' - ueAmbr: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' - rgTmbr: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' - praStatuses: - type: object - additionalProperties: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' - minProperties: 1 - description: Map of PRA status information. - userLoc: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - allowedSnssais: - description: array of allowed S-NSSAIs for the 3GPP access. - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - minItems: 1 - mappingSnssais: - description: mapping of each S-NSSAI of the Allowed NSSAI to the corresponding S-NSSAI of the HPLMN. - type: array - items: - $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/MappingOfSnssai' - minItems: 1 - accessTypes: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - minItems: 1 - ratTypes: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' - minItems: 1 - n3gAllowedSnssais: - description: array of allowed S-NSSAIs for the Non-3GPP access. - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - minItems: 1 - traceReq: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' - guami: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' - PolicyUpdate: - type: object - properties: - resourceUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - triggers: - type: array - items: - $ref: '#/components/schemas/RequestTrigger' - minItems: 1 - nullable: true - description: Request Triggers that the PCF subscribes. Only values "LOC_CH" and "PRA_CH" are permitted. - servAreaRes: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' - wlServAreaRes: - $ref: 'TS29571_CommonData.yaml#/components/schemas/WirelineServiceAreaRestriction' - rfsp: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndex' - smfSelInfo: - $ref: '#/components/schemas/SmfSelectionData' - ueAmbr: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' - rgTmbr: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' - pras: - type: object - additionalProperties: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfoRm' - description: Map of PRA information. - minProperties: 1 - nullable: true - required: - - resourceUri - TerminationNotification: - type: object - properties: - resourceUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - cause: - $ref: '#/components/schemas/PolicyAssociationReleaseCause' - required: - - resourceUri - - cause - SmfSelectionData: - type: object - properties: - unsuppDnn: - type: boolean - candidates: - type: object - additionalProperties: - $ref: '#/components/schemas/CandidateForReplacement' - minProperties: 1 - nullable: true - snssai: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - mappingSnssai: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - dnn: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' - nullable: true - CandidateForReplacement: - type: object - properties: - snssai: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - dnns: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' - minItems: 1 - nullable: true - required: - - snssai - nullable: true - RequestTrigger: - anyOf: - - type: string - enum: - - LOC_CH - - PRA_CH - - SERV_AREA_CH - - RFSP_CH - - ALLOWED_NSSAI_CH - - UE_AMBR_CH - - SMF_SELECT_CH - - ACCESS_TYPE_CH - - RG_TMBR_CH - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - LOC_CH: Location change (tracking area). The tracking area of the UE has changed. - - PRA_CH: Change of UE presence in PRA. The UE is entering/leaving a Presence Reporting Area. - - SERV_AREA_CH: Service Area Restriction change. The UDM notifies the AMF that the subscribed service area restriction information has changed. - - RFSP_CH: RFSP index change. The UDM notifies the AMF that the subscribed RFSP index has changed. - - ALLOWED_NSSAI_CH: Allowed NSSAI change. The AMF notifies that the set of UE allowed S-NSSAIs has changed. - - UE_AMBR_CH: UE-AMBR change. The UDM notifies the AMF that the subscribed UE-AMBR has changed. - - SMF_SELECT_CH: SMF selection information change. The UE requested for an unsupported DNN or UE requested for a DNN within the list of DNN candidates for replacement per S-NSSAI. - - ACCESS_TYPE_CH: Access Type change. The the AMF notifies that the access type and the RAT type combinations available in the AMF for a UE with simultaneous 3GPP and non-3GPP connectivity has changed. - - RG_TMBR_CH: Subscribed RG-TMBR change. The UDM notifies the AMF that the subscribed RG-TMBR has changed. - PolicyAssociationReleaseCause: - anyOf: - - type: string - enum: - - UNSPECIFIED - - UE_SUBSCRIPTION - - INSUFFICIENT_RES - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - UNSPECIFIED: This value is used for unspecified reasons. - - UE_SUBSCRIPTION: This value is used to indicate that the session needs to be terminated because the subscription of UE has changed (e.g. was removed). - - INSUFFICIENT_RES: This value is used to indicate that the server is overloaded and needs to abort the session. diff --git a/lib/sbi/support/3gpp-spec/TS29508_Nsmf_EventExposure.yaml b/lib/sbi/support/3gpp-spec/TS29508_Nsmf_EventExposure.yaml deleted file mode 100644 index a0b9302af3..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29508_Nsmf_EventExposure.yaml +++ /dev/null @@ -1,545 +0,0 @@ -openapi: 3.0.0 -info: - version: 1.1.0.alpha-4 - title: Nsmf_EventExposure - description: | - Session Management Event Exposure Service. - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. -externalDocs: - description: 3GPP TS 29.508 V16.3.0; 5G System; Session Management Event Exposure Service. - url: http://www.3gpp.org/ftp/Specs/archive/29_series/29.508/ -servers: - - url: '{apiRoot}/nsmf_event-exposure/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in subclause 4.4 of 3GPP TS 29.501 -security: - - {} - - oAuth2ClientCredentials: - - nsmf-event-exposure -paths: - /subscriptions: - post: - operationId: CreateIndividualSubcription - summary: Create an individual subscription for event notifications from the SMF - tags: - - Subscriptions (Collection) - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/NsmfEventExposure' - responses: - '201': - description: Success - headers: - Location: - description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nsmf-event-exposure/v1/subscriptions/{subId}' - required: true - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/NsmfEventExposure' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - callbacks: - myNotification: - '{$request.body#/notifUri}': - post: - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/NsmfEventExposureNotification' - responses: - '204': - description: No Content, Notification was succesfull - '307': - description: temporary redirect - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - callbacks: - afAcknowledgement: - '{request.body#/ackUri}': - post: - requestBody: # contents of the callback message - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/AckOfNotify' - responses: - '204': - description: No Content (successful acknowledgement) - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - /subscriptions/{subId}: - get: - operationId: GetIndividualSubcription - summary: Read an individual subscription for event notifications from the SMF - tags: - - IndividualSubscription (Document) - parameters: - - name: subId - in: path - description: Event Subscription ID - required: true - schema: - type: string - responses: - '200': - description: OK. Resource representation is returned - content: - application/json: - schema: - $ref: '#/components/schemas/NsmfEventExposure' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '406': - $ref: 'TS29571_CommonData.yaml#/components/responses/406' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - put: - operationId: ReplaceIndividualSubcription - summary: Replace an individual subscription for event notifications from the SMF - tags: - - IndividualSubscription (Document) - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/NsmfEventExposure' - parameters: - - name: subId - in: path - description: Event Subscription ID - required: true - schema: - type: string - responses: - '200': - description: OK. Resource was succesfully modified and representation is returned - content: - application/json: - schema: - $ref: '#/components/schemas/NsmfEventExposure' - '204': - description: No Content. Resource was succesfully modified - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - delete: - operationId: DeleteIndividualSubcription - summary: Delete an individual subscription for event notifications from the SMF - tags: - - IndividualSubscription (Document) - parameters: - - name: subId - in: path - description: Event Subscription ID - required: true - schema: - type: string - responses: - '204': - description: No Content. Resource was succesfully deleted - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' -components: - securitySchemes: - oAuth2ClientCredentials: - type: oauth2 - flows: - clientCredentials: - tokenUrl: '{nrfApiRoot}/oauth2/token' - scopes: - nsmf-event-exposure: Access to the Nsmf_EventExposure API - schemas: - NsmfEventExposure: - description: Represents an Individual SMF Notification Subscription resource. The serviveName property corresponds to the serviceName in the main body of the specification. - type: object - properties: - supi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - gpsi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' - anyUeInd: - type: boolean - description: Any UE indication. This IE shall be present if the event subscription is applicable to any UE. Default value "FALSE" is used, if not present. - groupId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' - pduSeId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' - subId: - $ref: '#/components/schemas/SubId' - notifId: - type: string - description: Notification Correlation ID assigned by the NF service consumer. - notifUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - altNotifIpv4Addrs: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' - description: Alternate or backup IPv4 Addess(es) where to send Notifications. - minItems: 1 - altNotifIpv6Addrs: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' - description: Alternate or backup IPv6 Addess(es) where to send Notifications. - minItems: 1 - eventSubs: - type: array - items: - $ref: '#/components/schemas/EventSubscription' - minItems: 1 - description: Subscribed events - ImmeRep: - type: boolean - notifMethod: - $ref: '#/components/schemas/NotificationMethod' - maxReportNbr: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' - expiry: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - repPeriod: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' - guami: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' - serviveName: - $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - sampRatio: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' - grpRepTime: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' - required: - - notifId - - notifUri - - eventSubs - NsmfEventExposureNotification: - type: object - properties: - notifId: - type: string - description: Notification correlation ID - eventNotifs: - type: array - items: - $ref: '#/components/schemas/EventNotification' - minItems: 1 - description: Notifications about Individual Events - ackUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - required: - - notifId - - eventNotifs - EventSubscription: - type: object - properties: - event: - $ref: '#/components/schemas/SmfEvent' - dnaiChgType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DnaiChangeType' - dddTraDescriptors: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DddTrafficDescriptor' - minItems: 1 - dddStati: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DlDataDeliveryStatus' - minItems: 1 - appIds: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' - minItems: 1 - required: - - event - EventNotification: - type: object - properties: - event: - $ref: '#/components/schemas/SmfEvent' - timeStamp: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - supi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - gpsi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' - sourceDnai: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' - targetDnai: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' - dnaiChgType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DnaiChangeType' - sourceUeIpv4Addr: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' - sourceUeIpv6Prefix: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' - targetUeIpv4Addr: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' - targetUeIpv6Prefix: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' - sourceTraRouting: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' - targetTraRouting: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' - ueMac: - $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' - adIpv4Addr: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' - adIpv6Prefix: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' - reIpv4Addr: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' - reIpv6Prefix: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' - plmnId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' - accType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - pduSeId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' - dddStatus: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DlDataDeliveryStatus' - dddTraDescriptor: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DddTrafficDescriptor' - maxWaitTime: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - commFailure: - $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/CommunicationFailure' - ipv4Addr: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' - ipv6Prefixes: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' - minItems: 1 - ipv6Addrs: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' - minItems: 1 - pduSessType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' - qfi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Qfi' - appId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' - ethfDescs: - type: array - items: - $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' - minItems: 1 - maxItems: 2 - fDescs: - type: array - items: - $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/FlowDescription' - minItems: 1 - maxItems: 2 - dnn: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' - snssai: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - ulDelays: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' - minItems: 1 - dlDelays: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' - minItems: 1 - rtDelays: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' - minItems: 1 - required: - - event - - timeStamp - SubId: - type: string - format: SubId - description: Identifies an Individual SMF Notification Subscription. To enable that the value is used as part of a URI, the string shall only contain characters allowed according to the "lower-with-hyphen" naming convention defined in 3GPP TS 29.501 [2]. In an OpenAPI [10] schema, the format shall be designated as "SubId". - AckOfNotify: - type: object - properties: - notifId: - type: string - ackResult: - $ref: 'TS29522_TrafficInfluence.yaml#/components/schemas/AfResultInfo' - supi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - gpsi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' - required: - - notifId - - ackResult - SmfEvent: - anyOf: - - type: string - enum: - - AC_TY_CH - - UP_PATH_CH - - PDU_SES_REL - - PLMN_CH - - UE_IP_CH - - DDDS - - COMM_FAIL - - PDU_SES_EST - - QFI_ALLOC - - QOS_MON - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - AC_TY_CH: Access Type Change - - UP_PATH_CH: UP Path Change - - PDU_SES_REL: PDU Session Release - - PLMN_CH: PLMN Change - - UE_IP_CH: UE IP address change - - DDDS: Downlink data delivery status - - COMM_FAIL: Communication Failure - - PDU_SES_EST: PDU Session Establishment - - QFI_ALLOC: QFI allocation - - QOS_MON: QoS Monitoring - NotificationMethod: - anyOf: - - type: string - enum: - - PERIODIC - - ONE_TIME - - ON_EVENT_DETECTION - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - PERIODIC - - ONE_TIME - - ON_EVENT_DETECTION diff --git a/lib/sbi/support/3gpp-spec/TS29521_Nbsf_Management.yaml b/lib/sbi/support/3gpp-spec/TS29521_Nbsf_Management.yaml deleted file mode 100644 index d672f60eb9..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29521_Nbsf_Management.yaml +++ /dev/null @@ -1,382 +0,0 @@ -openapi: 3.0.0 -info: - version: 1.1.0.alpha-4 - title: Nbsf_Management - description: | - Binding Support Management Service API. - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. -externalDocs: - description: 3GPP TS 29.521 V16.3.0; 5G System; Binding Support Management Service. - url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.521/' -servers: - - url: '{apiRoot}/nbsf-management/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in subclause 4.4 of 3GPP TS 29.501. -security: - - {} - - oAuth2ClientCredentials: - - nbsf-management -paths: - /pcfBindings: - post: - summary: Create a new Individual PCF binding information - operationId: CreatePCFBinding - tags: - - PCF Bindings (Collection) - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/PcfBinding' - responses: - '201': - description: The creation of an individual PCF session binding. - content: - application/json: - schema: - $ref: '#/components/schemas/PcfBinding' - headers: - Location: - description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nbsf-management/v1/pcfBindings/{bindingId}' - required: true - schema: - type: string - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - description: The existing PCF binding information stored in the BSF for the indicated combination is returned. - content: - application/json: - schema: - $ref: '#/components/schemas/ExtProblemDetails' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - get: - summary: Read PCF Bindings information - operationId: GetPCFBindings - tags: - - PCF Bindings (Collection) - parameters: - - name: ipv4Addr - in: query - description: The IPv4 Address of the served UE. - required: false - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' - - name: ipv6Prefix - in: query - description: The IPv6 Address of the served UE. The NF service consumer shall append '/128' to the IPv6 address in the attribute value. E.g. '2001:db8:85a3::8a2e:370:7334/128'. - required: false - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' - - name: macAddr48 - in: query - description: The MAC Address of the served UE. - required: false - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' - - name: dnn - in: query - description: DNN. - required: false - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' - - name: supi - in: query - description: Subscription Permanent Identifier. - required: false - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - - name: gpsi - in: query - description: Generic Public Subscription Identifier - required: false - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' - - name: snssai - in: query - description: The identification of slice. - required: false - content: - application/json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - - name: ipDomain - in: query - description: The IPv4 address domain identifier. - required: false - schema: - type: string - - name: supp-feat - in: query - description: To filter irrelevant responses related to unsupported features - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - responses: - '200': - description: The individual PCF session binding session binding information resource matching the query parameter(s) is returned. - content: - application/json: - schema: - $ref: '#/components/schemas/PcfBinding' - '204': - description: There is no PCF session binding information matching the query parameter(s). - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '406': - $ref: 'TS29571_CommonData.yaml#/components/responses/406' - '414': - $ref: 'TS29571_CommonData.yaml#/components/responses/414' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - /pcfBindings/{bindingId}: - delete: - summary: Delete an existing Individual PCF Binding information - operationId: DeleteIndPCFBinding - tags: - - Individual PCF Binding (Document) - parameters: - - name: bindingId - in: path - description: Represents the individual PCF Session Binding. - required: true - schema: - type: string - responses: - '204': - description: No Content. The Individual PCF session binding information resource is deleted. - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - patch: - summary: Update an existing Individual PCF Binding information - operationId: UpdateIndPCFBinding - tags: - - Individual PCF Binding (Document) - parameters: - - name: bindingId - in: path - description: Represents the individual PCF Session Binding. - required: true - schema: - type: string - requestBody: - description: Parameters to update the existing session binding - required: true - content: - application/merge-patch+json: - schema: - $ref: '#/components/schemas/PcfBindingPatch' - responses: - '200': - description: OK (Successful update of the session binding) - content: - application/json: - schema: - $ref: '#/components/schemas/PcfBinding' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' -components: - securitySchemes: - oAuth2ClientCredentials: - type: oauth2 - flows: - clientCredentials: - tokenUrl: '{nrfApiRoot}/oauth2/token' - scopes: - nbsf-management: Access to the Nbsf_Management API - schemas: - PcfBinding: - type: object - properties: - supi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - gpsi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' - ipv4Addr: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' - ipv6Prefix: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' - addIpv6Prefixes: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' - minItems: 1 - description: The additional IPv6 Address Prefixes of the served UE. - ipDomain: - type: string - macAddr48: - $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' - addMacAddrs: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' - minItems: 1 - description: The additional MAC Addresses of the served UE. - dnn: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' - pcfFqdn: - $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/Fqdn' - pcfIpEndPoints: - type: array - items: - $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IpEndPoint' - minItems: 1 - description: IP end points of the PCF hosting the Npcf_PolicyAuthorization service. - pcfDiamHost: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' - pcfDiamRealm: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' - pcfSmFqdn: - $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/Fqdn' - pcfSmIpEndPoints: - type: array - items: - $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IpEndPoint' - minItems: 1 - description: IP end points of the PCF hosting the Npcf_SMPolicyControl service. - snssai: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - suppFeat: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - pcfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - pcfSetId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' - recoveryTime: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - paraCom: - $ref: '#/components/schemas/ParameterCombination' - required: - - dnn - - snssai - oneOf: - - anyOf: - - required: [ipv4Addr] - - required: [ipv6Prefix] - - required: [addIpv6Prefixes] - - anyOf: - - required: [macAddr48] - - required: [addMacAddrs] - anyOf: - - anyOf: - - required: [pcfFqdn] - - required: [pcfIpEndPoints] - - required: [pcfDiamHost, pcfDiamRealm] - PcfBindingPatch: - type: object - properties: - ipv4Addr: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4AddrRm' - ipDomain: - type: string - nullable: true - ipv6Prefix: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6PrefixRm' - addIpv6Prefixes: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' - minItems: 1 - description: The additional IPv6 Address Prefixes of the served UE. - nullable: true - macAddr48: - $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48Rm' - addMacAddrs: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' - minItems: 1 - description: The additional MAC Addresses of the served UE. - nullable: true - pcfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - ParameterCombination: - type: object - properties: - supi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - dnn: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' - snssai: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - ExtProblemDetails: - allOf: - - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - - $ref: '#/components/schemas/BindingResp' - BindingResp: - type: object - properties: - pcfSmFqdn: - $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/Fqdn' - pcfSmIpEndPoints: - type: array - items: - $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IpEndPoint' - minItems: 1 - description: IP end points of the PCF hosting the Npcf_SMPolicyControl service. diff --git a/lib/sbi/support/3gpp-spec/TS29523_Npcf_EventExposure.yaml b/lib/sbi/support/3gpp-spec/TS29523_Npcf_EventExposure.yaml deleted file mode 100644 index 7f672a5e37..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29523_Npcf_EventExposure.yaml +++ /dev/null @@ -1,425 +0,0 @@ -openapi: 3.0.0 -info: - version: 1.1.0.alpha-1 - title: Npcf_EventExposure - description: | - PCF Event Exposure Service. - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. - -externalDocs: - description: 3GPP TS 29.523 V16.0.0; 5G System; Policy Control Event Exposure Service; Stage 3. - url: http://www.3gpp.org/ftp/Specs/archive/29_series/29.523/ - -servers: - - url: '{apiRoot}/npcf-eventexposure/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in subclause 4.4 of 3GPP TS 29.501 - -security: - - {} - - oAuth2ClientCredentials: - - npcf-eventexposure - -paths: - /subscriptions: - post: - summary: Creates a new Individual Policy Control Events Subscription resource - operationId: PostPcEventExposureSubsc - tags: - - Policy Control Events Subscription (Collection) - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/PcEventExposureSubsc' - responses: - '201': - description: Success - content: - application/json: - schema: - $ref: '#/components/schemas/PcEventExposureSubsc' - headers: - Location: - description: 'Contains the URI of the created individual policy control events subscription resource, according to the structure: {apiRoot}/npcf-eventexposure/v1/subscriptions/{subscriptionId}' - required: true - schema: - type: string - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - callbacks: - PcEventNotification: - '{$request.body#/notifUri}': - post: - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/PcEventExposureNotif' - responses: - '204': - description: No Content, Notification was succesfull - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - /subscriptions/{subscriptionId}: - get: - summary: "Reads an existing Individual Policy Control Events Subscription" - operationId: GetPcEventExposureSubsc - tags: - - Individual Policy Control Events Subscription (Document) - parameters: - - name: subscriptionId - in: path - description: Policy Control Event Subscription ID - required: true - schema: - type: string - responses: - '200': - description: OK. Resource representation is returned - content: - application/json: - schema: - $ref: '#/components/schemas/PcEventExposureSubsc' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '406': - $ref: 'TS29571_CommonData.yaml#/components/responses/406' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - put: - summary: "Modifies an existing Individual Policy Control Events Subscription " - operationId: PutPcEventExposureSubsc - tags: - - Individual Policy Control Events Subscription (Document) - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/PcEventExposureSubsc' - parameters: - - name: subscriptionId - in: path - description: Policy Control Event Subscription ID - required: true - schema: - type: string - responses: - '200': - description: OK. Resource was succesfully modified and representation is returned - content: - application/json: - schema: - $ref: '#/components/schemas/PcEventExposureSubsc' - '204': - description: No Content. Resource was succesfully modified - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - delete: - summary: "Cancels an existing Individual Policy Control Events Subscription " - operationId: DeletePcEventExposureSubsc - tags: - - Individual Policy Control Events Subscription (Document) - parameters: - - name: subscriptionId - in: path - description: Policy Control Event Subscription ID - required: true - schema: - type: string - responses: - '204': - description: No Content. Resource was succesfully deleted - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - - -components: - securitySchemes: - oAuth2ClientCredentials: - type: oauth2 - flows: - clientCredentials: - tokenUrl: '{nrfApiRoot}/oauth2/token' - scopes: - npcf-eventexposure: Access to the Npcf_EventExposure API. - - schemas: - - PcEventExposureNotif: - type: object - properties: - notifId: - type: string - eventNotifs: - type: array - items: - $ref: '#/components/schemas/PcEventNotification' - minItems: 1 - required: - - notifId - - eventNotifs - - - PcEventExposureSubsc: - type: object - properties: - eventSubs: - type: array - items: - $ref: '#/components/schemas/PcEvent' - minItems: 1 - eventsRepInfo: - $ref: '#/components/schemas/ReportingInformation' - groupId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' - filterDnns: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' - minItems: 1 - filterSnssais: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - minItems: 1 - filterServices: - type: array - items: - $ref: '#/components/schemas/ServiceIdentification' - minItems: 1 - notifUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - notifId: - type: string - suppFeat: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - eventSubs - - notifId - - notifUri - - ReportingInformation: - type: object - properties: - immRep: - type: boolean - notifMethod: - $ref: 'TS29508_Nsmf_EventExposure.yaml#/components/schemas/NotificationMethod' - maxReportNbr: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' - monDur: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - repPeriod: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' - sampRatio: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' - grpRepTime: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' - - ServiceIdentification: - type: object - properties: - servEthFlows: - type: array - items: - $ref: '#/components/schemas/EthernetFlowInfo' - minItems: 1 - servIpFlows: - type: array - items: - $ref: '#/components/schemas/IpFlowInfo' - minItems: 1 - afAppId: - $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/AfAppId' - # All conditions in allOf must be met - allOf: - # First condition is that servEthFlows and servIpFlows are mutually exclusive - - not: - required: [servEthFlows, servIpFlows] - # Second condition is that at least one the servEthFlows, servIpFlows and afAppId shall be present - - anyOf: - - required: [servEthFlows] - - required: [servIpFlows] - - required: [afAppId] - - EthernetFlowInfo: - type: object - properties: - ethFlows: - type: array - items: - $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' - minItems: 1 - maxItems: 2 - flowNumber: - type: integer - required: - - flowNumber - - IpFlowInfo: - type: object - properties: - ipFlows: - type: array - items: - $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/FlowDescription' - minItems: 1 - maxItems: 2 - flowNumber: - type: integer - required: - - flowNumber - - PcEventNotification: - type: object - properties: - event: - $ref: '#/components/schemas/PcEvent' - accType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - anGwAddr: - $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/AnGwAddress' - ratType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' - plmnId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' - supi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - gpsi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' - timeStamp: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - pduSessionInfo: - $ref: '#/components/schemas/PduSessionInformation' - repServices: - $ref: '#/components/schemas/ServiceIdentification' - required: - - event - - timeStamp - - PduSessionInformation: - type: object - properties: - snssai: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - dnn: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' - ueIpv4: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' - ueIpv6: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' - ipDomain: - type: string - ueMac: - $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' - required: - - snssai - - dnn - oneOf: - - required: [ueMac] - - anyOf: - - required: [ueIpv4] - - required: [ueIpv6] - -# Simple data types and Enumerations - - PcEvent: - anyOf: - - type: string - enum: - - AC_TY_CH - - PLMN_CH - - type: string \ No newline at end of file diff --git a/lib/sbi/support/3gpp-spec/TS29525_Npcf_UEPolicyControl.yaml b/lib/sbi/support/3gpp-spec/TS29525_Npcf_UEPolicyControl.yaml deleted file mode 100644 index 152bcba938..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29525_Npcf_UEPolicyControl.yaml +++ /dev/null @@ -1,501 +0,0 @@ -openapi: 3.0.0 -info: - version: 1.1.0.alpha-4 - title: Npcf_UEPolicyControl - description: | - UE Policy Control Service. - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. -externalDocs: - description: 3GPP TS 29.525 V16.3.0; 5G System; UE Policy Control Service. - url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.525/' -servers: - - url: '{apiRoot}/npcf-ue-policy-control/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in subclause subclause 4.4 of 3GPP TS 29.501 -security: - - {} - - oAuth2ClientCredentials: - - npcf-ue-policy-control -paths: - /policies: - post: - operationId: CreateIndividualUEPolicyAssociation - summary: Create individual UE policy association. - tags: - - UE Policy Associations (Collection) - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/PolicyAssociationRequest' - responses: - '201': - description: Created - content: - application/json: - schema: - $ref: '#/components/schemas/PolicyAssociation' - headers: - Location: - description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/npcf-ue-policy-control/v1/policies/{polAssoId}' - required: true - schema: - type: string - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - callbacks: - policyUpdateNotification: - '{$request.body#/notificationUri}/update': - post: - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/PolicyUpdate' - responses: - '204': - description: No Content, Notification was succesfull - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - policyAssocitionTerminationRequestNotification: - '{$request.body#/notificationUri}/terminate': - post: - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/TerminationNotification' - responses: - '204': - description: No Content, Notification was succesfull - '307': - description: temporary redirect - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - /policies/{polAssoId}: - get: - operationId: ReadIndividualUEPolicyAssociation - summary: Read individual UE policy association. - tags: - - Individual UE Policy Association (Document) - parameters: - - name: polAssoId - in: path - description: Identifier of a policy association - required: true - schema: - type: string - responses: - '200': - description: OK. Resource representation is returned - content: - application/json: - schema: - $ref: '#/components/schemas/PolicyAssociation' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '406': - $ref: 'TS29571_CommonData.yaml#/components/responses/406' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - delete: - operationId: DeleteIndividualUEPolicyAssociation - summary: Delete individual UE policy association. - tags: - - Individual UE Policy Association (Document) - parameters: - - name: polAssoId - in: path - description: Identifier of a policy association - required: true - schema: - type: string - responses: - '204': - description: No Content. Resource was succesfully deleted - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - /policies/{polAssoId}/update: - post: - operationId: ReportObservedEventTriggersForIndividualUEPolicyAssociation - summary: Report obeserved event triggers and possibly obtain updated policies for an individual UE policy association. - tags: - - Individual UE Policy Association (Document) - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/PolicyAssociationUpdateRequest' - parameters: - - name: polAssoId - in: path - description: Identifier of a policy association - required: true - schema: - type: string - responses: - '200': - description: OK. Updated policies are returned - content: - application/json: - schema: - $ref: '#/components/schemas/PolicyUpdate' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' -components: - securitySchemes: - oAuth2ClientCredentials: - type: oauth2 - flows: - clientCredentials: - tokenUrl: '{nrfApiRoot}/oauth2/token' - scopes: - npcf-ue-policy-control: Access to the Npcf_AMPolicyControl API - schemas: - PolicyAssociation: - type: object - properties: - request: - $ref: '#/components/schemas/PolicyAssociationRequest' - uePolicy: - $ref: '#/components/schemas/UePolicy' - n2Pc5Pol: - $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/N2InfoContent' - triggers: - type: array - items: - $ref: '#/components/schemas/RequestTrigger' - minItems: 1 - description: Request Triggers that the PCF subscribes. Only values "LOC_CH" and "PRA_CH" are permitted. - pras: - type: object - additionalProperties: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' - minProperties: 1 - suppFeat: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - suppFeat - PolicyAssociationRequest: - type: object - properties: - notificationUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - altNotifIpv4Addrs: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' - minItems: 1 - description: Alternate or backup IPv4 Address(es) where to send Notifications. - altNotifIpv6Addrs: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' - minItems: 1 - description: Alternate or backup IPv6 Address(es) where to send Notifications. - supi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - gpsi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' - accessType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - pei: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' - userLoc: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - timeZone: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' - servingPlmn: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' - ratType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' - groupIds: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' - minItems: 1 - hPcfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - uePolReq: - $ref: '#/components/schemas/UePolicyRequest' - guami: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' - serviceName: - $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' - servingNfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - pc5Capab: - $ref: '#/components/schemas/Pc5Capability' - suppFeat: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - notificationUri - - suppFeat - - supi - PolicyAssociationUpdateRequest: - type: object - properties: - notificationUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - altNotifIpv4Addrs: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' - minItems: 1 - description: Alternate or backup IPv4 Address(es) where to send Notifications. - altNotifIpv6Addrs: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' - minItems: 1 - description: Alternate or backup IPv6 Address(es) where to send Notifications. - triggers: - type: array - items: - $ref: '#/components/schemas/RequestTrigger' - minItems: 1 - description: Request Triggers that the NF service consumer observes. - praStatuses: - type: object - additionalProperties: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' - description: Map of PRA status information. - minProperties: 1 - userLoc: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - uePolDelResult: - $ref: '#/components/schemas/UePolicyDeliveryResult' - uePolTransFailNotif: - $ref: '#/components/schemas/UePolicyTransferFailureNotification' - uePolReq: - $ref: '#/components/schemas/UePolicyRequest' - guami: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' - servingNfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - plmnId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' - connectState: - $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/CmState' - PolicyUpdate: - type: object - properties: - resourceUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - uePolicy: - $ref: '#/components/schemas/UePolicy' - n2Pc5Pol: - $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/N2InfoContent' - triggers: - type: array - items: - $ref: '#/components/schemas/RequestTrigger' - minItems: 1 - nullable: true - description: Request Triggers that the PCF subscribes. Only values "LOC_CH" and "PRA_CH" are permitted. - pras: - type: object - additionalProperties: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' - description: Map of PRA information. - minProperties: 1 - nullable: true - required: - - resourceUri - TerminationNotification: - type: object - properties: - resourceUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - cause: - $ref: '#/components/schemas/PolicyAssociationReleaseCause' - required: - - resourceUri - - cause - UePolicyTransferFailureNotification: - type: object - properties: - cause: - $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/N1N2MessageTransferCause' - ptis: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' - minItems: 1 - required: - - cause - - ptis - UePolicy: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' - UePolicyDeliveryResult: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' - UePolicyRequest: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' - RequestTrigger: - anyOf: - - type: string - enum: - - LOC_CH - - PRA_CH - - UE_POLICY - - PLMN_CH - - CON_STATE_CH - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - LOC_CH: Location change (tracking area). The tracking area of the UE has changed. - - PRA_CH: Change of UE presence in PRA. The UE is entering/leaving a Presence Reporting Area. - - UE_POLICY: A MANAGE UE POLICY COMPLETE message or a MANAGE UE POLICY COMMAND REJECT message, as defined in Annex D.5 of 3GPP TS 24.501 or a "UE POLICY PROVISIONING REQUEST" message, as defined in subclause 7.2.1.1 of 3GPP TS 24.587 [24], has been received by the AMF and is being forwarded. - - PLMN_CH: PLMN change. the serving PLMN of UE has changed. - - CON_STATE_CH: Connectivity state change: the connectivity state of UE has changed. - PolicyAssociationReleaseCause: - anyOf: - - type: string - enum: - - UNSPECIFIED - - UE_SUBSCRIPTION - - INSUFFICIENT_RES - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - UNSPECIFIED: This value is used for unspecified reasons. - - UE_SUBSCRIPTION: This value is used to indicate that the policy association needs to be terminated because the subscription of UE has changed (e.g. was removed). - - INSUFFICIENT_RES: This value is used to indicate that the server is overloaded and needs to abort the policy association. - Pc5Capability: - anyOf: - - type: string - enum: - - LTE_PC5 - - NR_PC5 - - LTE_NR_PC5 - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - LTE_PC5: This value is used to indicate that UE supports PC5 LTE RAT for V2X communication over PC5 reference point. - - NR_PC5: This value is used to indicate that UE supports PC5 NR RAT for V2X communication over PC5 reference point. - - LTE_NR_PC5: This value is used to indicate that UE supports both PC5 LTE and NR RAT for V2X communication over PC5 reference point.. diff --git a/lib/sbi/support/3gpp-spec/TS29540_Nsmsf_SMService.yaml b/lib/sbi/support/3gpp-spec/TS29540_Nsmsf_SMService.yaml deleted file mode 100644 index a094f9df9e..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29540_Nsmsf_SMService.yaml +++ /dev/null @@ -1,269 +0,0 @@ -openapi: 3.0.0 -info: - version: '2.0.1' - title: 'Nsmsf_SMService Service API' - description: | - SMSF SMService. - ? 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. -security: - - oAuth2ClientCredentials: - - nsmsf-sms - - {} -servers: - - url: '{apiRoot}/nsmsf-sms/v2' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in subclause subclause 4.4 of 3GPP TS 29.501. -paths: - /ue-contexts/{supi}: - put: - summary: Activate SMS Service for a given UE - operationId: SMServiceActivation - tags: - - UEContext (Document) - parameters: - - name: supi - in: path - required: true - description: Subscriber Permanent Identifier (SUPI) - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UeSmsContextData' - required: true - responses: - '201': - description: UE Context for SMS is created in SMSF - content: - application/json: - schema: - $ref: '#/components/schemas/UeSmsContextData' - headers: - Location: - description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nsmsf-sms//ue-contexts/{supi}' - required: true - schema: - type: string - '204': - description: UE Context for SMS is updated in SMSF - '400': - description: Invalid Service Request - content: - application/problem+json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - '403': - description: Unable to create/update UE Context for SMS in SMSF - content: - application/problem+json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - '404': - description: Unable to found subscription for service user or UE Context for SMS in SMSF - content: - application/problem+json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - '503': - description: Service Unavailable - content: - application/problem+json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - default: - description: Unexpected error - content: - application/problem+json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - delete: - summary: Deactivate SMS Service for a given UE - operationId: SMServiceDeactivation - tags: - - UEContext (Document) - parameters: - - name: supi - in: path - required: true - description: Subscriber Permanent Identifier (SUPI) - schema: - type: string - responses: - '204': - description: UE Context for SMS is deleted from SMSF - '400': - description: Invalid Service Request - content: - application/problem+json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - '404': - description: Unable to found UE Context for SMS in SMSF - content: - application/problem+json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - '503': - description: Service Unavailable - content: - application/problem+json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - /ue-contexts/{supi}/sendsms: - post: - summary: Send SMS payload for a given UE - operationId: SendSMS - tags: - - UEContext (Document) - parameters: - - name: supi - in: path - required: true - description: Subscriber Permanent Identifier (SUPI) - schema: - type: string - requestBody: - content: - multipart/related: - schema: - type: object - properties: - jsonData: - $ref: '#/components/schemas/SmsRecordData' - binaryPayload: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryPayload: - contentType: application/vnd.3gpp.sms - headers: - Content-Id: - schema: - type: string - required: true - responses: - '200': - description: SMS payload is received by SMSF, and is being delivered out - content: - application/json: - schema: - $ref: '#/components/schemas/SmsRecordDeliveryData' - '400': - description: Invalid Service Request - content: - application/problem+json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - '403': - description: Unable to deliver SMS at SMSF - content: - application/problem+json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - '404': - description: Unable to found UE Context for SMS in SMSF - content: - application/problem+json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - '503': - description: Service Unavailable - content: - application/problem+json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' -components: - securitySchemes: - oAuth2ClientCredentials: - type: oauth2 - flows: - clientCredentials: - tokenUrl: '{nrfApiRoot}/oauth2/token' - scopes: - nsmsf-sms: Access to the nsmsf-sms API - schemas: - UeSmsContextData: - type: object - required: - - supi - - amfId - - accessType - properties: - supi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - pei: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' - amfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - guamis: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' - minItems: 1 - accessType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - gpsi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' - ueLocation: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - ueTimeZone: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' - traceData: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' - backupAmfInfo: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/BackupAmfInfo' - minItems: 1 - udmGroupId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' - routingIndicator: - type: string - SmsRecordData: - type: object - required: - - smsRecordId - - smsPayload - properties: - smsRecordId: - $ref: '#/components/schemas/RecordId' - smsPayload: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' - accessType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - gpsi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' - pei: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' - ueLocation: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - ueTimeZone: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' - RecordId: - type: string - SmsRecordDeliveryData: - type: object - required: - - smsRecordId - - deliveryStatus - properties: - smsRecordId: - $ref: '#/components/schemas/RecordId' - deliveryStatus: - $ref: '#/components/schemas/SmsDeliveryStatus' - SmsDeliveryStatus: - type: string - enum: - - SMS_DELIVERY_PENDING - - SMS_DELIVERY_COMPLETED - - SMS_DELIVERY_FAILED -externalDocs: - description: 3GPP TS 29.540 V15.3.0; 5G System; SMS Services; Stage 3 - url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.540/' diff --git a/lib/sbi/support/3gpp-spec/TS29549_SS_Events.yaml b/lib/sbi/support/3gpp-spec/TS29549_SS_Events.yaml deleted file mode 100644 index 87ef4283df..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29549_SS_Events.yaml +++ /dev/null @@ -1,263 +0,0 @@ -openapi: 3.0.0 -info: - title: SS_Events - description: | - API for SEAL Events management. - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. - version: "1.0.0.alpha-1" -externalDocs: - description: 3GPP TS 29.549 V1.1.0 Service Enabler Architecture Layer for Verticals (SEAL); Application Programming Interface (API) specification; Stage 3. - url: http://www.3gpp.org/ftp/Specs/archive/29_series/29.549/ -servers: - - url: '{apiRoot}/ss-events/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in clause 6.5 of 3GPP TS 29.549 -paths: - /subscriptions: - post: - description: Creates a new individual SEAL Event Subscription. - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/SEALEventSubscription' - callbacks: - notificationDestination: - '{request.body#/notificationDestination}': - post: - requestBody: # contents of the callback message - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/SEALEventNotification' - responses: - '204': - description: No Content (successful notification) - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29122_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29122_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29122_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - responses: - '201': - description: SEAL Events subscription resource created successfully. - content: - application/json: - schema: - $ref: '#/components/schemas/SEALEventSubscription' - headers: - Location: - description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/ss-events/v1/subscriptions/{subscriptionId}' - required: true - schema: - type: string - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29122_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29122_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29122_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - - /subscriptions/{subscriptionId}: - delete: - description: Deletes an individual SEAL Event Subscription. - parameters: - - name: subscriptionId - in: path - description: Identifier of an individual Events Subscription - required: true - schema: - type: string - responses: - '204': - description: The individual SEAL Events Subscription matching the subscriptionId is deleted. - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - -components: - schemas: - SEALEventSubscription: - type: object - properties: - subscriberId: - type: string - description: String identifying the subscriber of the event. - eventSubs: - type: array - items: - $ref: '#/components/schemas/EventSubscription' - minItems: 1 - description: Subscribed events. - eventReq: - $ref: 'TS29523_Npcf_EventExposure.yaml#/components/schemas/ReportingInformation' - notificationDestination: - $ref: 'TS29122_CommonData.yaml#/components/schemas/Uri' - requestTestNotification: - type: boolean - description: Set to true by Subscriber to request the SEAL server to send a test notification as defined in in clause 6.6. Set to false or omitted otherwise. - websockNotifConfig: - $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' - suppFeat: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - subscriberId - - eventSubs - - eventReq - - notificationDestination - SEALEventNotification: - type: object - properties: - subscriptionId: - type: string - description: Identifier of the subscription resource to which the notification is related - SEAL resource identifier - eventDetails: - type: array - items: - $ref: '#/components/schemas/SEALEventDetail' - minItems: 1 - description: Detailed notifications of individual events. - required: - - subscriptionId - - eventDetails - EventSubscription: - type: object - properties: - eventId: - $ref: '#/components/schemas/SEALEvent' - valGroups: - type: array - items: - $ref: '#/components/schemas/VALGroupFilter' - minItems: 1 - description: Each element of the array represents the VAL group identifier(s) of a VAL service that the subscriber wants to know in the interested event. This parameter shall be present only if the event subscribed is "GM_GROUP_INFO_CHANGE". - identities: - type: array - items: - $ref: '#/components/schemas/IdentityFilter' - minItems: 1 - description: Each element of the array represents the VAL User / UE IDs of a VAL service that the event subscriber wants to know in the interested event. This parameter shall be present only if the event subscribed is "CM_USER_PROFILE_CHANGE". - required: - - eventId - SEALEventDetail: - type: object - properties: - eventId: - $ref: '#/components/schemas/SEALEvent' - valGroupDocuments: - type: array - items: - $ref: 'TS29549_SS_GroupManagement.yaml#/components/schemas/VALGroupDocument' - minItems: 1 - description: The VAL groups documents with modified membership and configuration information.This parameter shall be present only if the event in event notification is "GM_GROUP_INFO_CHANGE". - profileDocs: - type: array - items: - $ref: 'TS29549_SS_UserProfileRetrieval.yaml#/components/schemas/ProfileDoc' - minItems: 1 - description: Updated profile information associated with VAL Users or VAL UEs. This parameter shall be present only if the event in event notification is "CM_USER_PROFILE_CHANGE". - required: - - eventId - VALGroupFilter: - type: object - properties: - valSvcId: - type: string - description: Identity of the VAL service - valGrpIds: - type: array - items: - type: string - minItems: 1 - description: VAL group identifiers that event subscriber wants to know in the interested event. - required: - - valGrpIds - IdentityFilter: - type: object - properties: - valSvcId: - type: string - description: Identity of the VAL service - valUserIds: - type: array - items: - type: string - minItems: 1 - description: VAL User IDs that the event subscriber wants to know in the interested event. - valUEIds: - type: array - items: - type: string - minItems: 1 - description: VAL UE IDs that the event subscriber wants to know in the interested event. - oneOf: - - required: [valUserIds] - - required: [valUEIds] - SEALEvent: - anyOf: - - type: string - enum: - - LM_LOCATION_INFO - - GM_GROUP_INFO_CHANGE - - CM_USER_PROFILE_CHANGE - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - LM_LOCATION_INFO: Events related to the location information of VAL Users or VAL UEs from the Location Management Server. - - GM_GROUP_INFO_CHANGE: Events related to the modification of VAL group membership and configuration information from the Group Management Server. - - CM_USER_PROFILE_CHANGE: Events related to update of user profile information from the Configuration Management Server. diff --git a/lib/sbi/support/3gpp-spec/TS29549_SS_GroupManagement.yaml b/lib/sbi/support/3gpp-spec/TS29549_SS_GroupManagement.yaml deleted file mode 100644 index 33ba2fd400..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29549_SS_GroupManagement.yaml +++ /dev/null @@ -1,212 +0,0 @@ -openapi: 3.0.0 -info: - title: SS_GroupManagement - description: | - API for SEAL Group management. - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. - version: "1.0.0.alpha-1" -externalDocs: - description: 3GPP TS 29.549 V1.1.0 Service Enabler Architecture Layer for Verticals (SEAL); Application Programming Interface (API) specification; Stage3. - url: http://www.3gpp.org/ftp/Specs/archive/29_series/29.549/ -servers: - - url: '{apiRoot}/group-management/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in clause 6.5 of 3GPP TS 29.549 -paths: - /group-documents: - post: - description: Creates a new VAL group document. - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/VALGroupDocument' - responses: - '201': - description: VAL group created sucessfully. - content: - application/json: - schema: - $ref: '#/components/schemas/VALGroupDocument' - headers: - Location: - description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/group-management/v1/group-documents/{groupDocId}' - required: true - schema: - type: string - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29122_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29122_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29122_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - - /group-documents/{groupDocId}: - get: - description: Retrieves VAL group information satisfying filter criteria - parameters: - - name: groupDocId - in: path - description: String identifying an individual VAL group document resource - required: true - schema: - type: string - - name: group-members - in: query - description: When set to true indicates the group management server to send the members list information of the VAL group. - schema: - type: boolean - - name: group-configuration - in: query - description: When set to true indicates the group management server to send the group configuration information of the VAL group. - schema: - type: boolean - responses: - '200': - description: The VAL group information based on the request from the VAL server. Includes VAL group members list if group-members flag is set to true in the request, VAL group configuration information if the group-configuration flag is set to true in the request, VAL group identifier, whole VAL group document resource if both group-members and group-configuration flags are omitted/set to false in the request. - content: - application/json: - schema: - $ref: '#/components/schemas/VALGroupDocument' - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '406': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - - put: - description: Updates an individual VAL group document. - parameters: - - name: groupDocId - in: path - description: String identifying an individual VAL group document resource - required: true - schema: - type: string - requestBody: - description: VAL group document to be updated in Group management server. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/VALGroupDocument' - responses: - '200': - description: VAL group document updated successfully - content: - application/json: - schema: - $ref: '#/components/schemas/VALGroupDocument' - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29122_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29122_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29122_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - delete: - description: Deletes a VAL Group. - parameters: - - name: groupDocId - in: path - description: String identifying an individual VAL group document resource - required: true - schema: - type: string - responses: - '204': - description: The individual VAL group matching groupDocId was deleted. - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' -components: - schemas: - VALGroupDocument: - type: object - properties: - valGroupId: - type: string - description: The VAL group idenitity. - grpDesc: - type: string - description: The text description of the VAL group. - membersList: - type: array - description: The list of VAL User IDs and VAL UE IDs, which are members of the VAL group. - items: - type: string - minItems: 1 - valGrpConf: - type: string - description: Configuration data for the VAL group. - valServiceIds: - type: array - description: The list of VAL services enabled on the group. - items: - type: string - minItems: 1 - suppFeat: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - valGroupId diff --git a/lib/sbi/support/3gpp-spec/TS29549_SS_NetworkResourceAdaptation.yaml b/lib/sbi/support/3gpp-spec/TS29549_SS_NetworkResourceAdaptation.yaml deleted file mode 100644 index 3c73aa4c10..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29549_SS_NetworkResourceAdaptation.yaml +++ /dev/null @@ -1,294 +0,0 @@ -openapi: 3.0.0 -info: - version: 1.0.0.alpha-1 - title: SS_NetworkResourceAdaptation - description: | - SS Network Resource Adaptation Service. - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. - -externalDocs: - description: 3GPP TS 29.549 V1.1.0; Service Enabler Architecture Layer for Verticals (SEAL); Application Programming Interface (API) specification; Stage3. - url: http://www.3gpp.org/ftp/Specs/archive/29_series/29.549/ - -security: - - {} - - oAuth2ClientCredentials: [] - -servers: - - url: '{apiRoot}/ss-nra/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 - -paths: - /multicast-subscriptions: - post: - summary: Creates a new Individual Multicast Subscription resource - operationId: CreateMulticastSubscription - tags: - - Multicast Subscriptions (Collection) - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/MulticastSubscription' - responses: - '201': - description: Success - content: - application/json: - schema: - $ref: '#/components/schemas/MulticastSubscription' - headers: - Location: - description: 'Contains the URI of the created individual multicast subscription resource' - required: true - schema: - type: string - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - callbacks: - UserPlaneNotification: - '{$request.body#/notifUri}': - post: - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UserPlaneNotification' - responses: - '204': - description: No Content, Notification was succesfull - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - /multicast-subscriptions/{multiSubId}: - get: - summary: "Reads an existing Individual Multicast Subscription" - operationId: GetMulticastSubscription - tags: - - Individual Multicast Subscription (Document) - parameters: - - name: multiSubId - in: path - description: Multicast Subscription ID - required: true - schema: - type: string - responses: - '200': - description: OK. Resource representation is returned - content: - application/json: - schema: - $ref: '#/components/schemas/MulticastSubscription' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '406': - $ref: 'TS29571_CommonData.yaml#/components/responses/406' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - delete: - summary: "Delete an existing Individual Multicast Subscription" - operationId: DeleteMulticastSubscription - tags: - - Individual Multicast Subscription (Document) - parameters: - - name: multiSubId - in: path - description: Multicast Subscription ID - required: true - schema: - type: string - responses: - '204': - description: No Content. Resource was succesfully deleted - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - -components: - securitySchemes: - oAuth2ClientCredentials: - type: oauth2 - flows: - clientCredentials: - tokenUrl: '{tokenUrl}' - scopes: {} - - schemas: - MulticastSubscription: - type: object - properties: - valGroupId: - type: string - anncMode: - $ref: '#/components/schemas/ServiceAnnoucementMode' - qosReq: - $ref: '#/components/schemas/QosRequirement' - locArea: - $ref: 'TS29122_GMDviaMBMSbyMB2.yaml#/components/schemas/MbmsLocArea' - duration: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - tmgi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' - notifUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - reqTestNotif: - type: boolean - wsNotifCfg: - $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' - suppFeat: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - valGroupId - - anncMode - - qosReq - - notifUri - UserPlaneNotification: - type: object - properties: - notifId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - eventNotifs: - type: array - items: - $ref: '#/components/schemas/NrmEventNotification' - minItems: 1 - required: - - notifId - - eventNotifs - NrmEventNotification: - type: object - properties: - event: - $ref: '#/components/schemas/NrmEvent' - ts: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - deliveryMode: - $ref: '#/components/schemas/DeliveryMode' - streamIds: - type: array - items: - type: string - minItems: 1 - required: - - event - - ts - QosRequirement: - type: string -# QoS requirment definition is FFS - -# Simple data types and Enumerations - - ServiceAnnoucementMode: - anyOf: - - type: string - enum: - - NRM - - VAL - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - NRM: NRM server performs the service announcement. - - VAL: VAL server performs the service announcement. - DeliveryMode: - anyOf: - - type: string - enum: - - UNICAST - - MULTICAST - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - UNICAST: Unicast delivery. - - MULTICAST: Multicast delivery. - NrmEvent: - anyOf: - - type: string - enum: - - UP_DELIVERY_MODE - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - UP_DELIVERY_MODE: User Plane delivery mode. diff --git a/lib/sbi/support/3gpp-spec/TS29549_SS_UserProfileRetrieval.yaml b/lib/sbi/support/3gpp-spec/TS29549_SS_UserProfileRetrieval.yaml deleted file mode 100644 index f4af4ca85c..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29549_SS_UserProfileRetrieval.yaml +++ /dev/null @@ -1,82 +0,0 @@ -openapi: 3.0.0 -info: - title: SS_UserProfileRetrieval - description: | - API for SEAL Configuration management. - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. - version: "1.0.0.alpha-1" -externalDocs: - description: 3GPP TS 29.549 V1.1.0 Service Enabler Architecture Layer for Verticals (SEAL); Application Programming Interface (API) specification; Stage3. - url: http://www.3gpp.org/ftp/Specs/archive/29_series/29.549/ -servers: - - url: '{apiRoot}/configuration-management/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in clause 6.5 of 3GPP TS 29.549 -paths: - /{valServiceId}: - get: - description: Retrieve a VAL User or VAL UE's profile information belonging to a VAL service. - parameters: - - name: valServiceId - in: path - description: String identifying an individual VAL service resource - required: true - schema: - type: string - - name: valUserId - in: query - description: String identifying a VAL User. Shall be present if valUEId query parameter is not present. - schema: - type: string - - name: valUEId - in: query - description: String identifying a VAL UE. Shall be present if valUserId query parameter is not present. - schema: - type: string - responses: - '200': - description: The Profile information of the VAL User or VAL UE corresponding to the identifier in the request. - content: - application/json: - schema: - $ref: '#/components/schemas/ProfileDoc' - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '406': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' -components: - schemas: - ProfileDoc: - type: object - properties: - profileInformation: - type: string - description: Profile information associated with the valUserId or valUEId. - valUserId: - type: string - description: Unique identifier of a VAL user. - valUEId: - type: string - description: Unique identifuer of a VAL UE. - required: - - profileInformation - oneOf: - - required: [valUserId] - - required: [valUEId] diff --git a/lib/sbi/support/3gpp-spec/TS29594_Nchf_SpendingLimitControl.yaml b/lib/sbi/support/3gpp-spec/TS29594_Nchf_SpendingLimitControl.yaml deleted file mode 100644 index 50b8108d54..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29594_Nchf_SpendingLimitControl.yaml +++ /dev/null @@ -1,288 +0,0 @@ -openapi: 3.0.0 -info: - version: 1.1.0.alpha-1 - title: Nchf_SpendingLimitControl - description: | - Nchf Spending Limit Control Service. - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. -externalDocs: - description: 3GPP TS 29.594 V16.1.0; 5G System; Spending Limit Control Service. - url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.594/' -servers: - - url: '{apiRoot}/nchf-spendinglimitcontrol/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in subclause subclause 4.4 of 3GPP TS 29.501 -security: - - {} - - oAuth2ClientCredentials: - - nchf-spendinglimitcontrol -paths: - /subscriptions: - post: - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/SpendingLimitContext' - responses: - '201': - description: Success - content: - application/json: - schema: - $ref: '#/components/schemas/SpendingLimitStatus' - headers: - Location: - description: 'Contains the URI of the created individual spending limit resource, according to the structure: {apiRoot}/nchf-spendinglimitcontrol/v1/subscriptions/{subscriptionId}' - required: true - schema: - type: string - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - callbacks: - statusNotification: - '{$request.body#/notifUri}/notify': - post: - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/SpendingLimitStatus' - responses: - '204': - description: No Content, Notification was succesfull - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - subscriptionTermination: - '{$request.body#/notifUri}/terminate': - post: - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/SubscriptionTerminationInfo' - responses: - '204': - description: No Content, Notification was succesfull - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - /subscriptions/{subscriptionId}: - parameters: - - in: path - name: subscriptionId - description: Identifies an individual spending limit retrieval subscription. - required: true - schema: - type: string - put: - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/SpendingLimitContext' - responses: - '200': - description: OK. Resource was succesfully modified and representation is returned - content: - application/json: - schema: - $ref: '#/components/schemas/SpendingLimitStatus' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - delete: - responses: - '204': - description: No Content. Resource was succesfully deleted - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' -components: - securitySchemes: - oAuth2ClientCredentials: - type: oauth2 - flows: - clientCredentials: - tokenUrl: '{nrfApiRoot}/oauth2/token' - scopes: - nchf-spendinglimitcontrol: Access to the Nchf_SpendingLimitControl API - schemas: - SpendingLimitContext: - type: object - properties: - supi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - gpsi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' - policyCounterIds: - type: array - items: - $ref: '#/components/schemas/PolicyCounterId' - minItems: 1 - description: This is a list of policy counter identifier(s), which identifies policy counters maintained per subscriber within the CHF. - notifUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - expiry: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - SpendingLimitStatus: - type: object - properties: - supi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - statusInfos: - type: object - additionalProperties: - $ref: '#/components/schemas/PolicyCounterInfo' - minProperties: 1 - description: Status of the requested policy counters. The key of the map is the attribute "policyCounterId". - expiry: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - PolicyCounterInfo: - type: object - properties: - policyCounterId: - $ref: '#/components/schemas/PolicyCounterId' - currentStatus: - type: string - description: Identifies the policy counter status applicable for a specific policy counter identified by the policyCounterId. The values (e.g. valid, invalid or any other status) are not specified. The interpretation and actions related to the defined values are out of scope of 3GPP. - penPolCounterStatuses: - type: array - items: - $ref: '#/components/schemas/PendingPolicyCounterStatus' - minItems: 1 - description: Provides the pending policy counter status. - required: - - policyCounterId - - currentStatus - PendingPolicyCounterStatus: - type: object - properties: - policyCounterStatus: - type: string - description: Identifies the policy counter status applicable for a specific policy counter identified by the policyCounterId. The values (e.g. valid, invalid or any other status) are not specified. The interpretation and actions related to the defined values are out of scope of 3GPP. - activationTime: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - required: - - policyCounterStatus - - activationTime - PolicyCounterId: - type: string - description: Identifies a policy counter. - SubscriptionTerminationInfo: - type: object - properties: - supi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - termCause: - $ref: '#/components/schemas/TerminationCause' - required: - - supi - TerminationCause: - anyOf: - - type: string - enum: - - REMOVED_SUBSCRIBER - - type: string diff --git a/lib/sbi/support/3gpp-spec/TS29675_Nucmf_Provisioning.yaml b/lib/sbi/support/3gpp-spec/TS29675_Nucmf_Provisioning.yaml deleted file mode 100644 index dccafb22d9..0000000000 --- a/lib/sbi/support/3gpp-spec/TS29675_Nucmf_Provisioning.yaml +++ /dev/null @@ -1,282 +0,0 @@ -openapi: 3.0.0 -info: - title: Nucmf_Provisioning - version: 1.0.0.alpha-3 - description: | - UCMF_Provisioning Service. - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. -externalDocs: - description: 3GPP TS 29.675 V16.0.0; User Equipment (UE) radio capability provisioning service; Stage 3. - url: http://www.3gpp.org/ftp/Specs/archive/29_series/29.675/ -servers: - - url: '{apiRoot}/nucmf-provisioning/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 -security: - - {} - - oAuth2ClientCredentials: - - nucmf-provisioning -paths: - /provisionings: - post: - summary: Create an Individual UE radio capability provisioning - operationId: CreateProvisioning - tags: - - UE radio capability provisionings (Collection) - requestBody: - description: create new provisionings for a given SCS/AS. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/RacsData' - responses: - '201': - description: Created. The creation of an Individual UE radio capability provisioning resource is confirmed and a representation of that resource is returned. - content: - application/json: - schema: - $ref: '#/components/schemas/RacsData' - headers: - Location: - description: 'Contains the URI of the newly created resource' - required: true - schema: - type: string - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29122_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29122_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29122_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - description: The RACS data for all RACS IDs were not provisioned successfully. - content: - application/json: - schema: - type: array - items: - $ref: 'TS29122_RacsParameterProvisioning.yaml#/components/schemas/RacsFailureReport' - minItems: 1 - application/problem+json: - schema: - $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - /provisionings/{provisioningId}: - parameters: - - name: provisioningId - in: path - description: Provisioning ID - required: true - schema: - type: string - get: - summary: Get an Individual UE radio capability provisioning - operationId: GetProvisioning - tags: - - Individual UE radio capability provisioning (Document) - responses: - '200': - description: OK. The provisioning information related to the request URI is returned. - content: - application/json: - schema: - $ref: '#/components/schemas/RacsData' - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '406': - $ref: 'TS29122_CommonData.yaml#/components/responses/406' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - patch: - summary: Update (PATCH) an Individual UE radio capability provisioning - operationId: UpdateProvisioning - tags: - - Individual UE radio capability provisioning (Document) - requestBody: - description: update an existing parameter provisioning. - required: true - content: - application/merge-patch+json: - schema: - $ref: '#/components/schemas/RacsDataPatch' - responses: - '200': - description: OK. The Individual UE radio capability provisioning resource is modified and a representation of that resource is returned. - content: - application/json: - schema: - $ref: '#/components/schemas/RacsData' - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29122_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29122_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29122_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - description: The RACS data for all RACS IDs were not provisioned successfully. - content: - application/json: - schema: - type: array - items: - $ref: 'TS29122_RacsParameterProvisioning.yaml#/components/schemas/RacsFailureReport' - minItems: 1 - application/problem+json: - schema: - $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - put: - summary: Replace (PUT) an Individual UE radio capability provisioning - operationId: ReplaceProvisioning - tags: - - Individual UE radio capability provisioning (Document) - requestBody: - description: update an existing parameter provisioning. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/RacsData' - responses: - '200': - description: OK. The Individual UE radio capability provisioning resource is modified and a representation of that resource is returned. - content: - application/json: - schema: - $ref: '#/components/schemas/RacsData' - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29122_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29122_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29122_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - description: The RACS data for all RACS IDs were not provisioned successfully. - content: - application/json: - schema: - type: array - items: - $ref: 'TS29122_RacsParameterProvisioning.yaml#/components/schemas/RacsFailureReport' - minItems: 1 - application/problem+json: - schema: - $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' - delete: - summary: Remove an Individual UE radio capability provisioning - operationId: RemoveProvisioning - tags: - - Individual UE radio capability provisioning (Document) - responses: - '204': - description: No Content. The Individual UE radio capability resource was successfully removed. The payload body shall be empty. - '400': - $ref: 'TS29122_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29122_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29122_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29122_CommonData.yaml#/components/responses/404' - '429': - $ref: 'TS29122_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29122_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29122_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29122_CommonData.yaml#/components/responses/default' -components: - securitySchemes: - oAuth2ClientCredentials: - type: oauth2 - flows: - clientCredentials: - tokenUrl: '{tokenUrl}' - scopes: {} - schemas: - RacsData: - type: object - properties: - suppFeat: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - racsConfigs: - type: object - additionalProperties: - $ref: 'TS29122_RacsParameterProvisioning.yaml#/components/schemas/RacsConfigurationRm' - minProperties: 1 - description: Identifies the configuration related to manufacturer specific UE radio capability. Each element uniquely identifies an RACS configuration for an RACS ID and is identified in the map via the RACS ID as key. The response shall include successfully provisioned RACS data. - racsReports: - type: object - additionalProperties: - $ref: 'TS29122_RacsParameterProvisioning.yaml#/components/schemas/RacsFailureReport' - minProperties: 1 - description: Contains the RACS IDs for which the RACS data are not provisioned successfully. The failure reason is also included. - readOnly: true - required: - - racsConfigs - RacsDataPatch: - type: object - properties: - racsConfigs: - type: object - additionalProperties: - $ref: 'TS29122_RacsParameterProvisioning.yaml#/components/schemas/RacsConfigurationRm' - minProperties: 1 - description: Identifies the configuration related to manufacturer specific UE radio capability. Each element uniquely identifies an RACS configuration for an RACS ID and is identified in the map via the RACS ID as key. diff --git a/lib/sbi/support/3gpp-spec/TS32291_Nchf_ConvergedCharging.yaml b/lib/sbi/support/3gpp-spec/TS32291_Nchf_ConvergedCharging.yaml deleted file mode 100644 index 14996833f5..0000000000 --- a/lib/sbi/support/3gpp-spec/TS32291_Nchf_ConvergedCharging.yaml +++ /dev/null @@ -1,1261 +0,0 @@ -openapi: 3.0.0 -info: - title: Nchf_ConvergedCharging - version: 3.0.0.alpha-2 - description: | - ConvergedCharging Service (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. -externalDocs: - description: > - 3GPP TS 32.291 V16.2.0: Telecommunication management; Charging management; - 5G system, charging service; Stage 3. - url: 'http://www.3gpp.org/ftp/Specs/archive/32_series/32.291/' -servers: - - url: '{apiRoot}/nchf-convergedcharging/v2' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in subclause 4.4 of 3GPP TS 29.501. -paths: - /chargingdata: - post: - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/ChargingDataRequest' - responses: - '201': - description: Created - content: - application/json: - schema: - $ref: '#/components/schemas/ChargingDataResponse' - '400': - description: Bad request - content: - application/json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - '404': - description: Not Found - content: - application/json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '410': - $ref: 'TS29571_CommonData.yaml#/components/responses/410' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - callbacks: - myNotification: - '{$request.body#/notifyUri}': - post: - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/ChargingNotifyRequest' - responses: - '204': - description: 'No Content, Notification was succesfull' - '400': - description: Bad request - content: - application/json: - schema: - $ref: >- - TS29571_CommonData.yaml#/components/schemas/ProblemDetails - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - '/chargingdata/{ChargingDataRef}/update': - post: - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/ChargingDataRequest' - parameters: - - name: ChargingDataRef - in: path - description: a unique identifier for a charging data resource in a PLMN - required: true - schema: - type: string - responses: - '200': - description: OK. Updated Charging Data resource is returned - content: - application/json: - schema: - $ref: '#/components/schemas/ChargingDataResponse' - '400': - description: Bad request - content: - application/json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - '404': - description: Not Found - content: - application/json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '410': - $ref: 'TS29571_CommonData.yaml#/components/responses/410' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - '/chargingdata/{ChargingDataRef}/release': - post: - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/ChargingDataRequest' - parameters: - - name: ChargingDataRef - in: path - description: a unique identifier for a charging data resource in a PLMN - required: true - schema: - type: string - responses: - '204': - description: No Content. - '404': - description: Not Found - content: - application/json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '410': - $ref: 'TS29571_CommonData.yaml#/components/responses/410' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' -components: - schemas: - ChargingDataRequest: - type: object - properties: - subscriberIdentifier: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - nfConsumerIdentification: - $ref: '#/components/schemas/NFIdentification' - invocationTimeStamp: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - invocationSequenceNumber: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' - oneTimeEvent: - type: boolean - oneTimeEventType: - $ref: '#/components/schemas/oneTimeEventType' - notifyUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - serviceSpecificationInfo: - type: string - multipleUnitUsage: - type: array - items: - $ref: '#/components/schemas/MultipleUnitUsage' - minItems: 0 - triggers: - type: array - items: - $ref: '#/components/schemas/Trigger' - minItems: 0 - pDUSessionChargingInformation: - $ref: '#/components/schemas/PDUSessionChargingInformation' - roamingQBCInformation: - $ref: '#/components/schemas/RoamingQBCInformation' - sMSChargingInformation: - $ref: '#/components/schemas/SMSChargingInformation' - nEFChargingInformation: - $ref: '#/components/schemas/NEFChargingInformation' - registrationChargingInformation: - $ref: '#/components/schemas/RegistrationChargingInformation' - n2ConnectionChargingInformation: - $ref: '#/components/schemas/N2ConnectionChargingInformation' - locationReportingChargingInformation: - $ref: '#/components/schemas/LocationReportingChargingInformation' - required: - - nfConsumerIdentification - - invocationTimeStamp - - invocationSequenceNumber - ChargingDataResponse: - type: object - properties: - invocationTimeStamp: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - invocationSequenceNumber: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' - invocationResult: - $ref: '#/components/schemas/InvocationResult' - sessionFailover: - $ref: '#/components/schemas/SessionFailover' - multipleUnitInformation: - type: array - items: - $ref: '#/components/schemas/MultipleUnitInformation' - minItems: 0 - triggers: - type: array - items: - $ref: '#/components/schemas/Trigger' - minItems: 0 - pDUSessionChargingInformation: - $ref: '#/components/schemas/PDUSessionChargingInformation' - roamingQBCInformation: - $ref: '#/components/schemas/RoamingQBCInformation' - required: - - invocationTimeStamp - - invocationSequenceNumber - ChargingNotifyRequest: - type: object - properties: - notificationType: - $ref: '#/components/schemas/NotificationType' - reauthorizationDetails: - type: array - items: - $ref: '#/components/schemas/ReauthorizationDetails' - minItems: 0 - required: - - notificationType - ChargingNotifyResponse: - type: object - properties: - invocationResult: - $ref: '#/components/schemas/InvocationResult' - NFIdentification: - type: object - properties: - nFName: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - nFIPv4Address: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' - nFIPv6Address: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' - nFPLMNID: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' - nodeFunctionality: - $ref: '#/components/schemas/NodeFunctionality' - nFFqdn: - type: string - required: - - nodeFunctionality - MultipleUnitUsage: - type: object - properties: - ratingGroup: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RatingGroup' - requestedUnit: - $ref: '#/components/schemas/RequestedUnit' - usedUnitContainer: - type: array - items: - $ref: '#/components/schemas/UsedUnitContainer' - minItems: 0 - uPFID: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - required: - - ratingGroup - InvocationResult: - type: object - properties: - error: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - failureHandling: - $ref: '#/components/schemas/FailureHandling' - Trigger: - type: object - properties: - triggerType: - $ref: '#/components/schemas/TriggerType' - triggerCategory: - $ref: '#/components/schemas/TriggerCategory' - timeLimit: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' - volumeLimit: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' - volumeLimit64: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' - maxNumberOfccc: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' - required: - - triggerType - - triggerCategory - MultipleUnitInformation: - type: object - properties: - resultCode: - $ref: '#/components/schemas/ResultCode' - ratingGroup: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RatingGroup' - grantedUnit: - $ref: '#/components/schemas/GrantedUnit' - triggers: - type: array - items: - $ref: '#/components/schemas/Trigger' - minItems: 0 - validityTime: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' - quotaHoldingTime: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' - finalUnitIndication: - $ref: '#/components/schemas/FinalUnitIndication' - timeQuotaThreshold: - type: integer - volumeQuotaThreshold: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' - unitQuotaThreshold: - type: integer - uPFID: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - required: - - ratingGroup - RequestedUnit: - type: object - properties: - time: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' - totalVolume: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' - uplinkVolume: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' - downlinkVolume: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' - serviceSpecificUnits: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' - UsedUnitContainer: - type: object - properties: - serviceId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceId' - quotaManagementIndicator: - $ref: '#/components/schemas/QuotaManagementIndicator' - triggers: - type: array - items: - $ref: '#/components/schemas/Trigger' - minItems: 0 - triggerTimestamp: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - time: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' - totalVolume: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' - uplinkVolume: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' - downlinkVolume: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' - serviceSpecificUnits: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' - eventTimeStamps: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - localSequenceNumber: - type: integer - pDUContainerInformation: - $ref: '#/components/schemas/PDUContainerInformation' - required: - - localSequenceNumber - GrantedUnit: - type: object - properties: - tariffTimeChange: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - time: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' - totalVolume: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' - uplinkVolume: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' - downlinkVolume: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' - serviceSpecificUnits: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' - FinalUnitIndication: - type: object - properties: - finalUnitAction: - $ref: '#/components/schemas/FinalUnitAction' - restrictionFilterRule: - $ref: '#/components/schemas/IPFilterRule' - filterId: - type: string - redirectServer: - $ref: '#/components/schemas/RedirectServer' - required: - - finalUnitAction - RedirectServer: - type: object - properties: - redirectAddressType: - $ref: '#/components/schemas/RedirectAddressType' - redirectServerAddress: - type: string - required: - - redirectAddressType - - redirectServerAddress - ReauthorizationDetails: - type: object - properties: - serviceId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceId' - ratingGroup: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RatingGroup' - quotaManagementIndicator: - $ref: '#/components/schemas/QuotaManagementIndicator' - PDUSessionChargingInformation: - type: object - properties: - chargingId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ChargingId' - homeProvidedChargingId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ChargingId' - userInformation: - $ref: '#/components/schemas/UserInformation' - userLocationinfo: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - presenceReportingAreaInformation: - type: object - additionalProperties: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' - minProperties: 0 - uetimeZone: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' - pduSessionInformation: - $ref: '#/components/schemas/PDUSessionInformation' - unitCountInactivityTimer: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' - rANSecondaryRATUsageReport: - $ref: '#/components/schemas/RANSecondaryRATUsageReport' - required: - - pduSessionInformation - UserInformation: - type: object - properties: - servedGPSI: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' - servedPEI: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' - unauthenticatedFlag: - type: boolean - roamerInOut: - $ref: '#/components/schemas/RoamerInOut' - PDUSessionInformation: - type: object - properties: - networkSlicingInfo: - $ref: '#/components/schemas/NetworkSlicingInfo' - pduSessionID: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' - pduType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' - sscMode: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SscMode' - hPlmnId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' - servingNetworkFunctionID: - $ref: '#/components/schemas/ServingNetworkFunctionID' - ratType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' - dnnId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' - dnnSelectionMode: - $ref: '#/components/schemas/dnnSelectionMode' - chargingCharacteristics: - type: string - chargingCharacteristicsSelectionMode: - $ref: '#/components/schemas/ChargingCharacteristicsSelectionMode' - startTime: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - stopTime: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - 3gppPSDataOffStatus: - $ref: '#/components/schemas/3GPPPSDataOffStatus' - sessionStopIndicator: - type: boolean - pduAddress: - $ref: '#/components/schemas/PDUAddress' - diagnostics: - $ref: '#/components/schemas/Diagnostics' - authorizedQoSInformation: - $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/AuthorizedDefaultQos' - subscribedQoSInformation: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SubscribedDefaultQos' - authorizedSessionAMBR: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' - subscribedSessionAMBR: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' - servingCNPlmnId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' - required: - - pduSessionID - - dnnId - PDUContainerInformation: - type: object - properties: - timeofFirstUsage: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - timeofLastUsage: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - qoSInformation: - $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/QosData' - qoSCharacteristics: - $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/QosCharacteristics' - afChargingIdentifier: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ChargingId' - userLocationInformation: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - uetimeZone: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' - rATType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' - servingNodeID: - type: array - items: - $ref: '#/components/schemas/ServingNetworkFunctionID' - minItems: 0 - presenceReportingAreaInformation: - type: object - additionalProperties: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' - minProperties: 0 - 3gppPSDataOffStatus: - $ref: '#/components/schemas/3GPPPSDataOffStatus' - sponsorIdentity: - type: string - applicationserviceProviderIdentity: - type: string - chargingRuleBaseName: - type: string - NetworkSlicingInfo: - type: object - properties: - sNSSAI: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - required: - - sNSSAI - PDUAddress: - type: object - properties: - pduIPv4Address: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' - pduIPv6AddresswithPrefix: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' - pduAddressprefixlength: - type: integer - iPv4dynamicAddressFlag: - type: boolean - iPv6dynamicPrefixFlag: - type: boolean - ServingNetworkFunctionID: - type: object - properties: - - servingNetworkFunctionInformation: - $ref: '#/components/schemas/NFIdentification' - aMFId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfId' - required: - - servingNetworkFunctionInformation - RoamingQBCInformation: - type: object - properties: - multipleQFIcontainer: - type: array - items: - $ref: '#/components/schemas/MultipleQFIcontainer' - minItems: 0 - uPFID: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - roamingChargingProfile: - $ref: '#/components/schemas/RoamingChargingProfile' - MultipleQFIcontainer: - type: object - properties: - triggers: - type: array - items: - $ref: '#/components/schemas/Trigger' - minItems: 0 - triggerTimestamp: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - time: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' - totalVolume: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' - uplinkVolume: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' - localSequenceNumber: - type: integer - qFIContainerInformation: - $ref: '#/components/schemas/QFIContainerInformation' - required: - - localSequenceNumber - QFIContainerInformation: - type: object - properties: - qFI: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Qfi' - reportTime: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - timeofFirstUsage: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - timeofLastUsage: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - qoSInformation: - $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/QosData' - qoSCharacteristics: - $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/QosCharacteristics' - userLocationInformation: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - uetimeZone: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' - presenceReportingAreaInformation: - type: object - additionalProperties: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' - minProperties: 0 - rATType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' - servingNetworkFunctionID: - type: array - items: - $ref: '#/components/schemas/ServingNetworkFunctionID' - minItems: 0 - 3gppPSDataOffStatus: - $ref: '#/components/schemas/3GPPPSDataOffStatus' - 3gppChargingId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ChargingId' - diagnostics: - $ref: '#/components/schemas/Diagnostics' - enhancedDiagnostics: - type: array - items: - type: string - required: - - reportTime - RoamingChargingProfile: - type: object - properties: - triggers: - type: array - items: - $ref: '#/components/schemas/Trigger' - minItems: 0 - partialRecordMethod: - $ref: '#/components/schemas/PartialRecordMethod' - SMSChargingInformation: - type: object - properties: - originatorInfo: - $ref: '#/components/schemas/OriginatorInfo' - recipientInfo: - type: array - items: - $ref: '#/components/schemas/RecipientInfo' - minItems: 0 - userEquipmentInfo: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' - userLocationinfo: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - uetimeZone: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' - rATType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' - sMSCAddress: - type: string - sMDataCodingScheme: - type: integer - sMMessageType: - $ref: '#/components/schemas/SMMessageType' - sMReplyPathRequested: - $ref: '#/components/schemas/ReplyPathRequested' - sMUserDataHeader: - type: string - sMStatus: - type: string - sMDischargeTime: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - numberofMessagesSent: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' - sMServiceType: - $ref: '#/components/schemas/SMServiceType' - sMSequenceNumber: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' - sMSresult: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' - submissionTime: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - sMPriority: - $ref: '#/components/schemas/SMPriority' - messageReference: - type: string - messageSize: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' - messageClass: - $ref: '#/components/schemas/MessageClass' - deliveryReportRequested: - $ref: '#/components/schemas/DeliveryReportRequested' - OriginatorInfo: - type: object - properties: - originatorSUPI: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - originatorGPSI: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' - originatorOtherAddress: - $ref: '#/components/schemas/SMAddressInfo' - originatorReceivedAddress: - $ref: '#/components/schemas/SMAddressInfo' - originatorSCCPAddress: - type: string - sMOriginatorInterface: - $ref: '#/components/schemas/SMInterface' - sMOriginatorProtocolId: - type: string - RecipientInfo: - type: object - properties: - recipientSUPI: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - recipientGPSI: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' - recipientOtherAddress: - $ref: '#/components/schemas/SMAddressInfo' - recipientReceivedAddress: - $ref: '#/components/schemas/SMAddressInfo' - recipientSCCPAddress: - type: string - sMDestinationInterface: - $ref: '#/components/schemas/SMInterface' - sMrecipientProtocolId: - type: string - SMAddressInfo: - type: object - properties: - sMaddressType: - $ref: '#/components/schemas/SMAddressType' - sMaddressData: - type: string - sMaddressDomain: - $ref: '#/components/schemas/SMAddressDomain' - RecipientAddress: - type: object - properties: - recipientAddressInfo: - $ref: '#/components/schemas/SMAddressInfo' - sMaddresseeType: - $ref: '#/components/schemas/SMAddresseeType' - MessageClass: - type: object - properties: - classIdentifier: - $ref: '#/components/schemas/ClassIdentifier' - tokenText: - type: string - SMAddressDomain: - type: object - properties: - domainName: - type: string - 3GPPIMSIMCCMNC: - type: string - SMInterface: - type: object - properties: - interfaceId: - type: string - interfaceText: - type: string - interfacePort: - type: string - interfaceType: - $ref: '#/components/schemas/InterfaceType' - RANSecondaryRATUsageReport: - type: object - properties: - rANSecondaryRATType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' - qosFlowsUsageReports: - type: array - items: - $ref: '#/components/schemas/QosFlowsUsageReport' - Diagnostics: - type: integer - IPFilterRule: - type: string - QosFlowsUsageReport: - type: object - properties: - qFI: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Qfi' - startTimestamp: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - endTimestamp: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - uplinkVolume: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' - downlinkVolume: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' - NEFChargingInformation: - type: object - properties: - groupIdentifier: - $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' - aPIDirection: - $ref: '#/components/schemas/APIDirection' - aPITargetNetworkFunction: - $ref: '#/components/schemas/NFIdentification' - aPIResultCode: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' - aPIName: - type: string - aPIReference: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - aPIContent: - type: string - required: - - aPIName - RegistrationChargingInformation: - type: object - properties: - registrationMessagetype: - $ref: '#/components/schemas/RegistrationMessageType' - userInformation: - $ref: '#/components/schemas/UserInformation' - userLocationinfo: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - uetimeZone: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' - rATType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' - 5GMMCapability: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' - mICOModeIndication: - $ref: '#/components/schemas/MICOModeIndication' - smsIndication: - $ref: '#/components/schemas/SmsIndication' - taiList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' - minItems: 0 - serviceAreaRestriction: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' - minItems: 0 - requestedNSSAI: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - minItems: 0 - allowedNSSAI: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - minItems: 0 - rejectedNSSAI: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - minItems: 0 - required: - - registrationMessagetype - N2ConnectionChargingInformation: - type: object - properties: - n2ConnectionMessageType: - $ref: '#/components/schemas/N2ConnectionMessageType' - userInformation: - $ref: '#/components/schemas/UserInformation' - userLocationinfo: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - uetimeZone: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' - rATType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' - amfUeNgapId: - type: integer - ranUeNgapId: - type: integer - ranNodeId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' - restrictedRatList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' - minItems: 0 - forbiddenAreaList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Area' - minItems: 0 - serviceAreaRestriction: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' - minItems: 0 - restrictedCnList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/CoreNetworkType' - minItems: 0 - allowedNSSAI: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - minItems: 0 - rrcEstCause: - type: string - pattern: '^[0-9a-fA-F]+$' - required: - - n2ConnectionMessageType - LocationReportingChargingInformation: - type: object - properties: - locationReportingMessageType: - $ref: '#/components/schemas/LocationReportingMessageType' - userInformation: - $ref: '#/components/schemas/UserInformation' - userLocationinfo: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - uetimeZone: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' - rATType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' - presenceReportingAreaInformation: - type: object - additionalProperties: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' - minProperties: 0 - required: - - locationReportingMessageType - N2ConnectionMessageType: - type: integer - LocationReportingMessageType: - type: integer - NotificationType: - anyOf: - - type: string - enum: - - REAUTHORIZATION - - ABORT_CHARGING - - type: string - NodeFunctionality: - anyOf: - - type: string - enum: - - SMF - - SMSF - - SGW - - I_SMF - - type: string - ChargingCharacteristicsSelectionMode: - anyOf: - - type: string - enum: - - HOME_DEFAULT - - ROAMING_DEFAULT - - VISITING_DEFAULT - - type: string - TriggerType: - anyOf: - - type: string - enum: - - QUOTA_THRESHOLD - - QHT - - FINAL - - QUOTA_EXHAUSTED - - VALIDITY_TIME - - OTHER_QUOTA_TYPE - - FORCED_REAUTHORISATION - - UNUSED_QUOTA_TIMER # Included for backwards compatibility, shall not be used - - UNIT_COUNT_INACTIVITY_TIMER - - ABNORMAL_RELEASE - - QOS_CHANGE - - VOLUME_LIMIT - - TIME_LIMIT - - PLMN_CHANGE - - USER_LOCATION_CHANGE - - RAT_CHANGE - - SESSION_AMBR_CHANGE - - UE_TIMEZONE_CHANGE - - TARIFF_TIME_CHANGE - - MAX_NUMBER_OF_CHANGES_IN_CHARGING_CONDITIONS - - MANAGEMENT_INTERVENTION - - CHANGE_OF_UE_PRESENCE_IN_PRESENCE_REPORTING_AREA - - CHANGE_OF_3GPP_PS_DATA_OFF_STATUS - - SERVING_NODE_CHANGE - - REMOVAL_OF_UPF - - ADDITION_OF_UPF - - INSERTION_OF_ISMF - - REMOVAL_OF_ISMF - - CHANGE_OF_ISMF - - START_OF_SERVICE_DATA_FLOW - - ECGI_CHANGE - - TAI_CHANGE - - HANDOVER_CANCEL - - HANDOVER_START - - HANDOVER_COMPLETE - - GFBR_GUARANTEED_STATUS_CHANGE - - type: string - FinalUnitAction: - anyOf: - - type: string - enum: - - TERMINATE - - REDIRECT - - RESTRICT_ACCESS - - type: string - RedirectAddressType: - anyOf: - - type: string - enum: - - IPV4 - - IPV6 - - URL - - type: string - TriggerCategory: - anyOf: - - type: string - enum: - - IMMEDIATE_REPORT - - DEFERRED_REPORT - - type: string - QuotaManagementIndicator: - anyOf: - - type: string - enum: - - ONLINE_CHARGING - - OFFLINE_CHARGING - - type: string - FailureHandling: - anyOf: - - type: string - enum: - - TERMINATE - - CONTINUE - - RETRY_AND_TERMINATE - - type: string - SessionFailover: - anyOf: - - type: string - enum: - - FAILOVER_NOT_SUPPORTED - - FAILOVER_SUPPORTED - - type: string - 3GPPPSDataOffStatus: - anyOf: - - type: string - enum: - - ACTIVE - - INACTIVE - - type: string - ResultCode: - anyOf: - - type: string - enum: - - SUCCESS - - END_USER_SERVICE_DENIED - - QUOTA_MANAGEMENT_NOT_APPLICABLE - - QUOTA_LIMIT_REACHED - - END_USER_SERVICE_REJECTED - - USER_UNKNOWN - - RATING_FAILED - - type: string - PartialRecordMethod: - anyOf: - - type: string - enum: - - DEFAULT - - INDIVIDUAL - - type: string - RoamerInOut: - anyOf: - - type: string - enum: - - IN_BOUND - - OUT_BOUND - - type: string - SMMessageType: - anyOf: - - type: string - enum: - - SUBMISSION - - DELIVERY_REPORT - - SM_SERVICE_REQUEST - - type: string - SMPriority: - anyOf: - - type: string - enum: - - LOW - - NORMAL - - HIGH - - type: string - DeliveryReportRequested: - anyOf: - - type: string - enum: - - YES - - NO - - type: string - InterfaceType: - anyOf: - - type: string - enum: - - UNKNOWN - - MOBILE_ORIGINATING - - MOBILE_TERMINATING - - APPLICATION_ORIGINATING - - APPLICATION_TERMINATING - - type: string - ClassIdentifier: - anyOf: - - type: string - enum: - - PERSONAL - - ADVERTISEMENT - - INFORMATIONAL - - AUTO - - type: string - SMAddressType: - anyOf: - - type: string - enum: - - EMAIL_ADDRESS - - MSISDN - - IPV4_ADDRESS - - IPV6_ADDRESS - - NUMERIC_SHORTCODE - - ALPHANUMERIC_SHORTCODE - - OTHER - - IMSI - - type: string - SMAddresseeType: - anyOf: - - type: string - enum: - - TO - - CC - - BCC - - type: string - SMServiceType: - anyOf: - - type: string - enum: - - VAS4SMS_SHORT_MESSAGE_CONTENT_PROCESSING - - VAS4SMS_SHORT_MESSAGE_FORWARDING - - VAS4SMS_SHORT_MESSAGE_FORWARDING_MULTIPLE_SUBSCRIPTIONS - - VAS4SMS_SHORT_MESSAGE_FILTERING - - VAS4SMS_SHORT_MESSAGE_RECEIPT - - VAS4SMS_SHORT_MESSAGE_NETWORK_STORAGE - - VAS4SMS_SHORT_MESSAGE_TO_MULTIPLE_DESTINATIONS - - VAS4SMS_SHORT_MESSAGE_VIRTUAL_PRIVATE_NETWORK(VPN) - - VAS4SMS_SHORT_MESSAGE_AUTO_REPLY - - VAS4SMS_SHORT_MESSAGE_PERSONAL_SIGNATURE - - VAS4SMS_SHORT_MESSAGE_DEFERRED_DELIVERY - - type: string - ReplyPathRequested: - anyOf: - - type: string - enum: - - NO_REPLY_PATH_SET - - REPLY_PATH_SET - - type: string - oneTimeEventType: - anyOf: - - type: string - enum: - - IEC - - PEC - - type: string - dnnSelectionMode: - anyOf: - - type: string - enum: - - VERIFIED - - UE_DNN_NOT_VERIFIED - - NW_DNN_NOT_VERIFIED - - type: string - APIDirection: - anyOf: - - type: string - enum: - - INVOCATION - - NOTIFICATION - - type: string - RegistrationMessageType: - anyOf: - - type: string - enum: - - INITIAL - - MOBILITY - - PERIODIC - - EMERGENCY - - DEREGISTRATION - - type: string - MICOModeIndication: - anyOf: - - type: string - enum: - - MICO_MODE - - NO_MICO_MODE - - type: string - SmsIndication: - anyOf: - - type: string - enum: - - SMS_SUPPORTED - - SMS_NOT_SUPPORTED - - type: string diff --git a/lib/sbi/support/generator.sh b/lib/sbi/support/generator.sh index 98f0f2398d..8ec22748aa 100755 --- a/lib/sbi/support/generator.sh +++ b/lib/sbi/support/generator.sh @@ -4,5 +4,10 @@ export C_POST_PROCESS_FILE="/usr/bin/uncrustify --no-backup" export UNCRUSTIFY_CONFIG=../openapi/.openapi-generator/uncrustify.cfg openapi_generator_cli="java -jar ${HOME}/Documents/git/my/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" +$openapi_generator_cli generate -i ./modified/TS29503_Nudm_SDM.yaml -c ../openapi/.openapi-generator/config.yaml -g c -o ../openapi +$openapi_generator_cli generate -i ./modified/TS29503_Nudm_UECM.yaml -c ../openapi/.openapi-generator/config.yaml -g c -o ../openapi +$openapi_generator_cli generate -i ./modified/TS29503_Nudm_UEAU.yaml -c ../openapi/.openapi-generator/config.yaml -g c -o ../openapi +$openapi_generator_cli generate -i ./modified/TS29509_Nausf_UEAuthentication.yaml -c ../openapi/.openapi-generator/config.yaml -g c -o ../openapi $openapi_generator_cli generate -i ./modified/TS29510_Nnrf_NFDiscovery.yaml -c ../openapi/.openapi-generator/config.yaml -g c -o ../openapi $openapi_generator_cli generate -i ./modified/TS29510_Nnrf_NFManagement.yaml -c ../openapi/.openapi-generator/config.yaml -g c -o ../openapi +$openapi_generator_cli generate -i ./modified/TS29504_Nudr_DR.yaml -c ../openapi/.openapi-generator/config.yaml -g c -o ../openapi diff --git a/lib/sbi/support/3gpp-spec/TS29122_CommonData.yaml b/lib/sbi/support/modified/TS29122_CommonData.yaml similarity index 92% rename from lib/sbi/support/3gpp-spec/TS29122_CommonData.yaml rename to lib/sbi/support/modified/TS29122_CommonData.yaml index 3a6022fc64..42b0fd51ca 100644 --- a/lib/sbi/support/3gpp-spec/TS29122_CommonData.yaml +++ b/lib/sbi/support/modified/TS29122_CommonData.yaml @@ -4,7 +4,7 @@ info: version: 1.1.0.alpha-2 description: | Data types applicable to several APIs. - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. externalDocs: description: 3GPP TS 29.122 V16.5.0 T8 reference point for Northbound APIs @@ -115,7 +115,7 @@ components: type: array items: type: string - description: Indicates the packet filters of the IP flow. Refer to subclause 5.3.8 of 3GPP TS 29.214 for encoding. It shall contain UL and/or DL IP flow description. + description: Indicates the packet filters of the IP flow. Refer to subclause 5.3.8 of 3GPP TS 29.214 for encoding. It shall contain UL and/or DL IP flow description. minItems: 1 maxItems: 2 required: @@ -265,7 +265,7 @@ components: description: integer indicating a bandwidth in bits per second. BdtReferenceId: type: string - description: string identifying a BDT Reference ID as defined in subclause 5.3.3 of 3GPP TS 29.154. + description: string identifying a BDT Reference ID as defined in subclause 5.3.3 of 3GPP TS 29.154. BdtReferenceIdRm: type: string description: This data type is defined in the same way as the BdtReferenceId data type, but with the nullable property set to true. @@ -275,7 +275,7 @@ components: description: string with format "binary" as defined in OpenAPI Specification. Bytes: type: string - description: String with format "byte" as defined in OpenAPI Specification, i.e, base64-encoded characters. + description: String with format "byte" as defined in OpenAPI Specification, i.e, base64-encoded characters. DayOfWeek: type: integer minimum: 1 @@ -290,7 +290,7 @@ components: nullable: true DateTimeRo: type: string - description: string with format "date-time" as defined in OpenAPI with "readOnly=true" property. + description: string with format "date-time" as defined in OpenAPI with "readOnly=true" property. readOnly: true DurationSec: type: integer @@ -313,36 +313,36 @@ components: description: Unsigned integer identifying a period of time in units of minutes. ExternalId: type: string - description: string containing a local identifier followed by "@" and a domain identifier. Both the local identifier and the domain identifier shall be encoded as strings that do not contain any "@" characters. See Clause 4.6.2 of 3GPP TS 23.682 for more information. + description: string containing a local identifier followed by "@" and a domain identifier. Both the local identifier and the domain identifier shall be encoded as strings that do not contain any "@" characters. See Clause 4.6.2 of 3GPP TS 23.682 for more information. ExternalGroupId: type: string - description: string containing a local identifier followed by "@" and a domain identifier. Both the local identifier and the domain identifier shall be encoded as strings that do not contain any "@" characters. See Clauses 4.6.2 and 4.6.3 of 3GPP TS 23.682 for more information. + description: string containing a local identifier followed by "@" and a domain identifier. Both the local identifier and the domain identifier shall be encoded as strings that do not contain any "@" characters. See Clauses 4.6.2 and 4.6.3 of 3GPP TS 23.682 for more information. Ipv4Addr: type: string - description: string identifying a Ipv4 address formatted in the "dotted decimal" notation as defined in IETF RFC 1166. + description: string identifying a Ipv4 address formatted in the "dotted decimal" notation as defined in IETF RFC 1166. Ipv6Addr: type: string - description: string identifying a Ipv6 address formatted according to clause 4 in IETF RFC 5952. The mixed Ipv4 Ipv6 notation according to clause 5 of IETF RFC 5952 shall not be used. + description: string identifying a Ipv6 address formatted according to clause 4 in IETF RFC 5952. The mixed Ipv4 Ipv6 notation according to clause 5 of IETF RFC 5952 shall not be used. Ipv4AddrRo: type: string - description: string identifying a Ipv4 address formatted in the "dotted decimal" notation as defined in IETF RFC 1166, with "readOnly=true" property. + description: string identifying a Ipv4 address formatted in the "dotted decimal" notation as defined in IETF RFC 1166, with "readOnly=true" property. readOnly: true Ipv6AddrRo: type: string - description: string identifying a Ipv6 address formatted according to clause 4 in IETF RFC 5952, with "readOnly=true" property. The mixed Ipv4 Ipv6 notation according to clause 5 of IETF RFC 5952 shall not be used. + description: string identifying a Ipv6 address formatted according to clause 4 in IETF RFC 5952, with "readOnly=true" property. The mixed Ipv4 Ipv6 notation according to clause 5 of IETF RFC 5952 shall not be used. readOnly: true Link: type: string - description: string formatted according to IETF RFC 3986 identifying a referenced resource. + description: string formatted according to IETF RFC 3986 identifying a referenced resource. Mcc: type: string - description: String encoding a Mobile Country Code part of the PLMN, comprising 3 digits, as defined in 3GPP TS 38.413. + description: String encoding a Mobile Country Code part of the PLMN, comprising 3 digits, as defined in 3GPP TS 38.413. Mnc: type: string - description: String encoding a Mobile Network Code part of the PLMN, comprising 2 or 3 digits, as defined in 3GPP TS 38.413. + description: String encoding a Mobile Network Code part of the PLMN, comprising 2 or 3 digits, as defined in 3GPP TS 38.413. Msisdn: type: string - description: string formatted according to subclause 3.3 of 3GPP TS 23.003 that describes an MSISDN. + description: string formatted according to subclause 3.3 of 3GPP TS 23.003 that describes an MSISDN. Port: type: integer description: Unsigned integer with valid values between 0 and 65535. @@ -365,7 +365,7 @@ components: description: String with format partial-time or full-time as defined in subclause 5.6 of IETF RFC 3339. Examples, 20:15:00, 20:15:00-08:00 (for 8 hours behind UTC). Uri: type: string - description: string providing an URI formatted according to IETF RFC 3986. + description: string providing an URI formatted according to IETF RFC 3986. Volume: type: integer format: int64 diff --git a/lib/sbi/support/3gpp-spec/TS29122_PfdManagement.yaml b/lib/sbi/support/modified/TS29122_PfdManagement.yaml similarity index 99% rename from lib/sbi/support/3gpp-spec/TS29122_PfdManagement.yaml rename to lib/sbi/support/modified/TS29122_PfdManagement.yaml index f2637486f4..27cf4e6663 100644 --- a/lib/sbi/support/3gpp-spec/TS29122_PfdManagement.yaml +++ b/lib/sbi/support/modified/TS29122_PfdManagement.yaml @@ -4,7 +4,7 @@ info: version: 1.1.0.alpha-4 description: | API for PFD management. - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. externalDocs: description: 3GPP TS 29.122 V16.4.0 T8 reference point for Northbound APIs @@ -472,7 +472,7 @@ components: $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' requestTestNotification: type: boolean - description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in subclause 5.2.5.3. Set to false or omitted otherwise. + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in subclause 5.2.5.3. Set to false or omitted otherwise. websockNotifConfig: $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' required: @@ -508,7 +508,7 @@ components: items: type: string minItems: 1 - description: Represents a 3-tuple with protocol, server ip and server port for UL/DL application traffic. The content of the string has the same encoding as the IPFilterRule AVP value as defined in IETF RFC 6733. + description: Represents a 3-tuple with protocol, server ip and server port for UL/DL application traffic. The content of the string has the same encoding as the IPFilterRule AVP value as defined in IETF RFC 6733. urls: type: array items: diff --git a/lib/sbi/support/modified/TS29503_Nudm_EE.yaml b/lib/sbi/support/modified/TS29503_Nudm_EE.yaml new file mode 100644 index 0000000000..ca3c0441e1 --- /dev/null +++ b/lib/sbi/support/modified/TS29503_Nudm_EE.yaml @@ -0,0 +1,448 @@ +openapi: 3.0.0 + +info: + version: '1.1.0.alpha-4' + title: 'Nudm_EE' + description: | + Nudm Event Exposure Service. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 16.3.0 + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-ee/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-ee + - {} + +paths: + /{ueIdentity}/ee-subscriptions: + post: + summary: Subscribe + operationId: CreateEeSubscription + tags: + - Create EE Subscription + parameters: + - name: ueIdentity + in: path + description: Represents the scope of the UE for which the subscription is applied. Contains the GPSI of the user or the external group ID or any UE. + required: true + schema: + type: string + pattern: '^(msisdn-[0-9]{5,15}|.+|extid-[^@]+@[^@]+|extgroupid-[^@]+@[^@]+|anyUE)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EeSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/CreatedEeSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-ee/v1/{ueIdentity}/ee-subscriptions/{subscriptionId}' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + eventOccurrenceNotification: + '{request.body#/callbackReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/MonitoringReport' + minItems: 1 + responses: + '204': + description: Successful Notification response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueIdentity}/ee-subscriptions/{subscriptionId}: + delete: + summary: Unsubscribe + operationId: DeleteEeSubscription + tags: + - Delete EE Subscription + parameters: + - name: ueIdentity + in: path + description: Represents the scope of the UE for which the subscription is applied. Contains the GPSI of the user or the external group ID or any UE. + required: true + schema: + type: string + pattern: '^(msisdn-[0-9]{5,15}|.+|extid-[^@]+@[^@]+|extgroupid-[^@]+@[^@]+|anyUE)$' + - name: subscriptionId + in: path + description: Id of the EE Subscription + required: true + schema: + type: string + responses: + '204': + description: Successful response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + patch: + summary: Patch + operationId: UpdateEeSubscription + tags: + - Update EE Subscription + parameters: + - name: ueIdentity + in: path + description: Represents the scope of the UE for which the subscription is applied. Contains the GPSI of the user or the external group ID or any UE. + required: true + schema: + type: string + pattern: '^(msisdn-[0-9]{5,15}|.+|extid-[^@]+@[^@]+|extgroupid-[^@]+@[^@]+|anyUE)$' + - name: subscriptionId + in: path + description: Id of the EE Subscription + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Successful response + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + description: Unexpected error + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-ee: Access to the nudm-ee API + + + schemas: + +# COMPLEX TYPES: + + CreatedEeSubscription: + type: object + required: + - eeSubscription + properties: + eeSubscription: + $ref: '#/components/schemas/EeSubscription' + numberOfUes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + eventReports: + type: array + items: + $ref: '#/components/schemas/MonitoringReport' + minItems: 1 + + EeSubscription: + type: object + required: + - callbackReference + - monitoringConfigurations + properties: + callbackReference: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + monitoringConfigurations: + description: A map (list of key-value pairs where ReferenceId serves as key) of MonitoringConfigurations + type: object + additionalProperties: + $ref: '#/components/schemas/MonitoringConfiguration' + minProperties: 1 + reportingOptions: + $ref: '#/components/schemas/ReportingOptions' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + subscriptionId: + type: string + + + MonitoringConfiguration: + type: object + required: + - eventType + properties: + eventType: + $ref: '#/components/schemas/EventType' + immediateFlag: + type: boolean + locationReportingConfiguration: + $ref: '#/components/schemas/LocationReportingConfiguration' + associationType: + $ref: '#/components/schemas/AssociationType' + datalinkReportCfg: + $ref: '#/components/schemas/DatalinkReportingConfiguration' + + LocationReportingConfiguration: + type: object + required: + - currentLocation + properties: + currentLocation: + type: boolean + oneTime: + type: boolean + accuracy: + $ref: '#/components/schemas/LocationAccuracy' + n3gppAccuracy: + $ref: '#/components/schemas/LocationAccuracy' + + ReportingOptions: + type: object + properties: + reportMode: + $ref: '#/components/schemas/EventReportMode' + maxNumOfReports: + $ref: '#/components/schemas/MaxNumOfReports' + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + samplingRatio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + guardTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + reportPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + + MonitoringReport: + type: object + required: + - referenceId + - eventType + - timeStamp + properties: + referenceId: + $ref: '#/components/schemas/ReferenceId' + eventType: + $ref: '#/components/schemas/EventType' + report: + $ref: '#/components/schemas/Report' + reachabilityForSmsReport: + $ref: '#/components/schemas/ReachabilityForSmsReport' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + timeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + Report: + oneOf: + - $ref: '#/components/schemas/ChangeOfSupiPeiAssociationReport' + - $ref: '#/components/schemas/RoamingStatusReport' + - $ref: '#/components/schemas/CnTypeChangeReport' + - $ref: '#/components/schemas/CmInfoReport' + + ReachabilityForSmsReport: + type: object + required: + - smsfAccessType + properties: + smsfAccessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + + ChangeOfSupiPeiAssociationReport: + type: object + required: + - newPei + properties: + newPei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + + RoamingStatusReport: + type: object + required: + - roaming + - newServingPlmn + properties: + roaming: + type: + boolean + newServingPlmn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + + CnTypeChangeReport: + type: object + required: + - newCnType + properties: + newCnType: + $ref: '#/components/schemas/CnType' + oldCnType: + $ref: '#/components/schemas/CnType' + + DatalinkReportingConfiguration: + type: object + properties: + dddTrafficDes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DddTrafficDescriptor' + minItems: 1 + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + slice: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dddStatusList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DlDataDeliveryStatus' + minItems: 1 + + CmInfoReport: + type: object + properties: + oldCmInfoList: + type: array + items: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/CmInfo' + minItems: 1 + maxItems: 2 + newCmInfoList: + type: array + items: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/CmInfo' + minItems: 1 + maxItems: 2 + required: + - newCmInfoList + + +# SIMPLE TYPES: + + ReferenceId: + type: integer + + MaxNumOfReports: + type: integer + + +# ENUMS: + + EventType: + anyOf: + - type: string + enum: + - LOSS_OF_CONNECTIVITY + - UE_REACHABILITY_FOR_DATA + - UE_REACHABILITY_FOR_SMS + - LOCATION_REPORTING + - CHANGE_OF_SUPI_PEI_ASSOCIATION + - ROAMING_STATUS + - COMMUNICATION_FAILURE + - AVAILABILITY_AFTER_DDN_FAILURE + - CN_TYPE_CHANGE + - DL_DATA_DELIVERY_STATUS + - PDN_CONNECTIVITY_STATUS + - UE_CONNECTION_MANAGEMENT_STATE + - type: string + + LocationAccuracy: + anyOf: + - type: string + enum: + - CELL_LEVEL + - TA_LEVEL + - N3IWF_LEVEL + - UE_IP + - UE_PORT + - type: string + + CnType: + anyOf: + - type: string + enum: + - SINGLE_4G + - SINGLE_5G + - DUAL_4G5G + - type: string + + AssociationType: + anyOf: + - type: string + enum: + - IMEI_CHANGE + - IMEISV_CHANGE + - type: string + + EventReportMode: + anyOf: + - type: string + enum: + - PERIODIC + - ON_EVENT_DETECTION + - type: string + diff --git a/lib/sbi/support/modified/TS29503_Nudm_NIDDAU.yaml b/lib/sbi/support/modified/TS29503_Nudm_NIDDAU.yaml new file mode 100644 index 0000000000..62e1fae9f6 --- /dev/null +++ b/lib/sbi/support/modified/TS29503_Nudm_NIDDAU.yaml @@ -0,0 +1,169 @@ +openapi: 3.0.0 + +info: + version: '1.0.0.alpha-4' + title: 'Nudm_NIDDAU' + description: | + Nudm NIDD Authorization Service. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 16.3.0 + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-niddau/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-niddau + - {} + +paths: + /{ueIdentity}/authorize: + post: + summary: Authorize the NIDD configuration request. + operationId: AuthorizeNiddData + tags: + - Authorize the NIDD configuration request + parameters: + - name: ueIdentity + in: path + description: Represents the scope of the UE for which the NIDD configuration are authorized. Contains the GPSI of the user or the external group ID. + required: true + schema: + type: string + pattern: '^(msisdn-[0-9]{5,15}|.+|extid-[^@]+@[^@]+|extgroupid-[^@]+@[^@]+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthorizationInfo' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AuthorizationData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + niddAuthUpdateNotification: + '{request.body#/authUpdateCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NiddAuthUpdateNotification' + responses: + '204': + description: Expected response to a valid request + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-niddau: Access to the nudm-niddau API + + schemas: + +# COMPLEX TYPES: +# + AuthorizationData: + type: object + required: + - authorizationData + properties: + authorizationData: + type: array + items: + $ref: '#/components/schemas/UserIdentifier' + minItems: 1 + uniqueItems: true + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + UserIdentifier: + type: object + required: + - supi + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + NiddAuthUpdateInfo: + type: object + required: + - authorizationData + properties: + authorizationData: + $ref: '#/components/schemas/AuthorizationData' + invalidityInd: + type: boolean + + NiddAuthUpdateNotification: + type: object + required: + - niddAuthUpdateInfoList + properties: + niddAuthUpdateInfoList: + type: array + items: + $ref: '#/components/schemas/NiddAuthUpdateInfo' + minItems: 1 + + AuthorizationInfo: + type: object + required: + - snssai + - dnn + - mtcProviderInformation + - authUpdateCallbackUri + properties: + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + authUpdateCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + + +# SIMPLE TYPES: + + + +# ENUMS: + + diff --git a/lib/sbi/support/modified/TS29503_Nudm_PP.yaml b/lib/sbi/support/modified/TS29503_Nudm_PP.yaml new file mode 100644 index 0000000000..8d3d6e6ce6 --- /dev/null +++ b/lib/sbi/support/modified/TS29503_Nudm_PP.yaml @@ -0,0 +1,483 @@ +openapi: 3.0.0 + +info: + version: '1.1.0.alpha-3' + title: 'Nudm_PP' + description: | + Nudm Parameter Provision Service. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 16.3.0 + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-pp/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-pp + - {} + +paths: + /{ueId}/pp-data: + patch: + summary: provision parameters + operationId: Update + tags: + - Subscription Data Update + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/PpData' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /5g-vn-groups/{external-group-id}: + put: + summary: create a 5G VN Group + operationId: Create 5G VN Group + tags: + - 5G VN Group Creation + parameters: + - name: external-group-id + in: path + description: External Identifier of the Group + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/5GVnGroupConfiguration' + required: true + responses: + '201': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + delete: + summary: delete a 5G VN Group + operationId: Delete 5G VN Group + tags: + - 5G VN Group Deletion + parameters: + - name: external-group-id + in: path + description: External Identifier of the Group + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + responses: + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + patch: + summary: modify a 5G VN Group + operationId: Modify 5G VN Group + tags: + - 5G VN Group Modification + parameters: + - name: external-group-id + in: path + description: External Identifier of the group + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/5GVnGroupConfiguration' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-pp: Access to the nudm-pp API + + + schemas: + +# COMPLEX TYPES: + + PpData: + type: object + properties: + communicationCharacteristics: + $ref: '#/components/schemas/CommunicationCharacteristics' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + expectedUeBehaviourParameters: + $ref: '#/components/schemas/ExpectedUeBehaviour' + ecRestriction: + $ref: '#/components/schemas/EcRestriction' + acsInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AcsInfoRm' + stnSr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/StnSrRm' + lcsPrivacy: + $ref: '#/components/schemas/LcsPrivacy' + + CommunicationCharacteristics: + type: object + properties: + ppSubsRegTimer: + $ref: '#/components/schemas/PpSubsRegTimer' + ppActiveTime: + $ref: '#/components/schemas/PpActiveTime' + ppDlPacketCount: + $ref: '#/components/schemas/PpDlPacketCount' + ppDlPacketCountExt: + $ref: '#/components/schemas/PpDlPacketCountExt' + ppMaximumResponseTime: + $ref: '#/components/schemas/PpMaximumResponseTime' + ppMaximumLatency: + $ref: '#/components/schemas/PpMaximumLatency' + + + PpSubsRegTimer: + type: object + required: + - subsRegTimer + - afInstanceId + - referenceId + properties: + subsRegTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + afInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + referenceId: + $ref: '#/components/schemas/ReferenceId' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + nullable: true + + PpActiveTime: + type: object + required: + - activeTime + - afInstanceId + - referenceId + properties: + activeTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + afInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + referenceId: + $ref: '#/components/schemas/ReferenceId' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + nullable: true + + 5GVnGroupConfiguration: + type: object + properties: + 5gVnGroupData: + $ref: '#/components/schemas/5GVnGroupData' + members: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + referenceId: + $ref: '#/components/schemas/ReferenceId' + afInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + internalGroupIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + + 5GVnGroupData: + type: object + required: + - dnn + - sNssai + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + pduSessionTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + minItems: 1 + appDescriptors: + type: array + items: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/AppDescriptor' + minItems: 1 + + ExpectedUeBehaviour: + type: object + required: + - afInstanceId + - referenceId + properties: + afInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + referenceId: + $ref: '#/components/schemas/ReferenceId' + stationaryIndication: + $ref: 'TS29571_CommonData.yaml#/components/schemas/StationaryIndicationRm' + communicationDurationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + scheduledCommunicationType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ScheduledCommunicationTypeRm' + periodicTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + scheduledCommunicationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ScheduledCommunicationTimeRm' + expectedUmts: + type: array + items: + $ref: '#/components/schemas/LocationArea' + minItems: 1 + nullable: true + description: Identifies the UE's expected geographical movement. The attribute is only applicable in 5G. + trafficProfile: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TrafficProfileRm' + batteryIndication: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BatteryIndicationRm' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + LocationArea: + type: object + properties: + geographicAreas: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 0 + description: Identifies a list of geographic area of the user where the UE is located. + civicAddresses: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' + minItems: 0 + description: Identifies a list of civic addresses of the user where the UE is located. + nwAreaInfo: + $ref: '#/components/schemas/NetworkAreaInfo' + + NetworkAreaInfo: + description: Describes a network area information in which the NF service consumer requests the number of UEs. + type: object + properties: + ecgis: + description: Contains a list of E-UTRA cell identities. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + minItems: 1 + ncgis: + description: Contains a list of NR cell identities. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + minItems: 1 + gRanNodeIds: + description: Contains a list of NG RAN nodes. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + minItems: 1 + tais: + description: Contains a list of tracking area identities. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + + EcRestriction: + type: object + required: + - afInstanceId + - referenceId + properties: + afInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + referenceId: + $ref: '#/components/schemas/ReferenceId' + plmnEcInfos: + type: array + items: + $ref: '#/components/schemas/PlmnEcInfo' + minItems: 1 + + PlmnEcInfo: + type: object + required: + - plmnId + properties: + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + ecModeARestricted: + type: boolean + ecModeBRestricted: + type: boolean + + + PpDlPacketCountExt: + type: object + required: + - afInstanceId + - referenceId + properties: + afInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + referenceId: + $ref: '#/components/schemas/ReferenceId' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + nullable: true + + PpMaximumResponseTime: + type: object + required: + - maximumResponseTime + - afInstanceId + - referenceId + properties: + maximumResponseTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + afInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + referenceId: + $ref: '#/components/schemas/ReferenceId' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + nullable: true + + PpMaximumLatency: + type: object + required: + - maximumLatency + - afInstanceId + - referenceId + properties: + maximumLatency: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + afInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + referenceId: + $ref: '#/components/schemas/ReferenceId' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + nullable: true + + LcsPrivacy: + type: object + properties: + afInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + referenceId: + $ref: '#/components/schemas/ReferenceId' + lpi: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/Lpi' + + +# SIMPLE TYPES: + + ReferenceId: + type: integer + + PpDlPacketCount: + type: integer + nullable: true + + + +# ENUMS: + diff --git a/lib/sbi/support/modified/TS29503_Nudm_SDM.yaml b/lib/sbi/support/modified/TS29503_Nudm_SDM.yaml new file mode 100644 index 0000000000..0f16f52509 --- /dev/null +++ b/lib/sbi/support/modified/TS29503_Nudm_SDM.yaml @@ -0,0 +1,2744 @@ +openapi: 3.0.0 + +info: + version: '2.1.0.alpha-4' + title: 'Nudm_SDM' + description: | + Nudm Subscriber Data Management Service. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 16.3.0 + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-sdm/v2' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-sdm + - {} + +paths: + /{supi}: + get: + summary: retrieve multiple data sets + operationId: GetDataSets + tags: + - Retrieval of multiple data sets + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: dataset-names + in: query + style: form + explode: false + description: List of dataset names + required: true + schema: + $ref: '#/components/schemas/DatasetNames' + - name: plmn-id + in: query + description: serving PLMN ID + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionDataSets' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/nssai: + get: + summary: retrieve a UE's subscribed NSSAI + operationId: GetNSSAI + tags: + - Slice Selection Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + description: serving PLMN ID + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/Nssai' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/am-data: + get: + summary: retrieve a UE's Access and Mobility Subscription Data + operationId: GetAmData + tags: + - Access and Mobility Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + description: serving PLMN ID + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AccessAndMobilitySubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/am-data/ecr-data: + get: + summary: retrieve a UE's subscribed Enhanced Coverage Restriction Data + operationId: GetEcrData + tags: + - Enhanced Coverage Restriction Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/EnhancedCoverageRestrictionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/smf-select-data: + get: + summary: retrieve a UE's SMF Selection Subscription Data + operationId: GetSmfSelData + tags: + - SMF Selection Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + description: serving PLMN ID + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmfSelectionSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/ue-context-in-smf-data: + get: + summary: retrieve a UE's UE Context In SMF Data + operationId: GetUeCtxInSmfData + tags: + - UE Context In SMF Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextInSmfData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/ue-context-in-smsf-data: + get: + summary: retrieve a UE's UE Context In SMSF Data + operationId: GetUeCtxInSmsfData + tags: + - UE Context In SMSF Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextInSmsfData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/trace-data: + get: + summary: retrieve a UE's Trace Configuration Data + operationId: GetTraceConfigData + tags: + - Trace Configuration Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + description: serving PLMN ID + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/TraceDataResponse' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/sm-data: + get: + summary: retrieve a UE's Session Management Subscription Data + operationId: GetSmData + tags: + - Session Management Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: single-nssai + in: query + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + - name: dnn + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - name: plmn-id + in: query + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SessionManagementSubscriptionData' + minItems: 1 + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/sms-data: + get: + summary: retrieve a UE's SMS Subscription Data + operationId: GetSmsData + tags: + - SMS Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/sms-mng-data: + get: + summary: retrieve a UE's SMS Management Subscription Data + operationId: GetSmsMngtData + tags: + - SMS Management Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsManagementSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{ueId}/lcs-privacy-data: + get: + summary: retrieve a UE's LCS Privacy Subscription Data + operationId: GetLcsPrivacyData + tags: + - LCS Privacy Data Retrieval + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/LcsPrivacyData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{supi}/lcs-mo-data: + get: + summary: retrieve a UE's LCS Mobile Originated Subscription Data + operationId: GetLcsMoData + tags: + - LCS Mobile Originated Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/LcsMoData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{ueId}/sdm-subscriptions: + post: + summary: subscribe to notifications + operationId: Subscribe + tags: + - Subscription Creation + parameters: + - name: ueId + in: path + description: Identity of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SdmSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SdmSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-sdm//{supi}/sdm-subscriptions/{subscriptionId}' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + datachangeNotification: + '{request.body#/callbackReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ModificationNotification' + responses: + '204': + description: Successful Notification response + '307': + description: Temporary Redirect + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + headers: + Location: + description: 'Contains the new Callback URI of the target NF Service Consumer (e.g. AMF) to which the request is redirected' + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + headers: + Location: + description: 'Contains the new Callback URI of the target NF Service Consumer (e.g. AMF) to which the request is redirected' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{ueId}/sdm-subscriptions/{subscriptionId}: + delete: + summary: unsubscribe from notifications + operationId: Unsubscribe + tags: + - Subscription Deletion + parameters: + - name: ueId + in: path + description: Identity of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subscriptionId + in: path + description: Id of the SDM Subscription + required: true + schema: + type: string + responses: + '204': + description: Successful response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + patch: + summary: modify the subscription + operationId: Modify + tags: + - Subscription Modification + parameters: + - name: ueId + in: path + description: Identity of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subscriptionId + in: path + description: Id of the SDM Subscription + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/SdmSubsModification' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/SdmSubscription' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{ueId}/id-translation-result: + get: + summary: retrieve a UE's SUPI or GPSI + operationId: GetSupiOrGpsi + tags: + - GPSI to SUPI Translation + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: app-port-id + in: query + description: Application port identifier + content: + application/json: + schema: + $ref: '#/components/schemas/AppPortId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/IdTranslationResult' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/am-data/sor-ack: + put: + summary: Nudm_Sdm Info service operation + operationId: SorAckInfo + tags: + - Providing acknowledgement of Steering of Roaming + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AcknowledgeInfo' + responses: + '204': + description: Successful acknowledgement + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/am-data/upu-ack: + put: + summary: Nudm_Sdm Info for UPU service operation + operationId: UpuAck + tags: + - Providing acknowledgement of UE Parameters Update + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AcknowledgeInfo' + responses: + '204': + description: Successful acknowledgement + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/am-data/subscribed-snssais-ack: + put: + summary: Nudm_Sdm Info operation for S-NSSAIs acknowledgement + operationId: S-NSSAIs Ack + tags: + - Providing acknowledgement of S-NSSAIs Update + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AcknowledgeInfo' + responses: + '204': + description: Successful acknowledgement + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/am-data/cag-ack: + put: + summary: Nudm_Sdm Info operation for CAG acknowledgement + operationId: CAG Ack + tags: + - Providing acknowledgement of CAG Update + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AcknowledgeInfo' + responses: + '204': + description: Successful acknowledgement + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/am-data/update-sor: + post: + summary: Nudm_Sdm custom operation to trigger SOR info update + operationId: Update SOR Info + tags: + - Trigger SOR info update + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SorUpdateInfo' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SorInfo' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /shared-data: + get: + summary: retrieve shared data + operationId: GetSharedData + tags: + - Retrieval of shared data + parameters: + - name: shared-data-ids + in: query + description: List of shared data ids + required: true + style: form + explode: false + schema: + $ref: '#/components/schemas/SharedDataIds' + - name: supportedFeatures + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SharedData' + minItems: 1 + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /shared-data-subscriptions: + post: + summary: subscribe to notifications for shared data + operationId: SubscribeToSharedData + tags: + - Subscription Creation for shared data + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SdmSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SdmSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-sdm//shared-data-subscriptions/{subscriptionId}' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + description: Unexpected error + callbacks: + datachangeNotification: + '{request.body#/callbackReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ModificationNotification' + responses: + '204': + description: Successful Notification response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /shared-data-subscriptions/{subscriptionId}: + delete: + summary: unsubscribe from notifications for shared data + operationId: UnsubscribeForSharedData + tags: + - Subscription Deletion for shared data + parameters: + - name: subscriptionId + in: path + description: Id of the Shared data Subscription + required: true + schema: + type: string + responses: + '204': + description: Successful response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + patch: + summary: modify the subscription + operationId: ModifySharedDataSubs + tags: + - Subscription Modification + parameters: + - name: subscriptionId + in: path + description: Id of the SDM Subscription + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/SdmSubsModification' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/SdmSubscription' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /group-data/group-identifiers: + get: + summary: Mapping of Group Identifiers + operationId: GetGroupIdentifiers + tags: + - Group Identifiers + parameters: + - name: ext-group-id + in: query + description: External Group Identifier + required: false + schema: + $ref: '#/components/schemas/ExtGroupId' + - name: int-group-id + in: query + description: Internal Group Identifier + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + - name: ue-id-ind + in: query + description: Indication whether UE identifiers are required or not + required: false + schema: + type: boolean + default: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/GroupIdentifiers' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-sdm: Access to the nudm-sdm API + + schemas: + +# COMPLEX TYPES: + + DatasetNames: + type: array + items: + $ref: '#/components/schemas/DataSetName' + minItems: 2 + uniqueItems: true + + SubscriptionDataSets: + type: object + properties: + amData: + $ref: '#/components/schemas/AccessAndMobilitySubscriptionData' + smfSelData: + $ref: '#/components/schemas/SmfSelectionSubscriptionData' + uecSmfData: + $ref: '#/components/schemas/UeContextInSmfData' + uecSmsfData: + $ref: '#/components/schemas/UeContextInSmsfData' + smsSubsData: + $ref: '#/components/schemas/SmsSubscriptionData' + smData: + type: array + items: + $ref: '#/components/schemas/SessionManagementSubscriptionData' + minItems: 1 + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + smsMngData: + $ref: '#/components/schemas/SmsManagementSubscriptionData' + lcsPrivacyData: + $ref: '#/components/schemas/LcsPrivacyData' + lcsMoData: + $ref: '#/components/schemas/LcsMoData' + + UeContextInSmsfData: + type: object + properties: + smsfInfo3GppAccess: + $ref: '#/components/schemas/SmsfInfo' + smsfInfoNon3GppAccess: + $ref: '#/components/schemas/SmsfInfo' + + SmsfInfo: + type: object + required: + - smsfInstanceId + - plmnId + properties: + smsfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + + AccessAndMobilitySubscriptionData: + type: object + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + gpsis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + internalGroupIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + vnGroupInfo: + type: object + additionalProperties: + $ref: '#/components/schemas/VnGroupData' + minProperties: 1 + sharedVnGroupDataIds: + type: object + additionalProperties: + $ref: '#/components/schemas/SharedDataId' + minProperties: 1 + subscribedUeAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmbrRm' + nssai: + $ref: '#/components/schemas/Nssai' + ratRestrictions: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + forbiddenAreas: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Area' + serviceAreaRestriction: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' + coreNetworkTypeRestrictions: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CoreNetworkType' + rfspIndex: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndexRm' + subsRegTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + ueUsageType: + $ref: '#/components/schemas/UeUsageType' + mpsPriority: + $ref: '#/components/schemas/MpsPriorityIndicator' + mcsPriority: + $ref: '#/components/schemas/McsPriorityIndicator' + activeTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + dlPacketCount: + $ref: '#/components/schemas/DlPacketCount' + sorInfo: + $ref: '#/components/schemas/SorInfo' + sorInfoExpectInd: + type: boolean + sorafRetrieval: + type: boolean + default: false + sorUpdateIndicatorList: + type: array + items: + $ref: '#/components/schemas/SorUpdateIndicator' + minItems: 1 + upuInfo: + $ref: '#/components/schemas/UpuInfo' + micoAllowed: + $ref: '#/components/schemas/MicoAllowed' + sharedAmDataIds: + type: array + items: + $ref: '#/components/schemas/SharedDataId' + minItems: 1 + odbPacketServices: + $ref: 'TS29571_CommonData.yaml#/components/schemas/OdbPacketServices' + subscribedDnnList: + type: array + items: +# anyOf: +# - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' +# - $ref: 'TS29571_CommonData.yaml#/components/schemas/WildcardDnn' + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + serviceGapTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + cagData: + $ref: '#/components/schemas/CagData' + stnSr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/StnSr' + cMsisdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CMsisdn' + nbIoTUePriority: + $ref: '#/components/schemas/NbIoTUePriority' + nssaiInclusionAllowed: + type: boolean + default: false + rgWirelineCharacteristics: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RgWirelineCharacteristics' + rgTMBR: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tmbr' + ecRestrictionData: + $ref: '#/components/schemas/EcRestrictionData' + expectedUeBehaviourList: + $ref: '#/components/schemas/ExpectedUeBehaviourData' + maximumResponseTimeList: + type: array + items: + $ref: '#/components/schemas/MaximumResponseTime' + minItems: 1 + maximumLatencyList: + type: array + items: + $ref: '#/components/schemas/MaximumLatency' + minItems: 1 + primaryRatRestrictions: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + secondaryRatRestrictions: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + edrxParametersList: + type: array + items: + $ref: '#/components/schemas/EdrxParameters' + minItems: 1 + ptwParametersList: + type: array + items: + $ref: '#/components/schemas/PtwParameters' + minItems: 1 + iabOperationAllowed: + type: boolean + default: false + nrV2xServicesAuth: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NrV2xAuth' + lteV2xServicesAuth: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LteV2xAuth' + nrUePc5Ambr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + ltePc5Ambr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + + CagData: + type: object + required: + - cagInfos + properties: + cagInfos: + description: A map (list of key-value pairs where PlmnId serves as key) of CagInfo + type: object + additionalProperties: + $ref: '#/components/schemas/CagInfo' + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + CagInfo: + type: object + required: + - allowedCagList + properties: + allowedCagList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CagId' + cagOnlyIndicator: + type: boolean + + SmfSelectionSubscriptionData: + type: object + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + subscribedSnssaiInfos: + type: object + additionalProperties: + $ref: '#/components/schemas/SnssaiInfo' + sharedSnssaiInfosId: + $ref: '#/components/schemas/SharedDataId' + + SnssaiInfo: + type: object + required: + - dnnInfos + properties: + dnnInfos: + type: array + items: + $ref: '#/components/schemas/DnnInfo' + minItems: 1 + + DnnInfo: + type: object + required: + - dnn + properties: + dnn: +# anyOf: +# - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' +# - $ref: 'TS29571_CommonData.yaml#/components/schemas/WildcardDnn' + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + defaultDnnIndicator: + $ref: '#/components/schemas/DnnIndicator' + lboRoamingAllowed: + $ref: '#/components/schemas/LboRoamingAllowed' + iwkEpsInd: + $ref: '#/components/schemas/IwkEpsInd' + dnnBarred: + type: boolean + + Nssai: + type: object + required: + - defaultSingleNssais + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + defaultSingleNssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + singleNssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + additionalSnssaiData: + type: object + additionalProperties: + $ref: '#/components/schemas/AdditionalSnssaiData' + minProperties: 1 + nullable: true + + UeContextInSmfData: + type: object + properties: + pduSessions: + description: A map (list of key-value pairs where PduSessionId serves as key) of PduSessions + type: object + additionalProperties: + $ref: '#/components/schemas/PduSession' + pgwInfo: + type: array + items: + $ref: '#/components/schemas/PgwInfo' + minItems: 1 + emergencyInfo: + $ref: '#/components/schemas/EmergencyInfo' + + EmergencyInfo: + type: object + oneOf: + - required: + - pgwFqdn + - required: + - pgwIpAddress + properties: + pgwFqdn: + type: string + pgwIpAddress: + $ref: '#/components/schemas/IpAddress' + smfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + + + PduSession: + type: object + required: + - dnn + - smfInstanceId + - plmnId + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + smfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + + PgwInfo: + type: object + required: + - dnn + - pgwFqdn + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + pgwFqdn: + type: string + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + + SessionManagementSubscriptionData: + type: object + required: + - singleNssai + properties: + singleNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnnConfigurations: + description: A map (list of key-value pairs where Dnn, or optionally the Wildcard DNN, serves as key) of DnnConfigurations + type: object + additionalProperties: + $ref: '#/components/schemas/DnnConfiguration' + internalGroupIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + vnGroupInfo: + type: object + additionalProperties: + $ref: '#/components/schemas/VnGroupData' + minProperties: 1 + sharedVnGroupDataIds: + type: object + additionalProperties: + $ref: '#/components/schemas/SharedDataId' + minProperties: 1 + sharedDnnConfigurationsId: + $ref: '#/components/schemas/SharedDataId' + odbPacketServices: + $ref: 'TS29571_CommonData.yaml#/components/schemas/OdbPacketServices' + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + sharedTraceDataId: + $ref: '#/components/schemas/SharedDataId' + expectedUeBehavioursList: + type: object + additionalProperties: + $ref: '#/components/schemas/ExpectedUeBehaviourData' + minProperties: 1 + suggestedPacketNumDlList: + type: object + additionalProperties: + $ref: '#/components/schemas/SuggestedPacketNumDl' + minProperties: 1 + 3gppChargingCharacteristics: + $ref: '#/components/schemas/3GppChargingCharacteristics' + + DnnConfiguration: + type: object + required: + - pduSessionTypes + - sscModes + properties: + pduSessionTypes: + $ref: '#/components/schemas/PduSessionTypes' + sscModes: + $ref: '#/components/schemas/SscModes' + iwkEpsInd: + $ref: '#/components/schemas/IwkEpsInd' + 5gQosProfile: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SubscribedDefaultQos' + sessionAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + 3gppChargingCharacteristics: + $ref: '#/components/schemas/3GppChargingCharacteristics' + staticIpAddress: + type: array + items: + $ref: '#/components/schemas/IpAddress' + minItems: 1 + maxItems: 2 + upSecurity: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UpSecurity' + pduSessionContinuityInd: + $ref: '#/components/schemas/PduSessionContinuityInd' + invokeNefSelection: + type: boolean + niddNefId: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NefId' + niddInfo: + $ref: '#/components/schemas/NiddInformation' + redundantSessionAllowed: + type: boolean + acsInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AcsInfo' + ipv4FrameRouteList: + type: array + items: + $ref: '#/components/schemas/FrameRouteInfo' + minItems: 1 + ipv6FrameRouteList: + type: array + items: + $ref: '#/components/schemas/FrameRouteInfo' + minItems: 1 + atsssAllowed: + type: boolean + default: false + + NiddInformation: + type: object + required: + - afId + properties: + afId: + type: string + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + extGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExternalGroupId' + + IpAddress: + type: object + oneOf: + - required: + - ipv4Addr + - required: + - ipv6Addr + - required: + - ipv6Prefix + properties: + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + ipv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + + PduSessionTypes: + type: object + required: + - defaultSessionType + properties: + defaultSessionType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + allowedSessionTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + minItems: 1 + + SscModes: + type: object + required: + - defaultSscMode + properties: + defaultSscMode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SscMode' + allowedSscModes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SscMode' + minItems: 1 + maxItems: 2 + + SmsSubscriptionData: + type: object + properties: + smsSubscribed: + $ref: '#/components/schemas/SmsSubscribed' + sharedSmsSubsDataId: + $ref: '#/components/schemas/SharedDataId' + + SmsManagementSubscriptionData: + type: object + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + mtSmsSubscribed: + type: boolean + mtSmsBarringAll: + type: boolean + mtSmsBarringRoaming: + type: boolean + moSmsSubscribed: + type: boolean + moSmsBarringAll: + type: boolean + moSmsBarringRoaming: + type: boolean + sharedSmsMngDataIds: + type: array + items: + $ref: '#/components/schemas/SharedDataId' + minItems: 1 + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + + SdmSubscription: + type: object + required: + - nfInstanceId + - callbackReference + - monitoredResourceUris + properties: + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + implicitUnsubscribe: + type: boolean + expires: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + callbackReference: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + amfServiceName: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' + monitoredResourceUris: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + singleNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + subscriptionId: + type: string + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + immediateReport: + type: boolean + default: false + report: + $ref: '#/components/schemas/SubscriptionDataSets' + + SdmSubsModification: + type: object + properties: + expires: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + monitoredResourceUris: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + + ModificationNotification: + type: object + required: + - notifyItems + properties: + notifyItems: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NotifyItem' + minItems: 1 + + IdTranslationResult: + type: object + required: + - supi + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + + AcknowledgeInfo: + type: object + required: + - provisioningTime + properties: + sorMacIue: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SorMac' + upuMacIue: + $ref: 'TS29509_Nausf_UPUProtection.yaml#/components/schemas/UpuMac' + securedPacket: + $ref: '#/components/schemas/SecuredPacket' + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + SorInfo: + type: object + properties: + steeringContainer: + $ref: '#/components/schemas/SteeringContainer' + ackInd: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/AckInd' + sorMacIausf: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SorMac' + countersor: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/CounterSor' + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - ackInd + - provisioningTime + + SharedDataIds: + type: array + items: + $ref: '#/components/schemas/SharedDataId' + minItems: 1 + uniqueItems: true + + UpuInfo: + type: object + properties: + upuDataList: + type: array + items: + $ref: 'TS29509_Nausf_UPUProtection.yaml#/components/schemas/UpuData' + minItems: 1 + upuRegInd: + $ref: '#/components/schemas/UpuRegInd' + upuAckInd: + $ref: 'TS29509_Nausf_UPUProtection.yaml#/components/schemas/UpuAckInd' + upuMacIausf: + $ref: 'TS29509_Nausf_UPUProtection.yaml#/components/schemas/UpuMac' + counterUpu: + $ref: 'TS29509_Nausf_UPUProtection.yaml#/components/schemas/CounterUpu' + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - upuDataList + - upuAckInd + - upuRegInd + - provisioningTime + + + SharedData: + type: object + required: + - sharedDataId + properties: + sharedDataId: + $ref: '#/components/schemas/SharedDataId' + sharedAmData: + $ref: '#/components/schemas/AccessAndMobilitySubscriptionData' + sharedSmsSubsData: + $ref: '#/components/schemas/SmsSubscriptionData' + sharedSmsMngSubsData: + $ref: '#/components/schemas/SmsManagementSubscriptionData' + sharedDnnConfigurations: + type: object + additionalProperties: + $ref: '#/components/schemas/DnnConfiguration' + sharedTraceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + sharedSnssaiInfos: + type: object + additionalProperties: + $ref: '#/components/schemas/SnssaiInfo' + sharedVnGroupDatas: + type: object + additionalProperties: + $ref: '#/components/schemas/VnGroupData' + minProperties: 1 + + TraceDataResponse: + type: object + properties: + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + sharedTraceDataId: + $ref: '#/components/schemas/SharedDataId' + + SteeringContainer: + oneOf: + - type: array + items: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SteeringInfo' + minItems: 1 + - $ref: '#/components/schemas/SecuredPacket' + + GroupIdentifiers: + type: object + properties: + extGroupId: + $ref: '#/components/schemas/ExtGroupId' + intGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + ueIdList: + type: array + items: + $ref: '#/components/schemas/UeId' + minItems: 1 + + VnGroupData: + type: object + properties: + pduSessionTypes: + $ref: '#/components/schemas/PduSessionTypes' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + singleNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + appDescriptors: + type: array + items: + $ref: '#/components/schemas/AppDescriptor' + minItems: 1 + + AppDescriptor: + type: object + properties: + osId: + $ref: 'TS29519_Policy_Data.yaml#/components/schemas/OsId' + appId: + type: string + + AdditionalSnssaiData: + type: object + properties: + requiredAuthnAuthz: + type: boolean + + AppPortId: + type: object + properties: + destinationPort: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint16' + originatorPort: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint16' + + LcsPrivacyData: + type: object + properties: + lpi: + $ref: '#/components/schemas/Lpi' + unrelatedClasses: + type: array + items: + $ref: '#/components/schemas/UnrelatedClass' + minItems: 1 + plmnOperatorClasses: + type: array + items: + $ref: '#/components/schemas/PlmnOperatorClass' + minItems: 1 + + Lpi: + type: object + required: + - locationPrivacyInd + properties: + locationPrivacyInd: + $ref: '#/components/schemas/LocationPrivacyInd' + validTimePeriod: + $ref: '#/components/schemas/ValidTimePeriod' + + UnrelatedClass: + type: object + required: + - nonExternalUnrelatedClass + properties: + nonExternalUnrelatedClass: + $ref: '#/components/schemas/NonExternalUnrelatedClass' + externalUnrelatedClass: + $ref: '#/components/schemas/ExternalUnrelatedClass' + serviceTypeUnrelatedClasses: + type: array + items: + $ref: '#/components/schemas/ServiceTypeUnrelatedClass' + minItems: 1 + + PlmnOperatorClass: + type: object + required: + - lcsClientClass + - lcsClientIds + properties: + lcsClientClass: + $ref: '#/components/schemas/LcsClientClass' + lcsClientIds: + type: array + items: + $ref: '#/components/schemas/LcsClientId' + minItems: 1 + + ValidTimePeriod: + type: object + properties: + startTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + endTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + NonExternalUnrelatedClass: + properties: + lcsClientNonExternals: + type: array + items: + $ref: '#/components/schemas/LcsClientNonExternal' + minItems: 1 + afNonExternals: + type: array + items: + $ref: '#/components/schemas/AfNonExternal' + minItems: 1 + + LcsClientNonExternal: + type: object + required: + - lcsClientId + properties: + lcsClientId: + $ref: '#/components/schemas/LcsClientId' + allowedGeographicArea: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + privacyCheckRelatedAction: + $ref: '#/components/schemas/PrivacyCheckRelatedAction' + codeWordInd: + $ref: '#/components/schemas/CodeWordInd' + validTimePeriod: + $ref: '#/components/schemas/ValidTimePeriod' + + AfNonExternal: + type: object + required: + - afId + properties: + afId: + type: string + allowedGeographicArea: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + privacyCheckRelatedAction: + $ref: '#/components/schemas/PrivacyCheckRelatedAction' + codeWordInd: + $ref: '#/components/schemas/CodeWordInd' + validTimePeriod: + $ref: '#/components/schemas/ValidTimePeriod' + + ExternalUnrelatedClass: + properties: + lcsClientExternals: + type: array + items: + $ref: '#/components/schemas/LcsClientExternal' + minItems: 1 + afExternals: + type: array + items: + $ref: '#/components/schemas/AfExternal' + minItems: 1 + lcsClientGroupExternals: + type: array + items: + $ref: '#/components/schemas/LcsClientGroupExternal' + minItems: 1 + + AfExternal: + type: object + properties: + afId: + type: string + allowedGeographicArea: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + privacyCheckRelatedAction: + $ref: '#/components/schemas/PrivacyCheckRelatedAction' + validTimePeriod: + $ref: '#/components/schemas/ValidTimePeriod' + + LcsClientExternal: + type: object + properties: + allowedGeographicArea: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + privacyCheckRelatedAction: + $ref: '#/components/schemas/PrivacyCheckRelatedAction' + validTimePeriod: + $ref: '#/components/schemas/ValidTimePeriod' + + LcsClientGroupExternal: + type: object + properties: + lcsClientGroupId: + $ref: '#/components/schemas/ExtGroupId' + allowedGeographicArea: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + privacyCheckRelatedAction: + $ref: '#/components/schemas/PrivacyCheckRelatedAction' + validTimePeriod: + $ref: '#/components/schemas/ValidTimePeriod' + + ServiceTypeUnrelatedClass: + type: object + required: + - serviceType + properties: + serviceType: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LcsServiceType' + allowedGeographicArea: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + privacyCheckRelatedAction: + $ref: '#/components/schemas/PrivacyCheckRelatedAction' + codeWordInd: + $ref: '#/components/schemas/CodeWordInd' + validTimePeriod: + $ref: '#/components/schemas/ValidTimePeriod' + + LcsMoData: + type: object + required: + - allowedServiceClasses + properties: + allowedServiceClasses: + type: array + items: + $ref: '#/components/schemas/LcsMoServiceClass' + minItems: 1 + + EcRestrictionData: + type: object + properties: + ecModeARestricted: + type: boolean + ecModeBRestricted: + type: boolean + + ExpectedUeBehaviourData: + type: object + properties: + stationaryIndication: + $ref: 'TS29571_CommonData.yaml#/components/schemas/StationaryIndication' + communicationDurationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + periodicTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + scheduledCommunicationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ScheduledCommunicationTime' + scheduledCommunicationType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ScheduledCommunicationType' + expectedUmts: + type: array + items: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/LocationArea' + minItems: 1 + description: Identifies the UE's expected geographical movement. The attribute is only applicable in 5G. + trafficProfile: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TrafficProfile' + batteryIndication: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BatteryIndication' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + MaximumResponseTime: + type: object + required: + - maximumResponseTime + properties: + maximumResponseTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + MaximumLatency: + type: object + required: + - maximumLatency + properties: + maximumLatency: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + SuggestedPacketNumDl: + type: object + required: + - suggestedPacketNumDl + properties: + suggestedPacketNumDl: + type: integer + minimum: 1 + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + FrameRouteInfo: + type: object + properties: + ipv4Mask: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4AddrMask' + ipv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + + SorUpdateInfo: + type: object + required: + - vplmnId + properties: + vplmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + + EnhancedCoverageRestrictionData: + type: object + properties: + plmnEcInfoList: + type: array + items: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/PlmnEcInfo' + minItems: 1 + + EdrxParameters: + type: object + required: + - ratType + - edrxValue + properties: + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + edrxValue: + type: string + pattern: '^([0-1]{4})$' + + PtwParameters: + type: object + required: + - operationMode + - ptwValue + properties: + operationMode: + $ref: '#/components/schemas/OperationMode' + ptwValue: + type: string + pattern: '^([0-1]{4})$' + + UeId: + type: object + required: + - supi + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + +# SIMPLE TYPES: + + UeUsageType: + type: integer + + MpsPriorityIndicator: + type: boolean + + McsPriorityIndicator: + type: boolean + + DnnIndicator: + type: boolean + + LboRoamingAllowed: + type: boolean + + SmsSubscribed: + type: boolean + + 3GppChargingCharacteristics: + type: string + + DlPacketCount: + type: integer + minimum: -1 + + MicoAllowed: + type: boolean + + SharedDataId: + type: string + pattern: '^[0-9]{5,6}-.+$' + + IwkEpsInd: + type: boolean + + SecuredPacket: + type: string + format: base64 + + UpuRegInd: + type: boolean + + ExtGroupId: + type: string + pattern: '^extgroupid-[^@]+@[^@]+$' + + NbIoTUePriority: + type: integer + + CodeWord: + type: string + + AfId: + type: string + + LcsClientId: + type: string + + + +# ENUMS: + + DataSetName: +# anyOf: +# - type: string + enum: + - AM + - SMF_SEL + - UEC_SMF + - UEC_SMSF + - SMS_SUB + - SM + - TRACE + - SMS_MNG + - LCS_PRIVACY + - LCS_MO + type: string + + PduSessionContinuityInd: +# anyOf: +# - type: string + enum: + - MAINTAIN_PDUSESSION + - RECONNECT_PDUSESSION + - RELEASE_PDUSESSION + type: string + + LocationPrivacyInd: +# anyOf: +# - type: string + enum: + - LOCATION_DISALLOWED + - LOCATION_ALLOWED + type: string + + PrivacyCheckRelatedAction: +# anyOf: +# - type: string + enum: + - LOCATION_NOT_ALLOWED + - LOCATION_ALLOWED_WITH_NOTIFICATION + - LOCATION_ALLOWED_WITHOUT_NOTIFICATION + - LOCATION_ALLOWED_WITHOUT_RESPONSE + - LOCATION_RESTRICTED_WITHOUT_RESPONSE + type: string + + LcsClientClass: +# anyOf: +# - type: string + enum: + - BROADCAST_SERVICE + - OM_IN_HPLMN + - OM_IN_VPLMN + - ANONYMOUS_LOCATION_SERVICE + - SPECIFIC_SERVICE + type: string + + LcsMoServiceClass: +# anyOf: +# - type: string + enum: + - BASIC_SELF_LOCATION + - AUTONOMOUS_SELF_LOCATION + - TRANSFER_TO_THIRD_PARTY + type: string + + OperationMode: +# anyOf: +# - type: string + enum: + - WB_S1 + - NB_S1 + - WB_N1 + - NB_N1 + type: string + + SorUpdateIndicator: +# anyOf: +# - type: string + enum: + - INITIAL_REGISTRATION + - EMERGENCY_REGISTRATION + type: string + + CodeWordInd: +# anyOf: +# - type: string + enum: + - CODEWORD_CHECK_IN_UE + - CODEWORD_CHECK_IN_GMLC + type: string + diff --git a/lib/sbi/support/modified/TS29503_Nudm_UEAU.yaml b/lib/sbi/support/modified/TS29503_Nudm_UEAU.yaml new file mode 100644 index 0000000000..8de5fde8e5 --- /dev/null +++ b/lib/sbi/support/modified/TS29503_Nudm_UEAU.yaml @@ -0,0 +1,576 @@ +openapi: 3.0.0 +info: + version: '1.1.0.alpha-2' + title: 'NudmUEAU' + description: | + UDM UE Authentication Service. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 16.3.0 + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-ueau/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-ueau + - {} + +paths: + /{supiOrSuci}/security-information/generate-auth-data: + post: + summary: Generate authentication data for the UE + operationId: GenerateAuthData + tags: + - Generate Auth Data + parameters: + - name: supiOrSuci + in: path + description: SUPI or SUCI of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupiOrSuci' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticationInfoRequest' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticationInfoResult' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{supiOrSuci}/security-information-rg: + get: + summary: Get authentication data for the FN-RG + operationId: GetRgAuthData + tags: + - Get Auth Data for FN-RG + parameters: + - name: supiOrSuci + in: path + description: SUPI or SUCI of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupiOrSuci' + - name: authenticated-ind + in: query + description: Authenticated indication + required: true + schema: + $ref: '#/components/schemas/AuthenticatedInd' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + description: serving PLMN ID + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/RgAuthCtx' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{supi}/auth-events: + post: + summary: Create a new confirmation event + operationId: ConfirmAuth + tags: + - Confirm Auth + parameters: + - name: supi + in: path + description: SUPI of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthEvent' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AuthEvent' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-ueau/v1/{supi}/auth-events/{authEventId}' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{supi}/hss-security-information/generate-av: + post: + summary: Generate authentication data for the UE in EPS or IMS domain + operationId: GenerateAv + tags: + - Generate HSS Authentication Vectors + parameters: + - name: supi + in: path + description: SUPI of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/HssAuthenticationInfoRequest' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/HssAuthenticationInfoResult' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{supi}/auth-events/{authEventId}: + delete: + summary: Deletes the authentication result in the UDM + operationId: DeleteAuth + tags: + - Delete Auth + parameters: + - name: supi + in: path + description: SUPI of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: authEventId + in: path + description: authEvent Id + required: true + schema: + type: string + responses: + '204': + description: Expected response to a successful authentication result removal + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-ueau: Access to the nudm-ueau API + + + schemas: + +# COMPLEX TYPES: + + AuthenticationInfoRequest: + type: object + required: + - servingNetworkName + - ausfInstanceId + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + servingNetworkName: + $ref: '#/components/schemas/ServingNetworkName' + resynchronizationInfo: + $ref: '#/components/schemas/ResynchronizationInfo' + ausfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + cagId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CagId' + AuthenticationInfoResult: + type: object + required: + - authType + properties: + authType: + $ref: '#/components/schemas/AuthType' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + authenticationVector: + $ref: '#/components/schemas/AuthenticationVector' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + + AuthenticationVector: + oneOf: + - $ref: '#/components/schemas/AvEapAkaPrime' + - $ref: '#/components/schemas/Av5GHeAka' + discriminator: + propertyName: avType + mapping: + 5G_HE_AKA: '#/components/schemas/Av5GHeAka' + EAP_AKA_PRIME: '#/components/schemas/AvEapAkaPrime' + + AvEapAkaPrime: + type: object + required: + - avType + - rand +# - xres + - autn +# - ckPrime +# - ikPrime + properties: + avType: + $ref: '#/components/schemas/AvType' + rand: + $ref: '#/components/schemas/Rand' + xres: + $ref: '#/components/schemas/Xres' + autn: + $ref: '#/components/schemas/Autn' + ckPrime: + $ref: '#/components/schemas/CkPrime' + ikPrime: + $ref: '#/components/schemas/IkPrime' + + Av5GHeAka: + type: object + required: + - avType + - rand +# - xresStar + - autn +# - kausf + properties: + avType: + $ref: '#/components/schemas/AvType' + rand: + $ref: '#/components/schemas/Rand' + xresStar: + $ref: '#/components/schemas/XresStar' + autn: + $ref: '#/components/schemas/Autn' + kausf: + $ref: '#/components/schemas/Kausf' + + ResynchronizationInfo: + type: object + required: + - rand + - auts + properties: + rand: + $ref: '#/components/schemas/Rand' + auts: + $ref: '#/components/schemas/Auts' + + AuthEvent: + type: object + required: + - nfInstanceId + - success + - timeStamp + - authType + - servingNetworkName + properties: + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + success: + $ref: '#/components/schemas/Success' + timeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + authType: + $ref: '#/components/schemas/AuthType' + servingNetworkName: + $ref: '#/components/schemas/ServingNetworkName' + + RgAuthCtx: + type: object + required: + - authInd + properties: + authInd: + type: boolean + default: false + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + HssAuthenticationInfoRequest: + type: object + required: + - hssAuthType + - numOfRequestedVectors + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + hssAuthType: + $ref: '#/components/schemas/HssAuthType' + numOfRequestedVectors: + $ref: '#/components/schemas/NumOfRequestedVectors' + servingNetworkId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + resynchronizationInfo: + $ref: '#/components/schemas/ResynchronizationInfo' + + HssAuthenticationInfoResult: + type: object + required: + - hssAuthenticationVectors + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + hssAuthenticationVectors: + $ref: '#/components/schemas/HssAuthenticationVectors' + + HssAuthenticationVectors: + oneOf: + - type: array + items: + $ref: '#/components/schemas/AvEpsAka' + minItems: 1 + maxItems: 5 + - type: array + items: + $ref: '#/components/schemas/AvImsGbaEapAka' + minItems: 1 + maxItems: 5 + - type: array + items: + $ref: '#/components/schemas/AvEapAkaPrime' + minItems: 1 + maxItems: 5 + + AvEpsAka: + type: object + required: + - avType + - rand + - xres + - autn + - kasme + properties: + avType: + $ref: '#/components/schemas/HssAvType' + rand: + $ref: '#/components/schemas/Rand' + xres: + $ref: '#/components/schemas/Xres' + autn: + $ref: '#/components/schemas/Autn' + kasme: + $ref: '#/components/schemas/Kasme' + + AvImsGbaEapAka: + type: object + required: + - avType + - rand + - xres + - autn + - ck + - ik + properties: + avType: + $ref: '#/components/schemas/HssAvType' + rand: + $ref: '#/components/schemas/Rand' + xres: + $ref: '#/components/schemas/Xres' + autn: + $ref: '#/components/schemas/Autn' + ck: + $ref: '#/components/schemas/ConfidentialityKey' + ik: + $ref: '#/components/schemas/IntegrityKey' + + +# SIMPLE TYPES: + + Autn: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + Auts: + type: string + pattern: '^[A-Fa-f0-9]{28}$' + + CkPrime: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + IkPrime: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + Kausf: + type: string + pattern: '^[A-Fa-f0-9]{64}$' + + Rand: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + Xres: + type: string + pattern: '^[A-Fa-f0-9]{8,32}$' + + XresStar: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + ServingNetworkName: + type: string + pattern: '^5G:mnc[0-9]{3}[.]mcc[0-9]{3}[.]3gppnetwork[.]org(:[A-F0-9]{11})?$' + + Success: + type: boolean + + AuthenticatedInd: + type: boolean + + ConfidentialityKey: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + IntegrityKey: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + Kasme: + type: string + pattern: '^[A-Fa-f0-9]{64}$' + + NumOfRequestedVectors: + type: integer + minimum: 1 + maximum: 5 + + +# ENUMS: + + AuthType: +# anyOf: +# - type: string + enum: + - 5G_AKA + - EAP_AKA_PRIME + - EAP_TLS + type: string + + AvType: +# anyOf: +# - type: string + enum: + - 5G_HE_AKA + - EAP_AKA_PRIME + type: string + + HssAuthType: + anyOf: + - type: string + enum: + - EPS_AKA + - EAP_AKA + - EAP_AKA_PRIME + - IMS_AKA + - GBA_AKA + - type: string + + HssAvType: + anyOf: + - type: string + enum: + - EPS_AKA + - EAP_AKA + - IMS_AKA + - GBA_AKA + - type: string + diff --git a/lib/sbi/support/modified/TS29503_Nudm_UECM.yaml b/lib/sbi/support/modified/TS29503_Nudm_UECM.yaml new file mode 100644 index 0000000000..911534d1d9 --- /dev/null +++ b/lib/sbi/support/modified/TS29503_Nudm_UECM.yaml @@ -0,0 +1,1414 @@ +openapi: 3.0.0 + +info: + version: '1.1.0.alpha-3' + title: 'Nudm_UECM' + description: | + Nudm Context Management Service. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 16.3.0 + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-uecm/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-uecm + - {} + +paths: + /{ueId}/registrations/amf-3gpp-access: + put: + summary: register as AMF for 3GPP access + operationId: 3GppRegistration + tags: + - AMF registration for 3GPP access + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-uecm/v1/{ueId}/registrations/amf-3gpp-access' + required: true + schema: + type: string + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + deregistrationeNotification: + '{request.body#/deregCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DeregistrationData' + responses: + '204': + description: Successful Notification response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + pcscfRestorationNotification: + '{request.body#/pcscfRestorationCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PcscfRestorationNotification' + responses: + '204': + description: Successful Notification response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + patch: + summary: Update a parameter in the AMF registration for 3GPP access + operationId: Update3GppRegistration + tags: + - Parameter update in the AMF registration for 3GPP access + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistrationModification' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '422': + description: Unprocessable Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + get: + summary: retrieve the AMF registration for 3GPP access information + operationId: Get3GppRegistration + tags: + - AMF 3Gpp-access Registration Info Retrieval + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/amf-3gpp-access/dereg-amf: + post: + summary: trigger AMF for 3GPP access deregistration + operationId: deregAMF + tags: + - Trigger AMF for 3GPP access deregistration + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AmfDeregInfo' + required: true + responses: + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/amf-3gpp-access/pei-update: + post: + summary: Updates the PEI in the 3GPP access registration context + operationId: PeiUpdate + tags: + - PEI Update + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PeiUpdateInfo' + required: true + responses: + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/amf-non-3gpp-access: + put: + summary: register as AMF for non-3GPP access + operationId: Non3GppRegistration + tags: + - AMF registration for non-3GPP access + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AmfNon3GppAccessRegistration' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/AmfNon3GppAccessRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-uecm/v1/{ueId}/registrations/amf-non-3gpp-access' + required: true + schema: + type: string + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AmfNon3GppAccessRegistration' + '204': + description: No Content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + deregistrationeNotification: + '{request.body#/deregCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DeregistrationData' + responses: + '204': + description: Successful Notification response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + pcscfRestorationNotification: + '{request.body#/pcscfRestorationCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PcscfRestorationNotification' + responses: + '204': + description: Successful Notification response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + patch: + summary: update a parameter in the AMF registration for non-3GPP access + operationId: UpdateNon3GppRegistration + tags: + - Parameter update in the AMF registration for non-3GPP access + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/AmfNon3GppAccessRegistrationModification' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '422': + description: Unprocessable Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + get: + summary: retrieve the AMF registration for non-3GPP access information + operationId: GetNon3GppRegistration + tags: + - AMF non-3GPP-access Registration Info Retrieval + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AmfNon3GppAccessRegistration' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/smf-registrations: + get: + summary: retrieve the SMF registration information + operationId: GetSmfRegistration + tags: + - SMF SmfRegistration + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: single-nssai + in: query + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + - name: dnn + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - name: supported-features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegistrationInfo' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/smf-registrations/{pduSessionId}: + put: + summary: register as SMF + operationId: Registration + tags: + - SMF SmfRegistration + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: pduSessionId + in: path + description: Identifier of the PDU session + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegistration' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-uecm/v1/{ueId}/registrations/smf-registrations/{pduSessionId}' + required: true + schema: + type: string + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegistration' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + deregistrationeNotification: + '{request.body#/deregCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DeregistrationData' + responses: + '204': + description: Successful Notification response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + pcscfRestorationNotification: + '{request.body#/pcscfRestorationCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PcscfRestorationNotification' + responses: + '204': + description: Successful Notification response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + delete: + summary: delete an SMF registration + operationId: SmfDeregistration + tags: + - SMF Deregistration + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: pduSessionId + in: path + description: Identifier of the PDU session + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + - name: smf-set-id + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + responses: + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '422': + description: Unprocessable Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + get: + summary: get an SMF registration + operationId: RetrieveSmfRegistration + tags: + - Retrieve SMF Registration + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: pduSessionId + in: path + description: Identifier of the PDU session + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegistration' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/smsf-3gpp-access: + put: + summary: register as SMSF for 3GPP access + operationId: 3GppSmsfRegistration + tags: + - SMSF registration for 3GPP access + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-uecm/v1/{ueId}/registrations/smsf-3gpp-access' + required: true + schema: + type: string + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + delete: + summary: delete the SMSF registration for 3GPP access + operationId: 3GppSmsfDeregistration + tags: + - SMSF Deregistration for 3GPP Access + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: smsf-set-id + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + responses: + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '422': + description: Unprocessable Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + get: + summary: retrieve the SMSF registration for 3GPP access information + operationId: Get3GppSmsfRegistration + tags: + - SMSF 3GPP access Registration Info Retrieval + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + - name: supported-features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/smsf-non-3gpp-access: + put: + summary: register as SMSF for non-3GPP access + operationId: Non3GppSmsfRegistration + tags: + - SMSF registration for non-3GPP access + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-uecm/v1/{ueId}/registrations/smsf-non-3gpp-access' + required: true + schema: + type: string + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + delete: + summary: delete SMSF registration for non 3GPP access + operationId: Non3GppSmsfDeregistration + tags: + - SMSF Deregistration for non-3GPP access + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: smsf-set-id + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + responses: + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '422': + description: Unprocessable Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + get: + summary: retrieve the SMSF registration for non-3GPP access information + operationId: GetNon3GppSmsfRegistration + tags: + - SMSF non-3GPP access Registration Info Retrieval + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + - name: supported-features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /restore-pcscf: + post: + summary: Trigger the Restoration of the P-CSCF + operationId: Trigger P-CSCF Restoration + tags: + - Trigger P-CSCF Restoration + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TriggerRequest' + required: true + responses: + '204': + description: Successful response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/loation: + get: + summary: retrieve the target UE’s location information + operationId: GetLocationInfo + tags: + - UE Location Information retrieval + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/LocationInfo' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-uecm: Access to the nudm-uecm API + + schemas: + +# COMPLEX TYPES: + + Amf3GppAccessRegistration: + type: object + required: + - amfInstanceId + - deregCallbackUri + - guami + - ratType + properties: + amfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + purgeFlag: + $ref: '#/components/schemas/PurgeFlag' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + imsVoPs: + $ref: '#/components/schemas/ImsVoPs' + deregCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + amfServiceNameDereg: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' + pcscfRestorationCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + amfServiceNamePcscfRest: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' + initialRegistrationInd: + type: boolean + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + backupAmfInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BackupAmfInfo' + minItems: 1 + drFlag: + $ref: '#/components/schemas/DualRegistrationFlag' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + urrpIndicator: + type: boolean + amfEeSubscriptionId: + type: string +# epsInterworkingInfo: +# $ref: '#/components/schemas/EpsInterworkingInfo' + ueSrvccCapability: + type: boolean + nid: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Nid' + registrationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + vgmlcAddressIpv4: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + vgmlcAddressIpv6: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + vgmlcFqdn: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/Fqdn' + + + Amf3GppAccessRegistrationModification: + type: object + required: + - guami + properties: + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + purgeFlag: + $ref: '#/components/schemas/PurgeFlag' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + imsVoPs: + $ref: '#/components/schemas/ImsVoPs' + backupAmfInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BackupAmfInfo' + epsInterworkingInfo: + $ref: '#/components/schemas/EpsInterworkingInfo' + ueSrvccCapability: + type: boolean + nullable: true + + EpsInterworkingInfo: + type: object + properties: + epsIwkPgws: + description: A map (list of key-value pairs where Dnn serves as key) of EpsIwkPgws + type: object + additionalProperties: + $ref: '#components/schemas/EpsIwkPgw' + + EpsIwkPgw: + type: object + required: + - pgwFqdn + - smfInstanceId + properties: + pgwFqdn: + type: string + smfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + + AmfNon3GppAccessRegistration: + type: object + required: + - amfInstanceId + - imsVoPs + - deregCallbackUri + - guami + - ratType + properties: + amfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + purgeFlag: + $ref: '#/components/schemas/PurgeFlag' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + imsVoPs: + $ref: '#/components/schemas/ImsVoPs' + deregCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + amfServiceNameDereg: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' + pcscfRestorationCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + amfServiceNamePcscfRest: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + backupAmfInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BackupAmfInfo' + minItems: 1 + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + urrpIndicator: + type: boolean + amfEeSubscriptionId: + type: string + nid: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Nid' + registrationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + vgmlcAddressIpv4: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + vgmlcAddressIpv6: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + vgmlcFqdn: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/Fqdn' + + + AmfNon3GppAccessRegistrationModification: + type: object + required: + - guami + properties: + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + purgeFlag: + $ref: '#/components/schemas/PurgeFlag' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + imsVoPs: + $ref: '#/components/schemas/ImsVoPs' + backupAmfInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BackupAmfInfo' + + SmfRegistration: + type: object + required: + - smfInstanceId + - pduSessionId + - singleNssai + - plmnId + properties: + smfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + smfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + singleNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + emergencyServices: + type: boolean + pcscfRestorationCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + pgwFqdn: + type: string + epdgInd: + type: boolean + default: false + deregCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + registrationReason: + $ref: '#/components/schemas/RegistrationReason' + registrationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + SmsfRegistration: + type: object + required: + - smsfInstanceId + - plmnId + properties: + smsfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + smsfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + smsfMAPAddress: + $ref: '#/components/schemas/E164Number' + smsfDiameterAddress: + $ref: '#/components/schemas/NetworkNodeDiameterAddress' + registrationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + DeregistrationData: + type: object + required: + - deregReason + - accessType + properties: + deregReason: + $ref: '#/components/schemas/DeregistrationReason' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + newSmfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + + PcscfRestorationNotification: + type: object + required: + - supi + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + + NetworkNodeDiameterAddress: + type: object + required: + - name + - realm + properties: + name: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + realm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + + TriggerRequest: + type: object + required: + - supi + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + + SmfRegistrationInfo: + type: object + required: + - smfRegistrationList + properties: + smfRegistrationList: + type: array + items: + $ref: '#/components/schemas/SmfRegistration' + minItems: 1 + + AmfDeregInfo: + type: object + required: + - deregReason + properties: + deregReason: + $ref: '#/components/schemas/DeregistrationReason' + + LocationInfo: + type: object + required: + - registrationLocationInfoList + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + registrationLocationInfoList: + type: array + items: + $ref: '#/components/schemas/RegistrationLocationInfo' + minItems: 1 + maxItems: 2 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + RegistrationLocationInfo: + type: object + + CmInfoReport: + type: object + required: + - newCmInfoList + properties: + oldCmInfoList: + type: array + items: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/CmInfo' + minItems: 1 + maxItems: 2 + newCmInfoList: + type: array + items: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/CmInfo' + minItems: 1 + maxItems: 2 + + VgmlcAddress: + type: object + properties: + vgmlcAddressIpv4: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + vgmlcAddressIpv6: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + vgmlcFqdn: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/Fqdn' + + PeiUpdateInfo: + type: object + required: + - pei + properties: + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + + +# SIMPLE TYPES: + + PurgeFlag: + type: boolean + + E164Number: + type: string + pattern: '^[0-9]{1,15}$' + + DualRegistrationFlag: + type: boolean + +# ENUMS: + + ImsVoPs: + anyOf: + - type: string + enum: + - HOMOGENEOUS_SUPPORT + - HOMOGENEOUS_NON_SUPPORT + - NON_HOMOGENEOUS_OR_UNKNOWN + - type: string + + DeregistrationReason: + anyOf: + - type: string + enum: + - UE_INITIAL_REGISTRATION + - UE_REGISTRATION_AREA_CHANGE + - SUBSCRIPTION_WITHDRAWN + - 5GS_TO_EPS_MOBILITY + - 5GS_TO_EPS_MOBILITY_UE_INITIAL_REGISTRATION + - REREGISTRATION_REQUIRED + - SMF_CONTEXT_TRANSFERRED + - type: string + + RegistrationReason: + anyOf: + - type: string + enum: + - SMF_CONTEXT_TRANSFERRED + - type: string + diff --git a/lib/sbi/support/modified/TS29504_Nudr_DR.yaml b/lib/sbi/support/modified/TS29504_Nudr_DR.yaml new file mode 100644 index 0000000000..92231b905f --- /dev/null +++ b/lib/sbi/support/modified/TS29504_Nudr_DR.yaml @@ -0,0 +1,172 @@ +openapi: 3.0.0 + +info: + version: 2.1.0.alpha-4 + title: 'Nudr_DataRepository API OpenAPI file' + description: | + Unified Data Repository Service. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.504 V16.3.0; 5G System; Unified Data Repository Services; Stage 3 + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.504/' + +servers: + - description: API root + url: '{apiRoot}/nudr-dr/v2' + variables: + apiRoot: + default: https://example.com + +security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + +paths: + /subscription-data/{ueId}/authentication-data/authentication-subscription: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1authentication-data~1authentication-subscription' + /subscription-data/{ueId}/authentication-data/authentication-status: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1authentication-data~1authentication-status' + /subscription-data/{ueId}/ue-update-confirmation-data/sor-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1ue-update-confirmation-data~1sor-data' + /subscription-data/{ueId}/ue-update-confirmation-data/upu-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1ue-update-confirmation-data~1upu-data' + /subscription-data/{ueId}/ue-update-confirmation-data/subscribed-cag: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1ue-update-confirmation-data~1subscribed-cag' + /subscription-data/{ueId}/ue-update-confirmation-data/subscribed-snssais: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1ue-update-confirmation-data~1subscribed-snssais' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/am-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data~1am-data' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/smf-selection-subscription-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data~1smf-selection-subscription-data' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/sm-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data~1sm-data' + /subscription-data/{ueId}/context-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data' + /subscription-data/{ueId}/context-data/amf-3gpp-access: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1amf-3gpp-access' + /subscription-data/{ueId}/context-data/amf-non-3gpp-access: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1amf-non-3gpp-access' + /subscription-data/{ueId}/context-data/smf-registrations: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1smf-registrations' + /subscription-data/{ueId}/context-data/smf-registrations/{pduSessionId}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1smf-registrations~1%7BpduSessionId%7D' + /subscription-data/{ueId}/operator-specific-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1operator-specific-data' + /subscription-data/{ueId}/context-data/smsf-3gpp-access: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1smsf-3gpp-access' + /subscription-data/{ueId}/context-data/smsf-non-3gpp-access: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1smsf-non-3gpp-access' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/sms-mng-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data~1sms-mng-data' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/sms-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data~1sms-data' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/lcs-privacy-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data~1lcs-privacy-data' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/lcs-mo-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data~1lcs-mo-data' + /subscription-data/{ueId}/pp-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1pp-data' + /subscription-data/{ueId}/context-data/ee-subscriptions: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1ee-subscriptions' + /subscription-data/{ueId}/context-data/ee-subscriptions/{subsId}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1ee-subscriptions~1%7BsubsId%7D' + /subscription-data/{ueId}/context-data/ee-subscriptions/{subsId}/amf-subscriptions: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1ee-subscriptions~1%7BsubsId%7D~1amf-subscriptions' + /subscription-data/group-data/{ueGroupId}/ee-subscriptions: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~1%7BueGroupId%7D~1ee-subscriptions' + /subscription-data/group-data/{ueGroupId}/ee-subscriptions/{subsId}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~1%7BueGroupId%7D~1ee-subscriptions~1%7BsubsId%7D' + /subscription-data/group-data/5g-vn-groups: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~15g-vn-groups' + /subscription-data/group-data/5g-vn-groups/{externalGroupId}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~15g-vn-groups~1%7BexternalGroupId%7D' + /subscription-data/{ueId}/ee-profile-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1ee-profile-data' + /subscription-data/{ueId}/context-data/sdm-subscriptions: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1sdm-subscriptions' + /subscription-data/{ueId}/context-data/sdm-subscriptions/{subsId}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1sdm-subscriptions~1%7BsubsId%7D' + /subscription-data/shared-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1shared-data' + /subscription-data/subs-to-notify: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1subs-to-notify' + /subscription-data/subs-to-notify/{subsId}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1subs-to-notify~1%7BsubsId%7D' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/trace-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data~1trace-data' + /subscription-data/{ueId}/identity-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1identity-data' + /subscription-data/{ueId}/operator-determined-barring-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1operator-determined-barring-data' + /subscription-data/{ueId}/nidd-authorization-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1nidd-authorization-data' + /subscription-data/group-data/group-identifiers: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~1group-identifiers' + /policy-data/ues/{ueId}/am-data: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1ues~1%7BueId%7D~1am-data' + /policy-data/ues/{ueId}/ue-policy-set: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1ues~1%7BueId%7D~1ue-policy-set' + /policy-data/ues/{ueId}/sm-data: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1ues~1%7BueId%7D~1sm-data' + /policy-data/ues/{ueId}/sm-data/{usageMonId}: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1ues~1%7BueId%7D~1sm-data~1%7BusageMonId%7D' + /policy-data/sponsor-connectivity-data/{sponsorId}: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1sponsor-connectivity-data~1%7BsponsorId%7D' + /policy-data/bdt-data: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1bdt-data' + /policy-data/bdt-data/{bdtReferenceId}: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1bdt-data~1%7BbdtReferenceId%7D' + /policy-data/subs-to-notify: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1subs-to-notify' + /policy-data/subs-to-notify/{subsId}: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1subs-to-notify~1%7BsubsId%7D' + /policy-data/ues/{ueId}/operator-specific-data: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1ues~1%7BueId%7D~1operator-specific-data' + /application-data/pfds: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1pfds' + /application-data/pfds/{appId}: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1pfds~1%7BappId%7D' + /application-data/influenceData: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1influenceData' + /application-data/influenceData/{influenceId}: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1influenceData~1%7BinfluenceId%7D' + /policy-data/plmns/{plmnId}/ue-policy-set: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1plmns~1%7BplmnId%7D~1ue-policy-set' + /application-data/bdtPolicyData: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1bdtPolicyData' + /application-data/bdtPolicyData/{bdtPolicyId}: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1bdtPolicyData~1%7BbdtPolicyId%7D' + /application-data/iptvConfigData: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1iptvConfigData' + /application-data/iptvConfigData/{configurationId}: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1iptvConfigData~1%7BconfigurationId%7D' + /application-data/influenceData/subs-to-notify: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1influenceData~1subs-to-notify' + /application-data/influenceData/subs-to-notify/{subscriptionId}: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1influenceData~1subs-to-notify~1%7BsubscriptionId%7D' + /application-data/subs-to-notify: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1subs-to-notify' + /application-data/subs-to-notify/{subsId}: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1subs-to-notify~1%7BsubsId%7D' + /exposure-data/{ueId}/access-and-mobility-data: + $ref: 'TS29519_Exposure_Data.yaml#/paths/~1exposure-data~1%7BueId%7D~1access-and-mobility-data' + /exposure-data/{ueId}/session-management-data/{pduSessionId}: + $ref: 'TS29519_Exposure_Data.yaml#/paths/~1exposure-data~1%7BueId%7D~1session-management-data~1%7BpduSessionId%7D' + /exposure-data/subs-to-notify: + $ref: 'TS29519_Exposure_Data.yaml#/paths/~1exposure-data~1subs-to-notify' + /exposure-data/subs-to-notify/{subId}: + $ref: 'TS29519_Exposure_Data.yaml#/paths/~1exposure-data~1subs-to-notify~1%7BsubId%7D' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudr-dr: Access to the Nudr_DataRepository API diff --git a/lib/sbi/support/modified/TS29505_Subscription_Data.yaml b/lib/sbi/support/modified/TS29505_Subscription_Data.yaml new file mode 100644 index 0000000000..6438ea68fc --- /dev/null +++ b/lib/sbi/support/modified/TS29505_Subscription_Data.yaml @@ -0,0 +1,3645 @@ +openapi: 3.0.0 +info: + version: '-' + title: 'Unified Data Repository Service API file for subscription data' + description: | + Unified Data Repository Service (subscription data). + The API version is defined in 3GPP TS 29.504. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.505 V16.2.0; 5G System; Usage of the Unified Data Repository Service for subscription data; Stage 3 + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.505/' + +paths: + + /subscription-data/{ueId}/authentication-data/authentication-subscription: + get: + summary: Retrieves the authentication subscription data of a UE + operationId: QueryAuthSubsData + tags: + - Authentication Data (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticationSubscription' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + patch: + summary: modify the authentication subscription data of a UE + operationId: ModifyAuthenticationSubscription + tags: + - Authentication Subscription (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/authentication-data/authentication-status: + put: + summary: To store the Authentication Status data of a UE + operationId: CreateAuthenticationStatus + tags: + - Authentication Status (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/AuthEvent' + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + get: + summary: Retrieves the Authentication Status of a UE + operationId: QueryAuthenticationStatus + tags: + - AuthEvent (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + description: Supported Features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/AuthEvent' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + delete: + summary: To remove the Authentication Status of a UE + operationId: DeleteAuthenticationStatus + tags: + - AuthEvent (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '204': + description: Upon success, an empty response body shall be returned. + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/ue-update-confirmation-data/sor-data: + put: + summary: To store the SoR acknowledgement information of a UE + operationId: CreateAuthenticationSoR + tags: + - Authentication SoR (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SorData' + responses: + '204': + description: Expected response to a valid request + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + get: + summary: Retrieves the SoR acknowledgement information of a UE + operationId: QueryAuthSoR + tags: + - Authentication SoR (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supportedFeatures + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SorData' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/ue-update-confirmation-data/upu-data: + put: + summary: To store the UPU acknowledgement information of a UE + operationId: CreateAuthenticationUPU + tags: + - Authentication UPU (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpuData' + responses: + '204': + description: Expected response to a valid request + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + get: + summary: Retrieves the UPU acknowledgement information of a UE + operationId: QueryAuthUPU + tags: + - Authentication UPU (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supportedFeatures + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/UpuData' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/ue-update-confirmation-data/subscribed-snssais: + put: + summary: To store the NSSAI update acknowledgement information of a UE + operationId: Create NSSAI update ack + tags: + - NSSAI update ack (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NssaiAckData' + responses: + '204': + description: Expected response to a valid request + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + get: + summary: Retrieves the UPU acknowledgement information of a UE + operationId: QueryNssaiAck + tags: + - NSSAI ACK (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supportedFeatures + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/NssaiAckData' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/ue-update-confirmation-data/subscribed-cag: + put: + summary: To store the CAG update acknowledgement information of a UE + operationId: CreateCagUpdateAck + tags: + - CAG update ack (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CagAckData' + responses: + '204': + description: Expected response to a valid request + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + get: + summary: Retrieves the CAG acknowledgement information of a UE + operationId: QueryCagAck + tags: + - CAG ACK (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/CagAckData' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data: + get: + summary: Retrieve multiple provisioned data sets of a UE + operationId: QueryProvisionedData + tags: + - Provisioned Data (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: dataset-names + in: query + description: List of dataset names + style: form + explode: false + schema: + $ref: '#/components/schemas/DatasetNames' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ProvisionedDataSets' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/am-data: + get: + summary: Retrieves the access and mobility subscription data of a UE + operationId: QueryAmData + tags: + - Access And Mobility Subscription Data (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AccessAndMobilitySubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/smf-selection-subscription-data: + get: + summary: Retrieves the SMF selection subscription data of a UE + operationId: QuerySmfSelectData + tags: + - SMF Selection Subscription Data (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmfSelectionSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/sm-data: + get: + summary: Retrieves the Session Management subscription data of a UE + operationId: QuerySmData + tags: + - Session Management Subscription Data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: single-nssai + in: query + content: + application/json: + schema: + $ref: '#/components/schemas/VarSnssai' + description: single NSSAI + required: false + - name: dnn + in: query + description: DNN + required: false + schema: + $ref: '#/components/schemas/Dnn' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SessionManagementSubscriptionData' + minItems: 1 + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/context-data/amf-3gpp-access: + get: + summary: Retrieves the AMF context data of a UE using 3gpp access + operationId: QueryAmfContext3gpp + tags: + - AMF 3GPP Access Registration (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + put: + summary: To store the AMF context data of a UE using 3gpp access in the UDR + operationId: CreateAmfContext3gpp + tags: + - AMF 3GPP Access Registration (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + patch: + summary: To modify the AMF context data of a UE using 3gpp access in the UDR + operationId: AmfContext3gpp + tags: + - AMF 3GPP Access Registration (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/context-data/amf-non-3gpp-access: + get: + summary: Retrieves the AMF context data of a UE using non-3gpp access + operationId: QueryAmfContextNon3gpp + tags: + - AMF Non-3GPP Access Registration (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AmfNon3GppAccessRegistration' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + put: + summary: To store the AMF context data of a UE using non-3gpp access in the UDR + operationId: CreateAmfContextNon3gpp + tags: + - AMF Non-3GPP Access Registration (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AmfNon3GppAccessRegistration' + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + patch: + summary: To modify the AMF context data of a UE using non 3gpp access in the UDR + operationId: AmfContextNon3gpp + tags: + - AMF Non-3GPP Access Registration (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/context-data/smf-registrations: + get: + summary: Retrieves the SMF registration list of a UE + operationId: QuerySmfRegList + tags: + - SMF Registrations (Collection) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegList' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/context-data/smf-registrations/{pduSessionId}: + get: + summary: Retrieves the individual SMF registration of a UE + operationId: QuerySmfRegistration + tags: + - SMF Registration (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: pduSessionId + in: path + description: PDU session id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegistration' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + put: + summary: To create an individual SMF context data of a UE in the UDR + operationId: CreateSmfContextNon3gpp + tags: + - SMF Registration (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: pduSessionId + in: path + description: PDU session id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegistration' + responses: + '201': + description: Upon success, a response body containing a representation of the created Individual SmfRegistration resource shall be returned + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/{ueId}/context-data/smf-registrations/{pduSessionId}' + required: true + schema: + type: string + delete: + summary: To remove an individual SMF context data of a UE the UDR + operationId: DeleteSmfContext + tags: + - SMF Registration (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: pduSessionId + in: path + description: PDU session id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + responses: + '204': + description: Upon success, an empty response body shall be returned. + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/operator-specific-data: + get: + summary: Retrieves the operator specific data of a UE + operationId: QueryOperSpecData + tags: + - Operator-Specific Data Container (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: object + additionalProperties: + $ref: '#/components/schemas/OperatorSpecificDataContainer' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + patch: + summary: To modify operator specific data of a UE + operationId: ModifyOperSpecData + tags: + - Operator-Specific Data Container (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/context-data/smsf-3gpp-access: + put: + summary: Create the SMSF context data of a UE via 3GPP access + operationId: CreateSmsfContext3gpp + tags: + - SMSF 3GPP Registration (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + delete: + summary: To remove the SMSF context data of a UE via 3GPP access + operationId: DeleteSmsfContext3gpp + tags: + - SMSF 3GPP Registration (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + get: + summary: Retrieves the SMSF context data of a UE using 3gpp access + operationId: QuerySmsfContext3gpp + tags: + - SMSF 3GPP Registration (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/context-data/smsf-non-3gpp-access: + put: + summary: Create the SMSF context data of a UE via non-3GPP access + operationId: CreateSmsfContextNon3gpp + tags: + - SMSF Non-3GPP Registration (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + delete: + summary: To remove the SMSF context data of a UE via non-3GPP access + operationId: DeleteSmsfContextNon3gpp + tags: + - SMSF Non-3GPP Registration (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + get: + summary: Retrieves the SMSF context data of a UE using non-3gpp access + operationId: QuerySmsfContextNon3gpp + tags: + - SMSF Non-3GPP Registration (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/sms-mng-data: + get: + summary: Retrieves the SMS management subscription data of a UE + operationId: QuerySmsMngData + tags: + - SMS Management Subscription Data (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsManagementSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/sms-data: + get: + summary: Retrieves the SMS subscription data of a UE + operationId: QuerySmsData + tags: + - SMS Subscription Data (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/pp-data: + get: + summary: Read the profile of a given UE + operationId: GetppData + tags: + - Parameter Provision (Document) + parameters: + - name: ueId + in: path + description: pp data for a UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/PpData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '403': + description: Forbidden + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + patch: + summary: modify the provisioned parameter data + operationId: ModifyPpData + tags: + - ProvisionedParameterData (Document) + parameters: + - name: ueId + in: path + description: pp data for a UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/context-data/ee-subscriptions: + get: + summary: Retrieves the ee subscriptions of a UE + operationId: Queryeesubscriptions + tags: + - Event Exposure Subscriptions (Collection) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/EeSubscription' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + post: + summary: Create individual EE subscription + operationId: CreateEeSubscriptions + tags: + - Event Exposure Subscriptions (Collection) + parameters: + - name: ueId + in: path + description: UE ID + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EeSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/EeSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/{ueId}/context-data/ee-subscriptions/{subsId}' + required: true + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/context-data/ee-subscriptions/{subsId}: + put: + summary: Update an individual ee subscriptions of a UE + operationId: UpdateEesubscriptions + tags: + - Event Exposure Subscription (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EeSubscription' + responses: + '204': + description: Upon success, an empty response body shall be returned + '404': + description: update of non-existing resource is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + delete: + summary: Deletes a eeSubscription + operationId: RemoveeeSubscriptions + tags: + - Event Exposure Subscription (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + description: Unique ID of the subscription to remove + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + + patch: + summary: Modify an individual ee subscription of a UE + operationId: ModifyEesubscription + tags: + - Event Exposure Subscription (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '204': + description: Successful response + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + description: Unexpected error + + get: + summary: Retrieve a eeSubscription + operationId: QueryeeSubscription + tags: + - Event Exposure Subscription (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + description: Unique ID of the subscription to remove + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + items: + $ref: '#/components/schemas/EeSubscription' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/context-data/ee-subscriptions/{subsId}/amf-subscriptions: + put: + summary: Create AmfSubscriptions for an individual ee subscriptions of a UE + operationId: Create AMF Subscriptions + tags: + - AMF Subscription Info (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AmfSubscriptionInfo' + minItems: 1 + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + delete: + summary: Deletes AMF Subscription Info for an eeSubscription + operationId: RemoveAmfSubscriptionsInfo + tags: + - Event AMF Subscription Info (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + patch: + summary: modify the AMF Subscription Info + operationId: ModifyAmfSubscriptionInfo + tags: + - AmfSubscriptionInfo (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + get: + summary: Retrieve AMF subscription Info + operationId: GetAmfSubscriptionInfo + tags: + - Query AMF Subscription Info (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AmfSubscriptionInfo' + minItems: 1 + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/group-data/{ueGroupId}/ee-subscriptions: + get: + summary: Retrieves the ee subscriptions of a group of UEs or any UE + operationId: QueryEeGroupSubscriptions + tags: + - Event Exposure Group Subscriptions (Collection) + parameters: + - name: ueGroupId + in: path + description: Group of UEs or any UE + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/EeSubscription' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + post: + summary: Create individual EE subscription for a group of UEs or any UE + operationId: CreateEeGroupSubscriptions + tags: + - Event Exposure Group Subscriptions (Collection) + parameters: + - name: ueGroupId + in: path + description: Group of UEs or any UE + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EeSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/EeSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/group-data/{ueGroupId}/ee-subscriptions ' + required: true + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/group-data/{ueGroupId}/ee-subscriptions/{subsId}: + put: + summary: Update an individual ee subscription of a group of UEs or any UE + operationId: UpdateEeGroupSubscriptions + tags: + - Event Exposure Subscription (Document) + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EeSubscription' + responses: + '204': + description: Upon success, an empty response body shall be returned + '404': + description: update of non-existing resource is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + delete: + summary: Deletes a eeSubscription for a group of UEs or any UE + operationId: RemoveEeGroupSubscriptions + tags: + - Event Exposure Subscription (Document) + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + description: Unique ID of the subscription to remove + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + + patch: + summary: Modify an individual ee subscription for a group of a UEs + operationId: ModifyEeGroupSubscription + tags: + - Event Exposure Subscription (Document) + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '204': + description: Successful response + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + description: Unexpected error + + get: + summary: Retrieve a individual eeSubscription for a group of UEs or any UE + operationId: QueryEeGroupSubscription + tags: + - Event Exposure Subscription (Document) + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + description: Unique ID of the subscription to remove + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + items: + $ref: '#/components/schemas/EeSubscription' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/ee-profile-data: + get: + summary: Retrieves the ee profile data of a UE + operationId: QueryEEData + tags: + - Event Exposure Data (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + style: form + explode: false + - name: supportedFeatures + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/EeProfileData' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + + /subscription-data/{ueId}/context-data/sdm-subscriptions: + get: + summary: Retrieves the sdm subscriptions of a UE + operationId: Querysdmsubscriptions + tags: + - SDM Subscriptions (Collection) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SdmSubscription' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + post: + summary: Create individual sdm subscription + operationId: CreateSdmSubscriptions + tags: + - SDM Subscriptions (Collection) + parameters: + - name: ueId + in: path + description: UE ID + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SdmSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SdmSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/{ueId}/context-data/sdm-subscriptions/{subsId}' + required: true + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/context-data/sdm-subscriptions/{subsId}: + put: + summary: Update an individual sdm subscriptions of a UE + operationId: Updatesdmsubscriptions + tags: + - SDM Subscription (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SdmSubscription' + responses: + '204': + description: Upon success, an empty response body shall be returned + '404': + description: update of non-existing resource is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + delete: + summary: Deletes a sdmsubscriptions + operationId: RemovesdmSubscriptions + tags: + - SDM Subscription (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + description: Unique ID of the subscription to remove + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + + patch: + summary: Modify an individual sdm subscription + operationId: ModifysdmSubscription + tags: + - SDM Subscription (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '204': + description: Successful response + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + description: Unexpected error + + get: + summary: Retrieves a individual sdmSubscription identified by subsId + operationId: QuerysdmSubscription + tags: + - SDM Subscription (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + description: Unique ID of the subscription to retrieve + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + items: + $ref: '#/components/schemas/SdmSubscription' + + /subscription-data/shared-data: + get: + summary: retrieve shared data + operationId: GetSharedData + tags: + - Retrieval of shared data + parameters: + - name: shared-data-ids + in: query + description: List of shared data ids + required: true + style: form + explode: false + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SharedDataIds' + - name: supportedFeatures + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SharedData' + minItems: 1 + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /subscription-data/subs-to-notify: + post: + summary: Subscription data subscriptions + operationId: SubscriptionDataSubscriptions + tags: + - Subs To Nofify (Collection) + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionDataSubscriptions' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionDataSubscriptions' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/subs-to-notify/{subsId}' + required: true + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + callbacks: + onDataChange: + '{request.body#/callbackReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DataChangeNotify' + responses: + '204': + description: Expected response to a valid request + + get: + summary: Retrieves the list of subscriptions + operationId: QuerySubsToNotify + tags: + - Subs To Nofify (Collection) + parameters: + - name: ue-id + in: query + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SubscriptionDataSubscriptions' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + delete: + summary: Deletes subscriptions identified by a given ue-id parameter + operationId: RemoveMultipleSubscriptionDataSubscriptions + tags: + - Subs To Notify (Collection) + parameters: + - name: ue-id + in: query + required: true + description: UE ID + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: nf-instance-id + in: query + required: false + description: NF Instance ID + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + - name: delete-all-nfs + in: query + required: false + description: Flag to delete subscriptions from all NFs + schema: + type: boolean + - name: implicit-unsubscribe-indication + in: query + required: false + description: Implicit Unsubscribe Indication + schema: + type: boolean + responses: + '204': + description: Expected response to a successful subscription removal + + /subscription-data/subs-to-notify/{subsId}: + delete: + summary: Deletes a subscriptionDataSubscriptions + operationId: RemovesubscriptionDataSubscriptions + tags: + - Subs To Notify (Document) + parameters: + - name: subsId + in: path + required: true + description: Unique ID of the subscription to remove + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + + patch: + summary: Modify an individual subscriptionDataSubscription + operationId: ModifysubscriptionDataSubscription + tags: + - Subs To Notify (Document) + parameters: + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '204': + description: Successful response + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + description: Unexpected error + + get: + summary: Retrieves a individual subscriptionDataSubscription identified by subsId + operationId: QuerySubscriptionDataSubscriptions + tags: + - Subs To Notify (Document) + parameters: + - name: subsId + in: path + required: true + description: Unique ID of the subscription to retrieve + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + items: + $ref: '#/components/schemas/SubscriptionDataSubscriptions' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/trace-data: + get: + summary: Retrieves the trace configuration data of a UE + operationId: QueryTraceData + tags: + - Trace Data (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /subscription-data/{ueId}/identity-data: + get: + summary: Retrieve identity data by SUPI or GPSI + operationId: GetIdentityData + tags: + - Query Identity Data by SUPI or GPSI (Document) + parameters: + - name: ueId + in: path + description: UE ID + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: app-port-id + in: query + description: Application port identifier + content: + application/json: + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/AppPortId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/IdentityData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/operator-determined-barring-data: + get: + summary: Retrieve ODB Data data by SUPI or GPSI + operationId: GetOdbData + tags: + - Query ODB Data by SUPI or GPSI (Document) + parameters: + - name: ueId + in: path + description: UE ID + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/OdbData' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/context-data: + get: + summary: Retrieve multiple context data sets of a UE + operationId: QueryContextData + tags: + - Context Data (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: context-dataset-names + in: query + description: List of context dataset names + style: form + explode: false + required: true + schema: + $ref: '#/components/schemas/ContextDatasetNames' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ContextDataSets' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/group-data/group-identifiers: + get: + summary: Mapping of Group Identifiers + operationId: GetGroupIdentifiers + tags: + - Group Identifiers + parameters: + - name: ext-group-id + in: query + description: External Group Identifier + required: false + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - name: int-group-id + in: query + description: Internal Group Identifier + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + - name: ue-id-ind + in: query + description: Indication whether UE identifiers are required or not + required: false + schema: + type: boolean + default: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/GroupIdentifiers' + + /subscription-data/group-data/5g-vn-groups: + get: + summary: Retrieves the data of a 5G VN Group + operationId: Query5GVnGroup + tags: + - 5G-VN-Groups (Store) + parameters: + - name: gpsis + in: query + description: List of GPSIs + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + style: form + explode: false + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: object + description: A map(list of key-value pairs) where ExtGroupId serves as key + additionalProperties: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/5GVnGroupConfiguration' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/group-data/5g-vn-groups/{externalGroupId}: + put: + summary: Create an individual 5G VN Grouop + operationId: Create5GVnGroup + tags: + - 5GVnGroupConfiguration (Document) + parameters: + - name: externalGroupId + in: path + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + requestBody: + content: + application/json: + schema: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/5GVnGroupConfiguration' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/5GVnGroupConfiguration' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + delete: + summary: Deletes the 5GVnGroup + operationId: Delete5GVnGroup + tags: + - Delete 5GVnGroup + parameters: + - name: externalGroupId + in: path + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + responses: + '204': + description: Expected response to a successful group removal + patch: + summary: modify the 5GVnGroup + operationId: Modify5GVnGroup + tags: + - Modify 5GVnGroup + parameters: + - name: externalGroupId + in: path + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + get: + summary: Retrieve a 5GVnGroup configuration + operationId: Get5GVnGroupConfiguration + tags: + - Query 5GVnGroupConfiguration (Document) + parameters: + - name: externalGroupId + in: path + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/5GVnGroupConfiguration' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/lcs-privacy-data: + get: + summary: Retrieves the LCS Privacy subscription data of a UE + operationId: QueryLcsPrivacyData + tags: + - LCS Privacy Subscription Data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/LcsPrivacyData' + minItems: 1 + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/lcs-mo-data: + get: + summary: Retrieves the LCS Mobile Originated subscription data of a UE + operationId: QueryLcsMoData + tags: + - LCS Mobile Originated Subscription Data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/LcsMoData' + minItems: 1 + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + /subscription-data/{ueId}/nidd-authorization-data: + get: + summary: Retrieve NIDD Authorization Data GPSI or External Group identifier + operationId: GetNiddAuData + tags: + - Query NIDD Authorization Data GPSI or External Group identifier (Document) + parameters: + - name: ueId + in: path + description: UE ID + required: true + schema: + type: string + pattern: '^(msisdn-[0-9]{5,15}|.+|extid-[^@]+@[^@]+|extgroupid-[^@]+@[^@]+)$' + - name: single-nssai + in: query + content: + application/json: + schema: + $ref: '#/components/schemas/VarSnssai' + description: single NSSAI + required: true + - name: dnn + in: query + description: DNN + required: true + schema: + $ref: '#/components/schemas/Dnn' + - name: mtc-provider-information + in: query + description: MTC Provider Information + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AuthorizationData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/coverage-restriction-data: + get: + summary: Retrieves the subscribed enhanced Coverage Restriction Data of a UE + operationId: QueryCoverageRestrictionData + tags: + - Enhanced Coverage Restriction Data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/EnhancedCoverageRestrictionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + +components: + schemas: + AuthenticationSubscription: + type: object + required: + - authenticationMethod + properties: + authenticationMethod: + $ref: '#/components/schemas/AuthMethod' + encPermanentKey: + type: string + protectionParameterId: + type: string + sequenceNumber: + $ref: '#/components/schemas/SequenceNumber' + authenticationManagementField: + type: string + pattern: '^[A-Fa-f0-9]{4}$' + algorithmId: + type: string + encOpcKey: + type: string + encTopcKey: + type: string + vectorGenerationInHss: + type: boolean + default: false + SequenceNumber: + type: object + properties: + sqnScheme: + $ref: '#/components/schemas/SqnScheme' + sqn: + type: string + pattern: '^[A-Fa-f0-9]{12}$' + lastIndexes: + type: object + additionalProperties: + type: integer + minimum: 0 + indLength: + type: integer + minimum: 0 + difSign: + $ref: '#/components/schemas/Sign' + + SqnScheme: +# anyOf: +# - type: string + enum: + - GENERAL + - NON_TIME_BASED + - TIME_BASED + type: string + Sign: + type: string + enum: + - POSITIVE + - NEGATIVE + VarPlmnId: + type: string + pattern: '^[0-9]{5,6}$' + DatasetNames: + type: array + items: + $ref: '#/components/schemas/DataSetName' + minItems: 1 + uniqueItems: true + DataSetName: + anyOf: + - type: string + enum: + - AM + - SMF_SEL + - SMS_SUB + - SM + - TRACE + - SMS_MNG + - LCS_PRIVACY + - LCS_MO + - type: string + ProvisionedDataSets: + type: object + properties: + amData: + $ref: '#/components/schemas/AccessAndMobilitySubscriptionData' + smfSelData: + $ref: '#/components/schemas/SmfSelectionSubscriptionData' + smsSubsData: + $ref: '#/components/schemas/SmsSubscriptionData' + smData: + type: array + items: + $ref: '#/components/schemas/SessionManagementSubscriptionData' + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + smsMngData: + $ref: '#/components/schemas/SmsManagementSubscriptionData' + lcsPrivacyData: + $ref: '#/components/schemas/LcsPrivacyData' + lcsMoData: + $ref: '#/components/schemas/LcsMoData' + AccessAndMobilitySubscriptionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/AccessAndMobilitySubscriptionData' + SmfSelectionSubscriptionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SmfSelectionSubscriptionData' + VarSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + Dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + SessionManagementSubscriptionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SessionManagementSubscriptionData' + Amf3GppAccessRegistration: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/Amf3GppAccessRegistration' + AmfNon3GppAccessRegistration: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/AmfNon3GppAccessRegistration' + SmfRegistration: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/SmfRegistration' + SmsfRegistration: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/SmsfRegistration' + SmsManagementSubscriptionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SmsManagementSubscriptionData' + SmsSubscriptionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SmsSubscriptionData' + LcsPrivacyData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/LcsPrivacyData' + LcsMoData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/LcsMoData' + AuthorizationData: + $ref: 'TS29503_Nudm_NIDDAU.yaml#/components/schemas/AuthorizationData' + EnhancedCoverageRestrictionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/EnhancedCoverageRestrictionData' + OperatorSpecificDataContainer: + type: object + required: + - dataType + - value + properties: + dataType: + type: string + enum: + - string + - integer + - number + - boolean + - object + dataTypeDefinition: + type: string + value: +# oneOf: + type: string +# - type: integer +# - type: number +# - type: boolean +# - type: object + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + AuthMethod: +# anyOf: +# - type: string + enum: + - 5G_AKA + - EAP_AKA_PRIME + - EAP_TLS + type: string + PpData: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/PpData' + EeSubscription: + $ref: 'TS29503_Nudm_EE.yaml#/components/schemas/EeSubscription' + VarUeGroupId: + type: string + pattern: '^(extgroupid-[^@]+@[^@]+|anyUE)$' + SdmSubscription: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SdmSubscription' + SmfRegList: + type: array + items: + $ref: '#/components/schemas/SmfRegistration' + SubscriptionDataSubscriptions: + type: object + required: + - monitoredResourceUris + - callbackReference + properties: + ueId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + callbackReference: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + originalCallbackReference: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + monitoredResourceUris: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + sdmSubscription: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SdmSubscription' + subscriptionId: + type: string + + supported-features: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + DataChangeNotify: + type: object + properties: + originalCallbackReference: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + ueId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + notifyItems: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NotifyItem' + minItems: 1 + sdmSubscription: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SdmSubscription' + additionalSdmSubscriptions: + type: array + items: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SdmSubscription' + minItems: 1 + subscriptionDataSubscriptions: + type: array + items: + $ref: '#/components/schemas/SubscriptionDataSubscriptions' + + IdentityData: + type: object + properties: + supiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + gpsiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + SorData: + type: object + properties: + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ueUpdateStatus: + $ref: '#/components/schemas/UeUpdateStatus' + sorXmacIue: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SorMac' + sorMacIue: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SorMac' + required: + - provisioningTime + - ueUpdateStatus + + UpuData: + type: object + properties: + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ueUpdateStatus: + $ref: '#/components/schemas/UeUpdateStatus' + upuXmacIue: + $ref: 'TS29509_Nausf_UPUProtection.yaml#/components/schemas/UpuMac' + upuMacIue: + $ref: 'TS29509_Nausf_UPUProtection.yaml#/components/schemas/UpuMac' + required: + - provisioningTime + - ueUpdateStatus + + NssaiAckData: + type: object + properties: + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ueUpdateStatus: + $ref: '#/components/schemas/UeUpdateStatus' + required: + - provisioningTime + - ueUpdateStatus + + CagAckData: + type: object + properties: + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ueUpdateStatus: + $ref: '#/components/schemas/UeUpdateStatus' + required: + - provisioningTime + - ueUpdateStatus + + UeUpdateStatus: + type: string + enum: + - NOT_SENT + - SENT_NO_ACK_REQUIRED + - WAITING_FOR_ACK + - ACK_RECEIVED + + EeProfileData: + type: object + properties: + restrictedEventTypes: + type: array + items: + $ref: 'TS29503_Nudm_EE.yaml#/components/schemas/EventType' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + AmfSubscriptionInfo: + type: object + required: + - amfInstanceId + - subscriptionId + properties: + amfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + subscriptionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + subsChangeNotifyCorrelationId: + type: string + ContextDatasetNames: + type: array + items: + $ref: '#/components/schemas/ContextDataSetName' + minItems: 1 + uniqueItems: true + ContextDataSetName: + anyOf: + - type: string + enum: + - AMF_3GPP + - AMF_NON_3GPP + - SDM_SUBSCRIPTIONS + - EE_SUBSCRIPTIONS + - SMSF_3GPP + - SMSF_NON_3GPP + - SUBS_TO_NOTIFY + - SMF_REG + - type: string + ContextDataSets: + type: object + properties: + amf3Gpp: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + amfNon3Gpp: + $ref: '#/components/schemas/AmfNon3GppAccessRegistration' + sdmSubscriptions: + type: array + items: + $ref: '#/components/schemas/SdmSubscription' + minItems: 1 + eeSubscriptions: + type: array + items: + $ref: '#/components/schemas/EeSubscription' + minItems: 1 + smsf3GppAccess: + $ref: '#/components/schemas/SmsfRegistration' + smsfNon3GppAccess: + $ref: '#/components/schemas/SmsfRegistration' + subscriptionDataSubscriptions: + type: array + items: + $ref: '#/components/schemas/SubscriptionDataSubscriptions' + minItems: 1 + smfRegistrations: + $ref: '#/components/schemas/SmfRegList' diff --git a/lib/sbi/support/3gpp-spec/TS29509_Nausf_SoRProtection.yaml b/lib/sbi/support/modified/TS29509_Nausf_SoRProtection.yaml similarity index 87% rename from lib/sbi/support/3gpp-spec/TS29509_Nausf_SoRProtection.yaml rename to lib/sbi/support/modified/TS29509_Nausf_SoRProtection.yaml index a80064a00f..610ac69f48 100644 --- a/lib/sbi/support/3gpp-spec/TS29509_Nausf_SoRProtection.yaml +++ b/lib/sbi/support/modified/TS29509_Nausf_SoRProtection.yaml @@ -1,128 +1,129 @@ -openapi: 3.0.0 -info: - version: 1.0.2 - title: Nausf_SoRProtection Service - description: | - AUSF SoR Protection Service. - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. - -servers: - - url: '{apiRoot}/nausf-sorprotection/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in subclause 4.4 of 3GPP TS 29.501 -security: - - {} - - oAuth2ClientCredentials: - - nausf-sorprotection -paths: - /{supi}/ue-sor: - post: - parameters: - - name: supi - in: path - description: Identifier of the UE - required: true - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SorInfo' - required: true - responses: - '200': - description: SorSecurityInfo - content: - application/json: - schema: - $ref: '#/components/schemas/SorSecurityInfo' - '503': - description: Service Unavailable - content: - application/problem+json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' -components: - securitySchemes: - oAuth2ClientCredentials: - type: oauth2 - flows: - clientCredentials: - tokenUrl: '{nrfApiRoot}/oauth2/token' - scopes: - nausf-sorprotection: Access to the Nausf_SoRProtection API - schemas: - SorInfo: - type: object - properties: - steeringContainer: - $ref: '#/components/schemas/SteeringContainer' - ackInd: - $ref: '#/components/schemas/AckInd' - required: - - ackInd - SorSecurityInfo: - type: object - properties: - sorMacIausf: - $ref: '#/components/schemas/SorMac' - counterSor: - $ref: '#/components/schemas/CounterSor' - sorXmacIue: - $ref: '#/components/schemas/SorMac' - required: - - sorMacIausf - - counterSor - SteeringContainer: - oneOf: - - type: array - items: - $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SteeringInfo' - minItems: 1 - - $ref: '#/components/schemas/SecuredPacket' - SteeringInfo: - type: object - properties: - plmnId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' - accessTechList: - type: array - items: - $ref: '#/components/schemas/AccessTech' - minItems: 1 - required: - - plmnId - SorMac: - type: string - pattern: '^[A-Fa-f0-9]{32}$' - CounterSor: - type: string - pattern: '^[A-Fa-f0-9]{4}$' - AckInd: - type: boolean - SecuredPacket: - type: string - format: base64 - AccessTech: - anyOf: - - type: string - enum: - - NR - - EUTRAN_IN_WBS1_MODE_AND_NBS1_MODE - - EUTRAN_IN_NBS1_MODE_ONLY - - EUTRAN_IN_WBS1_MODE_ONLY - - UTRAN - - GSM_AND_ECGSM_IoT - - GSM_WITHOUT_ECGSM_IoT - - ECGSM_IoT_ONLY - - CDMA_1xRTT - - CDMA_HRPD - - GSM_COMPACT - - type: string -externalDocs: - description: 3GPP TS 29.509 V15.3.0; 5G System; Authentication Server Services - url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.509' +openapi: 3.0.0 +info: + version: 1.1.0.alpha-1 + title: Nausf_SoRProtection Service + description: | + AUSF SoR Protection Service. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.509 V16.3.0; 5G System; Authentication Server Services + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.509' + +servers: + - url: '{apiRoot}/nausf-sorprotection/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 +security: + - {} + - oAuth2ClientCredentials: + - nausf-sorprotection +paths: + /{supi}/ue-sor: + post: + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SorInfo' + required: true + responses: + '200': + description: SorSecurityInfo + content: + application/json: + schema: + $ref: '#/components/schemas/SorSecurityInfo' + '503': + description: Service Unavailable + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nausf-sorprotection: Access to the Nausf_SoRProtection API + schemas: + SorInfo: + type: object + properties: + steeringContainer: + $ref: '#/components/schemas/SteeringContainer' + ackInd: + $ref: '#/components/schemas/AckInd' + required: + - ackInd + SorSecurityInfo: + type: object + properties: + sorMacIausf: + $ref: '#/components/schemas/SorMac' + counterSor: + $ref: '#/components/schemas/CounterSor' + sorXmacIue: + $ref: '#/components/schemas/SorMac' + required: + - sorMacIausf + - counterSor + SteeringContainer: + oneOf: + - type: array + items: + $ref: '#/components/schemas/SteeringInfo' + minItems: 1 + - $ref: '#/components/schemas/SecuredPacket' + SteeringInfo: + type: object + properties: + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + accessTechList: + type: array + items: + $ref: '#/components/schemas/AccessTech' + minItems: 1 + required: + - plmnId + SorMac: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + CounterSor: + type: string + pattern: '^[A-Fa-f0-9]{4}$' + AckInd: + type: boolean + SecuredPacket: + type: string + format: base64 + AccessTech: + anyOf: + - type: string + enum: + - NR + - EUTRAN_IN_WBS1_MODE_AND_NBS1_MODE + - EUTRAN_IN_NBS1_MODE_ONLY + - EUTRAN_IN_WBS1_MODE_ONLY + - UTRAN + - GSM_AND_ECGSM_IoT + - GSM_WITHOUT_ECGSM_IoT + - ECGSM_IoT_ONLY + - CDMA_1xRTT + - CDMA_HRPD + - GSM_COMPACT + - type: string diff --git a/lib/sbi/support/modified/TS29509_Nausf_UEAuthentication.yaml b/lib/sbi/support/modified/TS29509_Nausf_UEAuthentication.yaml new file mode 100644 index 0000000000..707194a0bd --- /dev/null +++ b/lib/sbi/support/modified/TS29509_Nausf_UEAuthentication.yaml @@ -0,0 +1,406 @@ +openapi: 3.0.0 +info: + version: 1.1.0.alpha-4 + title: AUSF API + description: | + AUSF UE Authentication Service. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.509 V16.3.0; 5G System; 3GPP TS Authentication Server services. + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.509' + +servers: + - url: '{apiRoot}/nausf-auth/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause clause 4.4 of 3GPP TS 29.501. + +security: + - {} + - oAuth2ClientCredentials: + - nausf-auth +paths: + /ue-authentications: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticationInfo' + required: true + responses: + '201': + description: UEAuthenticationCtx + content: + application/3gppHal+json: + schema: + $ref: '#/components/schemas/UEAuthenticationCtx' + headers: + Location: + description: 'Contains the URI of the newly created resource according to the structure: {apiRoot}/nausf-auth/v1/ue-authentications/{authCtxId}' + required: true + schema: + type: string + + '400': + description: Bad Request from the AMF + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '403': + description: Forbidden due to serving network not authorized + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '404': + description: User does not exist in the HPLMN + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + description: Internal Server Error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '501': + description: Received protection scheme is not supported by HPLMN + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + /ue-authentications/{authCtxId}/5g-aka-confirmation: + put: + parameters: + - name: authCtxId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ConfirmationData' + responses: + '200': + description: Request processed (EAP success or Failure) + content: + application/json: + schema: + $ref: '#/components/schemas/ConfirmationDataResponse' + + '400': + description: Bad Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + description: Internal Server Error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + delete: + summary: Deletes the authentication result in the UDM + operationId: Delete5gAkaAuthenticationResult + tags: + - Authentication Result Deletion + parameters: + - name: authCtxId + in: path + required: true + schema: + type: string + responses: + '204': + description: Expected response to a successful authentication result removal + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /ue-authentications/{authCtxId}/eap-session: + post: + operationId: EapAuthMethod + parameters: + - name: authCtxId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EapSession' + responses: + '200': + description: Use to handle or close the EAP session + content: + application/json: + schema: + $ref: '#/components/schemas/EapSession' + + application/3gppHal+json: + schema: + type: object + properties: + eapPayload: + $ref: '#/components/schemas/EapPayload' + _links: + type: object + description: 'URI : /{eapSessionUri}' + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LinksValueSchema' + minProperties: 1 + required: + - eapPayload + - _links + '400': + description: Bad Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + description: Internal Server Error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + delete: + summary: Deletes the authentication result in the UDM + operationId: DeleteEapAuthenticationResult + tags: + - Authentication Result Deletion + parameters: + - name: authCtxId + in: path + required: true + schema: + type: string + responses: + '204': + description: Expected response to a successful authentication result removal + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /rg-authentications: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RgAuthenticationInfo' + required: true + responses: + '201': + description: RgAuthCtx + content: + application/json: + schema: + $ref: '#/components/schemas/RgAuthCtx' + headers: + Location: + description: 'Contains the URI of the newly created resource according to the structure: {apiRoot}/nausf-auth/v1/rg-authentications/{authCtxId}' + required: true + schema: + type: string + '403': + description: The UE is not allowed to be authenticated + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '400': + description: Bad Request from the AMF + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '404': + description: User does not exist in the HPLMN + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nausf-auth: Access to Nausf_UEAuthentication API + schemas: + AuthenticationInfo: + type: object + properties: + supiOrSuci: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupiOrSuci' + servingNetworkName: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/ServingNetworkName' + resynchronizationInfo: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/ResynchronizationInfo' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + udmGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + routingIndicator: + type: string + pattern: '^[0-9]{1,4}$' + cagId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CagId' + required: + - supiOrSuci + - servingNetworkName + UEAuthenticationCtx: + type: object + properties: + authType: + $ref: '#/components/schemas/AuthType' + 5gAuthData: +# oneOf: +# - $ref: '#/components/schemas/Av5gAka' +# - $ref: '#/components/schemas/EapPayload' + $ref: '#/components/schemas/Av5gAka' + _links: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LinksValueSchema' + servingNetworkName: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/ServingNetworkName' + required: + - authType + - 5gAuthData + - _links + + Av5gAka: + type: object + required: + - rand + - hxresStar + - autn + properties: + rand: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/Rand' + hxresStar: + $ref: '#/components/schemas/HxresStar' + autn: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/Autn' + ConfirmationData: + type: object + required: + - resStar + properties: + resStar: + $ref: '#/components/schemas/ResStar' + ConfirmationDataResponse: + type: object + properties: + authResult: + $ref: '#/components/schemas/AuthResult' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + kseaf: + $ref: '#/components/schemas/Kseaf' + + required: + - authResult + EapSession: + type: object + properties: + eapPayload: + $ref: '#/components/schemas/EapPayload' + kSeaf: + $ref: '#/components/schemas/Kseaf' + _links: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LinksValueSchema' + authResult: + $ref: '#/components/schemas/AuthResult' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + required: + - eapPayload + RgAuthenticationInfo: + type: object + properties: + suci: + $ref: '#/components/schemas/Suci' + authenticatedInd: + type: boolean + default: false + required: + - suci + - authenticatedInd + RgAuthCtx: + type: object + properties: + authResult: + $ref: '#/components/schemas/AuthResult' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + authInd: + type: boolean + default: false + required: + - authResult + + AuthResult: + type: string + enum: + - AUTHENTICATION_SUCCESS + - AUTHENTICATION_FAILURE + - AUTHENTICATION_ONGOING + EapPayload: + type: string + format: base64 + description: contains an EAP packet + nullable: true + Kseaf: + type: string + pattern: '[A-Fa-f0-9]{64}' + ResStar: + type: string + pattern: '[A-Fa-f0-9]{32}' + nullable: true + HxresStar: + type: string + pattern: "[A-Fa-f0-9]{32}" + Suci: + type: string + pattern: '^(suci-(0-[0-9]{3}-[0-9]{2,3}|[1-7]-.+)-[0-9]{1,4}-(0-0-.+|[a-fA-F1-9]-([1-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])-[a-fA-F0-9]+)|.+)$' + AuthType: +# anyOf: +# - type: string + enum: + - 5G_AKA + - EAP_AKA_PRIME + - EAP_TLS + type: string diff --git a/lib/sbi/support/3gpp-spec/TS29509_Nausf_UPUProtection.yaml b/lib/sbi/support/modified/TS29509_Nausf_UPUProtection.yaml similarity index 84% rename from lib/sbi/support/3gpp-spec/TS29509_Nausf_UPUProtection.yaml rename to lib/sbi/support/modified/TS29509_Nausf_UPUProtection.yaml index 9709e991e6..bea844eec0 100644 --- a/lib/sbi/support/3gpp-spec/TS29509_Nausf_UPUProtection.yaml +++ b/lib/sbi/support/modified/TS29509_Nausf_UPUProtection.yaml @@ -1,109 +1,111 @@ -openapi: 3.0.0 -info: - version: 1.0.1 - title: Nausf_UPUProtection Service - description: | - AUSF UPU Protection Service. - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. - -servers: - - url: '{apiRoot}/nausf-upuprotection/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in subclause 4.4 of 3GPP TS 29.501 -security: - - {} - - oAuth2ClientCredentials: - - nausf-upuprotection -paths: - /{supi}/ue-upu: - post: - parameters: - - name: supi - in: path - description: Identifier of the UE - required: true - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpuInfo' - required: true - responses: - '200': - description: UpuSecurityInfo - content: - application/json: - schema: - $ref: '#/components/schemas/UpuSecurityInfo' - '503': - description: Service Unavailable - content: - application/problem+json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - -components: - securitySchemes: - oAuth2ClientCredentials: - type: oauth2 - flows: - clientCredentials: - tokenUrl: '{nrfApiRoot}/oauth2/token' - scopes: - nausf-upuprotection: Access to the Nausf_UPUProtection API - schemas: - UpuInfo: - type: object - properties: - upuDataList: - type: array - items: - $ref: '#/components/schemas/UpuData' - minItems: 1 - upuAckInd: - $ref: '#/components/schemas/UpuAckInd' - required: - - upuDataList - - upuAckInd - UpuSecurityInfo: - type: object - properties: - upuMacIausf: - $ref: '#/components/schemas/UpuMac' - counterUpu: - $ref: '#/components/schemas/CounterUpu' - upuXmacIue: - $ref: '#/components/schemas/UpuMac' - required: - - upuMacIausf - - counterUpu - UpuData: - type: object - properties: - secPacket: - $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SecuredPacket' - defaultConfNssai: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - minItems: 1 - oneOf: - - required: [secPacket] - - required: [defaultConfNssai] - UpuMac: - type: string - pattern: '^[A-Fa-f0-9]{32}$' - CounterUpu: - type: string - pattern: '^[A-Fa-f0-9]{4}$' - UpuAckInd: - type: boolean - -externalDocs: - description: 3GPP TS 29.509 V15.3.0; 5G System; Authentication Server Services - url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.509' +openapi: 3.0.0 +info: + version: 1.1.0.alpha-2 + title: Nausf_UPUProtection Service + description: | + AUSF UPU Protection Service + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.509 V16.3.0; 5G System; Authentication Server Services + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.509' + +servers: + - url: '{apiRoot}/nausf-upuprotection/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 +security: + - {} + - oAuth2ClientCredentials: + - nausf-upuprotection +paths: + /{supi}/ue-upu: + post: + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpuInfo' + required: true + responses: + '200': + description: UpuSecurityInfo + content: + application/json: + schema: + $ref: '#/components/schemas/UpuSecurityInfo' + '503': + description: Service Unavailable + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nausf-upuprotection: Access to the Nausf_UPUProtection API + schemas: + UpuInfo: + type: object + properties: + upuDataList: + type: array + items: + $ref: '#/components/schemas/UpuData' + minItems: 1 + upuAckInd: + $ref: '#/components/schemas/UpuAckInd' + required: + - upuDataList + - upuAckInd + UpuSecurityInfo: + type: object + properties: + upuMacIausf: + $ref: '#/components/schemas/UpuMac' + counterUpu: + $ref: '#/components/schemas/CounterUpu' + upuXmacIue: + $ref: '#/components/schemas/UpuMac' + required: + - upuMacIausf + - counterUpu + UpuData: + type: object + properties: + secPacket: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SecuredPacket' + defaultConfNssai: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + routingId: + $ref: 'TS29544_Nspaf_SecuredPacket.yaml#/components/schemas/RoutingId' + oneOf: + - required: [secPacket] + - required: [defaultConfNssai] + UpuMac: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + CounterUpu: + type: string + pattern: '^[A-Fa-f0-9]{4}$' + UpuAckInd: + type: boolean diff --git a/lib/sbi/support/modified/TS29510_Nnrf_NFDiscovery.yaml b/lib/sbi/support/modified/TS29510_Nnrf_NFDiscovery.yaml index 377e9fbe72..d4b28785c9 100644 --- a/lib/sbi/support/modified/TS29510_Nnrf_NFDiscovery.yaml +++ b/lib/sbi/support/modified/TS29510_Nnrf_NFDiscovery.yaml @@ -1,21 +1,29 @@ openapi: 3.0.0 + info: - version: '1.1.0.alpha-1' + version: '1.1.0.alpha-4' title: 'NRF NFDiscovery Service' description: | NRF NFDiscovery Service. - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. + +externalDocs: + description: 3GPP TS 29.510 V16.3.0; 5G System; Network Function Repository Services; Stage 3 + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.510/' + servers: - url: '{apiRoot}/nnrf-disc/v1' variables: apiRoot: default: https://example.com - description: apiRoot as defined in subclause 4.4 of 3GPP TS 29.501 + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + security: - {} - oAuth2ClientCredentials: - nnrf-disc + paths: /nf-instances: get: @@ -24,6 +32,11 @@ paths: tags: - NF Instances (Store) parameters: + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string - name: target-nf-type in: query description: Type of the target NF @@ -204,7 +217,19 @@ paths: in: query description: external group identifier of the user schema: - type: string + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - name: internal-group-identity + in: query + description: internal group identifier of the user + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + - name: pfd-data + in: query + description: PFD data + content: + application/json: + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/PfdData' - name: data-set in: query description: data set supported by the NF @@ -337,11 +362,151 @@ paths: description: UPF supporting allocating UE IP addresses/prefixes schema: type: boolean + - name: client-type + in: query + description: Requested client type served by the NF + content: + application/json: + schema: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/ExternalClientType' + - name: lmf-id + in: query + description: LMF identification to be discovered + content: + application/json: + schema: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LMFIdentification' + - name: an-node-type + in: query + description: Requested AN node type served by the NF + content: + application/json: + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/AnNodeType' + - name: rat-type + in: query + description: Requested RAT type served by the NF + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + - name: preferred-tai + in: query + description: preferred Tracking Area Identity + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + - name: preferred-nf-instances + in: query + description: preferred NF Instances + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + minItems: 1 + style: form + explode: false - name: If-None-Match in: header - description: Validator for conditional requests, as described in IETF RFC 7232, 3.2 + description: Validator for conditional requests, as described in IETF RFC 7232, 3.2 schema: type: string + - name: target-snpn + in: query + description: Target SNPN Identity + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + - name: af-ee-data + in: query + description: NEF exposured by the AF + content: + application/json: + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/AfEventExposureData' + - name: w-agf-info + in: query + description: UPF collocated with W-AGF + content: + application/json: + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/WAgfInfo' + - name: tngf-info + in: query + description: UPF collocated with TNGF + content: + application/json: + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/TngfInfo' + - name: twif-info + in: query + description: UPF collocated with TWIF + content: + application/json: + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/TwifInfo' + - name: target-nf-set-id + in: query + description: Target NF Set ID + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + - name: target-nf-service-set-id + in: query + description: Target NF Service Set ID + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + - name: nef-id + in: query + description: NEF ID + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NefId' + - name: notification-type + in: query + description: Notification Type + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NotificationType' + - name: serving-scope + in: query + description: areas that can be served by the target NF + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: imsi + in: query + description: IMSI of the requester UE to search for an appropriate NF (e.g. HSS) + schema: + type: string + - name: preferred-api-versions + in: query + description: Preferred API version of the services to be discovered + content: + application/json: + schema: + type: object + additionalProperties: + type: string + minProperties: 1 + - name: v2x-support-ind + in: query + description: PCF supports V2X + schema: + type: boolean + - name: redundant-gtpu + in: query + description: UPF supports redundant gtp-u to be discovered + schema: + type: boolean + - name: redundant-transport + in: query + description: UPF supports redundant transport path to be discovered + schema: + type: boolean responses: '200': description: Expected response to a valid request @@ -355,14 +520,14 @@ paths: parameters: searchId: $response.body#/searchId description: > - The 'searchId' parameter returned in the response can be used as the + The 'searchId' parameter returned in the response can be used as the 'searchId' parameter in the GET request to '/searches/{searchId}' completeSearch: operationId: RetrieveCompleteSearch parameters: searchId: $response.body#/searchId description: > - The 'searchId' parameter returned in the response can be used as the + The 'searchId' parameter returned in the response can be used as the 'searchId' parameter in the GET request to '/searches/{searchId}/complete' headers: Cache-Control: @@ -370,7 +535,11 @@ paths: schema: type: string ETag: - description: Entity Tag containing a strong validator, described in IETF RFC 7232, 2.3 + description: Entity Tag containing a strong validator, described in IETF RFC 7232, 2.3 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 schema: type: string '307': @@ -415,6 +584,11 @@ paths: - Stored Search (Document) parameters: - $ref: '#/components/parameters/searchId' + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string responses: '200': $ref: '#/components/responses/200' @@ -426,6 +600,11 @@ paths: - Complete Stored Search (Document) parameters: - $ref: '#/components/parameters/searchId' + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string responses: '200': $ref: '#/components/responses/200' @@ -434,8 +613,8 @@ components: securitySchemes: oAuth2ClientCredentials: type: oauth2 - flows: - clientCredentials: + flows: + clientCredentials: tokenUrl: '/oauth2/token' scopes: nnrf-disc: Access to the Nnrf_NFDiscovery API @@ -460,11 +639,16 @@ components: schema: type: string ETag: - description: Entity Tag containing a strong validator, described in IETF RFC 7232, 2.3 + description: Entity Tag containing a strong validator, described in IETF RFC 7232, 2.3 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 schema: type: string schemas: SearchResult: + description: Contains the list of NF Profiles returned in a Discovery response type: object required: - nfInstances @@ -479,9 +663,12 @@ components: type: string numNfInstComplete: $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + preferredSearch: + $ref: '#/components/schemas/PreferredSearch' nrfSupportedFeatures: $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' StoredSearchResult: + description: Contains a complete search result (i.e. a number of discovered NF Instances), stored by NRF as a consequence of a prior search result type: object required: - nfInstances @@ -491,6 +678,7 @@ components: items: $ref: '#/components/schemas/NFProfile' NFProfile: + description: Information of an NF Instance discovered by the NRF type: object required: - nfInstanceId @@ -545,6 +733,8 @@ components: type: integer minimum: 0 maximum: 100 + loadTimeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' locality: type: string priority: @@ -614,8 +804,27 @@ components: items: $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ChfInfo' minItems: 1 + udsfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/UdsfInfo' + udsfInfoExt: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/UdsfInfo' + minItems: 1 nwdafInfo: $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NwdafInfo' + nefInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NefInfo' + pcscfInfo: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/PcscfInfo' + minItems: 1 + hssInfo: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/HssInfo' + minItems: 1 customInfo: type: object recoveryTime: @@ -632,7 +841,33 @@ components: type: array items: $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/DefaultNotificationSubscription' + lmfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/LmfInfo' + gmlcInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/GmlcInfo' + snpnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + minItems: 1 + nfSetIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + minItems: 1 + servingScope: + type: array + items: + type: string + minItems: 1 + lcHSupportInd: + type: boolean + default: false + olcHSupportInd: + type: boolean + default: false NFService: + description: Information of a given NF Service Instance; it is part of the NFProfile of an NF Instance discovered by the NRF type: object required: - serviceInstanceId @@ -676,6 +911,8 @@ components: type: integer minimum: 0 maximum: 100 + loadTimeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' priority: type: integer minimum: 0 @@ -686,6 +923,36 @@ components: $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ChfServiceInfo' supportedFeatures: $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' -externalDocs: - description: 3GPP TS 29.510 V15.3.0; 5G System; Network Function Repository Services; Stage 3 - url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.510/' + nfServiceSetIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + minItems: 1 + sNssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + perPlmnSnssaiList: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/PlmnSnssai' + minItems: 1 + vendorId: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/VendorId' + supportedVendorSpecificFeatures: + type: object + additionalProperties: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/VendorSpecificFeature' + minProperties: 1 + oauth2Required: + type: boolean + PreferredSearch: + description: Contains information on whether the returned NFProfiles match the preferred query parameters + type: object + properties: + preferredTaiMatchInd: + type: boolean + default: false diff --git a/lib/sbi/support/modified/TS29510_Nnrf_NFManagement.yaml b/lib/sbi/support/modified/TS29510_Nnrf_NFManagement.yaml index 3f7b2a134d..72b35e08ca 100644 --- a/lib/sbi/support/modified/TS29510_Nnrf_NFManagement.yaml +++ b/lib/sbi/support/modified/TS29510_Nnrf_NFManagement.yaml @@ -1,21 +1,29 @@ openapi: 3.0.0 + info: - version: '1.1.0.alpha-1' + version: '1.1.0.alpha-4' title: 'NRF NFManagement Service' description: | NRF NFManagement Service. - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. + +externalDocs: + description: 3GPP TS 29.510 V16.3.0; 5G System; Network Function Repository Services; Stage 3 + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.510/' + servers: - url: '{apiRoot}/nnrf-nfm/v1' variables: apiRoot: default: https://example.com - description: apiRoot as defined in subclause 4.4 of 3GPP TS 29.501 + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + security: - {} - oAuth2ClientCredentials: - nnrf-nfm + paths: /nf-instances: get: @@ -169,7 +177,12 @@ paths: $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - name: Content-Encoding in: header - description: Content-Encoding, described in IETF RFC 7231 + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 schema: type: string requestBody: @@ -190,6 +203,10 @@ paths: description: Accept-Encoding, described in IETF RFC 7694 schema: type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string '201': description: Expected response to a valid request content: @@ -206,6 +223,10 @@ paths: description: Accept-Encoding, described in IETF RFC 7694 schema: type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string '400': $ref: 'TS29571_CommonData.yaml#/components/responses/400' '401': @@ -242,6 +263,16 @@ paths: description: Unique ID of the NF Instance to update schema: $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string requestBody: content: application/json-patch+json: @@ -258,8 +289,22 @@ paths: application/json: schema: $ref: '#/components/schemas/NFProfile' + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string '204': description: Expected response with empty body + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string '400': $ref: 'TS29571_CommonData.yaml#/components/responses/400' '403': @@ -323,6 +368,17 @@ paths: operationId: CreateSubscription tags: - Subscriptions (Collection) + parameters: + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string requestBody: content: application/json: @@ -342,6 +398,14 @@ paths: required: true schema: type: string + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string '400': $ref: 'TS29571_CommonData.yaml#/components/responses/400' '401': @@ -370,6 +434,12 @@ paths: onNFStatusEvent: '{$request.body#/nfStatusNotificationUri}': post: + parameters: + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string requestBody: description: Notification Payload content: @@ -379,6 +449,11 @@ paths: responses: '204': description: Expected response to a successful callback processing + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string '400': $ref: 'TS29571_CommonData.yaml#/components/responses/400' '401': @@ -417,6 +492,16 @@ paths: schema: type: string pattern: '^([0-9]{5,6}-)?[^-]+$' + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string requestBody: content: application/json-patch+json: @@ -432,8 +517,22 @@ paths: application/json: schema: $ref: '#/components/schemas/SubscriptionData' + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string '204': description: No Content + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string '400': $ref: 'TS29571_CommonData.yaml#/components/responses/400' '403': @@ -500,13 +599,14 @@ components: securitySchemes: oAuth2ClientCredentials: type: oauth2 - flows: - clientCredentials: + flows: + clientCredentials: tokenUrl: '/oauth2/token' scopes: nnrf-nfm: Access to the Nnrf_NFManagement API schemas: NFProfile: + description: Information of an NF Instance registered in the NRF type: object required: - nfInstanceId @@ -532,6 +632,11 @@ components: items: $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' minItems: 1 + snpnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + minItems: 1 sNssais: type: array items: @@ -566,6 +671,11 @@ components: items: $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' minItems: 1 + allowedSnpns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + minItems: 1 allowedNfTypes: type: array items: @@ -593,6 +703,8 @@ components: type: integer minimum: 0 maximum: 100 + loadTimeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' locality: type: string udrInfo: @@ -658,10 +770,29 @@ components: items: $ref: '#/components/schemas/ChfInfo' minItems: 1 + nefInfo: + $ref: '#/components/schemas/NefInfo' nrfInfo: $ref: '#/components/schemas/NrfInfo' + udsfInfo: + $ref: '#/components/schemas/UdsfInfo' + udsfInfoExt: + type: array + items: + $ref: '#/components/schemas/UdsfInfo' + minItems: 1 nwdafInfo: $ref: '#/components/schemas/NwdafInfo' + pcscfInfo: + type: array + items: + $ref: '#/components/schemas/PcscfInfo' + minItems: 1 + hssInfo: + type: array + items: + $ref: '#/components/schemas/HssInfo' + minItems: 1 customInfo: type: object recoveryTime: @@ -686,7 +817,28 @@ components: type: array items: $ref: '#/components/schemas/DefaultNotificationSubscription' + lmfInfo: + $ref: '#/components/schemas/LmfInfo' + gmlcInfo: + $ref: '#/components/schemas/GmlcInfo' + nfSetIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + minItems: 1 + servingScope: + type: array + items: + type: string + minItems: 1 + lcHSupportInd: + type: boolean + default: false + olcHSupportInd: + type: boolean + default: false NFService: + description: Information of a given NF Service Instance; it is part of the NFProfile of an NF Instance type: object required: - serviceInstanceId @@ -729,6 +881,11 @@ components: items: $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' minItems: 1 + allowedSnpns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + minItems: 1 allowedNfTypes: type: array items: @@ -756,13 +913,42 @@ components: type: integer minimum: 0 maximum: 100 + loadTimeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' recoveryTime: $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' chfServiceInfo: $ref: '#/components/schemas/ChfServiceInfo' supportedFeatures: $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + nfServiceSetIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + minItems: 1 + sNssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + perPlmnSnssaiList: + type: array + items: + $ref: '#/components/schemas/PlmnSnssai' + minItems: 1 + vendorId: + $ref: '#/components/schemas/VendorId' + supportedVendorSpecificFeatures: + type: object + additionalProperties: + type: array + items: + $ref: '#/components/schemas/VendorSpecificFeature' + minProperties: 1 + oauth2Required: + type: boolean NFType: +# description: NF types known to NRF # anyOf: # - type: string enum: @@ -787,10 +973,25 @@ components: - BSF - CHF - NWDAF + - PCSCF + - CBCF + - HSS + - UCMF + - SOR_AF + - SPAF + - MME + - SCSAS + - SCEF + - SCP type: string Fqdn: + description: Fully Qualified Domain Name + type: string + NefId: + description: Identity of the NEF type: string IpEndPoint: + description: IP addressing information of a given NFService; it consists on, e.g. IP address, TCP port, transport protocol... type: object properties: ipv4Address: @@ -800,10 +1001,11 @@ components: transport: $ref: '#/components/schemas/TransportProtocol' port: - type: integer + type: integer minimum: 0 maximum: 65535 SubscriptionData: + description: Information of a subscription to notifications to NRF events, included in subscription requests and responses type: object required: - nfStatusNotificationUri @@ -822,6 +1024,9 @@ components: # - $ref: '#/components/schemas/GuamiListCond' # - $ref: '#/components/schemas/NetworkSliceCond' # - $ref: '#/components/schemas/NfGroupCond' +# - $ref: '#/components/schemas/NfSetCond' +# - $ref: '#/components/schemas/NfServiceSetCond' +# - $ref: '#/components/schemas/UpfCond' subscriptionId: type: string pattern: '^([0-9]{5,6}-)?[^-]+$' @@ -835,6 +1040,8 @@ components: minItems: 1 plmnId: $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + nid: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Nid' notifCondition: $ref: '#/components/schemas/NotifCondition' reqNfType: @@ -846,7 +1053,13 @@ components: items: $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' minItems: 1 + reqPlmnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 NfInstanceIdCond: + description: Subscription to a given NF Instance Id type: object required: - nfInstanceId @@ -854,6 +1067,7 @@ components: nfInstanceId: $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' NfTypeCond: + description: Subscription to a set of NFs based on their NF Type type: object required: - nfType @@ -863,6 +1077,7 @@ components: nfType: $ref: '#/components/schemas/NFType' ServiceNameCond: + description: Subscription to a set of NFs based on their support for a given Service Name type: object required: - serviceName @@ -870,6 +1085,7 @@ components: serviceName: $ref: '#/components/schemas/ServiceName' AmfCond: + description: Subscription to a set of AMFs, based on AMF Set Id and/or AMF Region Id type: object anyOf: - required: [ amfSetId ] @@ -880,6 +1096,7 @@ components: amfRegionId: $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfRegionId' GuamiListCond: + description: Subscription to a set of AMFs, based on their GUAMIs type: object required: - guamiList @@ -889,6 +1106,7 @@ components: items: $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' NetworkSliceCond: + description: Subscription to a set of NFs, based on the slices (S-NSSAI and NSI) they support type: object required: - snssaiList @@ -902,6 +1120,7 @@ components: items: type: string NfGroupCond: + description: Subscription to a set of NFs based on their Group Id type: object required: - nfType @@ -914,9 +1133,11 @@ components: - AUSF - UDR - PCF + - CHF nfGroupId: $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' NotifCondition: + description: Condition (list of attributes in the NF Profile) to determine whether a notification must be sent by NRF type: object not: required: [ monitoredAttributes, unmonitoredAttributes ] @@ -932,6 +1153,7 @@ components: type: string minItems: 1 UdrInfo: + description: Information of an UDR NF Instance type: object properties: groupId: @@ -957,6 +1179,7 @@ components: $ref: '#/components/schemas/DataSetId' minItems: 1 SupiRange: + description: A range of SUPIs (subscriber identities), either based on a numeric range, or based on regular-expression matching type: object properties: start: @@ -968,6 +1191,7 @@ components: pattern: type: string IdentityRange: + description: A range of GPSIs (subscriber identities), either based on a numeric range, or based on regular-expression matching type: object properties: start: @@ -978,7 +1202,18 @@ components: pattern: '^[0-9]+$' pattern: type: string + InternalGroupIdRange: + description: A range of Group IDs (internal group identities), either based on a numeric range, or based on regular-expression matching + type: object + properties: + start: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + end: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + pattern: + type: string DataSetId: + description: Types of data sets stored in UDR anyOf: - type: string enum: @@ -986,8 +1221,9 @@ components: - POLICY - EXPOSURE - APPLICATION - - type: string + - type: string UdmInfo: + description: Information of an UDM NF Instance type: object properties: groupId: @@ -1013,7 +1249,13 @@ components: type: string pattern: '^[0-9]{1,4}$' minItems: 1 + internalGroupIdentifiersRanges: + type: array + items: + $ref: '#/components/schemas/InternalGroupIdRange' + minItems: 1 AusfInfo: + description: Information of an AUSF NF Instance type: object properties: groupId: @@ -1030,6 +1272,7 @@ components: pattern: '^[0-9]{1,4}$' minItems: 1 AmfInfo: + description: Information of an AMF NF Instance type: object required: - amfSetId @@ -1068,6 +1311,7 @@ components: n2InterfaceAmfInfo: $ref: '#/components/schemas/N2InterfaceAmfInfo' SmfInfo: + description: Information of an SMF NF Instance type: object required: - sNssaiSmfInfoList @@ -1094,7 +1338,12 @@ components: items: $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' minItems: 1 + priority: + type: integer + minimum: 0 + maximum: 65535 SnssaiSmfInfoItem: + description: Set of parameters supported by SMF for a given S-NSSAI type: object required: - sNssai @@ -1108,6 +1357,7 @@ components: $ref: '#/components/schemas/DnnSmfInfoItem' minItems: 1 DnnSmfInfoItem: + description: Set of parameters supported by SMF for a given DNN type: object required: - dnn @@ -1115,6 +1365,7 @@ components: dnn: $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' UpfInfo: + description: Information of an UPF NF Instance type: object required: - sNssaiUpfInfoList @@ -1147,7 +1398,26 @@ components: ueIpAddrInd: type: boolean default: false + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + wAgfInfo: + $ref: '#/components/schemas/WAgfInfo' + tngfInfo: + $ref: '#/components/schemas/TngfInfo' + twifInfo: + $ref: '#/components/schemas/TwifInfo' + priority: + type: integer + minimum: 0 + maximum: 65535 + redundantGtpu: + type: boolean + default: false SnssaiUpfInfoItem: + description: Set of parameters supported by UPF for a given S-NSSAI type: object required: - sNssai @@ -1160,7 +1430,11 @@ components: items: $ref: '#/components/schemas/DnnUpfInfoItem' minItems: 1 + redundantTransport: + type: boolean + default: false DnnUpfInfoItem: + description: Set of parameters supported by UPF for a given DNN type: object required: - dnn @@ -1177,7 +1451,18 @@ components: items: $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' minItems: 1 + ipv4AddressRanges: + type: array + items: + $ref: '#/components/schemas/Ipv4AddressRange' + minItems: 1 + ipv6PrefixRanges: + type: array + items: + $ref: '#/components/schemas/Ipv6PrefixRange' + minItems: 1 InterfaceUpfInfoItem: + description: Information of a given IP interface of an UPF type: object required: - interfaceType @@ -1199,6 +1484,7 @@ components: networkInstance: type: string UPInterfaceType: + description: Types of User-Plane interfaces of the UPF anyOf: - type: string enum: @@ -1206,7 +1492,40 @@ components: - N6 - N9 - type: string + WAgfInfo: + description: Information of the W-AGF end-points + type: object + properties: + ipv4EndpointAddresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + ipv6EndpointAddresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + endpointFqdn: + $ref: '#/components/schemas/Fqdn' + TngfInfo: + description: Infomation of the TNGF endpoints + type: object + properties: + ipv4EndpointAddresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + ipv6EndpointAddresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + endpointFqdn: + $ref: '#/components/schemas/Fqdn' PcfInfo: + description: Information of a PCF NF Instance type: object properties: groupId: @@ -1230,7 +1549,11 @@ components: $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' rxDiamRealm: $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + v2xSupportInd: + type: boolean + default: false BsfInfo: + description: Information of a BSF NF Instance type: object properties: dnnList: @@ -1245,15 +1568,16 @@ components: minItems: 1 ipv4AddressRanges: type: array - items: + items: $ref: '#/components/schemas/Ipv4AddressRange' minItems: 1 ipv6PrefixRanges: type: array - items: + items: $ref: '#/components/schemas/Ipv6PrefixRange' minItems: 1 ChfInfo: + description: Information of a CHF NF Instance type: object properties: supiRangeList: @@ -1271,7 +1595,10 @@ components: items: $ref: '#/components/schemas/PlmnRange' minItems: 1 + groupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' Ipv4AddressRange: + description: Range of IPv4 addresses type: object properties: start: @@ -1279,6 +1606,7 @@ components: end: $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' Ipv6PrefixRange: + description: Range of IPv6 prefixes type: object properties: start: @@ -1286,6 +1614,7 @@ components: end: $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' DefaultNotificationSubscription: + description: Data structure for specifying the notifications the NF service subscribes by default along with callback URI type: object required: - notificationType @@ -1299,7 +1628,42 @@ components: $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/N1MessageClass' n2InformationClass: $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/N2InformationClass' + versions: + type: array + items: + type: string + minItems: 1 + NfSetCond: + description: Subscription to a set of NFs based on their Set Id + type: object + required: + - nfSetId + properties: + nfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + NfServiceSetCond: + description: Subscription to a set of NFs based on their Service Set Id + type: object + required: + - nfServiceSetId + properties: + nfServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + UpfCond: + type: object + properties: + smfServingArea: + type: array + items: + type: string + minItems: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 NotificationType: +# description: Types of notifications used in Default Notification URIs in the NF Profile of an NF Instance # anyOf: # - type: string enum: @@ -1308,22 +1672,26 @@ components: - LOCATION_NOTIFICATION - DATA_REMOVAL_NOTIFICATION - DATA_CHANGE_NOTIFICATION + - LOCATION_UPDATE_NOTIFICATION type: string TransportProtocol: -# anyOf: -# - type: string + description: Types of transport protocol used in a given IP endpoint of an NF Service Instance + anyOf: + - type: string enum: - TCP - type: string + - type: string NotificationEventType: +# description: Types of events sent in notifications from NRF to subscribed NF Instances # anyOf: # - type: string enum: - NF_REGISTERED - NF_DEREGISTERED - NF_PROFILE_CHANGED - type: string + type: string NotificationData: + description: Data sent in notifications from NRF to subscribed NF Instances type: object required: - event @@ -1339,7 +1707,7 @@ components: event: type: string enum: - - NF_PROFILE_CHANGED + - NF_PROFILE_CHANGED - oneOf: - required: [ nfProfile ] - required: [ profileChanges ] @@ -1353,7 +1721,7 @@ components: event: type: string enum: - - NF_REGISTERED + - NF_REGISTERED - required: [ nfProfile ] properties: event: @@ -1364,15 +1732,15 @@ components: allOf: - $ref: '#/components/schemas/NFProfile' - not: - required: [ interPlmnFqdn ] + required: [ interPlmnFqdn ] - not: - required: [ allowedPlmns ] + required: [ allowedPlmns ] - not: - required: [ allowedNfTypes ] + required: [ allowedNfTypes ] - not: - required: [ allowedNfDomains ] + required: [ allowedNfDomains ] - not: - required: [ allowedNssais ] + required: [ allowedNssais ] - properties: nfServices: type: array @@ -1395,6 +1763,7 @@ components: $ref: 'TS29571_CommonData.yaml#/components/schemas/ChangeItem' minItems: 1 NFStatus: +# description: Status of a given NF Instance stored in NRF # anyOf: # - type: string enum: @@ -1403,6 +1772,7 @@ components: - UNDISCOVERABLE type: string NFServiceVersion: + description: Contains the version details of an NF service type: object required: - apiVersionInUri @@ -1415,17 +1785,20 @@ components: expiry: $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' ServiceName: +# description: Service names known to NRF # anyOf: # - type: string # enum: # - nnrf-nfm # - nnrf-disc +# - nnrf-oauth2 # - nudm-sdm # - nudm-uecm # - nudm-ueau # - nudm-ee # - nudm-pp # - nudm-niddau +# - nudm-mt # - namf-comm # - namf-evts # - namf-mt @@ -1436,6 +1809,8 @@ components: # - nausf-sorprotection # - nausf-upuprotection # - nnef-pfdmanagement +# - nnef-smcontext +# - nnef-eventexposure # - npcf-am-policy-control # - npcf-smpolicycontrol # - npcf-policyauthorization @@ -1446,15 +1821,30 @@ components: # - nnssf-nsselection # - nnssf-nssaiavailability # - nudr-dr +# - nudr-group-id-map # - nlmf-loc # - n5g-eir-eic # - nbsf-management # - nchf-spendinglimitcontrol # - nchf-convergedcharging +# - nchf-offlineonlycharging # - nnwdaf-eventssubscription # - nnwdaf-analyticsinfo +# - ngmlc-loc +# - nucmf-provisioning +# - nucmf-uecapabilitymanagement +# - nhss-sdm +# - nhss-uecm +# - nhss-ueau +# - nhss-ims-sdm +# - nhss-ims-uecm +# - nhss-ims-ueau +# - nsepp-telescopic +# - nsoraf-sor +# - nspaf-secured-packet type: string N2InterfaceAmfInfo: + description: AMF N2 interface information type: object properties: ipv4EndpointAddress: @@ -1470,6 +1860,7 @@ components: amfName: $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfName' NFServiceStatus: +# description: Status of a given NF Service Instance of an NF Instance stored in NRF # anyOf: # - type: string enum: @@ -1478,6 +1869,7 @@ components: - UNDISCOVERABLE type: string TaiRange: + description: Range of TAIs (Tracking Area Identities) type: object required: - plmnId @@ -1490,7 +1882,10 @@ components: items: $ref: '#/components/schemas/TacRange' minItems: 1 + nid: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Nid' TacRange: + description: Range of TACs (Tracking Area Codes) type: object properties: start: @@ -1502,6 +1897,7 @@ components: pattern: type: string ChfServiceInfo: + description: Information of primary and secondary CHF services type: object not: required: [ primaryChfServiceInstance, secondaryChfServiceInstance ] @@ -1511,6 +1907,7 @@ components: secondaryChfServiceInstance: type: string PlmnRange: + description: Range of PLMN IDs type: object properties: start: @@ -1522,6 +1919,7 @@ components: pattern: type: string NrfInfo: + description: Information of an NRF NF Instance, used in hierarchical NRF deployments type: object properties: servedUdrInfo: @@ -1569,12 +1967,43 @@ components: additionalProperties: $ref: '#/components/schemas/ChfInfo' minProperties: 1 + servedNefInfo: + type: object + additionalProperties: + $ref: '#/components/schemas/NefInfo' + minProperties: 1 servedNwdafInfo: type: object additionalProperties: $ref: '#/components/schemas/NwdafInfo' minProperties: 1 + servedPcscfInfo: + type: object + additionalProperties: + $ref: '#/components/schemas/PcscfInfo' + minProperties: 1 + servedGmlcInfo: + type: object + additionalProperties: + $ref: '#/components/schemas/GmlcInfo' + minProperties: 1 + servedLmfInfo: + type: object + additionalProperties: + $ref: '#/components/schemas/LmfInfo' + minProperties: 1 + servedNfInfo: + type: object + additionalProperties: + $ref: '#/components/schemas/NfInfo' + minProperties: 1 + servedHssInfo: + type: object + additionalProperties: + $ref: '#/components/schemas/HssInfo' + minProperties: 1 PlmnSnssai: + description: List of network slices (S-NSSAIs) for a given PLMN ID type: object required: - plmnId @@ -1587,7 +2016,34 @@ components: items: $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' minItems: 1 + nid: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Nid' + NefInfo: + description: Information of an NEF NF Instance + type: object + properties: + nefId: + $ref: '#/components/schemas/NefId' + pfdData: + $ref: '#/components/schemas/PfdData' + afEeData: + $ref: '#/components/schemas/AfEventExposureData' + PfdData: + description: List of Application IDs and/or AF IDs managed by a given NEF Instance + type: object + properties: + appIds: + type: array + items: + type: string + minItems: 1 + afIds: + type: array + items: + type: string + minItems: 1 NwdafInfo: + description: Information of a NWDAF NF Instance type: object properties: eventIds: @@ -1610,7 +2066,147 @@ components: items: $ref: '#/components/schemas/TaiRange' minItems: 1 - -externalDocs: - description: 3GPP TS 29.510 V15.3.0; 5G System; Network Function Repository Services; Stage 3 - url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.510/' + LmfInfo: + type: object + properties: + servingClientTypes: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/ExternalClientType' + minItems: 1 + lmfId: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LMFIdentification' + servingAccessTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + minItems: 1 + servingAnNodeTypes: + type: array + items: + $ref: '#/components/schemas/AnNodeType' + minItems: 1 + servingRatTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + minItems: 1 + GmlcInfo: + type: object + properties: + servingClientTypes: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/ExternalClientType' + minItems: 1 + AfEventExposureData: + description: AF Event Exposure data managed by a given NEF Instance + type: object + required: + - afEvents + properties: + afEvents: + type: array + items: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AfEvent' + minItems: 1 + afIds: + type: array + items: + type: string + minItems: 1 + appIds: + type: array + items: + type: string + minItems: 1 + PcscfInfo: + description: Information of a P-CSCF NF Instance + type: object + properties: + accessType: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + minItems: 1 + dnnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + NfInfo: + description: Information of a generic NF Instance + type: object + properties: + nfType: + $ref: '#/components/schemas/NFType' + HssInfo: + description: Information of an HSS NF Instance + type: object + properties: + groupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + imsRanges: + type: array + items: + $ref: '#/components/schemas/ImsiRange' + minItems: 1 + ImsiRange: + description: A range of IMSIs (subscriber identities), either based on a numeric range, or based on regular-expression matching + type: object + properties: + start: + type: string + pattern: '^[0-9]+$' + end: + type: string + pattern: '^[0-9]+$' + pattern: + type: string + TwifInfo: + type: object + properties: + ipv4EndpointAddresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + ipv6EndpointAddresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + endpointFqdn: + $ref: '#/components/schemas/Fqdn' + VendorId: + description: Vendor ID of the NF Service instance (Private Enterprise Number assigned by IANA) + type: string + pattern: '^[0-9]{6}$' + VendorSpecificFeature: + description: Information about a vendor-specific feature + type: object + required: + - featureName + - featureVersion + properties: + featureName: + type: string + featureVersion: + type: string + AnNodeType: + anyOf: + - type: string + enum: + - GNB + - NG_ENB + - type: string + UdsfInfo: + type: object + properties: + groupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + supiRanges: + type: array + items: + $ref: '#/components/schemas/SupiRange' + minItems: 1 diff --git a/lib/sbi/support/modified/TS29512_Npcf_SMPolicyControl.yaml b/lib/sbi/support/modified/TS29512_Npcf_SMPolicyControl.yaml new file mode 100644 index 0000000000..eda11fab7d --- /dev/null +++ b/lib/sbi/support/modified/TS29512_Npcf_SMPolicyControl.yaml @@ -0,0 +1,1987 @@ +openapi: 3.0.0 +info: + title: Npcf_SMPolicyControl API + version: 1.1.1.alpha-5 + description: | + Session Management Policy Control Service + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.512 V16.4.0; 5G System; Session Management Policy Control Service. + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.512/' +security: + - {} + - oAuth2Clientcredentials: + - npcf-smpolicycontrol +servers: + - url: '{apiRoot}/npcf-smpolicycontrol/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in subclause 4.4 of 3GPP TS 29.501 +paths: + /sm-policies: + post: + summary: Create a new Individual SM Policy + operationId: CreateSMPolicy + tags: + - SM Policies (Collection) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SmPolicyContextData' + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/SmPolicyDecision' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '308': + description: Permanent Redirect + headers: + Location: + description: 'Contains the URI of the PCF within the existing PCF binding information stored in the BSF for the same UE ID, S-NSSAI and DNN combination ' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + description: Not Found + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + SmPolicyUpdateNotification: + '{$request.body#/notificationUri}/update': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SmPolicyNotification' + responses: + '200': + description: OK. The current applicable values corresponding to the policy control request trigger is reported + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/UeCampingRep' + - type: array + items: + $ref: '#/components/schemas/PartialSuccessReport' + minItems: 1 + '204': + description: No Content, Notification was succesfull + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorReport' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + SmPolicyControlTerminationRequestNotification: + '{$request.body#/notificationUri}/terminate': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TerminationNotification' + responses: + '204': + description: No Content, Notification was succesful + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /sm-policies/{smPolicyId}: + get: + summary: Read an Individual SM Policy + operationId: GetSMPolicy + tags: + - Individual SM Policy (Document) + parameters: + - name: smPolicyId + in: path + description: Identifier of a policy association + required: true + schema: + type: string + responses: + '200': + description: OK. Resource representation is returned + content: + application/json: + schema: + $ref: '#/components/schemas/SmPolicyControl' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /sm-policies/{smPolicyId}/update: + post: + summary: Update an existing Individual SM Policy + operationId: UpdateSMPolicy + tags: + - Individual SM Policy (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SmPolicyUpdateContextData' + parameters: + - name: smPolicyId + in: path + description: Identifier of a policy association + required: true + schema: + type: string + responses: + '200': + description: OK. Updated policies are returned + content: + application/json: + schema: + $ref: '#/components/schemas/SmPolicyDecision' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /sm-policies/{smPolicyId}/delete: + post: + summary: Delete an existing Individual SM Policy + operationId: DeleteSMPolicy + tags: + - Individual SM Policy (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SmPolicyDeleteData' + parameters: + - name: smPolicyId + in: path + description: Identifier of a policy association + required: true + schema: + type: string + responses: + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2Clientcredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + npcf-smpolicycontrol: Access to the Npcf_SMPolicyControl API + schemas: + SmPolicyControl: + type: object + properties: + context: + $ref: '#/components/schemas/SmPolicyContextData' + policy: + $ref: '#/components/schemas/SmPolicyDecision' + required: + - context + - policy + SmPolicyContextData: + type: object + properties: + accNetChId: + $ref: '#/components/schemas/AccNetChId' + chargEntityAddr: + $ref: '#/components/schemas/AccNetChargingAddress' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + interGrpIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + pduSessionType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + chargingcharacteristics: + type: string + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + dnnSelMode: + $ref: 'TS29502_Nsmf_PDUSession.yaml#/components/schemas/DnnSelectionMode' + notificationUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + addAccessInfo: + $ref: '#/components/schemas/AdditionalAccessInfo' + servingNetwork: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + userLocationInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + ipv4Address: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6AddressPrefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + ipDomain: + type: string + description: Indicates the IPv4 address domain + subsSessAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + authProfIndex: + type: string + description: Indicates the DN-AAA authorization profile index + subsDefQos: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SubscribedDefaultQos' + numOfPackFilter: + type: integer + description: Contains the number of supported packet filter for signalled QoS rules. + online: + type: boolean + description: If it is included and set to true, the online charging is applied to the PDU session. + offline: + type: boolean + description: If it is included and set to true, the offline charging is applied to the PDU session. + 3gppPsDataOffStatus: + type: boolean + description: If it is included and set to true, the 3GPP PS Data Off is activated by the UE. + refQosIndication: + type: boolean + description: If it is included and set to true, the reflective QoS is supported by the UE. + traceReq: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + sliceInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + qosFlowUsage: + $ref: '#/components/schemas/QosFlowUsage' + servNfId: + $ref: '#/components/schemas/ServingNfIdentity' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + smfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + maPduInd: + $ref: '#/components/schemas/MaPduIndication' + atsssCapab: + $ref: '#/components/schemas/AtsssCapability' + required: + - supi + - pduSessionId + - pduSessionType + - dnn + - notificationUri + - sliceInfo + SmPolicyDecision: + type: object + properties: + sessRules: + type: object + additionalProperties: + $ref: '#/components/schemas/SessionRule' + minProperties: 1 + description: A map of Sessionrules with the content being the SessionRule as described in subclause 5.6.2.7. + pccRules: + type: object + additionalProperties: + $ref: '#/components/schemas/PccRule' + minProperties: 1 + description: A map of PCC rules with the content being the PCCRule as described in subclause 5.6.2.6. + nullable: true + pcscfRestIndication: + type: boolean + description: If it is included and set to true, it indicates the P-CSCF Restoration is requested. + qosDecs: + type: object + additionalProperties: + $ref: '#/components/schemas/QosData' + minProperties: 1 + description: Map of QoS data policy decisions. + chgDecs: + type: object + additionalProperties: + $ref: '#/components/schemas/ChargingData' + minProperties: 1 + description: Map of Charging data policy decisions. + nullable: true + chargingInfo: + $ref: '#/components/schemas/ChargingInformation' + traffContDecs: + type: object + additionalProperties: + $ref: '#/components/schemas/TrafficControlData' + minProperties: 1 + description: Map of Traffic Control data policy decisions. + umDecs: + type: object + additionalProperties: + $ref: '#/components/schemas/UsageMonitoringData' + minProperties: 1 + description: Map of Usage Monitoring data policy decisions. + nullable: true + qosChars: + type: object + additionalProperties: + $ref: '#/components/schemas/QosCharacteristics' + minProperties: 1 + description: Map of QoS characteristics for non standard 5QIs. This map uses the 5QI values as keys. + qosMonDecs: + type: object + additionalProperties: + $ref: '#/components/schemas/QosMonitoringData' + minProperties: 1 + description: Map of QoS Monitoring data policy decisions. + nullable: true + reflectiveQoSTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + conds: + type: object + additionalProperties: + $ref: '#/components/schemas/ConditionData' + minProperties: 1 + description: A map of condition data with the content being as described in subclause 5.6.2.9. + nullable: true + revalidationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + offline: + type: boolean + description: Indicates the offline charging is applicable to the PDU session or PCC rule. + online: + type: boolean + description: Indicates the online charging is applicable to the PDU session or PCC rule. + policyCtrlReqTriggers: + type: array + items: + $ref: '#/components/schemas/PolicyControlRequestTrigger' + minItems: 1 + description: Defines the policy control request triggers subscribed by the PCF. + nullable: true + lastReqRuleData: + type: array + items: + $ref: '#/components/schemas/RequestedRuleData' + minItems: 1 + description: Defines the last list of rule control data requested by the PCF. + lastReqUsageData: + $ref: '#/components/schemas/RequestedUsageData' + praInfos: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfoRm' + minProperties: 1 + description: Map of PRA information. + nullable: true + ipv4Index: + $ref: 'TS29519_Policy_Data.yaml#/components/schemas/IpIndex' + ipv6Index: + $ref: 'TS29519_Policy_Data.yaml#/components/schemas/IpIndex' + qosFlowUsage: + $ref: '#/components/schemas/QosFlowUsage' + relCause: + $ref: '#/components/schemas/SmPolicyAssociationReleaseCause' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + tsnPortManContDstt: + $ref: '#/components/schemas/PortManagementContainer' + tsnPortManContNwtts: + type: array + items: + $ref: '#/components/schemas/PortManagementContainer' + minItems: 1 + SmPolicyNotification: + type: object + properties: + resourceUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + smPolicyDecision: + $ref: '#/components/schemas/SmPolicyDecision' + PccRule: + type: object + properties: + flowInfos: + type: array + items: + $ref: '#/components/schemas/FlowInformation' + minItems: 1 + description: An array of IP flow packet filter information. + appId: + type: string + description: A reference to the application detection filter configured at the UPF. + contVer: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/ContentVersion' + pccRuleId: + type: string + description: Univocally identifies the PCC rule within a PDU session. + precedence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + afSigProtocol: + $ref: '#/components/schemas/AfSigProtocol' + appReloc: + type: boolean + description: Indication of application relocation possibility. + refQosData: + type: array + items: + type: string + minItems: 1 + maxItems: 1 + description: A reference to the QoSData policy type decision type. It is the qosId described in subclause 5.6.2.8. + refAltQosParams: + type: array + items: + type: string + minItems: 1 + description: A Reference to the QoS Data policy decision type for the Alternative QoS parameter sets of the service data flow. + refTcData: + type: array + items: + type: string + minItems: 1 + maxItems: 1 + description: A reference to the TrafficControlData policy decision type. It is the tcId described in subclause 5.6.2.10. + refChgData: + type: array + items: + type: string + minItems: 1 + maxItems: 1 + description: A reference to the ChargingData policy decision type. It is the chgId described in subclause 5.6.2.11. + nullable: true + refChgN3gData: + type: array + items: + type: string + minItems: 1 + maxItems: 1 + description: A reference to the ChargingData policy decision type only applicable to Non-3GPP access if "ATSSS" feature is supported. It is the chgId described in subclause 5.6.2.11. + nullable: true + refUmData: + type: array + items: + type: string + minItems: 1 + maxItems: 1 + description: A reference to UsageMonitoringData policy decision type. It is the umId described in subclause 5.6.2.12. + nullable: true + refUmN3gData: + type: array +# items: + items: + type: string + minItems: 1 + maxItems: 1 + description: A reference to UsageMonitoringData policy decision type only applicable to Non-3GPP access if "ATSSS" feature is supported. It is the umId described in subclause 5.6.2.12. + nullable: true + refCondData: + type: string + description: A reference to the condition data. It is the condId described in subclause 5.6.2.9. + nullable: true + refQosMon: + type: array + items: + type: string + minItems: 1 + maxItems: 1 + description: A reference to the QosMonitoringData policy type decision type. It is the qmId described in subclause 5.6.2.40. + nullable: true + addrPreserInd: + type: boolean + nullable: true + tscaiInputDl: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TscaiInputContainer' + tscaiInputUl: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TscaiInputContainer' + required: + - pccRuleId + nullable: true + SessionRule: + type: object + properties: + authSessAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + authDefQos: + $ref: '#/components/schemas/AuthorizedDefaultQos' + sessRuleId: + type: string + description: Univocally identifies the session rule within a PDU session. + refUmData: + type: string + description: A reference to UsageMonitoringData policy decision type. It is the umId described in subclause 5.6.2.12. + nullable: true + refUmN3gData: + type: string + description: A reference to UsageMonitoringData policy decision type to apply for Non-3GPP access. It is the umId described in subclause 5.6.2.12. + nullable: true + refCondData: + type: string + description: A reference to the condition data. It is the condId described in subclause 5.6.2.9. + nullable: true + required: + - sessRuleId + nullable: true + QosData: + type: object + properties: + qosId: + type: string + description: Univocally identifies the QoS control policy data within a PDU session. + 5qi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5Qi' + maxbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + maxbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + gbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + gbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + arp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + qnc: + type: boolean + description: Indicates whether notifications are requested from 3GPP NG-RAN when the GFBR can no longer (or again) be guaranteed for a QoS Flow during the lifetime of the QoS Flow. + priorityLevel: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5QiPriorityLevelRm' + averWindow: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AverWindowRm' + maxDataBurstVol: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MaxDataBurstVolRm' + reflectiveQos: + type: boolean + description: Indicates whether the QoS information is reflective for the corresponding service data flow. + sharingKeyDl: + type: string + description: Indicates, by containing the same value, what PCC rules may share resource in downlink direction. + sharingKeyUl: + type: string + description: Indicates, by containing the same value, what PCC rules may share resource in uplink direction. + maxPacketLossRateDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRateRm' + maxPacketLossRateUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRateRm' + defQosFlowIndication: + type: boolean + description: Indicates that the dynamic PCC rule shall always have its binding with the QoS Flow associated with the default QoS rule + extMaxDataBurstVol: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtMaxDataBurstVolRm' + required: + - qosId + nullable: true + ConditionData: + type: object + properties: + condId: + type: string + description: Uniquely identifies the condition data within a PDU session. + activationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTimeRm' + deactivationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTimeRm' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + required: + - condId + nullable: true + TrafficControlData: + type: object + properties: + tcId: + type: string + description: Univocally identifies the traffic control policy data within a PDU session. + flowStatus: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/FlowStatus' + redirectInfo: + $ref: '#/components/schemas/RedirectInformation' + addRedirectInfo: + type: array + items: + $ref: '#/components/schemas/RedirectInformation' + minItems: 1 + muteNotif: + type: boolean + description: Indicates whether applicat'on's start or stop notification is to be muted. + trafficSteeringPolIdDl: + type: string + description: Reference to a pre-configured traffic steering policy for downlink traffic at the SMF. + nullable: true + trafficSteeringPolIdUl: + type: string + description: Reference to a pre-configured traffic steering policy for uplink traffic at the SMF. + nullable: true + routeToLocs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + minItems: 1 + description: A list of location which the traffic shall be routed to for the AF request + traffCorreInd: + type: boolean + upPathChgEvent: + $ref: '#/components/schemas/UpPathChgEvent' + steerFun: + $ref: '#/components/schemas/SteeringFunctionality' + steerModeDl: + $ref: '#/components/schemas/SteeringMode' + steerModeUl: + $ref: '#/components/schemas/SteeringMode' + mulAccCtrl: + $ref: '#/components/schemas/MulticastAccessControl' + required: + - tcId + nullable: true + ChargingData: + type: object + properties: + chgId: + type: string + description: Univocally identifies the charging control policy data within a PDU session. + meteringMethod: + $ref: '#/components/schemas/MeteringMethod' + offline: + type: boolean + description: Indicates the offline charging is applicable to the PCC rule. + online: + type: boolean + description: Indicates the online charging is applicable to the PCC rule. + sdfHandl: + type: boolean + description: Indicates whether the service data flow is allowed to start while the SMF is waiting for the response to the credit request. + ratingGroup: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatingGroup' + reportingLevel: + $ref: '#/components/schemas/ReportingLevel' + serviceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceId' + sponsorId: + type: string + description: Indicates the sponsor identity. + appSvcProvId: + type: string + description: Indicates the application service provider identity. + afChargingIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ChargingId' + afChargId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationChargingId' + required: + - chgId + nullable: true + UsageMonitoringData: + type: object + properties: + umId: + type: string + description: Univocally identifies the usage monitoring policy data within a PDU session. + volumeThreshold: + $ref: 'TS29122_CommonData.yaml#/components/schemas/VolumeRm' + volumeThresholdUplink: + $ref: 'TS29122_CommonData.yaml#/components/schemas/VolumeRm' + volumeThresholdDownlink: + $ref: 'TS29122_CommonData.yaml#/components/schemas/VolumeRm' + timeThreshold: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + monitoringTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTimeRm' + nextVolThreshold: + $ref: 'TS29122_CommonData.yaml#/components/schemas/VolumeRm' + nextVolThresholdUplink: + $ref: 'TS29122_CommonData.yaml#/components/schemas/VolumeRm' + nextVolThresholdDownlink: + $ref: 'TS29122_CommonData.yaml#/components/schemas/VolumeRm' + nextTimeThreshold: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + inactivityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + exUsagePccRuleIds: + type: array + items: + type: string + minItems: 1 + description: Contains the PCC rule identifier(s) which corresponding service data flow(s) shall be excluded from PDU Session usage monitoring. It is only included in the UsageMonitoringData instance for session level usage monitoring. + nullable: true + required: + - umId + nullable: true + RedirectInformation: + type: object + properties: + redirectEnabled: + type: boolean + description: Indicates the redirect is enable. + redirectAddressType: + $ref: '#/components/schemas/RedirectAddressType' + redirectServerAddress: + type: string + description: Indicates the address of the redirect server. + FlowInformation: + type: object + properties: + flowDescription: + $ref: '#/components/schemas/FlowDescription' + ethFlowDescription: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + packFiltId: + type: string + description: An identifier of packet filter. + packetFilterUsage: + type: boolean + description: The packet shall be sent to the UE. + tosTrafficClass: + type: string + description: Contains the Ipv4 Type-of-Service and mask field or the Ipv6 Traffic-Class field and mask field. + nullable: true + spi: + type: string + description: the security parameter index of the IPSec packet. + nullable: true + flowLabel: + type: string + description: the Ipv6 flow label header field. + nullable: true + flowDirection: + $ref: '#/components/schemas/FlowDirectionRm' + SmPolicyDeleteData: + type: object + properties: + userLocationInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + servingNetwork: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + userLocationInfoTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ranNasRelCauses: + type: array + items: + $ref: '#/components/schemas/RanNasRelCause' + minItems: 1 + description: Contains the RAN and/or NAS release cause. + accuUsageReports: + type: array + items: + $ref: '#/components/schemas/AccuUsageReport' + minItems: 1 + description: Contains the usage report + pduSessRelCause: + $ref: '#/components/schemas/PduSessionRelCause' + QosCharacteristics: + type: object + properties: + 5qi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5Qi' + resourceType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/QosResourceType' + priorityLevel: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5QiPriorityLevel' + packetDelayBudget: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' + packetErrorRate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketErrRate' + averagingWindow: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AverWindow' + maxDataBurstVol: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MaxDataBurstVol' + extMaxDataBurstVol: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtMaxDataBurstVol' + required: + - 5qi + - resourceType + - priorityLevel + - packetDelayBudget + - packetErrorRate + ChargingInformation: + type: object + properties: + primaryChfAddress: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + secondaryChfAddress: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + primaryChfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + primaryChfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + secondaryChfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + secondaryChfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + required: + - primaryChfAddress + - secondaryChfAddress + AccuUsageReport: + type: object + properties: + refUmIds: + type: string + description: An id referencing UsageMonitoringData objects associated with this usage report. + volUsage: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + volUsageUplink: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + volUsageDownlink: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + timeUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + nextVolUsage: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + nextVolUsageUplink: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + nextVolUsageDownlink: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + nextTimeUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + required: + - refUmIds + SmPolicyUpdateContextData: + type: object + properties: + repPolicyCtrlReqTriggers: + type: array + items: + $ref: '#/components/schemas/PolicyControlRequestTrigger' + minItems: 1 + description: The policy control reqeust trigges which are met. + accNetChIds: + type: array + items: + $ref: '#/components/schemas/AccNetChId' + minItems: 1 + description: Indicates the access network charging identifier for the PCC rule(s) or whole PDU session. + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + addAccessInfo: + $ref: '#/components/schemas/AdditionalAccessInfo' + relAccessInfo: + $ref: '#/components/schemas/AdditionalAccessInfo' + servingNetwork: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + userLocationInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + relIpv4Address: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv4Address: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipDomain: + type: string + description: Indicates the IPv4 address domain + ipv6AddressPrefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + relIpv6AddressPrefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + addIpv6AddrPrefixes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + addRelIpv6AddrPrefixes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + relUeMac: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + ueMac: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + subsSessAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + authProfIndex: + type: string + description: Indicates the DN-AAA authorization profile index + subsDefQos: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SubscribedDefaultQos' + numOfPackFilter: + type: integer + description: Contains the number of supported packet filter for signalled QoS rules. + accuUsageReports: + type: array + items: + $ref: '#/components/schemas/AccuUsageReport' + minItems: 1 + description: Contains the usage report + 3gppPsDataOffStatus: + type: boolean + description: If it is included and set to true, the 3GPP PS Data Off is activated by the UE. + appDetectionInfos: + type: array + items: + $ref: '#/components/schemas/AppDetectionInfo' + minItems: 1 + description: Report the start/stop of the application traffic and detected SDF descriptions if applicable. + ruleReports: + type: array + items: + $ref: '#/components/schemas/RuleReport' + minItems: 1 + description: Used to report the PCC rule failure. + sessRuleReports: + type: array + items: + $ref: '#/components/schemas/SessionRuleReport' + minItems: 1 + description: Used to report the session rule failure. + qncReports: + type: array + items: + $ref: '#/components/schemas/QosNotificationControlInfo' + minItems: 1 + description: QoS Notification Control information. + qosMonReports: + type: array + items: + $ref: '#/components/schemas/QosMonitoringReport' + userLocationInfoTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + repPraInfos: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 1 + description: Reports the changes of presence reporting area. + ueInitResReq: + $ref: '#/components/schemas/UeInitiatedResourceRequest' + refQosIndication: + type: boolean + description: If it is included and set to true, the reflective QoS is supported by the UE. If it is included and set to false, the reflective QoS is revoked by the UE. + qosFlowUsage: + $ref: '#/components/schemas/QosFlowUsage' + creditManageStatus: + $ref: '#/components/schemas/CreditManagementStatus' + servNfId: + $ref: '#/components/schemas/ServingNfIdentity' + traceReq: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + maPduInd: + $ref: '#/components/schemas/MaPduIndication' + atsssCapab: + $ref: '#/components/schemas/AtsssCapability' + tsnBridgeInfo: + $ref: '#/components/schemas/TsnBridgeInfo' + tsnPortManContDstt: + $ref: '#/components/schemas/PortManagementContainer' + tsnPortManContNwtts: + type: array + items: + $ref: '#/components/schemas/PortManagementContainer' + minItems: 1 + mulAddrInfos: + type: array + items: + $ref: '#/components/schemas/IpMulticastAddressInfo' + minItems: 1 + UpPathChgEvent: + type: object + properties: + notificationUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + notifCorreId: + type: string + description: It is used to set the value of Notification Correlation ID in the notification sent by the SMF. + dnaiChgType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DnaiChangeType' + afAckInd: + type: boolean + required: + - notificationUri + - notifCorreId + - dnaiChgType + nullable: true + TerminationNotification: + type: object + properties: + resourceUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + cause: + $ref: '#/components/schemas/SmPolicyAssociationReleaseCause' + required: + - resourceUri + - cause + AppDetectionInfo: + type: object + properties: + appId: + type: string + description: A reference to the application detection filter configured at the UPF + instanceId: + type: string + description: Identifier sent by the SMF in order to allow correlation of application Start and Stop events to the specific service data flow description, if service data flow descriptions are deducible. + sdfDescriptions: + type: array + items: + $ref: '#/components/schemas/FlowInformation' + minItems: 1 + description: Contains the detected service data flow descriptions if they are deducible. + required: + - appId + AccNetChId: + type: object + properties: + accNetChaIdValue: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ChargingId' + refPccRuleIds: + type: array + items: + type: string + minItems: 1 + description: Contains the identifier of the PCC rule(s) associated to the provided Access Network Charging Identifier. + sessionChScope: + type: boolean + description: When it is included and set to true, indicates the Access Network Charging Identifier applies to the whole PDU Session + required: + - accNetChaIdValue + AccNetChargingAddress: + description: Describes the network entity within the access network performing charging + type: object + anyOf: + - required: [anChargIpv4Addr] + - required: [anChargIpv6Addr] + properties: + anChargIpv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + anChargIpv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + RequestedRuleData: + type: object + properties: + refPccRuleIds: + type: array + items: + type: string + minItems: 1 + description: An array of PCC rule id references to the PCC rules associated with the control data. + reqData: + type: array + items: + $ref: '#/components/schemas/RequestedRuleDataType' + minItems: 1 + description: Array of requested rule data type elements indicating what type of rule data is requested for the corresponding referenced PCC rules. + required: + - refPccRuleIds + - reqData + RequestedUsageData: + type: object + properties: + refUmIds: + type: array + items: + type: string + minItems: 1 + description: An array of usage monitoring data id references to the usage monitoring data instances for which the PCF is requesting a usage report. This attribute shall only be provided when allUmIds is not set to true. + allUmIds: + type: boolean + description: Thooleanean indicates whether requested usage data applies to all usage monitoring data instances. When it's not included, it means requested usage data shall only apply to the usage monitoring data instances referenced by the refUmIds attribute. + UeCampingRep: + type: object + properties: + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + servNfId: + $ref: '#/components/schemas/ServingNfIdentity' + servingNetwork: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + userLocationInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + RuleReport: + type: object + properties: + pccRuleIds: + type: array + items: + type: string + minItems: 1 + description: Contains the identifier of the affected PCC rule(s). + ruleStatus: + $ref: '#/components/schemas/RuleStatus' + contVers: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/ContentVersion' + minItems: 1 + description: Indicates the version of a PCC rule. + failureCode: + $ref: '#/components/schemas/FailureCode' + finUnitAct: + $ref: 'TS32291_Nchf_ConvergedCharging.yaml#/components/schemas/FinalUnitAction' + ranNasRelCauses: + type: array + items: + $ref: '#/components/schemas/RanNasRelCause' + minItems: 1 + description: indicates the RAN or NAS release cause code information. + required: + - pccRuleIds + - ruleStatus + RanNasRelCause: + type: object + properties: + ngApCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + 5gMmCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5GMmCause' + 5gSmCause: + $ref: '#/components/schemas/5GSmCause' + UeInitiatedResourceRequest: + type: object + properties: + pccRuleId: + type: string + ruleOp: + $ref: '#/components/schemas/RuleOperation' + precedence: + type: integer + packFiltInfo: + type: array + items: + $ref: '#/components/schemas/PacketFilterInfo' + minItems: 1 + reqQos: + $ref: '#/components/schemas/RequestedQos' + required: + - ruleOp + - packFiltInfo + PacketFilterInfo: + type: object + properties: + packFiltId: + type: string + description: An identifier of packet filter. + packFiltCont: + $ref: '#/components/schemas/PacketFilterContent' + tosTrafficClass: + type: string + description: Contains the Ipv4 Type-of-Service and mask field or the Ipv6 Traffic-Class field and mask field. + spi: + type: string + description: The security parameter index of the IPSec packet. + flowLabel: + type: string + description: The Ipv6 flow label header field. + flowDirection: + $ref: '#/components/schemas/FlowDirection' + RequestedQos: + type: object + properties: + 5qi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5Qi' + gbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + gbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + required: + - 5qi + QosNotificationControlInfo: + type: object + properties: + refPccRuleIds: + type: array + items: + type: string + minItems: 1 + description: An array of PCC rule id references to the PCC rules associated with the QoS notification control info. + notifType: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/QosNotifType' + contVer: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/ContentVersion' + altQosParamId: + type: string + required: + - refPccRuleIds + - notifType + PartialSuccessReport: + type: object + properties: + failureCause: + $ref: '#/components/schemas/FailureCause' + ruleReports: + type: array + items: + $ref: '#/components/schemas/RuleReport' + minItems: 1 + description: Information about the PCC rules provisioned by the PCF not successfully installed/activated. + sessRuleReports: + type: array + items: + $ref: '#/components/schemas/SessionRuleReport' + minItems: 1 + description: Information about the session rules provisioned by the PCF not successfully installed. + ueCampingRep: + $ref: '#/components/schemas/UeCampingRep' + required: + - failureCause + AuthorizedDefaultQos: + type: object + properties: + 5qi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5Qi' + arp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + priorityLevel: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5QiPriorityLevelRm' + averWindow: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AverWindowRm' + maxDataBurstVol: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MaxDataBurstVolRm' + maxbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + maxbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + gbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + gbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + qnc: + type: boolean + description: Indicates whether notifications are requested from 3GPP NG-RAN when the GFBR can no longer (or again) be guaranteed for a QoS Flow during the lifetime of the QoS Flow. + extMaxDataBurstVol: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtMaxDataBurstVolRm' + ErrorReport: + type: object + properties: + error: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + ruleReports: + type: array + items: + $ref: '#/components/schemas/RuleReport' + minItems: 1 + description: Used to report the PCC rule failure. + sessRuleReports: + type: array + items: + $ref: '#/components/schemas/SessionRuleReport' + minItems: 1 + description: Used to report the session rule failure. + SessionRuleReport: + type: object + properties: + ruleIds: + type: array + items: + type: string + minItems: 1 + description: Contains the identifier of the affected session rule(s). + ruleStatus: + $ref: '#/components/schemas/RuleStatus' + sessRuleFailureCode: + $ref: '#/components/schemas/SessionRuleFailureCode' + required: + - ruleIds + - ruleStatus + ServingNfIdentity: + type: object + properties: + servNfInstId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + anGwAddr: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/AnGwAddress' + SteeringMode: + type: object + properties: + steerModeValue: + $ref: '#/components/schemas/SteerModeValue' + active: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + standby: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + 3gLoad: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + prioAcc: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + required: + - steerModeValue + AdditionalAccessInfo: + type: object + properties: + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + required: + - accessType + QosMonitoringData: + type: object + properties: + qmId: + type: string + description: Univocally identifies the QoS monitoring policy data within a PDU session. + reqQosMonParams: + type: array + items: + $ref: '#/components/schemas/RequestedQosMonitoringParameter' + minItems: 1 + maxItems: 3 + description: indicates the UL packet delay, DL packet delay and/or round trip packet delay between the UE and the UPF is to be monitored when the QoS Monitoring for URLLC is enabled for the service data flow.. + repFreqs: + type: array + items: + $ref: '#/components/schemas/ReportingFrequency' + minItems: 1 + repThreshDl: + type: integer + description: Unsigned integer identifying a period of time in units of miliiseconds for DL packet delay. + nullable: true + repThreshUl: + type: integer + description: Unsigned integer identifying a period of time in units of miliiseconds for UL packet delay. + nullable: true + repThreshRp: + type: integer + description: Unsigned integer identifying a period of time in units of miliiseconds for round trip packet delay. + nullable: true + waitTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + repPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + notifyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + notifyCorreId: + type: string + required: + - qmId + nullable: true + QosMonitoringReport: + type: object + properties: + refPccRuleIds: + type: array + items: + type: string + minItems: 1 + description: An array of PCC rule id references to the PCC rules associated with the QoS monitoring report. + ulDelays: + type: array + items: + type: integer + dlDelays: + type: array + items: + type: integer + rtDelays: + type: array + items: + type: integer + required: + - refPccRuleIds +# + TsnBridgeInfo: + type: object + properties: + bridgeName: + type: string + description: Name of the bridge. + bridgeMac: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + nwttPorts: + type: array + items: + $ref: '#/components/schemas/TsnPortIdentifier' + minItems: 1 + description: NW-TT ports available for a PDU session. + dsttPort: + $ref: '#/components/schemas/TsnPortIdentifier' + dsttResidTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' +# + TsnPortIdentifier: + type: object + properties: + portMac: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + portNumber: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + required: + - portMac +# + PortManagementContainer: + type: object + properties: + portManCont: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + portIdentifier: + $ref: '#/components/schemas/TsnPortIdentifier' + required: + - portManCont + - portIdentifier + IpMulticastAddressInfo: + type: object + properties: + srcIpv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv4MulAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + srcIpv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + ipv6MulAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + 5GSmCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + PacketFilterContent: + type: string + description: Defines a packet filter for an IP flow. Refer to subclause 5.3.54 of 3GPP TS 29.212 for encoding. + FlowDescription: + type: string + description: Defines a packet filter for an IP flow. Refer to subclause 5.4.2 of 3GPP TS 29.212 for encoding. + FlowDirection: + anyOf: + - type: string + enum: + - DOWNLINK + - UPLINK + - BIDIRECTIONAL + - UNSPECIFIED + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - DOWNLINK: The corresponding filter applies for traffic to the UE. + - UPLINK: The corresponding filter applies for traffic from the UE. + - BIDIRECTIONAL: The corresponding filter applies for traffic both to and from the UE. + - UNSPECIFIED: The corresponding filter applies for traffic to the UE (downlink), but has no specific direction declared. The service data flow detection shall apply the filter for uplink traffic as if the filter was bidirectional. The PCF shall not use the value UNSPECIFIED in filters created by the network in NW-initiated procedures. The PCF shall only include the value UNSPECIFIED in filters in UE-initiated procedures if the same value is received from the SMF. + FlowDirectionRm: + anyOf: + - $ref: '#/components/schemas/FlowDirection' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/NullValue' + ReportingLevel: + anyOf: + - type: string + enum: + - SER_ID_LEVEL + - RAT_GR_LEVEL + - SPON_CON_LEVEL + - $ref: 'TS29571_CommonData.yaml#/components/schemas/NullValue' + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - SER_ID_LEVEL: Indicates that the usage shall be reported on service id and rating group combination level. + - RAT_GR_LEVEL: Indicates that the usage shall be reported on rating group level. + - SPON_CON_LEVEL: Indicates that the usage shall be reported on sponsor identity and rating group combination level. + MeteringMethod: + anyOf: + - type: string + enum: + - DURATION + - VOLUME + - DURATION_VOLUME + - EVENT + - $ref: 'TS29571_CommonData.yaml#/components/schemas/NullValue' + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - DURATION: Indicates that the duration of the service data flow traffic shall be metered. + - VOLUME: Indicates that volume of the service data flow traffic shall be metered. + - DURATION_VOLUME: Indicates that the duration and the volume of the service data flow traffic shall be metered. + - EVENT: Indicates that events of the service data flow traffic shall be metered. + PolicyControlRequestTrigger: + anyOf: + - type: string + enum: + - PLMN_CH + - RES_MO_RE + - AC_TY_CH + - UE_IP_CH + - UE_MAC_CH + - AN_CH_COR + - US_RE + - APP_STA + - APP_STO + - AN_INFO + - CM_SES_FAIL + - PS_DA_OFF + - DEF_QOS_CH + - SE_AMBR_CH + - QOS_NOTIF + - NO_CREDIT + - REALLO_OF_CREDIT + - PRA_CH + - SAREA_CH + - SCNN_CH + - RE_TIMEOUT + - RES_RELEASE + - SUCC_RES_ALLO + - RAT_TY_CH + - REF_QOS_IND_CH + - NUM_OF_PACKET_FILTER + - UE_STATUS_RESUME + - UE_TZ_CH + - AUTH_PROF_CH + - QOS_MONITORING + - SCELL_CH + - EPS_FALLBACK + - MA_PDU + - TSN_ETHER_PORT + - TSN_CONTAINER + - 5G_RG_JOIN + - 5G_RG_LEAVE + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - PLMN_CH: PLMN Change + - RES_MO_RE: A request for resource modification has been received by the SMF. The SMF always reports to the PCF. + - AC_TY_CH: Access Type Change + - UE_IP_CH: UE IP address change. The SMF always reports to the PCF. + - UE_MAC_CH: A new UE MAC address is detected or a used UE MAC address is inactive for a specific period + - AN_CH_COR: Access Network Charging Correlation Information + - US_RE: The PDU Session or the Monitoring key specific resources consumed by a UE either reached the threshold or needs to be reported for other reasons. + - APP_STA: The start of application traffic has been detected. + - APP_STO: The stop of application traffic has been detected. + - AN_INFO: Access Network Information report + - CM_SES_FAIL: Credit management session failure + - PS_DA_OFF: The SMF reports when the 3GPP PS Data Off status changes. The SMF always reports to the PCF. + - DEF_QOS_CH: Default QoS Change. The SMF always reports to the PCF. + - SE_AMBR_CH: Session AMBR Change. The SMF always reports to the PCF. + - QOS_NOTIF: The SMF notify the PCF when receiving notification from RAN that QoS targets of the QoS Flow cannot be guranteed or gurateed again. + - NO_CREDIT: Out of credit + - REALLO_OF_CREDIT: Reallocation of credit + - PRA_CH: Change of UE presence in Presence Reporting Area + - SAREA_CH: Location Change with respect to the Serving Area + - SCNN_CH: Location Change with respect to the Serving CN node + - RE_TIMEOUT: Indicates the SMF generated the request because there has been a PCC revalidation timeout + - RES_RELEASE: Indicate that the SMF can inform the PCF of the outcome of the release of resources for those rules that require so. + - SUCC_RES_ALLO: Indicates that the requested rule data is the successful resource allocation. + - RAT_TY_CH: RAT Type Change. + - REF_QOS_IND_CH: Reflective QoS indication Change + - NUM_OF_PACKET_FILTER: Indicates that the SMF shall report the number of supported packet filter for signalled QoS rules + - UE_STATUS_RESUME: Indicates that the UE’s status is resumed. + - UE_TZ_CH: UE Time Zone Change + - AUTH_PROF_CH: The DN-AAA authorization profile index has changed + - QOS_MONITORING: Indicate that the SMF notifies the PCF of the QoS Monitoring information. + - SCELL_CH: Location Change with respect to the Serving Cell. Only applicable to the interworking scenario as defined in Annex B. + - EPS_FALLBACK: EPS Fallback report is enabled in the SMF. + - MA_PDU: UE Indicates that the SMF notifies the PCF of the MA PDU session request + - TSN_ETHER_PORT: Manageable Ethernet port detected + - TSN_CONTAINER: Port management container detected. + - 5G_RG_JOIN: The 5G-RG has joined to an IP Multicast Group. + - 5G_RG_LEAVE: The 5G-RG has left an IP Multicast Group. + RequestedRuleDataType: + anyOf: + - type: string + enum: + - CH_ID + - MS_TIME_ZONE + - USER_LOC_INFO + - RES_RELEASE + - SUCC_RES_ALLO + - EPS_FALLBACK + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - CH_ID: Indicates that the requested rule data is the charging identifier. + - MS_TIME_ZONE: Indicates that the requested access network info type is the UE's timezone. + - USER_LOC_INFO: Indicates that the requested access network info type is the UE's location. + - RES_RELEASE: Indicates that the requested rule data is the result of the release of resource. + - SUCC_RES_ALLO: Indicates that the requested rule data is the successful resource allocation. + - EPS_FALLBACK: Indicates that the requested rule data is the report of QoS flow rejection due to EPS fallback. + RuleStatus: + anyOf: + - type: string + enum: + - ACTIVE + - INACTIVE + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - ACTIVE: Indicates that the PCC rule(s) are successfully installed (for those provisioned from PCF) or activated (for those pre-defined in SMF), or the session rule(s) are successfully installed + - INACTIVE: Indicates that the PCC rule(s) are removed (for those provisioned from PCF) or inactive (for those pre-defined in SMF) or the session rule(s) are removed. + FailureCode: + anyOf: + - type: string + enum: + - UNK_RULE_ID + - RA_GR_ERR + - SER_ID_ERR + - NF_MAL + - RES_LIM + - MAX_NR_QoS_FLOW + - MISS_FLOW_INFO + - RES_ALLO_FAIL + - UNSUCC_QOS_VAL + - INCOR_FLOW_INFO + - PS_TO_CS_HAN + - APP_ID_ERR + - NO_QOS_FLOW_BOUND + - FILTER_RES + - MISS_REDI_SER_ADDR + - CM_END_USER_SER_DENIED + - CM_CREDIT_CON_NOT_APP + - CM_AUTH_REJ + - CM_USER_UNK + - CM_RAT_FAILED + - UE_STA_SUSP + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - UNK_RULE_ID: Indicates that the pre-provisioned PCC rule could not be successfully activated because the PCC rule identifier is unknown to the SMF. + - RA_GR_ERR: Indicate that the PCC rule could not be successfully installed or enforced because the Rating Group specified within the Charging Data policy decision which the PCC rule refers to is unknown or, invalid. + - SER_ID_ERR: Indicate that the PCC rule could not be successfully installed or enforced because the Service Identifier specified within the Charging Data policy decision which the PCC rule refers to is invalid, unknown, or not applicable to the service being charged. + - NF_MAL: Indicate that the PCC rule could not be successfully installed (for those provisioned from the PCF) or activated (for those pre-defined in SMF) or enforced (for those already successfully installed) due to SMF/UPF malfunction. + - RES_LIM: Indicate that the PCC rule could not be successfully installed (for those provisioned from PCF) or activated (for those pre-defined in SMF) or enforced (for those already successfully installed) due to a limitation of resources at the SMF/UPF. + - MAX_NR_QoS_FLOW: Indicate that the PCC rule could not be successfully installed (for those provisioned from PCF) or activated (for those pre-defined in SMF) or enforced (for those already successfully installed) due to the fact that the maximum number of QoS flows has been reached for the PDU session. + - MISS_FLOW_INFO: Indicate that the PCC rule could not be successfully installed or enforced because neither the "flowInfos" attribute nor the "appId" attribute is specified within the PccRule data structure by the PCF during the first install request of the PCC rule. + - RES_ALLO_FAIL: Indicate that the PCC rule could not be successfully installed or maintained since the QoS flow establishment/modification failed, or the QoS flow was released. + - UNSUCC_QOS_VAL: indicate that the QoS validation has failed or when Guaranteed Bandwidth > Max-Requested-Bandwidth. + - INCOR_FLOW_INFO: Indicate that the PCC rule could not be successfully installed or modified at the SMF because the provided flow information is not supported by the network (e.g. the provided IP address(es) or Ipv6 prefix(es) do not correspond to an IP version applicable for the PDU session). + - PS_TO_CS_HAN: Indicate that the PCC rule could not be maintained because of PS to CS handover. + - APP_ID_ERR: Indicate that the rule could not be successfully installed or enforced because the Application Identifier is invalid, unknown, or not applicable to the application required for detection. + - NO_QOS_FLOW_BOUND: Indicate that there is no QoS flow which the SMF can bind the PCC rule(s) to. + - FILTER_RES: Indicate that the Flow Information within the "flowInfos" attribute cannot be handled by the SMF because any of the restrictions defined in subclause 5.4.2 of 3GPP TS 29.212 was not met. + - MISS_REDI_SER_ADDR: Indicate that the PCC rule could not be successfully installed or enforced at the SMF because there is no valid Redirect Server Address within the Traffic Control Data policy decision which the PCC rule refers to provided by the PCF and no preconfigured redirection address for this PCC rule at the SMF. + - CM_END_USER_SER_DENIED: Indicate that the charging system denied the service request due to service restrictions (e.g. terminate rating group) or limitations related to the end-user, for example the end-user's account could not cover the requested service. + - CM_CREDIT_CON_NOT_APP: Indicate that the charging system determined that the service can be granted to the end user but no further credit control is needed for the service (e.g. service is free of charge or is treated for offline charging). + - CM_AUTH_REJ: Indicate that the charging system denied the service request in order to terminate the service for which credit is requested. + - CM_USER_UNK: Indicate that the specified end user could not be found in the charging system. + - CM_RAT_FAILED: Indicate that the charging system cannot rate the service request due to insufficient rating input, incorrect AVP combination or due to an attribute or an attribute value that is not recognized or supported in the rating. + - UE_STA_SUSP: Indicates that the UE is in suspend state. + AfSigProtocol: + anyOf: + - type: string + enum: + - NO_INFORMATION + - SIP + - $ref: 'TS29571_CommonData.yaml#/components/schemas/NullValue' + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - NO_INFORMATION: Indicate that no information about the AF signalling protocol is being provided. + - SIP: Indicate that the signalling protocol is Session Initiation Protocol. + RuleOperation: + anyOf: + - type: string + enum: + - CREATE_PCC_RULE + - DELETE_PCC_RULE + - MODIFY_PCC_RULE_AND_ADD_PACKET_FILTERS + - MODIFY_ PCC_RULE_AND_REPLACE_PACKET_FILTERS + - MODIFY_ PCC_RULE_AND_DELETE_PACKET_FILTERS + - MODIFY_PCC_RULE_WITHOUT_MODIFY_PACKET_FILTERS + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - CREATE_PCC_RULE: Indicates to create a new PCC rule to reserve the resource requested by the UE. + - DELETE_PCC_RULE: Indicates to delete a PCC rule corresponding to reserve the resource requested by the UE.. + - MODIFY_PCC_RULE_AND_ADD_PACKET_FILTERS: Indicates to modify the PCC rule by adding new packet filter(s). + - MODIFY_ PCC_RULE_AND_REPLACE_PACKET_FILTERS: Indicates to modify the PCC rule by replacing the existing packet filter(s). + - MODIFY_ PCC_RULE_AND_DELETE_PACKET_FILTERS: Indicates to modify the PCC rule by deleting the existing packet filter(s). + - MODIFY_PCC_RULE_WITHOUT_MODIFY_PACKET_FILTERS: Indicates to modify the PCC rule by modifying the QoS of the PCC rule. + RedirectAddressType: + anyOf: + - type: string + enum: + - IPV4_ADDR + - IPV6_ADDR + - URL + - SIP_URI + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - IPV4_ADDR: Indicates that the address type is in the form of "dotted-decimal" IPv4 address. + - IPV6_ADDR: Indicates that the address type is in the form of IPv6 address. + - URL: Indicates that the address type is in the form of Uniform Resource Locator. + - SIP_URI: Indicates that the address type is in the form of SIP Uniform Resource Identifier. + QosFlowUsage: + anyOf: + - type: string + enum: + - GENERAL + - IMS_SIG + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - GENERAL: Indicate no specific QoS flow usage information is available. + - IMS_SIG: Indicate that the QoS flow is used for IMS signalling only. + FailureCause: + anyOf: + - type: string + enum: + - PCC_RULE_EVENT + - PCC_QOS_FLOW_EVENT + - RULE_PERMANENT_ERROR + - RULE_TEMPORARY_ERROR + - type: string + CreditManagementStatus: + anyOf: + - type: string + enum: + - END_USER_SER_DENIED + - CREDIT_CTRL_NOT_APP + - AUTH_REJECTED + - USER_UNKNOWN + - RATING_FAILED + - type: string + SessionRuleFailureCode: + anyOf: + - type: string + enum: + - NF_MAL + - RES_LIM + - UNSUCC_QOS_VAL + - UE_STA_SUSP + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - NF_MAL: Indicate that the PCC rule could not be successfully installed (for those provisioned from the PCF) or activated (for those pre-defined in SMF) or enforced (for those already successfully installed) due to SMF/UPF malfunction. + - RES_LIM: Indicate that the PCC rule could not be successfully installed (for those provisioned from PCF) or activated (for those pre-defined in SMF) or enforced (for those already successfully installed) due to a limitation of resources at the SMF/UPF. + - UNSUCC_QOS_VAL: indicate that the QoS validation has failed. + - UE_STA_SUSP: Indicates that the UE is in suspend state. + SteeringFunctionality: + anyOf: + - type: string + enum: + - MPTCP + - ATSSS_LL + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - MPTCP: Indicates that PCF authorizes the MPTCP functionality to support traffic steering, switching and splitting. + - ATSSS_LL: Indicates that PCF authorizes the ATSSS-LL functionality to support traffic steering, switching and splitting. + SteerModeValue: + anyOf: + - type: string + enum: + - ACTIVE_STANDBY + - LOAD_BALANCING + - SMALLEST_DELAY + - PRIORITY_BASED + - type: string + MulticastAccessControl: + anyOf: + - type: string + enum: + - ALLOWED + - NOT_ALLOWED + - type: string + RequestedQosMonitoringParameter: + anyOf: + - type: string + enum: + - DOWNLINK + - UPLINK + - ROUND_TRIP + - type: string + ReportingFrequency: + anyOf: + - type: string + enum: + - EVENT_TRIGGERED + - PERIODIC + - SESSION_RELEASE + - type: string + SmPolicyAssociationReleaseCause: + anyOf: + - type: string + enum: + - UNSPECIFIED + - UE_SUBSCRIPTION + - INSUFFICIENT_RES + - VALIDATION_CONDITION_NOT_MET + - type: string + PduSessionRelCause: + anyOf: + - type: string + enum: + - PS_TO_CS_HO + - type: string + MaPduIndication: + anyOf: + - type: string + enum: + - MA_PDU_REQUEST + - MA_PDU_ NETWORK_UPGRADE ALLOWED + - type: string + AtsssCapability: + anyOf: + - type: string + enum: + - MPTCP_ATSSS_LL_WITH_ASMODE_UL + - MPTCP_ATSSS_LL_WITH_ASMODE_DLUL + - ATSSS_LL + - MPTCP_ATSSS_LL + - type: string +# diff --git a/lib/sbi/support/3gpp-spec/TS29514_Npcf_PolicyAuthorization.yaml b/lib/sbi/support/modified/TS29514_Npcf_PolicyAuthorization.yaml similarity index 99% rename from lib/sbi/support/3gpp-spec/TS29514_Npcf_PolicyAuthorization.yaml rename to lib/sbi/support/modified/TS29514_Npcf_PolicyAuthorization.yaml index d89961ab56..bf4bdbb4be 100644 --- a/lib/sbi/support/3gpp-spec/TS29514_Npcf_PolicyAuthorization.yaml +++ b/lib/sbi/support/modified/TS29514_Npcf_PolicyAuthorization.yaml @@ -4,7 +4,7 @@ info: version: 1.1.0.alpha-5 description: | PCF Policy Authorization Service. - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. externalDocs: diff --git a/lib/sbi/support/3gpp-spec/TS29517_Naf_EventExposure.yaml b/lib/sbi/support/modified/TS29517_Naf_EventExposure.yaml similarity index 99% rename from lib/sbi/support/3gpp-spec/TS29517_Naf_EventExposure.yaml rename to lib/sbi/support/modified/TS29517_Naf_EventExposure.yaml index 8152c7c079..44d99607bd 100644 --- a/lib/sbi/support/3gpp-spec/TS29517_Naf_EventExposure.yaml +++ b/lib/sbi/support/modified/TS29517_Naf_EventExposure.yaml @@ -4,7 +4,7 @@ info: title: Naf_EventExposure description: | AF Event Exposure Service. - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. externalDocs: diff --git a/lib/sbi/support/modified/TS29518_Namf_Communication.yaml b/lib/sbi/support/modified/TS29518_Namf_Communication.yaml index a6225f6786..e68bc8e81a 100644 --- a/lib/sbi/support/modified/TS29518_Namf_Communication.yaml +++ b/lib/sbi/support/modified/TS29518_Namf_Communication.yaml @@ -1,2439 +1,2622 @@ -openapi: 3.0.0 -info: - version: 1.1.0.alpha-1 - title: Namf_Communication - description: | - AMF Communication Service - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. -security: - - {} - - oAuth2ClientCredentials: - - namf-comm -externalDocs: - description: 3GPP TS 29.518 V15.3.0; 5G System; Access and Mobility Management Services - url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.518/' -servers: - - url: '{apiRoot}/namf-comm/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in subclause subclause 4.4 of 3GPP TS 29.501 -paths: - /ue-contexts/{ueContextId}: - put: - summary: Namf_Communication CreateUEContext service Operation - tags: - - Individual ueContext (Document) - operationId: CreateUEContext - parameters: - - name: ueContextId - in: path - description: UE Context Identifier - required: true - schema: - type: string - pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' - requestBody: - content: - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/UeContextCreateData' - binaryDataN2Information: - type: string - format: binary - binaryDataN2InformationExt1: - type: string - format: binary - binaryDataN2InformationExt2: - type: string - format: binary - binaryDataN2InformationExt3: - type: string - format: binary - binaryDataN2InformationExt4: - type: string - format: binary - binaryDataN2InformationExt5: - type: string - format: binary - binaryDataN2InformationExt6: - type: string - format: binary - binaryDataN2InformationExt7: - type: string - format: binary - binaryDataN2InformationExt8: - type: string - format: binary - binaryDataN2InformationExt9: - type: string - format: binary - binaryDataN2InformationExt10: - type: string - format: binary - binaryDataN2InformationExt11: - type: string - format: binary - binaryDataN2InformationExt12: - type: string - format: binary - binaryDataN2InformationExt13: - type: string - format: binary - binaryDataN2InformationExt14: - type: string - format: binary - binaryDataN2InformationExt15: - type: string - format: binary - binaryDataN2InformationExt16: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN2Information: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt1: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt2: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt3: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt4: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt5: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt6: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt7: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt8: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt9: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt10: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt11: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt12: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt13: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt14: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt15: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt16: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - required: true - callbacks: - onN2MessageNotify: - '{$request.body#/n2NotifyUri}': - post: - summary: Namf_Communication N2 Info Notify (UE Specific) service Operation - tags: - - N2 Info Notify - operationId: N2InfoNotify - requestBody: - description: UE Specific N2 Information Notification - content: - application/json: - schema: - $ref: '#/components/schemas/N2InformationNotification' - responses: - '200': - description: N2 Information Notification Response. - content: - application/json: - schema: - $ref: '#/components/schemas/N2InfoNotificationRspData' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/N2InfoNotificationRspData' - binaryDataN2Information: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN2Information: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - '204': - description: Expected response to a successful callback processing - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - responses: - '201': - description: UE context successfully created. - headers: - Location: - description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-comm//ue-contexts/{ueContextId}' - required: true - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/UeContextCreatedData' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/UeContextCreatedData' - binaryDataN2Information: - type: string - format: binary - binaryDataN2InformationExt1: - type: string - format: binary - binaryDataN2InformationExt2: - type: string - format: binary - binaryDataN2InformationExt3: - type: string - format: binary - binaryDataN2InformationExt4: - type: string - format: binary - binaryDataN2InformationExt5: - type: string - format: binary - binaryDataN2InformationExt6: - type: string - format: binary - binaryDataN2InformationExt7: - type: string - format: binary - binaryDataN2InformationExt8: - type: string - format: binary - binaryDataN2InformationExt9: - type: string - format: binary - binaryDataN2InformationExt10: - type: string - format: binary - binaryDataN2InformationExt11: - type: string - format: binary - binaryDataN2InformationExt12: - type: string - format: binary - binaryDataN2InformationExt13: - type: string - format: binary - binaryDataN2InformationExt14: - type: string - format: binary - binaryDataN2InformationExt15: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN2Information: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt1: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt2: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt3: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt4: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt5: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt6: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt7: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt8: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt9: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt10: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt11: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt12: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt13: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt14: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt15: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/UeContextCreateError' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/UeContextCreateError' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - description: Internal Server Error - content: - application/json: - schema: - $ref: '#/components/schemas/UeContextCreateError' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - description: Unexpected error - /ue-contexts/{ueContextId}/release: - post: - summary: Namf_Communication ReleaseUEContext service Operation - tags: - - Individual ueContext (Document) - operationId: ReleaseUEContext - parameters: - - name: ueContextId - in: path - description: UE Context Identifier - required: true - schema: - type: string - pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UEContextRelease' - required: true - responses: - '204': - description: UE Context successfully released - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - description: Unexpected error - /ue-contexts/{ueContextId}/assign-ebi: - post: - summary: Namf_Communication EBI Assignment service Operation - tags: - - Individual ueContext (Document) - operationId: EBIAssignment - parameters: - - name: ueContextId - in: path - description: UE Context Identifier - required: true - schema: - type: string - pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/AssignEbiData' - required: true - responses: - '200': - description: EBI Assignment successfully performed. - content: - application/json: - schema: - $ref: '#/components/schemas/AssignedEbiData' - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/AssignEbiError' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/AssignEbiError' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - description: Internal Server Error - content: - application/json: - schema: - $ref: '#/components/schemas/AssignEbiError' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - description: Unexpected error - /ue-contexts/{ueContextId}/transfer: - post: - summary: Namf_Communication UEContextTransfer service Operation - tags: - - Individual ueContext (Document) - operationId: UEContextTransfer - parameters: - - name: ueContextId - in: path - description: UE Context Identifier - required: true - schema: - type: string - pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UeContextTransferReqData' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/UeContextTransferReqData' - binaryDataN1Message: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1Message: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - required: true - responses: - '200': - description: UE context transfer successfully initiated. - content: - application/json: - schema: - $ref: '#/components/schemas/UeContextTransferRspData' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/UeContextTransferRspData' - binaryDataN2Information: - type: string - format: binary - binaryDataN2InformationExt1: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN2Information: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt1: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - description: Unexpected error - /ue-contexts/{ueContextId}/transfer-update: - post: - summary: Namf_Communication RegistrationStatusUpdate service Operation - tags: - - Individual ueContext (Document) - operationId: RegistrationStatusUpdate - parameters: - - name: ueContextId - in: path - description: UE Context Identifier - required: true - schema: - type: string - pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UeRegStatusUpdateReqData' - required: true - responses: - '200': - description: UE context transfer status successfully updated. - content: - application/json: - schema: - $ref: '#/components/schemas/UeRegStatusUpdateRspData' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - /ue-contexts/{ueContextId}/n1-n2-messages: - post: - summary: Namf_Communication N1N2 Message Transfer (UE Specific) service Operation - tags: - - n1N2Message collection (Document) - operationId: N1N2MessageTransfer - parameters: - - name: ueContextId - in: path - description: UE Context Identifier - required: true - schema: - type: string - pattern: '^(imsi-[0-9]{5,15}|nai-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|cid-.{1,255}|.+)$' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/N1N2MessageTransferReqData' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/N1N2MessageTransferReqData' - binaryDataN1Message: - type: string - format: binary - binaryDataN2Information: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1Message: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - binaryDataN2Information: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - required: true - responses: - '202': - description: N1N2 Message Transfer accepted. - content: - application/json: - schema: - $ref: '#/components/schemas/N1N2MessageTransferRspData' - '200': - description: N1N2 Message Transfer successfully initiated. - content: - application/json: - schema: - $ref: '#/components/schemas/N1N2MessageTransferRspData' - '307': - description: Temporary Redirect - content: - application/problem+json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - headers: - Location: - description: 'The URI of the resource located on the target NF Service Consumer (e.g. AMF) to which the request is redirected' - required: true - schema: - type: string - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '409': - description: Conflicts - content: - application/json: - schema: - $ref: '#/components/schemas/N1N2MessageTransferError' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - '504': - description: Gateway Timeout - content: - application/json: - schema: - $ref: '#/components/schemas/N1N2MessageTransferError' - default: - description: Unexpected error - callbacks: - onN1N2TransferFailure: - '{$request.body#/n1n2FailureTxfNotifURI}': - post: - summary: Namf_Communication N1N2Transfer Failure Notification service Operation - tags: - - N1N2 Transfer Failure Notification - operationId: N1N2TransferFailureNotification - requestBody: - description: N1N2Transfer Failure Notification - content: - application/json: - schema: - $ref: '#/components/schemas/N1N2MsgTxfrFailureNotification' - responses: - '204': - description: Expected response to a successful callback processing - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - /ue-contexts/{ueContextId}/n1-n2-messages/subscriptions: - post: - summary: Namf_Communication N1N2 Message Subscribe (UE Specific) service Operation - tags: - - N1N2 Subscriptions Collection for Individual UE Contexts (Document) - operationId: N1N2MessageSubscribe - parameters: - - name: ueContextId - in: path - description: UE Context Identifier - required: true - schema: - type: string - pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UeN1N2InfoSubscriptionCreateData' - required: true - responses: - '201': - description: N1N2 Message Subscription successfully created. - headers: - Location: - description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-comm//{ueContextId}/n1-n2-messages/subscriptions/{subscriptionId}' - required: true - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/UeN1N2InfoSubscriptionCreatedData' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - description: Unexpected error - callbacks: - onN1N2MessageNotify: - '{$request.body#/n1NotifyCallbackUri}': - post: - summary: Namf_Communication N1 Message Notify service Operation - tags: - - N1 Message Notify - operationId: N1MessageNotify - requestBody: - description: N1 Message Notification - content: - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/N1MessageNotification' - binaryDataN1Message: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1Message: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - responses: - '204': - description: Expected response to a successful callback processing - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - '{$request.body#/n2NotifyCallbackUri}': - post: - summary: Namf_Communication N2 Info Notify (UE Specific) service Operation - tags: - - N2 Info Notify - operationId: N2InfoNotify - requestBody: - description: UE Specific N2 Informaiton Notification - content: - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/N2InformationNotification' - binaryDataN1Message: - type: string - format: binary - binaryDataN2Information: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1Message: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - binaryDataN2Information: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - responses: - '204': - description: Expected response to a successful callback processing - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - /ue-contexts/{ueContextId}/n1-n2-messages/subscriptions/{subscriptionId}: - delete: - summary: Namf_Communication N1N2 Message UnSubscribe (UE Specific) service Operation - tags: - - N1N2 Individual Subscription (Document) - operationId: N1N2MessageUnSubscribe - parameters: - - name: ueContextId - in: path - description: UE Context Identifier - required: true - schema: - type: string - pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' - - name: subscriptionId - in: path - description: Subscription Identifier - required: true - schema: - type: string - responses: - '204': - description: N1N2 Message Subscription successfully removed. - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - /non-ue-n2-messages/transfer: - post: - summary: Namf_Communication Non UE N2 Message Transfer service Operation - tags: - - Non UE N2Messages collection (Document) - operationId: NonUeN2MessageTransfer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/N2InformationTransferReqData' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/N2InformationTransferReqData' - binaryDataN2Information: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN2Information: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - required: true - responses: - '200': - description: Non UE N2 Message Transfer successfully initiated. - content: - application/json: - schema: - $ref: '#/components/schemas/N2InformationTransferRspData' - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/N2InformationTransferError' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/N2InformationTransferError' - '404': - description: Not Found - content: - application/json: - schema: - $ref: '#/components/schemas/N2InformationTransferError' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - description: Internal Server Error - content: - application/json: - schema: - $ref: '#/components/schemas/N2InformationTransferError' - '503': - description: Service Unavailable - content: - application/json: - schema: - $ref: '#/components/schemas/N2InformationTransferError' - default: - description: Unexpected error - /non-ue-n2-messages/subscriptions: - post: - summary: Namf_Communication Non UE N2 Info Subscribe service Operation - tags: - - Non UE N2Messages Subscriptions collection (Document) - operationId: NonUeN2InfoSubscribe - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/NonUeN2InfoSubscriptionCreateData' - required: true - responses: - '201': - description: Non UE N2 Info Subscription successfully created. - headers: - Location: - description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-comm//non-ue-n2-messages/subscriptions/{n2NotifySubscriptionId}' - required: true - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/NonUeN2InfoSubscriptionCreatedData' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - description: Unexpected error - callbacks: - onN2InfoNotify: - '{$request.body#/n2NotifyCallbackUri}': - post: - summary: Namf_Communication Non UE N2 Info Notify service Operation - tags: - - Non UE N2 Info Notify - operationId: NonUeN2InfoNotify - requestBody: - description: Non UE N2 Informaiton Notification - content: - application/json: - schema: - $ref: '#/components/schemas/N2InformationNotification' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/N2InformationNotification' - binaryDataN2Information: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN2Information: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - responses: - '204': - description: Expected response to a successful callback processing - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - /non-ue-n2-messages/subscriptions/{n2NotifySubscriptionId}: - delete: - summary: Namf_Communication Non UE N2 Info UnSubscribe service Operation - tags: - - Non UE N2 Message Notification Individual Subscription (Document) - operationId: NonUeN2InfoUnSubscribe - parameters: - - name: n2NotifySubscriptionId - in: path - description: N2 info Subscription Identifier - required: true - schema: - type: string - responses: - '204': - description: Non UE N2 INfo Subscription successfully removed. - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - /subscriptions: - post: - summary: Namf_Communication AMF Status Change Subscribe service Operation - tags: - - subscriptions collection (Document) - operationId: AMFStatusChangeSubscribe - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SubscriptionData' - required: true - responses: - '201': - description: N1N2 Message Subscription successfully created. - headers: - Location: - description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-comm//subscriptions/{subscriptionId}' - required: true - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/SubscriptionData' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - description: Unexpected error - callbacks: - onAmfStatusChange: - '{$request.body#/amfStatusUri}': - post: - summary: Amf Status Change Notify service Operation - tags: - - Amf Status Change Notify - operationId: AmfStatusChangeNotify - requestBody: - description: Amf Status Change Notification - content: - application/json: - schema: - $ref: '#/components/schemas/AmfStatusChangeNotification' - responses: - '204': - description: Expected response to a successful callback processing - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - /subscriptions/{subscriptionId}: - delete: - summary: Namf_Communication AMF Status Change UnSubscribe service Operation - tags: - - individual subscription (Document) - operationId: AMFStatusChangeUnSubscribe - parameters: - - name: subscriptionId - in: path - description: AMF Status Change Subscription Identifier - required: true - schema: - type: string - responses: - '204': - description: N1N2 Message Subscription successfully removed. - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - description: Unexpected error - put: - summary: Namf_Communication AMF Status Change Subscribe Modify service Operation - tags: - - individual subscription (Document) - operationId: AMFStatusChangeSubscribeModfy - parameters: - - name: subscriptionId - in: path - description: AMF Status Change Subscription Identifier - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SubscriptionData' - required: true - responses: - '202': - description: N1N2 Message Subscription successfully updated. - content: - application/json: - schema: - $ref: '#/components/schemas/SubscriptionData' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - description: Unexpected error - callbacks: - OnAmfStatusChange: - '{$request.body#/amfStatusUri}': - post: - summary: Amf Status Change Notify service Operation - tags: - - Amf Status Change Notify - operationId: AmfStatusChangeNOtify - requestBody: - description: Amf Status Change Notification - content: - application/json: - schema: - $ref: '#/components/schemas/AmfStatusChangeNotification' - responses: - '204': - description: Expected response to a successful callback processing - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' -components: - securitySchemes: - oAuth2ClientCredentials: - type: oauth2 - flows: - clientCredentials: - tokenUrl: '{nrfApiRoot}/oauth2/token' - scopes: - namf-comm: Access to the Namf_Communication API - schemas: -# -# STRUCTURED DATA TYPES -# - SubscriptionData: - type: object - properties: - amfStatusUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - guamiList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' - minItems: 1 - required: - - amfStatusUri - AmfStatusChangeNotification: - type: object - properties: - amfStatusInfoList: - type: array - items: - $ref: '#/components/schemas/AmfStatusInfo' - minItems: 1 - required: - - amfStatusInfoList - AmfStatusInfo: - type: object - properties: - guamiList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' - minItems: 1 - statusChange: - $ref: '#/components/schemas/StatusChange' - targetAmfRemoval: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfName' - targetAmfFailure: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfName' - required: - - guamiList - - statusChange - AssignEbiData: - type: object - properties: - pduSessionId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' - arpList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' - minItems: 1 - releasedEbiList: - type: array - items: - $ref: '#/components/schemas/EpsBearerId' - minItems: 1 - required: - - pduSessionId - AssignedEbiData: - type: object - properties: - pduSessionId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' - assignedEbiList: - type: array - items: - $ref: 'TS29502_Nsmf_PDUSession.yaml#/components/schemas/EbiArpMapping' - minItems: 0 - failedArpList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' - minItems: 1 - releasedEbiList: - type: array - items: - $ref: '#/components/schemas/EpsBearerId' - minItems: 1 - required: - - pduSessionId - - assignedEbiList - AssignEbiFailed: - type: object - properties: - pduSessionId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' - failedArpList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' - minItems: 1 - required: - - pduSessionId - UEContextRelease: - type: object - properties: - supi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - unauthenticatedSupi: - type: boolean - default: false - ngapCause: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' - required: - - ngapCause - N2InformationTransferReqData: - type: object - properties: - taiList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' - minItems: 1 - ratSelector: - $ref: '#/components/schemas/RatSelector' - ecgiList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' - minItems: 1 - ncgiList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' - minItems: 1 - globalRanNodeList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' - minItems: 1 - n2Information: - $ref: '#/components/schemas/N2InfoContainer' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - n2Information - NonUeN2InfoSubscriptionCreateData: - type: object - properties: - globalRanNodeList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' - minItems: 1 - anTypeList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - minItems: 1 - n2InformationClass: - $ref: '#/components/schemas/N2InformationClass' - n2NotifyCallbackUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - nfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - n2InformationClass - - n2NotifyCallbackUri - NonUeN2InfoSubscriptionCreatedData: - type: object - properties: - n2NotifySubscriptionId: - type: string - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - n2NotifySubscriptionId - UeN1N2InfoSubscriptionCreateData: - type: object - properties: - n2InformationClass: - $ref: '#/components/schemas/N2InformationClass' - n2NotifyCallbackUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - n1MessageClass: - $ref: '#/components/schemas/N1MessageClass' - n1NotifyCallbackUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - nfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - UeN1N2InfoSubscriptionCreatedData: - type: object - properties: - n1n2NotifySubscriptionId: - type: string - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - n1n2NotifySubscriptionId - N2InformationNotification: - type: object - properties: - n2NotifySubscriptionId: - type: string - n2InfoContainer: - $ref: '#/components/schemas/N2InfoContainer' - toReleaseSessionList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' - minItems: 1 - lcsCorrelationId: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CorrelationID' - notifyReason: - $ref: '#/components/schemas/N2InfoNotifyReason' - smfChangeInd: - $ref: '#/components/schemas/SmfChangeIndication' - required: - - n2NotifySubscriptionId - N2InfoContainer: - type: object - properties: - n2InformationClass: - $ref: '#/components/schemas/N2InformationClass' - smInfo: - $ref: '#/components/schemas/N2SmInformation' - ranInfo: - $ref: '#/components/schemas/N2RanInformation' - nrppaInfo: - $ref: '#/components/schemas/NrppaInformation' - pwsInfo: - $ref: '#/components/schemas/PwsInformation' - required: - - n2InformationClass - N1MessageNotification: - type: object - properties: - n1NotifySubscriptionId: - type: string - n1MessageContainer: - $ref: '#/components/schemas/N1MessageContainer' - lcsCorrelationId: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CorrelationID' - registrationCtxtContainer: - $ref: '#/components/schemas/RegistrationContextContainer' - required: - - n1MessageContainer - N1MessageContainer: - type: object - properties: - n1MessageClass: - $ref: '#/components/schemas/N1MessageClass' - n1MessageContent: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' - nfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - serviceInstanceId: - type: string - required: - - n1MessageClass - - n1MessageContent - N1N2MessageTransferReqData: - type: object - properties: - n1MessageContainer: - $ref: '#/components/schemas/N1MessageContainer' - n2InfoContainer: - $ref: '#/components/schemas/N2InfoContainer' - skipInd: - type: boolean - default: false - lastMsgIndication: - type: boolean - pduSessionId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' - lcsCorrelationId: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CorrelationID' - ppi: - $ref: '#/components/schemas/Ppi' - arp: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' - 5qi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/5Qi' - n1n2FailureTxfNotifURI: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - smfReallocationInd: - type: boolean - default: false - areaOfValidity: - $ref: '#/components/schemas/AreaOfValidity' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - N1N2MessageTransferRspData: - type: object - properties: - cause: - $ref: '#/components/schemas/N1N2MessageTransferCause' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - cause - RegistrationContextContainer: - type: object - properties: - ueContext: - $ref: '#/components/schemas/UeContext' - localTimeZone: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' - anType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - anN2ApId: - type: integer - ranNodeId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' - initialAmfName: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfName' - userLocation: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - rrcEstCause: - type: string - pattern: '^[0-9a-fA-F]+$' - ueContextRequest: - type: boolean - default: false - anN2IPv4Addr: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' - anN2IPv6Addr: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' - allowedNssai: - $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/AllowedNssai' - configuredNssai: - type: array - items: - $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/ConfiguredSnssai' - minItems: 1 - rejectedNssaiInPlmn: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - minItems: 1 - rejectedNssaiInTa: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - minItems: 1 - required: - - ueContext - - anType - - anN2ApId - - ranNodeId - - initialAmfName - - userLocation - AreaOfValidity: - type: object - properties: - taiList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' - minItems: 0 - required: - - taiList - UeContextTransferReqData: - type: object - properties: - reason: - $ref: '#/components/schemas/TransferReason' - accessType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - plmnId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' - regRequest: - $ref: '#/components/schemas/N1MessageContainer' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - reason - - accessType - UeContextTransferRspData: - type: object - properties: - ueContext: - $ref: '#/components/schemas/UeContext' - ueRadioCapability: - $ref: '#/components/schemas/N2InfoContent' - ueNbiotRadioCapability: - $ref: '#/components/schemas/N2InfoContent' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - ueContext - UeContext: - type: object - properties: - supi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - supiUnauthInd: - type: boolean - gpsiList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' - minItems: 1 - pei: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' - udmGroupId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' - ausfGroupId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' - routingIndicator: - type: string - groupList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' - minItems: 1 - drxParameter: - $ref: '#/components/schemas/DrxParameter' - subRfsp: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndex' - usedRfsp: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndex' - subUeAmbr: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' - smsSupport: - $ref: '#/components/schemas/SmsSupport' - smsfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - seafData: - $ref: '#/components/schemas/SeafData' - 5gMmCapability: - $ref: '#/components/schemas/5GMmCapability' - pcfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - pcfAmPolicyUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - amPolicyReqTriggerList: - type: array - items: - $ref: '#/components/schemas/PolicyReqTrigger' - minItems: 1 - pcfUePolicyUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - uePolicyReqTriggerList: - type: array - items: - $ref: '#/components/schemas/PolicyReqTrigger' - minItems: 1 - hpcfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - restrictedRatList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' - minItems: 1 - forbiddenAreaList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Area' - minItems: 1 - serviceAreaRestriction: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' - restrictedCoreNwTypeList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/CoreNetworkType' - minItems: 1 - eventSubscriptionList: - type: array - items: - $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/AmfEventSubscription' - minItems: 1 - mmContextList: - type: array - items: - $ref: '#/components/schemas/MmContext' - minItems: 1 - maxItems: 2 - sessionContextList: - type: array - items: - $ref: '#/components/schemas/PduSessionContext' - minItems: 1 - traceData: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' - remainingServiceGapTimer: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' - N2SmInformation: - type: object - properties: - pduSessionId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' - n2InfoContent: - $ref: '#/components/schemas/N2InfoContent' - sNssai: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - homePlmnSnssai: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - subjectToHo: - type: boolean - required: - - pduSessionId - N2InfoContent: - type: object - properties: - ngapMessageType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' - ngapIeType: - $ref: '#/components/schemas/NgapIeType' - ngapData: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' - required: - - ngapData - NrppaInformation: - type: object - properties: - nfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - nrppaPdu: - $ref: '#/components/schemas/N2InfoContent' - serviceInstanceId: - type: string - required: - - nfId - - nrppaPdu - PwsInformation: - type: object - properties: - messageIdentifier: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint16' - serialNumber: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint16' - pwsContainer: - $ref: '#/components/schemas/N2InfoContent' - sendRanResponse: - type: boolean - default: false - omcId: - $ref: '#/components/schemas/OmcIdentifier' - required: - - messageIdentifier - - serialNumber - - pwsContainer - N1N2MsgTxfrFailureNotification: - type: object - properties: - cause: - $ref: '#/components/schemas/N1N2MessageTransferCause' - n1n2MsgDataUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - required: - - cause - - n1n2MsgDataUri - N1N2MessageTransferError: - type: object - properties: - error: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - errInfo: - $ref: '#/components/schemas/N1N2MsgTxfrErrDetail' - required: - - error - N1N2MsgTxfrErrDetail: - type: object - properties: - retryAfter: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' - highestPrioArp: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' - N2InformationTransferRspData: - type: object - properties: - result: - $ref: '#/components/schemas/N2InformationTransferResult' - pwsRspData: - $ref: '#/components/schemas/PWSResponseData' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - result - MmContext: - type: object - properties: - accessType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - nasSecurityMode: - $ref: '#/components/schemas/NasSecurityMode' - nasDownlinkCount: - $ref: '#/components/schemas/NasCount' - nasUplinkCount: - $ref: '#/components/schemas/NasCount' - ueSecurityCapability: - $ref: '#/components/schemas/UeSecurityCapability' - s1UeNetworkCapability: - $ref: '#/components/schemas/S1UeNetworkCapability' - allowedNssai: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - minItems: 1 - nssaiMappingList: - type: array - items: - $ref: '#/components/schemas/NssaiMapping' - minItems: 1 - nsInstanceList: - type: array - items: - $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/NsiId' - minItems: 1 - expectedUEbehavior: - $ref: '#/components/schemas/ExpectedUeBehavior' - required: - - accessType - SeafData: - type: object - properties: - ngKsi: - $ref: '#/components/schemas/NgKsi' - keyAmf: - $ref: '#/components/schemas/KeyAmf' - nh: - type: string - pattern: '^[A-Fa-f0-9]+$' - ncc: - type: integer - minimum: 0 - maximum: 7 - keyAmfChangeInd: - type: boolean - keyAmfHDerivationInd: - type: boolean - required: - - ngKsi - - keyAmf - NasSecurityMode: - type: object - properties: - integrityAlgorithm: - $ref: '#/components/schemas/IntegrityAlgorithm' - cipheringAlgorithm: - $ref: '#/components/schemas/CipheringAlgorithm' - required: - - integrityAlgorithm - - cipheringAlgorithm - PduSessionContext: - type: object - properties: - pduSessionId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' - smContextRef: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - sNssai: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - dnn: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' - accessType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - allocatedEbiList: - type: array - items: - $ref: 'TS29502_Nsmf_PDUSession.yaml#/components/schemas/EbiArpMapping' - minItems: 1 - hsmfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - vsmfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - nsInstance: - $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/NsiId' - smfServiceInstanceId: - type: string - required: - - pduSessionId - - smContextRef - - sNssai - - dnn - - accessType - NssaiMapping: - type: object - properties: - mappedSnssai: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - hSnssai: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - required: - - mappedSnssai - - hSnssai - UeRegStatusUpdateReqData: - type: object - properties: - transferStatus: - $ref: '#/components/schemas/UeContextTransferStatus' - toReleaseSessionList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' - minItems: 1 - pcfReselectedInd: - type: boolean - required: - - transferStatus - UeRegStatusUpdateRspData: - type: object - properties: - regStatusTransferComplete: - type: boolean - required: - - regStatusTransferComplete - AssignEbiError: - type: object - properties: - error: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - failureDetails: - $ref: '#/components/schemas/AssignEbiFailed' - required: - - error - - failureDetails - UeContextCreateData: - type: object - properties: - ueContext: - $ref: '#/components/schemas/UeContext' - targetId: - $ref: '#/components/schemas/NgRanTargetId' - sourceToTargetData: - $ref: '#/components/schemas/N2InfoContent' - pduSessionList: - type: array - items: - $ref: '#/components/schemas/N2SmInformation' - minItems: 1 - mmeControlFteid: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' - n2NotifyUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - ueRadioCapability: - $ref: '#/components/schemas/N2InfoContent' - ngapCause: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - ueContext - - targetId - - sourceToTargetData - - pduSessionList - UeContextCreatedData: - type: object - properties: - ueContext: - $ref: '#/components/schemas/UeContext' - targetToSourceData: - $ref: '#/components/schemas/N2InfoContent' - pduSessionList: - type: array - items: - $ref: '#/components/schemas/N2SmInformation' - minItems: 1 - failedSessionList: - type: array - items: - $ref: '#/components/schemas/N2SmInformation' - minItems: 1 - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - pcfReselectedInd: - type: boolean - required: - - ueContext - - targetToSourceData - - pduSessionList - UeContextCreateError: - type: object - properties: - error: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - ngapCause: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' - required: - - error - NgRanTargetId: - type: object - properties: - ranNodeId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' - tai: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' - required: - - ranNodeId - - tai - PWSResponseData: - type: object - properties: - ngapMessageType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' - serialNumber: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint16' - messageIdentifier: - type: integer - unknownTaiList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' - minItems: 1 - required: - - ngapMessageType - - serialNumber - - messageIdentifier - PWSErrorData: - type: object - properties: - namfCause: - type: integer - required: - - namfCause - N2InformationTransferError: - type: object - properties: - error: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - pwdErrorInfo: - $ref: '#/components/schemas/PWSErrorData' - required: - - error - NgKsi: - type: object - properties: - tsc: - $ref: '#/components/schemas/ScType' - ksi: - type: integer - minimum: 0 - maximum: 6 - required: - - tsc - - ksi - KeyAmf: - type: object - properties: - keyType: - $ref: '#/components/schemas/KeyAmfType' - keyVal: - type: string - required: - - keyType - - keyVal - ExpectedUeBehavior: - type: object - properties: - expMoveTrajectory: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - minItems: 1 - validityTime: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - required: - - expMoveTrajectory - - validityTime - N2RanInformation: - type: object - properties: - n2InfoContent: - $ref: '#/components/schemas/N2InfoContent' - required: - - n2InfoContent - N2InfoNotificationRspData: - type: object - properties: - n2InfoContent: - $ref: '#/components/schemas/N2InfoContent' -# -# SIMPLE DATA TYPES -# - EpsBearerId: - type: integer - minimum: 0 - maximum: 15 - Ppi: - type: integer - minimum: 0 - maximum: 7 - NasCount: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' - 5GMmCapability: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' - UeSecurityCapability: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' - S1UeNetworkCapability: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' - DrxParameter: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' - OmcIdentifier: - type: string - -# -# ENUMERATIONS -# - StatusChange: - anyOf: - - type: string - enum: - - AMF_UNAVAILABLE - - AMF_AVAILABLE - - type: string - N2InformationClass: - anyOf: - - type: string - enum: - - SM - - NRPPa - - PWS - - PWS-BCAL - - PWS-RF - - RAN - - type: string - N1MessageClass: -# anyOf: -# - type: string - enum: - - 5GMM - - SM - - LPP - - SMS - - UPDP - type: string - N1N2MessageTransferCause: - anyOf: - - type: string - enum: - - ATTEMPTING_TO_REACH_UE - - N1_N2_TRANSFER_INITIATED - - WAITING_FOR_ASYNCHRONOUS_TRANSFER - - UE_NOT_RESPONDING - - N1_MSG_NOT_TRANSFERRED - - UE_NOT_REACHABLE_FOR_SESSION - - type: string - UeContextTransferStatus: - anyOf: - - type: string - enum: - - TRANSFERRED - - NOT_TRANSFERRED - - type: string - N2InformationTransferResult: - anyOf: - - type: string - enum: - - N2_INFO_TRANSFER_INITIATED - - type: string - CipheringAlgorithm: - anyOf: - - type: string - enum: - - NEA0 - - NEA1 - - NEA2 - - NEA3 - - type: string - IntegrityAlgorithm: - anyOf: - - type: string - enum: - - NIA0 - - NIA1 - - NIA2 - - NIA3 - - type: string - SmsSupport: - anyOf: - - type: string - enum: - - 3GPP - - NON_3GPP - - BOTH - - NONE - - type: string - ScType: - anyOf: - - type: string - enum: - - NATIVE - - MAPPED - - type: string - KeyAmfType: - anyOf: - - type: string - enum: - - KAMF - - KPRIMEAMF - - type: string - TransferReason: - anyOf: - - type: string - enum: - - INIT_REG - - MOBI_REG - - MOBI_REG_UE_VALIDATED - - type: string - PolicyReqTrigger: - anyOf: - - type: string - enum: - - LOCATION_CHANGE - - PRA_CHANGE - - SARI_CHANGE - - RFSP_INDEX_CHANGE - - ALLOWED_NSSAI_CHANGE - - type: string - RatSelector: - anyOf: - - type: string - enum: - - E-UTRA - - NR - - type: string - NgapIeType: - anyOf: - - type: string - enum: - - PDU_RES_SETUP_REQ - - PDU_RES_REL_CMD - - PDU_RES_MOD_REQ - - HANDOVER_CMD - - HANDOVER_REQUIRED - - HANDOVER_PREP_FAIL - - SRC_TO_TAR_CONTAINER - - TAR_TO_SRC_CONTAINER - - RAN_STATUS_TRANS_CONTAINER - - SON_CONFIG_TRANSFER - - NRPPA_PDU - - UE_RADIO_CAPABILITY - - type: string - N2InfoNotifyReason: - anyOf: - - type: string - enum: - - HANDOVER_COMPLETED - - type: string - SmfChangeIndication: - anyOf: - - type: string - enum: - - INSERTED - - CHANGED - - REMOVED - - type: string +openapi: 3.0.0 +info: + version: 1.1.0.alpha-4 + title: Namf_Communication + description: | + AMF Communication Service + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +security: + - {} + - oAuth2ClientCredentials: + - namf-comm +externalDocs: + description: 3GPP TS 29.518 V16.3.0; 5G System; Access and Mobility Management Services + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.518/' +servers: + - url: '{apiRoot}/namf-comm/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause clause 4.4 of 3GPP TS 29.501 +paths: + /ue-contexts/{ueContextId}: + put: + summary: Namf_Communication CreateUEContext service Operation + tags: + - Individual ueContext (Document) + operationId: CreateUEContext + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/UeContextCreateData' + binaryDataN2Information: + type: string + format: binary + binaryDataN2InformationExt1: + type: string + format: binary + binaryDataN2InformationExt2: + type: string + format: binary + binaryDataN2InformationExt3: + type: string + format: binary + binaryDataN2InformationExt4: + type: string + format: binary + binaryDataN2InformationExt5: + type: string + format: binary + binaryDataN2InformationExt6: + type: string + format: binary + binaryDataN2InformationExt7: + type: string + format: binary + binaryDataN2InformationExt8: + type: string + format: binary + binaryDataN2InformationExt9: + type: string + format: binary + binaryDataN2InformationExt10: + type: string + format: binary + binaryDataN2InformationExt11: + type: string + format: binary + binaryDataN2InformationExt12: + type: string + format: binary + binaryDataN2InformationExt13: + type: string + format: binary + binaryDataN2InformationExt14: + type: string + format: binary + binaryDataN2InformationExt15: + type: string + format: binary + binaryDataN2InformationExt16: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt1: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt2: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt3: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt4: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt5: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt6: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt7: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt8: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt9: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt10: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt11: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt12: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt13: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt14: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt15: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt16: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + required: true + callbacks: + onN2MessageNotify: + '{$request.body#/n2NotifyUri}': + post: + summary: Namf_Communication N2 Info Notify (UE Specific) service Operation + tags: + - N2 Info Notify + operationId: N2InfoNotify + requestBody: + description: UE Specific N2 Information Notification + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationNotification' + responses: + '200': + description: N2 Information Notification Response. + content: + application/json: + schema: + $ref: '#/components/schemas/N2InfoNotificationRspData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/N2InfoNotificationRspData' + binaryDataN2Information: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '204': + description: Expected response to a successful callback processing + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + responses: + '201': + description: UE context successfully created. + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-comm//ue-contexts/{ueContextId}' + required: true + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextCreatedData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/UeContextCreatedData' + binaryDataN2Information: + type: string + format: binary + binaryDataN2InformationExt1: + type: string + format: binary + binaryDataN2InformationExt2: + type: string + format: binary + binaryDataN2InformationExt3: + type: string + format: binary + binaryDataN2InformationExt4: + type: string + format: binary + binaryDataN2InformationExt5: + type: string + format: binary + binaryDataN2InformationExt6: + type: string + format: binary + binaryDataN2InformationExt7: + type: string + format: binary + binaryDataN2InformationExt8: + type: string + format: binary + binaryDataN2InformationExt9: + type: string + format: binary + binaryDataN2InformationExt10: + type: string + format: binary + binaryDataN2InformationExt11: + type: string + format: binary + binaryDataN2InformationExt12: + type: string + format: binary + binaryDataN2InformationExt13: + type: string + format: binary + binaryDataN2InformationExt14: + type: string + format: binary + binaryDataN2InformationExt15: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt1: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt2: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt3: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt4: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt5: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt6: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt7: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt8: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt9: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt10: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt11: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt12: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt13: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt14: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt15: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextCreateError' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextCreateError' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextCreateError' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /ue-contexts/{ueContextId}/release: + post: + summary: Namf_Communication ReleaseUEContext service Operation + tags: + - Individual ueContext (Document) + operationId: ReleaseUEContext + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UEContextRelease' + required: true + responses: + '204': + description: UE Context successfully released + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /ue-contexts/{ueContextId}/assign-ebi: + post: + summary: Namf_Communication EBI Assignment service Operation + tags: + - Individual ueContext (Document) + operationId: EBIAssignment + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AssignEbiData' + required: true + responses: + '200': + description: EBI Assignment successfully performed. + content: + application/json: + schema: + $ref: '#/components/schemas/AssignedEbiData' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/AssignEbiError' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/AssignEbiError' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/AssignEbiError' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/AssignEbiError' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /ue-contexts/{ueContextId}/transfer: + post: + summary: Namf_Communication UEContextTransfer service Operation + tags: + - Individual ueContext (Document) + operationId: UEContextTransfer + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextTransferReqData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/UeContextTransferReqData' + binaryDataN1Message: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1Message: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + required: true + responses: + '200': + description: UE context transfer successfully initiated. + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextTransferRspData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/UeContextTransferRspData' + binaryDataN2Information: + type: string + format: binary + binaryDataN2InformationExt1: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt1: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /ue-contexts/{ueContextId}/transfer-update: + post: + summary: Namf_Communication RegistrationStatusUpdate service Operation + tags: + - Individual ueContext (Document) + operationId: RegistrationStatusUpdate + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UeRegStatusUpdateReqData' + required: true + responses: + '200': + description: UE context transfer status successfully updated. + content: + application/json: + schema: + $ref: '#/components/schemas/UeRegStatusUpdateRspData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /ue-contexts/{ueContextId}/n1-n2-messages: + post: + summary: Namf_Communication N1N2 Message Transfer (UE Specific) service Operation + tags: + - n1N2Message collection (Document) + operationId: N1N2MessageTransfer + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|cid-.{1,255}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/N1N2MessageTransferReqData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/N1N2MessageTransferReqData' + binaryDataN1Message: + type: string + format: binary + binaryDataN2Information: + type: string + format: binary + binaryMtData: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1Message: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryMtData: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + required: true + responses: + '202': + description: N1N2 Message Transfer accepted. + content: + application/json: + schema: + $ref: '#/components/schemas/N1N2MessageTransferRspData' + headers: + Location: + description: 'The URI of the resource located on the AMF to which the status of the N1N2 message transfer is held' + required: true + schema: + type: string + '200': + description: N1N2 Message Transfer successfully initiated. + content: + application/json: + schema: + $ref: '#/components/schemas/N1N2MessageTransferRspData' + '307': + description: Temporary Redirect + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + headers: + Location: + description: 'The URI of the resource located on the target NF Service Consumer (e.g. AMF) to which the request is redirected' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '409': + description: Conflicts + content: + application/json: + schema: + $ref: '#/components/schemas/N1N2MessageTransferError' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + description: Gateway Timeout + content: + application/json: + schema: + $ref: '#/components/schemas/N1N2MessageTransferError' + default: + description: Unexpected error + callbacks: + onN1N2TransferFailure: + '{$request.body#/n1n2FailureTxfNotifURI}': + post: + summary: Namf_Communication N1N2Transfer Failure Notification service Operation + tags: + - N1N2 Transfer Failure Notification + operationId: N1N2TransferFailureNotification + requestBody: + description: N1N2Transfer Failure Notification + content: + application/json: + schema: + $ref: '#/components/schemas/N1N2MsgTxfrFailureNotification' + responses: + '204': + description: Expected response to a successful callback processing + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + /ue-contexts/{ueContextId}/n1-n2-messages/subscriptions: + post: + summary: Namf_Communication N1N2 Message Subscribe (UE Specific) service Operation + tags: + - N1N2 Subscriptions Collection for Individual UE Contexts (Document) + operationId: N1N2MessageSubscribe + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UeN1N2InfoSubscriptionCreateData' + required: true + responses: + '201': + description: N1N2 Message Subscription successfully created. + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-comm//{ueContextId}/ue-contexts/n1-n2-messages/subscriptions/{subscriptionId}' + required: true + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/UeN1N2InfoSubscriptionCreatedData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + onN1N2MessageNotify: + '{$request.body#/n1NotifyCallbackUri}': + post: + summary: Namf_Communication N1 Message Notify service Operation + tags: + - N1 Message Notify + operationId: N1MessageNotify + requestBody: + description: N1 Message Notification + content: + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/N1MessageNotification' + binaryDataN1Message: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1Message: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + responses: + '204': + description: Expected response to a successful callback processing + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '{$request.body#/n2NotifyCallbackUri}': + post: + summary: Namf_Communication N2 Info Notify (UE Specific) service Operation + tags: + - N2 Info Notify + operationId: N2InfoNotify + requestBody: + description: UE Specific N2 Information Notification + content: + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/N2InformationNotification' + binaryDataN1Message: + type: string + format: binary + binaryDataN2Information: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1Message: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + responses: + '204': + description: Expected response to a successful callback processing + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + /ue-contexts/{ueContextId}/n1-n2-messages/subscriptions/{subscriptionId}: + delete: + summary: Namf_Communication N1N2 Message UnSubscribe (UE Specific) service Operation + tags: + - N1N2 Individual Subscription (Document) + operationId: N1N2MessageUnSubscribe + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + - name: subscriptionId + in: path + description: Subscription Identifier + required: true + schema: + type: string + responses: + '204': + description: N1N2 Message Subscription successfully removed. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + /non-ue-n2-messages/transfer: + post: + summary: Namf_Communication Non UE N2 Message Transfer service Operation + tags: + - Non UE N2Messages collection (Document) + operationId: NonUeN2MessageTransfer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationTransferReqData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/N2InformationTransferReqData' + binaryDataN2Information: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + required: true + responses: + '200': + description: Non UE N2 Message Transfer successfully initiated. + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationTransferRspData' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationTransferError' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationTransferError' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationTransferError' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationTransferError' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationTransferError' + default: + description: Unexpected error + /non-ue-n2-messages/subscriptions: + post: + summary: Namf_Communication Non UE N2 Info Subscribe service Operation + tags: + - Non UE N2Messages Subscriptions collection (Document) + operationId: NonUeN2InfoSubscribe + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NonUeN2InfoSubscriptionCreateData' + required: true + responses: + '201': + description: Non UE N2 Info Subscription successfully created. + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-comm//non-ue-n2-messages/subscriptions/{n2NotifySubscriptionId}' + required: true + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/NonUeN2InfoSubscriptionCreatedData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + onN2InfoNotify: + '{$request.body#/n2NotifyCallbackUri}': + post: + summary: Namf_Communication Non UE N2 Info Notify service Operation + tags: + - Non UE N2 Info Notify + operationId: NonUeN2InfoNotify + requestBody: + description: Non UE N2 Information Notification + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationNotification' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/N2InformationNotification' + binaryDataN2Information: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + responses: + '204': + description: Expected response to a successful callback processing + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + /non-ue-n2-messages/subscriptions/{n2NotifySubscriptionId}: + delete: + summary: Namf_Communication Non UE N2 Info UnSubscribe service Operation + tags: + - Non UE N2 Message Notification Individual Subscription (Document) + operationId: NonUeN2InfoUnSubscribe + parameters: + - name: n2NotifySubscriptionId + in: path + description: N2 info Subscription Identifier + required: true + schema: + type: string + responses: + '204': + description: Non UE N2 INfo Subscription successfully removed. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + /subscriptions: + post: + summary: Namf_Communication AMF Status Change Subscribe service Operation + tags: + - subscriptions collection (Document) + operationId: AMFStatusChangeSubscribe + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionData' + required: true + responses: + '201': + description: N1N2 Message Subscription successfully created. + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-comm//subscriptions/{subscriptionId}' + required: true + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + onAmfStatusChange: + '{$request.body#/amfStatusUri}': + post: + summary: Amf Status Change Notify service Operation + tags: + - Amf Status Change Notify + operationId: AmfStatusChangeNotify + requestBody: + description: Amf Status Change Notification + content: + application/json: + schema: + $ref: '#/components/schemas/AmfStatusChangeNotification' + responses: + '204': + description: Expected response to a successful callback processing + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + /subscriptions/{subscriptionId}: + delete: + summary: Namf_Communication AMF Status Change UnSubscribe service Operation + tags: + - individual subscription (Document) + operationId: AMFStatusChangeUnSubscribe + parameters: + - name: subscriptionId + in: path + description: AMF Status Change Subscription Identifier + required: true + schema: + type: string + responses: + '204': + description: N1N2 Message Subscription successfully removed. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + put: + summary: Namf_Communication AMF Status Change Subscribe Modify service Operation + tags: + - individual subscription (Document) + operationId: AMFStatusChangeSubscribeModfy + parameters: + - name: subscriptionId + in: path + description: AMF Status Change Subscription Identifier + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionData' + required: true + responses: + '202': + description: N1N2 Message Subscription successfully updated. + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + OnAmfStatusChange: + '{$request.body#/amfStatusUri}': + post: + summary: Amf Status Change Notify service Operation + tags: + - Amf Status Change Notify + operationId: AmfStatusChangeNOtify + requestBody: + description: Amf Status Change Notification + content: + application/json: + schema: + $ref: '#/components/schemas/AmfStatusChangeNotification' + responses: + '204': + description: Expected response to a successful callback processing + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + namf-comm: Access to the Namf_Communication API + schemas: +# +# STRUCTURED DATA TYPES +# + SubscriptionData: + type: object + properties: + amfStatusUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + guamiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + minItems: 1 + required: + - amfStatusUri + AmfStatusChangeNotification: + type: object + properties: + amfStatusInfoList: + type: array + items: + $ref: '#/components/schemas/AmfStatusInfo' + minItems: 1 + required: + - amfStatusInfoList + AmfStatusInfo: + type: object + properties: + guamiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + minItems: 1 + statusChange: + $ref: '#/components/schemas/StatusChange' + targetAmfRemoval: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfName' + targetAmfFailure: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfName' + required: + - guamiList + - statusChange + AssignEbiData: + type: object + properties: + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + arpList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + minItems: 1 + releasedEbiList: + type: array + items: + $ref: '#/components/schemas/EpsBearerId' + minItems: 1 + oldGuami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + required: + - pduSessionId + AssignedEbiData: + type: object + properties: + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + assignedEbiList: + type: array + items: + $ref: 'TS29502_Nsmf_PDUSession.yaml#/components/schemas/EbiArpMapping' + minItems: 0 + failedArpList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + minItems: 1 + releasedEbiList: + type: array + items: + $ref: '#/components/schemas/EpsBearerId' + minItems: 1 + required: + - pduSessionId + - assignedEbiList + AssignEbiFailed: + type: object + properties: + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + failedArpList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + minItems: 1 + required: + - pduSessionId + UEContextRelease: + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + unauthenticatedSupi: + type: boolean + default: false + ngapCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + required: + - ngapCause + N2InformationTransferReqData: + type: object + properties: + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + ratSelector: + $ref: '#/components/schemas/RatSelector' + globalRanNodeList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + minItems: 1 + n2Information: + $ref: '#/components/schemas/N2InfoContainer' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - n2Information + NonUeN2InfoSubscriptionCreateData: + type: object + properties: + globalRanNodeList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + minItems: 1 + anTypeList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + minItems: 1 + n2InformationClass: + $ref: '#/components/schemas/N2InformationClass' + n2NotifyCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - n2InformationClass + - n2NotifyCallbackUri + NonUeN2InfoSubscriptionCreatedData: + type: object + properties: + n2NotifySubscriptionId: + type: string + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + n2InformationClass: + $ref: '#/components/schemas/N2InformationClass' + required: + - n2NotifySubscriptionId + UeN1N2InfoSubscriptionCreateData: + type: object + properties: + n2InformationClass: + $ref: '#/components/schemas/N2InformationClass' + n2NotifyCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + n1MessageClass: + $ref: '#/components/schemas/N1MessageClass' + n1NotifyCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + oldGuami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + UeN1N2InfoSubscriptionCreatedData: + type: object + properties: + n1n2NotifySubscriptionId: + type: string + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - n1n2NotifySubscriptionId + N2InformationNotification: + type: object + properties: + n2NotifySubscriptionId: + type: string + n2InfoContainer: + $ref: '#/components/schemas/N2InfoContainer' + toReleaseSessionList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + minItems: 1 + lcsCorrelationId: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CorrelationID' + notifyReason: + $ref: '#/components/schemas/N2InfoNotifyReason' + smfChangeInfoList: + type: array + items: + $ref: '#/components/schemas/SmfChangeInfo' + minItems: 1 + ranNodeId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + initialAmfName: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfName' + anN2IPv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + anN2IPv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + required: + - n2NotifySubscriptionId + N2InfoContainer: + type: object + properties: + n2InformationClass: + $ref: '#/components/schemas/N2InformationClass' + smInfo: + $ref: '#/components/schemas/N2SmInformation' + ranInfo: + $ref: '#/components/schemas/N2RanInformation' + nrppaInfo: + $ref: '#/components/schemas/NrppaInformation' + pwsInfo: + $ref: '#/components/schemas/PwsInformation' + required: + - n2InformationClass + N1MessageNotification: + type: object + properties: + n1NotifySubscriptionId: + type: string + n1MessageContainer: + $ref: '#/components/schemas/N1MessageContainer' + lcsCorrelationId: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CorrelationID' + registrationCtxtContainer: + $ref: '#/components/schemas/RegistrationContextContainer' + newLmfIdentification: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LMFIdentification' + required: + - n1MessageContainer + N1MessageContainer: + type: object + properties: + n1MessageClass: + $ref: '#/components/schemas/N1MessageClass' + n1MessageContent: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + nfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + serviceInstanceId: + type: string + required: + - n1MessageClass + - n1MessageContent + N1N2MessageTransferReqData: + type: object + properties: + n1MessageContainer: + $ref: '#/components/schemas/N1MessageContainer' + n2InfoContainer: + $ref: '#/components/schemas/N2InfoContainer' + mtData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + skipInd: + type: boolean + default: false + lastMsgIndication: + type: boolean + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + lcsCorrelationId: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CorrelationID' + ppi: + $ref: '#/components/schemas/Ppi' + arp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + 5qi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5Qi' + n1n2FailureTxfNotifURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + smfReallocationInd: + type: boolean + default: false + areaOfValidity: + $ref: '#/components/schemas/AreaOfValidity' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + oldGuami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + maAcceptedInd: + type: boolean + default: false + extBufSupport: + type: boolean + default: false + targetAccess: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + + N1N2MessageTransferRspData: + type: object + properties: + cause: + $ref: '#/components/schemas/N1N2MessageTransferCause' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - cause + RegistrationContextContainer: + type: object + properties: + ueContext: + $ref: '#/components/schemas/UeContext' + localTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + anType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + anN2ApId: + type: integer + ranNodeId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + initialAmfName: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfName' + userLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + rrcEstCause: + type: string + pattern: '^[0-9a-fA-F]+$' + ueContextRequest: + type: boolean + default: false + initialAmfN2ApId: + type: integer + anN2IPv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + anN2IPv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + allowedNssai: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/AllowedNssai' + configuredNssai: + type: array + items: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/ConfiguredSnssai' + minItems: 1 + rejectedNssaiInPlmn: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + rejectedNssaiInTa: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + required: + - ueContext + - anType + - anN2ApId + - ranNodeId + - initialAmfName + - userLocation + AreaOfValidity: + type: object + properties: + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 0 + required: + - taiList + UeContextTransferReqData: + type: object + properties: + reason: + $ref: '#/components/schemas/TransferReason' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + regRequest: + $ref: '#/components/schemas/N1MessageContainer' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - reason + - accessType + UeContextTransferRspData: + type: object + properties: + ueContext: + $ref: '#/components/schemas/UeContext' + ueRadioCapability: + $ref: '#/components/schemas/N2InfoContent' + ueNbiotRadioCapability: + $ref: '#/components/schemas/N2InfoContent' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - ueContext + UeContext: + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + supiUnauthInd: + type: boolean + gpsiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + udmGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + ausfGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + routingIndicator: + type: string + groupList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + drxParameter: + $ref: '#/components/schemas/DrxParameter' + subRfsp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndex' + usedRfsp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndex' + subUeAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + smsfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + seafData: + $ref: '#/components/schemas/SeafData' + 5gMmCapability: + $ref: '#/components/schemas/5GMmCapability' + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + pcfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + pcfAmpServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + pcfUepServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + pcfBinding: + $ref: '#/components/schemas/SbiBindingLevel' + pcfAmPolicyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + amPolicyReqTriggerList: + type: array + items: + $ref: '#/components/schemas/PolicyReqTrigger' + minItems: 1 + pcfUePolicyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + uePolicyReqTriggerList: + type: array + items: + $ref: '#/components/schemas/PolicyReqTrigger' + minItems: 1 + hpcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + restrictedRatList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + minItems: 1 + forbiddenAreaList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Area' + minItems: 1 + serviceAreaRestriction: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' + restrictedCoreNwTypeList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CoreNetworkType' + minItems: 1 + eventSubscriptionList: + type: array + items: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/AmfEventSubscription' + minItems: 1 + mmContextList: + type: array + items: + $ref: '#/components/schemas/MmContext' + minItems: 1 + maxItems: 2 + sessionContextList: + type: array + items: + $ref: '#/components/schemas/PduSessionContext' + minItems: 1 + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + serviceGapExpiryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + stnSr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/StnSr' + cMsisdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CMsisdn' + msClassmark2: + $ref: '#/components/schemas/MSClassmark2' + supportedCodecList: + type: array + items: + $ref: '#/components/schemas/SupportedCodec' + minItems: 1 + smallDataRateStatusInfos: + type: array + items: + $ref: '#/components/schemas/SmallDataRateStatusInfo' + minItems: 1 + restrictedPrimaryRatList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + minItems: 1 + restrictedSecondaryRatList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + minItems: 1 + v2xContext: + items: + $ref: '#/components/schemas/V2xContext' + lteCatMInd: + type: boolean + default: false + moExpDataCounter: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MoExpDataCounter' + N2SmInformation: + type: object + properties: + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + n2InfoContent: + $ref: '#/components/schemas/N2InfoContent' + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + homePlmnSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + subjectToHo: + type: boolean + required: + - pduSessionId + N2InfoContent: + type: object + properties: + ngapMessageType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + ngapIeType: + $ref: '#/components/schemas/NgapIeType' + ngapData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + required: + - ngapData + NrppaInformation: + type: object + properties: + nfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + nrppaPdu: + $ref: '#/components/schemas/N2InfoContent' + serviceInstanceId: + type: string + required: + - nfId + - nrppaPdu + PwsInformation: + type: object + properties: + messageIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint16' + serialNumber: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint16' + pwsContainer: + $ref: '#/components/schemas/N2InfoContent' + sendRanResponse: + type: boolean + default: false + omcId: + $ref: '#/components/schemas/OmcIdentifier' + required: + - messageIdentifier + - serialNumber + - pwsContainer + N1N2MsgTxfrFailureNotification: + type: object + properties: + cause: + $ref: '#/components/schemas/N1N2MessageTransferCause' + n1n2MsgDataUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + required: + - cause + - n1n2MsgDataUri + N1N2MessageTransferError: + type: object + properties: + error: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + errInfo: + $ref: '#/components/schemas/N1N2MsgTxfrErrDetail' + required: + - error + N1N2MsgTxfrErrDetail: + type: object + properties: + retryAfter: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + highestPrioArp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + maxWaitingTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + N2InformationTransferRspData: + type: object + properties: + result: + $ref: '#/components/schemas/N2InformationTransferResult' + pwsRspData: + $ref: '#/components/schemas/PWSResponseData' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - result + MmContext: + type: object + properties: + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + nasSecurityMode: + $ref: '#/components/schemas/NasSecurityMode' + nasDownlinkCount: + $ref: '#/components/schemas/NasCount' + nasUplinkCount: + $ref: '#/components/schemas/NasCount' + ueSecurityCapability: + $ref: '#/components/schemas/UeSecurityCapability' + s1UeNetworkCapability: + $ref: '#/components/schemas/S1UeNetworkCapability' + allowedNssai: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + nssaiMappingList: + type: array + items: + $ref: '#/components/schemas/NssaiMapping' + minItems: 1 + nsInstanceList: + type: array + items: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/NsiId' + minItems: 1 + expectedUEbehavior: + $ref: '#/components/schemas/ExpectedUeBehavior' + plmnAssiUeRadioCapId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnAssiUeRadioCapId' + manAssiUeRadioCapId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ManAssiUeRadioCapId' + ucmfDicEntryId: + type: string + required: + - accessType + SeafData: + type: object + properties: + ngKsi: + $ref: '#/components/schemas/NgKsi' + keyAmf: + $ref: '#/components/schemas/KeyAmf' + nh: + type: string + pattern: '^[A-Fa-f0-9]+$' + ncc: + type: integer + minimum: 0 + maximum: 7 + keyAmfChangeInd: + type: boolean + keyAmfHDerivationInd: + type: boolean + required: + - ngKsi + - keyAmf + NasSecurityMode: + type: object + properties: + integrityAlgorithm: + $ref: '#/components/schemas/IntegrityAlgorithm' + cipheringAlgorithm: + $ref: '#/components/schemas/CipheringAlgorithm' + required: + - integrityAlgorithm + - cipheringAlgorithm + PduSessionContext: + type: object + properties: + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + smContextRef: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + additionalAccessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + allocatedEbiList: + type: array + items: + $ref: 'TS29502_Nsmf_PDUSession.yaml#/components/schemas/EbiArpMapping' + minItems: 1 + hsmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + hsmfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + hsmfServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + smfBinding: + $ref: '#/components/schemas/SbiBindingLevel' + vsmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + vsmfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + vsmfServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + vsmfBinding: + $ref: '#/components/schemas/SbiBindingLevel' + ismfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + ismfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + ismfServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + ismfBinding: + $ref: '#/components/schemas/SbiBindingLevel' + nsInstance: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/NsiId' + smfServiceInstanceId: + type: string + maPduSession: + type: boolean + default: false + cnAssistedRanPara: + $ref: 'TS29502_Nsmf_PDUSession.yaml#/components/schemas/CnAssistedRanPara' + required: + - pduSessionId + - smContextRef + - sNssai + - dnn + - accessType + NssaiMapping: + type: object + properties: + mappedSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + hSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + required: + - mappedSnssai + - hSnssai + UeRegStatusUpdateReqData: + type: object + properties: + transferStatus: + $ref: '#/components/schemas/UeContextTransferStatus' + toReleaseSessionList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + minItems: 1 + pcfReselectedInd: + type: boolean + smfChangeInfoList: + type: array + items: + $ref: '#/components/schemas/SmfChangeInfo' + minItems: 1 + required: + - transferStatus + UeRegStatusUpdateRspData: + type: object + properties: + regStatusTransferComplete: + type: boolean + required: + - regStatusTransferComplete + AssignEbiError: + type: object + properties: + error: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + failureDetails: + $ref: '#/components/schemas/AssignEbiFailed' + required: + - error + - failureDetails + UeContextCreateData: + type: object + properties: + ueContext: + $ref: '#/components/schemas/UeContext' + targetId: + $ref: '#/components/schemas/NgRanTargetId' + sourceToTargetData: + $ref: '#/components/schemas/N2InfoContent' + pduSessionList: + type: array + items: + $ref: '#/components/schemas/N2SmInformation' + minItems: 1 + mmeControlFteid: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + n2NotifyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ueRadioCapability: + $ref: '#/components/schemas/N2InfoContent' + ngapCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - ueContext + - targetId + - sourceToTargetData + - pduSessionList + UeContextCreatedData: + type: object + properties: + ueContext: + $ref: '#/components/schemas/UeContext' + targetToSourceData: + $ref: '#/components/schemas/N2InfoContent' + pduSessionList: + type: array + items: + $ref: '#/components/schemas/N2SmInformation' + minItems: 1 + failedSessionList: + type: array + items: + $ref: '#/components/schemas/N2SmInformation' + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + pcfReselectedInd: + type: boolean + required: + - ueContext + - targetToSourceData + - pduSessionList + UeContextCreateError: + type: object + properties: + error: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + ngapCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + required: + - error + NgRanTargetId: + type: object + properties: + ranNodeId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + tai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + required: + - ranNodeId + - tai + PWSResponseData: + type: object + properties: + ngapMessageType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + serialNumber: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint16' + messageIdentifier: + type: integer + unknownTaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + required: + - ngapMessageType + - serialNumber + - messageIdentifier + PWSErrorData: + type: object + properties: + namfCause: + type: integer + required: + - namfCause + N2InformationTransferError: + type: object + properties: + error: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + pwdErrorInfo: + $ref: '#/components/schemas/PWSErrorData' + required: + - error + NgKsi: + type: object + properties: + tsc: + $ref: '#/components/schemas/ScType' + ksi: + type: integer + minimum: 0 + maximum: 6 + required: + - tsc + - ksi + KeyAmf: + type: object + properties: + keyType: + $ref: '#/components/schemas/KeyAmfType' + keyVal: + type: string + required: + - keyType + - keyVal + ExpectedUeBehavior: + type: object + properties: + expMoveTrajectory: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + minItems: 1 + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - expMoveTrajectory + - validityTime + N2RanInformation: + type: object + properties: + n2InfoContent: + $ref: '#/components/schemas/N2InfoContent' + required: + - n2InfoContent + N2InfoNotificationRspData: + type: object + properties: + n2InfoContent: + $ref: '#/components/schemas/N2InfoContent' + SmallDataRateStatusInfo: + type: object + properties: + Snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + Dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + SmallDataRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SmallDataRateStatus' + required: + - Snssai + - Dnn + - SmallDataRateStatus + SmfChangeInfo: + type: object + properties: + pduSessionIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + minItems: 1 + smfChangeInd: + $ref: '#/components/schemas/SmfChangeIndication' + required: + - pduSessionIdList + - smfChangeInd + + V2xContext: + type: object + properties: + nrV2xServicesAuth: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NrV2xAuth' + lteV2xServicesAuth: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LteV2xAuth' + nrUeSidelinkAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + lteUeSidelinkAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + Pc5QoSPara: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pc5QoSPara' +# +# SIMPLE DATA TYPES +# + EpsBearerId: + type: integer + minimum: 0 + maximum: 15 + Ppi: + type: integer + minimum: 0 + maximum: 7 + NasCount: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + 5GMmCapability: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + UeSecurityCapability: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + S1UeNetworkCapability: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + DrxParameter: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + OmcIdentifier: + type: string + MSClassmark2: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + SupportedCodec: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + +# +# ENUMERATIONS +# + StatusChange: + anyOf: + - type: string + enum: + - AMF_UNAVAILABLE + - AMF_AVAILABLE + - type: string + N2InformationClass: + anyOf: + - type: string + enum: + - SM + - NRPPa + - PWS + - PWS-BCAL + - PWS-RF + - RAN + - type: string + N1MessageClass: +# anyOf: +# - type: string + enum: + - 5GMM + - SM + - LPP + - SMS + - UPDP + - LCS + type: string + N1N2MessageTransferCause: + anyOf: + - type: string + enum: + - ATTEMPTING_TO_REACH_UE + - N1_N2_TRANSFER_INITIATED + - WAITING_FOR_ASYNCHRONOUS_TRANSFER + - UE_NOT_RESPONDING + - N1_MSG_NOT_TRANSFERRED + - UE_NOT_REACHABLE_FOR_SESSION + - TEMPORARY_REJECT_REGISTRATION_ONGOING + - TEMPORARY_REJECT_HANDOVER_ONGOING + - type: string + UeContextTransferStatus: + anyOf: + - type: string + enum: + - TRANSFERRED + - NOT_TRANSFERRED + - type: string + N2InformationTransferResult: + anyOf: + - type: string + enum: + - N2_INFO_TRANSFER_INITIATED + - type: string + CipheringAlgorithm: + anyOf: + - type: string + enum: + - NEA0 + - NEA1 + - NEA2 + - NEA3 + - type: string + IntegrityAlgorithm: + anyOf: + - type: string + enum: + - NIA0 + - NIA1 + - NIA2 + - NIA3 + - type: string + SmsSupport: + anyOf: + - type: string + enum: + - 3GPP + - NON_3GPP + - BOTH + - NONE + - type: string + ScType: + anyOf: + - type: string + enum: + - NATIVE + - MAPPED + - type: string + KeyAmfType: + anyOf: + - type: string + enum: + - KAMF + - KPRIMEAMF + - type: string + TransferReason: + anyOf: + - type: string + enum: + - INIT_REG + - MOBI_REG + - MOBI_REG_UE_VALIDATED + - type: string + PolicyReqTrigger: + anyOf: + - type: string + enum: + - LOCATION_CHANGE + - PRA_CHANGE + - SARI_CHANGE + - RFSP_INDEX_CHANGE + - ALLOWED_NSSAI_CHANGE + - type: string + RatSelector: + anyOf: + - type: string + enum: + - E-UTRA + - NR + - type: string + NgapIeType: + anyOf: + - type: string + enum: + - PDU_RES_SETUP_REQ + - PDU_RES_REL_CMD + - PDU_RES_MOD_REQ + - HANDOVER_CMD + - HANDOVER_REQUIRED + - HANDOVER_PREP_FAIL + - SRC_TO_TAR_CONTAINER + - TAR_TO_SRC_CONTAINER + - RAN_STATUS_TRANS_CONTAINER + - SON_CONFIG_TRANSFER + - NRPPA_PDU + - UE_RADIO_CAPABILITY + - RIM_INFO_TRANSFER + - SECONDARY_RAT_USAGE + - type: string + N2InfoNotifyReason: + anyOf: + - type: string + enum: + - HANDOVER_COMPLETED + - type: string + SmfChangeIndication: + anyOf: + - type: string + enum: + - CHANGED + - REMOVED + - type: string + SbiBindingLevel: + anyOf: + - type: string + enum: + - NF_INSTANCE_BINDING + - NF_SET_BINDING + - NF_SERVICE_SET_BINDING + - type: string diff --git a/lib/sbi/support/3gpp-spec/TS29518_Namf_EventExposure.yaml b/lib/sbi/support/modified/TS29518_Namf_EventExposure.yaml similarity index 85% rename from lib/sbi/support/3gpp-spec/TS29518_Namf_EventExposure.yaml rename to lib/sbi/support/modified/TS29518_Namf_EventExposure.yaml index 9d9d8fb764..af86848cc5 100644 --- a/lib/sbi/support/3gpp-spec/TS29518_Namf_EventExposure.yaml +++ b/lib/sbi/support/modified/TS29518_Namf_EventExposure.yaml @@ -1,529 +1,586 @@ -openapi: 3.0.0 -info: - version: 1.0.2 - title: Namf_EventExposure - description: | - AMF Event Exposure Service - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved.security: - - {} - - oAuth2ClientCredentials: - - namf-evts -externalDocs: - description: 3GPP TS 29.518 V15.4.0; 5G System; Access and Mobility Management Services - url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.518/' -servers: - - url: '{apiRoot}/namf-evts/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in subclause subclause 4.4 of 3GPP TS 29.501 -paths: - /subscriptions: - post: - summary: Namf_EventExposure Subscribe service Operation - tags: - - Subscriptions collection (Document) - operationId: CreateSubscription - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/AmfCreateEventSubscription' - required: true - responses: - '201': - description: Subsription Created - headers: - Location: - description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-evts//subscriptions/{subscriptionId}' - required: true - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/AmfCreatedEventSubscription' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - description: Unexpected error - callbacks: - onEventReport: - '{$request.body#/subscription/eventNotifyUri}': - post: - summary: Event Notificaiton Delivery - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/AmfEventNotification' - required: true - responses: - '204': - description: Successful acknowledgement - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - description: Unexpected error - onSubscriptionIdChangeEvtReport: - '{$request.body#/subscription/subsChangeNotifyUri}': - post: - summary: Event Notificaiton Delivery For Subscription Id Change - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/AmfEventNotification' - required: true - responses: - '204': - description: Successful acknowledgement - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - description: Unexpected error - /subscriptions/{subscriptionId}: - patch: - summary: Namf_EventExposure Subscribe Modify service Operation - tags: - - Individual subscription (Document) - operationId: ModifySubscription - parameters: - - name: subscriptionId - in: path - required: true - description: Unique ID of the subscription to be modified - schema: - type: string - requestBody: - content: - application/json-patch+json: - schema: - oneOf: - - $ref: '#/components/schemas/AmfUpdateEventSubscriptionItem' - - $ref: '#/components/schemas/AmfUpdateEventOptionItem' - required: true - responses: - '200': - description: Subsription modified successfully - content: - application/json: - schema: - $ref: '#/components/schemas/AmfUpdatedEventSubscription' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - description: Unexpected error - delete: - summary: Namf_EventExposure Unsubscribe service Operation - tags: - - Individual subscription (Document) - operationId: DeleteSubscription - parameters: - - name: subscriptionId - in: path - required: true - description: Unique ID of the subscription to be deleted - schema: - type: string - responses: - '204': - description: Subsription deleted successfully - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - description: Unexpected error -components: - securitySchemes: - oAuth2ClientCredentials: - type: oauth2 - flows: - clientCredentials: - tokenUrl: '{nrfApiRoot}/oauth2/token' - scopes: - namf-evts: Access to the Namf_EventExposure API - schemas: - AmfEventSubscription: - type: object - properties: - eventList: - type: array - items: - $ref: '#/components/schemas/AmfEvent' - minItems: 1 - eventNotifyUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - notifyCorrelationId: - type: string - nfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - subsChangeNotifyUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - subsChangeNotifyCorrelationId: - type: string - supi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - groupId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' - gpsi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' - pei: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' - anyUE: - type: boolean - options: - $ref: '#/components/schemas/AmfEventMode' - required: - - eventList - - eventNotifyUri - - notifyCorrelationId - - nfId - AmfEvent: - type: object - properties: - type: - $ref: '#/components/schemas/AmfEventType' - immediateFlag: - type: boolean - areaList: - type: array - items: - $ref: '#/components/schemas/AmfEventArea' - minItems: 1 - locationFilterList: - type: array - items: - $ref: '#/components/schemas/LocationFilter' - minItems: 1 - refId: - $ref: 'TS29503_Nudm_EE.yaml#/components/schemas/ReferenceId' - required: - - type - AmfEventNotification: - type: object - properties: - notifyCorrelationId: - type: string - subsChangeNotifyCorrelationId: - type: string - reportList: - type: array - items: - $ref: '#/components/schemas/AmfEventReport' - minItems: 1 - AmfEventReport: - type: object - properties: - type: - $ref: '#/components/schemas/AmfEventType' - state: - $ref: '#/components/schemas/AmfEventState' - timeStamp: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - subscriptionId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - anyUe: - type: boolean - supi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - areaList: - type: array - items: - $ref: '#/components/schemas/AmfEventArea' - minItems: 1 - refId: - $ref: 'TS29503_Nudm_EE.yaml#/components/schemas/ReferenceId' - gpsi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' - pei: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' - location: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - timezone: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' - accessTypeList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - minItems: 1 - rmInfoList: - type: array - items: - $ref: '#/components/schemas/RmInfo' - minItems: 1 - cmInfoList: - type: array - items: - $ref: '#/components/schemas/CmInfo' - minItems: 1 - reachability: - $ref: '#/components/schemas/UeReachability' - commFailure: - $ref: '#/components/schemas/CommunicationFailure' - numberOfUes: - type: integer - required: - - type - - state - - timeStamp - AmfEventMode: - type: object - properties: - trigger: - $ref: '#/components/schemas/AmfEventTrigger' - maxReports: - type: integer - expiry: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - required: - - trigger - AmfEventState: - type: object - properties: - active: - type: boolean - remainReports: - type: integer - remainDuration: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' - required: - - active - RmInfo: - type: object - properties: - rmState: - $ref: '#/components/schemas/RmState' - accessType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - required: - - rmState - - accessType - CmInfo: - type: object - properties: - cmState: - $ref: '#/components/schemas/CmState' - accessType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - required: - - cmState - - accessType - CommunicationFailure: - type: object - properties: - nasReleaseCode: - type: string - ranReleaseCode: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' - AmfCreateEventSubscription: - type: object - properties: - subscription: - $ref: '#/components/schemas/AmfEventSubscription' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - subscription - AmfCreatedEventSubscription: - type: object - properties: - subscription: - $ref: '#/components/schemas/AmfEventSubscription' - subscriptionId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - reportList: - type: array - items: - $ref: '#/components/schemas/AmfEventReport' - minItems: 1 - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - subscription - - subscriptionId - AmfUpdateEventSubscriptionItem: - type: array - items: - type: object - properties: - op: - type: string - enum: - - add - - remove - - replace - path: - type: string - pattern: '\/eventList\/[0-]$|\/eventList\/[1-9][0-9]*$' - value: - $ref: '#/components/schemas/AmfEvent' - required: - - op - - path - minItems: 1 - AmfUpdateEventOptionItem: - type: object - properties: - op: - type: string - enum: - - replace - path: - type: string - pattern: '\/options\/expiry$' - value: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - required: - - op - - path - - value - AmfUpdatedEventSubscription: - type: object - properties: - subscription: - $ref: '#/components/schemas/AmfEventSubscription' - required: - - subscription - AmfEventArea: - type: object - properties: - presenceInfo: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' - ladnInfo: - $ref: '#/components/schemas/LadnInfo' - LadnInfo: - type: object - properties: - ladn: - type: string - presence: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceState' - required: - - ladn - 5gGuti: - type: string - AmfEventType: - anyOf: - - type: string - enum: - - LOCATION_REPORT - - PRESENCE_IN_AOI_REPORT - - TIMEZONE_REPORT - - ACCESS_TYPE_REPORT - - REGISTRATION_STATE_REPORT - - CONNECTIVITY_STATE_REPORT - - REACHABILITY_REPORT - - COMMUNICATION_FAILURE_REPORT - - UES_IN_AREA_REPORT - - SUBSCRIPTION_ID_CHANGE - - SUBSCRIPTION_ID_ADDITION - - LOSS_OF_CONNECTIVITY - - type: string - AmfEventTrigger: - anyOf: - - type: string - enum: - - ONE_TIME - - CONTINUOUS - - type: string - LocationFilter : - anyOf: - - type: string - enum: - - TAI - - CELL_ID - - N3IWF - - UE_IP - - UDP_PORT - - type: string - UeReachability: - anyOf: - - type: string - enum: - - UNREACHABLE - - REACHABLE - - REGULATORY_ONLY - - type: string - RmState: - anyOf: - - type: string - enum: - - REGISTERED - - DEREGISTERED - - type: string - CmState: - anyOf: - - type: string - enum: - - IDLE - - CONNECTED - - type: string +openapi: 3.0.0 +info: + version: 1.1.0.alpha-3 + title: Namf_EventExposure + description: | + AMF Event Exposure Service + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +security: + - {} + - oAuth2ClientCredentials: + - namf-evts +externalDocs: + description: 3GPP TS 29.518 V16.3.0; 5G System; Access and Mobility Management Services + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.518/' +servers: + - url: '{apiRoot}/namf-evts/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause clause 4.4 of 3GPP TS 29.501 +paths: + /subscriptions: + post: + summary: Namf_EventExposure Subscribe service Operation + tags: + - Subscriptions collection (Document) + operationId: CreateSubscription + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AmfCreateEventSubscription' + required: true + responses: + '201': + description: Subsription Created + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-evts//subscriptions/{subscriptionId}' + required: true + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/AmfCreatedEventSubscription' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + onEventReport: + '{$request.body#/subscription/eventNotifyUri}': + post: + summary: Event Notificaiton Delivery + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AmfEventNotification' + required: true + responses: + '204': + description: Successful acknowledgement + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + onSubscriptionIdChangeEvtReport: + '{$request.body#/subscription/subsChangeNotifyUri}': + post: + summary: Event Notificaiton Delivery For Subscription Id Change + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AmfEventNotification' + required: true + responses: + '204': + description: Successful acknowledgement + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /subscriptions/{subscriptionId}: + patch: + summary: Namf_EventExposure Subscribe Modify service Operation + tags: + - Individual subscription (Document) + operationId: ModifySubscription + parameters: + - name: subscriptionId + in: path + required: true + description: Unique ID of the subscription to be modified + schema: + type: string + requestBody: + content: + application/json-patch+json: + schema: + oneOf: + - $ref: '#/components/schemas/AmfUpdateEventSubscriptionItem' + - $ref: '#/components/schemas/AmfUpdateEventOptionItem' + required: true + responses: + '200': + description: Subsription modified successfully + content: + application/json: + schema: + $ref: '#/components/schemas/AmfUpdatedEventSubscription' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + delete: + summary: Namf_EventExposure Unsubscribe service Operation + tags: + - Individual subscription (Document) + operationId: DeleteSubscription + parameters: + - name: subscriptionId + in: path + required: true + description: Unique ID of the subscription to be deleted + schema: + type: string + responses: + '204': + description: Subsription deleted successfully + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + namf-evts: Access to the Namf_EventExposure API + schemas: + AmfEventSubscription: + type: object + properties: + eventList: + type: array + items: + $ref: '#/components/schemas/AmfEvent' + minItems: 1 + eventNotifyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + notifyCorrelationId: + type: string + nfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + subsChangeNotifyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + subsChangeNotifyCorrelationId: + type: string + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + groupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + anyUE: + type: boolean + options: + $ref: '#/components/schemas/AmfEventMode' + required: + - eventList + - eventNotifyUri + - notifyCorrelationId + - nfId + AmfEvent: + type: object + properties: + type: + $ref: '#/components/schemas/AmfEventType' + immediateFlag: + type: boolean + areaList: + type: array + items: + $ref: '#/components/schemas/AmfEventArea' + minItems: 1 + locationFilterList: + type: array + items: + $ref: '#/components/schemas/LocationFilter' + minItems: 1 + refId: + $ref: 'TS29503_Nudm_EE.yaml#/components/schemas/ReferenceId' + trafficDescriptorList: + type: array + items: + $ref: '#/components/schemas/TrafficDescriptor' + minItems: 1 + required: + - type + AmfEventNotification: + type: object + properties: + notifyCorrelationId: + type: string + subsChangeNotifyCorrelationId: + type: string + reportList: + type: array + items: + $ref: '#/components/schemas/AmfEventReport' + minItems: 1 + AmfEventReport: + type: object + properties: + type: + $ref: '#/components/schemas/AmfEventType' + state: + $ref: '#/components/schemas/AmfEventState' + timeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + subscriptionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + anyUe: + type: boolean + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + areaList: + type: array + items: + $ref: '#/components/schemas/AmfEventArea' + minItems: 1 + refId: + $ref: 'TS29503_Nudm_EE.yaml#/components/schemas/ReferenceId' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + location: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + timezone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + accessTypeList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + minItems: 1 + rmInfoList: + type: array + items: + $ref: '#/components/schemas/RmInfo' + minItems: 1 + cmInfoList: + type: array + items: + $ref: '#/components/schemas/CmInfo' + minItems: 1 + reachability: + $ref: '#/components/schemas/UeReachability' + commFailure: + $ref: '#/components/schemas/CommunicationFailure' + numberOfUes: + type: integer + 5gsUserStateList: + type: array + items: + $ref: '#/components/schemas/5GsUserStateInfo' + minItems: 1 + typeCode: + type: string + pattern: '^imeitac-[0-9]{8}$' + registrationNumber: + type: integer + required: + - type + - state + - timeStamp + AmfEventMode: + type: object + properties: + trigger: + $ref: '#/components/schemas/AmfEventTrigger' + maxReports: + type: integer + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - trigger + AmfEventState: + type: object + properties: + active: + type: boolean + remainReports: + type: integer + remainDuration: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + required: + - active + RmInfo: + type: object + properties: + rmState: + $ref: '#/components/schemas/RmState' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + required: + - rmState + - accessType + CmInfo: + type: object + properties: + cmState: + $ref: '#/components/schemas/CmState' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + required: + - cmState + - accessType + CommunicationFailure: + type: object + properties: + nasReleaseCode: + type: string + ranReleaseCode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + AmfCreateEventSubscription: + type: object + properties: + subscription: + $ref: '#/components/schemas/AmfEventSubscription' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + oldGuami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + required: + - subscription + AmfCreatedEventSubscription: + type: object + properties: + subscription: + $ref: '#/components/schemas/AmfEventSubscription' + subscriptionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + reportList: + type: array + items: + $ref: '#/components/schemas/AmfEventReport' + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - subscription + - subscriptionId + AmfUpdateEventSubscriptionItem: + type: array + items: + type: object + properties: + op: + type: string + enum: + - add + - remove + - replace + path: + type: string + pattern: '\/eventList\/[0-]$|\/eventList\/[1-9][0-9]*$' + value: + $ref: '#/components/schemas/AmfEvent' + required: + - op + - path + minItems: 1 + AmfUpdateEventOptionItem: + type: object + properties: + op: + type: string + enum: + - replace + path: + type: string + pattern: '\/options\/expiry$' + value: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - op + - path + - value + AmfUpdatedEventSubscription: + type: object + properties: + subscription: + $ref: '#/components/schemas/AmfEventSubscription' + required: + - subscription + AmfEventArea: + type: object + properties: + presenceInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + ladnInfo: + $ref: '#/components/schemas/LadnInfo' + LadnInfo: + type: object + properties: + ladn: + type: string + presence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceState' + required: + - ladn + 5GsUserStateInfo: + type: object + properties: + 5gsUserState: + $ref: '#/components/schemas/5GsUserState' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + required: + - 5gsUserState + - accessType + TrafficDescriptor: + type: object + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dddTrafficDescriptorList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DddTrafficDescriptor' + minItems: 1 + 5gGuti: + type: string + AmfEventType: + anyOf: + - type: string + enum: + - LOCATION_REPORT + - PRESENCE_IN_AOI_REPORT + - TIMEZONE_REPORT + - ACCESS_TYPE_REPORT + - REGISTRATION_STATE_REPORT + - CONNECTIVITY_STATE_REPORT + - REACHABILITY_REPORT + - COMMUNICATION_FAILURE_REPORT + - UES_IN_AREA_REPORT + - SUBSCRIPTION_ID_CHANGE + - SUBSCRIPTION_ID_ADDITION + - LOSS_OF_CONNECTIVITY + - 5GS_USER_STATE_REPORT + - AVAILABILITY_AFTER_DDN_FAILURE + - TYPE_ALLOCATION_CODE_REPORT + - FREQUENT_MOBILITY_REGISTRATION_REPORT + - type: string + AmfEventTrigger: + anyOf: + - type: string + enum: + - ONE_TIME + - CONTINUOUS + - type: string + LocationFilter : + anyOf: + - type: string + enum: + - TAI + - CELL_ID + - N3IWF + - UE_IP + - UDP_PORT + - TNAP_ID + - GLI + - type: string + UeReachability: + anyOf: + - type: string + enum: + - UNREACHABLE + - REACHABLE + - REGULATORY_ONLY + - type: string + RmState: + anyOf: + - type: string + enum: + - REGISTERED + - DEREGISTERED + - type: string + CmState: + anyOf: + - type: string + enum: + - IDLE + - CONNECTED + - type: string + 5GsUserState: + anyOf: + - type: string + enum: + - DEREGISTERED + - REGISTERED_NOT_REACHABLE_FOR_PAGING + - REGISTERED_REACHABLE_FOR_PAGING + - CONNECTED_NOT_REACHABLE_FOR_PAGING + - CONNECTED_REACHABLE_FOR_PAGING + - NOT_PROVIDED_FROM_AMF + - type: string diff --git a/lib/sbi/support/3gpp-spec/TS29519_Application_Data.yaml b/lib/sbi/support/modified/TS29519_Application_Data.yaml similarity index 99% rename from lib/sbi/support/3gpp-spec/TS29519_Application_Data.yaml rename to lib/sbi/support/modified/TS29519_Application_Data.yaml index f72356b5f8..9fa6aad486 100644 --- a/lib/sbi/support/3gpp-spec/TS29519_Application_Data.yaml +++ b/lib/sbi/support/modified/TS29519_Application_Data.yaml @@ -4,7 +4,7 @@ info: title: Unified Data Repository Service API file for Application Data description: | The API version is defined in 3GPP TS 29.504 - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. externalDocs: description: 3GPP TS 29.519 V16.3.0; 5G System; Usage of the Unified Data Repository Service for Policy Data, Application Data and Structured Data for Exposure. diff --git a/lib/sbi/support/3gpp-spec/TS29519_Exposure_Data.yaml b/lib/sbi/support/modified/TS29519_Exposure_Data.yaml similarity index 99% rename from lib/sbi/support/3gpp-spec/TS29519_Exposure_Data.yaml rename to lib/sbi/support/modified/TS29519_Exposure_Data.yaml index 9f4586aea8..c531d86d32 100644 --- a/lib/sbi/support/3gpp-spec/TS29519_Exposure_Data.yaml +++ b/lib/sbi/support/modified/TS29519_Exposure_Data.yaml @@ -4,7 +4,7 @@ info: title: Unified Data Repository Service API file for structured data for exposure description: | The API version is defined in 3GPP TS 29.504 - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. externalDocs: description: 3GPP TS 29.519 V16.3.0; 5G System; Usage of the Unified Data Repository Service for Policy Data, Application Data and Structured Data for Exposure. diff --git a/lib/sbi/support/modified/TS29519_Policy_Data.yaml b/lib/sbi/support/modified/TS29519_Policy_Data.yaml new file mode 100644 index 0000000000..b1f024b457 --- /dev/null +++ b/lib/sbi/support/modified/TS29519_Policy_Data.yaml @@ -0,0 +1,1505 @@ +openapi: 3.0.0 +info: + version: '-' + title: Unified Data Repository Service API file for policy data + description: | + The API version is defined in 3GPP TS 29.504 + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.519 V16.3.0; 5G System; Usage of the Unified Data Repository Service for Policy Data, Application Data and Structured Data for Exposure. + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.519/' + +paths: + /policy-data/ues/{ueId}/am-data: + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + get: + summary: Retrieves the access and mobility policy data for a subscriber + operationId: ReadAccessAndMobilityPolicyData + tags: + - AccessAndMobilityPolicyData (Document) + responses: + '200': + description: Upon success, a response body containing access and mobility policies shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/AmPolicyData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/ues/{ueId}/ue-policy-set: + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + get: + summary: Retrieves the UE policy set data for a subscriber + operationId: ReadUEPolicySet + tags: + - UEPolicySet (Document) + responses: + '200': + description: Upon success, a response body containing UE policies shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/UePolicySet' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + summary: Create or modify the UE policy set data for a subscriber + operationId: CreateOrReplaceUEPolicySet + tags: + - UEPolicySet (Document) + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UePolicySet' + responses: + '201': + description: Successful case. The resource has been successfully created and a response body containing a representation of the created UEPolicySet resource shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/UePolicySet' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '200': + description: Successful case. The resource has been successfully created and a response body containing UE policies shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/UePolicySet' + '204': + description: Successful case. The resource has been successfully updated and no additional content is to be sent in the response message. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Modify the UE policy set data for a subscriber + operationId: UpdateUEPolicySet + tags: + - UEPolicySet (Document) + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/UePolicySetPatch' + responses: + '204': + description: Successful case. The resource has been successfully updated and no additional content is to be sent in the response message. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/ues/{ueId}/sm-data: + get: + summary: Retrieves the session management policy data for a subscriber + operationId: ReadSessionManagementPolicyData + tags: + - SessionManagementPolicyData (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: snssai + in: query + required: false + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + - name: dnn + in: query + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + - name: supp-feat + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Upon success, a response body containing SmPolicyData shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/SmPolicyData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Modify the session management policy data for a subscriber + operationId: UpdateSessionManagementPolicyData + tags: + - SessionManagementPolicyData (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/SmPolicyDataPatch' + responses: + '204': + description: Successful case. The resource has been successfully updated and no additional content is to be sent in the response message. + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmPolicyData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/ues/{ueId}/sm-data/{usageMonId}: + get: + summary: Retrieve a usage monitoring resource + operationId: ReadUsageMonitoringInformation + tags: + - UsageMonitoringInformation (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: usageMonId + in: path + required: true + schema: + type: string + responses: + '200': + description: Successful case. The usage monitoring data is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/UsageMonData' + '204': + description: The resource was found but no usage monitoring data is available. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + summary: Create a usage monitoring resource + operationId: CreateUsageMonitoringResource + tags: + - UsageMonitoringInformation (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: usageMonId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UsageMonData' + responses: + '201': + description: Successful case. The resource has been successfully created and a response body is returned containing a representation of the resource. + content: + application/json: + schema: + $ref: '#/components/schemas/UsageMonData' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete a usage monitoring resource + operationId: DeleteUsageMonitoringInformation + tags: + - UsageMonitoringInformation (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: usageMonId + in: path + required: true + schema: + type: string + responses: + '204': + description: Successful case. The resource has been successfully deleted. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/sponsor-connectivity-data/{sponsorId}: + parameters: + - name: sponsorId + in: path + required: true + schema: + type: string + get: + summary: Retrieves the sponsored connectivity information for a given sponsorId + operationId: ReadSponsorConnectivityData + tags: + - SponsorConnectivityData (Document) + responses: + '200': + description: Upon success, a response body containing Sponsor Connectivity Data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/SponsorConnectivityData' + '204': + description: The resource was found but no Sponsor Connectivity Data is available. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/bdt-data: + get: + summary: Retrieves the BDT data collection + operationId: ReadBdtData + tags: + - BdtData (Store) + parameters: + - name: bdt-ref-ids + in: query + description: List of the BDT reference identifiers. + schema: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + minItems: 1 + style: form + explode: false + responses: + '200': + description: Upon success, a response body containing the BDT data shall be returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/BdtData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/bdt-data/{bdtReferenceId}: + parameters: + - name: bdtReferenceId + in: path + required: true + schema: + type: string + get: + summary: Retrieves the BDT data information associated with a BDT reference Id + operationId: ReadIndividualBdtData + tags: + - IndividualBdtData (Document) + responses: + '200': + description: Upon success, a response body containing the BDT data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BdtData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + summary: Creates an BDT data resource associated with an BDT reference Id + operationId: CreateIndividualBdtData + tags: + - IndividualBdtData (Document) + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BdtData' + responses: + '201': + description: Successful case. The resource has been successfully created. + content: + application/json: + schema: + $ref: '#/components/schemas/BdtData' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Deletes an BDT data resource associated with an BDT reference Id + operationId: DeleteIndividualBdtData + tags: + - IndividualBdtData (Document) + responses: + '204': + description: Successful case. The resource has been successfully deleted. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/subs-to-notify: + post: + summary: Create a subscription to receive notification of policy data changes + operationId: CreateIndividualPolicyDataSubscription + tags: + - PolicyDataSubscriptions (Collection) + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyDataSubscription' + responses: + '201': + description: Upon success, a response body containing a representation of each Individual subscription resource shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyDataSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + policyDataChangeNotification: + '{$request.body#/notificationUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PolicyDataChangeNotification' + minItems: 1 + responses: + '204': + description: No Content, Notification was successful + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/subs-to-notify/{subsId}: + parameters: + - name: subsId + in: path + required: true + schema: + type: string + put: + summary: Modify a subscription to receive notification of policy data changes + operationId: ReplaceIndividualPolicyDataSubscription + tags: + - IndividualPolicyDataSubscription (Document) + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyDataSubscription' + responses: + '200': + description: The individual subscription resource was updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyDataSubscription' + '204': + description: The individual subscription resource was updated successfully and no additional content is to be sent in the response message. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete the individual Policy Data subscription + operationId: DeleteIndividualPolicyDataSubscription + tags: + - IndividualPolicyDataSubscription (Document) + responses: + '204': + description: Upon success, an empty response body shall be returned. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/ues/{ueId}/operator-specific-data: + get: + summary: Retrieve the operator specific policy data of an UE + operationId: ReadOperatorSpecificData + tags: + - OperatorSpecificData (Document) + parameters: + - name: ueId + in: path + description: UE Id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + - name: supp-feat + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: object + additionalProperties: + $ref: 'TS29505_Subscription_Data.yaml#/components/schemas/OperatorSpecificDataContainer' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Modify the operator specific policy data of an UE + operationId: UpdateOperatorSpecificData + tags: + - OperatorSpecificData (Document) + parameters: + - name: ueId + in: path + description: UE Id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: No content. Response to successful modification. + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + summary: Modify the operator specific policy data of an UE + operationId: ReplaceOperatorSpecificData + tags: + - OperatorSpecificData (Document) + parameters: + - name: ueId + in: path + description: UE Id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: + $ref: 'TS29505_Subscription_Data.yaml#/components/schemas/OperatorSpecificDataContainer' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: + $ref: 'TS29505_Subscription_Data.yaml#/components/schemas/OperatorSpecificDataContainer' + '204': + description: The resource has been successfully updated. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /policy-data/plmns/{plmnId}/ue-policy-set: + parameters: + - name: plmnId + in: path + required: true + schema: + $ref: 'TS29505_Subscription_Data.yaml#/components/schemas/VarPlmnId' + get: + summary: Retrieve the UE policy set data for an H-PLMN + operationId: ReadPlmnUePolicySet + tags: + - PlmnUePolicySet (Document) + responses: + '200': + description: Upon success, a response body containing UE policies shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/UePolicySet' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '412': + $ref: 'TS29571_CommonData.yaml#/components/responses/412' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +components: + schemas: + AmPolicyData: + description: Contains the AM policy data for a given subscriber. + type: object + properties: + praInfos: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 1 + subscCats: + type: array + items: + type: string + minItems: 1 + UePolicySet: + description: Contains the UE policy data for a given subscriber. + type: object + properties: + praInfos: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 1 + subscCats: + type: array + items: + type: string + minItems: 1 + uePolicySections: + type: object + additionalProperties: + $ref: '#/components/schemas/UePolicySection' + minProperties: 1 + upsis: + type: array + items: + type: string + minItems: 1 + allowedRouteSelDescs: + type: object + additionalProperties: + $ref: '#/components/schemas/PlmnRouteSelectionDescriptor' + minProperties: 1 + andspInd: + type: boolean + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + osIds: + type: array + items: + $ref: '#/components/schemas/OsId' + minItems: 1 + UePolicySetPatch: + description: Contains the UE policy set for a given subscriber. + type: object + properties: + uePolicySections: + type: object + additionalProperties: + $ref: '#/components/schemas/UePolicySection' + minProperties: 1 + upsis: + type: array + items: + type: string + minItems: 1 + andspInd: + type: boolean + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + osIds: + type: array + items: + $ref: '#/components/schemas/OsId' + minItems: 1 + UePolicySection: + description: Contains the UE policy section. + type: object + properties: + uePolicySectionInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + upsi: + type: string + required: + - uePolicySectionInfo + - upsi + SmPolicyData: + description: Contains the SM policy data for a given subscriber. + type: object + properties: + smPolicySnssaiData: + type: object + additionalProperties: + $ref: '#/components/schemas/SmPolicySnssaiData' + minProperties: 1 + umDataLimits: + type: object + additionalProperties: + $ref: '#/components/schemas/UsageMonDataLimit' + minProperties: 1 + umData: + type: object + additionalProperties: + $ref: '#/components/schemas/UsageMonData' + minProperties: 1 + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - smPolicySnssaiData + SmPolicySnssaiData: + description: Contains the SM policy data for a given subscriber and S-NSSAI. + type: object + properties: + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + smPolicyDnnData: + type: object + additionalProperties: + $ref: '#/components/schemas/SmPolicyDnnData' + minProperties: 1 + required: + - snssai + SmPolicyDnnData: + description: Contains the SM policy data for a given DNN (and S-NSSAI). + type: object + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + allowedServices: + type: array + items: + type: string + minItems: 1 + subscCats: + type: array + items: + type: string + minItems: 1 + gbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + gbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + adcSupport: + type: boolean + subscSpendingLimits: + type: boolean + ipv4Index: + $ref: '#/components/schemas/IpIndex' + ipv6Index: + $ref: '#/components/schemas/IpIndex' + offline: + type: boolean + online: + type: boolean + chfInfo: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/ChargingInformation' + refUmDataLimitIds: + type: object + additionalProperties: + $ref: '#/components/schemas/LimitIdToMonitoringKey' + minProperties: 1 + mpsPriority: + type: boolean + mcsPriority: + type: boolean + imsSignallingPrio: + type: boolean + mpsPriorityLevel: + type: integer + mcsPriorityLevel: + type: integer + praInfos: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 1 + bdtRefIds: + type: object + additionalProperties: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceIdRm' + minProperties: 1 + nullable: true + required: + - dnn + UsageMonDataLimit: + description: Contains usage monitoring control data for a subscriber. + type: object + properties: + limitId: + type: string + scopes: + type: object + additionalProperties: + $ref: '#/components/schemas/UsageMonDataScope' + minProperties: 1 + umLevel: + $ref: '#/components/schemas/UsageMonLevel' + startDate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + endDate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + usageLimit: + $ref: 'TS29122_CommonData.yaml#/components/schemas/UsageThreshold' + resetPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - limitId + UsageMonData: + description: Contains remain allowed usage data for a subscriber. + type: object + properties: + limitId: + type: string + scopes: + type: object + additionalProperties: + $ref: '#/components/schemas/UsageMonDataScope' + minProperties: 1 + umLevel: + $ref: '#/components/schemas/UsageMonLevel' + allowedUsage: + $ref: 'TS29122_CommonData.yaml#/components/schemas/UsageThreshold' + resetTime: + $ref: '#/components/schemas/TimePeriod' + required: + - limitId + LimitIdToMonitoringKey: + description: Contains the limit identifier and the corresponding monitoring key for a given S-NSSAI and DNN. + type: object + properties: + limitId: + type: string + monkey: + type: array + items: + type: string + minItems: 1 + required: + - limitId + nullable: true + UsageMonDataScope: + description: Contains a SNSSAI and DNN combinations to which the UsageMonData instance belongs to. + type: object + properties: + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + required: + - snssai + TimePeriod: + description: Contains the periodicity for the defined usage monitoring data limits. + type: object + properties: + period: + $ref: '#/components/schemas/Periodicity' + maxNumPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + required: + - period + SponsorConnectivityData: + description: Contains the sponsored data connectivity related information for a sponsor identifier. + type: object + properties: + aspIds: + type: array + items: + type: string + required: + - aspIds + BdtData: + description: Contains the background data transfer data. + type: object + properties: + aspId: + type: string + transPolicy: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/TransferPolicy' + bdtRefId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + nwAreaInfo: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + numOfUes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + volPerUe: + $ref: 'TS29122_CommonData.yaml#/components/schemas/UsageThreshold' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + required: + - aspId + - transPolicy + PolicyDataSubscription: + description: Identifies a subscription to policy data change notification. + type: object + properties: + notificationUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + notifId: + type: string + monitoredResourceUris: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + monResItems: + type: array + items: + $ref: '#/components/schemas/ResourceItem' + minItems: 1 + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - notificationUri + - monitoredResourceUris + PolicyDataChangeNotification: + description: Contains changed policy data for which notification was requested. + type: object + properties: + amPolicyData: + $ref: '#/components/schemas/AmPolicyData' + uePolicySet: + $ref: '#/components/schemas/UePolicySet' + plmnUePolicySet: + $ref: '#/components/schemas/UePolicySet' + smPolicyData: + $ref: '#/components/schemas/SmPolicyData' + usageMonData: + $ref: '#/components/schemas/UsageMonData' + SponsorConnectivityData: + $ref: '#/components/schemas/SponsorConnectivityData' + bdtData: + $ref: '#/components/schemas/BdtData' + opSpecData: + $ref: 'TS29505_Subscription_Data.yaml#/components/schemas/OperatorSpecificDataContainer' + ueId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + sponsorId: + type: string + bdtRefId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + usageMonId: + type: string + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + delResources: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + notifId: + type: string + reportedFragments: + type: array + items: + $ref: '#/components/schemas/NotificationItem' + minItems: 1 + PlmnRouteSelectionDescriptor: + description: Contains the route selection descriptors (combinations of SNSSAI, DNNs, PDU session types, and SSC modes) allowed by subscription to the UE for a serving PLMN + type: object + properties: + servingPlmn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + snssaiRouteSelDescs: + type: array + items: + $ref: '#/components/schemas/SnssaiRouteSelectionDescriptor' + minItems: 1 + required: + - servingPlmn + SnssaiRouteSelectionDescriptor: + description: Contains the route selector parameters (DNNs, PDU session types and SSC modes) per SNSSAI + type: object + properties: + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnnRouteSelDescs: + type: array + items: + $ref: '#/components/schemas/DnnRouteSelectionDescriptor' + minItems: 1 + required: + - snssai + DnnRouteSelectionDescriptor: + description: Contains the route selector parameters (PDU session types and SSC modes) per DNN + type: object + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + sscModes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SscMode' + minItems: 1 + pduSessTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + minItems: 1 + required: + - dnn + SmPolicyDataPatch: + description: Contains the SM policy data for a given subscriber. + type: object + properties: + umData: + type: object + additionalProperties: + $ref: '#/components/schemas/UsageMonData' + minProperties: 1 + nullable: true + smPolicySnssaiData: + type: object + additionalProperties: + $ref: '#/components/schemas/SmPolicySnssaiDataPatch' + minProperties: 1 + SmPolicySnssaiDataPatch: + description: Contains the SM policy data for a given subscriber and S-NSSAI. + type: object + properties: + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + smPolicyDnnData: + type: object + additionalProperties: + $ref: '#/components/schemas/SmPolicyDnnDataPatch' + minProperties: 1 + required: + - snssai + SmPolicyDnnDataPatch: + description: Contains the SM policy data for a given DNN (and S-NSSAI). + type: object + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + bdtRefIds: + type: object + additionalProperties: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceIdRm' + minProperties: 1 + nullable: true + required: + - dnn +# + ResourceItem: + description: Identifies a subscription to policy data change notification when the change occurs in a fragment (subset of resource data) of a given resource. + type: object + properties: + monResourceUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + items: + type: array + items: + $ref: '#/components/schemas/ItemPath' + minItems: 1 + required: + - monResourceUri + - items +# + + NotificationItem: + description: Identifies a data change notification when the change occurs in a fragment (subset of resource data) of a given resource. + type: object + properties: + resourceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + notifItems: + type: array + items: + $ref: '#/components/schemas/UpdatedItem' + minItems: 1 + required: + - resourceId + - notifItems +# + UpdatedItem: + description: Identifies a fragment of a resource. + type: object + properties: + item: + $ref: '#/components/schemas/ItemPath' +# value: {} + value: + type: string + required: + - item + - value +# + + IpIndex: + type: integer + OsId: + type: string + format: uuid + UsageMonLevel: + anyOf: + - type: string + enum: + - SESSION_LEVEL + - SERVICE_LEVEL + - type: string + Periodicity: + anyOf: + - type: string + enum: + - YEARLY + - MONTHLY + - WEEKLY + - DAILY + - HOURLY + - type: string +# + + ItemPath: + description: Identifies a fragment (subset of resource data) of a given resource. + type: string diff --git a/lib/sbi/support/3gpp-spec/TS29522_IPTVConfiguration.yaml b/lib/sbi/support/modified/TS29522_IPTVConfiguration.yaml similarity index 99% rename from lib/sbi/support/3gpp-spec/TS29522_IPTVConfiguration.yaml rename to lib/sbi/support/modified/TS29522_IPTVConfiguration.yaml index 28ce13045e..4cca2e002b 100644 --- a/lib/sbi/support/3gpp-spec/TS29522_IPTVConfiguration.yaml +++ b/lib/sbi/support/modified/TS29522_IPTVConfiguration.yaml @@ -4,7 +4,7 @@ info: version: 1.0.0.alpha-2 description: | API for IPTV configuration. - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. externalDocs: description: 3GPP TS 29.522 V16.3.0; 5G System; Network Exposure Function Northbound APIs. diff --git a/lib/sbi/support/3gpp-spec/TS29522_ServiceParameter.yaml b/lib/sbi/support/modified/TS29522_ServiceParameter.yaml similarity index 99% rename from lib/sbi/support/3gpp-spec/TS29522_ServiceParameter.yaml rename to lib/sbi/support/modified/TS29522_ServiceParameter.yaml index 8b7a71eb42..78c6f623f0 100644 --- a/lib/sbi/support/3gpp-spec/TS29522_ServiceParameter.yaml +++ b/lib/sbi/support/modified/TS29522_ServiceParameter.yaml @@ -4,7 +4,7 @@ info: version: 1.0.0.alpha-1 description: | API for AF service paramter - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. externalDocs: description: 3GPP TS 29.522 V16.3.0; 5G System; Network Exposure Function Northbound APIs. diff --git a/lib/sbi/support/3gpp-spec/TS29522_TrafficInfluence.yaml b/lib/sbi/support/modified/TS29522_TrafficInfluence.yaml similarity index 99% rename from lib/sbi/support/3gpp-spec/TS29522_TrafficInfluence.yaml rename to lib/sbi/support/modified/TS29522_TrafficInfluence.yaml index 670d660fcb..b67851f691 100644 --- a/lib/sbi/support/3gpp-spec/TS29522_TrafficInfluence.yaml +++ b/lib/sbi/support/modified/TS29522_TrafficInfluence.yaml @@ -4,7 +4,7 @@ info: version: 1.1.0.alpha-4 description: | API for AF traffic influence - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. externalDocs: description: 3GPP TS 29.522 V16.3.0; 5G System; Network Exposure Function Northbound APIs. diff --git a/lib/sbi/support/modified/TS29544_Nspaf_SecuredPacket.yaml b/lib/sbi/support/modified/TS29544_Nspaf_SecuredPacket.yaml new file mode 100644 index 0000000000..f7ff542fe7 --- /dev/null +++ b/lib/sbi/support/modified/TS29544_Nspaf_SecuredPacket.yaml @@ -0,0 +1,93 @@ +openapi: 3.0.0 +info: + title: 'Nspaf_SecuredPacket' + version: 1.0.0.alpha-2 + description: | + Nspaf Secured Packet Service. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.544, SP-AF Services, version 16.0.0 + url: http://www.3gpp.org/ftp/Specs/archive/29_series/29.544/ +servers: + - url: '{apiRoot}/nspaf-secured-packet/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 +security: + - {} + - oAuth2ClientCredentials: + - nspaf-secured-packet +paths: + /{supi}/provide-secured-packet: + post: + summary: request generation of a secured packet + operationId: ProvideSecuredPacket + tags: + - SecuredPacket Generation (Custom Operation) + parameters: + - name: supi + in: path + description: SUPI of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UiccConfigurationParameter' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SecuredPacket' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nspaf-secured-packet: Access to the nspaf-secured-packet API + schemas: + +# COMPLEX TYPES: + + UiccConfigurationParameter: + type: object + properties: + routingId: + $ref: '#/components/schemas/RoutingId' + steeringContainer: + type: array + items: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SteeringInfo' + minItems: 1 + +# SIMPLE TYPES: + + RoutingId: + type: string + pattern: '^[0-9]{1,4}$' + +# ENUMS: + + + diff --git a/lib/sbi/support/3gpp-spec/TS29551_Nnef_PFDmanagement.yaml b/lib/sbi/support/modified/TS29551_Nnef_PFDmanagement.yaml similarity index 99% rename from lib/sbi/support/3gpp-spec/TS29551_Nnef_PFDmanagement.yaml rename to lib/sbi/support/modified/TS29551_Nnef_PFDmanagement.yaml index 9aab995263..0b37836857 100644 --- a/lib/sbi/support/3gpp-spec/TS29551_Nnef_PFDmanagement.yaml +++ b/lib/sbi/support/modified/TS29551_Nnef_PFDmanagement.yaml @@ -4,7 +4,7 @@ info: version: 1.1.0.alpha-3 description: | Packet Flow Description Management Service. - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. # externalDocs: diff --git a/lib/sbi/support/3gpp-spec/TS29554_Npcf_BDTPolicyControl.yaml b/lib/sbi/support/modified/TS29554_Npcf_BDTPolicyControl.yaml similarity index 99% rename from lib/sbi/support/3gpp-spec/TS29554_Npcf_BDTPolicyControl.yaml rename to lib/sbi/support/modified/TS29554_Npcf_BDTPolicyControl.yaml index 038fe7aa27..a6ead04e64 100644 --- a/lib/sbi/support/3gpp-spec/TS29554_Npcf_BDTPolicyControl.yaml +++ b/lib/sbi/support/modified/TS29554_Npcf_BDTPolicyControl.yaml @@ -4,7 +4,7 @@ info: version: 1.1.0.alpha-4 description: | PCF BDT Policy Control Service. - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. # externalDocs: diff --git a/lib/sbi/support/modified/TS29571_CommonData.yaml b/lib/sbi/support/modified/TS29571_CommonData.yaml index 1c5b067449..e6cea161ca 100644 --- a/lib/sbi/support/modified/TS29571_CommonData.yaml +++ b/lib/sbi/support/modified/TS29571_CommonData.yaml @@ -1,1916 +1,2404 @@ -openapi: 3.0.0 -info: - version: '1.2.0.alpha-1' - title: 'Common Data Types' - description: | - Common Data Types for Service Based Interfaces. - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. -externalDocs: - description: 3GPP TS 29.571 Common Data Types for Service Based Interfaces, version 16.0.0 interim - url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.571/' - -paths: {} -components: - schemas: - -# -# Common Data Types for Generic usage definitiones as defined in subclause 5.2 -# - -# -# COMMON SIMPLE DATA TYPES -# - Binary: - format: binary - type: string - BinaryRm: - format: binary - type: string - nullable: true - Bytes: - format: byte - type: string - BytesRm: - format: byte - type: string - nullable: true - Date: - format: date - type: string - DateRm: - format: date - type: string - nullable: true - DateTime: - format: date-time - type: string - DateTimeRm: - format: date-time - type: string - nullable: true - DiameterIdentity: - type: string - pattern: '^([A-Za-z0-9]+([-A-Za-z0-9]+)\.)+[a-z]{2,}$' - DiameterIdentityRm: - type: string - pattern: '^([A-Za-z0-9]+([-A-Za-z0-9]+)\.)+[a-z]{2,}$' - nullable: true - Double: - format: double - type: number - DoubleRm: - format: double - type: number - nullable: true - DurationSec: - type: integer - DurationSecRm: - type: integer - nullable: true - Float: - format: float - type: number - FloatRm: - format: float - type: number - nullable: true - Int32: - format: int32 - type: integer - Int32Rm: - format: int32 - type: integer - nullable: true - Int64: - type: integer - format: int64 - Int64Rm: - format: int64 - type: integer - nullable: true - Ipv4Addr: - type: string - pattern: '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$' - example: '198.51.100.1' - Ipv4AddrRm: - type: string - pattern: '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$' - example: '198.51.100.1' - nullable: true - Ipv6Addr: - type: string -# allOf: -# - pattern: '^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))$' -# - pattern: '^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))$' - example: '2001:db8:85a3::8a2e:370:7334' - Ipv6AddrRm: - type: string -# allOf: -# - pattern: '^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))$' -# - pattern: '^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))$' - example: '2001:db8:85a3::8a2e:370:7334' - nullable: true - Ipv6Prefix: - type: string -# allOf: -# - pattern: '^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))(\/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))$' -# - pattern: '^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))(\/.+)$' - example: '2001:db8:abcd:12::0/64' - Ipv6PrefixRm: - type: string -# allOf: -# - pattern: '^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))(\/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))$' -# - pattern: '^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))(\/.+)$' - nullable: true - MacAddr48: - type: string - pattern: '^([0-9a-fA-F]{2})((-[0-9a-fA-F]{2}){5})$' - MacAddr48Rm: - type: string - pattern: '^([0-9a-fA-F]{2})((-[0-9a-fA-F]{2}){5})$' - nullable: true - SupportedFeatures: - type: string - pattern: '^[A-Fa-f0-9]*$' - Uinteger: - type: integer - minimum: 0 - UintegerRm: - type: integer - minimum: 0 - nullable: true - Uint16: - type: integer - minimum: 0 - maximum: 65535 - Uint16Rm: - type: integer - minimum: 0 - maximum: 65535 - nullable: true - Uint32: - format: int32 - type: integer - minimum: 0 - Uint32Rm: - format: int32 - type: integer - minimum: 0 - nullable: true - Uint64: - format: int64 - type: integer - minimum: 0 - Uint64Rm: - format: int64 - type: integer - minimum: 0 - nullable: true - Uri: - type: string - UriRm: - type: string - nullable: true - VarUeId: - type: string - pattern: '^(imsi-[0-9]{5,15}|nai-.+|msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|.+)$' - VarUeIdRm: - type: string - pattern: '^(imsi-[0-9]{5,15}|nai-.+|msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|.+)$' - nullable: true - TimeZone: - type: string - TimeZoneRm: - type: string - nullable: true - -# -# COMMON ENUMERATED DATA TYPES -# - - PatchOperation: -# anyOf: -# - type: string - enum: - - add - - copy - - move - - remove - - replace - - test - type: string - UriScheme: -# anyOf: -# - type: string - enum: - - http - - https - type: string - ChangeType: -# anyOf: -# - type: string - enum: - - ADD - - MOVE - - REMOVE - - REPLACE - type: string - -# -# COMMON STRUCTURED DATA TYPES -# - - ProblemDetails: - type: object - properties: - type: - $ref: '#/components/schemas/Uri' - title: - type: string - status: - type: integer - detail: - type: string - instance: - $ref: '#/components/schemas/Uri' - cause: - type: string - invalidParams: - type: array - items: - $ref: '#/components/schemas/InvalidParam' - minItems: 1 - supportedFeatures: - $ref: '#/components/schemas/SupportedFeatures' - Link: - type: object - properties: - href: - $ref: '#/components/schemas/Uri' - LinkRm: - type: object - properties: - href: - $ref: '#/components/schemas/Uri' - nullable: true - PatchItem: - type: object - properties: - op: - $ref: '#/components/schemas/PatchOperation' - path: - type: string - from: - type: string - value: - nullable: true - type: string - required: - - op - - path - LinksValueSchema: - oneOf: - - type: array - items: - $ref: '#/components/schemas/Link' - minItems: 1 - - $ref: '#/components/schemas/Link' - SelfLink: - type: object - properties: - self: - $ref: '#/components/schemas/Link' - required: - - self - InvalidParam: - type: object - properties: - param: - type: string - reason: - type: string - required: - - param - ChangeItem: - type: object - properties: - op: - $ref: '#/components/schemas/ChangeType' - path: - type: string - from: - type: string -# origValue: {} -# newValue: {} - origValue: - type: string - newValue: - type: string - required: - - op - - path - NotifyItem: - type: object - required: - - resourceId - - changes - properties: - resourceId: - $ref: '#/components/schemas/Uri' - changes: - type: array - items: - $ref: '#/components/schemas/ChangeItem' - minItems: 1 - ComplexQuery: - oneOf: - - $ref: '#/components/schemas/Cnf' - - $ref: '#/components/schemas/Dnf' - Cnf: - type: object - required: - - cnfUnits - properties: - cnfUnits: - type: array - items: - $ref: '#/components/schemas/CnfUnit' - minItems: 1 - Dnf: - type: object - required: - - dnfUnits - properties: - dnfUnits: - type: array - items: - $ref: '#/components/schemas/DnfUnit' - minItems: 1 - CnfUnit: - type: object - required: - - cnfUnit - properties: - cnfUnit: - type: array - items: - $ref: '#/components/schemas/Atom' - minItems: 1 - DnfUnit: - type: object - required: - - dnfUnit - properties: - dnfUnit: - type: array - items: - $ref: '#/components/schemas/Atom' - minItems: 1 - Atom: - type: object - required: - - attr - - value - properties: - attr: - type: string -# value: {} - value: - type: string - negative: - type: boolean - NFDiscFactors: - type: object - properties: - targetNfType: - $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' - requesterNfType: - $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' - serviceNames: - type: array - items: - $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' - minItems: 1 - uniqueItems: true - requesterNfInstanceFqdn: - $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/Fqdn' - targetPlmnList: - type: array - items: - $ref: '#/components/schemas/PlmnId' - minItems: 1 - requesterPlmnList: - type: array - items: - $ref: '#/components/schemas/PlmnId' - minItems: 1 - targetNfInstanceId: - $ref: '#/components/schemas/NfInstanceId' - targetNfFqdn: - $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/Fqdn' - hnrfUri: - $ref: '#/components/schemas/Uri' - snssais: - type: array - items: - $ref: '#/components/schemas/Snssai' - minItems: 1 - plmnSpecificSnssaiList: - type: array - items: - $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/PlmnSnssai' - minItems: 1 - dnn: - $ref: '#/components/schemas/Dnn' - nsiList: - type: array - items: - type: string - minItems: 1 - tai: - $ref: '#/components/schemas/Tai' - amfRegionId: - $ref: '#/components/schemas/AmfRegionId' - amfSetId: - $ref: '#/components/schemas/AmfSetId' - guami: - $ref: '#/components/schemas/Guami' - supi: - $ref: '#/components/schemas/Supi' - ueIpv4Address: - $ref: '#/components/schemas/Ipv4Addr' - ipDomain: - type: string - ueIpv6Prefix: - $ref: '#/components/schemas/Ipv6Prefix' - pgwInd: - type: boolean - pgw: - $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/Fqdn' - gpsi: - $ref: '#/components/schemas/Gpsi' - externalGroupIdentity: - type: string - dataSet: - $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/DataSetId' - routingIndicator: - type: string - pattern: '^[0-9]{1,4}$' - groupIdList: - type: array - items: - $ref: '#/components/schemas/NfGroupId' - minItems: 1 - dnaiList: - type: array - items: - $ref: '#/components/schemas/Dnai' - minItems: 1 - pduSessionTypes: - type: array - items: - $ref: '#/components/schemas/PduSessionType' - minItems: 1 - upfIwkEpsInd: - type: boolean - chfSupportedPlmn: - $ref: '#/components/schemas/PlmnId' - preferredLocality: - type: string - accessType: - $ref: '#/components/schemas/AccessType' - requiredFeatures: - type: array - items: - $ref: '#/components/schemas/SupportedFeatures' - minItems: 1 - complexQuery: - $ref: '#/components/schemas/ComplexQuery' - - - - -# -# Data Types related to Subscription, Identification and Numbering as defined in subclause 5.3 -# - -# -# SIMPLE DATA TYPES -# - Dnn: - type: string - DnnRm: - type: string - nullable: true - Gpsi: - type: string - pattern: '^(msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|.+)$' - GpsiRm: - type: string - pattern: '^(msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|.+)$' - nullable: true - GroupId: - type: string - pattern: '^[A-Fa-f0-9]{8}-[0-9]{3}-[0-9]{2,3}-([A-Fa-f0-9][A-Fa-f0-9]){1,10}$' - GroupIdRm: - type: string - pattern: '^[A-Fa-f0-9]{8}-[0-9]{3}-[0-9]{2,3}-([A-Fa-f0-9][A-Fa-f0-9]){1,10}$' - nullable: true - Pei: - type: string - pattern: '^(imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' - PeiRm: - type: string - pattern: '^(imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' - nullable: true - Supi: - type: string - pattern: '^(imsi-[0-9]{5,15}|nai-.+|.+)$' - SupiRm: - type: string - pattern: '^(imsi-[0-9]{5,15}|nai-.+|.+)$' - nullable: true - NfInstanceId: - type: string - format: uuid - AmfId: - type: string - pattern: '^[A-Fa-f0-9]{6}$' - AmfRegionId: - type: string - pattern: '^[A-Fa-f0-9]{2}$' - AmfSetId: - type: string - pattern: '^[0-3][A-Fa-f0-9]{2}$' - RfspIndex: - type: integer - minimum: 1 - maximum: 256 - RfspIndexRm: - type: integer - minimum: 1 - maximum: 256 - nullable: true - NfGroupId: - type: string - MtcProviderInformation: - type: string - -# -# STRUCTURED DATA TYPES -# - Guami: - type: object - properties: - plmnId: - $ref: '#/components/schemas/PlmnId' - amfId: - $ref: '#/components/schemas/AmfId' - required: - - plmnId - - amfId - GuamiRm: - type: object - properties: - plmnId: - $ref: '#/components/schemas/PlmnId' - amfId: - $ref: '#/components/schemas/AmfId' - required: - - plmnId - - amfId - nullable: true - NetworkId: - type: object - properties: - mnc: - $ref: '#/components/schemas/Mnc' - mcc: - $ref: '#/components/schemas/Mcc' - - -# -# Data Types related to 5G Network as defined in subclause 5.4 -# - -# -# SIMPLE DATA TYPES -# - ApplicationId: - type: string - ApplicationIdRm: - type: string - nullable: true - PduSessionId: - type: integer - minimum: 0 - maximum: 255 - Mcc: - type: string - pattern: '^\d{3}$' - MccRm: - type: string - pattern: '^\d{3}$' - nullable: true - Mnc: - type: string - pattern: '^\d{2,3}$' - MncRm: - type: string - pattern: '^\d{2,3}$' - nullable: true - Tac: - type: string - pattern: '(^[A-Fa-f0-9]{4}$)|(^[A-Fa-f0-9]{6}$)' - TacRm: - type: string - pattern: '(^[A-Fa-f0-9]{4}$)|(^[A-Fa-f0-9]{6}$)' - nullable: true - EutraCellId: - type: string - pattern: '^[A-Fa-f0-9]{7}$' - EutraCellIdRm: - type: string - pattern: '^[A-Fa-f0-9]{7}$' - nullable: true - NrCellId: - type: string - pattern: '^[A-Fa-f0-9]{9}$' - NrCellIdRm: - type: string - pattern: '^[A-Fa-f0-9]{9}$' - nullable: true - Dnai: - type: string - DnaiRm: - type: string - nullable: true - 5GMmCause: - $ref: '#/components/schemas/Uinteger' - AmfName: - type: string - AreaCode: - type: string - AreaCodeRm: - type: string - nullable: true - N3IwfId: - type: string - pattern: '^[A-Fa-f0-9]+$' - NgeNbId: - type: string - pattern: '^(MacroNGeNB-[A-Fa-f0-9]{5}|LMacroNGeNB-[A-Fa-f0-9]{6}|SMacroNGeNB-[A-Fa-f0-9]{5})$' - -# -# ENUMERATED DATA TYPES -# - - AccessType: - type: string - enum: - - 3GPP_ACCESS - - NON_3GPP_ACCESS - AccessTypeRm: - type: string - enum: - - 3GPP_ACCESS - - NON_3GPP_ACCESS - nullable: true - RatType: - anyOf: - - type: string - enum: - - NR - - EUTRA - - WLAN - - VIRTUAL - - NBIOT - - type: string - RatTypeRm: - anyOf: - - type: string - enum: - - NR - - EUTRA - - WLAN - - VIRTUAL - - NBIOT - - type: string - nullable: true - PduSessionType: - anyOf: - - type: string - enum: - - IPV4 - - IPV6 - - IPV4V6 - - UNSTRUCTURED - - ETHERNET - - type: string - PduSessionTypeRm: - anyOf: - - type: string - enum: - - IPV4 - - IPV6 - - IPV4V6 - - UNSTRUCTURED - - ETHERNET - - type: string - nullable: true - UpIntegrity: - anyOf: - - type: string - enum: - - REQUIRED - - PREFERRED - - NOT_NEEDED - - type: string - UpIntegrityRm: - anyOf: - - type: string - enum: - - REQUIRED - - PREFERRED - - NOT_NEEDED - - type: string - nullable: true - UpConfidentiality: - anyOf: - - type: string - enum: - - REQUIRED - - PREFERRED - - NOT_NEEDED - - type: string - UpConfidentialityRm: - anyOf: - - type: string - enum: - - REQUIRED - - PREFERRED - - NOT_NEEDED - - type: string - nullable: true - SscMode: - anyOf: - - type: string - enum: - - SSC_MODE_1 - - SSC_MODE_2 - - SSC_MODE_3 - - type: string - SscModeRm: - anyOf: - - type: string - enum: - - SSC_MODE_1 - - SSC_MODE_2 - - SSC_MODE_3 - - type: string - nullable: true - DnaiChangeType: - anyOf: - - type: string - enum: - - EARLY - - EARLY_LATE - - LATE - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - EARLY: Early notification of UP path reconfiguration. - - EARLY_LATE: Early and late notification of UP path reconfiguration. This value shall only be present in the subscription to the DNAI change event. - - LATE: Late notification of UP path reconfiguration. - DnaiChangeTypeRm: - anyOf: - - type: string - enum: - - EARLY - - EARLY_LATE - - LATE - - type: string - nullable: true - RestrictionType: - anyOf: - - type: string - enum: - - ALLOWED_AREAS - - NOT_ALLOWED_AREAS - - type: string - RestrictionTypeRm: - anyOf: - - type: string - enum: - - ALLOWED_AREAS - - NOT_ALLOWED_AREAS - - type: string - nullable: true - CoreNetworkType: - anyOf: - - type: string - enum: - - 5GC - - EPC - - type: string - CoreNetworkTypeRm: - anyOf: - - type: string - enum: - - 5GC - - EPC - - type: string - nullable: true - PresenceState: - anyOf: - - type: string - enum: - - IN_AREA - - OUT_OF_AREA - - UNKNOWN - - INACTIVE - - type: string - -# -# STRUCTURED DATA TYPES -# - - Snssai: - type: object - properties: - sst: - type: integer - minimum: 0 - maximum: 255 - sd: - type: string - pattern: '^[A-Fa-f0-9]{6}$' - required: - - sst - PlmnId: - type: object - properties: - mcc: - $ref: '#/components/schemas/Mcc' - mnc: - $ref: '#/components/schemas/Mnc' - required: - - mcc - - mnc - PlmnIdRm: - type: object - properties: - mcc: - $ref: '#/components/schemas/Mcc' - mnc: - $ref: '#/components/schemas/Mnc' - required: - - mcc - - mnc - nullable: true - Tai: - type: object - properties: - plmnId: - $ref: '#/components/schemas/PlmnId' - tac: - $ref: '#/components/schemas/Tac' - required: - - plmnId - - tac - TaiRm: - type: object - properties: - plmnId: - $ref: '#/components/schemas/PlmnId' - tac: - $ref: '#/components/schemas/Tac' - required: - - plmnId - - tac - nullable: true - Ecgi: - type: object - properties: - plmnId: - $ref: '#/components/schemas/PlmnId' - # PLMN Identity - eutraCellId: - $ref: '#/components/schemas/EutraCellId' - required: - - plmnId - - eutraCellId - EcgiRm: - type: object - properties: - plmnId: - $ref: '#/components/schemas/PlmnId' - # PLMN Identity - eutraCellId: - $ref: '#/components/schemas/EutraCellId' - required: - - plmnId - - eutraCellId - nullable: true - Ncgi: - type: object - properties: - plmnId: - $ref: '#/components/schemas/PlmnId' - nrCellId: - $ref: '#/components/schemas/NrCellId' - required: - - plmnId - - nrCellId - NcgiRm: - type: object - properties: - plmnId: - $ref: '#/components/schemas/PlmnId' - nrCellId: - $ref: '#/components/schemas/NrCellId' - required: - - plmnId - - nrCellId - nullable: true - UserLocation: - type: object - properties: - eutraLocation: - $ref: '#/components/schemas/EutraLocation' - nrLocation: - $ref: '#/components/schemas/NrLocation' - n3gaLocation: - $ref: '#/components/schemas/N3gaLocation' - EutraLocation: - type: object - properties: - tai: - $ref: '#/components/schemas/Tai' - ecgi: - $ref: '#/components/schemas/Ecgi' - ageOfLocationInformation: - type: integer - minimum: 0 - maximum: 32767 - ueLocationTimestamp: - $ref: '#/components/schemas/DateTime' - geographicalInformation: - type: string - pattern: '^[0-9A-F]{16}$' - geodeticInformation: - type: string - pattern: '^[0-9A-F]{20}$' - globalNgenbId: - $ref: '#/components/schemas/GlobalRanNodeId' - required: - - tai - - ecgi - EutraLocationRm: - type: object - properties: - tai: - $ref: '#/components/schemas/Tai' - ecgi: - $ref: '#/components/schemas/Ecgi' - ageOfLocationInformation: - type: integer - minimum: 0 - maximum: 32767 - ueLocationTimestamp: - $ref: '#/components/schemas/DateTime' - geographicalInformation: - type: string - pattern: '^[0-9A-F]{16}$' - geodeticInformation: - type: string - pattern: '^[0-9A-F]{20}$' - globalNgenbId: - $ref: '#/components/schemas/GlobalRanNodeId' - required: - - tai - - ecgi - nullable: true - NrLocation: - type: object - properties: - tai: - $ref: '#/components/schemas/Tai' - ncgi: - $ref: '#/components/schemas/Ncgi' - ageOfLocationInformation: - type: integer - minimum: 0 - maximum: 32767 - ueLocationTimestamp: - $ref: '#/components/schemas/DateTime' - geographicalInformation: - type: string - pattern: '^[0-9A-F]{16}$' - geodeticInformation: - type: string - pattern: '^[0-9A-F]{20}$' - globalGnbId: - $ref: '#/components/schemas/GlobalRanNodeId' - required: - - tai - - ncgi - NrLocationRm: - type: object - properties: - tai: - $ref: '#/components/schemas/Tai' - ncgi: - $ref: '#/components/schemas/Ncgi' - ageOfLocationInformation: - type: integer - minimum: 0 - maximum: 32767 - ueLocationTimestamp: - $ref: '#/components/schemas/DateTime' - geographicalInformation: - type: string - pattern: '^[0-9A-F]{16}$' - geodeticInformation: - type: string - pattern: '^[0-9A-F]{20}$' - globalGnbId: - $ref: '#/components/schemas/GlobalRanNodeId' - required: - - tai - - ncgi - nullable: true - N3gaLocation: - type: object - properties: - n3gppTai: - $ref: '#/components/schemas/Tai' - n3IwfId: - type: string - pattern: '^[A-Fa-f0-9]+$' - ueIpv4Addr: - $ref: '#/components/schemas/Ipv4Addr' - ueIpv6Addr: - $ref: '#/components/schemas/Ipv6Addr' - portNumber: - $ref: '#/components/schemas/Uinteger' - UpSecurity: - type: object - properties: - upIntegr: - $ref: '#/components/schemas/UpIntegrity' - upConfid: - $ref: '#/components/schemas/UpConfidentiality' - required: - - upIntegr - - upConfid - UpSecurityRm: - type: object - properties: - upIntegr: - $ref: '#/components/schemas/UpIntegrity' - upConfid: - $ref: '#/components/schemas/UpConfidentiality' - required: - - upIntegr - - upConfid - nullable: true - NgApCause: - type: object - properties: - group: - $ref: '#/components/schemas/Uinteger' - value: - $ref: '#/components/schemas/Uinteger' - required: - - group - - value - BackupAmfInfo: - type: object - properties: - backupAmf: - $ref: '#/components/schemas/AmfName' - guamiList: - type: array - items: - $ref: '#/components/schemas/Guami' - minItems: 1 - required: - - backupAmf - RefToBinaryData: - type: object - properties: - contentId: - type: string - required: - - contentId - RefToBinaryDataRm: - type: object - properties: - contentId: - type: string - required: - - contentId - nullable: true - RouteToLocation: - type: object - properties: - dnai: - $ref: '#/components/schemas/Dnai' - routeInfo: - $ref: '#/components/schemas/RouteInformation' - routeProfId: - type: string - nullable: true - required: - - dnai - anyOf: - - required: [ routeInfo ] - - required: [ routeProfId ] - nullable: true - RouteInformation: - type: object - properties: - ipv4Addr: - $ref: '#/components/schemas/Ipv4Addr' - ipv6Addr: - $ref: '#/components/schemas/Ipv6Addr' - portNumber: - $ref: '#/components/schemas/Uinteger' - required: - - portNumber - nullable: true - SubscribedDefaultQos: - type: object - required: - - 5qi - - arp - properties: - 5qi: - $ref: '#/components/schemas/5Qi' - arp: - $ref: '#/components/schemas/Arp' - priorityLevel: - $ref: '#/components/schemas/5QiPriorityLevel' - Area: - type: object - oneOf: - - required: - - tacs - - required: - - areaCode - properties: - tacs: - type: array - items: - $ref: '#/components/schemas/Tac' - minItems: 1 - areaCode: - $ref: '#/components/schemas/AreaCode' - ServiceAreaRestriction: - type: object - properties: - restrictionType: - $ref: '#/components/schemas/RestrictionType' - areas: - type: array - items: - $ref: '#/components/schemas/Area' - maxNumOfTAs: - $ref: '#/components/schemas/Uinteger' - maxNumOfTAsForNotAllowedAreas: - $ref: '#/components/schemas/Uinteger' - allOf: - # - # 1st condition: restrictionType and areas attributes shall be either both absent - # or both present - # - - oneOf: - - not: - required: [ restrictionType ] - - required: [ areas ] - # - # 2nd condition: if restrictionType takes value NOT_ALLOWED_AREAS, - # then maxNumOfTAs shall be absent - # - - anyOf: - - not: - required: [ restrictionType ] - properties: - restrictionType: - type: string - enum: [ NOT_ALLOWED_AREAS ] - - not: - required: [ maxNumOfTAs ] - # - # 3rd condition: if restrictionType takes value ALLOWED_AREAS, - # then maxNumOfTAsForNotAllowedAreas shall be absent - # - - anyOf: - - not: - required: [ restrictionType ] - properties: - restrictionType: - type: string - enum: [ ALLOWED_AREAS ] - - not: - required: [ maxNumOfTAsForNotAllowedAreas ] - PresenceInfo: - type: object - properties: - praId: - type: string - presenceState: - $ref: '#/components/schemas/PresenceState' - trackingAreaList: - type: array - items: - $ref: '#/components/schemas/Tai' - minItems: 1 - ecgiList: - type: array - items: - $ref: '#/components/schemas/Ecgi' - minItems: 1 - ncgiList: - type: array - items: - $ref: '#/components/schemas/Ncgi' - minItems: 1 - globalRanNodeIdList: - type: array - items: - $ref: '#/components/schemas/GlobalRanNodeId' - minItems: 1 - PresenceInfoRm: - type: object - properties: - praId: - type: string - presenceState: - $ref: '#/components/schemas/PresenceState' - trackingAreaList: - type: array - items: - $ref: '#/components/schemas/Tai' - minItems: 0 - ecgiList: - type: array - items: - $ref: '#/components/schemas/Ecgi' - minItems: 0 - ncgiList: - type: array - items: - $ref: '#/components/schemas/Ncgi' - minItems: 0 - globalRanNodeIdList: - type: array - items: - $ref: '#/components/schemas/GlobalRanNodeId' - nullable: true - GlobalRanNodeId: - type: object - properties: - plmnId: - $ref: '#/components/schemas/PlmnId' - n3IwfId: - $ref: '#/components/schemas/N3IwfId' - gNbId: - $ref: '#/components/schemas/GNbId' - ngeNbId: - $ref: '#/components/schemas/NgeNbId' - oneOf: - - required: [ n3IwfId ] - - required: [ gNbId ] - - required: [ ngeNbId ] - required: - - plmnId - GNbId: - type: object - properties: - bitLength: - type: integer - minimum: 22 - maximum: 32 - gNBValue: - type: string - pattern: '^[A-Fa-f0-9]{6,8}$' - required: - - bitLength - - gNBValue - MaPduCapability: - type: object - properties: - atsssLL: - type: boolean - default: false - mptcp: - type: boolean - default: boolean - AtsssCapability: - type: object - properties: - atsssLL: - type: boolean - default: false - mptcp: - type: boolean - default: false - - -# -# Data Types related to 5G QoS as defined in subclause 5.5 -# - -# -# SIMPLE DATA TYPES -# -# - Qfi: - type: integer - minimum: 0 - maximum: 63 - QfiRm: - type: integer - minimum: 0 - maximum: 63 - nullable: true - 5Qi: - type: integer - minimum: 0 - maximum: 255 - 5QiRm: - type: integer - minimum: 0 - maximum: 255 - nullable: true - BitRate: - type: string - pattern: '^\d+(\.\d+)? (bps|Kbps|Mbps|Gbps|Tbps)$' - BitRateRm: - type: string - pattern: '^\d+(\.\d+)? (bps|Kbps|Mbps|Gbps|Tbps)$' - nullable: true - ArpPriorityLevelRm: - type: integer - minimum: 1 - maximum: 15 - nullable: true - ArpPriorityLevel: - type: integer - minimum: 1 - maximum: 15 - nullable: true - description: nullable true shall not be used for this attribute - 5QiPriorityLevel: - type: integer - minimum: 1 - maximum: 127 - 5QiPriorityLevelRm: - type: integer - minimum: 1 - maximum: 127 - nullable: true - PacketDelBudget: - type: integer - minimum: 1 - PacketDelBudgetRm: - type: integer - minimum: 1 - nullable: true - PacketErrRate: - type: string - pattern: '^([0-9]E-[0-9])$' - PacketErrRateRm: - type: string - pattern: '^([0-9]E-[0-9])$' - nullable: true - PacketLossRate: - type: integer - minimum: 0 - maximum: 1000 - PacketLossRateRm: - type: integer - minimum: 0 - maximum: 1000 - nullable: true - AverWindow: - type: integer - minimum: 1 - maximum: 4095 - default: 2000 - AverWindowRm: - type: integer - maximum: 4095 - default: 2000 - minimum: 1 - nullable: true - MaxDataBurstVol: - type: integer - minimum: 1 - maximum: 4095 - MaxDataBurstVolRm: - type: integer - minimum: 1 - maximum: 4095 - nullable: true - SampleRatio: - type: integer - minimum: 1 - maximum: 100 - SampleRatioRm: - type: integer - minimum: 1 - maximum: 100 - nullable: true - -# -# ENUMERATED DATA TYPES -# - - PreemptionCapability: - anyOf: - - type: string - enum: - - NOT_PREEMPT - - MAY_PREEMPT - - type: string - PreemptionCapabilityRm: - anyOf: - - type: string - enum: - - NOT_PREEMPT - - MAY_PREEMPT - - type: string - nullable: true - PreemptionVulnerability: - anyOf: - - type: string - enum: - - NOT_PREEMPTABLE - - PREEMPTABLE - - type: string - PreemptionVulnerabilityRm: - anyOf: - - type: string - enum: - - NOT_PREEMPTABLE - - PREEMPTABLE - - type: string - nullable: true - ReflectiveQoSAttribute: - anyOf: - - type: string - enum: - - RQOS - - NO_RQOS - - type: string - ReflectiveQoSAttributeRm: - anyOf: - - type: string - enum: - - RQOS - - NO_RQOS - - type: string - nullable: true - NotificationControl: - anyOf: - - type: string - enum: - - REQUESTED - - NOT_REQUESTED - - type: string - NotificationControlRm: - anyOf: - - type: string - enum: - - REQUESTED - - NOT_REQUESTED - - type: string - nullable: true - QosResourceType: - anyOf: - - type: string - enum: - - NON_GBR - - NON_CRITICAL_GBR - - CRITICAL_GBR - - type: string - QosResourceTypeRm: - anyOf: - - type: string - enum: - - NON_GBR - - NON_CRITICAL_GBR - - CRITICAL_GBR - - type: string - nullable: true - AdditionalQosFlowInfo: - anyOf: - - type: string - enum: - - MORE_LIKELY - - type: string - nullable: true -# - -# -# STRUCTURED DATA TYPES -# - - Arp: - type: object - properties: - priorityLevel: - $ref: '#/components/schemas/ArpPriorityLevel' - preemptCap: - $ref: '#/components/schemas/PreemptionCapability' - preemptVuln: - $ref: '#/components/schemas/PreemptionVulnerability' - required: - - priorityLevel - - preemptCap - - preemptVuln - ArpRm: - type: object - properties: - priorityLevel: - $ref: '#/components/schemas/ArpPriorityLevel' - preemptCap: - $ref: '#/components/schemas/PreemptionCapability' - preemptVuln: - $ref: '#/components/schemas/PreemptionVulnerability' - required: - - priorityLevel - - preemptCap - - preemptVuln - nullable: true - Ambr: - type: object - properties: - uplink: - $ref: '#/components/schemas/BitRate' - downlink: - $ref: '#/components/schemas/BitRate' - required: - - uplink - - downlink - AmbrRm: - type: object - properties: - uplink: - $ref: '#/components/schemas/BitRate' - downlink: - $ref: '#/components/schemas/BitRate' - required: - - uplink - - downlink - nullable: true - Dynamic5Qi: - type: object - properties: - resourceType: - $ref: '#/components/schemas/QosResourceType' - priorityLevel: - $ref: '#/components/schemas/5QiPriorityLevel' - packetDelayBudget: - $ref: '#/components/schemas/PacketDelBudget' - packetErrRate: - $ref: '#/components/schemas/PacketErrRate' - averWindow: - $ref: '#/components/schemas/AverWindow' - maxDataBurstVol: - $ref: '#/components/schemas/MaxDataBurstVol' - required: - - resourceType - - priorityLevel - - packetDelayBudget - - packetErrRate - NonDynamic5Qi: - type: object - properties: - priorityLevel: - $ref: '#/components/schemas/5QiPriorityLevel' - averWindow: - $ref: '#/components/schemas/AverWindow' - maxDataBurstVol: - $ref: '#/components/schemas/MaxDataBurstVol' - minProperties: 0 - -# -# Data Types related to 5G Trace as defined in subclause 5.6 -# - -# -# SIMPLE DATA TYPES -# -# -# -# Enumerations -# - TraceDepth: - anyOf: - - type: string - enum: - - MINIMUM - - MEDIUM - - MAXIMUM - - MINIMUM_WO_VENDOR_EXTENSION - - MEDIUM_WO_VENDOR_EXTENSION - - MAXIMUM_WO_VENDOR_EXTENSION - - type: string - TraceDepthRm: - anyOf: - - type: string - enum: - - MINIMUM - - MEDIUM - - MAXIMUM - - MINIMUM_WO_VENDOR_EXTENSION - - MEDIUM_WO_VENDOR_EXTENSION - - MAXIMUM_WO_VENDOR_EXTENSION - - type: string - nullable: true -# -# STRUCTURED DATA TYPES -# - TraceData: - type: object - nullable: true - properties: - traceRef: - type: string - pattern: '^[0-9]{3}[0-9]{2,3}-[A-Fa-f0-9]{6}$' - traceDepth: - $ref: '#/components/schemas/TraceDepth' - neTypeList: - type: string - pattern: '^[A-Fa-f0-9]+$' - eventList: - type: string - pattern: '^[A-Fa-f0-9]+$' - collectionEntityIpv4Addr: - $ref: '#/components/schemas/Ipv4Addr' - collectionEntityIpv6Addr: - $ref: '#/components/schemas/Ipv6Addr' - interfaceList: - type: string - pattern: '^[A-Fa-f0-9]+$' - required: - - traceRef - - traceDepth - - neTypeList - - eventList - - -# Data Types related to 5G ODB as defined in subclause 5.7 - -# -# SIMPLE DATA TYPES -# -# -# -# Enumerations -# - RoamingOdb: - anyOf: - - type: string - enum: - - OUTSIDE_HOME_PLMN - - OUTSIDE_HOME_PLMN_COUNTRY - - type: string - - OdbPacketServices: - anyOf: - - type: string - enum: - - ALL_PACKET_SERVICES - - ROAMER_ACCESS_HPLMN_AP - - ROAMER_ACCESS_VPLMN_AP - - type: string - nullable: true - -# -# STRUCTURED DATA TYPES -# - - OdbData: - type: object - properties: - roamingOdb: - $ref: '#/components/schemas/RoamingOdb' - -# -# Data Types related to Charging as defined in subclause 5.8 -# - -# -# SIMPLE DATA TYPES -# -# - ChargingId: - $ref: '#/components/schemas/Uint32' - - RatingGroup: - $ref: '#/components/schemas/Uint32' - - ServiceId: - $ref: '#/components/schemas/Uint32' - - -# -# Enumerations -# - -# -# STRUCTURED DATA TYPES -# - SecondaryRatUsageReport: - type: object - properties: - secondaryRatType: - $ref: '#/components/schemas/RatType' - qosFlowsUsageData: - type: array - items: - $ref: '#/components/schemas/QosFlowUsageReport' - minItems: 1 - required: - - secondaryRatType - - qosFlowsUsageData - - QosFlowUsageReport: - type: object - properties: - qfi: - $ref: '#/components/schemas/Qfi' - startTimeStamp: - $ref: '#/components/schemas/DateTime' - endTimeStamp: - $ref: '#/components/schemas/DateTime' - downlinkVolume: - $ref: '#/components/schemas/Int64' - uplinkVolume: - $ref: '#/components/schemas/Int64' - required: - - qfi - - startTimeStamp - - endTimeStamp - - downlinkVolume - - uplinkVolume - - SecondaryRatUsageInfo: - type: object - properties: - secondaryRatType: - $ref: '#/components/schemas/RatType' - qosFlowsUsageData: - type: array - items: - $ref: '#/components/schemas/QosFlowUsageReport' - minItems: 1 - pduSessionUsageData: - type: array - items: - $ref: '#/components/schemas/VolumeTimedReport' - minItems: 1 - required: - - secondaryRatType - - VolumeTimedReport: - type: object - properties: - startTimeStamp: - $ref: '#/components/schemas/DateTime' - endTimeStamp: - $ref: '#/components/schemas/DateTime' - downlinkVolume: - $ref: '#/components/schemas/Int64' - uplinkVolume: - $ref: '#/components/schemas/Int64' - required: - - startTimeStamp - - endTimeStamp - - downlinkVolume - - uplinkVolume - - -# -# HTTP responses -# - - responses: - '400': - description: Bad request - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '401': - description: Unauthorized - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '403': - description: Forbidden - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '404': - description: Not Found - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '405': - description: Method Not Allowed - '408': - description: Request Timeout - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '406': - description: 406 Not Acceptable - '409': - description: Conflict - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '410': - description: Gone - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '411': - description: Length Required - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '412': - description: Precondition Failed - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '413': - description: Payload Too Large - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '414': - description: URI Too Long - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '415': - description: Unsupported Media Type - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '429': - description: Too Many Requests - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '500': - description: Internal Server Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '501': - description: Not Implemented - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '503': - description: Service Unavailable - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '504': - description: Gateway Timeout - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - default: - description: Generic Error +openapi: 3.0.0 + +info: + version: '1.2.0.alpha-4' + title: 'Common Data Types' + description: | + Common Data Types for Service Based Interfaces. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.571 Common Data Types for Service Based Interfaces, version 16.3.0 + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.571/' + +paths: {} +components: + schemas: + +# +# Common Data Types for Generic usage definitiones as defined in clause 5.2 +# + +# +# COMMON SIMPLE DATA TYPES +# + Binary: + format: binary + type: string + BinaryRm: + format: binary + type: string + nullable: true + Bytes: + format: byte + type: string + BytesRm: + format: byte + type: string + nullable: true + Date: + format: date + type: string + DateRm: + format: date + type: string + nullable: true + DateTime: + format: date-time + type: string + DateTimeRm: + format: date-time + type: string + nullable: true + DiameterIdentity: + type: string + pattern: '^([A-Za-z0-9]+([-A-Za-z0-9]+)\.)+[a-z]{2,}$' + DiameterIdentityRm: + type: string + pattern: '^([A-Za-z0-9]+([-A-Za-z0-9]+)\.)+[a-z]{2,}$' + nullable: true + Double: + format: double + type: number + DoubleRm: + format: double + type: number + nullable: true + DurationSec: + type: integer + DurationSecRm: + type: integer + nullable: true + Float: + format: float + type: number + FloatRm: + format: float + type: number + nullable: true + Int32: + format: int32 + type: integer + Int32Rm: + format: int32 + type: integer + nullable: true + Int64: + type: integer + format: int64 + Int64Rm: + format: int64 + type: integer + nullable: true + Ipv4Addr: + type: string + pattern: '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$' + example: '198.51.100.1' + Ipv4AddrRm: + type: string + pattern: '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$' + example: '198.51.100.1' + nullable: true + Ipv4AddrMask: + type: string + pattern: '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$' + example: '198.51.0.0/16' + Ipv4AddrMaskRm: + type: string + pattern: '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$' + example: '198.51.0.0/16' + nullable: true + Ipv6Addr: + type: string +# allOf: +# - pattern: '^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))$' +# - pattern: '^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))$' + example: '2001:db8:85a3::8a2e:370:7334' + Ipv6AddrRm: + type: string +# allOf: +# - pattern: '^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))$' +# - pattern: '^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))$' + example: '2001:db8:85a3::8a2e:370:7334' + nullable: true + Ipv6Prefix: + type: string +# allOf: +# - pattern: '^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))(\/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))$' +# - pattern: '^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))(\/.+)$' + example: '2001:db8:abcd:12::0/64' + Ipv6PrefixRm: + type: string +# allOf: +# - pattern: '^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))(\/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))$' +# - pattern: '^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))(\/.+)$' + nullable: true + MacAddr48: + type: string + pattern: '^([0-9a-fA-F]{2})((-[0-9a-fA-F]{2}){5})$' + MacAddr48Rm: + type: string + pattern: '^([0-9a-fA-F]{2})((-[0-9a-fA-F]{2}){5})$' + nullable: true + SupportedFeatures: + type: string + pattern: '^[A-Fa-f0-9]*$' + Uinteger: + type: integer + minimum: 0 + UintegerRm: + type: integer + minimum: 0 + nullable: true + Uint16: + type: integer + minimum: 0 + maximum: 65535 + Uint16Rm: + type: integer + minimum: 0 + maximum: 65535 + nullable: true + Uint32: + format: int32 + type: integer + minimum: 0 + Uint32Rm: + format: int32 + type: integer + minimum: 0 + nullable: true + Uint64: + format: int64 + type: integer + minimum: 0 + Uint64Rm: + format: int64 + type: integer + minimum: 0 + nullable: true + Uri: + type: string + UriRm: + type: string + nullable: true + VarUeId: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|gci-.+|gli-.+|.+)$' + VarUeIdRm: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|gci-.+|gli-.+|.+)$' + nullable: true + TimeZone: + type: string + TimeZoneRm: + type: string + nullable: true + StnSr: + type: string + StnSrRm: + type: string + nullable: true + CMsisdn: + type: string + pattern: '^[0-9]{5,15}$' + CMsisdnRm: + type: string + pattern: '^[0-9]{5,15}$' + nullable: true + DayOfWeek: + type: integer + minimum: 1 + maximum: 7 + description: integer between and including 1 and 7 denoting a weekday. 1 shall indicate Monday, and the subsequent weekdays shall be indicated with the next higher numbers. 7 shall indicate Sunday. + TimeOfDay: + type: string + description: String with format partial-time or full-time as defined in clause 5.6 of IETF RFC 3339. Examples, 20:15:00, 20:15:00-08:00 (for 8 hours behind UTC). +# +# COMMON ENUMERATED DATA TYPES +# + + PatchOperation: +# anyOf: +# - type: string + enum: + - add + - copy + - move + - remove + - replace + - test + type: string + UriScheme: +# anyOf: +# - type: string + enum: + - http + - https + type: string + ChangeType: +# anyOf: +# - type: string + enum: + - ADD + - MOVE + - REMOVE + - REPLACE + type: string + HttpMethod: + anyOf: + - type: string + enum: + - GET + - POST + - PUT + - DELETE + - PATCH + - OPTIONS + - HEAD + - CONNECT + - TRACE + - type: string + NullValue: + enum: + - null + +# +# COMMON STRUCTURED DATA TYPES +# + + ProblemDetails: + type: object + properties: + type: + $ref: '#/components/schemas/Uri' + title: + type: string + status: + type: integer + detail: + type: string + instance: + $ref: '#/components/schemas/Uri' + cause: + type: string + invalidParams: + type: array + items: + $ref: '#/components/schemas/InvalidParam' + minItems: 1 + supportedFeatures: + $ref: '#/components/schemas/SupportedFeatures' + Link: + type: object + properties: + href: + $ref: '#/components/schemas/Uri' + LinkRm: + type: object + properties: + href: + $ref: '#/components/schemas/Uri' + nullable: true + PatchItem: + type: object + properties: + op: + $ref: '#/components/schemas/PatchOperation' + path: + type: string + from: + type: string + value: + type: string + required: + - op + - path + LinksValueSchema: + oneOf: + - type: array + items: + $ref: '#/components/schemas/Link' + minItems: 1 + - $ref: '#/components/schemas/Link' + SelfLink: + type: object + properties: + self: + $ref: '#/components/schemas/Link' + required: + - self + InvalidParam: + type: object + properties: + param: + type: string + reason: + type: string + required: + - param + ChangeItem: + type: object + properties: + op: + $ref: '#/components/schemas/ChangeType' + path: + type: string + from: + type: string +# origValue: {} +# newValue: {} + origValue: + type: string + newValue: + type: string + required: + - op + - path + NotifyItem: + type: object + required: + - resourceId + - changes + properties: + resourceId: + $ref: '#/components/schemas/Uri' + changes: + type: array + items: + $ref: '#/components/schemas/ChangeItem' + minItems: 1 + ComplexQuery: + oneOf: + - $ref: '#/components/schemas/Cnf' + - $ref: '#/components/schemas/Dnf' + Cnf: + type: object + required: + - cnfUnits + properties: + cnfUnits: + type: array + items: + $ref: '#/components/schemas/CnfUnit' + minItems: 1 + Dnf: + type: object + required: + - dnfUnits + properties: + dnfUnits: + type: array + items: + $ref: '#/components/schemas/DnfUnit' + minItems: 1 + CnfUnit: + type: object + required: + - cnfUnit + properties: + cnfUnit: + type: array + items: + $ref: '#/components/schemas/Atom' + minItems: 1 + DnfUnit: + type: object + required: + - dnfUnit + properties: + dnfUnit: + type: array + items: + $ref: '#/components/schemas/Atom' + minItems: 1 + Atom: + type: object + required: + - attr + - value + properties: + attr: + type: string +# value: {} + value: + type: string + negative: + type: boolean + PatchResult: + type: object + required: + - report + properties: + report: + type: array + items: + $ref: '#/components/schemas/ReportItem' + minItems: 1 + ReportItem: + type: object + required: + - path + properties: + path: + type: string + HalTemplate: + type: object + required: + - method + properties: + title: + type: string + method: + $ref: '#/components/schemas/HttpMethod' + contentType: + type: string + properties: + type: array + items: + $ref: '#/components/schemas/Property' + minItems: 1 + Property: + type: object + required: + - name + properties: + name: + type: string + required: + type: boolean + regex: + type: string + value: + type: string + + + + +# +# Data Types related to Subscription, Identification and Numbering as defined in clause 5.3 +# + +# +# SIMPLE DATA TYPES +# + Dnn: + type: string + DnnRm: + type: string + nullable: true + WildcardDnn: + type: string + pattern: '^[*]$' + WildcardDnnRm: + type: string + pattern: '^[*]$' + nullable: true + Gpsi: + type: string + pattern: '^(msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|.+)$' + GpsiRm: + type: string + pattern: '^(msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|.+)$' + nullable: true + GroupId: + type: string + pattern: '^[A-Fa-f0-9]{8}-[0-9]{3}-[0-9]{2,3}-([A-Fa-f0-9][A-Fa-f0-9]){1,10}$' + GroupIdRm: + type: string + pattern: '^[A-Fa-f0-9]{8}-[0-9]{3}-[0-9]{2,3}-([A-Fa-f0-9][A-Fa-f0-9]){1,10}$' + nullable: true + ExternalGroupId: + type: string + pattern: '^extgroupid-[^@]+@[^@]+$' + ExternalGroupIdRm: + type: string + pattern: '^extgroupid-[^@]+@[^@]+$' + nullable: true + Pei: + type: string + pattern: '^(imei-[0-9]{15}|imeisv-[0-9]{16}|mac((-[0-9a-fA-F]{2}){6})(-untrusted)?|eui((-[0-9a-fA-F]{2}){8})|.+)$' + PeiRm: + type: string + pattern: '^(imei-[0-9]{15}|imeisv-[0-9]{16}|mac((-[0-9a-fA-F]{2}){6})(-untrusted)?|eui((-[0-9a-fA-F]{2}){8})|.+)$' + nullable: true + Supi: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gci-.+|gli-.+|.+)$' + SupiRm: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gci-.+|gli-.+|.+)$' + nullable: true + NfInstanceId: + type: string + format: uuid + AmfId: + type: string + pattern: '^[A-Fa-f0-9]{6}$' + AmfRegionId: + type: string + pattern: '^[A-Fa-f0-9]{2}$' + AmfSetId: + type: string + pattern: '^[0-3][A-Fa-f0-9]{2}$' + RfspIndex: + type: integer + minimum: 1 + maximum: 256 + RfspIndexRm: + type: integer + minimum: 1 + maximum: 256 + nullable: true + NfGroupId: + type: string + MtcProviderInformation: + type: string + CagId: + type: string + pattern: '^[A-Fa-f0-9]{8}$' + SupiOrSuci: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|suci-(0-[0-9]{3}-[0-9]{2,3}|[1-7]-.+)-[0-9]{1,4}-(0-0-.+|[a-fA-F1-9]-([1-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])-[a-fA-F0-9]+)|.+)$' + +# +# STRUCTURED DATA TYPES +# + Guami: + type: object + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + amfId: + $ref: '#/components/schemas/AmfId' + required: + - plmnId + - amfId + GuamiRm: + type: object + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + amfId: + $ref: '#/components/schemas/AmfId' + required: + - plmnId + - amfId + nullable: true + NetworkId: + type: object + properties: + mnc: + $ref: '#/components/schemas/Mnc' + mcc: + $ref: '#/components/schemas/Mcc' + + +# +# Data Types related to 5G Network as defined in clause 5.4 +# + +# +# SIMPLE DATA TYPES +# + ApplicationId: + type: string + ApplicationIdRm: + type: string + nullable: true + PduSessionId: + type: integer + minimum: 0 + maximum: 255 + Mcc: + type: string + pattern: '^\d{3}$' + MccRm: + type: string + pattern: '^\d{3}$' + nullable: true + Mnc: + type: string + pattern: '^\d{2,3}$' + MncRm: + type: string + pattern: '^\d{2,3}$' + nullable: true + Tac: + type: string + pattern: '(^[A-Fa-f0-9]{4}$)|(^[A-Fa-f0-9]{6}$)' + TacRm: + type: string + pattern: '(^[A-Fa-f0-9]{4}$)|(^[A-Fa-f0-9]{6}$)' + nullable: true + EutraCellId: + type: string + pattern: '^[A-Fa-f0-9]{7}$' + EutraCellIdRm: + type: string + pattern: '^[A-Fa-f0-9]{7}$' + nullable: true + NrCellId: + type: string + pattern: '^[A-Fa-f0-9]{9}$' + NrCellIdRm: + type: string + pattern: '^[A-Fa-f0-9]{9}$' + nullable: true + Dnai: + type: string + DnaiRm: + type: string + nullable: true + 5GMmCause: + $ref: '#/components/schemas/Uinteger' + AmfName: + type: string + AreaCode: + type: string + AreaCodeRm: + type: string + nullable: true + N3IwfId: + type: string + pattern: '^[A-Fa-f0-9]+$' + NgeNbId: + type: string + pattern: '^(MacroNGeNB-[A-Fa-f0-9]{5}|LMacroNGeNB-[A-Fa-f0-9]{6}|SMacroNGeNB-[A-Fa-f0-9]{5})$' + Nid: + type: string + pattern: '^[A-Fa-f0-9]{11}$' + NidRm: + type: string + pattern: '^[A-Fa-f0-9]{11}$' + nullable: true + NfSetId: + type: string + NfServiceSetId: + type: string + PlmnAssiUeRadioCapId: + $ref: '#/components/schemas/Bytes' + ManAssiUeRadioCapId: + $ref: '#/components/schemas/Bytes' + TypeAllocationCode: + type: string + pattern: '^[0-9]{8}$' + HfcNId: + type: string + maxLength: 6 + HfcNIdRm: + type: string + maxLength: 6 + nullable: true + ENbId: + type: string + pattern: '^(MacroeNB-[A-Fa-f0-9]{5}|LMacroeNB-[A-Fa-f0-9]{6}|SMacroeNB-[A-Fa-f0-9]{5}|HomeeNB-[A-Fa-f0-9]{7})$' + Gli: + $ref: '#/components/schemas/Bytes' + +# +# ENUMERATED DATA TYPES +# + + AccessType: + type: string + enum: + - 3GPP_ACCESS + - NON_3GPP_ACCESS + AccessTypeRm: + anyOf: + - $ref: '#/components/schemas/AccessType' + - $ref: '#/components/schemas/NullValue' + RatType: + anyOf: + - type: string + enum: + - NR + - EUTRA + - WLAN + - VIRTUAL + - NBIOT + - WIRELINE + - WIRELINE_CABLE + - WIRELINE_DSL + - WIRELINE_PON + - LTE-M + - NR_U + - EUTRA_U + - TRUSTED_N3GA + - TRUSTED_WLAN + - UTRA + - GERA + - type: string + RatTypeRm: + allOf: + - $ref: '#/components/schemas/RatType' + nullable: true + PduSessionType: + anyOf: + - type: string + enum: + - IPV4 + - IPV6 + - IPV4V6 + - UNSTRUCTURED + - ETHERNET + - type: string + PduSessionTypeRm: + anyOf: + - $ref: '#/components/schemas/PduSessionType' + - $ref: '#/components/schemas/NullValue' + UpIntegrity: + anyOf: + - type: string + enum: + - REQUIRED + - PREFERRED + - NOT_NEEDED + - type: string + UpIntegrityRm: + anyOf: + - $ref: '#/components/schemas/UpIntegrity' + - $ref: '#/components/schemas/NullValue' + UpConfidentiality: + anyOf: + - type: string + enum: + - REQUIRED + - PREFERRED + - NOT_NEEDED + - type: string + UpConfidentialityRm: + anyOf: + - $ref: '#/components/schemas/UpConfidentiality' + - $ref: '#/components/schemas/NullValue' + SscMode: + anyOf: + - type: string + enum: + - SSC_MODE_1 + - SSC_MODE_2 + - SSC_MODE_3 + - type: string + SscModeRm: + anyOf: + - $ref: '#/components/schemas/SscMode' + - $ref: '#/components/schemas/NullValue' + DnaiChangeType: + anyOf: + - type: string + enum: + - EARLY + - EARLY_LATE + - LATE + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - EARLY: Early notification of UP path reconfiguration. + - EARLY_LATE: Early and late notification of UP path reconfiguration. This value shall only be present in the subscription to the DNAI change event. + - LATE: Late notification of UP path reconfiguration. + DnaiChangeTypeRm: + anyOf: + - $ref: '#/components/schemas/DnaiChangeType' + - $ref: '#/components/schemas/NullValue' + RestrictionType: + anyOf: + - type: string + enum: + - ALLOWED_AREAS + - NOT_ALLOWED_AREAS + - type: string + RestrictionTypeRm: + anyOf: + - $ref: '#/components/schemas/RestrictionType' + - $ref: '#/components/schemas/NullValue' + CoreNetworkType: + anyOf: + - type: string + enum: + - 5GC + - EPC + - type: string + CoreNetworkTypeRm: + anyOf: + - $ref: '#/components/schemas/CoreNetworkType' + - $ref: '#/components/schemas/NullValue' + PresenceState: + anyOf: + - type: string + enum: + - IN_AREA + - OUT_OF_AREA + - UNKNOWN + - INACTIVE + - type: string + StationaryIndication: + anyOf: + - type: string + enum: + - STATIONARY + - MOBILE + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - STATIONARY: Identifies the UE is stationary + - MOBILE: Identifies the UE is mobile + StationaryIndicationRm: + anyOf: + - $ref: '#/components/schemas/StationaryIndication' + - $ref: '#/components/schemas/NullValue' + ScheduledCommunicationType: + anyOf: + - type: string + enum: + - DOWNLINK_ONLY + - UPLINK_ONLY + - BIDIRECTIONAL + - type: string + ScheduledCommunicationTypeRm: + anyOf: + - $ref: '#/components/schemas/ScheduledCommunicationType' + - $ref: '#/components/schemas/NullValue' + TrafficProfile: + anyOf: + - type: string + enum: + - SINGLE_TRANS_UL + - SINGLE_TRANS_DL + - DUAL_TRANS_UL_FIRST + - DUAL_TRANS_DL_FIRST + - MULTI_TRANS + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - SINGLE_TRANS_UL: Uplink single packet transmission. + - SINGLE_TRANS_DL: Downlink single packet transmission. + - DUAL_TRANS_UL_FIRST: Dual packet transmission, firstly uplink packet transmission with subsequent downlink packet transmission. + - DUAL_TRANS_DL_FIRST: Dual packet transmission, firstly downlink packet transmission with subsequent uplink packet transmission. + TrafficProfileRm: + anyOf: + - $ref: '#/components/schemas/TrafficProfile' + - $ref: '#/components/schemas/NullValue' + LcsServiceAuth: + anyOf: + - type: string + enum: + - "LOCATION_NOT_ALLOWED" + - "LOCATION_ALLOWED_WITH_NOTIFICATION" + - "LOCATION_ALLOWED_WITHOUT_NOTIFICATION" + - "LOCATION_ALLOWED_WITHOUT_RESPONSE" + - "LOCATION_RESTRICTED_WITHOUT_RESPONSE" + - "NOTIFICATION_ONLY" + - "NOTIFICATION_AND_VERIFICATION_ONLY" + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - "LOCATION_NOT_ALLOWED": Indicates the start of MO Exception Data delivery. + - "STOP": Indicates the stop of MO Exception Data delivery. + - "LOCATION_NOT_ALLOWED": Location not allowed + - "LOCATION_ALLOWED_WITH_NOTIFICATION": Location allowed with notification + - "LOCATION_ALLOWED_WITHOUT_NOTIFICATION": Location allowed without notification + - "LOCATION_ALLOWED_WITHOUT_RESPONSE": Location with notification and privacy verification; location allowed if no response + - "LOCATION_RESTRICTED_WITHOUT_RESPONSE": Location with notification and privacy verification; location restricted if no response + - "NOTIFICATION_ONLY": Notification only + - "NOTIFICATION_AND_VERIFICATION_ONLY": Notification and privacy verification only + UeAuth: + anyOf: + - type: string + enum: + - AUTHORIZED + - NOT_AUTHORIZED + - type: string + DlDataDeliveryStatus: + anyOf: + - type: string + enum: + - BUFFERED + - TRANSMITTED + - DISCARDED + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + 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. + DlDataDeliveryStatusRm: + anyOf: + - $ref: '#/components/schemas/DlDataDeliveryStatus' + - $ref: '#/components/schemas/NullValue' + MoExceptionDataFlag: + anyOf: + - type: string + enum: + - START + - STOP + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - "START": Indicates the start of MO Exception Data delivery. + - "STOP": Indicates the stop of MO Exception Data delivery. + +# +# STRUCTURED DATA TYPES +# + + Snssai: + type: object + properties: + sst: + type: integer + minimum: 0 + maximum: 255 + sd: + type: string + pattern: '^[A-Fa-f0-9]{6}$' + required: + - sst + PlmnId: + type: object + properties: + mcc: + $ref: '#/components/schemas/Mcc' + mnc: + $ref: '#/components/schemas/Mnc' + required: + - mcc + - mnc + PlmnIdRm: + type: object + properties: + mcc: + $ref: '#/components/schemas/Mcc' + mnc: + $ref: '#/components/schemas/Mnc' + required: + - mcc + - mnc + nullable: true + Tai: + type: object + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + tac: + $ref: '#/components/schemas/Tac' + nid: + $ref: '#/components/schemas/Nid' + required: + - plmnId + - tac + TaiRm: + type: object + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + tac: + $ref: '#/components/schemas/Tac' + nid: + $ref: '#/components/schemas/Nid' + required: + - plmnId + - tac + nullable: true + Ecgi: + type: object + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + # PLMN Identity + eutraCellId: + $ref: '#/components/schemas/EutraCellId' + nid: + $ref: '#/components/schemas/Nid' + required: + - plmnId + - eutraCellId + EcgiRm: + type: object + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + # PLMN Identity + eutraCellId: + $ref: '#/components/schemas/EutraCellId' + nid: + $ref: '#/components/schemas/Nid' + required: + - plmnId + - eutraCellId + nullable: true + Ncgi: + type: object + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + nrCellId: + $ref: '#/components/schemas/NrCellId' + nid: + $ref: '#/components/schemas/Nid' + required: + - plmnId + - nrCellId + NcgiRm: + type: object + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + nrCellId: + $ref: '#/components/schemas/NrCellId' + nid: + $ref: '#/components/schemas/Nid' + required: + - plmnId + - nrCellId + nullable: true + UserLocation: + type: object + properties: + eutraLocation: + $ref: '#/components/schemas/EutraLocation' + nrLocation: + $ref: '#/components/schemas/NrLocation' + n3gaLocation: + $ref: '#/components/schemas/N3gaLocation' + EutraLocation: + type: object + properties: + tai: + $ref: '#/components/schemas/Tai' + ecgi: + $ref: '#/components/schemas/Ecgi' + ignoreEcgi: + type: boolean + default: false + ageOfLocationInformation: + type: integer + minimum: 0 + maximum: 32767 + ueLocationTimestamp: + $ref: '#/components/schemas/DateTime' + geographicalInformation: + type: string + pattern: '^[0-9A-F]{16}$' + geodeticInformation: + type: string + pattern: '^[0-9A-F]{20}$' + globalNgenbId: + $ref: '#/components/schemas/GlobalRanNodeId' + globalENbId: + $ref: '#/components/schemas/GlobalRanNodeId' + required: + - tai + - ecgi + EutraLocationRm: + type: object + properties: + tai: + $ref: '#/components/schemas/Tai' + ecgi: + $ref: '#/components/schemas/Ecgi' + ageOfLocationInformation: + type: integer + minimum: 0 + maximum: 32767 + ueLocationTimestamp: + $ref: '#/components/schemas/DateTime' + geographicalInformation: + type: string + pattern: '^[0-9A-F]{16}$' + geodeticInformation: + type: string + pattern: '^[0-9A-F]{20}$' + globalNgenbId: + $ref: '#/components/schemas/GlobalRanNodeId' + globalENbId: + $ref: '#/components/schemas/GlobalRanNodeId' + required: + - tai + - ecgi + nullable: true + NrLocation: + type: object + properties: + tai: + $ref: '#/components/schemas/Tai' + ncgi: + $ref: '#/components/schemas/Ncgi' + ageOfLocationInformation: + type: integer + minimum: 0 + maximum: 32767 + ueLocationTimestamp: + $ref: '#/components/schemas/DateTime' + geographicalInformation: + type: string + pattern: '^[0-9A-F]{16}$' + geodeticInformation: + type: string + pattern: '^[0-9A-F]{20}$' + globalGnbId: + $ref: '#/components/schemas/GlobalRanNodeId' + required: + - tai + - ncgi + NrLocationRm: + type: object + properties: + tai: + $ref: '#/components/schemas/Tai' + ncgi: + $ref: '#/components/schemas/Ncgi' + ignoreNcgi: + type: boolean + default: false + ageOfLocationInformation: + type: integer + minimum: 0 + maximum: 32767 + ueLocationTimestamp: + $ref: '#/components/schemas/DateTime' + geographicalInformation: + type: string + pattern: '^[0-9A-F]{16}$' + geodeticInformation: + type: string + pattern: '^[0-9A-F]{20}$' + globalGnbId: + $ref: '#/components/schemas/GlobalRanNodeId' + required: + - tai + - ncgi + nullable: true + N3gaLocation: + type: object + properties: + n3gppTai: + $ref: '#/components/schemas/Tai' + n3IwfId: + type: string + pattern: '^[A-Fa-f0-9]+$' + ueIpv4Addr: + $ref: '#/components/schemas/Ipv4Addr' + ueIpv6Addr: + $ref: '#/components/schemas/Ipv6Addr' + portNumber: + $ref: '#/components/schemas/Uinteger' + ssId: + type: string + bssId: + type: string + civicAddress: + $ref: '#/components/schemas/Bytes' + hfcNodeId: + $ref: '#/components/schemas/HfcNodeId' + gli: + $ref: '#/components/schemas/Gli' + UpSecurity: + type: object + properties: + upIntegr: + $ref: '#/components/schemas/UpIntegrity' + upConfid: + $ref: '#/components/schemas/UpConfidentiality' + required: + - upIntegr + - upConfid + UpSecurityRm: + type: object + properties: + upIntegr: + $ref: '#/components/schemas/UpIntegrity' + upConfid: + $ref: '#/components/schemas/UpConfidentiality' + required: + - upIntegr + - upConfid + nullable: true + NgApCause: + type: object + properties: + group: + $ref: '#/components/schemas/Uinteger' + value: + $ref: '#/components/schemas/Uinteger' + required: + - group + - value + BackupAmfInfo: + type: object + properties: + backupAmf: + $ref: '#/components/schemas/AmfName' + guamiList: + type: array + items: + $ref: '#/components/schemas/Guami' + minItems: 1 + required: + - backupAmf + RefToBinaryData: + type: object + properties: + contentId: + type: string + required: + - contentId + RefToBinaryDataRm: + type: object + properties: + contentId: + type: string + required: + - contentId + nullable: true + RouteToLocation: + type: object + properties: + dnai: + $ref: '#/components/schemas/Dnai' + routeInfo: + $ref: '#/components/schemas/RouteInformation' + routeProfId: + type: string + nullable: true + required: + - dnai + anyOf: + - required: [ routeInfo ] + - required: [ routeProfId ] + nullable: true + RouteInformation: + type: object + properties: + ipv4Addr: + $ref: '#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: '#/components/schemas/Ipv6Addr' + portNumber: + $ref: '#/components/schemas/Uinteger' + required: + - portNumber + nullable: true + SubscribedDefaultQos: + type: object + required: + - 5qi + - arp + properties: + 5qi: + $ref: '#/components/schemas/5Qi' + arp: + $ref: '#/components/schemas/Arp' + priorityLevel: + $ref: '#/components/schemas/5QiPriorityLevel' + Area: + type: object + oneOf: + - required: + - tacs + - required: + - areaCode + properties: + tacs: + type: array + items: + $ref: '#/components/schemas/Tac' + minItems: 1 + areaCode: + $ref: '#/components/schemas/AreaCode' + ServiceAreaRestriction: + type: object + properties: + restrictionType: + $ref: '#/components/schemas/RestrictionType' + areas: + type: array + items: + $ref: '#/components/schemas/Area' + maxNumOfTAs: + $ref: '#/components/schemas/Uinteger' + maxNumOfTAsForNotAllowedAreas: + $ref: '#/components/schemas/Uinteger' + allOf: + # + # 1st condition: restrictionType and areas attributes shall be either both absent + # or both present + # + - oneOf: + - not: + required: [ restrictionType ] + - required: [ areas ] + # + # 2nd condition: if restrictionType takes value NOT_ALLOWED_AREAS, + # then maxNumOfTAs shall be absent + # + - anyOf: + - not: + required: [ restrictionType ] + properties: + restrictionType: + type: string + enum: [ NOT_ALLOWED_AREAS ] + - not: + required: [ maxNumOfTAs ] + # + # 3rd condition: if restrictionType takes value ALLOWED_AREAS, + # then maxNumOfTAsForNotAllowedAreas shall be absent + # + - anyOf: + - not: + required: [ restrictionType ] + properties: + restrictionType: + type: string + enum: [ ALLOWED_AREAS ] + - not: + required: [ maxNumOfTAsForNotAllowedAreas ] + WirelineArea: + type: object + properties: + globalLineIds: + type: array + items: + $ref: '#/components/schemas/Gli' + minItems: 1 + hfcNIds: + type: array + items: + $ref: '#/components/schemas/HfcNId' + minItems: 1 + areaCodeB: + $ref: '#/components/schemas/AreaCode' + areaCodeC: + $ref: '#/components/schemas/AreaCode' + WirelineServiceAreaRestriction: + type: object + properties: + restrictionType: + $ref: '#/components/schemas/RestrictionType' + areas: + type: array + items: + $ref: '#/components/schemas/WirelineArea' + PresenceInfo: + type: object + properties: + praId: + type: string + presenceState: + $ref: '#/components/schemas/PresenceState' + trackingAreaList: + type: array + items: + $ref: '#/components/schemas/Tai' + minItems: 1 + ecgiList: + type: array + items: + $ref: '#/components/schemas/Ecgi' + minItems: 1 + ncgiList: + type: array + items: + $ref: '#/components/schemas/Ncgi' + minItems: 1 + globalRanNodeIdList: + type: array + items: + $ref: '#/components/schemas/GlobalRanNodeId' + minItems: 1 + globaleNbIdList: + type: array + items: + $ref: '#/components/schemas/GlobalRanNodeId' + minItems: 1 + PresenceInfoRm: + type: object + properties: + praId: + type: string + presenceState: + $ref: '#/components/schemas/PresenceState' + trackingAreaList: + type: array + items: + $ref: '#/components/schemas/Tai' + minItems: 0 + ecgiList: + type: array + items: + $ref: '#/components/schemas/Ecgi' + minItems: 0 + ncgiList: + type: array + items: + $ref: '#/components/schemas/Ncgi' + minItems: 0 + globalRanNodeIdList: + type: array + items: + $ref: '#/components/schemas/GlobalRanNodeId' + globaleNbIdList: + type: array + items: + $ref: '#/components/schemas/GlobalRanNodeId' + minItems: 1 + nullable: true + GlobalRanNodeId: + type: object + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + n3IwfId: + $ref: '#/components/schemas/N3IwfId' + gNbId: + $ref: '#/components/schemas/GNbId' + ngeNbId: + $ref: '#/components/schemas/NgeNbId' + nid: + $ref: '#/components/schemas/Nid' + eNbId: + $ref: '#/components/schemas/ENbId' + oneOf: + - required: [ n3IwfId ] + - required: [ gNbId ] + - required: [ ngeNbId ] + - required: [ eNbId ] + required: + - plmnId + GNbId: + type: object + properties: + bitLength: + type: integer + minimum: 22 + maximum: 32 + gNBValue: + type: string + pattern: '^[A-Fa-f0-9]{6,8}$' + required: + - bitLength + - gNBValue + AtsssCapability: + type: object + properties: + atsssLL: + type: boolean + default: false + mptcp: + type: boolean + default: false + PlmnIdNid: + type: object + required: + - mcc + - mnc + properties: + mcc: + $ref: '#/components/schemas/Mcc' + mnc: + $ref: '#/components/schemas/Mnc' + nid: + $ref: '#/components/schemas/Nid' + SmallDataRateStatus: + type: object + properties: + remainPacketsUl: + type: integer + minimum: 0 + remainPacketsDl: + type: integer + minimum: 0 + validityTime: + $ref: '#/components/schemas/DateTime' + remainExReportsUl: + type: integer + minimum: 0 + remainExReportsDl: + type: integer + minimum: 0 + ApnRateStatus: + type: object + properties: + remainPacketsUl: + type: integer + minimum: 0 + remainPacketsDl: + type: integer + minimum: 0 + validityTime: + $ref: '#/components/schemas/DateTime' + remainExReportsUl: + type: integer + minimum: 0 + remainExReportsDl: + type: integer + minimum: 0 + HfcNodeId: + type: object + required: + - hfcNId + properties: + hfcNId: + $ref: '#/components/schemas/HfcNId' + HfcNodeIdRm: + type: object + required: + - hfcNId + properties: + hfcNId: + $ref: '#/components/schemas/HfcNId' + nullable: true + ScheduledCommunicationTime: + type: object + properties: + daysOfWeek: + type: array + items: + $ref: '#/components/schemas/DayOfWeek' + minItems: 1 + maxItems: 6 + description: Identifies the day(s) of the week. If absent, it indicates every day of the week. + timeOfDayStart: + $ref: '#/components/schemas/TimeOfDay' + timeOfDayEnd: + $ref: '#/components/schemas/TimeOfDay' + ScheduledCommunicationTimeRm: + anyOf: + - $ref: '#/components/schemas/ScheduledCommunicationTime' + - $ref: '#/components/schemas/NullValue' + BatteryIndication: + type: object + properties: + batteryInd: + type: boolean + replaceableInd: + type: boolean + rechargeableInd: + type: boolean + BatteryIndicationRm: + anyOf: + - $ref: '#/components/schemas/BatteryIndication' + - $ref: '#/components/schemas/NullValue' + AcsInfo: + type: object + properties: + acsUrl: + $ref: '#/components/schemas/Uri' + acsIpv4Addr: + $ref: '#/components/schemas/Ipv4Addr' + acsIpv6Addr: + $ref: '#/components/schemas/Ipv6Addr' + AcsInfoRm: + anyOf: + - $ref: '#/components/schemas/AcsInfo' + - $ref: '#/components/schemas/NullValue' + NrV2xAuth: + type: object + properties: + vehicleUeAuth: + $ref: '#/components/schemas/UeAuth' + pedestrianUeAuth: + $ref: '#/components/schemas/UeAuth' + LteV2xAuth: + type: object + properties: + vehicleUeAuth: + $ref: '#/components/schemas/UeAuth' + pedestrianUeAuth: + $ref: '#/components/schemas/UeAuth' + Pc5QoSPara: + type: object + required: + - pc5QosFlowList + properties: + pc5QosFlowList: + type: array + items: + $ref: '#/components/schemas/Pc5QosFlowItem' + pc5LinkAmbr: + $ref: '#/components/schemas/BitRate' + Pc5QosFlowItem: + type: object + required: + - pqi + properties: + pqi: + $ref: '#/components/schemas/5Qi' + pc5FlowBitRates: + $ref: '#/components/schemas/Pc5FlowBitRates' + range: + $ref: '#/components/schemas/Uinteger' + Pc5FlowBitRates: + type: object + properties: + guaFbr: + $ref: '#/components/schemas/BitRate' + maxFbr: + $ref: '#/components/schemas/BitRate' + UtraLocation: + type: object + oneOf: + - required: + - cgi + - required: + - sai + - required: + - rai + properties: + cgi: + $ref: '#/components/schemas/CellGlobalId' + sai: + $ref: '#/components/schemas/ServiceAreaId' + lai: + $ref: '#/components/schemas/LocationAreaId' + rai: + $ref: '#/components/schemas/RoutingAreaId' + ageOfLocationInformation: + type: integer + minimum: 0 + maximum: 32767 + ueLocationTimestamp: + $ref: '#/components/schemas/DateTime' + geographicalInformation: + type: string + pattern: '^[0-9A-F]{16}$' + geodeticInformation: + type: string + pattern: '^[0-9A-F]{20}$' + GeraLocation: + type: object + oneOf: + - required: + - cgi + - required: + - sai + - required: + - rai + properties: + locationNumber: + type: string + cgi: + $ref: '#/components/schemas/CellGlobalId' + sai: + $ref: '#/components/schemas/ServiceAreaId' + lai: + $ref: '#/components/schemas/LocationAreaId' + vlrNumber: + type: string + mscNumber: + type: string + ageOfLocationInformation: + type: integer + minimum: 0 + maximum: 32767 + ueLocationTimestamp: + $ref: '#/components/schemas/DateTime' + geographicalInformation: + type: string + pattern: '^[0-9A-F]{16}$' + geodeticInformation: + type: string + pattern: '^[0-9A-F]{20}$' + CellGlobalId: + type: object + required: + - plmnId + - lac + - cellId + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + lac: + type: string + cellId: + type: string + pattern: '^[A-Fa-f0-9]$' + ServiceAreaId: + type: object + required: + - plmnId + - lac + - sac + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + lac: + type: string + pattern: '^[A-Fa-f0-9]$' + sac: + type: string + pattern: '^[A-Fa-f0-9]$' + LocationAreaId: + type: object + required: + - plmnId + - lac + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + lac: + type: string + pattern: '^[A-Fa-f0-9]$' + RoutingAreaId: + type: object + required: + - plmnId + - lac + - rac + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + lac: + type: string + pattern: '^[A-Fa-f0-9]$' + rac: + type: string + pattern: '^[A-Fa-f0-9]$' + DddTrafficDescriptor: + type: object + properties: + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + portNumber: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + macAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + MoExpDataCounter: + type: object + required: + - counter + properties: + counter: + type: integer + timeStamp: + $ref: '#/components/schemas/DateTime' + + +# +# Data Types related to 5G QoS as defined in clause 5.5 +# + +# +# SIMPLE DATA TYPES +# +# + Qfi: + type: integer + minimum: 0 + maximum: 63 + QfiRm: + type: integer + minimum: 0 + maximum: 63 + nullable: true + 5Qi: + type: integer + minimum: 0 + maximum: 255 + 5QiRm: + type: integer + minimum: 0 + maximum: 255 + nullable: true + BitRate: + type: string + pattern: '^\d+(\.\d+)? (bps|Kbps|Mbps|Gbps|Tbps)$' + BitRateRm: + type: string + pattern: '^\d+(\.\d+)? (bps|Kbps|Mbps|Gbps|Tbps)$' + nullable: true + ArpPriorityLevelRm: + type: integer + minimum: 1 + maximum: 15 + nullable: true + ArpPriorityLevel: + type: integer + minimum: 1 + maximum: 15 + nullable: true + description: nullable true shall not be used for this attribute + 5QiPriorityLevel: + type: integer + minimum: 1 + maximum: 127 + 5QiPriorityLevelRm: + type: integer + minimum: 1 + maximum: 127 + nullable: true + PacketDelBudget: + type: integer + minimum: 1 + PacketDelBudgetRm: + type: integer + minimum: 1 + nullable: true + PacketErrRate: + type: string + pattern: '^([0-9]E-[0-9])$' + PacketErrRateRm: + type: string + pattern: '^([0-9]E-[0-9])$' + nullable: true + PacketLossRate: + type: integer + minimum: 0 + maximum: 1000 + PacketLossRateRm: + type: integer + minimum: 0 + maximum: 1000 + nullable: true + AverWindow: + type: integer + minimum: 1 + maximum: 4095 + default: 2000 + AverWindowRm: + type: integer + maximum: 4095 + default: 2000 + minimum: 1 + nullable: true + MaxDataBurstVol: + type: integer + minimum: 1 + maximum: 4095 + MaxDataBurstVolRm: + type: integer + minimum: 1 + maximum: 4095 + nullable: true + SamplingRatio: + type: integer + minimum: 1 + maximum: 100 + SamplingRatioRm: + type: integer + minimum: 1 + maximum: 100 + nullable: true + RgWirelineCharacteristics: + $ref: '#/components/schemas/Bytes' + RgWirelineCharacteristicsRm: + allOf: + - $ref: '#/components/schemas/RgWirelineCharacteristics' + - nullable: true + ExtMaxDataBurstVol: + type: integer + minimum: 4096 + maximum: 2000000 + ExtMaxDataBurstVolRm: + type: integer + minimum: 4096 + maximum: 2000000 + nullable: true + +# +# ENUMERATED DATA TYPES +# + + PreemptionCapability: + anyOf: + - type: string + enum: + - NOT_PREEMPT + - MAY_PREEMPT + - type: string + PreemptionCapabilityRm: + anyOf: + - $ref: '#/components/schemas/PreemptionCapability' + - $ref: '#/components/schemas/NullValue' + PreemptionVulnerability: + anyOf: + - type: string + enum: + - NOT_PREEMPTABLE + - PREEMPTABLE + - type: string + PreemptionVulnerabilityRm: + anyOf: + - $ref: '#/components/schemas/PreemptionVulnerability' + - $ref: '#/components/schemas/NullValue' + ReflectiveQoSAttribute: + anyOf: + - type: string + enum: + - RQOS + - NO_RQOS + - type: string + ReflectiveQoSAttributeRm: + anyOf: + - $ref: '#/components/schemas/ReflectiveQoSAttribute' + - $ref: '#/components/schemas/NullValue' + NotificationControl: + anyOf: + - type: string + enum: + - REQUESTED + - NOT_REQUESTED + - type: string + NotificationControlRm: + anyOf: + - $ref: '#/components/schemas/NotificationControl' + - $ref: '#/components/schemas/NullValue' + QosResourceType: + anyOf: + - type: string + enum: + - NON_GBR + - NON_CRITICAL_GBR + - CRITICAL_GBR + - type: string + QosResourceTypeRm: + anyOf: + - $ref: '#/components/schemas/QosResourceType' + - $ref: '#/components/schemas/NullValue' + AdditionalQosFlowInfo: + anyOf: + - anyOf: + - type: string + enum: + - MORE_LIKELY + - type: string + - $ref: '#/components/schemas/NullValue' +# + +# +# STRUCTURED DATA TYPES +# + + Arp: + type: object + properties: + priorityLevel: + $ref: '#/components/schemas/ArpPriorityLevel' + preemptCap: + $ref: '#/components/schemas/PreemptionCapability' + preemptVuln: + $ref: '#/components/schemas/PreemptionVulnerability' + required: + - priorityLevel + - preemptCap + - preemptVuln + ArpRm: + type: object + properties: + priorityLevel: + $ref: '#/components/schemas/ArpPriorityLevel' + preemptCap: + $ref: '#/components/schemas/PreemptionCapability' + preemptVuln: + $ref: '#/components/schemas/PreemptionVulnerability' + required: + - priorityLevel + - preemptCap + - preemptVuln + nullable: true + Ambr: + type: object + properties: + uplink: + $ref: '#/components/schemas/BitRate' + downlink: + $ref: '#/components/schemas/BitRate' + required: + - uplink + - downlink + AmbrRm: + type: object + properties: + uplink: + $ref: '#/components/schemas/BitRate' + downlink: + $ref: '#/components/schemas/BitRate' + required: + - uplink + - downlink + nullable: true + Dynamic5Qi: + type: object + properties: + resourceType: + $ref: '#/components/schemas/QosResourceType' + priorityLevel: + $ref: '#/components/schemas/5QiPriorityLevel' + packetDelayBudget: + $ref: '#/components/schemas/PacketDelBudget' + packetErrRate: + $ref: '#/components/schemas/PacketErrRate' + averWindow: + $ref: '#/components/schemas/AverWindow' + maxDataBurstVol: + $ref: '#/components/schemas/MaxDataBurstVol' + extMaxDataBurstVol: + $ref: '#/components/schemas/ExtMaxDataBurstVol' + required: + - resourceType + - priorityLevel + - packetDelayBudget + - packetErrRate + NonDynamic5Qi: + type: object + properties: + priorityLevel: + $ref: '#/components/schemas/5QiPriorityLevel' + averWindow: + $ref: '#/components/schemas/AverWindow' + maxDataBurstVol: + $ref: '#/components/schemas/MaxDataBurstVol' + extMaxDataBurstVol: + $ref: '#/components/schemas/ExtMaxDataBurstVol' + minProperties: 0 + Tmbr: + type: object + properties: + uplink: + $ref: '#/components/schemas/BitRate' + downlink: + $ref: '#/components/schemas/BitRate' + required: + - uplink + - downlink + TmbrRm: + anyOf: + - $ref: '#/components/schemas/Tmbr' + - $ref: '#/components/schemas/NullValue' + +# +# Data Types related to 5G Trace as defined in clause 5.6 +# + +# +# SIMPLE DATA TYPES +# +# +# +# Enumerations +# + TraceDepth: + anyOf: + - type: string + enum: + - MINIMUM + - MEDIUM + - MAXIMUM + - MINIMUM_WO_VENDOR_EXTENSION + - MEDIUM_WO_VENDOR_EXTENSION + - MAXIMUM_WO_VENDOR_EXTENSION + - type: string + TraceDepthRm: + anyOf: + - $ref: '#/components/schemas/TraceDepth' + - $ref: '#/components/schemas/NullValue' +# +# STRUCTURED DATA TYPES +# + TraceData: + type: object + nullable: true + properties: + traceRef: + type: string + pattern: '^[0-9]{3}[0-9]{2,3}-[A-Fa-f0-9]{6}$' + traceDepth: + $ref: '#/components/schemas/TraceDepth' + neTypeList: + type: string + pattern: '^[A-Fa-f0-9]+$' + eventList: + type: string + pattern: '^[A-Fa-f0-9]+$' + collectionEntityIpv4Addr: + $ref: '#/components/schemas/Ipv4Addr' + collectionEntityIpv6Addr: + $ref: '#/components/schemas/Ipv6Addr' + interfaceList: + type: string + pattern: '^[A-Fa-f0-9]+$' + required: + - traceRef + - traceDepth + - neTypeList + - eventList + + +# Data Types related to 5G ODB as defined in clause 5.7 + +# +# SIMPLE DATA TYPES +# +# +# +# Enumerations +# + RoamingOdb: + anyOf: + - type: string + enum: + - OUTSIDE_HOME_PLMN + - OUTSIDE_HOME_PLMN_COUNTRY + - type: string + + OdbPacketServices: + anyOf: + - anyOf: + - type: string + enum: + - ALL_PACKET_SERVICES + - ROAMER_ACCESS_HPLMN_AP + - ROAMER_ACCESS_VPLMN_AP + - type: string + - $ref: '#/components/schemas/NullValue' + +# +# STRUCTURED DATA TYPES +# + + OdbData: + type: object + properties: + roamingOdb: + $ref: '#/components/schemas/RoamingOdb' + +# +# Data Types related to Charging as defined in clause 5.8 +# + +# +# SIMPLE DATA TYPES +# +# + ChargingId: + $ref: '#/components/schemas/Uint32' + + ApplicationChargingId: + type: string + + RatingGroup: + $ref: '#/components/schemas/Uint32' + + ServiceId: + $ref: '#/components/schemas/Uint32' + + +# +# Enumerations +# + +# +# STRUCTURED DATA TYPES +# + SecondaryRatUsageReport: + type: object + properties: + secondaryRatType: + $ref: '#/components/schemas/RatType' + qosFlowsUsageData: + type: array + items: + $ref: '#/components/schemas/QosFlowUsageReport' + minItems: 1 + required: + - secondaryRatType + - qosFlowsUsageData + + QosFlowUsageReport: + type: object + properties: + qfi: + $ref: '#/components/schemas/Qfi' + startTimeStamp: + $ref: '#/components/schemas/DateTime' + endTimeStamp: + $ref: '#/components/schemas/DateTime' + downlinkVolume: + $ref: '#/components/schemas/Int64' + uplinkVolume: + $ref: '#/components/schemas/Int64' + required: + - qfi + - startTimeStamp + - endTimeStamp + - downlinkVolume + - uplinkVolume + + SecondaryRatUsageInfo: + type: object + properties: + secondaryRatType: + $ref: '#/components/schemas/RatType' + qosFlowsUsageData: + type: array + items: + $ref: '#/components/schemas/QosFlowUsageReport' + minItems: 1 + pduSessionUsageData: + type: array + items: + $ref: '#/components/schemas/VolumeTimedReport' + minItems: 1 + required: + - secondaryRatType + + VolumeTimedReport: + type: object + properties: + startTimeStamp: + $ref: '#/components/schemas/DateTime' + endTimeStamp: + $ref: '#/components/schemas/DateTime' + downlinkVolume: + $ref: '#/components/schemas/Int64' + uplinkVolume: + $ref: '#/components/schemas/Int64' + required: + - startTimeStamp + - endTimeStamp + - downlinkVolume + - uplinkVolume + + +# +# HTTP responses +# + + responses: + '400': + description: Bad request + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '401': + description: Unauthorized + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '403': + description: Forbidden + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '404': + description: Not Found + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '405': + description: Method Not Allowed + '408': + description: Request Timeout + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '406': + description: 406 Not Acceptable + '409': + description: Conflict + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '410': + description: Gone + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '411': + description: Length Required + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '412': + description: Precondition Failed + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '413': + description: Payload Too Large + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '414': + description: URI Too Long + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '415': + description: Unsupported Media Type + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '429': + description: Too Many Requests + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '500': + description: Internal Server Error + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '501': + description: Not Implemented + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '503': + description: Service Unavailable + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '504': + description: Gateway Timeout + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + default: + description: Generic Error + diff --git a/lib/sbi/support/modified/TS29572_Nlmf_Location.yaml b/lib/sbi/support/modified/TS29572_Nlmf_Location.yaml new file mode 100644 index 0000000000..a679b94eeb --- /dev/null +++ b/lib/sbi/support/modified/TS29572_Nlmf_Location.yaml @@ -0,0 +1,1139 @@ +openapi: 3.0.0 + +info: + version: '1.1.0.alpha-3' + title: 'LMF Location' + description: | + LMF Location Service. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.572 V16.2.0; 5G System; Location Management Services; Stage 3 + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.572/' + +servers: + - url: '{apiRoot}/nlmf-loc/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +security: + - {} + - oAuth2ClientCredentials: + - nlmf-loc + +paths: + /determine-location: + post: + summary: Determine Location of an UE + operationId: DetermineLocation + tags: + - Determine Location + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InputData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/InputData' + binaryDataLppMessage: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataLppMessage: + contentType: application/vnd.3gpp.lpp + headers: + Content-Id: + schema: + type: string + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/LocationData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + EventNotify: + '{$request.body#/hgmlcCallBackURI}': + post: + requestBody: + description: UE Event Notification + content: + application/json: + schema: + $ref: '#/components/schemas/EventNotifyData' + responses: + '204': + description: Expected response to a valid notification + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /cancel-location: + post: + summary: request cancellation of periodic or triggered location + operationId: CancelLocation + tags: + - Cancel Location + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CancelLocData' + required: true + responses: + '204': + description: Expected response to a successful cancellation + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /location-context-transfer: + post: + summary: transfer context information for periodic or triggered location + operationId: LocationContextTransfer + tags: + - Location Context Transfer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LocContextData' + required: true + responses: + '204': + description: Expected response to successful location context transfer + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nlmf-loc: Access to the Nlmf_Location API + schemas: +# +# COMPLEX TYPES +# + InputData: + type: object + not: + required: [ ecgi, ncgi ] + properties: + externalClientType: + $ref: '#/components/schemas/ExternalClientType' + correlationID: + $ref: '#/components/schemas/CorrelationID' + amfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + locationQoS: + $ref: '#/components/schemas/LocationQoS' + supportedGADShapes: + type: array + items: + $ref: '#/components/schemas/SupportedGADShapes' + minItems: 1 + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + ecgiOnSecondNode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + ncgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + ncgiOnSecondNode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + priority: + $ref: '#/components/schemas/LcsPriority' + velocityRequested: + $ref: '#/components/schemas/VelocityRequested' + ueLcsCap: + $ref: '#/components/schemas/UeLcsCapability' + lcsServiceType: + $ref: '#/components/schemas/LcsServiceType' + ldrType: + $ref: '#/components/schemas/LdrType' + hgmlcCallBackURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ldrReference: + $ref: '#/components/schemas/LdrReference' + periodicEventInfo: + $ref: '#/components/schemas/PeriodicEventInfo' + areaEventInfo: + $ref: '#/components/schemas/AreaEventInfo' + motionEventInfo: + $ref: '#/components/schemas/MotionEventInfo' + reportingAccessTypes: + $ref: '#/components/schemas/ReportingAccessTypes' + ueConnectivityStates: + $ref: '#/components/schemas/UeConnectivityState' + ueLocationServiceInd: + $ref: '#/components/schemas/UeLocationServiceInd' + lppMessage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + + LocationData: + type: object + required: + - locationEstimate + properties: + locationEstimate: + $ref: '#/components/schemas/GeographicArea' + accuracyFulfilmentIndicator: + $ref: '#/components/schemas/AccuracyFulfilmentIndicator' + ageOfLocationEstimate: + $ref: '#/components/schemas/AgeOfLocationEstimate' + velocityEstimate: + $ref: '#/components/schemas/VelocityEstimate' + civicAddress: + $ref: '#/components/schemas/CivicAddress' + positioningDataList: + type: array + items: + $ref: '#/components/schemas/PositioningMethodAndUsage' + minItems: 1 + gnssPositioningDataList: + type: array + items: + $ref: '#/components/schemas/GnssPositioningMethodAndUsage' + minItems: 1 + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + ncgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + altitude: + $ref: '#/components/schemas/Altitude' + barometricPressure: + $ref: '#/components/schemas/BarometricPressure' + servingLMFIdentification: + $ref: '#/components/schemas/LMFIdentification' + GeographicArea: + anyOf: + - $ref: '#/components/schemas/Point' + - $ref: '#/components/schemas/PointUncertaintyCircle' + - $ref: '#/components/schemas/PointUncertaintyEllipse' + - $ref: '#/components/schemas/Polygon' + - $ref: '#/components/schemas/PointAltitude' + - $ref: '#/components/schemas/PointAltitudeUncertainty' + - $ref: '#/components/schemas/EllipsoidArc' + GADShape: + type: object + required: + - shape + properties: + shape: + $ref: '#/components/schemas/SupportedGADShapes' + discriminator: + propertyName: shape + mapping: + POINT: '#/components/schemas/Point' + POINT_UNCERTAINTY_CIRCLE: '#/components/schemas/PointUncertaintyCircle' + POINT_UNCERTAINTY_ELLIPSE: '#/components/schemas/PointUncertaintyEllipse' + POLYGON: '#/components/schemas/Polygon' + POINT_ALTITUDE: '#/components/schemas/PointAltitude' + POINT_ALTITUDE_UNCERTAINTY: '#/components/schemas/PointAltitudeUncertainty' + ELLIPSOID_ARC: '#/components/schemas/EllipsoidArc' + Point: + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - point + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + PointUncertaintyCircle: + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - point + - uncertainty + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + uncertainty: + $ref: '#/components/schemas/Uncertainty' + PointUncertaintyEllipse: + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - point + - uncertaintyEllipse + - confidence + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + uncertaintyEllipse: + $ref: '#/components/schemas/UncertaintyEllipse' + confidence: + $ref: '#/components/schemas/Confidence' + Polygon: + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - pointList + properties: + pointList: + $ref: '#/components/schemas/PointList' + PointAltitude: + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - point + - altitude + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + altitude: + $ref: '#/components/schemas/Altitude' + PointAltitudeUncertainty: + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - point + - altitude + - uncertaintyEllipse + - uncertaintyAltitude + - confidence + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + altitude: + $ref: '#/components/schemas/Altitude' + uncertaintyEllipse: + $ref: '#/components/schemas/UncertaintyEllipse' + uncertaintyAltitude: + $ref: '#/components/schemas/Uncertainty' + confidence: + $ref: '#/components/schemas/Confidence' + EllipsoidArc: + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - point + - innerRadius + - uncertaintyRadius + - offsetAngle + - includedAngle + - confidence + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + innerRadius: + $ref: '#/components/schemas/InnerRadius' + uncertaintyRadius: + $ref: '#/components/schemas/Uncertainty' + offsetAngle: + $ref: '#/components/schemas/Angle' + includedAngle: + $ref: '#/components/schemas/Angle' + confidence: + $ref: '#/components/schemas/Confidence' + GeographicalCoordinates: + type: object + required: + - lon + - lat + properties: + lon: + type: number + format: double + minimum: -180 + maximum: 180 + lat: + type: number + format: double + minimum: -90 + maximum: 90 + UncertaintyEllipse: + type: object + required: + - semiMajor + - semiMinor + - orientationMajor + properties: + semiMajor: + $ref: '#/components/schemas/Uncertainty' + semiMinor: + $ref: '#/components/schemas/Uncertainty' + orientationMajor: + $ref: '#/components/schemas/Orientation' + PointList: + type: array + items: + $ref: '#/components/schemas/GeographicalCoordinates' + minItems: 3 + maxItems: 15 + LocationQoS: + type: object + properties: + hAccuracy: + $ref: '#/components/schemas/Accuracy' + vAccuracy: + $ref: '#/components/schemas/Accuracy' + verticalRequested: + type: boolean + responseTime: + $ref: '#/components/schemas/ResponseTime' + lcsQosClass: + $ref: '#/components/schemas/LcsQosClass' + PositioningMethodAndUsage: + type: object + required: + - method + - mode + - usage + properties: + method: + $ref: '#/components/schemas/PositioningMethod' + mode: + $ref: '#/components/schemas/PositioningMode' + usage: + $ref: '#/components/schemas/Usage' + GnssPositioningMethodAndUsage: + type: object + required: + - mode + - gnss + - usage + properties: + mode: + $ref: '#/components/schemas/PositioningMode' + gnss: + $ref: '#/components/schemas/GnssId' + usage: + $ref: '#/components/schemas/Usage' + CivicAddress: + type: object + properties: + country: + type: string + A1: + type: string + A2: + type: string + A3: + type: string + A4: + type: string + A5: + type: string + A6: + type: string + PRD: + type: string + POD: + type: string + STS: + type: string + HNO: + type: string + HNS: + type: string + LMK: + type: string + LOC: + type: string + NAM: + type: string + PC: + type: string + BLD: + type: string + UNIT: + type: string + FLR: + type: string + ROOM: + type: string + PLC: + type: string + PCN: + type: string + POBOX: + type: string + ADDCODE: + type: string + SEAT: + type: string + RD: + type: string + RDSEC: + type: string + RDBR: + type: string + RDSUBBR: + type: string + PRM: + type: string + POM: + type: string + VelocityEstimate: + oneOf: + - $ref: '#/components/schemas/HorizontalVelocity' + - $ref: '#/components/schemas/HorizontalWithVerticalVelocity' + - $ref: '#/components/schemas/HorizontalVelocityWithUncertainty' + - $ref: '#/components/schemas/HorizontalWithVerticalVelocityAndUncertainty' + HorizontalVelocity: + type: object + required: + - hSpeed + - bearing + properties: + hSpeed: + $ref: '#/components/schemas/HorizontalSpeed' + bearing: + $ref: '#/components/schemas/Angle' + HorizontalWithVerticalVelocity: + type: object + required: + - hSpeed + - bearing + - vSpeed + - vDirection + properties: + hSpeed: + $ref: '#/components/schemas/HorizontalSpeed' + bearing: + $ref: '#/components/schemas/Angle' + vSpeed: + $ref: '#/components/schemas/VerticalSpeed' + vDirection: + $ref: '#/components/schemas/VerticalDirection' + HorizontalVelocityWithUncertainty: + type: object + required: + - hSpeed + - bearing + - hUncertainty + properties: + hSpeed: + $ref: '#/components/schemas/HorizontalSpeed' + bearing: + $ref: '#/components/schemas/Angle' + hUncertainty: + $ref: '#/components/schemas/SpeedUncertainty' + HorizontalWithVerticalVelocityAndUncertainty: + type: object + required: + - hSpeed + - bearing + - vSpeed + - vDirection + - hUncertainty + - vUncertainty + properties: + hSpeed: + $ref: '#/components/schemas/HorizontalSpeed' + bearing: + $ref: '#/components/schemas/Angle' + vSpeed: + $ref: '#/components/schemas/VerticalSpeed' + vDirection: + $ref: '#/components/schemas/VerticalDirection' + hUncertainty: + $ref: '#/components/schemas/SpeedUncertainty' + vUncertainty: + $ref: '#/components/schemas/SpeedUncertainty' + UeLcsCapability: + type: object + properties: + lppSupport: + type: boolean + default: true + ciotOptimisation: + type: boolean + default: false + PeriodicEventInfo: + type: object + required: + - reportingAmount + - reportingInterval + properties: + reportingAmount: + $ref: '#/components/schemas/ReportingAmount' + reportingInterval: + $ref: '#/components/schemas/ReportingInterval' + AreaEventInfo: + type: object + required: + - areaDefinition + properties: + areaDefinition: + type: array + items: + $ref: '#/components/schemas/ReportingArea' + minItems: 1 + maxItems: 250 + occurrenceInfo: + $ref: '#/components/schemas/OccurrenceInfo' + minimumInterval: + $ref: '#/components/schemas/MinimumInterval' + maximumInterval: + $ref: '#/components/schemas/MaximumInterval' + samplingInterval: + $ref: '#/components/schemas/SamplingInterval' + reportingDuration: + $ref: '#/components/schemas/ReportingDuration' + reportingLocationReq: + type: boolean + default: true + ReportingArea: + type: object + required: + - areaType + properties: + areaType: + $ref: '#/components/schemas/ReportingAreaType' + tai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + ncgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + MotionEventInfo: + type: object + required: + - linearDistance + properties: + linearDistance: + $ref: '#/components/schemas/LinearDistance' + occurrenceInfo: + $ref: '#/components/schemas/OccurrenceInfo' + minimumInterval: + $ref: '#/components/schemas/MinimumInterval' + maximumInterval: + $ref: '#/components/schemas/MaximumInterval' + samplingInterval: + $ref: '#/components/schemas/SamplingInterval' + reportingDuration: + $ref: '#/components/schemas/ReportingDuration' + reportingLocationReq: + type: boolean + default: true + ReportingAccessTypes: + type: array + items: + $ref: '#/components/schemas/ReportingAccessType' + minItems: 1 + CancelLocData: + type: object + required: + - hgmlcCallBackURI + - ldrReference + properties: + hgmlcCallBackURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ldrReference: + $ref: '#/components/schemas/LdrReference' + LocContextData: + type: object + required: + - amfId + - ldrType + - hgmlcCallBackURI + - ldrReference + - eventReportMessage + properties: + amfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + locationQoS: + $ref: '#/components/schemas/LocationQoS' + supportedGADShapes: + type: array + items: + $ref: '#/components/schemas/SupportedGADShapes' + minItems: 1 + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + ldrType: + $ref: '#/components/schemas/LdrType' + hgmlcCallBackURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ldrReference: + $ref: '#/components/schemas/LdrReference' + periodicEventInfo: + $ref: '#/components/schemas/PeriodicEventInfo' + areaEventInfo: + $ref: '#/components/schemas/AreaEventInfo' + motionEventInfo: + $ref: '#/components/schemas/MotionEventInfo' + eventReportMessage: + $ref: '#/components/schemas/EventReportMessage' + eventReportingStatus: + $ref: '#/components/schemas/EventReportingStatus' + ueLocationInfo: + $ref: '#/components/schemas/UELocationInfo' + EventReportMessage: + type: object + required: + - eventClass + - eventContent + properties: + eventClass: + $ref: '#/components/schemas/EventClass' + eventContent: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + EventReportingStatus: + type: object + properties: + eventReportCounter: + $ref: '#/components/schemas/EventReportCounter' + eventReportDuration: + $ref: '#/components/schemas/EventReportDuration' + UELocationInfo: + type: object + properties: + locationEstimate: + $ref: '#/components/schemas/GeographicArea' + ageOfLocationEstimate: + $ref: '#/components/schemas/AgeOfLocationEstimate' + velocityEstimate: + $ref: '#/components/schemas/VelocityEstimate' + ageOfVelocityEstimate: + $ref: '#/components/schemas/AgeOfLocationEstimate' + + EventNotifyData: + type: object + required: + - reportedEventType + - ldrReference + properties: + reportedEventType: + $ref: '#/components/schemas/ReportedEventType' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + hgmlcCallBackURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ldrReference: + $ref: '#/components/schemas/LdrReference' + locationEstimate: + $ref: '#/components/schemas/GeographicArea' + ageOfLocationEstimate: + $ref: '#/components/schemas/AgeOfLocationEstimate' + civicAddress: + $ref: '#/components/schemas/CivicAddress' + positioningDataList: + type: array + items: + $ref: '#/components/schemas/PositioningMethodAndUsage' + minItems: 1 + gnssPositioningDataList: + type: array + items: + $ref: '#/components/schemas/GnssPositioningMethodAndUsage' + minItems: 1 + servingLMFidentification: + $ref: '#/components/schemas/LMFIdentification' + terminationCause: + $ref: '#/components/schemas/TerminationCause' + + UeConnectivityState: + type: object + required: + - accessType + properties: + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + connectivitystate: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/CmState' +# +# +# SIMPLE TYPES +# + Altitude: + type: number + format: double + minimum: -32767 + maximum: 32767 + Angle: + type: integer + minimum: 0 + maximum: 360 + Uncertainty: + type: number + format: float + minimum: 0 + Orientation: + type: integer + minimum: 0 + maximum: 180 + Confidence: + type: integer + minimum: 0 + maximum: 100 + Accuracy: + type: number + format: float + minimum: 0 + InnerRadius: + type: integer + format: int32 + minimum: 0 + maximum: 327675 + CorrelationID: + type: string + minLength: 1 + maxLength: 255 + AgeOfLocationEstimate: + type: integer + minimum: 0 + maximum: 32767 + HorizontalSpeed: + type: number + format: float + minimum: 0 + maximum: 2047 + VerticalSpeed: + type: number + format: float + minimum: 0 + maximum: 255 + SpeedUncertainty: + type: number + format: float + minimum: 0 + maximum: 255 + BarometricPressure: + type: integer + minimum: 30000 + maximum: 115000 + LcsServiceType: + type: integer + minimum: 0 + maximum: 127 + LdrReference: + type: string + minLength: 2 + maxLength: 510 + ReportingAmount: + type: integer + minimum: 1 + maximum: 8639999 + ReportingInterval: + type: integer + minimum: 1 + maximum: 8639999 + MinimumInterval: + type: integer + minimum: 1 + maximum: 32767 + MaximumInterval: + type: integer + minimum: 1 + maximum: 86400 + SamplingInterval: + type: integer + minimum: 1 + maximum: 3600 + ReportingDuration: + type: integer + minimum: 1 + maximum: 8640000 + LinearDistance: + type: integer + minimum: 1 + maximum: 10000 + LMFIdentification: + type: string + EventReportCounter: + type: integer + minimum: 1 + maximum: 8640000 + EventReportDuration: + type: integer + minimum: 1 + maximum: 8640000 +# +# ENUMS +# + ExternalClientType: + anyOf: + - type: string + enum: + - EMERGENCY_SERVICES + - VALUE_ADDED_SERVICES + - PLMN_OPERATOR_SERVICES + - LAWFUL_INTERCEPT_SERVICES + - PLMN_OPERATOR_BROADCAST_SERVICES + - PLMN_OPERATOR_OM + - PLMN_OPERATOR_ANONYMOUS_STATISTICS + - PLMN_OPERATOR_TARGET_MS_SERVICE_SUPPORT + - type: string + SupportedGADShapes: + anyOf: + - type: string + enum: + - POINT + - POINT_UNCERTAINTY_CIRCLE + - POINT_UNCERTAINTY_ELLIPSE + - POLYGON + - POINT_ALTITUDE + - POINT_ALTITUDE_UNCERTAINTY + - ELLIPSOID_ARC + - type: string + ResponseTime: + anyOf: + - type: string + enum: + - LOW_DELAY + - DELAY_TOLERANT + - type: string + PositioningMethod: + anyOf: + - type: string + enum: + - CELLID + - ECID + - OTDOA + - BAROMETRIC_PRESSURE + - WLAN + - BLUETOOTH + - MBS + - MOTION_SENSOR + - type: string + PositioningMode: + anyOf: + - type: string + enum: + - UE_BASED + - UE_ASSISTED + - CONVENTIONAL + - type: string + GnssId: + anyOf: + - type: string + enum: + - GPS + - GALILEO + - SBAS + - MODERNIZED_GPS + - QZSS + - GLONASS + - type: string + Usage: + anyOf: + - type: string + enum: + - UNSUCCESS + - SUCCESS_RESULTS_NOT_USED + - SUCCESS_RESULTS_USED_TO_VERIFY_LOCATION + - SUCCESS_RESULTS_USED_TO_GENERATE_LOCATION + - SUCCESS_METHOD_NOT_DETERMINED + - type: string + LcsPriority: + anyOf: + - type: string + enum: + - HIGHEST_PRIORITY + - NORMAL_PRIORITY + - type: string + VelocityRequested: + anyOf: + - type: string + enum: + - VELOCITY_IS_NOT_REQUESTED + - VELOCITY_IS_REQUESTED + - type: string + AccuracyFulfilmentIndicator: + anyOf: + - type: string + enum: + - REQUESTED_ACCURACY_FULFILLED + - REQUESTED_ACCURACY_NOT_FULFILLED + - type: string + VerticalDirection: + type: string + enum: + - UPWARD + - DOWNWARD + LdrType: + anyOf: + - type: string + enum: + - UE_AVAILABLE + - PERIODIC + - ENTERING_INTO_AREA + - LEAVING_FROM_AREA + - BEING_INSIDE_AREA + - MOTION + - type: string + ReportingAreaType: + anyOf: + - type: string + enum: + - EPS_TRACKING_AREA_IDENTITY + - E-UTRAN_CELL_GLOBAL_IDENTIFICATION + - 5GS_TRACKING_AREA_IDENTITY + - NR_CELL_GLOBAL_IDENTITY + - type: string + OccurrenceInfo: + anyOf: + - type: string + enum: + - ONE_TIME_EVENT + - MULTIPLE_TIME_EVENT + - type: string + ReportingAccessType: + anyOf: + - type: string + enum: + - NR + - EUTRA_CONNECTED_TO_5GC + - NON_3GPP_CONNECTED_TO_5GC + - type: string + EventClass: + anyOf: + - type: string + enum: + - SUPPLEMENTARY_SERVICES + - type: string + ReportedEventType: + anyOf: + - type: string + enum: + - PERIODIC_EVENT + - ENTERING_AREA_EVENT + - LEAVING_AREA_EVENT + - BEING_INSIDE_AREA_EVENT + - MOTION_EVENT + - MAXIMUM_INTERVAL_EXPIRATION_EVENT + - LOCATION_CANCELLATION_EVENT + - type: string + TerminationCause: + anyOf: + - type: string + enum: + - TERMINATION_BY_UE + - TERMINATION_BY_NETWORK + - NORMAL_TERMINATION + - type: string + LcsQosClass: + anyOf: + - type: string + enum: + - BEST_EFFORT + - ASSURED + - type: string + + UeLocationServiceInd: + anyOf: + - type: string + enum: + - LOCATION_ESTIMATE + - LOCATION_ASSISTANCE_DATA + - type: string diff --git a/lib/sbi/support/3gpp-spec/TS29122_AsSessionWithQoS.yaml b/lib/sbi/support/standard/TS29122_AsSessionWithQoS.yaml similarity index 99% rename from lib/sbi/support/3gpp-spec/TS29122_AsSessionWithQoS.yaml rename to lib/sbi/support/standard/TS29122_AsSessionWithQoS.yaml index ead52fa595..8f7864f360 100644 --- a/lib/sbi/support/3gpp-spec/TS29122_AsSessionWithQoS.yaml +++ b/lib/sbi/support/standard/TS29122_AsSessionWithQoS.yaml @@ -4,7 +4,7 @@ info: version: 1.1.0.alpha-2 description: | API for setting us an AS session with required QoS. - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. externalDocs: description: 3GPP TS 29.122 V16.5.0 T8 reference point for Northbound APIs @@ -388,7 +388,7 @@ components: $ref: '#/components/schemas/QosMonitoringInformation' requestTestNotification: type: boolean - description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in subclause 5.2.5.3. Set to false or omitted otherwise. + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in subclause 5.2.5.3. Set to false or omitted otherwise. websockNotifConfig: $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' required: diff --git a/lib/sbi/support/3gpp-spec/TS29122_ChargeableParty.yaml b/lib/sbi/support/standard/TS29122_ChargeableParty.yaml similarity index 98% rename from lib/sbi/support/3gpp-spec/TS29122_ChargeableParty.yaml rename to lib/sbi/support/standard/TS29122_ChargeableParty.yaml index 205152fc5f..19144da3a4 100644 --- a/lib/sbi/support/3gpp-spec/TS29122_ChargeableParty.yaml +++ b/lib/sbi/support/standard/TS29122_ChargeableParty.yaml @@ -4,7 +4,7 @@ info: version: 1.1.0.alpha-1 description: | API for Chargeable Party management. - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. externalDocs: description: 3GPP TS 29.122 V16.3.0 T8 reference point for Northbound APIs @@ -304,7 +304,7 @@ components: $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' requestTestNotification: type: boolean - description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in subclause 5.2.5.3. Set to false or omitted otherwise. + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in subclause 5.2.5.3. Set to false or omitted otherwise. websockNotifConfig: $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' ipv4Addr: diff --git a/lib/sbi/support/standard/TS29122_CommonData.yaml b/lib/sbi/support/standard/TS29122_CommonData.yaml new file mode 100644 index 0000000000..42b0fd51ca --- /dev/null +++ b/lib/sbi/support/standard/TS29122_CommonData.yaml @@ -0,0 +1,505 @@ +openapi: 3.0.0 +info: + title: TS 29.122 Common Data Types + version: 1.1.0.alpha-2 + description: | + Data types applicable to several APIs. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.122 V16.5.0 T8 reference point for Northbound APIs + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +paths: {} +components: + schemas: + SponsorInformation: + type: object + properties: + sponsorId: + type: string + description: It indicates Sponsor ID. + aspId: + type: string + description: It indicates Application Service Provider ID. + required: + - sponsorId + - aspId + UsageThreshold: + type: object + properties: + duration: + $ref: '#/components/schemas/DurationSec' + totalVolume: + $ref: '#/components/schemas/Volume' + downlinkVolume: + $ref: '#/components/schemas/Volume' + uplinkVolume: + $ref: '#/components/schemas/Volume' + UsageThresholdRm: + type: object + properties: + duration: + $ref: '#/components/schemas/DurationSecRm' + totalVolume: + $ref: '#/components/schemas/VolumeRm' + downlinkVolume: + $ref: '#/components/schemas/VolumeRm' + uplinkVolume: + $ref: '#/components/schemas/VolumeRm' + nullable: true + TimeWindow: + type: object + properties: + startTime: + $ref: '#/components/schemas/DateTime' + stopTime: + $ref: '#/components/schemas/DateTime' + required: + - startTime + - stopTime + Acknowledgement: + type: object + properties: + details: + type: string + description: A human-readable explanation specific to this successful acknowledgement + required: + - details + NotificationData: + type: object + properties: + transaction: + $ref: '#/components/schemas/Link' + eventReports: + type: array + items: + $ref: '#/components/schemas/EventReport' + minItems: 1 + description: Contains the reported event and applicable information + required: + - transaction + - eventReports + EventReport: + type: object + properties: + event: + $ref: '#/components/schemas/Event' + accumulatedUsage: + $ref: '#/components/schemas/AccumulatedUsage' + flowIds: + type: array + items: + type: integer + minItems: 1 + description: Identifies the IP flows that were sent during event subscription + required: + - event + AccumulatedUsage: + type: object + properties: + duration: + $ref: '#/components/schemas/DurationSec' + totalVolume: + $ref: '#/components/schemas/Volume' + downlinkVolume: + $ref: '#/components/schemas/Volume' + uplinkVolume: + $ref: '#/components/schemas/Volume' + FlowInfo: + type: object + properties: + flowId: + type: integer + description: Indicates the IP flow. + flowDescriptions: + type: array + items: + type: string + description: Indicates the packet filters of the IP flow. Refer to subclause 5.3.8 of 3GPP TS 29.214 for encoding. It shall contain UL and/or DL IP flow description. + minItems: 1 + maxItems: 2 + required: + - flowId + TestNotification: + type: object + properties: + subscription: + $ref: '#/components/schemas/Link' + required: + - subscription + WebsockNotifConfig: + type: object + properties: + websocketUri: + $ref: '#/components/schemas/Link' + requestWebsocketUri: + type: boolean + description: Set by the SCS/AS to indicate that the Websocket delivery is requested. + LocationArea: + type: object + properties: + cellIds: + type: array + items: + type: string + minItems: 1 + description: Indicates a list of Cell Global Identities of the user which identifies the cell the UE is registered. + enodeBIds: + type: array + items: + type: string + minItems: 1 + description: Indicates a list of eNodeB identities in which the UE is currently located. + routingAreaIds: + type: array + items: + type: string + minItems: 1 + description: Identifies a list of Routing Area Identities of the user where the UE is located. + trackingAreaIds: + type: array + items: + type: string + minItems: 1 + description: Identifies a list of Tracking Area Identities of the user where the UE is located. + geographicAreas: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + description: Identifies a list of geographic area of the user where the UE is located. + civicAddresses: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' + minItems: 1 + description: Identifies a list of civic addresses of the user where the UE is located. + LocationArea5G: + type: object + properties: + geographicAreas: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 0 + description: Identifies a list of geographic area of the user where the UE is located. + civicAddresses: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' + minItems: 0 + description: Identifies a list of civic addresses of the user where the UE is located. + nwAreaInfo: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + ProblemDetails: + type: object + properties: + type: + $ref: '#/components/schemas/Uri' + title: + type: string + description: A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem. + status: + type: integer + description: The HTTP status code for this occurrence of the problem. + detail: + type: string + description: A human-readable explanation specific to this occurrence of the problem. + instance: + $ref: '#/components/schemas/Uri' + cause: + type: string + description: A machine-readable application error cause specific to this occurrence of the problem. This IE should be present and provide application-related error information, if available. + invalidParams: + type: array + items: + $ref: '#/components/schemas/InvalidParam' + minItems: 1 + description: Description of invalid parameters, for a request rejected due to invalid parameters. + InvalidParam: + type: object + properties: + param: + type: string + description: Attribute's name encoded as a JSON Pointer, or header's name. + reason: + type: string + description: A human-readable reason, e.g. "must be a positive integer". + required: + - param + PlmnId: + type: object + properties: + mcc: + $ref: '#/components/schemas/Mcc' + mnc: + $ref: '#/components/schemas/Mnc' + required: + - mcc + - mnc + ConfigResult: + type: object + properties: + externalIds: + type: array + items: + $ref: '#/components/schemas/ExternalId' + minItems: 1 + description: Each element indicates an external identifier of the UE. + msisdns: + type: array + items: + $ref: '#/components/schemas/Msisdn' + minItems: 1 + description: Each element identifies the MS internal PSTN/ISDN number allocated for the UE. + resultReason: + $ref: '#/components/schemas/ResultReason' + required: + - resultReason + oneOf: + - required: [externalIds] + - required: [msisdns] + Bandwidth: + type: integer + minimum: 0 + description: integer indicating a bandwidth in bits per second. + BdtReferenceId: + type: string + description: string identifying a BDT Reference ID as defined in subclause 5.3.3 of 3GPP TS 29.154. + BdtReferenceIdRm: + type: string + description: This data type is defined in the same way as the BdtReferenceId data type, but with the nullable property set to true. + nullable: true + Binary: + type: string + description: string with format "binary" as defined in OpenAPI Specification. + Bytes: + type: string + description: String with format "byte" as defined in OpenAPI Specification, i.e, base64-encoded characters. + DayOfWeek: + type: integer + minimum: 1 + maximum: 7 + description: integer between and including 1 and 7 denoting a weekday. 1 shall indicate Monday, and the subsequent weekdays shall be indicated with the next higher numbers. 7 shall indicate Sunday. + DateTime: + type: string + description: string with format "date-time" as defined in OpenAPI. + DateTimeRm: + type: string + description: string with format "date-time" as defined in OpenAPI with "nullable=true" property. + nullable: true + DateTimeRo: + type: string + description: string with format "date-time" as defined in OpenAPI with "readOnly=true" property. + readOnly: true + DurationSec: + type: integer + minimum: 0 + description: Unsigned integer identifying a period of time in units of seconds. + DurationSecRm: + type: integer + minimum: 0 + description: Unsigned integer identifying a period of time in units of seconds with "nullable=true" property. + nullable: true + DurationSecRo: + type: integer + minimum: 0 + description: Unsigned integer identifying a period of time in units of seconds with "readOnly=true" property. + readOnly: true + DurationMin: + type: integer + format: int32 + minimum: 0 + description: Unsigned integer identifying a period of time in units of minutes. + ExternalId: + type: string + description: string containing a local identifier followed by "@" and a domain identifier. Both the local identifier and the domain identifier shall be encoded as strings that do not contain any "@" characters. See Clause 4.6.2 of 3GPP TS 23.682 for more information. + ExternalGroupId: + type: string + description: string containing a local identifier followed by "@" and a domain identifier. Both the local identifier and the domain identifier shall be encoded as strings that do not contain any "@" characters. See Clauses 4.6.2 and 4.6.3 of 3GPP TS 23.682 for more information. + Ipv4Addr: + type: string + description: string identifying a Ipv4 address formatted in the "dotted decimal" notation as defined in IETF RFC 1166. + Ipv6Addr: + type: string + description: string identifying a Ipv6 address formatted according to clause 4 in IETF RFC 5952. The mixed Ipv4 Ipv6 notation according to clause 5 of IETF RFC 5952 shall not be used. + Ipv4AddrRo: + type: string + description: string identifying a Ipv4 address formatted in the "dotted decimal" notation as defined in IETF RFC 1166, with "readOnly=true" property. + readOnly: true + Ipv6AddrRo: + type: string + description: string identifying a Ipv6 address formatted according to clause 4 in IETF RFC 5952, with "readOnly=true" property. The mixed Ipv4 Ipv6 notation according to clause 5 of IETF RFC 5952 shall not be used. + readOnly: true + Link: + type: string + description: string formatted according to IETF RFC 3986 identifying a referenced resource. + Mcc: + type: string + description: String encoding a Mobile Country Code part of the PLMN, comprising 3 digits, as defined in 3GPP TS 38.413. + Mnc: + type: string + description: String encoding a Mobile Network Code part of the PLMN, comprising 2 or 3 digits, as defined in 3GPP TS 38.413. + Msisdn: + type: string + description: string formatted according to subclause 3.3 of 3GPP TS 23.003 that describes an MSISDN. + Port: + type: integer + description: Unsigned integer with valid values between 0 and 65535. + minimum: 0 + maximum: 65535 + PortRo: + type: integer + description: Unsigned integer with valid values between 0 and 65535, with "readOnly=true" property. + minimum: 0 + maximum: 65535 + readOnly: true + ResourceId: + type: string + description: string chosen by the SCEF to serve as identifier in a resource URI. + ScsAsId: + type: string + description: string that identifies an SCS/AS. + TimeOfDay: + type: string + description: String with format partial-time or full-time as defined in subclause 5.6 of IETF RFC 3339. Examples, 20:15:00, 20:15:00-08:00 (for 8 hours behind UTC). + Uri: + type: string + description: string providing an URI formatted according to IETF RFC 3986. + Volume: + type: integer + format: int64 + minimum: 0 + description: Unsigned integer identifying a volume in units of bytes. + VolumeRm: + type: integer + format: int64 + minimum: 0 + description: Unsigned integer identifying a volume in units of bytes with "nullable=true" property. + nullable: true + Event: + anyOf: + - type: string + enum: + - SESSION_TERMINATION + - LOSS_OF_BEARER + - RECOVERY_OF_BEARER + - RELEASE_OF_BEARER + - USAGE_REPORT + - FAILED_RESOURCES_ALLOCATION + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - SESSION_TERMINATION: Indicates that Rx session is terminated. + - LOSS_OF_BEARER : Indicates a loss of a bearer. + - RECOVERY_OF_BEARER: Indicates a recovery of a bearer. + - RELEASE_OF_BEARER: Indicates a release of a bearer. + - USAGE_REPORT: Indicates the usage report event. + - FAILED_RESOURCES_ALLOCATION: Indicates the resource allocation is failed. + ResultReason: + anyOf: + - type: string + enum: + - ROAMING_NOT_ALLOWED + - OTHER_REASON + - type: string + description: > + This string provides a failure reason. + description: > + Possible values are + - ROAMING_NOT_ALLOWED: Identifies the configuration parameters are not allowed by roaming agreement. + - OTHER_REASON: Identifies the configuration parameters are not configured due to other reason. +# +# HTTP responses +# + responses: + '400': + description: Bad request + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '401': + description: Unauthorized + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '403': + description: Forbidden + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '404': + description: Not Found + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '406': + description: Not Acceptable + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '409': + description: Conflict + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '411': + description: Length Required + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '412': + description: Precondition Failed + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '413': + description: Payload Too Large + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '414': + description: URI Too Long + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '415': + description: Unsupported Media Type + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '429': + description: Too Many Requests + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '500': + description: Internal Server Error + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '503': + description: Service Unavailable + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + default: + description: Generic Error diff --git a/lib/sbi/support/3gpp-spec/TS29122_CpProvisioning.yaml b/lib/sbi/support/standard/TS29122_CpProvisioning.yaml similarity index 99% rename from lib/sbi/support/3gpp-spec/TS29122_CpProvisioning.yaml rename to lib/sbi/support/standard/TS29122_CpProvisioning.yaml index ad4c1c763e..32ad3e2c73 100644 --- a/lib/sbi/support/3gpp-spec/TS29122_CpProvisioning.yaml +++ b/lib/sbi/support/standard/TS29122_CpProvisioning.yaml @@ -4,7 +4,7 @@ info: version: 1.1.0.alpha-2 description: | API for provisioning communication pattern parameters. - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. externalDocs: description: 3GPP TS 29.122 V16.4.0 T8 reference point for Northbound APIs diff --git a/lib/sbi/support/3gpp-spec/TS29122_DeviceTriggering.yaml b/lib/sbi/support/standard/TS29122_DeviceTriggering.yaml similarity index 98% rename from lib/sbi/support/3gpp-spec/TS29122_DeviceTriggering.yaml rename to lib/sbi/support/standard/TS29122_DeviceTriggering.yaml index 9916e31b92..28178b4de1 100644 --- a/lib/sbi/support/3gpp-spec/TS29122_DeviceTriggering.yaml +++ b/lib/sbi/support/standard/TS29122_DeviceTriggering.yaml @@ -4,7 +4,7 @@ info: version: 1.0.2 description: | API for device trigger. - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. externalDocs: description: 3GPP TS 29.122 V16.4.0 T8 reference point for Northbound APIs @@ -324,7 +324,7 @@ components: $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' requestTestNotification: type: boolean - description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in subclause 5.2.5.3. Set to false or omitted otherwise. + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in subclause 5.2.5.3. Set to false or omitted otherwise. websockNotifConfig: $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' deliveryResult: diff --git a/lib/sbi/support/3gpp-spec/TS29122_ECRControl.yaml b/lib/sbi/support/standard/TS29122_ECRControl.yaml similarity index 97% rename from lib/sbi/support/3gpp-spec/TS29122_ECRControl.yaml rename to lib/sbi/support/standard/TS29122_ECRControl.yaml index 9d91eb21b7..09fe3840aa 100644 --- a/lib/sbi/support/3gpp-spec/TS29122_ECRControl.yaml +++ b/lib/sbi/support/standard/TS29122_ECRControl.yaml @@ -4,7 +4,7 @@ info: version: 1.0.1 description: | API for enhanced converage restriction control. - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. externalDocs: description: 3GPP TS 29.122 V15.4.0 T8 reference point for Northbound APIs @@ -155,4 +155,4 @@ components: required: - supportedFeatures not: - required: [restrictedPlmnIds, allowedPlmnIds] \ No newline at end of file + required: [restrictedPlmnIds, allowedPlmnIds] diff --git a/lib/sbi/support/3gpp-spec/TS29122_GMDviaMBMSbyMB2.yaml b/lib/sbi/support/standard/TS29122_GMDviaMBMSbyMB2.yaml similarity index 99% rename from lib/sbi/support/3gpp-spec/TS29122_GMDviaMBMSbyMB2.yaml rename to lib/sbi/support/standard/TS29122_GMDviaMBMSbyMB2.yaml index ecf8b6981c..8aa65b2bce 100644 --- a/lib/sbi/support/3gpp-spec/TS29122_GMDviaMBMSbyMB2.yaml +++ b/lib/sbi/support/standard/TS29122_GMDviaMBMSbyMB2.yaml @@ -3,7 +3,7 @@ info: title: GMDviaMBMSbyMB2 description: | API for Group Message Delivery via MBMS by MB2 - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. version: 1.0.1 externalDocs: @@ -688,7 +688,7 @@ components: $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' requestTestNotification: type: boolean - description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in subclause 5.2.5.3. Set to false or omitted otherwise. + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in subclause 5.2.5.3. Set to false or omitted otherwise. websockNotifConfig: $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' externalGroupId: @@ -768,4 +768,4 @@ components: items: $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' minItems: 1 - description: Identifies a civic address of the user where the UE is located. \ No newline at end of file + description: Identifies a civic address of the user where the UE is located. diff --git a/lib/sbi/support/3gpp-spec/TS29122_GMDviaMBMSbyxMB.yaml b/lib/sbi/support/standard/TS29122_GMDviaMBMSbyxMB.yaml similarity index 99% rename from lib/sbi/support/3gpp-spec/TS29122_GMDviaMBMSbyxMB.yaml rename to lib/sbi/support/standard/TS29122_GMDviaMBMSbyxMB.yaml index 12c3847c67..55e8be0f37 100644 --- a/lib/sbi/support/3gpp-spec/TS29122_GMDviaMBMSbyxMB.yaml +++ b/lib/sbi/support/standard/TS29122_GMDviaMBMSbyxMB.yaml @@ -3,7 +3,7 @@ info: title: GMDviaMBMSbyxMB description: | API for Group Message Delivery via MBMS by xMB - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. version: 1.0.1 externalDocs: @@ -612,7 +612,7 @@ components: $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' requestTestNotification: type: boolean - description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in subclause 5.2.5.3. Set to false or omitted otherwise. + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in subclause 5.2.5.3. Set to false or omitted otherwise. websockNotifConfig: $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' mbmsLocArea: @@ -702,4 +702,4 @@ components: Possible values are - SACH: BM-SC performs the service announcement for the current service using the SACH channel. - CONTENT_PROVIDER: BM-SC provides the necessary service access information used by the Content Provider to create the service announcement information. - readOnly: true \ No newline at end of file + readOnly: true diff --git a/lib/sbi/support/3gpp-spec/TS29122_MonitoringEvent.yaml b/lib/sbi/support/standard/TS29122_MonitoringEvent.yaml similarity index 97% rename from lib/sbi/support/3gpp-spec/TS29122_MonitoringEvent.yaml rename to lib/sbi/support/standard/TS29122_MonitoringEvent.yaml index a0282715fc..3f4ed67717 100644 --- a/lib/sbi/support/3gpp-spec/TS29122_MonitoringEvent.yaml +++ b/lib/sbi/support/standard/TS29122_MonitoringEvent.yaml @@ -4,7 +4,7 @@ info: version: 1.1.0.alpha-5 description: | API for Monitoring Event. - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. externalDocs: description: 3GPP TS 29.122 V16.5.0 T8 reference point for Northbound APIs @@ -338,7 +338,7 @@ components: $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' requestTestNotification: type: boolean - description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in subclause 5.2.5.3. Set to false or omitted otherwise. + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in subclause 5.2.5.3. Set to false or omitted otherwise. websockNotifConfig: $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' monitoringType: @@ -346,7 +346,7 @@ components: maximumNumberOfReports: type: integer minimum: 1 - description: Identifies the maximum number of event reports to be generated by the HSS, MME/SGSN as specified in subclause 5.6.0 of 3GPP TS 23.682 [2]. + description: Identifies the maximum number of event reports to be generated by the HSS, MME/SGSN as specified in subclause 5.6.0 of 3GPP TS 23.682 [2]. monitorExpireTime: $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' groupReportGuardTime: @@ -441,7 +441,7 @@ components: $ref: '#/components/schemas/LocationInfo' lossOfConnectReason: type: integer - description: If "monitoringType" is "LOSS_OF_CONNECTIVITY", this parameter shall be included if available to identify the reason why loss of connectivity is reported. Refer to 3GPP TS 29.336 [11] Subclause 8.4.58. + description: If "monitoringType" is "LOSS_OF_CONNECTIVITY", this parameter shall be included if available to identify the reason why loss of connectivity is reported. Refer to 3GPP TS 29.336 [11] Subclause 8.4.58. maxUEAvailabilityTime: $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' msisdn: @@ -543,25 +543,25 @@ components: properties: bssgpCause: type: integer - description: Identifies a non-transparent copy of the BSSGP cause code. Refer to 3GPP TS 29.128 [12]. + description: Identifies a non-transparent copy of the BSSGP cause code. Refer to 3GPP TS 29.128 [12]. causeType: type: integer - description: Identify the type of the S1AP-Cause. Refer to 3GPP TS 29.128 [12]. + description: Identify the type of the S1AP-Cause. Refer to 3GPP TS 29.128 [12]. gmmCause: type: integer - description: Identifies a non-transparent copy of the GMM cause code. Refer to 3GPP TS 29.128 [12]. + description: Identifies a non-transparent copy of the GMM cause code. Refer to 3GPP TS 29.128 [12]. ranapCause: type: integer - description: Identifies a non-transparent copy of the RANAP cause code. Refer to 3GPP TS 29.128 [12]. + description: Identifies a non-transparent copy of the RANAP cause code. Refer to 3GPP TS 29.128 [12]. ranNasCause: type: string - description: Indicates RAN and/or NAS release cause code information, TWAN release cause code information or untrusted WLAN release cause code information. Refer to 3GPP TS 29.214 [10]. + description: Indicates RAN and/or NAS release cause code information, TWAN release cause code information or untrusted WLAN release cause code information. Refer to 3GPP TS 29.214 [10]. s1ApCause: type: integer - description: Identifies a non-transparent copy of the S1AP cause code. Refer to 3GPP TS 29.128 [12]. + description: Identifies a non-transparent copy of the S1AP cause code. Refer to 3GPP TS 29.128 [12]. smCause: type: integer - description: Identifies a non-transparent copy of the SM cause code. Refer to 3GPP TS 29.128 [12]. + description: Identifies a non-transparent copy of the SM cause code. Refer to 3GPP TS 29.128 [12]. PdnConnectionInformation: type: object properties: @@ -645,7 +645,7 @@ components: - COMMUNICATION_FAILURE: The SCS/AS requests to be notified of communication failure events - AVAILABILITY_AFTER_DDN_FAILURE: The SCS/AS requests to be notified when the UE has become available after a DDN failure - NUMBER_OF_UES_IN_AN_AREA: The SCS/AS requests to be notified the number of UEs in a given geographic area - - PDN_CONNECTIVITY_STATUS: The SCS/AS requests to be notified when the 3GPP network detects that the UE's PDN connection is set up or torn down + - PDN_CONNECTIVITY_STATUS: The SCS/AS requests to be notified when the 3GPP network detects that the UE’s PDN connection is set up or torn down - DOWNLINK_DATA_DELIVERY_STATUS: The AF requests to be notified when the 3GPP network detects that the downlink data delivery status is changed. - API_SUPPORT_CAPABILITY: The SCS/AS requests to be notified of the availability of support of service APIs. ReachabilityType: diff --git a/lib/sbi/support/3gpp-spec/TS29122_MsisdnLessMoSms.yaml b/lib/sbi/support/standard/TS29122_MsisdnLessMoSms.yaml similarity index 96% rename from lib/sbi/support/3gpp-spec/TS29122_MsisdnLessMoSms.yaml rename to lib/sbi/support/standard/TS29122_MsisdnLessMoSms.yaml index 8d01eea8f3..d529e5cdef 100644 --- a/lib/sbi/support/3gpp-spec/TS29122_MsisdnLessMoSms.yaml +++ b/lib/sbi/support/standard/TS29122_MsisdnLessMoSms.yaml @@ -4,7 +4,7 @@ info: version: 1.0.1 description: | API for MSISDN-less Mobile Originated SMS. - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. externalDocs: description: 3GPP TS 29.122 V15.4.0 T8 reference point for Northbound APIs @@ -89,4 +89,4 @@ components: supportedFeatures: $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' required: - - supportedFeatures \ No newline at end of file + - supportedFeatures diff --git a/lib/sbi/support/3gpp-spec/TS29122_NIDD.yaml b/lib/sbi/support/standard/TS29122_NIDD.yaml similarity index 96% rename from lib/sbi/support/3gpp-spec/TS29122_NIDD.yaml rename to lib/sbi/support/standard/TS29122_NIDD.yaml index c322346d0a..44516d89cb 100644 --- a/lib/sbi/support/3gpp-spec/TS29122_NIDD.yaml +++ b/lib/sbi/support/standard/TS29122_NIDD.yaml @@ -4,7 +4,7 @@ info: version: 1.1.0.alpha-2 description: | API for non IP data delivery. - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. externalDocs: description: 3GPP TS 29.122 V16.5.0 T8 reference point for Northbound APIs @@ -486,26 +486,26 @@ components: $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' reliableDataService: type: boolean - description: The reliable data service (as defined in subclause 4.5.15.3 of 3GPP TS 23.682) to indicate if a reliable data service acknowledgment is enabled or not. + description: The reliable data service (as defined in subclause 4.5.15.3 of 3GPP TS 23.682) to indicate if a reliable data service acknowledgment is enabled or not. rdsPorts: type: array items: $ref: '#/components/schemas/RdsPort' minItems: 1 - description: Indicates the port configuration that is used for reliable data transfer between specific applications using RDS (as defined in subclause 5.2.4 and 5.2.5 of 3GPP TS 24.250). + description: Indicates the port configuration that is used for reliable data transfer between specific applications using RDS (as defined in subclause 5.2.4 and 5.2.5 of 3GPP TS 24.250). pdnEstablishmentOption: $ref: '#/components/schemas/PdnEstablishmentOptions' notificationDestination: $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' requestTestNotification: type: boolean - description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in subclause 5.2.5.3. Set to false or omitted otherwise. + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in subclause 5.2.5.3. Set to false or omitted otherwise. websockNotifConfig: $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' maximumPacketSize: type: integer minimum: 1 - description: The Maximum Packet Size is the maximum NIDD packet size that was transferred to the UE by the SCEF in the PCO, see subclause 4.5.14.1 of 3GPP TS 23.682. If no maximum packet size was provided to the UE by the SCEF, the SCEF sends a default configured max packet size to SCS/AS. Unit bit. + description: The Maximum Packet Size is the maximum NIDD packet size that was transferred to the UE by the SCEF in the PCO, see subclause 4.5.14.1 of 3GPP TS 23.682. If no maximum packet size was provided to the UE by the SCEF, the SCEF sends a default configured max packet size to SCS/AS. Unit bit. readOnly: true niddDownlinkDataTransfers: type: array @@ -536,7 +536,7 @@ components: $ref: 'TS29122_CommonData.yaml#/components/schemas/Bytes' reliableDataService: type: boolean - description: The reliable data service (as defined in subclause 4.5.15.3 of 3GPP TS 23.682) to indicate if a reliable data service acknowledgment is enabled or not. + description: The reliable data service (as defined in subclause 4.5.15.3 of 3GPP TS 23.682) to indicate if a reliable data service acknowledgment is enabled or not. rdsPort: $ref: '#/components/schemas/RdsPort' maximumLatency: @@ -736,7 +736,7 @@ components: description: > Possible values are - ACTIVE: The NIDD configuration is active. - - TERMINATED_UE_NOT_AUTHORIZED: The NIDD configuration was terminated because the UE's authorisation was revoked. + - TERMINATED_UE_NOT_AUTHORIZED: The NIDD configuration was terminated because the UE´s authorisation was revoked. - TERMINATED: The NIDD configuration was terminated. - RDS_PORT_UNKNOWN: The RDS port is unknown. readOnly: true @@ -747,13 +747,13 @@ components: $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTimeRm' reliableDataService: type: boolean - description: The reliable data service (as defined in subclause 4.5.15.3 of 3GPP TS 23.682) to indicate if a reliable data service acknowledgment is enabled or not. + description: The reliable data service (as defined in subclause 4.5.15.3 of 3GPP TS 23.682) to indicate if a reliable data service acknowledgment is enabled or not. nullable: true rdsPorts: type: array items: $ref: '#/components/schemas/RdsPort' minItems: 1 - description: Indicates the port configuration that is used for reliable data transfer between specific applications using RDS (as defined in subclause 5.2.4 and 5.2.5 of 3GPP TS 24.250). + description: Indicates the port configuration that is used for reliable data transfer between specific applications using RDS (as defined in subclause 5.2.4 and 5.2.5 of 3GPP TS 24.250). pdnEstablishmentOption: $ref: '#/components/schemas/PdnEstablishmentOptionsRm' diff --git a/lib/sbi/support/3gpp-spec/TS29122_NpConfiguration.yaml b/lib/sbi/support/standard/TS29122_NpConfiguration.yaml similarity index 98% rename from lib/sbi/support/3gpp-spec/TS29122_NpConfiguration.yaml rename to lib/sbi/support/standard/TS29122_NpConfiguration.yaml index b95459e6e9..bd9594fb13 100644 --- a/lib/sbi/support/3gpp-spec/TS29122_NpConfiguration.yaml +++ b/lib/sbi/support/standard/TS29122_NpConfiguration.yaml @@ -4,7 +4,7 @@ info: version: 1.1.0.alpha-2 description: | API for network parameter configuration. - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. externalDocs: description: 3GPP TS 29.122 V16.3.0 T8 reference point for Northbound APIs @@ -383,7 +383,7 @@ components: $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' requestTestNotification: type: boolean - description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in subclause 5.2.5.3. Set to false or omitted otherwise. + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in subclause 5.2.5.3. Set to false or omitted otherwise. websockNotifConfig: $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' validityTime: diff --git a/lib/sbi/support/standard/TS29122_PfdManagement.yaml b/lib/sbi/support/standard/TS29122_PfdManagement.yaml new file mode 100644 index 0000000000..27cf4e6663 --- /dev/null +++ b/lib/sbi/support/standard/TS29122_PfdManagement.yaml @@ -0,0 +1,600 @@ +openapi: 3.0.0 +info: + title: 3gpp-pfd-management + version: 1.1.0.alpha-4 + description: | + API for PFD management. + © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.122 V16.4.0 T8 reference point for Northbound APIs + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-pfd-management/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in subclause 5.2.4 of 3GPP TS 29.122. +paths: + /{scsAsId}/transactions: + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS as defined in subclause subclause 5.2.4 of 3GPP TS 29.122. + required: true + schema: + type: string + get: + responses: + '200': + description: OK. All transactions related to the request URI are returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PfdManagement' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PfdManagement' + description: Create a new transaction for PFD management. + responses: + '201': + description: Created. The transaction was created successfully. The SCEF shall return the created transaction in the response payload body. PfdReport may be included to provide detailed failure information for some applications. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdManagement' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The PFDs for all applications were not created successfully. PfdReport is included with detailed information. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PfdReport' + minItems: 1 + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + callbacks: + notificationDestination: + '{request.body#/notificationDestination}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PfdReport' + minItems: 1 + responses: + '204': + description: No Content (successful notification) + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + /{scsAsId}/transactions/{transactionId}: + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS as defined in subclause subclause 5.2.4 of 3GPP TS 29.122. + required: true + schema: + type: string + - name: transactionId + in: path + description: Transaction ID + required: true + schema: + type: string + get: + responses: + '200': + description: OK. The transaction information related to the request URI is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdManagement' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + put: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PfdManagement' + description: Change information in PFD management transaction. + responses: + '200': + description: OK. The transaction was modified successfully. The SCEF shall return an updated transaction in the response payload body. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdManagement' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The PFDs for all applications were not updated successfully. PfdReport is included with detailed information. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PfdReport' + minItems: 1 + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + delete: + responses: + '204': + description: No Content. The transaction was deleted successfully. The payload body shall be empty. + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + /{scsAsId}/transactions/{transactionId}/applications/{appId}: + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS as defined in subclause subclause 5.2.4 of 3GPP TS 29.122. + required: true + schema: + type: string + - name: transactionId + in: path + description: Transaction ID + required: true + schema: + type: string + - name: appId + in: path + description: Identifier of the application + required: true + schema: + type: string + get: + responses: + '200': + description: OK. The application information related to the request URI is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdData' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + put: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PfdData' + description: Change information in application. + responses: + '200': + description: OK. The application resource was modified successfully. The SCEF shall return an updated application resource in the response payload body. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdData' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + description: The PFDs for the application were not updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdReport' + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '409': + description: The PFDs for the application were not updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdReport' + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The PFDs for the application were not updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdReport' + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + patch: + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/PfdData' + description: Change information in PFD management transaction. + responses: + '200': + description: OK. The transaction was modified successfully. The SCEF shall return an updated transaction in the response payload body. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdData' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + description: The PFDs for the application were not updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdReport' + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '409': + description: The PFDs for the application were not updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdReport' + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The PFDs for the application were not updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdReport' + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + delete: + responses: + '204': + description: No Content. The application was deleted successfully. The payload body shall be empty. + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + PfdManagement: + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + pfdDatas: + type: object + additionalProperties: + $ref: '#/components/schemas/PfdData' + minProperties: 1 + description: Each element uniquely identifies the PFDs for an external application identifier. Each element is identified in the map via an external application identifier as key. The response shall include successfully provisioned PFD data of application(s). + pfdReports: + type: object + additionalProperties: + $ref: '#/components/schemas/PfdReport' + minProperties: 1 + description: Supplied by the SCEF and contains the external application identifiers for which PFD(s) are not added or modified successfully. The failure reason is also included. Each element provides the related information for one or more external application identifier(s) and is identified in the map via the failure identifier as key. + readOnly: true + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + requestTestNotification: + type: boolean + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in subclause 5.2.5.3. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + required: + - pfdDatas + PfdData: + type: object + properties: + externalAppId: + type: string + description: Each element uniquely external application identifier + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + pfds: + type: object + additionalProperties: + $ref: '#/components/schemas/Pfd' + description: Contains the PFDs of the external application identifier. Each PFD is identified in the map via a key containing the PFD identifier. + allowedDelay: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSecRm' + cachingTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSecRo' + required: + - externalAppId + - pfds + Pfd: + type: object + properties: + pfdId: + type: string + description: Identifies a PDF of an application identifier. + flowDescriptions: + type: array + items: + type: string + minItems: 1 + description: Represents a 3-tuple with protocol, server ip and server port for UL/DL application traffic. The content of the string has the same encoding as the IPFilterRule AVP value as defined in IETF RFC 6733. + urls: + type: array + items: + type: string + minItems: 1 + description: Indicates a URL or a regular expression which is used to match the significant parts of the URL. + domainNames: + type: array + items: + type: string + minItems: 1 + description: Indicates an FQDN or a regular expression as a domain name matching criteria. + dnProtocol: + $ref: '#/components/schemas/DomainNameProtocol' + required: + - pfdId + PfdReport: + type: object + properties: + externalAppIds: + type: array + items: + type: string + minItems: 1 + description: Identifies the external application identifier(s) which PFD(s) are not added or modified successfully + failureCode: + $ref: '#/components/schemas/FailureCode' + cachingTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + locationArea: + $ref: '#/components/schemas/UserPlaneLocationArea' + required: + - externalAppIds + - failureCode + UserPlaneLocationArea: + type: object + properties: + locationArea: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea' + locationArea5G: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + dnais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 0 + description: Identifies a list of DNAI which the user plane functions support. + FailureCode: + anyOf: + - type: string + enum: + - MALFUNCTION + - RESOURCE_LIMITATION + - SHORT_DELAY + - APP_ID_DUPLICATED + - PARTIAL_FAILURE + - OTHER_REASON + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - MALFUNCTION: This value indicates that something functions wrongly in PFD provisioning or the PFD provisioning does not function at all. + - RESOURCE_LIMITATION: This value indicates there is resource limitation for PFD storage. + - SHORT_DELAY: This value indicates that the allowed delay is too short and PFD(s) are not stored. + - APP_ID_DUPLICATED: The received external application identifier(s) are already provisioned. + - PARTIAL_FAILURE: The PFD(s) are not provisioned to all PCEFs/TDFs/SMFs. + - OTHER_REASON: Other reason unspecified. + DomainNameProtocol: + anyOf: + - type: string + enum: + - DNS_QNAME + - TLS_SNI + - TLS_SAN + - TSL_SCN + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - DNS_QNAME: Identifies the DNS protocol and the question name in DNS query. + - TLS_SNI: Identifies the Server Name Indication in TLS ClientHello message. + - TLS_SAN: Identifies the Subject Alternative Name in TLS ServerCertificate message. + - TLS_SCN: Identifies the Subject Common Name in TLS ServerCertificate message. diff --git a/lib/sbi/support/3gpp-spec/TS29122_RacsParameterProvisioning.yaml b/lib/sbi/support/standard/TS29122_RacsParameterProvisioning.yaml similarity index 97% rename from lib/sbi/support/3gpp-spec/TS29122_RacsParameterProvisioning.yaml rename to lib/sbi/support/standard/TS29122_RacsParameterProvisioning.yaml index 9f3311d819..13e50117ef 100644 --- a/lib/sbi/support/3gpp-spec/TS29122_RacsParameterProvisioning.yaml +++ b/lib/sbi/support/standard/TS29122_RacsParameterProvisioning.yaml @@ -4,7 +4,7 @@ info: version: 1.0.0.alpha-1 description: | API for provisioning UE radio capability parameters. - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. externalDocs: description: 3GPP TS 29.122 V16.4.0 T8 reference point for Northbound APIs @@ -313,10 +313,10 @@ components: properties: racsId: type: string - description: The UE radio capability ID provided by the SCS/AS to identify the UE radio capability data. See 3GPP TS 23.003 for the encoding. + description: The UE radio capability ID provided by the SCS/AS to identify the UE radio capability data. See 3GPP TS 23.003 for the encoding. racsParam: type: string - description: The UE radio capability data, depending on the device type (4G or 5G capable), its encoding shall comply with the UE-CapabilityRAT-ContainerList as defined in subclause 6.3.6 of 3GPP TS 36.331 or UE-CapabilityRAT-ContainerList as defined in subclause 6.3.3 of 3GPP TS 38.331. + description: The UE radio capability data, depending on the device type (4G or 5G capable), its encoding shall comply with the UE-CapabilityRAT-ContainerList as defined in subclause 6.3.6 of 3GPP TS 36.331 or UE-CapabilityRAT-ContainerList as defined in subclause 6.3.3 of 3GPP TS 38.331. required: - racsId - racsParam @@ -349,4 +349,3 @@ components: - RESOURCE_LIMITATION: The received RACS identifier(s) are already provisioned. - RACS_ID_DUPLICATED: This value indicates there is resource limitation for RACS data storage. - OTHER_REASON: Other reason unspecified. - diff --git a/lib/sbi/support/3gpp-spec/TS29122_ReportingNetworkStatus.yaml b/lib/sbi/support/standard/TS29122_ReportingNetworkStatus.yaml similarity index 98% rename from lib/sbi/support/3gpp-spec/TS29122_ReportingNetworkStatus.yaml rename to lib/sbi/support/standard/TS29122_ReportingNetworkStatus.yaml index 0487646687..df30057a02 100644 --- a/lib/sbi/support/3gpp-spec/TS29122_ReportingNetworkStatus.yaml +++ b/lib/sbi/support/standard/TS29122_ReportingNetworkStatus.yaml @@ -4,7 +4,7 @@ info: version: 1.0.1 description: | API for reporting network status. - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. externalDocs: description: 3GPP TS 29.122 V15.4.0 T8 reference point for Northbound APIs @@ -256,7 +256,7 @@ components: $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' requestTestNotification: type: boolean - description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in subclause 5.2.5.3. Set to false or omitted otherwise. + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in subclause 5.2.5.3. Set to false or omitted otherwise. websockNotifConfig: $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' locationArea: @@ -314,4 +314,4 @@ components: Possible values are - HIGH: The congestion status is high. - MEDIUM: The congestion status is medium. - - LOW: The congestion status is low. \ No newline at end of file + - LOW: The congestion status is low. diff --git a/lib/sbi/support/3gpp-spec/TS29122_ResourceManagementOfBdt.yaml b/lib/sbi/support/standard/TS29122_ResourceManagementOfBdt.yaml similarity index 99% rename from lib/sbi/support/3gpp-spec/TS29122_ResourceManagementOfBdt.yaml rename to lib/sbi/support/standard/TS29122_ResourceManagementOfBdt.yaml index 0a4f76ec93..b97ff8ba76 100644 --- a/lib/sbi/support/3gpp-spec/TS29122_ResourceManagementOfBdt.yaml +++ b/lib/sbi/support/standard/TS29122_ResourceManagementOfBdt.yaml @@ -4,7 +4,7 @@ info: version: 1.1.0.alpha-4 description: | API for BDT resouce management. - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. externalDocs: description: 3GPP TS 29.122 V16.5.0 T8 reference point for Northbound APIs diff --git a/lib/sbi/support/standard/TS29503_Nudm_EE.yaml b/lib/sbi/support/standard/TS29503_Nudm_EE.yaml new file mode 100644 index 0000000000..ca3c0441e1 --- /dev/null +++ b/lib/sbi/support/standard/TS29503_Nudm_EE.yaml @@ -0,0 +1,448 @@ +openapi: 3.0.0 + +info: + version: '1.1.0.alpha-4' + title: 'Nudm_EE' + description: | + Nudm Event Exposure Service. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 16.3.0 + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-ee/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-ee + - {} + +paths: + /{ueIdentity}/ee-subscriptions: + post: + summary: Subscribe + operationId: CreateEeSubscription + tags: + - Create EE Subscription + parameters: + - name: ueIdentity + in: path + description: Represents the scope of the UE for which the subscription is applied. Contains the GPSI of the user or the external group ID or any UE. + required: true + schema: + type: string + pattern: '^(msisdn-[0-9]{5,15}|.+|extid-[^@]+@[^@]+|extgroupid-[^@]+@[^@]+|anyUE)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EeSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/CreatedEeSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-ee/v1/{ueIdentity}/ee-subscriptions/{subscriptionId}' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + eventOccurrenceNotification: + '{request.body#/callbackReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/MonitoringReport' + minItems: 1 + responses: + '204': + description: Successful Notification response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueIdentity}/ee-subscriptions/{subscriptionId}: + delete: + summary: Unsubscribe + operationId: DeleteEeSubscription + tags: + - Delete EE Subscription + parameters: + - name: ueIdentity + in: path + description: Represents the scope of the UE for which the subscription is applied. Contains the GPSI of the user or the external group ID or any UE. + required: true + schema: + type: string + pattern: '^(msisdn-[0-9]{5,15}|.+|extid-[^@]+@[^@]+|extgroupid-[^@]+@[^@]+|anyUE)$' + - name: subscriptionId + in: path + description: Id of the EE Subscription + required: true + schema: + type: string + responses: + '204': + description: Successful response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + patch: + summary: Patch + operationId: UpdateEeSubscription + tags: + - Update EE Subscription + parameters: + - name: ueIdentity + in: path + description: Represents the scope of the UE for which the subscription is applied. Contains the GPSI of the user or the external group ID or any UE. + required: true + schema: + type: string + pattern: '^(msisdn-[0-9]{5,15}|.+|extid-[^@]+@[^@]+|extgroupid-[^@]+@[^@]+|anyUE)$' + - name: subscriptionId + in: path + description: Id of the EE Subscription + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Successful response + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + description: Unexpected error + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-ee: Access to the nudm-ee API + + + schemas: + +# COMPLEX TYPES: + + CreatedEeSubscription: + type: object + required: + - eeSubscription + properties: + eeSubscription: + $ref: '#/components/schemas/EeSubscription' + numberOfUes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + eventReports: + type: array + items: + $ref: '#/components/schemas/MonitoringReport' + minItems: 1 + + EeSubscription: + type: object + required: + - callbackReference + - monitoringConfigurations + properties: + callbackReference: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + monitoringConfigurations: + description: A map (list of key-value pairs where ReferenceId serves as key) of MonitoringConfigurations + type: object + additionalProperties: + $ref: '#/components/schemas/MonitoringConfiguration' + minProperties: 1 + reportingOptions: + $ref: '#/components/schemas/ReportingOptions' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + subscriptionId: + type: string + + + MonitoringConfiguration: + type: object + required: + - eventType + properties: + eventType: + $ref: '#/components/schemas/EventType' + immediateFlag: + type: boolean + locationReportingConfiguration: + $ref: '#/components/schemas/LocationReportingConfiguration' + associationType: + $ref: '#/components/schemas/AssociationType' + datalinkReportCfg: + $ref: '#/components/schemas/DatalinkReportingConfiguration' + + LocationReportingConfiguration: + type: object + required: + - currentLocation + properties: + currentLocation: + type: boolean + oneTime: + type: boolean + accuracy: + $ref: '#/components/schemas/LocationAccuracy' + n3gppAccuracy: + $ref: '#/components/schemas/LocationAccuracy' + + ReportingOptions: + type: object + properties: + reportMode: + $ref: '#/components/schemas/EventReportMode' + maxNumOfReports: + $ref: '#/components/schemas/MaxNumOfReports' + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + samplingRatio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + guardTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + reportPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + + MonitoringReport: + type: object + required: + - referenceId + - eventType + - timeStamp + properties: + referenceId: + $ref: '#/components/schemas/ReferenceId' + eventType: + $ref: '#/components/schemas/EventType' + report: + $ref: '#/components/schemas/Report' + reachabilityForSmsReport: + $ref: '#/components/schemas/ReachabilityForSmsReport' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + timeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + Report: + oneOf: + - $ref: '#/components/schemas/ChangeOfSupiPeiAssociationReport' + - $ref: '#/components/schemas/RoamingStatusReport' + - $ref: '#/components/schemas/CnTypeChangeReport' + - $ref: '#/components/schemas/CmInfoReport' + + ReachabilityForSmsReport: + type: object + required: + - smsfAccessType + properties: + smsfAccessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + + ChangeOfSupiPeiAssociationReport: + type: object + required: + - newPei + properties: + newPei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + + RoamingStatusReport: + type: object + required: + - roaming + - newServingPlmn + properties: + roaming: + type: + boolean + newServingPlmn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + + CnTypeChangeReport: + type: object + required: + - newCnType + properties: + newCnType: + $ref: '#/components/schemas/CnType' + oldCnType: + $ref: '#/components/schemas/CnType' + + DatalinkReportingConfiguration: + type: object + properties: + dddTrafficDes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DddTrafficDescriptor' + minItems: 1 + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + slice: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dddStatusList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DlDataDeliveryStatus' + minItems: 1 + + CmInfoReport: + type: object + properties: + oldCmInfoList: + type: array + items: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/CmInfo' + minItems: 1 + maxItems: 2 + newCmInfoList: + type: array + items: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/CmInfo' + minItems: 1 + maxItems: 2 + required: + - newCmInfoList + + +# SIMPLE TYPES: + + ReferenceId: + type: integer + + MaxNumOfReports: + type: integer + + +# ENUMS: + + EventType: + anyOf: + - type: string + enum: + - LOSS_OF_CONNECTIVITY + - UE_REACHABILITY_FOR_DATA + - UE_REACHABILITY_FOR_SMS + - LOCATION_REPORTING + - CHANGE_OF_SUPI_PEI_ASSOCIATION + - ROAMING_STATUS + - COMMUNICATION_FAILURE + - AVAILABILITY_AFTER_DDN_FAILURE + - CN_TYPE_CHANGE + - DL_DATA_DELIVERY_STATUS + - PDN_CONNECTIVITY_STATUS + - UE_CONNECTION_MANAGEMENT_STATE + - type: string + + LocationAccuracy: + anyOf: + - type: string + enum: + - CELL_LEVEL + - TA_LEVEL + - N3IWF_LEVEL + - UE_IP + - UE_PORT + - type: string + + CnType: + anyOf: + - type: string + enum: + - SINGLE_4G + - SINGLE_5G + - DUAL_4G5G + - type: string + + AssociationType: + anyOf: + - type: string + enum: + - IMEI_CHANGE + - IMEISV_CHANGE + - type: string + + EventReportMode: + anyOf: + - type: string + enum: + - PERIODIC + - ON_EVENT_DETECTION + - type: string + diff --git a/lib/sbi/support/standard/TS29503_Nudm_MT.yaml b/lib/sbi/support/standard/TS29503_Nudm_MT.yaml new file mode 100644 index 0000000000..d2d3579741 --- /dev/null +++ b/lib/sbi/support/standard/TS29503_Nudm_MT.yaml @@ -0,0 +1,191 @@ +openapi: 3.0.0 +info: + version: '1.0.0.alpha-2' + title: 'NudmMT' + description: | + UDM MT Service. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 16.3.0 + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-mt/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-mt + - {} + +paths: + /{supi}: + get: + summary: Query Information for the UE + operationId: QueryUeInfo + tags: + - Query UE Info + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: fields + in: query + description: attributes to be retrieved + required: true + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/UeInfo' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/loc-info/provide-loc-info: + post: + summary: Provides the UE's 5GS location information + operationId: ProvideLocationInfo + tags: + - Provide UE Location + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LocationInfoRequest' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/LocationInfoResult' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-mt: Access to the nudm-mt API + + + schemas: + +# COMPLEX TYPES: + + UeInfo: + type: object + properties: + tadsInfo: + $ref: 'TS29518_Namf_MT.yaml#/components/schemas/UeContextInfo' + userState: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/5GsUserState' + + LocationInfoRequest: + type: object + properties: + req5gsLoc: + type: boolean + default: false + reqCurrentLoc: + type: boolean + default: false + reqRatType: + type: boolean + default: false + reqTimeZone: + type: boolean + default: false + reqServingNode: + type: boolean + default: false + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + LocationInfoResult: + type: object + properties: + vPlmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + amfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + smsfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + ncgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + tai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + currentLoc: + type: boolean + geoInfo: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + locatoinAge: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/AgeOfLocationEstimate' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + timezone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + +# SIMPLE TYPES: + + +# ENUMS: + diff --git a/lib/sbi/support/standard/TS29503_Nudm_NIDDAU.yaml b/lib/sbi/support/standard/TS29503_Nudm_NIDDAU.yaml new file mode 100644 index 0000000000..62e1fae9f6 --- /dev/null +++ b/lib/sbi/support/standard/TS29503_Nudm_NIDDAU.yaml @@ -0,0 +1,169 @@ +openapi: 3.0.0 + +info: + version: '1.0.0.alpha-4' + title: 'Nudm_NIDDAU' + description: | + Nudm NIDD Authorization Service. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 16.3.0 + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-niddau/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-niddau + - {} + +paths: + /{ueIdentity}/authorize: + post: + summary: Authorize the NIDD configuration request. + operationId: AuthorizeNiddData + tags: + - Authorize the NIDD configuration request + parameters: + - name: ueIdentity + in: path + description: Represents the scope of the UE for which the NIDD configuration are authorized. Contains the GPSI of the user or the external group ID. + required: true + schema: + type: string + pattern: '^(msisdn-[0-9]{5,15}|.+|extid-[^@]+@[^@]+|extgroupid-[^@]+@[^@]+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthorizationInfo' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AuthorizationData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + niddAuthUpdateNotification: + '{request.body#/authUpdateCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NiddAuthUpdateNotification' + responses: + '204': + description: Expected response to a valid request + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-niddau: Access to the nudm-niddau API + + schemas: + +# COMPLEX TYPES: +# + AuthorizationData: + type: object + required: + - authorizationData + properties: + authorizationData: + type: array + items: + $ref: '#/components/schemas/UserIdentifier' + minItems: 1 + uniqueItems: true + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + UserIdentifier: + type: object + required: + - supi + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + NiddAuthUpdateInfo: + type: object + required: + - authorizationData + properties: + authorizationData: + $ref: '#/components/schemas/AuthorizationData' + invalidityInd: + type: boolean + + NiddAuthUpdateNotification: + type: object + required: + - niddAuthUpdateInfoList + properties: + niddAuthUpdateInfoList: + type: array + items: + $ref: '#/components/schemas/NiddAuthUpdateInfo' + minItems: 1 + + AuthorizationInfo: + type: object + required: + - snssai + - dnn + - mtcProviderInformation + - authUpdateCallbackUri + properties: + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + authUpdateCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + + +# SIMPLE TYPES: + + + +# ENUMS: + + diff --git a/lib/sbi/support/standard/TS29503_Nudm_PP.yaml b/lib/sbi/support/standard/TS29503_Nudm_PP.yaml new file mode 100644 index 0000000000..8d3d6e6ce6 --- /dev/null +++ b/lib/sbi/support/standard/TS29503_Nudm_PP.yaml @@ -0,0 +1,483 @@ +openapi: 3.0.0 + +info: + version: '1.1.0.alpha-3' + title: 'Nudm_PP' + description: | + Nudm Parameter Provision Service. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 16.3.0 + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-pp/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-pp + - {} + +paths: + /{ueId}/pp-data: + patch: + summary: provision parameters + operationId: Update + tags: + - Subscription Data Update + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/PpData' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /5g-vn-groups/{external-group-id}: + put: + summary: create a 5G VN Group + operationId: Create 5G VN Group + tags: + - 5G VN Group Creation + parameters: + - name: external-group-id + in: path + description: External Identifier of the Group + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/5GVnGroupConfiguration' + required: true + responses: + '201': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + delete: + summary: delete a 5G VN Group + operationId: Delete 5G VN Group + tags: + - 5G VN Group Deletion + parameters: + - name: external-group-id + in: path + description: External Identifier of the Group + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + responses: + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + patch: + summary: modify a 5G VN Group + operationId: Modify 5G VN Group + tags: + - 5G VN Group Modification + parameters: + - name: external-group-id + in: path + description: External Identifier of the group + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/5GVnGroupConfiguration' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-pp: Access to the nudm-pp API + + + schemas: + +# COMPLEX TYPES: + + PpData: + type: object + properties: + communicationCharacteristics: + $ref: '#/components/schemas/CommunicationCharacteristics' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + expectedUeBehaviourParameters: + $ref: '#/components/schemas/ExpectedUeBehaviour' + ecRestriction: + $ref: '#/components/schemas/EcRestriction' + acsInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AcsInfoRm' + stnSr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/StnSrRm' + lcsPrivacy: + $ref: '#/components/schemas/LcsPrivacy' + + CommunicationCharacteristics: + type: object + properties: + ppSubsRegTimer: + $ref: '#/components/schemas/PpSubsRegTimer' + ppActiveTime: + $ref: '#/components/schemas/PpActiveTime' + ppDlPacketCount: + $ref: '#/components/schemas/PpDlPacketCount' + ppDlPacketCountExt: + $ref: '#/components/schemas/PpDlPacketCountExt' + ppMaximumResponseTime: + $ref: '#/components/schemas/PpMaximumResponseTime' + ppMaximumLatency: + $ref: '#/components/schemas/PpMaximumLatency' + + + PpSubsRegTimer: + type: object + required: + - subsRegTimer + - afInstanceId + - referenceId + properties: + subsRegTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + afInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + referenceId: + $ref: '#/components/schemas/ReferenceId' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + nullable: true + + PpActiveTime: + type: object + required: + - activeTime + - afInstanceId + - referenceId + properties: + activeTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + afInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + referenceId: + $ref: '#/components/schemas/ReferenceId' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + nullable: true + + 5GVnGroupConfiguration: + type: object + properties: + 5gVnGroupData: + $ref: '#/components/schemas/5GVnGroupData' + members: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + referenceId: + $ref: '#/components/schemas/ReferenceId' + afInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + internalGroupIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + + 5GVnGroupData: + type: object + required: + - dnn + - sNssai + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + pduSessionTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + minItems: 1 + appDescriptors: + type: array + items: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/AppDescriptor' + minItems: 1 + + ExpectedUeBehaviour: + type: object + required: + - afInstanceId + - referenceId + properties: + afInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + referenceId: + $ref: '#/components/schemas/ReferenceId' + stationaryIndication: + $ref: 'TS29571_CommonData.yaml#/components/schemas/StationaryIndicationRm' + communicationDurationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + scheduledCommunicationType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ScheduledCommunicationTypeRm' + periodicTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + scheduledCommunicationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ScheduledCommunicationTimeRm' + expectedUmts: + type: array + items: + $ref: '#/components/schemas/LocationArea' + minItems: 1 + nullable: true + description: Identifies the UE's expected geographical movement. The attribute is only applicable in 5G. + trafficProfile: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TrafficProfileRm' + batteryIndication: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BatteryIndicationRm' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + LocationArea: + type: object + properties: + geographicAreas: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 0 + description: Identifies a list of geographic area of the user where the UE is located. + civicAddresses: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' + minItems: 0 + description: Identifies a list of civic addresses of the user where the UE is located. + nwAreaInfo: + $ref: '#/components/schemas/NetworkAreaInfo' + + NetworkAreaInfo: + description: Describes a network area information in which the NF service consumer requests the number of UEs. + type: object + properties: + ecgis: + description: Contains a list of E-UTRA cell identities. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + minItems: 1 + ncgis: + description: Contains a list of NR cell identities. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + minItems: 1 + gRanNodeIds: + description: Contains a list of NG RAN nodes. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + minItems: 1 + tais: + description: Contains a list of tracking area identities. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + + EcRestriction: + type: object + required: + - afInstanceId + - referenceId + properties: + afInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + referenceId: + $ref: '#/components/schemas/ReferenceId' + plmnEcInfos: + type: array + items: + $ref: '#/components/schemas/PlmnEcInfo' + minItems: 1 + + PlmnEcInfo: + type: object + required: + - plmnId + properties: + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + ecModeARestricted: + type: boolean + ecModeBRestricted: + type: boolean + + + PpDlPacketCountExt: + type: object + required: + - afInstanceId + - referenceId + properties: + afInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + referenceId: + $ref: '#/components/schemas/ReferenceId' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + nullable: true + + PpMaximumResponseTime: + type: object + required: + - maximumResponseTime + - afInstanceId + - referenceId + properties: + maximumResponseTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + afInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + referenceId: + $ref: '#/components/schemas/ReferenceId' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + nullable: true + + PpMaximumLatency: + type: object + required: + - maximumLatency + - afInstanceId + - referenceId + properties: + maximumLatency: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + afInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + referenceId: + $ref: '#/components/schemas/ReferenceId' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + nullable: true + + LcsPrivacy: + type: object + properties: + afInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + referenceId: + $ref: '#/components/schemas/ReferenceId' + lpi: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/Lpi' + + +# SIMPLE TYPES: + + ReferenceId: + type: integer + + PpDlPacketCount: + type: integer + nullable: true + + + +# ENUMS: + diff --git a/lib/sbi/support/standard/TS29503_Nudm_SDM.yaml b/lib/sbi/support/standard/TS29503_Nudm_SDM.yaml new file mode 100644 index 0000000000..9bff7dac81 --- /dev/null +++ b/lib/sbi/support/standard/TS29503_Nudm_SDM.yaml @@ -0,0 +1,2742 @@ +openapi: 3.0.0 + +info: + version: '2.1.0.alpha-4' + title: 'Nudm_SDM' + description: | + Nudm Subscriber Data Management Service. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 16.3.0 + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-sdm/v2' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-sdm + - {} + +paths: + /{supi}: + get: + summary: retrieve multiple data sets + operationId: GetDataSets + tags: + - Retrieval of multiple data sets + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: dataset-names + in: query + style: form + explode: false + description: List of dataset names + required: true + schema: + $ref: '#/components/schemas/DatasetNames' + - name: plmn-id + in: query + description: serving PLMN ID + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionDataSets' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/nssai: + get: + summary: retrieve a UE's subscribed NSSAI + operationId: GetNSSAI + tags: + - Slice Selection Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + description: serving PLMN ID + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/Nssai' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/am-data: + get: + summary: retrieve a UE's Access and Mobility Subscription Data + operationId: GetAmData + tags: + - Access and Mobility Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + description: serving PLMN ID + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AccessAndMobilitySubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/am-data/ecr-data: + get: + summary: retrieve a UE's subscribed Enhanced Coverage Restriction Data + operationId: GetEcrData + tags: + - Enhanced Coverage Restriction Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/EnhancedCoverageRestrictionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/smf-select-data: + get: + summary: retrieve a UE's SMF Selection Subscription Data + operationId: GetSmfSelData + tags: + - SMF Selection Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + description: serving PLMN ID + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmfSelectionSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/ue-context-in-smf-data: + get: + summary: retrieve a UE's UE Context In SMF Data + operationId: GetUeCtxInSmfData + tags: + - UE Context In SMF Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextInSmfData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/ue-context-in-smsf-data: + get: + summary: retrieve a UE's UE Context In SMSF Data + operationId: GetUeCtxInSmsfData + tags: + - UE Context In SMSF Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextInSmsfData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/trace-data: + get: + summary: retrieve a UE's Trace Configuration Data + operationId: GetTraceConfigData + tags: + - Trace Configuration Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + description: serving PLMN ID + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/TraceDataResponse' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/sm-data: + get: + summary: retrieve a UE's Session Management Subscription Data + operationId: GetSmData + tags: + - Session Management Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: single-nssai + in: query + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + - name: dnn + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - name: plmn-id + in: query + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SessionManagementSubscriptionData' + minItems: 1 + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/sms-data: + get: + summary: retrieve a UE's SMS Subscription Data + operationId: GetSmsData + tags: + - SMS Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/sms-mng-data: + get: + summary: retrieve a UE's SMS Management Subscription Data + operationId: GetSmsMngtData + tags: + - SMS Management Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsManagementSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{ueId}/lcs-privacy-data: + get: + summary: retrieve a UE's LCS Privacy Subscription Data + operationId: GetLcsPrivacyData + tags: + - LCS Privacy Data Retrieval + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/LcsPrivacyData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{supi}/lcs-mo-data: + get: + summary: retrieve a UE's LCS Mobile Originated Subscription Data + operationId: GetLcsMoData + tags: + - LCS Mobile Originated Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/LcsMoData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{ueId}/sdm-subscriptions: + post: + summary: subscribe to notifications + operationId: Subscribe + tags: + - Subscription Creation + parameters: + - name: ueId + in: path + description: Identity of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SdmSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SdmSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-sdm//{supi}/sdm-subscriptions/{subscriptionId}' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + datachangeNotification: + '{request.body#/callbackReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ModificationNotification' + responses: + '204': + description: Successful Notification response + '307': + description: Temporary Redirect + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + headers: + Location: + description: 'Contains the new Callback URI of the target NF Service Consumer (e.g. AMF) to which the request is redirected' + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + headers: + Location: + description: 'Contains the new Callback URI of the target NF Service Consumer (e.g. AMF) to which the request is redirected' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{ueId}/sdm-subscriptions/{subscriptionId}: + delete: + summary: unsubscribe from notifications + operationId: Unsubscribe + tags: + - Subscription Deletion + parameters: + - name: ueId + in: path + description: Identity of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subscriptionId + in: path + description: Id of the SDM Subscription + required: true + schema: + type: string + responses: + '204': + description: Successful response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + patch: + summary: modify the subscription + operationId: Modify + tags: + - Subscription Modification + parameters: + - name: ueId + in: path + description: Identity of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subscriptionId + in: path + description: Id of the SDM Subscription + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/SdmSubsModification' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/SdmSubscription' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{ueId}/id-translation-result: + get: + summary: retrieve a UE's SUPI or GPSI + operationId: GetSupiOrGpsi + tags: + - GPSI to SUPI Translation + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: app-port-id + in: query + description: Application port identifier + content: + application/json: + schema: + $ref: '#/components/schemas/AppPortId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/IdTranslationResult' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/am-data/sor-ack: + put: + summary: Nudm_Sdm Info service operation + operationId: SorAckInfo + tags: + - Providing acknowledgement of Steering of Roaming + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AcknowledgeInfo' + responses: + '204': + description: Successful acknowledgement + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/am-data/upu-ack: + put: + summary: Nudm_Sdm Info for UPU service operation + operationId: UpuAck + tags: + - Providing acknowledgement of UE Parameters Update + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AcknowledgeInfo' + responses: + '204': + description: Successful acknowledgement + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/am-data/subscribed-snssais-ack: + put: + summary: Nudm_Sdm Info operation for S-NSSAIs acknowledgement + operationId: S-NSSAIs Ack + tags: + - Providing acknowledgement of S-NSSAIs Update + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AcknowledgeInfo' + responses: + '204': + description: Successful acknowledgement + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/am-data/cag-ack: + put: + summary: Nudm_Sdm Info operation for CAG acknowledgement + operationId: CAG Ack + tags: + - Providing acknowledgement of CAG Update + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AcknowledgeInfo' + responses: + '204': + description: Successful acknowledgement + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/am-data/update-sor: + post: + summary: Nudm_Sdm custom operation to trigger SOR info update + operationId: Update SOR Info + tags: + - Trigger SOR info update + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SorUpdateInfo' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SorInfo' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /shared-data: + get: + summary: retrieve shared data + operationId: GetSharedData + tags: + - Retrieval of shared data + parameters: + - name: shared-data-ids + in: query + description: List of shared data ids + required: true + style: form + explode: false + schema: + $ref: '#/components/schemas/SharedDataIds' + - name: supportedFeatures + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SharedData' + minItems: 1 + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /shared-data-subscriptions: + post: + summary: subscribe to notifications for shared data + operationId: SubscribeToSharedData + tags: + - Subscription Creation for shared data + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SdmSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SdmSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-sdm//shared-data-subscriptions/{subscriptionId}' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + description: Unexpected error + callbacks: + datachangeNotification: + '{request.body#/callbackReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ModificationNotification' + responses: + '204': + description: Successful Notification response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /shared-data-subscriptions/{subscriptionId}: + delete: + summary: unsubscribe from notifications for shared data + operationId: UnsubscribeForSharedData + tags: + - Subscription Deletion for shared data + parameters: + - name: subscriptionId + in: path + description: Id of the Shared data Subscription + required: true + schema: + type: string + responses: + '204': + description: Successful response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + patch: + summary: modify the subscription + operationId: ModifySharedDataSubs + tags: + - Subscription Modification + parameters: + - name: subscriptionId + in: path + description: Id of the SDM Subscription + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/SdmSubsModification' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/SdmSubscription' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /group-data/group-identifiers: + get: + summary: Mapping of Group Identifiers + operationId: GetGroupIdentifiers + tags: + - Group Identifiers + parameters: + - name: ext-group-id + in: query + description: External Group Identifier + required: false + schema: + $ref: '#/components/schemas/ExtGroupId' + - name: int-group-id + in: query + description: Internal Group Identifier + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + - name: ue-id-ind + in: query + description: Indication whether UE identifiers are required or not + required: false + schema: + type: boolean + default: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/GroupIdentifiers' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-sdm: Access to the nudm-sdm API + + schemas: + +# COMPLEX TYPES: + + DatasetNames: + type: array + items: + $ref: '#/components/schemas/DataSetName' + minItems: 2 + uniqueItems: true + + SubscriptionDataSets: + type: object + properties: + amData: + $ref: '#/components/schemas/AccessAndMobilitySubscriptionData' + smfSelData: + $ref: '#/components/schemas/SmfSelectionSubscriptionData' + uecSmfData: + $ref: '#/components/schemas/UeContextInSmfData' + uecSmsfData: + $ref: '#/components/schemas/UeContextInSmsfData' + smsSubsData: + $ref: '#/components/schemas/SmsSubscriptionData' + smData: + type: array + items: + $ref: '#/components/schemas/SessionManagementSubscriptionData' + minItems: 1 + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + smsMngData: + $ref: '#/components/schemas/SmsManagementSubscriptionData' + lcsPrivacyData: + $ref: '#/components/schemas/LcsPrivacyData' + lcsMoData: + $ref: '#/components/schemas/LcsMoData' + + UeContextInSmsfData: + type: object + properties: + smsfInfo3GppAccess: + $ref: '#/components/schemas/SmsfInfo' + smsfInfoNon3GppAccess: + $ref: '#/components/schemas/SmsfInfo' + + SmsfInfo: + type: object + required: + - smsfInstanceId + - plmnId + properties: + smsfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + + AccessAndMobilitySubscriptionData: + type: object + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + gpsis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + internalGroupIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + vnGroupInfo: + type: object + additionalProperties: + $ref: '#/components/schemas/VnGroupData' + minProperties: 1 + sharedVnGroupDataIds: + type: object + additionalProperties: + $ref: '#/components/schemas/SharedDataId' + minProperties: 1 + subscribedUeAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmbrRm' + nssai: + $ref: '#/components/schemas/Nssai' + ratRestrictions: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + forbiddenAreas: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Area' + serviceAreaRestriction: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' + coreNetworkTypeRestrictions: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CoreNetworkType' + rfspIndex: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndexRm' + subsRegTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + ueUsageType: + $ref: '#/components/schemas/UeUsageType' + mpsPriority: + $ref: '#/components/schemas/MpsPriorityIndicator' + mcsPriority: + $ref: '#/components/schemas/McsPriorityIndicator' + activeTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + dlPacketCount: + $ref: '#/components/schemas/DlPacketCount' + sorInfo: + $ref: '#/components/schemas/SorInfo' + sorInfoExpectInd: + type: boolean + sorafRetrieval: + type: boolean + default: false + sorUpdateIndicatorList: + type: array + items: + $ref: '#/components/schemas/SorUpdateIndicator' + minItems: 1 + upuInfo: + $ref: '#/components/schemas/UpuInfo' + micoAllowed: + $ref: '#/components/schemas/MicoAllowed' + sharedAmDataIds: + type: array + items: + $ref: '#/components/schemas/SharedDataId' + minItems: 1 + odbPacketServices: + $ref: 'TS29571_CommonData.yaml#/components/schemas/OdbPacketServices' + subscribedDnnList: + type: array + items: + anyOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/WildcardDnn' + serviceGapTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + cagData: + $ref: '#/components/schemas/CagData' + stnSr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/StnSr' + cMsisdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CMsisdn' + nbIoTUePriority: + $ref: '#/components/schemas/NbIoTUePriority' + nssaiInclusionAllowed: + type: boolean + default: false + rgWirelineCharacteristics: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RgWirelineCharacteristics' + rgTMBR: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tmbr' + ecRestrictionData: + $ref: '#/components/schemas/EcRestrictionData' + expectedUeBehaviourList: + $ref: '#/components/schemas/ExpectedUeBehaviourData' + maximumResponseTimeList: + type: array + items: + $ref: '#/components/schemas/MaximumResponseTime' + minItems: 1 + maximumLatencyList: + type: array + items: + $ref: '#/components/schemas/MaximumLatency' + minItems: 1 + primaryRatRestrictions: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + secondaryRatRestrictions: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + edrxParametersList: + type: array + items: + $ref: '#/components/schemas/EdrxParameters' + minItems: 1 + ptwParametersList: + type: array + items: + $ref: '#/components/schemas/PtwParameters' + minItems: 1 + iabOperationAllowed: + type: boolean + default: false + nrV2xServicesAuth: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NrV2xAuth' + lteV2xServicesAuth: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LteV2xAuth' + nrUePc5Ambr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + ltePc5Ambr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + + CagData: + type: object + required: + - cagInfos + properties: + cagInfos: + description: A map (list of key-value pairs where PlmnId serves as key) of CagInfo + type: object + additionalProperties: + $ref: '#/components/schemas/CagInfo' + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + CagInfo: + type: object + required: + - allowedCagList + properties: + allowedCagList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CagId' + cagOnlyIndicator: + type: boolean + + SmfSelectionSubscriptionData: + type: object + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + subscribedSnssaiInfos: + type: object + additionalProperties: + $ref: '#/components/schemas/SnssaiInfo' + sharedSnssaiInfosId: + $ref: '#/components/schemas/SharedDataId' + + SnssaiInfo: + type: object + required: + - dnnInfos + properties: + dnnInfos: + type: array + items: + $ref: '#/components/schemas/DnnInfo' + minItems: 1 + + DnnInfo: + type: object + required: + - dnn + properties: + dnn: + anyOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/WildcardDnn' + defaultDnnIndicator: + $ref: '#/components/schemas/DnnIndicator' + lboRoamingAllowed: + $ref: '#/components/schemas/LboRoamingAllowed' + iwkEpsInd: + $ref: '#/components/schemas/IwkEpsInd' + dnnBarred: + type: boolean + + Nssai: + type: object + required: + - defaultSingleNssais + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + defaultSingleNssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + singleNssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + additionalSnssaiData: + type: object + additionalProperties: + $ref: '#/components/schemas/AdditionalSnssaiData' + minProperties: 1 + nullable: true + + UeContextInSmfData: + type: object + properties: + pduSessions: + description: A map (list of key-value pairs where PduSessionId serves as key) of PduSessions + type: object + additionalProperties: + $ref: '#/components/schemas/PduSession' + pgwInfo: + type: array + items: + $ref: '#/components/schemas/PgwInfo' + minItems: 1 + emergencyInfo: + $ref: '#/components/schemas/EmergencyInfo' + + EmergencyInfo: + type: object + oneOf: + - required: + - pgwFqdn + - required: + - pgwIpAddress + properties: + pgwFqdn: + type: string + pgwIpAddress: + $ref: '#/components/schemas/IpAddress' + smfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + + + PduSession: + type: object + required: + - dnn + - smfInstanceId + - plmnId + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + smfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + + PgwInfo: + type: object + required: + - dnn + - pgwFqdn + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + pgwFqdn: + type: string + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + + SessionManagementSubscriptionData: + type: object + required: + - singleNssai + properties: + singleNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnnConfigurations: + description: A map (list of key-value pairs where Dnn, or optionally the Wildcard DNN, serves as key) of DnnConfigurations + type: object + additionalProperties: + $ref: '#/components/schemas/DnnConfiguration' + internalGroupIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + vnGroupInfo: + type: object + additionalProperties: + $ref: '#/components/schemas/VnGroupData' + minProperties: 1 + sharedVnGroupDataIds: + type: object + additionalProperties: + $ref: '#/components/schemas/SharedDataId' + minProperties: 1 + sharedDnnConfigurationsId: + $ref: '#/components/schemas/SharedDataId' + odbPacketServices: + $ref: 'TS29571_CommonData.yaml#/components/schemas/OdbPacketServices' + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + sharedTraceDataId: + $ref: '#/components/schemas/SharedDataId' + expectedUeBehavioursList: + type: object + additionalProperties: + $ref: '#/components/schemas/ExpectedUeBehaviourData' + minProperties: 1 + suggestedPacketNumDlList: + type: object + additionalProperties: + $ref: '#/components/schemas/SuggestedPacketNumDl' + minProperties: 1 + 3gppChargingCharacteristics: + $ref: '#/components/schemas/3GppChargingCharacteristics' + + DnnConfiguration: + type: object + required: + - pduSessionTypes + - sscModes + properties: + pduSessionTypes: + $ref: '#/components/schemas/PduSessionTypes' + sscModes: + $ref: '#/components/schemas/SscModes' + iwkEpsInd: + $ref: '#/components/schemas/IwkEpsInd' + 5gQosProfile: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SubscribedDefaultQos' + sessionAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + 3gppChargingCharacteristics: + $ref: '#/components/schemas/3GppChargingCharacteristics' + staticIpAddress: + type: array + items: + $ref: '#/components/schemas/IpAddress' + minItems: 1 + maxItems: 2 + upSecurity: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UpSecurity' + pduSessionContinuityInd: + $ref: '#/components/schemas/PduSessionContinuityInd' + invokeNefSelection: + type: boolean + niddNefId: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NefId' + niddInfo: + $ref: '#/components/schemas/NiddInformation' + redundantSessionAllowed: + type: boolean + acsInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AcsInfo' + ipv4FrameRouteList: + type: array + items: + $ref: '#/components/schemas/FrameRouteInfo' + minItems: 1 + ipv6FrameRouteList: + type: array + items: + $ref: '#/components/schemas/FrameRouteInfo' + minItems: 1 + atsssAllowed: + type: boolean + default: false + + NiddInformation: + type: object + required: + - afId + properties: + afId: + type: string + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + extGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExternalGroupId' + + IpAddress: + type: object + oneOf: + - required: + - ipv4Addr + - required: + - ipv6Addr + - required: + - ipv6Prefix + properties: + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + ipv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + + PduSessionTypes: + type: object + required: + - defaultSessionType + properties: + defaultSessionType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + allowedSessionTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + minItems: 1 + + SscModes: + type: object + required: + - defaultSscMode + properties: + defaultSscMode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SscMode' + allowedSscModes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SscMode' + minItems: 1 + maxItems: 2 + + SmsSubscriptionData: + type: object + properties: + smsSubscribed: + $ref: '#/components/schemas/SmsSubscribed' + sharedSmsSubsDataId: + $ref: '#/components/schemas/SharedDataId' + + SmsManagementSubscriptionData: + type: object + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + mtSmsSubscribed: + type: boolean + mtSmsBarringAll: + type: boolean + mtSmsBarringRoaming: + type: boolean + moSmsSubscribed: + type: boolean + moSmsBarringAll: + type: boolean + moSmsBarringRoaming: + type: boolean + sharedSmsMngDataIds: + type: array + items: + $ref: '#/components/schemas/SharedDataId' + minItems: 1 + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + + SdmSubscription: + type: object + required: + - nfInstanceId + - callbackReference + - monitoredResourceUris + properties: + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + implicitUnsubscribe: + type: boolean + expires: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + callbackReference: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + amfServiceName: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' + monitoredResourceUris: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + singleNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + subscriptionId: + type: string + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + immediateReport: + type: boolean + default: false + report: + $ref: '#/components/schemas/SubscriptionDataSets' + + SdmSubsModification: + type: object + properties: + expires: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + monitoredResourceUris: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + + ModificationNotification: + type: object + required: + - notifyItems + properties: + notifyItems: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NotifyItem' + minItems: 1 + + IdTranslationResult: + type: object + required: + - supi + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + + AcknowledgeInfo: + type: object + required: + - provisioningTime + properties: + sorMacIue: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SorMac' + upuMacIue: + $ref: 'TS29509_Nausf_UPUProtection.yaml#/components/schemas/UpuMac' + securedPacket: + $ref: '#/components/schemas/SecuredPacket' + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + SorInfo: + type: object + properties: + steeringContainer: + $ref: '#/components/schemas/SteeringContainer' + ackInd: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/AckInd' + sorMacIausf: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SorMac' + countersor: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/CounterSor' + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - ackInd + - provisioningTime + + SharedDataIds: + type: array + items: + $ref: '#/components/schemas/SharedDataId' + minItems: 1 + uniqueItems: true + + UpuInfo: + type: object + properties: + upuDataList: + type: array + items: + $ref: 'TS29509_Nausf_UPUProtection.yaml#/components/schemas/UpuData' + minItems: 1 + upuRegInd: + $ref: '#/components/schemas/UpuRegInd' + upuAckInd: + $ref: 'TS29509_Nausf_UPUProtection.yaml#/components/schemas/UpuAckInd' + upuMacIausf: + $ref: 'TS29509_Nausf_UPUProtection.yaml#/components/schemas/UpuMac' + counterUpu: + $ref: 'TS29509_Nausf_UPUProtection.yaml#/components/schemas/CounterUpu' + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - upuDataList + - upuAckInd + - upuRegInd + - provisioningTime + + + SharedData: + type: object + required: + - sharedDataId + properties: + sharedDataId: + $ref: '#/components/schemas/SharedDataId' + sharedAmData: + $ref: '#/components/schemas/AccessAndMobilitySubscriptionData' + sharedSmsSubsData: + $ref: '#/components/schemas/SmsSubscriptionData' + sharedSmsMngSubsData: + $ref: '#/components/schemas/SmsManagementSubscriptionData' + sharedDnnConfigurations: + type: object + additionalProperties: + $ref: '#/components/schemas/DnnConfiguration' + sharedTraceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + sharedSnssaiInfos: + type: object + additionalProperties: + $ref: '#/components/schemas/SnssaiInfo' + sharedVnGroupDatas: + type: object + additionalProperties: + $ref: '#/components/schemas/VnGroupData' + minProperties: 1 + + TraceDataResponse: + type: object + properties: + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + sharedTraceDataId: + $ref: '#/components/schemas/SharedDataId' + + SteeringContainer: + oneOf: + - type: array + items: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SteeringInfo' + minItems: 1 + - $ref: '#/components/schemas/SecuredPacket' + + GroupIdentifiers: + type: object + properties: + extGroupId: + $ref: '#/components/schemas/ExtGroupId' + intGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + ueIdList: + type: array + items: + $ref: '#/components/schemas/UeId' + minItems: 1 + + VnGroupData: + type: object + properties: + pduSessionTypes: + $ref: '#/components/schemas/PduSessionTypes' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + singleNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + appDescriptors: + type: array + items: + $ref: '#/components/schemas/AppDescriptor' + minItems: 1 + + AppDescriptor: + type: object + properties: + osId: + $ref: 'TS29519_Policy_Data.yaml#/components/schemas/OsId' + appId: + type: string + + AdditionalSnssaiData: + type: object + properties: + requiredAuthnAuthz: + type: boolean + + AppPortId: + type: object + properties: + destinationPort: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint16' + originatorPort: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint16' + + LcsPrivacyData: + type: object + properties: + lpi: + $ref: '#/components/schemas/Lpi' + unrelatedClasses: + type: array + items: + $ref: '#/components/schemas/UnrelatedClass' + minItems: 1 + plmnOperatorClasses: + type: array + items: + $ref: '#/components/schemas/PlmnOperatorClass' + minItems: 1 + + Lpi: + type: object + required: + - locationPrivacyInd + properties: + locationPrivacyInd: + $ref: '#/components/schemas/LocationPrivacyInd' + validTimePeriod: + $ref: '#/components/schemas/ValidTimePeriod' + + UnrelatedClass: + type: object + required: + - nonExternalUnrelatedClass + properties: + nonExternalUnrelatedClass: + $ref: '#/components/schemas/NonExternalUnrelatedClass' + externalUnrelatedClass: + $ref: '#/components/schemas/ExternalUnrelatedClass' + serviceTypeUnrelatedClasses: + type: array + items: + $ref: '#/components/schemas/ServiceTypeUnrelatedClass' + minItems: 1 + + PlmnOperatorClass: + type: object + required: + - lcsClientClass + - lcsClientIds + properties: + lcsClientClass: + $ref: '#/components/schemas/LcsClientClass' + lcsClientIds: + type: array + items: + $ref: '#/components/schemas/LcsClientId' + minItems: 1 + + ValidTimePeriod: + type: object + properties: + startTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + endTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + NonExternalUnrelatedClass: + properties: + lcsClientNonExternals: + type: array + items: + $ref: '#/components/schemas/LcsClientNonExternal' + minItems: 1 + afNonExternals: + type: array + items: + $ref: '#/components/schemas/AfNonExternal' + minItems: 1 + + LcsClientNonExternal: + type: object + required: + - lcsClientId + properties: + lcsClientId: + $ref: '#/components/schemas/LcsClientId' + allowedGeographicArea: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + privacyCheckRelatedAction: + $ref: '#/components/schemas/PrivacyCheckRelatedAction' + codeWordInd: + $ref: '#/components/schemas/CodeWordInd' + validTimePeriod: + $ref: '#/components/schemas/ValidTimePeriod' + + AfNonExternal: + type: object + required: + - afId + properties: + afId: + type: string + allowedGeographicArea: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + privacyCheckRelatedAction: + $ref: '#/components/schemas/PrivacyCheckRelatedAction' + codeWordInd: + $ref: '#/components/schemas/CodeWordInd' + validTimePeriod: + $ref: '#/components/schemas/ValidTimePeriod' + + ExternalUnrelatedClass: + properties: + lcsClientExternals: + type: array + items: + $ref: '#/components/schemas/LcsClientExternal' + minItems: 1 + afExternals: + type: array + items: + $ref: '#/components/schemas/AfExternal' + minItems: 1 + lcsClientGroupExternals: + type: array + items: + $ref: '#/components/schemas/LcsClientGroupExternal' + minItems: 1 + + AfExternal: + type: object + properties: + afId: + type: string + allowedGeographicArea: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + privacyCheckRelatedAction: + $ref: '#/components/schemas/PrivacyCheckRelatedAction' + validTimePeriod: + $ref: '#/components/schemas/ValidTimePeriod' + + LcsClientExternal: + type: object + properties: + allowedGeographicArea: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + privacyCheckRelatedAction: + $ref: '#/components/schemas/PrivacyCheckRelatedAction' + validTimePeriod: + $ref: '#/components/schemas/ValidTimePeriod' + + LcsClientGroupExternal: + type: object + properties: + lcsClientGroupId: + $ref: '#/components/schemas/ExtGroupId' + allowedGeographicArea: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + privacyCheckRelatedAction: + $ref: '#/components/schemas/PrivacyCheckRelatedAction' + validTimePeriod: + $ref: '#/components/schemas/ValidTimePeriod' + + ServiceTypeUnrelatedClass: + type: object + required: + - serviceType + properties: + serviceType: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LcsServiceType' + allowedGeographicArea: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + privacyCheckRelatedAction: + $ref: '#/components/schemas/PrivacyCheckRelatedAction' + codeWordInd: + $ref: '#/components/schemas/CodeWordInd' + validTimePeriod: + $ref: '#/components/schemas/ValidTimePeriod' + + LcsMoData: + type: object + required: + - allowedServiceClasses + properties: + allowedServiceClasses: + type: array + items: + $ref: '#/components/schemas/LcsMoServiceClass' + minItems: 1 + + EcRestrictionData: + type: object + properties: + ecModeARestricted: + type: boolean + ecModeBRestricted: + type: boolean + + ExpectedUeBehaviourData: + type: object + properties: + stationaryIndication: + $ref: 'TS29571_CommonData.yaml#/components/schemas/StationaryIndication' + communicationDurationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + periodicTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + scheduledCommunicationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ScheduledCommunicationTime' + scheduledCommunicationType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ScheduledCommunicationType' + expectedUmts: + type: array + items: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/LocationArea' + minItems: 1 + description: Identifies the UE's expected geographical movement. The attribute is only applicable in 5G. + trafficProfile: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TrafficProfile' + batteryIndication: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BatteryIndication' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + MaximumResponseTime: + type: object + required: + - maximumResponseTime + properties: + maximumResponseTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + MaximumLatency: + type: object + required: + - maximumLatency + properties: + maximumLatency: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + SuggestedPacketNumDl: + type: object + required: + - suggestedPacketNumDl + properties: + suggestedPacketNumDl: + type: integer + minimum: 1 + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + FrameRouteInfo: + type: object + properties: + ipv4Mask: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4AddrMask' + ipv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + + SorUpdateInfo: + type: object + required: + - vplmnId + properties: + vplmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + + EnhancedCoverageRestrictionData: + type: object + properties: + plmnEcInfoList: + type: array + items: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/PlmnEcInfo' + minItems: 1 + + EdrxParameters: + type: object + required: + - ratType + - edrxValue + properties: + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + edrxValue: + type: string + pattern: '^([0-1]{4})$' + + PtwParameters: + type: object + required: + - operationMode + - ptwValue + properties: + operationMode: + $ref: '#/components/schemas/OperationMode' + ptwValue: + type: string + pattern: '^([0-1]{4})$' + + UeId: + type: object + required: + - supi + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + +# SIMPLE TYPES: + + UeUsageType: + type: integer + + MpsPriorityIndicator: + type: boolean + + McsPriorityIndicator: + type: boolean + + DnnIndicator: + type: boolean + + LboRoamingAllowed: + type: boolean + + SmsSubscribed: + type: boolean + + 3GppChargingCharacteristics: + type: string + + DlPacketCount: + type: integer + minimum: -1 + + MicoAllowed: + type: boolean + + SharedDataId: + type: string + pattern: '^[0-9]{5,6}-.+$' + + IwkEpsInd: + type: boolean + + SecuredPacket: + type: string + format: base64 + + UpuRegInd: + type: boolean + + ExtGroupId: + type: string + pattern: '^extgroupid-[^@]+@[^@]+$' + + NbIoTUePriority: + type: integer + + CodeWord: + type: string + + AfId: + type: string + + LcsClientId: + type: string + + + +# ENUMS: + + DataSetName: + anyOf: + - type: string + enum: + - AM + - SMF_SEL + - UEC_SMF + - UEC_SMSF + - SMS_SUB + - SM + - TRACE + - SMS_MNG + - LCS_PRIVACY + - LCS_MO + - type: string + + PduSessionContinuityInd: + anyOf: + - type: string + enum: + - MAINTAIN_PDUSESSION + - RECONNECT_PDUSESSION + - RELEASE_PDUSESSION + - type: string + + LocationPrivacyInd: + anyOf: + - type: string + enum: + - LOCATION_DISALLOWED + - LOCATION_ALLOWED + - type: string + + PrivacyCheckRelatedAction: + anyOf: + - type: string + enum: + - LOCATION_NOT_ALLOWED + - LOCATION_ALLOWED_WITH_NOTIFICATION + - LOCATION_ALLOWED_WITHOUT_NOTIFICATION + - LOCATION_ALLOWED_WITHOUT_RESPONSE + - LOCATION_RESTRICTED_WITHOUT_RESPONSE + - type: string + + LcsClientClass: + anyOf: + - type: string + enum: + - BROADCAST_SERVICE + - OM_IN_HPLMN + - OM_IN_VPLMN + - ANONYMOUS_LOCATION_SERVICE + - SPECIFIC_SERVICE + - type: string + + LcsMoServiceClass: + anyOf: + - type: string + enum: + - BASIC_SELF_LOCATION + - AUTONOMOUS_SELF_LOCATION + - TRANSFER_TO_THIRD_PARTY + - type: string + + OperationMode: + anyOf: + - type: string + enum: + - WB_S1 + - NB_S1 + - WB_N1 + - NB_N1 + - type: string + + SorUpdateIndicator: + anyOf: + - type: string + enum: + - INITIAL_REGISTRATION + - EMERGENCY_REGISTRATION + - type: string + + CodeWordInd: + anyOf: + - type: string + enum: + - CODEWORD_CHECK_IN_UE + - CODEWORD_CHECK_IN_GMLC + - type: string + diff --git a/lib/sbi/support/standard/TS29503_Nudm_UEAU.yaml b/lib/sbi/support/standard/TS29503_Nudm_UEAU.yaml new file mode 100644 index 0000000000..daa90e9d61 --- /dev/null +++ b/lib/sbi/support/standard/TS29503_Nudm_UEAU.yaml @@ -0,0 +1,576 @@ +openapi: 3.0.0 +info: + version: '1.1.0.alpha-2' + title: 'NudmUEAU' + description: | + UDM UE Authentication Service. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 16.3.0 + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-ueau/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-ueau + - {} + +paths: + /{supiOrSuci}/security-information/generate-auth-data: + post: + summary: Generate authentication data for the UE + operationId: GenerateAuthData + tags: + - Generate Auth Data + parameters: + - name: supiOrSuci + in: path + description: SUPI or SUCI of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupiOrSuci' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticationInfoRequest' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticationInfoResult' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{supiOrSuci}/security-information-rg: + get: + summary: Get authentication data for the FN-RG + operationId: GetRgAuthData + tags: + - Get Auth Data for FN-RG + parameters: + - name: supiOrSuci + in: path + description: SUPI or SUCI of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupiOrSuci' + - name: authenticated-ind + in: query + description: Authenticated indication + required: true + schema: + $ref: '#/components/schemas/AuthenticatedInd' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + description: serving PLMN ID + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/RgAuthCtx' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{supi}/auth-events: + post: + summary: Create a new confirmation event + operationId: ConfirmAuth + tags: + - Confirm Auth + parameters: + - name: supi + in: path + description: SUPI of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthEvent' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AuthEvent' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-ueau/v1/{supi}/auth-events/{authEventId}' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{supi}/hss-security-information/generate-av: + post: + summary: Generate authentication data for the UE in EPS or IMS domain + operationId: GenerateAv + tags: + - Generate HSS Authentication Vectors + parameters: + - name: supi + in: path + description: SUPI of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/HssAuthenticationInfoRequest' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/HssAuthenticationInfoResult' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{supi}/auth-events/{authEventId}: + delete: + summary: Deletes the authentication result in the UDM + operationId: DeleteAuth + tags: + - Delete Auth + parameters: + - name: supi + in: path + description: SUPI of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: authEventId + in: path + description: authEvent Id + required: true + schema: + type: string + responses: + '204': + description: Expected response to a successful authentication result removal + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-ueau: Access to the nudm-ueau API + + + schemas: + +# COMPLEX TYPES: + + AuthenticationInfoRequest: + type: object + required: + - servingNetworkName + - ausfInstanceId + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + servingNetworkName: + $ref: '#/components/schemas/ServingNetworkName' + resynchronizationInfo: + $ref: '#/components/schemas/ResynchronizationInfo' + ausfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + cagId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CagId' + AuthenticationInfoResult: + type: object + required: + - authType + properties: + authType: + $ref: '#/components/schemas/AuthType' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + authenticationVector: + $ref: '#/components/schemas/AuthenticationVector' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + + AuthenticationVector: + oneOf: + - $ref: '#/components/schemas/AvEapAkaPrime' + - $ref: '#/components/schemas/Av5GHeAka' + discriminator: + propertyName: avType + mapping: + 5G_HE_AKA: '#/components/schemas/Av5GHeAka' + EAP_AKA_PRIME: '#/components/schemas/AvEapAkaPrime' + + AvEapAkaPrime: + type: object + required: + - avType + - rand + - xres + - autn + - ckPrime + - ikPrime + properties: + avType: + $ref: '#/components/schemas/AvType' + rand: + $ref: '#/components/schemas/Rand' + xres: + $ref: '#/components/schemas/Xres' + autn: + $ref: '#/components/schemas/Autn' + ckPrime: + $ref: '#/components/schemas/CkPrime' + ikPrime: + $ref: '#/components/schemas/IkPrime' + + Av5GHeAka: + type: object + required: + - avType + - rand + - xresStar + - autn + - kausf + properties: + avType: + $ref: '#/components/schemas/AvType' + rand: + $ref: '#/components/schemas/Rand' + xresStar: + $ref: '#/components/schemas/XresStar' + autn: + $ref: '#/components/schemas/Autn' + kausf: + $ref: '#/components/schemas/Kausf' + + ResynchronizationInfo: + type: object + required: + - rand + - auts + properties: + rand: + $ref: '#/components/schemas/Rand' + auts: + $ref: '#/components/schemas/Auts' + + AuthEvent: + type: object + required: + - nfInstanceId + - success + - timeStamp + - authType + - servingNetworkName + properties: + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + success: + $ref: '#/components/schemas/Success' + timeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + authType: + $ref: '#/components/schemas/AuthType' + servingNetworkName: + $ref: '#/components/schemas/ServingNetworkName' + + RgAuthCtx: + type: object + required: + - authInd + properties: + authInd: + type: boolean + default: false + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + HssAuthenticationInfoRequest: + type: object + required: + - hssAuthType + - numOfRequestedVectors + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + hssAuthType: + $ref: '#/components/schemas/HssAuthType' + numOfRequestedVectors: + $ref: '#/components/schemas/NumOfRequestedVectors' + servingNetworkId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + resynchronizationInfo: + $ref: '#/components/schemas/ResynchronizationInfo' + + HssAuthenticationInfoResult: + type: object + required: + - hssAuthenticationVectors + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + hssAuthenticationVectors: + $ref: '#/components/schemas/HssAuthenticationVectors' + + HssAuthenticationVectors: + oneOf: + - type: array + items: + $ref: '#/components/schemas/AvEpsAka' + minItems: 1 + maxItems: 5 + - type: array + items: + $ref: '#/components/schemas/AvImsGbaEapAka' + minItems: 1 + maxItems: 5 + - type: array + items: + $ref: '#/components/schemas/AvEapAkaPrime' + minItems: 1 + maxItems: 5 + + AvEpsAka: + type: object + required: + - avType + - rand + - xres + - autn + - kasme + properties: + avType: + $ref: '#/components/schemas/HssAvType' + rand: + $ref: '#/components/schemas/Rand' + xres: + $ref: '#/components/schemas/Xres' + autn: + $ref: '#/components/schemas/Autn' + kasme: + $ref: '#/components/schemas/Kasme' + + AvImsGbaEapAka: + type: object + required: + - avType + - rand + - xres + - autn + - ck + - ik + properties: + avType: + $ref: '#/components/schemas/HssAvType' + rand: + $ref: '#/components/schemas/Rand' + xres: + $ref: '#/components/schemas/Xres' + autn: + $ref: '#/components/schemas/Autn' + ck: + $ref: '#/components/schemas/ConfidentialityKey' + ik: + $ref: '#/components/schemas/IntegrityKey' + + +# SIMPLE TYPES: + + Autn: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + Auts: + type: string + pattern: '^[A-Fa-f0-9]{28}$' + + CkPrime: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + IkPrime: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + Kausf: + type: string + pattern: '^[A-Fa-f0-9]{64}$' + + Rand: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + Xres: + type: string + pattern: '^[A-Fa-f0-9]{8,32}$' + + XresStar: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + ServingNetworkName: + type: string + pattern: '^5G:mnc[0-9]{3}[.]mcc[0-9]{3}[.]3gppnetwork[.]org(:[A-F0-9]{11})?$' + + Success: + type: boolean + + AuthenticatedInd: + type: boolean + + ConfidentialityKey: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + IntegrityKey: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + Kasme: + type: string + pattern: '^[A-Fa-f0-9]{64}$' + + NumOfRequestedVectors: + type: integer + minimum: 1 + maximum: 5 + + +# ENUMS: + + AuthType: + anyOf: + - type: string + enum: + - 5G_AKA + - EAP_AKA_PRIME + - EAP_TLS + - type: string + + AvType: + anyOf: + - type: string + enum: + - 5G_HE_AKA + - EAP_AKA_PRIME + - type: string + + HssAuthType: + anyOf: + - type: string + enum: + - EPS_AKA + - EAP_AKA + - EAP_AKA_PRIME + - IMS_AKA + - GBA_AKA + - type: string + + HssAvType: + anyOf: + - type: string + enum: + - EPS_AKA + - EAP_AKA + - IMS_AKA + - GBA_AKA + - type: string + diff --git a/lib/sbi/support/standard/TS29503_Nudm_UECM.yaml b/lib/sbi/support/standard/TS29503_Nudm_UECM.yaml new file mode 100644 index 0000000000..57d8d1c28a --- /dev/null +++ b/lib/sbi/support/standard/TS29503_Nudm_UECM.yaml @@ -0,0 +1,1414 @@ +openapi: 3.0.0 + +info: + version: '1.1.0.alpha-3' + title: 'Nudm_UECM' + description: | + Nudm Context Management Service. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 16.3.0 + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-uecm/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-uecm + - {} + +paths: + /{ueId}/registrations/amf-3gpp-access: + put: + summary: register as AMF for 3GPP access + operationId: 3GppRegistration + tags: + - AMF registration for 3GPP access + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-uecm/v1/{ueId}/registrations/amf-3gpp-access' + required: true + schema: + type: string + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + deregistrationeNotification: + '{request.body#/deregCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DeregistrationData' + responses: + '204': + description: Successful Notification response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + pcscfRestorationNotification: + '{request.body#/pcscfRestorationCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PcscfRestorationNotification' + responses: + '204': + description: Successful Notification response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + patch: + summary: Update a parameter in the AMF registration for 3GPP access + operationId: Update3GppRegistration + tags: + - Parameter update in the AMF registration for 3GPP access + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistrationModification' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '422': + description: Unprocessable Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + get: + summary: retrieve the AMF registration for 3GPP access information + operationId: Get3GppRegistration + tags: + - AMF 3Gpp-access Registration Info Retrieval + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/amf-3gpp-access/dereg-amf: + post: + summary: trigger AMF for 3GPP access deregistration + operationId: deregAMF + tags: + - Trigger AMF for 3GPP access deregistration + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AmfDeregInfo' + required: true + responses: + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/amf-3gpp-access/pei-update: + post: + summary: Updates the PEI in the 3GPP access registration context + operationId: PeiUpdate + tags: + - PEI Update + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PeiUpdateInfo' + required: true + responses: + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/amf-non-3gpp-access: + put: + summary: register as AMF for non-3GPP access + operationId: Non3GppRegistration + tags: + - AMF registration for non-3GPP access + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AmfNon3GppAccessRegistration' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/AmfNon3GppAccessRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-uecm/v1/{ueId}/registrations/amf-non-3gpp-access' + required: true + schema: + type: string + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AmfNon3GppAccessRegistration' + '204': + description: No Content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + deregistrationeNotification: + '{request.body#/deregCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DeregistrationData' + responses: + '204': + description: Successful Notification response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + pcscfRestorationNotification: + '{request.body#/pcscfRestorationCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PcscfRestorationNotification' + responses: + '204': + description: Successful Notification response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + patch: + summary: update a parameter in the AMF registration for non-3GPP access + operationId: UpdateNon3GppRegistration + tags: + - Parameter update in the AMF registration for non-3GPP access + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/AmfNon3GppAccessRegistrationModification' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '422': + description: Unprocessable Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + get: + summary: retrieve the AMF registration for non-3GPP access information + operationId: GetNon3GppRegistration + tags: + - AMF non-3GPP-access Registration Info Retrieval + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AmfNon3GppAccessRegistration' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/smf-registrations: + get: + summary: retrieve the SMF registration information + operationId: GetSmfRegistration + tags: + - SMF SmfRegistration + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: single-nssai + in: query + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + - name: dnn + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - name: supported-features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegistrationInfo' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/smf-registrations/{pduSessionId}: + put: + summary: register as SMF + operationId: Registration + tags: + - SMF SmfRegistration + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: pduSessionId + in: path + description: Identifier of the PDU session + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegistration' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-uecm/v1/{ueId}/registrations/smf-registrations/{pduSessionId}' + required: true + schema: + type: string + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegistration' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + deregistrationeNotification: + '{request.body#/deregCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DeregistrationData' + responses: + '204': + description: Successful Notification response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + pcscfRestorationNotification: + '{request.body#/pcscfRestorationCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PcscfRestorationNotification' + responses: + '204': + description: Successful Notification response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + delete: + summary: delete an SMF registration + operationId: SmfDeregistration + tags: + - SMF Deregistration + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: pduSessionId + in: path + description: Identifier of the PDU session + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + - name: smf-set-id + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + responses: + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '422': + description: Unprocessable Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + get: + summary: get an SMF registration + operationId: RetrieveSmfRegistration + tags: + - Retrieve SMF Registration + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: pduSessionId + in: path + description: Identifier of the PDU session + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegistration' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/smsf-3gpp-access: + put: + summary: register as SMSF for 3GPP access + operationId: 3GppSmsfRegistration + tags: + - SMSF registration for 3GPP access + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-uecm/v1/{ueId}/registrations/smsf-3gpp-access' + required: true + schema: + type: string + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + delete: + summary: delete the SMSF registration for 3GPP access + operationId: 3GppSmsfDeregistration + tags: + - SMSF Deregistration for 3GPP Access + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: smsf-set-id + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + responses: + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '422': + description: Unprocessable Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + get: + summary: retrieve the SMSF registration for 3GPP access information + operationId: Get3GppSmsfRegistration + tags: + - SMSF 3GPP access Registration Info Retrieval + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + - name: supported-features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/smsf-non-3gpp-access: + put: + summary: register as SMSF for non-3GPP access + operationId: Non3GppSmsfRegistration + tags: + - SMSF registration for non-3GPP access + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-uecm/v1/{ueId}/registrations/smsf-non-3gpp-access' + required: true + schema: + type: string + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + delete: + summary: delete SMSF registration for non 3GPP access + operationId: Non3GppSmsfDeregistration + tags: + - SMSF Deregistration for non-3GPP access + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: smsf-set-id + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + responses: + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '422': + description: Unprocessable Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + get: + summary: retrieve the SMSF registration for non-3GPP access information + operationId: GetNon3GppSmsfRegistration + tags: + - SMSF non-3GPP access Registration Info Retrieval + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + - name: supported-features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /restore-pcscf: + post: + summary: Trigger the Restoration of the P-CSCF + operationId: Trigger P-CSCF Restoration + tags: + - Trigger P-CSCF Restoration + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TriggerRequest' + required: true + responses: + '204': + description: Successful response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/loation: + get: + summary: retrieve the target UE’s location information + operationId: GetLocationInfo + tags: + - UE Location Information retrieval + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/LocationInfo' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-uecm: Access to the nudm-uecm API + + schemas: + +# COMPLEX TYPES: + + Amf3GppAccessRegistration: + type: object + required: + - amfInstanceId + - deregCallbackUri + - guami + - ratType + properties: + amfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + purgeFlag: + $ref: '#/components/schemas/PurgeFlag' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + imsVoPs: + $ref: '#/components/schemas/ImsVoPs' + deregCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + amfServiceNameDereg: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' + pcscfRestorationCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + amfServiceNamePcscfRest: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' + initialRegistrationInd: + type: boolean + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + backupAmfInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BackupAmfInfo' + minItems: 1 + drFlag: + $ref: '#/components/schemas/DualRegistrationFlag' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + urrpIndicator: + type: boolean + amfEeSubscriptionId: + type: string + epsInterworkingInfo: + $ref: '#/components/schemas/EpsInterworkingInfo' + ueSrvccCapability: + type: boolean + nid: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Nid' + registrationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + vgmlcAddressIpv4: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + vgmlcAddressIpv6: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + vgmlcFqdn: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/Fqdn' + + + Amf3GppAccessRegistrationModification: + type: object + required: + - guami + properties: + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + purgeFlag: + $ref: '#/components/schemas/PurgeFlag' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + imsVoPs: + $ref: '#/components/schemas/ImsVoPs' + backupAmfInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BackupAmfInfo' + epsInterworkingInfo: + $ref: '#/components/schemas/EpsInterworkingInfo' + ueSrvccCapability: + type: boolean + nullable: true + + EpsInterworkingInfo: + type: object + properties: + epsIwkPgws: + description: A map (list of key-value pairs where Dnn serves as key) of EpsIwkPgws + type: object + additionalProperties: + $ref: '#components/schemas/EpsIwkPgw' + + EpsIwkPgw: + type: object + required: + - pgwFqdn + - smfInstanceId + properties: + pgwFqdn: + type: string + smfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + + AmfNon3GppAccessRegistration: + type: object + required: + - amfInstanceId + - imsVoPs + - deregCallbackUri + - guami + - ratType + properties: + amfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + purgeFlag: + $ref: '#/components/schemas/PurgeFlag' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + imsVoPs: + $ref: '#/components/schemas/ImsVoPs' + deregCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + amfServiceNameDereg: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' + pcscfRestorationCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + amfServiceNamePcscfRest: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + backupAmfInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BackupAmfInfo' + minItems: 1 + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + urrpIndicator: + type: boolean + amfEeSubscriptionId: + type: string + nid: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Nid' + registrationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + vgmlcAddressIpv4: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + vgmlcAddressIpv6: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + vgmlcFqdn: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/Fqdn' + + + AmfNon3GppAccessRegistrationModification: + type: object + required: + - guami + properties: + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + purgeFlag: + $ref: '#/components/schemas/PurgeFlag' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + imsVoPs: + $ref: '#/components/schemas/ImsVoPs' + backupAmfInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BackupAmfInfo' + + SmfRegistration: + type: object + required: + - smfInstanceId + - pduSessionId + - singleNssai + - plmnId + properties: + smfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + smfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + singleNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + emergencyServices: + type: boolean + pcscfRestorationCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + pgwFqdn: + type: string + epdgInd: + type: boolean + default: false + deregCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + registrationReason: + $ref: '#/components/schemas/RegistrationReason' + registrationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + SmsfRegistration: + type: object + required: + - smsfInstanceId + - plmnId + properties: + smsfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + smsfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + smsfMAPAddress: + $ref: '#/components/schemas/E164Number' + smsfDiameterAddress: + $ref: '#/components/schemas/NetworkNodeDiameterAddress' + registrationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + DeregistrationData: + type: object + required: + - deregReason + - accessType + properties: + deregReason: + $ref: '#/components/schemas/DeregistrationReason' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + newSmfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + + PcscfRestorationNotification: + type: object + required: + - supi + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + + NetworkNodeDiameterAddress: + type: object + required: + - name + - realm + properties: + name: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + realm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + + TriggerRequest: + type: object + required: + - supi + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + + SmfRegistrationInfo: + type: object + required: + - smfRegistrationList + properties: + smfRegistrationList: + type: array + items: + $ref: '#/components/schemas/SmfRegistration' + minItems: 1 + + AmfDeregInfo: + type: object + required: + - deregReason + properties: + deregReason: + $ref: '#/components/schemas/DeregistrationReason' + + LocationInfo: + type: object + required: + - registrationLocationInfoList + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + registrationLocationInfoList: + type: array + items: + $ref: '#/components/schemas/RegistrationLocationInfo' + minItems: 1 + maxItems: 2 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + RegistrationLocationInfo: + type: object + + CmInfoReport: + type: object + required: + - newCmInfoList + properties: + oldCmInfoList: + type: array + items: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/CmInfo' + minItems: 1 + maxItems: 2 + newCmInfoList: + type: array + items: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/CmInfo' + minItems: 1 + maxItems: 2 + + VgmlcAddress: + type: object + properties: + vgmlcAddressIpv4: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + vgmlcAddressIpv6: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + vgmlcFqdn: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/Fqdn' + + PeiUpdateInfo: + type: object + required: + - pei + properties: + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + + +# SIMPLE TYPES: + + PurgeFlag: + type: boolean + + E164Number: + type: string + pattern: '^[0-9]{1,15}$' + + DualRegistrationFlag: + type: boolean + +# ENUMS: + + ImsVoPs: + anyOf: + - type: string + enum: + - HOMOGENEOUS_SUPPORT + - HOMOGENEOUS_NON_SUPPORT + - NON_HOMOGENEOUS_OR_UNKNOWN + - type: string + + DeregistrationReason: + anyOf: + - type: string + enum: + - UE_INITIAL_REGISTRATION + - UE_REGISTRATION_AREA_CHANGE + - SUBSCRIPTION_WITHDRAWN + - 5GS_TO_EPS_MOBILITY + - 5GS_TO_EPS_MOBILITY_UE_INITIAL_REGISTRATION + - REREGISTRATION_REQUIRED + - SMF_CONTEXT_TRANSFERRED + - type: string + + RegistrationReason: + anyOf: + - type: string + enum: + - SMF_CONTEXT_TRANSFERRED + - type: string + diff --git a/lib/sbi/support/standard/TS29504_Nudr_DR.yaml b/lib/sbi/support/standard/TS29504_Nudr_DR.yaml new file mode 100644 index 0000000000..92231b905f --- /dev/null +++ b/lib/sbi/support/standard/TS29504_Nudr_DR.yaml @@ -0,0 +1,172 @@ +openapi: 3.0.0 + +info: + version: 2.1.0.alpha-4 + title: 'Nudr_DataRepository API OpenAPI file' + description: | + Unified Data Repository Service. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.504 V16.3.0; 5G System; Unified Data Repository Services; Stage 3 + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.504/' + +servers: + - description: API root + url: '{apiRoot}/nudr-dr/v2' + variables: + apiRoot: + default: https://example.com + +security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + +paths: + /subscription-data/{ueId}/authentication-data/authentication-subscription: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1authentication-data~1authentication-subscription' + /subscription-data/{ueId}/authentication-data/authentication-status: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1authentication-data~1authentication-status' + /subscription-data/{ueId}/ue-update-confirmation-data/sor-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1ue-update-confirmation-data~1sor-data' + /subscription-data/{ueId}/ue-update-confirmation-data/upu-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1ue-update-confirmation-data~1upu-data' + /subscription-data/{ueId}/ue-update-confirmation-data/subscribed-cag: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1ue-update-confirmation-data~1subscribed-cag' + /subscription-data/{ueId}/ue-update-confirmation-data/subscribed-snssais: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1ue-update-confirmation-data~1subscribed-snssais' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/am-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data~1am-data' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/smf-selection-subscription-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data~1smf-selection-subscription-data' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/sm-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data~1sm-data' + /subscription-data/{ueId}/context-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data' + /subscription-data/{ueId}/context-data/amf-3gpp-access: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1amf-3gpp-access' + /subscription-data/{ueId}/context-data/amf-non-3gpp-access: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1amf-non-3gpp-access' + /subscription-data/{ueId}/context-data/smf-registrations: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1smf-registrations' + /subscription-data/{ueId}/context-data/smf-registrations/{pduSessionId}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1smf-registrations~1%7BpduSessionId%7D' + /subscription-data/{ueId}/operator-specific-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1operator-specific-data' + /subscription-data/{ueId}/context-data/smsf-3gpp-access: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1smsf-3gpp-access' + /subscription-data/{ueId}/context-data/smsf-non-3gpp-access: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1smsf-non-3gpp-access' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/sms-mng-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data~1sms-mng-data' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/sms-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data~1sms-data' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/lcs-privacy-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data~1lcs-privacy-data' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/lcs-mo-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data~1lcs-mo-data' + /subscription-data/{ueId}/pp-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1pp-data' + /subscription-data/{ueId}/context-data/ee-subscriptions: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1ee-subscriptions' + /subscription-data/{ueId}/context-data/ee-subscriptions/{subsId}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1ee-subscriptions~1%7BsubsId%7D' + /subscription-data/{ueId}/context-data/ee-subscriptions/{subsId}/amf-subscriptions: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1ee-subscriptions~1%7BsubsId%7D~1amf-subscriptions' + /subscription-data/group-data/{ueGroupId}/ee-subscriptions: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~1%7BueGroupId%7D~1ee-subscriptions' + /subscription-data/group-data/{ueGroupId}/ee-subscriptions/{subsId}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~1%7BueGroupId%7D~1ee-subscriptions~1%7BsubsId%7D' + /subscription-data/group-data/5g-vn-groups: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~15g-vn-groups' + /subscription-data/group-data/5g-vn-groups/{externalGroupId}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~15g-vn-groups~1%7BexternalGroupId%7D' + /subscription-data/{ueId}/ee-profile-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1ee-profile-data' + /subscription-data/{ueId}/context-data/sdm-subscriptions: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1sdm-subscriptions' + /subscription-data/{ueId}/context-data/sdm-subscriptions/{subsId}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1sdm-subscriptions~1%7BsubsId%7D' + /subscription-data/shared-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1shared-data' + /subscription-data/subs-to-notify: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1subs-to-notify' + /subscription-data/subs-to-notify/{subsId}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1subs-to-notify~1%7BsubsId%7D' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/trace-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data~1trace-data' + /subscription-data/{ueId}/identity-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1identity-data' + /subscription-data/{ueId}/operator-determined-barring-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1operator-determined-barring-data' + /subscription-data/{ueId}/nidd-authorization-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1nidd-authorization-data' + /subscription-data/group-data/group-identifiers: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~1group-identifiers' + /policy-data/ues/{ueId}/am-data: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1ues~1%7BueId%7D~1am-data' + /policy-data/ues/{ueId}/ue-policy-set: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1ues~1%7BueId%7D~1ue-policy-set' + /policy-data/ues/{ueId}/sm-data: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1ues~1%7BueId%7D~1sm-data' + /policy-data/ues/{ueId}/sm-data/{usageMonId}: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1ues~1%7BueId%7D~1sm-data~1%7BusageMonId%7D' + /policy-data/sponsor-connectivity-data/{sponsorId}: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1sponsor-connectivity-data~1%7BsponsorId%7D' + /policy-data/bdt-data: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1bdt-data' + /policy-data/bdt-data/{bdtReferenceId}: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1bdt-data~1%7BbdtReferenceId%7D' + /policy-data/subs-to-notify: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1subs-to-notify' + /policy-data/subs-to-notify/{subsId}: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1subs-to-notify~1%7BsubsId%7D' + /policy-data/ues/{ueId}/operator-specific-data: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1ues~1%7BueId%7D~1operator-specific-data' + /application-data/pfds: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1pfds' + /application-data/pfds/{appId}: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1pfds~1%7BappId%7D' + /application-data/influenceData: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1influenceData' + /application-data/influenceData/{influenceId}: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1influenceData~1%7BinfluenceId%7D' + /policy-data/plmns/{plmnId}/ue-policy-set: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1plmns~1%7BplmnId%7D~1ue-policy-set' + /application-data/bdtPolicyData: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1bdtPolicyData' + /application-data/bdtPolicyData/{bdtPolicyId}: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1bdtPolicyData~1%7BbdtPolicyId%7D' + /application-data/iptvConfigData: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1iptvConfigData' + /application-data/iptvConfigData/{configurationId}: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1iptvConfigData~1%7BconfigurationId%7D' + /application-data/influenceData/subs-to-notify: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1influenceData~1subs-to-notify' + /application-data/influenceData/subs-to-notify/{subscriptionId}: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1influenceData~1subs-to-notify~1%7BsubscriptionId%7D' + /application-data/subs-to-notify: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1subs-to-notify' + /application-data/subs-to-notify/{subsId}: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1subs-to-notify~1%7BsubsId%7D' + /exposure-data/{ueId}/access-and-mobility-data: + $ref: 'TS29519_Exposure_Data.yaml#/paths/~1exposure-data~1%7BueId%7D~1access-and-mobility-data' + /exposure-data/{ueId}/session-management-data/{pduSessionId}: + $ref: 'TS29519_Exposure_Data.yaml#/paths/~1exposure-data~1%7BueId%7D~1session-management-data~1%7BpduSessionId%7D' + /exposure-data/subs-to-notify: + $ref: 'TS29519_Exposure_Data.yaml#/paths/~1exposure-data~1subs-to-notify' + /exposure-data/subs-to-notify/{subId}: + $ref: 'TS29519_Exposure_Data.yaml#/paths/~1exposure-data~1subs-to-notify~1%7BsubId%7D' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudr-dr: Access to the Nudr_DataRepository API diff --git a/lib/sbi/support/standard/TS29504_Nudr_GroupIDmap.yaml b/lib/sbi/support/standard/TS29504_Nudr_GroupIDmap.yaml new file mode 100644 index 0000000000..5ad19d796d --- /dev/null +++ b/lib/sbi/support/standard/TS29504_Nudr_GroupIDmap.yaml @@ -0,0 +1,94 @@ +openapi: 3.0.0 + +info: + version: 1.0.0.alpha-1 + title: 'Nudr_GroupIDmap' + description: | + Unified Data Repository Service for NF-Group ID retrieval. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.504 V16.2.0; 5G System; Unified Data Repository Services; Stage 3 + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.504/' + +servers: + - description: API root + url: '{apiRoot}/nudr-group-id-map/v1' + variables: + apiRoot: + default: https://example.com + +security: + - {} + - oAuth2ClientCredentials: + - nudr-group-id-map + +paths: + /nf-group-ids: + get: + summary: Retrieves NF-Group IDs for provided Subscriber and NF types + operationId: GetNfGroupIDs + tags: + - NF Group IDs (Document) + parameters: + - name: nf-type + in: query + description: Type of NF + required: true + style: form + explode: false + schema: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + minItems: 1 + - name: subscriberId + in: query + description: Identifier of the subscriber + required: true + schema: + $ref: '#/components/schemas/SubscriberId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/NfGroupIdMapResult' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + description: Unexpected error + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudr-group-id-map: Access to the Nudr_GroupIDmap API + + + + schemas: + +# COMPLEX TYPES: + + NfGroupIdMapResult: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + minProperties: 1 + + +# SIMPLE TYPES: + + SubscriberId: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|impi-.+|impu-.+|.+)$' + +# ENUMS: diff --git a/lib/sbi/support/standard/TS29505_Subscription_Data.yaml b/lib/sbi/support/standard/TS29505_Subscription_Data.yaml new file mode 100644 index 0000000000..ab1e93807b --- /dev/null +++ b/lib/sbi/support/standard/TS29505_Subscription_Data.yaml @@ -0,0 +1,3645 @@ +openapi: 3.0.0 +info: + version: '-' + title: 'Unified Data Repository Service API file for subscription data' + description: | + Unified Data Repository Service (subscription data). + The API version is defined in 3GPP TS 29.504. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.505 V16.2.0; 5G System; Usage of the Unified Data Repository Service for subscription data; Stage 3 + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.505/' + +paths: + + /subscription-data/{ueId}/authentication-data/authentication-subscription: + get: + summary: Retrieves the authentication subscription data of a UE + operationId: QueryAuthSubsData + tags: + - Authentication Data (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticationSubscription' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + patch: + summary: modify the authentication subscription data of a UE + operationId: ModifyAuthenticationSubscription + tags: + - Authentication Subscription (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/authentication-data/authentication-status: + put: + summary: To store the Authentication Status data of a UE + operationId: CreateAuthenticationStatus + tags: + - Authentication Status (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/AuthEvent' + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + get: + summary: Retrieves the Authentication Status of a UE + operationId: QueryAuthenticationStatus + tags: + - AuthEvent (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + description: Supported Features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/AuthEvent' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + delete: + summary: To remove the Authentication Status of a UE + operationId: DeleteAuthenticationStatus + tags: + - AuthEvent (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '204': + description: Upon success, an empty response body shall be returned. + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/ue-update-confirmation-data/sor-data: + put: + summary: To store the SoR acknowledgement information of a UE + operationId: CreateAuthenticationSoR + tags: + - Authentication SoR (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SorData' + responses: + '204': + description: Expected response to a valid request + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + get: + summary: Retrieves the SoR acknowledgement information of a UE + operationId: QueryAuthSoR + tags: + - Authentication SoR (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supportedFeatures + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SorData' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/ue-update-confirmation-data/upu-data: + put: + summary: To store the UPU acknowledgement information of a UE + operationId: CreateAuthenticationUPU + tags: + - Authentication UPU (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpuData' + responses: + '204': + description: Expected response to a valid request + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + get: + summary: Retrieves the UPU acknowledgement information of a UE + operationId: QueryAuthUPU + tags: + - Authentication UPU (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supportedFeatures + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/UpuData' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/ue-update-confirmation-data/subscribed-snssais: + put: + summary: To store the NSSAI update acknowledgement information of a UE + operationId: Create NSSAI update ack + tags: + - NSSAI update ack (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NssaiAckData' + responses: + '204': + description: Expected response to a valid request + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + get: + summary: Retrieves the UPU acknowledgement information of a UE + operationId: QueryNssaiAck + tags: + - NSSAI ACK (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supportedFeatures + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/NssaiAckData' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/ue-update-confirmation-data/subscribed-cag: + put: + summary: To store the CAG update acknowledgement information of a UE + operationId: CreateCagUpdateAck + tags: + - CAG update ack (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CagAckData' + responses: + '204': + description: Expected response to a valid request + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + get: + summary: Retrieves the CAG acknowledgement information of a UE + operationId: QueryCagAck + tags: + - CAG ACK (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/CagAckData' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data: + get: + summary: Retrieve multiple provisioned data sets of a UE + operationId: QueryProvisionedData + tags: + - Provisioned Data (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: dataset-names + in: query + description: List of dataset names + style: form + explode: false + schema: + $ref: '#/components/schemas/DatasetNames' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ProvisionedDataSets' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/am-data: + get: + summary: Retrieves the access and mobility subscription data of a UE + operationId: QueryAmData + tags: + - Access And Mobility Subscription Data (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AccessAndMobilitySubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/smf-selection-subscription-data: + get: + summary: Retrieves the SMF selection subscription data of a UE + operationId: QuerySmfSelectData + tags: + - SMF Selection Subscription Data (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmfSelectionSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/sm-data: + get: + summary: Retrieves the Session Management subscription data of a UE + operationId: QuerySmData + tags: + - Session Management Subscription Data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: single-nssai + in: query + content: + application/json: + schema: + $ref: '#/components/schemas/VarSnssai' + description: single NSSAI + required: false + - name: dnn + in: query + description: DNN + required: false + schema: + $ref: '#/components/schemas/Dnn' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SessionManagementSubscriptionData' + minItems: 1 + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/context-data/amf-3gpp-access: + get: + summary: Retrieves the AMF context data of a UE using 3gpp access + operationId: QueryAmfContext3gpp + tags: + - AMF 3GPP Access Registration (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + put: + summary: To store the AMF context data of a UE using 3gpp access in the UDR + operationId: CreateAmfContext3gpp + tags: + - AMF 3GPP Access Registration (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + patch: + summary: To modify the AMF context data of a UE using 3gpp access in the UDR + operationId: AmfContext3gpp + tags: + - AMF 3GPP Access Registration (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/context-data/amf-non-3gpp-access: + get: + summary: Retrieves the AMF context data of a UE using non-3gpp access + operationId: QueryAmfContextNon3gpp + tags: + - AMF Non-3GPP Access Registration (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AmfNon3GppAccessRegistration' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + put: + summary: To store the AMF context data of a UE using non-3gpp access in the UDR + operationId: CreateAmfContextNon3gpp + tags: + - AMF Non-3GPP Access Registration (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AmfNon3GppAccessRegistration' + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + patch: + summary: To modify the AMF context data of a UE using non 3gpp access in the UDR + operationId: AmfContextNon3gpp + tags: + - AMF Non-3GPP Access Registration (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/context-data/smf-registrations: + get: + summary: Retrieves the SMF registration list of a UE + operationId: QuerySmfRegList + tags: + - SMF Registrations (Collection) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegList' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/context-data/smf-registrations/{pduSessionId}: + get: + summary: Retrieves the individual SMF registration of a UE + operationId: QuerySmfRegistration + tags: + - SMF Registration (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: pduSessionId + in: path + description: PDU session id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegistration' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + put: + summary: To create an individual SMF context data of a UE in the UDR + operationId: CreateSmfContextNon3gpp + tags: + - SMF Registration (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: pduSessionId + in: path + description: PDU session id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegistration' + responses: + '201': + description: Upon success, a response body containing a representation of the created Individual SmfRegistration resource shall be returned + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/{ueId}/context-data/smf-registrations/{pduSessionId}' + required: true + schema: + type: string + delete: + summary: To remove an individual SMF context data of a UE the UDR + operationId: DeleteSmfContext + tags: + - SMF Registration (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: pduSessionId + in: path + description: PDU session id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + responses: + '204': + description: Upon success, an empty response body shall be returned. + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/operator-specific-data: + get: + summary: Retrieves the operator specific data of a UE + operationId: QueryOperSpecData + tags: + - Operator-Specific Data Container (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: object + additionalProperties: + $ref: '#/components/schemas/OperatorSpecificDataContainer' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + patch: + summary: To modify operator specific data of a UE + operationId: ModifyOperSpecData + tags: + - Operator-Specific Data Container (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/context-data/smsf-3gpp-access: + put: + summary: Create the SMSF context data of a UE via 3GPP access + operationId: CreateSmsfContext3gpp + tags: + - SMSF 3GPP Registration (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + delete: + summary: To remove the SMSF context data of a UE via 3GPP access + operationId: DeleteSmsfContext3gpp + tags: + - SMSF 3GPP Registration (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + get: + summary: Retrieves the SMSF context data of a UE using 3gpp access + operationId: QuerySmsfContext3gpp + tags: + - SMSF 3GPP Registration (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/context-data/smsf-non-3gpp-access: + put: + summary: Create the SMSF context data of a UE via non-3GPP access + operationId: CreateSmsfContextNon3gpp + tags: + - SMSF Non-3GPP Registration (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + delete: + summary: To remove the SMSF context data of a UE via non-3GPP access + operationId: DeleteSmsfContextNon3gpp + tags: + - SMSF Non-3GPP Registration (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + get: + summary: Retrieves the SMSF context data of a UE using non-3gpp access + operationId: QuerySmsfContextNon3gpp + tags: + - SMSF Non-3GPP Registration (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/sms-mng-data: + get: + summary: Retrieves the SMS management subscription data of a UE + operationId: QuerySmsMngData + tags: + - SMS Management Subscription Data (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsManagementSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/sms-data: + get: + summary: Retrieves the SMS subscription data of a UE + operationId: QuerySmsData + tags: + - SMS Subscription Data (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/pp-data: + get: + summary: Read the profile of a given UE + operationId: GetppData + tags: + - Parameter Provision (Document) + parameters: + - name: ueId + in: path + description: pp data for a UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/PpData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '403': + description: Forbidden + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + patch: + summary: modify the provisioned parameter data + operationId: ModifyPpData + tags: + - ProvisionedParameterData (Document) + parameters: + - name: ueId + in: path + description: pp data for a UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/context-data/ee-subscriptions: + get: + summary: Retrieves the ee subscriptions of a UE + operationId: Queryeesubscriptions + tags: + - Event Exposure Subscriptions (Collection) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/EeSubscription' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + post: + summary: Create individual EE subscription + operationId: CreateEeSubscriptions + tags: + - Event Exposure Subscriptions (Collection) + parameters: + - name: ueId + in: path + description: UE ID + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EeSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/EeSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/{ueId}/context-data/ee-subscriptions/{subsId}' + required: true + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/context-data/ee-subscriptions/{subsId}: + put: + summary: Update an individual ee subscriptions of a UE + operationId: UpdateEesubscriptions + tags: + - Event Exposure Subscription (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EeSubscription' + responses: + '204': + description: Upon success, an empty response body shall be returned + '404': + description: update of non-existing resource is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + delete: + summary: Deletes a eeSubscription + operationId: RemoveeeSubscriptions + tags: + - Event Exposure Subscription (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + description: Unique ID of the subscription to remove + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + + patch: + summary: Modify an individual ee subscription of a UE + operationId: ModifyEesubscription + tags: + - Event Exposure Subscription (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '204': + description: Successful response + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + description: Unexpected error + + get: + summary: Retrieve a eeSubscription + operationId: QueryeeSubscription + tags: + - Event Exposure Subscription (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + description: Unique ID of the subscription to remove + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + items: + $ref: '#/components/schemas/EeSubscription' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/context-data/ee-subscriptions/{subsId}/amf-subscriptions: + put: + summary: Create AmfSubscriptions for an individual ee subscriptions of a UE + operationId: Create AMF Subscriptions + tags: + - AMF Subscription Info (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AmfSubscriptionInfo' + minItems: 1 + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + delete: + summary: Deletes AMF Subscription Info for an eeSubscription + operationId: RemoveAmfSubscriptionsInfo + tags: + - Event AMF Subscription Info (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + patch: + summary: modify the AMF Subscription Info + operationId: ModifyAmfSubscriptionInfo + tags: + - AmfSubscriptionInfo (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + get: + summary: Retrieve AMF subscription Info + operationId: GetAmfSubscriptionInfo + tags: + - Query AMF Subscription Info (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AmfSubscriptionInfo' + minItems: 1 + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/group-data/{ueGroupId}/ee-subscriptions: + get: + summary: Retrieves the ee subscriptions of a group of UEs or any UE + operationId: QueryEeGroupSubscriptions + tags: + - Event Exposure Group Subscriptions (Collection) + parameters: + - name: ueGroupId + in: path + description: Group of UEs or any UE + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/EeSubscription' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + post: + summary: Create individual EE subscription for a group of UEs or any UE + operationId: CreateEeGroupSubscriptions + tags: + - Event Exposure Group Subscriptions (Collection) + parameters: + - name: ueGroupId + in: path + description: Group of UEs or any UE + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EeSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/EeSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/group-data/{ueGroupId}/ee-subscriptions ' + required: true + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/group-data/{ueGroupId}/ee-subscriptions/{subsId}: + put: + summary: Update an individual ee subscription of a group of UEs or any UE + operationId: UpdateEeGroupSubscriptions + tags: + - Event Exposure Subscription (Document) + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EeSubscription' + responses: + '204': + description: Upon success, an empty response body shall be returned + '404': + description: update of non-existing resource is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + delete: + summary: Deletes a eeSubscription for a group of UEs or any UE + operationId: RemoveEeGroupSubscriptions + tags: + - Event Exposure Subscription (Document) + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + description: Unique ID of the subscription to remove + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + + patch: + summary: Modify an individual ee subscription for a group of a UEs + operationId: ModifyEeGroupSubscription + tags: + - Event Exposure Subscription (Document) + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '204': + description: Successful response + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + description: Unexpected error + + get: + summary: Retrieve a individual eeSubscription for a group of UEs or any UE + operationId: QueryEeGroupSubscription + tags: + - Event Exposure Subscription (Document) + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + description: Unique ID of the subscription to remove + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + items: + $ref: '#/components/schemas/EeSubscription' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/ee-profile-data: + get: + summary: Retrieves the ee profile data of a UE + operationId: QueryEEData + tags: + - Event Exposure Data (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + style: form + explode: false + - name: supportedFeatures + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/EeProfileData' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + + /subscription-data/{ueId}/context-data/sdm-subscriptions: + get: + summary: Retrieves the sdm subscriptions of a UE + operationId: Querysdmsubscriptions + tags: + - SDM Subscriptions (Collection) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SdmSubscription' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + post: + summary: Create individual sdm subscription + operationId: CreateSdmSubscriptions + tags: + - SDM Subscriptions (Collection) + parameters: + - name: ueId + in: path + description: UE ID + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SdmSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SdmSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/{ueId}/context-data/sdm-subscriptions/{subsId}' + required: true + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/context-data/sdm-subscriptions/{subsId}: + put: + summary: Update an individual sdm subscriptions of a UE + operationId: Updatesdmsubscriptions + tags: + - SDM Subscription (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SdmSubscription' + responses: + '204': + description: Upon success, an empty response body shall be returned + '404': + description: update of non-existing resource is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + delete: + summary: Deletes a sdmsubscriptions + operationId: RemovesdmSubscriptions + tags: + - SDM Subscription (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + description: Unique ID of the subscription to remove + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + + patch: + summary: Modify an individual sdm subscription + operationId: ModifysdmSubscription + tags: + - SDM Subscription (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '204': + description: Successful response + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + description: Unexpected error + + get: + summary: Retrieves a individual sdmSubscription identified by subsId + operationId: QuerysdmSubscription + tags: + - SDM Subscription (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + description: Unique ID of the subscription to retrieve + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + items: + $ref: '#/components/schemas/SdmSubscription' + + /subscription-data/shared-data: + get: + summary: retrieve shared data + operationId: GetSharedData + tags: + - Retrieval of shared data + parameters: + - name: shared-data-ids + in: query + description: List of shared data ids + required: true + style: form + explode: false + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SharedDataIds' + - name: supportedFeatures + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SharedData' + minItems: 1 + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /subscription-data/subs-to-notify: + post: + summary: Subscription data subscriptions + operationId: SubscriptionDataSubscriptions + tags: + - Subs To Nofify (Collection) + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionDataSubscriptions' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionDataSubscriptions' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/subs-to-notify/{subsId}' + required: true + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + callbacks: + onDataChange: + '{request.body#/callbackReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DataChangeNotify' + responses: + '204': + description: Expected response to a valid request + + get: + summary: Retrieves the list of subscriptions + operationId: QuerySubsToNotify + tags: + - Subs To Nofify (Collection) + parameters: + - name: ue-id + in: query + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SubscriptionDataSubscriptions' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + delete: + summary: Deletes subscriptions identified by a given ue-id parameter + operationId: RemoveMultipleSubscriptionDataSubscriptions + tags: + - Subs To Notify (Collection) + parameters: + - name: ue-id + in: query + required: true + description: UE ID + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: nf-instance-id + in: query + required: false + description: NF Instance ID + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + - name: delete-all-nfs + in: query + required: false + description: Flag to delete subscriptions from all NFs + schema: + type: boolean + - name: implicit-unsubscribe-indication + in: query + required: false + description: Implicit Unsubscribe Indication + schema: + type: boolean + responses: + '204': + description: Expected response to a successful subscription removal + + /subscription-data/subs-to-notify/{subsId}: + delete: + summary: Deletes a subscriptionDataSubscriptions + operationId: RemovesubscriptionDataSubscriptions + tags: + - Subs To Notify (Document) + parameters: + - name: subsId + in: path + required: true + description: Unique ID of the subscription to remove + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + + patch: + summary: Modify an individual subscriptionDataSubscription + operationId: ModifysubscriptionDataSubscription + tags: + - Subs To Notify (Document) + parameters: + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '204': + description: Successful response + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + description: Unexpected error + + get: + summary: Retrieves a individual subscriptionDataSubscription identified by subsId + operationId: QuerySubscriptionDataSubscriptions + tags: + - Subs To Notify (Document) + parameters: + - name: subsId + in: path + required: true + description: Unique ID of the subscription to retrieve + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + items: + $ref: '#/components/schemas/SubscriptionDataSubscriptions' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/trace-data: + get: + summary: Retrieves the trace configuration data of a UE + operationId: QueryTraceData + tags: + - Trace Data (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /subscription-data/{ueId}/identity-data: + get: + summary: Retrieve identity data by SUPI or GPSI + operationId: GetIdentityData + tags: + - Query Identity Data by SUPI or GPSI (Document) + parameters: + - name: ueId + in: path + description: UE ID + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: app-port-id + in: query + description: Application port identifier + content: + application/json: + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/AppPortId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/IdentityData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/operator-determined-barring-data: + get: + summary: Retrieve ODB Data data by SUPI or GPSI + operationId: GetOdbData + tags: + - Query ODB Data by SUPI or GPSI (Document) + parameters: + - name: ueId + in: path + description: UE ID + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/OdbData' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/context-data: + get: + summary: Retrieve multiple context data sets of a UE + operationId: QueryContextData + tags: + - Context Data (Document) + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: context-dataset-names + in: query + description: List of context dataset names + style: form + explode: false + required: true + schema: + $ref: '#/components/schemas/ContextDatasetNames' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ContextDataSets' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/group-data/group-identifiers: + get: + summary: Mapping of Group Identifiers + operationId: GetGroupIdentifiers + tags: + - Group Identifiers + parameters: + - name: ext-group-id + in: query + description: External Group Identifier + required: false + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - name: int-group-id + in: query + description: Internal Group Identifier + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + - name: ue-id-ind + in: query + description: Indication whether UE identifiers are required or not + required: false + schema: + type: boolean + default: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/GroupIdentifiers' + + /subscription-data/group-data/5g-vn-groups: + get: + summary: Retrieves the data of a 5G VN Group + operationId: Query5GVnGroup + tags: + - 5G-VN-Groups (Store) + parameters: + - name: gpsis + in: query + description: List of GPSIs + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + style: form + explode: false + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: object + description: A map(list of key-value pairs) where ExtGroupId serves as key + additionalProperties: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/5GVnGroupConfiguration' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/group-data/5g-vn-groups/{externalGroupId}: + put: + summary: Create an individual 5G VN Grouop + operationId: Create5GVnGroup + tags: + - 5GVnGroupConfiguration (Document) + parameters: + - name: externalGroupId + in: path + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + requestBody: + content: + application/json: + schema: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/5GVnGroupConfiguration' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/5GVnGroupConfiguration' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + delete: + summary: Deletes the 5GVnGroup + operationId: Delete5GVnGroup + tags: + - Delete 5GVnGroup + parameters: + - name: externalGroupId + in: path + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + responses: + '204': + description: Expected response to a successful group removal + patch: + summary: modify the 5GVnGroup + operationId: Modify5GVnGroup + tags: + - Modify 5GVnGroup + parameters: + - name: externalGroupId + in: path + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + get: + summary: Retrieve a 5GVnGroup configuration + operationId: Get5GVnGroupConfiguration + tags: + - Query 5GVnGroupConfiguration (Document) + parameters: + - name: externalGroupId + in: path + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/5GVnGroupConfiguration' + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/lcs-privacy-data: + get: + summary: Retrieves the LCS Privacy subscription data of a UE + operationId: QueryLcsPrivacyData + tags: + - LCS Privacy Subscription Data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/LcsPrivacyData' + minItems: 1 + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/lcs-mo-data: + get: + summary: Retrieves the LCS Mobile Originated subscription data of a UE + operationId: QueryLcsMoData + tags: + - LCS Mobile Originated Subscription Data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/LcsMoData' + minItems: 1 + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + /subscription-data/{ueId}/nidd-authorization-data: + get: + summary: Retrieve NIDD Authorization Data GPSI or External Group identifier + operationId: GetNiddAuData + tags: + - Query NIDD Authorization Data GPSI or External Group identifier (Document) + parameters: + - name: ueId + in: path + description: UE ID + required: true + schema: + type: string + pattern: '^(msisdn-[0-9]{5,15}|.+|extid-[^@]+@[^@]+|extgroupid-[^@]+@[^@]+)$' + - name: single-nssai + in: query + content: + application/json: + schema: + $ref: '#/components/schemas/VarSnssai' + description: single NSSAI + required: true + - name: dnn + in: query + description: DNN + required: true + schema: + $ref: '#/components/schemas/Dnn' + - name: mtc-provider-information + in: query + description: MTC Provider Information + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AuthorizationData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/{ueId}/coverage-restriction-data: + get: + summary: Retrieves the subscribed enhanced Coverage Restriction Data of a UE + operationId: QueryCoverageRestrictionData + tags: + - Enhanced Coverage Restriction Data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/EnhancedCoverageRestrictionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + +components: + schemas: + AuthenticationSubscription: + type: object + required: + - authenticationMethod + properties: + authenticationMethod: + $ref: '#/components/schemas/AuthMethod' + encPermanentKey: + type: string + protectionParameterId: + type: string + sequenceNumber: + $ref: '#/components/schemas/SequenceNumber' + authenticationManagementField: + type: string + pattern: '^[A-Fa-f0-9]{4}$' + algorithmId: + type: string + encOpcKey: + type: string + encTopcKey: + type: string + vectorGenerationInHss: + type: boolean + default: false + SequenceNumber: + type: object + properties: + sqnScheme: + $ref: '#/components/schemas/SqnScheme' + sqn: + type: string + pattern: '^[A-Fa-f0-9]{12}$' + lastIndexes: + type: object + additionalProperties: + type: integer + minimum: 0 + indLength: + type: integer + minimum: 0 + difSign: + $ref: '#/components/schemas/Sign' + + SqnScheme: + anyOf: + - type: string + enum: + - GENERAL + - NON_TIME_BASED + - TIME_BASED + - type: string + Sign: + type: string + enum: + - POSITIVE + - NEGATIVE + VarPlmnId: + type: string + pattern: '^[0-9]{5,6}$' + DatasetNames: + type: array + items: + $ref: '#/components/schemas/DataSetName' + minItems: 1 + uniqueItems: true + DataSetName: + anyOf: + - type: string + enum: + - AM + - SMF_SEL + - SMS_SUB + - SM + - TRACE + - SMS_MNG + - LCS_PRIVACY + - LCS_MO + - type: string + ProvisionedDataSets: + type: object + properties: + amData: + $ref: '#/components/schemas/AccessAndMobilitySubscriptionData' + smfSelData: + $ref: '#/components/schemas/SmfSelectionSubscriptionData' + smsSubsData: + $ref: '#/components/schemas/SmsSubscriptionData' + smData: + type: array + items: + $ref: '#/components/schemas/SessionManagementSubscriptionData' + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + smsMngData: + $ref: '#/components/schemas/SmsManagementSubscriptionData' + lcsPrivacyData: + $ref: '#/components/schemas/LcsPrivacyData' + lcsMoData: + $ref: '#/components/schemas/LcsMoData' + AccessAndMobilitySubscriptionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/AccessAndMobilitySubscriptionData' + SmfSelectionSubscriptionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SmfSelectionSubscriptionData' + VarSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + Dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + SessionManagementSubscriptionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SessionManagementSubscriptionData' + Amf3GppAccessRegistration: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/Amf3GppAccessRegistration' + AmfNon3GppAccessRegistration: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/AmfNon3GppAccessRegistration' + SmfRegistration: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/SmfRegistration' + SmsfRegistration: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/SmsfRegistration' + SmsManagementSubscriptionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SmsManagementSubscriptionData' + SmsSubscriptionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SmsSubscriptionData' + LcsPrivacyData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/LcsPrivacyData' + LcsMoData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/LcsMoData' + AuthorizationData: + $ref: 'TS29503_Nudm_NIDDAU.yaml#/components/schemas/AuthorizationData' + EnhancedCoverageRestrictionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/EnhancedCoverageRestrictionData' + OperatorSpecificDataContainer: + type: object + required: + - dataType + - value + properties: + dataType: + type: string + enum: + - string + - integer + - number + - boolean + - object + dataTypeDefinition: + type: string + value: + oneOf: + - type: string + - type: integer + - type: number + - type: boolean + - type: object + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + AuthMethod: + anyOf: + - type: string + enum: + - 5G_AKA + - EAP_AKA_PRIME + - EAP_TLS + - type: string + PpData: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/PpData' + EeSubscription: + $ref: 'TS29503_Nudm_EE.yaml#/components/schemas/EeSubscription' + VarUeGroupId: + type: string + pattern: '^(extgroupid-[^@]+@[^@]+|anyUE)$' + SdmSubscription: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SdmSubscription' + SmfRegList: + type: array + items: + $ref: '#/components/schemas/SmfRegistration' + SubscriptionDataSubscriptions: + type: object + required: + - monitoredResourceUris + - callbackReference + properties: + ueId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + callbackReference: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + originalCallbackReference: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + monitoredResourceUris: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + sdmSubscription: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SdmSubscription' + subscriptionId: + type: string + + supported-features: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + DataChangeNotify: + type: object + properties: + originalCallbackReference: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + ueId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + notifyItems: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NotifyItem' + minItems: 1 + sdmSubscription: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SdmSubscription' + additionalSdmSubscriptions: + type: array + items: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SdmSubscription' + minItems: 1 + subscriptionDataSubscriptions: + type: array + items: + $ref: '#/components/schemas/SubscriptionDataSubscriptions' + + IdentityData: + type: object + properties: + supiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + gpsiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + SorData: + type: object + properties: + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ueUpdateStatus: + $ref: '#/components/schemas/UeUpdateStatus' + sorXmacIue: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SorMac' + sorMacIue: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SorMac' + required: + - provisioningTime + - ueUpdateStatus + + UpuData: + type: object + properties: + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ueUpdateStatus: + $ref: '#/components/schemas/UeUpdateStatus' + upuXmacIue: + $ref: 'TS29509_Nausf_UPUProtection.yaml#/components/schemas/UpuMac' + upuMacIue: + $ref: 'TS29509_Nausf_UPUProtection.yaml#/components/schemas/UpuMac' + required: + - provisioningTime + - ueUpdateStatus + + NssaiAckData: + type: object + properties: + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ueUpdateStatus: + $ref: '#/components/schemas/UeUpdateStatus' + required: + - provisioningTime + - ueUpdateStatus + + CagAckData: + type: object + properties: + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ueUpdateStatus: + $ref: '#/components/schemas/UeUpdateStatus' + required: + - provisioningTime + - ueUpdateStatus + + UeUpdateStatus: + type: string + enum: + - NOT_SENT + - SENT_NO_ACK_REQUIRED + - WAITING_FOR_ACK + - ACK_RECEIVED + + EeProfileData: + type: object + properties: + restrictedEventTypes: + type: array + items: + $ref: 'TS29503_Nudm_EE.yaml#/components/schemas/EventType' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + AmfSubscriptionInfo: + type: object + required: + - amfInstanceId + - subscriptionId + properties: + amfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + subscriptionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + subsChangeNotifyCorrelationId: + type: string + ContextDatasetNames: + type: array + items: + $ref: '#/components/schemas/ContextDataSetName' + minItems: 1 + uniqueItems: true + ContextDataSetName: + anyOf: + - type: string + enum: + - AMF_3GPP + - AMF_NON_3GPP + - SDM_SUBSCRIPTIONS + - EE_SUBSCRIPTIONS + - SMSF_3GPP + - SMSF_NON_3GPP + - SUBS_TO_NOTIFY + - SMF_REG + - type: string + ContextDataSets: + type: object + properties: + amf3Gpp: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + amfNon3Gpp: + $ref: '#/components/schemas/AmfNon3GppAccessRegistration' + sdmSubscriptions: + type: array + items: + $ref: '#/components/schemas/SdmSubscription' + minItems: 1 + eeSubscriptions: + type: array + items: + $ref: '#/components/schemas/EeSubscription' + minItems: 1 + smsf3GppAccess: + $ref: '#/components/schemas/SmsfRegistration' + smsfNon3GppAccess: + $ref: '#/components/schemas/SmsfRegistration' + subscriptionDataSubscriptions: + type: array + items: + $ref: '#/components/schemas/SubscriptionDataSubscriptions' + minItems: 1 + smfRegistrations: + $ref: '#/components/schemas/SmfRegList' diff --git a/lib/sbi/support/standard/TS29509_Nausf_SoRProtection.yaml b/lib/sbi/support/standard/TS29509_Nausf_SoRProtection.yaml new file mode 100644 index 0000000000..610ac69f48 --- /dev/null +++ b/lib/sbi/support/standard/TS29509_Nausf_SoRProtection.yaml @@ -0,0 +1,129 @@ +openapi: 3.0.0 +info: + version: 1.1.0.alpha-1 + title: Nausf_SoRProtection Service + description: | + AUSF SoR Protection Service. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.509 V16.3.0; 5G System; Authentication Server Services + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.509' + +servers: + - url: '{apiRoot}/nausf-sorprotection/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 +security: + - {} + - oAuth2ClientCredentials: + - nausf-sorprotection +paths: + /{supi}/ue-sor: + post: + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SorInfo' + required: true + responses: + '200': + description: SorSecurityInfo + content: + application/json: + schema: + $ref: '#/components/schemas/SorSecurityInfo' + '503': + description: Service Unavailable + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nausf-sorprotection: Access to the Nausf_SoRProtection API + schemas: + SorInfo: + type: object + properties: + steeringContainer: + $ref: '#/components/schemas/SteeringContainer' + ackInd: + $ref: '#/components/schemas/AckInd' + required: + - ackInd + SorSecurityInfo: + type: object + properties: + sorMacIausf: + $ref: '#/components/schemas/SorMac' + counterSor: + $ref: '#/components/schemas/CounterSor' + sorXmacIue: + $ref: '#/components/schemas/SorMac' + required: + - sorMacIausf + - counterSor + SteeringContainer: + oneOf: + - type: array + items: + $ref: '#/components/schemas/SteeringInfo' + minItems: 1 + - $ref: '#/components/schemas/SecuredPacket' + SteeringInfo: + type: object + properties: + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + accessTechList: + type: array + items: + $ref: '#/components/schemas/AccessTech' + minItems: 1 + required: + - plmnId + SorMac: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + CounterSor: + type: string + pattern: '^[A-Fa-f0-9]{4}$' + AckInd: + type: boolean + SecuredPacket: + type: string + format: base64 + AccessTech: + anyOf: + - type: string + enum: + - NR + - EUTRAN_IN_WBS1_MODE_AND_NBS1_MODE + - EUTRAN_IN_NBS1_MODE_ONLY + - EUTRAN_IN_WBS1_MODE_ONLY + - UTRAN + - GSM_AND_ECGSM_IoT + - GSM_WITHOUT_ECGSM_IoT + - ECGSM_IoT_ONLY + - CDMA_1xRTT + - CDMA_HRPD + - GSM_COMPACT + - type: string diff --git a/lib/sbi/support/3gpp-spec/TS29509_Nausf_UEAuthentication.yaml b/lib/sbi/support/standard/TS29509_Nausf_UEAuthentication.yaml similarity index 60% rename from lib/sbi/support/3gpp-spec/TS29509_Nausf_UEAuthentication.yaml rename to lib/sbi/support/standard/TS29509_Nausf_UEAuthentication.yaml index 98faf2e462..5ee4302189 100644 --- a/lib/sbi/support/3gpp-spec/TS29509_Nausf_UEAuthentication.yaml +++ b/lib/sbi/support/standard/TS29509_Nausf_UEAuthentication.yaml @@ -1,275 +1,405 @@ -openapi: 3.0.0 -info: - version: 1.1.0.alpha-1 - title: AUSF API - description: | - AUSF UE Authentication Service. - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. - -servers: - - url: '{apiRoot}/nausf-auth/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in subclause subclause 4.4 of 3GPP TS 29.501. - -security: - - {} - - oAuth2ClientCredentials: - - nausf-auth -paths: - /ue-authentications: - post: - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/AuthenticationInfo' - required: true - responses: - '201': - description: UEAuthenticationCtx - content: - application/3gppHal+json: - schema: - $ref: '#/components/schemas/UEAuthenticationCtx' - headers: - Location: - description: 'Contains the URI of the newly created resource according to the structure: {apiRoot}/nausf-auth/v1/ue-authentications/{authCtxId}' - required: true - schema: - type: string - - '400': - description: Bad Request from the AMF - content: - application/problem+json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - '403': - description: Forbidden due to serving network not authorized - content: - application/problem+json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - '500': - description: Internal Server Error - content: - application/problem+json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - /ue-authentications/{authCtxId}/5g-aka-confirmation: - put: - parameters: - - name: authCtxId - in: path - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ConfirmationData' - responses: - '200': - description: Request processed (EAP success or Failure) - content: - application/json: - schema: - $ref: '#/components/schemas/ConfirmationDataResponse' - - '400': - description: Bad Request - content: - application/problem+json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - '500': - description: Internal Server Error - content: - application/problem+json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - /ue-authentications/{authCtxId}/eap-session: - post: - operationId: EapAuthMethod - parameters: - - name: authCtxId - in: path - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EapSession' - responses: - '200': - description: Use to handle or close the EAP session - content: - application/json: - schema: - $ref: '#/components/schemas/EapSession' - - application/3gppHal+json: - schema: - type: object - properties: - eapPayload: - $ref: '#/components/schemas/EapPayload' - _links: - type: object - description: 'URI : /{eapSessionUri}' - additionalProperties: - $ref: 'TS29571_CommonData.yaml#/components/schemas/LinksValueSchema' - minProperties: 1 - required: - - eapPayload - - _links - '400': - description: Bad Request - content: - application/problem+json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - '500': - description: Internal Server Error - content: - application/problem+json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' -components: - securitySchemes: - oAuth2ClientCredentials: - type: oauth2 - flows: - clientCredentials: - tokenUrl: '{nrfApiRoot}/oauth2/token' - scopes: - nausf-auth: Access to Nausf_UEAuthentication API - schemas: - AuthenticationInfo: - type: object - properties: - supiOrSuci: - $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/SupiOrSuci' - servingNetworkName: - $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/ServingNetworkName' - resynchronizationInfo: - $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/ResynchronizationInfo' - pei: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' - traceData: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' - udmGroupId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' - routingIndicator: - type: string - pattern: '^[0-9]{1,4}$' - required: - - supiOrSuci - - servingNetworkName - UEAuthenticationCtx: - type: object - properties: - authType: - $ref: '#/components/schemas/AuthType' - 5gAuthData: - oneOf: - - $ref: '#/components/schemas/Av5gAka' - - $ref: '#/components/schemas/EapPayload' - _links: - type: object - additionalProperties: - $ref: 'TS29571_CommonData.yaml#/components/schemas/LinksValueSchema' - servingNetworkName: - $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/ServingNetworkName' - required: - - authType - - 5gAuthData - - _links - - Av5gAka: - type: object - required: - - rand - - hxresStar - - autn - properties: - rand: - $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/Rand' - hxresStar: - $ref: '#/components/schemas/HxresStar' - autn: - $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/Autn' - ConfirmationData: - type: object - required: - - resStar - properties: - resStar: - $ref: '#/components/schemas/ResStar' - ConfirmationDataResponse: - type: object - properties: - authResult: - $ref: '#/components/schemas/AuthResult' - supi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - kseaf: - $ref: '#/components/schemas/Kseaf' - - required: - - authResult - EapSession: - type: object - properties: - eapPayload: - $ref: '#/components/schemas/EapPayload' - kSeaf: - $ref: '#/components/schemas/Kseaf' - _links: - type: object - additionalProperties: - $ref: 'TS29571_CommonData.yaml#/components/schemas/LinksValueSchema' - authResult: - $ref: '#/components/schemas/AuthResult' - supi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - required: - - eapPayload - - AuthResult: - type: string - enum: - - AUTHENTICATION_SUCCESS - - AUTHENTICATION_FAILURE - - AUTHENTICATION_ONGOING - EapPayload: - type: string - format: base64 - description: contains an EAP packet - Kseaf: - type: string - pattern: '[A-Fa-f0-9]{64}' - ResStar: - type: string - pattern: '[A-Fa-f0-9]{32}' - nullable: true - HxresStar: - type: string - pattern: "[A-Fa-f0-9]{32}" - AuthType: - anyOf: - - type: string - enum: - - 5G_AKA - - EAP_AKA_PRIME - - EAP_TLS - - type: string -externalDocs: - description: 3GPP TS 29.509 V15.3.0; 5G System; 3GPP TS Authentication Server services. - url: http://www.3gpp.org/ftp/Specs/archive/29_series/29.509 +openapi: 3.0.0 +info: + version: 1.1.0.alpha-4 + title: AUSF API + description: | + AUSF UE Authentication Service. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.509 V16.3.0; 5G System; 3GPP TS Authentication Server services. + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.509' + +servers: + - url: '{apiRoot}/nausf-auth/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause clause 4.4 of 3GPP TS 29.501. + +security: + - {} + - oAuth2ClientCredentials: + - nausf-auth +paths: + /ue-authentications: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticationInfo' + required: true + responses: + '201': + description: UEAuthenticationCtx + content: + application/3gppHal+json: + schema: + $ref: '#/components/schemas/UEAuthenticationCtx' + headers: + Location: + description: 'Contains the URI of the newly created resource according to the structure: {apiRoot}/nausf-auth/v1/ue-authentications/{authCtxId}' + required: true + schema: + type: string + + '400': + description: Bad Request from the AMF + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '403': + description: Forbidden due to serving network not authorized + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '404': + description: User does not exist in the HPLMN + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + description: Internal Server Error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '501': + description: Received protection scheme is not supported by HPLMN + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + /ue-authentications/{authCtxId}/5g-aka-confirmation: + put: + parameters: + - name: authCtxId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ConfirmationData' + responses: + '200': + description: Request processed (EAP success or Failure) + content: + application/json: + schema: + $ref: '#/components/schemas/ConfirmationDataResponse' + + '400': + description: Bad Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + description: Internal Server Error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + delete: + summary: Deletes the authentication result in the UDM + operationId: Delete5gAkaAuthenticationResult + tags: + - Authentication Result Deletion + parameters: + - name: authCtxId + in: path + required: true + schema: + type: string + responses: + '204': + description: Expected response to a successful authentication result removal + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /ue-authentications/{authCtxId}/eap-session: + post: + operationId: EapAuthMethod + parameters: + - name: authCtxId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EapSession' + responses: + '200': + description: Use to handle or close the EAP session + content: + application/json: + schema: + $ref: '#/components/schemas/EapSession' + + application/3gppHal+json: + schema: + type: object + properties: + eapPayload: + $ref: '#/components/schemas/EapPayload' + _links: + type: object + description: 'URI : /{eapSessionUri}' + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LinksValueSchema' + minProperties: 1 + required: + - eapPayload + - _links + '400': + description: Bad Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + description: Internal Server Error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + delete: + summary: Deletes the authentication result in the UDM + operationId: DeleteEapAuthenticationResult + tags: + - Authentication Result Deletion + parameters: + - name: authCtxId + in: path + required: true + schema: + type: string + responses: + '204': + description: Expected response to a successful authentication result removal + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /rg-authentications: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RgAuthenticationInfo' + required: true + responses: + '201': + description: RgAuthCtx + content: + application/json: + schema: + $ref: '#/components/schemas/RgAuthCtx' + headers: + Location: + description: 'Contains the URI of the newly created resource according to the structure: {apiRoot}/nausf-auth/v1/rg-authentications/{authCtxId}' + required: true + schema: + type: string + '403': + description: The UE is not allowed to be authenticated + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '400': + description: Bad Request from the AMF + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '404': + description: User does not exist in the HPLMN + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nausf-auth: Access to Nausf_UEAuthentication API + schemas: + AuthenticationInfo: + type: object + properties: + supiOrSuci: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupiOrSuci' + servingNetworkName: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/ServingNetworkName' + resynchronizationInfo: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/ResynchronizationInfo' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + udmGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + routingIndicator: + type: string + pattern: '^[0-9]{1,4}$' + cagId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CagId' + required: + - supiOrSuci + - servingNetworkName + UEAuthenticationCtx: + type: object + properties: + authType: + $ref: '#/components/schemas/AuthType' + 5gAuthData: + oneOf: + - $ref: '#/components/schemas/Av5gAka' + - $ref: '#/components/schemas/EapPayload' + _links: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LinksValueSchema' + servingNetworkName: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/ServingNetworkName' + required: + - authType + - 5gAuthData + - _links + + Av5gAka: + type: object + required: + - rand + - hxresStar + - autn + properties: + rand: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/Rand' + hxresStar: + $ref: '#/components/schemas/HxresStar' + autn: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/Autn' + ConfirmationData: + type: object + required: + - resStar + properties: + resStar: + $ref: '#/components/schemas/ResStar' + ConfirmationDataResponse: + type: object + properties: + authResult: + $ref: '#/components/schemas/AuthResult' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + kseaf: + $ref: '#/components/schemas/Kseaf' + + required: + - authResult + EapSession: + type: object + properties: + eapPayload: + $ref: '#/components/schemas/EapPayload' + kSeaf: + $ref: '#/components/schemas/Kseaf' + _links: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LinksValueSchema' + authResult: + $ref: '#/components/schemas/AuthResult' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + required: + - eapPayload + RgAuthenticationInfo: + type: object + properties: + suci: + $ref: '#/components/schemas/Suci' + authenticatedInd: + type: boolean + default: false + required: + - suci + - authenticatedInd + RgAuthCtx: + type: object + properties: + authResult: + $ref: '#/components/schemas/AuthResult' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + authInd: + type: boolean + default: false + required: + - authResult + + AuthResult: + type: string + enum: + - AUTHENTICATION_SUCCESS + - AUTHENTICATION_FAILURE + - AUTHENTICATION_ONGOING + EapPayload: + type: string + format: base64 + description: contains an EAP packet + nullable: true + Kseaf: + type: string + pattern: '[A-Fa-f0-9]{64}' + ResStar: + type: string + pattern: '[A-Fa-f0-9]{32}' + nullable: true + HxresStar: + type: string + pattern: "[A-Fa-f0-9]{32}" + Suci: + type: string + pattern: '^(suci-(0-[0-9]{3}-[0-9]{2,3}|[1-7]-.+)-[0-9]{1,4}-(0-0-.+|[a-fA-F1-9]-([1-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])-[a-fA-F0-9]+)|.+)$' + AuthType: + anyOf: + - type: string + enum: + - 5G_AKA + - EAP_AKA_PRIME + - EAP_TLS + - type: string diff --git a/lib/sbi/support/standard/TS29509_Nausf_UPUProtection.yaml b/lib/sbi/support/standard/TS29509_Nausf_UPUProtection.yaml new file mode 100644 index 0000000000..bea844eec0 --- /dev/null +++ b/lib/sbi/support/standard/TS29509_Nausf_UPUProtection.yaml @@ -0,0 +1,111 @@ +openapi: 3.0.0 +info: + version: 1.1.0.alpha-2 + title: Nausf_UPUProtection Service + description: | + AUSF UPU Protection Service + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.509 V16.3.0; 5G System; Authentication Server Services + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.509' + +servers: + - url: '{apiRoot}/nausf-upuprotection/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 +security: + - {} + - oAuth2ClientCredentials: + - nausf-upuprotection +paths: + /{supi}/ue-upu: + post: + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpuInfo' + required: true + responses: + '200': + description: UpuSecurityInfo + content: + application/json: + schema: + $ref: '#/components/schemas/UpuSecurityInfo' + '503': + description: Service Unavailable + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nausf-upuprotection: Access to the Nausf_UPUProtection API + schemas: + UpuInfo: + type: object + properties: + upuDataList: + type: array + items: + $ref: '#/components/schemas/UpuData' + minItems: 1 + upuAckInd: + $ref: '#/components/schemas/UpuAckInd' + required: + - upuDataList + - upuAckInd + UpuSecurityInfo: + type: object + properties: + upuMacIausf: + $ref: '#/components/schemas/UpuMac' + counterUpu: + $ref: '#/components/schemas/CounterUpu' + upuXmacIue: + $ref: '#/components/schemas/UpuMac' + required: + - upuMacIausf + - counterUpu + UpuData: + type: object + properties: + secPacket: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SecuredPacket' + defaultConfNssai: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + routingId: + $ref: 'TS29544_Nspaf_SecuredPacket.yaml#/components/schemas/RoutingId' + oneOf: + - required: [secPacket] + - required: [defaultConfNssai] + UpuMac: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + CounterUpu: + type: string + pattern: '^[A-Fa-f0-9]{4}$' + UpuAckInd: + type: boolean diff --git a/lib/sbi/support/3gpp-spec/TS29510_Nnrf_AccessToken.yaml b/lib/sbi/support/standard/TS29510_Nnrf_AccessToken.yaml similarity index 74% rename from lib/sbi/support/3gpp-spec/TS29510_Nnrf_AccessToken.yaml rename to lib/sbi/support/standard/TS29510_Nnrf_AccessToken.yaml index ef9561a101..b9c80d6289 100644 --- a/lib/sbi/support/3gpp-spec/TS29510_Nnrf_AccessToken.yaml +++ b/lib/sbi/support/standard/TS29510_Nnrf_AccessToken.yaml @@ -1,11 +1,17 @@ openapi: 3.0.0 + info: - version: '1.0.2' + version: '1.1.0.alpha-3' title: 'NRF OAuth2' description: | NRF OAuth2 Authorization. - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. + +externalDocs: + description: 3GPP TS 29.510 V16.3.0; 5G System; Network Function Repository Services; Stage 3 + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.510/' + paths: /oauth2/token: post: @@ -13,6 +19,17 @@ paths: operationId: AccessTokenRequest tags: - Access Token Request + parameters: + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string requestBody: content: application/x-www-form-urlencoded: @@ -31,6 +48,14 @@ paths: $ref: '#/components/headers/cache-control' Pragma: $ref: '#/components/headers/pragma' + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string '307': description: Temporary Redirect '400': @@ -82,6 +107,7 @@ components: - no-cache schemas: AccessTokenReq: + description: Contains information related to the access token request type: object required: - grant_type @@ -107,7 +133,20 @@ components: $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' targetPlmn: $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + targetSnssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + targetNsiList: + type: array + items: + type: string + minItems: 1 + targetNfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' AccessTokenRsp: + description: Contains information related to the access token response type: object required: - access_token @@ -126,6 +165,7 @@ components: type: string pattern: '^([a-zA-Z0-9_-]+)( [a-zA-Z0-9_-]+)*$' AccessTokenClaims: + description: The claims data structure for the access token type: object required: - iss @@ -154,7 +194,20 @@ components: $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' producerPlmnId: $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + producerSnssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + producerNsiList: + type: array + items: + type: string + minItems: 1 + producerNfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' AccessTokenErr: + description: Error returned in the access token response message type: object required: - error @@ -172,6 +225,3 @@ components: type: string error_uri: type: string -externalDocs: - description: 3GPP TS 29.510 V15.3.0; 5G System; Network Function Repository Services; Stage 3 - url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.510/' diff --git a/lib/sbi/support/standard/TS29510_Nnrf_Bootstrapping.yaml b/lib/sbi/support/standard/TS29510_Nnrf_Bootstrapping.yaml new file mode 100644 index 0000000000..f072f142f5 --- /dev/null +++ b/lib/sbi/support/standard/TS29510_Nnrf_Bootstrapping.yaml @@ -0,0 +1,59 @@ +openapi: 3.0.0 + +info: + version: '1.0.0.alpha-2' + title: 'NRF Bootstrapping' + description: | + NRF Bootstrapping. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.510 V16.3.0; 5G System; Network Function Repository Services; Stage 3 + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.510/' + +paths: + /bootstrapping: + get: + summary: Bootstrapping Info Request + operationId: BootstrappingInfoRequest + tags: + - Bootstrapping Request + responses: + '200': + description: Successful Bootstrapping Request + content: + application/3gppHal+json: + schema: + $ref: '#/components/schemas/BootstrappingInfo' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + schemas: + BootstrappingInfo: + description: Information returned by NRF in the bootstrapping response message + type: object + required: + - _links + properties: + status: + $ref: '#/components/schemas/Status' + _links: + type: object + description: 'Map of link objects where the keys are the link relations defined in 3GPP TS 29.510 clause 6.4.6.3.3' + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LinksValueSchema' + minProperties: 1 + Status: + description: Overal status of the NRF + anyOf: + - type: string + enum: + - OPERATIVE + - NON_OPERATIVE + - type: string diff --git a/lib/sbi/support/3gpp-spec/TS29510_Nnrf_NFDiscovery.yaml b/lib/sbi/support/standard/TS29510_Nnrf_NFDiscovery.yaml similarity index 69% rename from lib/sbi/support/3gpp-spec/TS29510_Nnrf_NFDiscovery.yaml rename to lib/sbi/support/standard/TS29510_Nnrf_NFDiscovery.yaml index 377e9fbe72..d4b28785c9 100644 --- a/lib/sbi/support/3gpp-spec/TS29510_Nnrf_NFDiscovery.yaml +++ b/lib/sbi/support/standard/TS29510_Nnrf_NFDiscovery.yaml @@ -1,21 +1,29 @@ openapi: 3.0.0 + info: - version: '1.1.0.alpha-1' + version: '1.1.0.alpha-4' title: 'NRF NFDiscovery Service' description: | NRF NFDiscovery Service. - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. + +externalDocs: + description: 3GPP TS 29.510 V16.3.0; 5G System; Network Function Repository Services; Stage 3 + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.510/' + servers: - url: '{apiRoot}/nnrf-disc/v1' variables: apiRoot: default: https://example.com - description: apiRoot as defined in subclause 4.4 of 3GPP TS 29.501 + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + security: - {} - oAuth2ClientCredentials: - nnrf-disc + paths: /nf-instances: get: @@ -24,6 +32,11 @@ paths: tags: - NF Instances (Store) parameters: + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string - name: target-nf-type in: query description: Type of the target NF @@ -204,7 +217,19 @@ paths: in: query description: external group identifier of the user schema: - type: string + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - name: internal-group-identity + in: query + description: internal group identifier of the user + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + - name: pfd-data + in: query + description: PFD data + content: + application/json: + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/PfdData' - name: data-set in: query description: data set supported by the NF @@ -337,11 +362,151 @@ paths: description: UPF supporting allocating UE IP addresses/prefixes schema: type: boolean + - name: client-type + in: query + description: Requested client type served by the NF + content: + application/json: + schema: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/ExternalClientType' + - name: lmf-id + in: query + description: LMF identification to be discovered + content: + application/json: + schema: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LMFIdentification' + - name: an-node-type + in: query + description: Requested AN node type served by the NF + content: + application/json: + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/AnNodeType' + - name: rat-type + in: query + description: Requested RAT type served by the NF + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + - name: preferred-tai + in: query + description: preferred Tracking Area Identity + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + - name: preferred-nf-instances + in: query + description: preferred NF Instances + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + minItems: 1 + style: form + explode: false - name: If-None-Match in: header - description: Validator for conditional requests, as described in IETF RFC 7232, 3.2 + description: Validator for conditional requests, as described in IETF RFC 7232, 3.2 schema: type: string + - name: target-snpn + in: query + description: Target SNPN Identity + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + - name: af-ee-data + in: query + description: NEF exposured by the AF + content: + application/json: + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/AfEventExposureData' + - name: w-agf-info + in: query + description: UPF collocated with W-AGF + content: + application/json: + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/WAgfInfo' + - name: tngf-info + in: query + description: UPF collocated with TNGF + content: + application/json: + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/TngfInfo' + - name: twif-info + in: query + description: UPF collocated with TWIF + content: + application/json: + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/TwifInfo' + - name: target-nf-set-id + in: query + description: Target NF Set ID + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + - name: target-nf-service-set-id + in: query + description: Target NF Service Set ID + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + - name: nef-id + in: query + description: NEF ID + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NefId' + - name: notification-type + in: query + description: Notification Type + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NotificationType' + - name: serving-scope + in: query + description: areas that can be served by the target NF + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: imsi + in: query + description: IMSI of the requester UE to search for an appropriate NF (e.g. HSS) + schema: + type: string + - name: preferred-api-versions + in: query + description: Preferred API version of the services to be discovered + content: + application/json: + schema: + type: object + additionalProperties: + type: string + minProperties: 1 + - name: v2x-support-ind + in: query + description: PCF supports V2X + schema: + type: boolean + - name: redundant-gtpu + in: query + description: UPF supports redundant gtp-u to be discovered + schema: + type: boolean + - name: redundant-transport + in: query + description: UPF supports redundant transport path to be discovered + schema: + type: boolean responses: '200': description: Expected response to a valid request @@ -355,14 +520,14 @@ paths: parameters: searchId: $response.body#/searchId description: > - The 'searchId' parameter returned in the response can be used as the + The 'searchId' parameter returned in the response can be used as the 'searchId' parameter in the GET request to '/searches/{searchId}' completeSearch: operationId: RetrieveCompleteSearch parameters: searchId: $response.body#/searchId description: > - The 'searchId' parameter returned in the response can be used as the + The 'searchId' parameter returned in the response can be used as the 'searchId' parameter in the GET request to '/searches/{searchId}/complete' headers: Cache-Control: @@ -370,7 +535,11 @@ paths: schema: type: string ETag: - description: Entity Tag containing a strong validator, described in IETF RFC 7232, 2.3 + description: Entity Tag containing a strong validator, described in IETF RFC 7232, 2.3 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 schema: type: string '307': @@ -415,6 +584,11 @@ paths: - Stored Search (Document) parameters: - $ref: '#/components/parameters/searchId' + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string responses: '200': $ref: '#/components/responses/200' @@ -426,6 +600,11 @@ paths: - Complete Stored Search (Document) parameters: - $ref: '#/components/parameters/searchId' + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string responses: '200': $ref: '#/components/responses/200' @@ -434,8 +613,8 @@ components: securitySchemes: oAuth2ClientCredentials: type: oauth2 - flows: - clientCredentials: + flows: + clientCredentials: tokenUrl: '/oauth2/token' scopes: nnrf-disc: Access to the Nnrf_NFDiscovery API @@ -460,11 +639,16 @@ components: schema: type: string ETag: - description: Entity Tag containing a strong validator, described in IETF RFC 7232, 2.3 + description: Entity Tag containing a strong validator, described in IETF RFC 7232, 2.3 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 schema: type: string schemas: SearchResult: + description: Contains the list of NF Profiles returned in a Discovery response type: object required: - nfInstances @@ -479,9 +663,12 @@ components: type: string numNfInstComplete: $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + preferredSearch: + $ref: '#/components/schemas/PreferredSearch' nrfSupportedFeatures: $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' StoredSearchResult: + description: Contains a complete search result (i.e. a number of discovered NF Instances), stored by NRF as a consequence of a prior search result type: object required: - nfInstances @@ -491,6 +678,7 @@ components: items: $ref: '#/components/schemas/NFProfile' NFProfile: + description: Information of an NF Instance discovered by the NRF type: object required: - nfInstanceId @@ -545,6 +733,8 @@ components: type: integer minimum: 0 maximum: 100 + loadTimeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' locality: type: string priority: @@ -614,8 +804,27 @@ components: items: $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ChfInfo' minItems: 1 + udsfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/UdsfInfo' + udsfInfoExt: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/UdsfInfo' + minItems: 1 nwdafInfo: $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NwdafInfo' + nefInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NefInfo' + pcscfInfo: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/PcscfInfo' + minItems: 1 + hssInfo: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/HssInfo' + minItems: 1 customInfo: type: object recoveryTime: @@ -632,7 +841,33 @@ components: type: array items: $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/DefaultNotificationSubscription' + lmfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/LmfInfo' + gmlcInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/GmlcInfo' + snpnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + minItems: 1 + nfSetIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + minItems: 1 + servingScope: + type: array + items: + type: string + minItems: 1 + lcHSupportInd: + type: boolean + default: false + olcHSupportInd: + type: boolean + default: false NFService: + description: Information of a given NF Service Instance; it is part of the NFProfile of an NF Instance discovered by the NRF type: object required: - serviceInstanceId @@ -676,6 +911,8 @@ components: type: integer minimum: 0 maximum: 100 + loadTimeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' priority: type: integer minimum: 0 @@ -686,6 +923,36 @@ components: $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ChfServiceInfo' supportedFeatures: $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' -externalDocs: - description: 3GPP TS 29.510 V15.3.0; 5G System; Network Function Repository Services; Stage 3 - url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.510/' + nfServiceSetIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + minItems: 1 + sNssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + perPlmnSnssaiList: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/PlmnSnssai' + minItems: 1 + vendorId: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/VendorId' + supportedVendorSpecificFeatures: + type: object + additionalProperties: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/VendorSpecificFeature' + minProperties: 1 + oauth2Required: + type: boolean + PreferredSearch: + description: Contains information on whether the returned NFProfiles match the preferred query parameters + type: object + properties: + preferredTaiMatchInd: + type: boolean + default: false diff --git a/lib/sbi/support/3gpp-spec/TS29510_Nnrf_NFManagement.yaml b/lib/sbi/support/standard/TS29510_Nnrf_NFManagement.yaml similarity index 70% rename from lib/sbi/support/3gpp-spec/TS29510_Nnrf_NFManagement.yaml rename to lib/sbi/support/standard/TS29510_Nnrf_NFManagement.yaml index 7a6c3c1ea9..ec5be3f281 100644 --- a/lib/sbi/support/3gpp-spec/TS29510_Nnrf_NFManagement.yaml +++ b/lib/sbi/support/standard/TS29510_Nnrf_NFManagement.yaml @@ -1,21 +1,29 @@ openapi: 3.0.0 + info: - version: '1.1.0.alpha-1' + version: '1.1.0.alpha-4' title: 'NRF NFManagement Service' description: | NRF NFManagement Service. - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. + +externalDocs: + description: 3GPP TS 29.510 V16.3.0; 5G System; Network Function Repository Services; Stage 3 + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.510/' + servers: - url: '{apiRoot}/nnrf-nfm/v1' variables: apiRoot: default: https://example.com - description: apiRoot as defined in subclause 4.4 of 3GPP TS 29.501 + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + security: - {} - oAuth2ClientCredentials: - nnrf-nfm + paths: /nf-instances: get: @@ -169,7 +177,12 @@ paths: $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - name: Content-Encoding in: header - description: Content-Encoding, described in IETF RFC 7231 + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 schema: type: string requestBody: @@ -190,6 +203,10 @@ paths: description: Accept-Encoding, described in IETF RFC 7694 schema: type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string '201': description: Expected response to a valid request content: @@ -206,6 +223,10 @@ paths: description: Accept-Encoding, described in IETF RFC 7694 schema: type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string '400': $ref: 'TS29571_CommonData.yaml#/components/responses/400' '401': @@ -242,6 +263,16 @@ paths: description: Unique ID of the NF Instance to update schema: $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string requestBody: content: application/json-patch+json: @@ -258,8 +289,22 @@ paths: application/json: schema: $ref: '#/components/schemas/NFProfile' + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string '204': description: Expected response with empty body + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string '400': $ref: 'TS29571_CommonData.yaml#/components/responses/400' '403': @@ -323,6 +368,17 @@ paths: operationId: CreateSubscription tags: - Subscriptions (Collection) + parameters: + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string requestBody: content: application/json: @@ -342,6 +398,14 @@ paths: required: true schema: type: string + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string '400': $ref: 'TS29571_CommonData.yaml#/components/responses/400' '401': @@ -370,6 +434,12 @@ paths: onNFStatusEvent: '{$request.body#/nfStatusNotificationUri}': post: + parameters: + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string requestBody: description: Notification Payload content: @@ -379,6 +449,11 @@ paths: responses: '204': description: Expected response to a successful callback processing + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string '400': $ref: 'TS29571_CommonData.yaml#/components/responses/400' '401': @@ -417,6 +492,16 @@ paths: schema: type: string pattern: '^([0-9]{5,6}-)?[^-]+$' + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string requestBody: content: application/json-patch+json: @@ -432,8 +517,22 @@ paths: application/json: schema: $ref: '#/components/schemas/SubscriptionData' + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string '204': description: No Content + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string '400': $ref: 'TS29571_CommonData.yaml#/components/responses/400' '403': @@ -500,13 +599,14 @@ components: securitySchemes: oAuth2ClientCredentials: type: oauth2 - flows: - clientCredentials: + flows: + clientCredentials: tokenUrl: '/oauth2/token' scopes: nnrf-nfm: Access to the Nnrf_NFManagement API schemas: NFProfile: + description: Information of an NF Instance registered in the NRF type: object required: - nfInstanceId @@ -532,6 +632,11 @@ components: items: $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' minItems: 1 + snpnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + minItems: 1 sNssais: type: array items: @@ -566,6 +671,11 @@ components: items: $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' minItems: 1 + allowedSnpns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + minItems: 1 allowedNfTypes: type: array items: @@ -593,6 +703,8 @@ components: type: integer minimum: 0 maximum: 100 + loadTimeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' locality: type: string udrInfo: @@ -658,10 +770,29 @@ components: items: $ref: '#/components/schemas/ChfInfo' minItems: 1 + nefInfo: + $ref: '#/components/schemas/NefInfo' nrfInfo: $ref: '#/components/schemas/NrfInfo' + udsfInfo: + $ref: '#/components/schemas/UdsfInfo' + udsfInfoExt: + type: array + items: + $ref: '#/components/schemas/UdsfInfo' + minItems: 1 nwdafInfo: $ref: '#/components/schemas/NwdafInfo' + pcscfInfo: + type: array + items: + $ref: '#/components/schemas/PcscfInfo' + minItems: 1 + hssInfo: + type: array + items: + $ref: '#/components/schemas/HssInfo' + minItems: 1 customInfo: type: object recoveryTime: @@ -686,7 +817,28 @@ components: type: array items: $ref: '#/components/schemas/DefaultNotificationSubscription' + lmfInfo: + $ref: '#/components/schemas/LmfInfo' + gmlcInfo: + $ref: '#/components/schemas/GmlcInfo' + nfSetIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + minItems: 1 + servingScope: + type: array + items: + type: string + minItems: 1 + lcHSupportInd: + type: boolean + default: false + olcHSupportInd: + type: boolean + default: false NFService: + description: Information of a given NF Service Instance; it is part of the NFProfile of an NF Instance type: object required: - serviceInstanceId @@ -729,6 +881,11 @@ components: items: $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' minItems: 1 + allowedSnpns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + minItems: 1 allowedNfTypes: type: array items: @@ -756,13 +913,42 @@ components: type: integer minimum: 0 maximum: 100 + loadTimeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' recoveryTime: $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' chfServiceInfo: $ref: '#/components/schemas/ChfServiceInfo' supportedFeatures: $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + nfServiceSetIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + minItems: 1 + sNssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + perPlmnSnssaiList: + type: array + items: + $ref: '#/components/schemas/PlmnSnssai' + minItems: 1 + vendorId: + $ref: '#/components/schemas/VendorId' + supportedVendorSpecificFeatures: + type: object + additionalProperties: + type: array + items: + $ref: '#/components/schemas/VendorSpecificFeature' + minProperties: 1 + oauth2Required: + type: boolean NFType: + description: NF types known to NRF anyOf: - type: string enum: @@ -787,10 +973,25 @@ components: - BSF - CHF - NWDAF + - PCSCF + - CBCF + - HSS + - UCMF + - SOR_AF + - SPAF + - MME + - SCSAS + - SCEF + - SCP - type: string Fqdn: + description: Fully Qualified Domain Name + type: string + NefId: + description: Identity of the NEF type: string IpEndPoint: + description: IP addressing information of a given NFService; it consists on, e.g. IP address, TCP port, transport protocol... type: object properties: ipv4Address: @@ -800,10 +1001,11 @@ components: transport: $ref: '#/components/schemas/TransportProtocol' port: - type: integer + type: integer minimum: 0 maximum: 65535 SubscriptionData: + description: Information of a subscription to notifications to NRF events, included in subscription requests and responses type: object required: - nfStatusNotificationUri @@ -822,6 +1024,9 @@ components: - $ref: '#/components/schemas/GuamiListCond' - $ref: '#/components/schemas/NetworkSliceCond' - $ref: '#/components/schemas/NfGroupCond' + - $ref: '#/components/schemas/NfSetCond' + - $ref: '#/components/schemas/NfServiceSetCond' + - $ref: '#/components/schemas/UpfCond' subscriptionId: type: string pattern: '^([0-9]{5,6}-)?[^-]+$' @@ -835,6 +1040,8 @@ components: minItems: 1 plmnId: $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + nid: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Nid' notifCondition: $ref: '#/components/schemas/NotifCondition' reqNfType: @@ -846,7 +1053,13 @@ components: items: $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' minItems: 1 + reqPlmnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 NfInstanceIdCond: + description: Subscription to a given NF Instance Id type: object required: - nfInstanceId @@ -854,6 +1067,7 @@ components: nfInstanceId: $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' NfTypeCond: + description: Subscription to a set of NFs based on their NF Type type: object required: - nfType @@ -863,6 +1077,7 @@ components: nfType: $ref: '#/components/schemas/NFType' ServiceNameCond: + description: Subscription to a set of NFs based on their support for a given Service Name type: object required: - serviceName @@ -870,6 +1085,7 @@ components: serviceName: $ref: '#/components/schemas/ServiceName' AmfCond: + description: Subscription to a set of AMFs, based on AMF Set Id and/or AMF Region Id type: object anyOf: - required: [ amfSetId ] @@ -880,6 +1096,7 @@ components: amfRegionId: $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfRegionId' GuamiListCond: + description: Subscription to a set of AMFs, based on their GUAMIs type: object required: - guamiList @@ -889,6 +1106,7 @@ components: items: $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' NetworkSliceCond: + description: Subscription to a set of NFs, based on the slices (S-NSSAI and NSI) they support type: object required: - snssaiList @@ -902,6 +1120,7 @@ components: items: type: string NfGroupCond: + description: Subscription to a set of NFs based on their Group Id type: object required: - nfType @@ -914,9 +1133,11 @@ components: - AUSF - UDR - PCF + - CHF nfGroupId: $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' NotifCondition: + description: Condition (list of attributes in the NF Profile) to determine whether a notification must be sent by NRF type: object not: required: [ monitoredAttributes, unmonitoredAttributes ] @@ -932,6 +1153,7 @@ components: type: string minItems: 1 UdrInfo: + description: Information of an UDR NF Instance type: object properties: groupId: @@ -957,6 +1179,7 @@ components: $ref: '#/components/schemas/DataSetId' minItems: 1 SupiRange: + description: A range of SUPIs (subscriber identities), either based on a numeric range, or based on regular-expression matching type: object properties: start: @@ -968,6 +1191,7 @@ components: pattern: type: string IdentityRange: + description: A range of GPSIs (subscriber identities), either based on a numeric range, or based on regular-expression matching type: object properties: start: @@ -978,7 +1202,18 @@ components: pattern: '^[0-9]+$' pattern: type: string + InternalGroupIdRange: + description: A range of Group IDs (internal group identities), either based on a numeric range, or based on regular-expression matching + type: object + properties: + start: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + end: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + pattern: + type: string DataSetId: + description: Types of data sets stored in UDR anyOf: - type: string enum: @@ -986,8 +1221,9 @@ components: - POLICY - EXPOSURE - APPLICATION - - type: string + - type: string UdmInfo: + description: Information of an UDM NF Instance type: object properties: groupId: @@ -1013,7 +1249,13 @@ components: type: string pattern: '^[0-9]{1,4}$' minItems: 1 + internalGroupIdentifiersRanges: + type: array + items: + $ref: '#/components/schemas/InternalGroupIdRange' + minItems: 1 AusfInfo: + description: Information of an AUSF NF Instance type: object properties: groupId: @@ -1030,6 +1272,7 @@ components: pattern: '^[0-9]{1,4}$' minItems: 1 AmfInfo: + description: Information of an AMF NF Instance type: object required: - amfSetId @@ -1068,6 +1311,7 @@ components: n2InterfaceAmfInfo: $ref: '#/components/schemas/N2InterfaceAmfInfo' SmfInfo: + description: Information of an SMF NF Instance type: object required: - sNssaiSmfInfoList @@ -1094,7 +1338,12 @@ components: items: $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' minItems: 1 + priority: + type: integer + minimum: 0 + maximum: 65535 SnssaiSmfInfoItem: + description: Set of parameters supported by SMF for a given S-NSSAI type: object required: - sNssai @@ -1108,6 +1357,7 @@ components: $ref: '#/components/schemas/DnnSmfInfoItem' minItems: 1 DnnSmfInfoItem: + description: Set of parameters supported by SMF for a given DNN type: object required: - dnn @@ -1115,6 +1365,7 @@ components: dnn: $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' UpfInfo: + description: Information of an UPF NF Instance type: object required: - sNssaiUpfInfoList @@ -1147,7 +1398,26 @@ components: ueIpAddrInd: type: boolean default: false + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + wAgfInfo: + $ref: '#/components/schemas/WAgfInfo' + tngfInfo: + $ref: '#/components/schemas/TngfInfo' + twifInfo: + $ref: '#/components/schemas/TwifInfo' + priority: + type: integer + minimum: 0 + maximum: 65535 + redundantGtpu: + type: boolean + default: false SnssaiUpfInfoItem: + description: Set of parameters supported by UPF for a given S-NSSAI type: object required: - sNssai @@ -1160,7 +1430,11 @@ components: items: $ref: '#/components/schemas/DnnUpfInfoItem' minItems: 1 + redundantTransport: + type: boolean + default: false DnnUpfInfoItem: + description: Set of parameters supported by UPF for a given DNN type: object required: - dnn @@ -1177,7 +1451,18 @@ components: items: $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' minItems: 1 + ipv4AddressRanges: + type: array + items: + $ref: '#/components/schemas/Ipv4AddressRange' + minItems: 1 + ipv6PrefixRanges: + type: array + items: + $ref: '#/components/schemas/Ipv6PrefixRange' + minItems: 1 InterfaceUpfInfoItem: + description: Information of a given IP interface of an UPF type: object required: - interfaceType @@ -1199,6 +1484,7 @@ components: networkInstance: type: string UPInterfaceType: + description: Types of User-Plane interfaces of the UPF anyOf: - type: string enum: @@ -1206,7 +1492,40 @@ components: - N6 - N9 - type: string + WAgfInfo: + description: Information of the W-AGF end-points + type: object + properties: + ipv4EndpointAddresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + ipv6EndpointAddresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + endpointFqdn: + $ref: '#/components/schemas/Fqdn' + TngfInfo: + description: Infomation of the TNGF endpoints + type: object + properties: + ipv4EndpointAddresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + ipv6EndpointAddresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + endpointFqdn: + $ref: '#/components/schemas/Fqdn' PcfInfo: + description: Information of a PCF NF Instance type: object properties: groupId: @@ -1230,7 +1549,11 @@ components: $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' rxDiamRealm: $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + v2xSupportInd: + type: boolean + default: false BsfInfo: + description: Information of a BSF NF Instance type: object properties: dnnList: @@ -1245,15 +1568,16 @@ components: minItems: 1 ipv4AddressRanges: type: array - items: + items: $ref: '#/components/schemas/Ipv4AddressRange' minItems: 1 ipv6PrefixRanges: type: array - items: + items: $ref: '#/components/schemas/Ipv6PrefixRange' minItems: 1 ChfInfo: + description: Information of a CHF NF Instance type: object properties: supiRangeList: @@ -1271,7 +1595,10 @@ components: items: $ref: '#/components/schemas/PlmnRange' minItems: 1 + groupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' Ipv4AddressRange: + description: Range of IPv4 addresses type: object properties: start: @@ -1279,6 +1606,7 @@ components: end: $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' Ipv6PrefixRange: + description: Range of IPv6 prefixes type: object properties: start: @@ -1286,6 +1614,7 @@ components: end: $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' DefaultNotificationSubscription: + description: Data structure for specifying the notifications the NF service subscribes by default along with callback URI type: object required: - notificationType @@ -1299,7 +1628,42 @@ components: $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/N1MessageClass' n2InformationClass: $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/N2InformationClass' + versions: + type: array + items: + type: string + minItems: 1 + NfSetCond: + description: Subscription to a set of NFs based on their Set Id + type: object + required: + - nfSetId + properties: + nfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + NfServiceSetCond: + description: Subscription to a set of NFs based on their Service Set Id + type: object + required: + - nfServiceSetId + properties: + nfServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + UpfCond: + type: object + properties: + smfServingArea: + type: array + items: + type: string + minItems: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 NotificationType: + description: Types of notifications used in Default Notification URIs in the NF Profile of an NF Instance anyOf: - type: string enum: @@ -1308,22 +1672,26 @@ components: - LOCATION_NOTIFICATION - DATA_REMOVAL_NOTIFICATION - DATA_CHANGE_NOTIFICATION + - LOCATION_UPDATE_NOTIFICATION - type: string TransportProtocol: + description: Types of transport protocol used in a given IP endpoint of an NF Service Instance anyOf: - type: string enum: - TCP - type: string NotificationEventType: + description: Types of events sent in notifications from NRF to subscribed NF Instances anyOf: - type: string enum: - NF_REGISTERED - NF_DEREGISTERED - NF_PROFILE_CHANGED - - type: string + - type: string NotificationData: + description: Data sent in notifications from NRF to subscribed NF Instances type: object required: - event @@ -1339,7 +1707,7 @@ components: event: type: string enum: - - NF_PROFILE_CHANGED + - NF_PROFILE_CHANGED - oneOf: - required: [ nfProfile ] - required: [ profileChanges ] @@ -1353,7 +1721,7 @@ components: event: type: string enum: - - NF_REGISTERED + - NF_REGISTERED - required: [ nfProfile ] properties: event: @@ -1364,15 +1732,15 @@ components: allOf: - $ref: '#/components/schemas/NFProfile' - not: - required: [ interPlmnFqdn ] + required: [ interPlmnFqdn ] - not: - required: [ allowedPlmns ] + required: [ allowedPlmns ] - not: - required: [ allowedNfTypes ] + required: [ allowedNfTypes ] - not: - required: [ allowedNfDomains ] + required: [ allowedNfDomains ] - not: - required: [ allowedNssais ] + required: [ allowedNssais ] - properties: nfServices: type: array @@ -1395,14 +1763,16 @@ components: $ref: 'TS29571_CommonData.yaml#/components/schemas/ChangeItem' minItems: 1 NFStatus: + description: Status of a given NF Instance stored in NRF anyOf: - type: string enum: - REGISTERED - SUSPENDED - UNDISCOVERABLE - - type: string + type: string NFServiceVersion: + description: Contains the version details of an NF service type: object required: - apiVersionInUri @@ -1415,17 +1785,20 @@ components: expiry: $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' ServiceName: + description: Service names known to NRF anyOf: - type: string enum: - nnrf-nfm - nnrf-disc + - nnrf-oauth2 - nudm-sdm - nudm-uecm - nudm-ueau - nudm-ee - nudm-pp - nudm-niddau + - nudm-mt - namf-comm - namf-evts - namf-mt @@ -1436,6 +1809,8 @@ components: - nausf-sorprotection - nausf-upuprotection - nnef-pfdmanagement + - nnef-smcontext + - nnef-eventexposure - npcf-am-policy-control - npcf-smpolicycontrol - npcf-policyauthorization @@ -1446,15 +1821,30 @@ components: - nnssf-nsselection - nnssf-nssaiavailability - nudr-dr + - nudr-group-id-map - nlmf-loc - n5g-eir-eic - nbsf-management - nchf-spendinglimitcontrol - nchf-convergedcharging + - nchf-offlineonlycharging - nnwdaf-eventssubscription - nnwdaf-analyticsinfo + - ngmlc-loc + - nucmf-provisioning + - nucmf-uecapabilitymanagement + - nhss-sdm + - nhss-uecm + - nhss-ueau + - nhss-ims-sdm + - nhss-ims-uecm + - nhss-ims-ueau + - nsepp-telescopic + - nsoraf-sor + - nspaf-secured-packet - type: string N2InterfaceAmfInfo: + description: AMF N2 interface information type: object properties: ipv4EndpointAddress: @@ -1470,6 +1860,7 @@ components: amfName: $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfName' NFServiceStatus: + description: Status of a given NF Service Instance of an NF Instance stored in NRF anyOf: - type: string enum: @@ -1478,6 +1869,7 @@ components: - UNDISCOVERABLE - type: string TaiRange: + description: Range of TAIs (Tracking Area Identities) type: object required: - plmnId @@ -1490,7 +1882,10 @@ components: items: $ref: '#/components/schemas/TacRange' minItems: 1 + nid: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Nid' TacRange: + description: Range of TACs (Tracking Area Codes) type: object properties: start: @@ -1502,6 +1897,7 @@ components: pattern: type: string ChfServiceInfo: + description: Information of primary and secondary CHF services type: object not: required: [ primaryChfServiceInstance, secondaryChfServiceInstance ] @@ -1511,6 +1907,7 @@ components: secondaryChfServiceInstance: type: string PlmnRange: + description: Range of PLMN IDs type: object properties: start: @@ -1522,6 +1919,7 @@ components: pattern: type: string NrfInfo: + description: Information of an NRF NF Instance, used in hierarchical NRF deployments type: object properties: servedUdrInfo: @@ -1569,12 +1967,43 @@ components: additionalProperties: $ref: '#/components/schemas/ChfInfo' minProperties: 1 + servedNefInfo: + type: object + additionalProperties: + $ref: '#/components/schemas/NefInfo' + minProperties: 1 servedNwdafInfo: type: object additionalProperties: $ref: '#/components/schemas/NwdafInfo' minProperties: 1 + servedPcscfInfo: + type: object + additionalProperties: + $ref: '#/components/schemas/PcscfInfo' + minProperties: 1 + servedGmlcInfo: + type: object + additionalProperties: + $ref: '#/components/schemas/GmlcInfo' + minProperties: 1 + servedLmfInfo: + type: object + additionalProperties: + $ref: '#/components/schemas/LmfInfo' + minProperties: 1 + servedNfInfo: + type: object + additionalProperties: + $ref: '#/components/schemas/NfInfo' + minProperties: 1 + servedHssInfo: + type: object + additionalProperties: + $ref: '#/components/schemas/HssInfo' + minProperties: 1 PlmnSnssai: + description: List of network slices (S-NSSAIs) for a given PLMN ID type: object required: - plmnId @@ -1587,7 +2016,34 @@ components: items: $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' minItems: 1 + nid: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Nid' + NefInfo: + description: Information of an NEF NF Instance + type: object + properties: + nefId: + $ref: '#/components/schemas/NefId' + pfdData: + $ref: '#/components/schemas/PfdData' + afEeData: + $ref: '#/components/schemas/AfEventExposureData' + PfdData: + description: List of Application IDs and/or AF IDs managed by a given NEF Instance + type: object + properties: + appIds: + type: array + items: + type: string + minItems: 1 + afIds: + type: array + items: + type: string + minItems: 1 NwdafInfo: + description: Information of a NWDAF NF Instance type: object properties: eventIds: @@ -1610,7 +2066,147 @@ components: items: $ref: '#/components/schemas/TaiRange' minItems: 1 - -externalDocs: - description: 3GPP TS 29.510 V15.3.0; 5G System; Network Function Repository Services; Stage 3 - url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.510/' + LmfInfo: + type: object + properties: + servingClientTypes: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/ExternalClientType' + minItems: 1 + lmfId: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LMFIdentification' + servingAccessTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + minItems: 1 + servingAnNodeTypes: + type: array + items: + $ref: '#/components/schemas/AnNodeType' + minItems: 1 + servingRatTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + minItems: 1 + GmlcInfo: + type: object + properties: + servingClientTypes: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/ExternalClientType' + minItems: 1 + AfEventExposureData: + description: AF Event Exposure data managed by a given NEF Instance + type: object + required: + - afEvents + properties: + afEvents: + type: array + items: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AfEvent' + minItems: 1 + afIds: + type: array + items: + type: string + minItems: 1 + appIds: + type: array + items: + type: string + minItems: 1 + PcscfInfo: + description: Information of a P-CSCF NF Instance + type: object + properties: + accessType: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + minItems: 1 + dnnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + NfInfo: + description: Information of a generic NF Instance + type: object + properties: + nfType: + $ref: '#/components/schemas/NFType' + HssInfo: + description: Information of an HSS NF Instance + type: object + properties: + groupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + imsRanges: + type: array + items: + $ref: '#/components/schemas/ImsiRange' + minItems: 1 + ImsiRange: + description: A range of IMSIs (subscriber identities), either based on a numeric range, or based on regular-expression matching + type: object + properties: + start: + type: string + pattern: '^[0-9]+$' + end: + type: string + pattern: '^[0-9]+$' + pattern: + type: string + TwifInfo: + type: object + properties: + ipv4EndpointAddresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + ipv6EndpointAddresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + endpointFqdn: + $ref: '#/components/schemas/Fqdn' + VendorId: + description: Vendor ID of the NF Service instance (Private Enterprise Number assigned by IANA) + type: string + pattern: '^[0-9]{6}$' + VendorSpecificFeature: + description: Information about a vendor-specific feature + type: object + required: + - featureName + - featureVersion + properties: + featureName: + type: string + featureVersion: + type: string + AnNodeType: + anyOf: + - type: string + enum: + - GNB + - NG_ENB + - type: string + UdsfInfo: + type: object + properties: + groupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + supiRanges: + type: array + items: + $ref: '#/components/schemas/SupiRange' + minItems: 1 diff --git a/lib/sbi/support/3gpp-spec/TS29512_Npcf_SMPolicyControl.yaml b/lib/sbi/support/standard/TS29512_Npcf_SMPolicyControl.yaml similarity index 99% rename from lib/sbi/support/3gpp-spec/TS29512_Npcf_SMPolicyControl.yaml rename to lib/sbi/support/standard/TS29512_Npcf_SMPolicyControl.yaml index 007274b8d9..ca923795b0 100644 --- a/lib/sbi/support/3gpp-spec/TS29512_Npcf_SMPolicyControl.yaml +++ b/lib/sbi/support/standard/TS29512_Npcf_SMPolicyControl.yaml @@ -4,7 +4,7 @@ info: version: 1.1.1.alpha-5 description: | Session Management Policy Control Service - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. externalDocs: description: 3GPP TS 29.512 V16.4.0; 5G System; Session Management Policy Control Service. @@ -1692,11 +1692,11 @@ components: - RAT_TY_CH: RAT Type Change. - REF_QOS_IND_CH: Reflective QoS indication Change - NUM_OF_PACKET_FILTER: Indicates that the SMF shall report the number of supported packet filter for signalled QoS rules - - UE_STATUS_RESUME: Indicates that the UE's status is resumed. + - UE_STATUS_RESUME: Indicates that the UE’s status is resumed. - UE_TZ_CH: UE Time Zone Change - AUTH_PROF_CH: The DN-AAA authorization profile index has changed - QOS_MONITORING: Indicate that the SMF notifies the PCF of the QoS Monitoring information. - - SCELL_CH: Location Change with respect to the Serving Cell. Only applicable to the interworking scenario as defined in Annex B. + - SCELL_CH: Location Change with respect to the Serving Cell. Only applicable to the interworking scenario as defined in Annex B. - EPS_FALLBACK: EPS Fallback report is enabled in the SMF. - MA_PDU: UE Indicates that the SMF notifies the PCF of the MA PDU session request - TSN_ETHER_PORT: Manageable Ethernet port detected diff --git a/lib/sbi/support/standard/TS29514_Npcf_PolicyAuthorization.yaml b/lib/sbi/support/standard/TS29514_Npcf_PolicyAuthorization.yaml new file mode 100644 index 0000000000..bf4bdbb4be --- /dev/null +++ b/lib/sbi/support/standard/TS29514_Npcf_PolicyAuthorization.yaml @@ -0,0 +1,1702 @@ +openapi: 3.0.0 +info: + title: Npcf_PolicyAuthorization Service API + version: 1.1.0.alpha-5 + description: | + PCF Policy Authorization Service. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.514 V16.4.0; 5G System; Policy Authorization Service;Stage 3. + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.514/' +# +servers: + - url: '{apiRoot}/npcf-policyauthorization/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in subclause 4.4 of 3GPP TS 29.501 + +security: + - {} + - oAuth2ClientCredentials: + - npcf-policyauthorization +paths: + /app-sessions: + post: + summary: Creates a new Individual Application Session Context resource + operationId: PostAppSessions + tags: + - Application Sessions (Collection) + requestBody: + description: Contains the information for the creation the resource + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AppSessionContext' + responses: + '201': + description: Successful creation of the resource + content: + application/json: + schema: + $ref: '#/components/schemas/AppSessionContext' + headers: + Location: + description: 'Contains the URI of the created individual application session context resource, according to the structure: {apiRoot}/npcf-policyauthorization/v1/app-sessions/{appSessionId} or the URI of the created events subscription sub-resource, according to the structure: {apiRoot}/npcf-policyauthorization/v1/app-sessions/{appSessionId}/events-subscription}' + required: true + schema: + type: string + '303': + description: See Other. The result of the HTTP POST request would be equivalent to the existing Application Session Context. The HTTP response shall contain a Location header field set to the URI of the existing individual Application Session Context resource + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + description: Forbidden + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ExtendedProblemDetails' + headers: + Retry-After: + description: 'Indicates the time the AF has to wait before making a new request. It can be a non-negative integer (decimal number) indicating the number of seconds the AF has to wait before making a new request or an HTTP-date after which the AF can retry a new request. ' + schema: + anyOf: + - type: integer + - type: string + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + terminationRequest: + '{$request.body#/ascReqData/notifUri}/terminate': + post: + requestBody: + description: Request of the termination of the Individual Application Session Context + content: + application/json: + schema: + $ref: '#/components/schemas/TerminationInfo' + responses: + '204': + description: The receipt of the notification is acknowledged. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + eventNotification: + '{$request.body#/ascReqData/evSubsc/notifUri}/notify': + post: + requestBody: + description: Notification of an event occurrence in the PCF. + content: + application/json: + schema: + $ref: '#/components/schemas/EventsNotification' + responses: + '204': + description: The receipt of the notification is acknowledged + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + new5GsBridge: + '{$request.body#/ascReqData/evSubsc/notifUri}/new-bridge': + post: + requestBody: + description: Notification of a new 5GS Bridge detected in the PCF. + content: + application/json: + schema: + $ref: '#/components/schemas/NewTsnBridge' + responses: + '204': + description: The receipt of the notification is acknowledged + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /app-sessions/pcscf-restoration: + post: + summary: "Indicates P-CSCF restoration and does not create an Individual Application Session Context" + operationId: PcscfRestoration + tags: + - PCSCF Restoration Indication + requestBody: + description: PCSCF Restoration Indication + required: false + content: + application/json: + schema: + $ref: '#/components/schemas/PcscfRestorationRequestData' + responses: + '204': + description: The deletion is confirmed without returning additional data. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +# + /app-sessions/{appSessionId}: + get: + summary: "Reads an existing Individual Application Session Context" + operationId: GetAppSession + tags: + - Individual Application Session Context (Document) + parameters: + - name: appSessionId + description: string identifying the resource + in: path + required: true + schema: + type: string + responses: + '200': + description: A representation of the resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/AppSessionContext' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: "Modifies an existing Individual Application Session Context" + operationId: ModAppSession + tags: + - Individual Application Session Context (Document) + parameters: + - name: appSessionId + description: string identifying the resource + in: path + required: true + schema: + type: string + requestBody: + description: modification of the resource. + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/AppSessionContextUpdateData' + responses: + '200': + description: successful modification of the resource and a representation of that resource is returned + content: + application/json: + schema: + $ref: '#/components/schemas/AppSessionContext' + '204': + description: The successful modification + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + description: Forbidden + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ExtendedProblemDetails' + headers: + Retry-After: + description: 'Indicates the time the AF has to wait before making a new request. It can be a non-negative integer (decimal number) indicating the number of seconds the AF has to wait before making a new request or an HTTP-date after which the AF can retry a new request. ' + schema: + anyOf: + - type: integer + - type: string + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + eventNotification: + '{$request.body#/evSubsc/notifUri}/notify': + post: + requestBody: + description: Notification of an event occurrence in the PCF. + content: + application/json: + schema: + $ref: '#/components/schemas/EventsNotification' + responses: + '204': + description: The receipt of the notification is acknowledged + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +# +# + /app-sessions/{appSessionId}/delete: + post: + summary: "Deletes an existing Individual Application Session Context" + operationId: DeleteAppSession + tags: + - Individual Application Session Context (Document) + parameters: + - name: appSessionId + description: string identifying the Individual Application Session Context resource + in: path + required: true + schema: + type: string + requestBody: + description: deletion of the Individual Application Session Context resource, req notification + required: false + content: + application/json: + schema: + $ref: '#/components/schemas/EventsSubscReqData' + responses: + '200': + description: The deletion of the resource is confirmed and a resource is returned + content: + application/json: + schema: + $ref: '#/components/schemas/AppSessionContext' + '204': + description: The deletion is confirmed without returning additional data. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +# + /app-sessions/{appSessionId}/events-subscription: + put: + summary: "creates or modifies an Events Subscription subresource" + operationId: updateEventsSubsc + tags: + - Events Subscription (Document) + parameters: + - name: appSessionId + description: string identifying the Events Subscription resource + in: path + required: true + schema: + type: string + requestBody: + description: Creation or modification of an Events Subscription resource. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EventsSubscReqData' + responses: + '201': + description: The creation of the Events Subscription resource is confirmed and its representation is returned. + content: + application/json: + schema: + anyOf: + - $ref: '#/components/schemas/EventsSubscReqData' + - $ref: '#/components/schemas/EventsNotification' + headers: + Location: + description: 'Contains the URI of the created Events Subscription resource, according to the structure: {apiRoot}/npcf-policyauthorization/v1/app-sessions/{appSessionId}/events-subscription}' + required: true + schema: + type: string + '200': + description: The modification of the of the Events Subscription resource is confirmed its representation is returned. + content: + application/json: + schema: + anyOf: + - $ref: '#/components/schemas/EventsSubscReqData' + - $ref: '#/components/schemas/EventsNotification' + '204': + description: The modification of the Events Subscription subresource is confirmed without returning additional data. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + eventNotification: + '{$request.body#/notifUri}/notify': + post: + requestBody: + description: Contains the information for the notification of an event occurrence in the PCF. + content: + application/json: + schema: + $ref: '#/components/schemas/EventsNotification' + responses: + '204': + description: The receipt of the notification is acknowledged. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: deletes the Events Subscription subresource + operationId: DeleteEventsSubsc + tags: + - Events Subscription (Document) + parameters: + - name: appSessionId + description: string identifying the Individual Application Session Context resource + in: path + required: true + schema: + type: string + responses: + '204': + description: The deletion of the of the Events Subscription sub-resource is confirmed without returning additional data. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + npcf-policyauthorization: Access to the Npcf_PolicyAuthorization API + schemas: + AppSessionContext: + description: Represents an Individual Application Session Context resource. + type: object + properties: + ascReqData: + $ref: '#/components/schemas/AppSessionContextReqData' + ascRespData: + $ref: '#/components/schemas/AppSessionContextRespData' + evsNotif: + $ref: '#/components/schemas/EventsNotification' + AppSessionContextReqData: + description: Identifies the service requirements of an Individual Application Session Context. + type: object + required: + - notifUri + - suppFeat + oneOf: + - required: [ueIpv4] + - required: [ueIpv6] + - required: [ueMac] + properties: + afAppId: + $ref: '#/components/schemas/AfAppId' + afChargId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationChargingId' + afReqData: + $ref: '#/components/schemas/AfRequestedData' + afRoutReq: + $ref: '#/components/schemas/AfRoutingRequirement' + aspId: + $ref: '#/components/schemas/AspId' + bdtRefId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + evSubsc: + $ref: '#/components/schemas/EventsSubscReqData' + mcpttId: + description: indication of MCPTT service request + type: string + mcVideoId: + description: indication of MCVideo service request + type: string + medComponents: + type: object + additionalProperties: + $ref: '#/components/schemas/MediaComponent' + minProperties: 1 + ipDomain: + type: string + mpsId: + description: indication of MPS service request + type: string + mcsId: + description: indication of MCS service request + type: string + preemptControlInfo: + $ref: '#/components/schemas/PreemptionControlInformation' + resPrio: + $ref: '#/components/schemas/ReservPriority' + servInfStatus: + $ref: '#/components/schemas/ServiceInfoStatus' + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + servUrn: + $ref: '#/components/schemas/ServiceUrn' + sliceInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + sponId: + $ref: '#/components/schemas/SponId' + sponStatus: + $ref: '#/components/schemas/SponsoringStatus' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + ueIpv4: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ueIpv6: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + ueMac: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + tsnPortManContDstt: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/PortManagementContainer' + tsnPortManContNwtts: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/PortManagementContainer' + minItems: 1 + AppSessionContextRespData: + description: Describes the authorization data of an Individual Application Session Context created by the PCF. + type: object + properties: + servAuthInfo: + $ref: '#/components/schemas/ServAuthInfo' + ueIds: + type: array + items: + $ref: '#/components/schemas/UeIdentityInfo' + minItems: 1 + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + AppSessionContextUpdateData: + description: Identifies the modifications to an Individual Application Session Context and may include the modifications to the sub-resource Events Subscription. + type: object + properties: + afAppId: + $ref: '#/components/schemas/AfAppId' + afRoutReq: + $ref: '#/components/schemas/AfRoutingRequirementRm' + aspId: + $ref: '#/components/schemas/AspId' + bdtRefId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + evSubsc: + $ref: '#/components/schemas/EventsSubscReqDataRm' + mcpttId: + description: indication of MCPTT service request + type: string + mcVideoId: + description: indication of modification of MCVideo service + type: string + medComponents: + type: object + additionalProperties: + $ref: '#/components/schemas/MediaComponentRm' + minProperties: 1 + mpsId: + description: indication of MPS service request + type: string + mcsId: + description: indication of MCS service request + type: string + preemptControlInfo: + $ref: '#/components/schemas/PreemptionControlInformationRm' + resPrio: + $ref: '#/components/schemas/ReservPriority' + servInfStatus: + $ref: '#/components/schemas/ServiceInfoStatus' + sipForkInd: + $ref: '#/components/schemas/SipForkingIndication' + sponId: + $ref: '#/components/schemas/SponId' + sponStatus: + $ref: '#/components/schemas/SponsoringStatus' + tsnPortManContDstt: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/PortManagementContainer' + tsnPortManContNwtts: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/PortManagementContainer' + minItems: 1 + EventsSubscReqData: + description: Identifies the events the application subscribes to. + type: object + required: + - events + properties: + events: + type: array + items: + $ref: '#/components/schemas/AfEventSubscription' + minItems: 1 + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + reqQosMonParams: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/RequestedQosMonitoringParameter' + minItems: 1 + qosMon: + $ref: '#/components/schemas/QosMonitoringInformation' + reqAni: + $ref: '#/components/schemas/RequiredAccessInfo' + usgThres: + $ref: 'TS29122_CommonData.yaml#/components/schemas/UsageThreshold' + notifCorreId: + type: string + EventsSubscReqDataRm: + description: this data type is defined in the same way as the EventsSubscReqData data type, but with the OpenAPI nullable property set to true. + type: object + required: + - events + properties: + events: + type: array + items: + $ref: '#/components/schemas/AfEventSubscription' + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + reqQosMonParams: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/RequestedQosMonitoringParameter' + minItems: 1 + qosMon: + $ref: '#/components/schemas/QosMonitoringInformationRm' + reqAni: + $ref: '#/components/schemas/RequiredAccessInfo' + usgThres: + $ref: 'TS29122_CommonData.yaml#/components/schemas/UsageThresholdRm' + notifCorreId: + type: string + nullable: true + MediaComponent: + description: Identifies a media component. + type: object + required: + - medCompN + properties: + afAppId: + $ref: '#/components/schemas/AfAppId' + afRoutReq: + $ref: '#/components/schemas/AfRoutingRequirement' + qosReference: + type: string + altSerReqs: + type: array + items: + type: string + minItems: 1 + contVer: + $ref: '#/components/schemas/ContentVersion' + codecs: + type: array + items: + $ref: '#/components/schemas/CodecData' + minItems: 1 + maxItems: 2 + desMaxLatency: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + desMaxLoss: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + flusId: + type: string + fStatus: + $ref: '#/components/schemas/FlowStatus' + marBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + marBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + maxPacketLossRateDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRateRm' + maxPacketLossRateUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRateRm' + maxSuppBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + maxSuppBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + medCompN: + type: integer + medSubComps: + type: object + additionalProperties: + $ref: '#/components/schemas/MediaSubComponent' + minProperties: 1 + medType: + $ref: '#/components/schemas/MediaType' + minDesBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + minDesBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + mirBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + mirBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + preemptCap: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PreemptionCapability' + preemptVuln: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PreemptionVulnerability' + prioSharingInd: + $ref: '#/components/schemas/PrioritySharingIndicator' + resPrio: + $ref: '#/components/schemas/ReservPriority' + rrBw: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + rsBw: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + sharingKeyDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + sharingKeyUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + tsnQos: + $ref: '#/components/schemas/TsnQosContainer' + tscaiInputDl: + $ref: '#/components/schemas/TscaiInputContainer' + tscaiInputUl: + $ref: '#/components/schemas/TscaiInputContainer' + MediaComponentRm: + description: This data type is defined in the same way as the MediaComponent data type, but with the OpenAPI nullable property set to true + type: object + required: + - medCompN + properties: + afAppId: + $ref: '#/components/schemas/AfAppId' + afRoutReq: + $ref: '#/components/schemas/AfRoutingRequirementRm' + qosReference: + type: string + nullable: true + altSerReqs: + type: array + items: + type: string + minItems: 1 + nullable: true + contVer: + $ref: '#/components/schemas/ContentVersion' + codecs: + type: array + items: + $ref: '#/components/schemas/CodecData' + minItems: 1 + maxItems: 2 + desMaxLatency: + $ref: 'TS29571_CommonData.yaml#/components/schemas/FloatRm' + desMaxLoss: + $ref: 'TS29571_CommonData.yaml#/components/schemas/FloatRm' + flusId: + type: string + nullable: true + fStatus: + $ref: '#/components/schemas/FlowStatus' + marBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + marBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + maxPacketLossRateDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRateRm' + maxPacketLossRateUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRateRm' + maxSuppBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + maxSuppBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + medCompN: + type: integer + medSubComps: + type: object + additionalProperties: + $ref: '#/components/schemas/MediaSubComponentRm' + minProperties: 1 + medType: + $ref: '#/components/schemas/MediaType' + minDesBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + minDesBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + mirBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + mirBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + preemptCap: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PreemptionCapabilityRm' + preemptVuln: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PreemptionVulnerabilityRm' + prioSharingInd: + $ref: '#/components/schemas/PrioritySharingIndicator' + resPrio: + $ref: '#/components/schemas/ReservPriority' + rrBw: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + rsBw: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + sharingKeyDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32Rm' + sharingKeyUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32Rm' + tsnQos: + $ref: '#/components/schemas/TsnQosContainerRm' + tscaiInputDl: + $ref: '#/components/schemas/TscaiInputContainer' + tscaiInputUl: + $ref: '#/components/schemas/TscaiInputContainer' + nullable: true + MediaSubComponent: + description: Identifies a media subcomponent + type: object + required: + - fNum + properties: + afSigProtocol: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/AfSigProtocol' + ethfDescs: + type: array + items: + $ref: '#/components/schemas/EthFlowDescription' + minItems: 1 + maxItems: 2 + fNum: + type: integer + fDescs: + type: array + items: + $ref: '#/components/schemas/FlowDescription' + minItems: 1 + maxItems: 2 + fStatus: + $ref: '#/components/schemas/FlowStatus' + marBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + marBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + tosTrCl: + $ref: '#/components/schemas/TosTrafficClass' + flowUsage: + $ref: '#/components/schemas/FlowUsage' + tscaiInputDl: + $ref: '#/components/schemas/TscaiInputContainer' + tscaiInputUl: + $ref: '#/components/schemas/TscaiInputContainer' + MediaSubComponentRm: + description: This data type is defined in the same way as the MediaSubComponent data type, but with the OpenAPI nullable property set to true. Removable attributes marBwDl and marBwUl are defined with the corresponding removable data type. + type: object + required: + - fNum + properties: + afSigProtocol: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/AfSigProtocol' + ethfDescs: + type: array + items: + $ref: '#/components/schemas/EthFlowDescription' + minItems: 1 + maxItems: 2 + nullable: true + fNum: + type: integer + fDescs: + type: array + items: + $ref: '#/components/schemas/FlowDescription' + minItems: 1 + maxItems: 2 + nullable: true + fStatus: + $ref: '#/components/schemas/FlowStatus' + marBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + marBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + tosTrCl: + $ref: '#/components/schemas/TosTrafficClassRm' + flowUsage: + $ref: '#/components/schemas/FlowUsage' + tscaiInputDl: + $ref: '#/components/schemas/TscaiInputContainer' + tscaiInputUl: + $ref: '#/components/schemas/TscaiInputContainer' + nullable: true + EventsNotification: + description: describes the notification of a matched event + type: object + required: + - evSubsUri + - evNotifs + properties: + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + anChargAddr: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/AccNetChargingAddress' + anChargIds: + type: array + items: + $ref: '#/components/schemas/AccessNetChargingIdentifier' + minItems: 1 + anGwAddr: + $ref: '#/components/schemas/AnGwAddress' + evSubsUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + evNotifs: + type: array + items: + $ref: '#/components/schemas/AfEventNotification' + minItems: 1 + failedResourcAllocReports: + type: array + items: + $ref: '#/components/schemas/ResourcesAllocationInfo' + minItems: 1 + noNetLocSupp: + type: boolean + outOfCredReports: + type: array + items: + $ref: '#/components/schemas/OutOfCreditInformation' + minItems: 1 + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + qncReports: + type: array + items: + $ref: '#/components/schemas/QosNotificationControlInfo' + minItems: 1 + qosMonReports: + type: array + items: + $ref: '#/components/schemas/QosMonitoringReport' + minItems: 1 + ranNasRelCauses: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/RanNasRelCause' + minItems: 1 + description: Contains the RAN and/or NAS release cause. + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + ueLoc: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + usgRep: + $ref: 'TS29122_CommonData.yaml#/components/schemas/AccumulatedUsage' + tsnBridgeInfo: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/TsnBridgeInfo' + tsnPortManContDstt: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/PortManagementContainer' + tsnPortManContNwtts: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/PortManagementContainer' + minItems: 1 + AfEventSubscription: + description: describes the event information delivered in the subscription + type: object + required: + - event + properties: + event: + $ref: '#/components/schemas/AfEvent' + notifMethod: + $ref: '#/components/schemas/AfNotifMethod' + repPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + waitTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + AfEventNotification: + description: describes the event information delivered in the notification + type: object + required: + - event + properties: + event: + $ref: '#/components/schemas/AfEvent' + flows: + type: array + items: + $ref: '#/components/schemas/Flows' + minItems: 1 + TerminationInfo: + description: indicates the cause for requesting the deletion of the Individual Application Session Context resource + type: object + required: + - termCause + - resUri + properties: + termCause: + $ref: '#/components/schemas/TerminationCause' + resUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + AfRoutingRequirement: + description: describes the event information delivered in the subscription + type: object + properties: + appReloc: + type: boolean + routeToLocs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + minItems: 1 + spVal: + $ref: '#/components/schemas/SpatialValidity' + tempVals: + type: array + items: + $ref: '#/components/schemas/TemporalValidity' + minItems: 1 + upPathChgSub: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/UpPathChgEvent' + addrPreserInd: + type: boolean + SpatialValidity: + description: describes explicitly the route to an Application location + type: object + required: + - presenceInfoList + properties: + presenceInfoList: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 1 + SpatialValidityRm: + description: this data type is defined in the same way as the SpatialValidity data type, but with the OpenAPI nullable property set to true + type: object + required: + - presenceInfoList + properties: + presenceInfoList: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 1 + nullable: true + AfRoutingRequirementRm: + description: this data type is defined in the same way as the AfRoutingRequirement data type, but with the OpenAPI nullable property set to true and the spVal and tempVals attributes defined as removable. + type: object + properties: + appReloc: + type: boolean + routeToLocs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + minItems: 1 + nullable: true + spVal: + $ref: '#/components/schemas/SpatialValidityRm' + tempVals: + type: array + items: + $ref: '#/components/schemas/TemporalValidity' + minItems: 1 + nullable: true + upPathChgSub: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/UpPathChgEvent' + addrPreserInd: + type: boolean + nullable: true + nullable: true + AnGwAddress: + description: describes the address of the access network gateway control node + type: object + anyOf: + - required: [anGwIpv4Addr] + - required: [anGwIpv6Addr] + properties: + anGwIpv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + anGwIpv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + Flows: + description: Identifies the flows + type: object + required: + - medCompN + properties: + contVers: + type: array + items: + $ref: '#/components/schemas/ContentVersion' + minItems: 1 + fNums: + type: array + items: + type: integer + minItems: 1 + medCompN: + type: integer + EthFlowDescription: + description: Identifies an Ethernet flow + type: object + required: + - ethType + properties: + destMacAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + ethType: + type: string + fDesc: + $ref: '#/components/schemas/FlowDescription' + fDir: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/FlowDirection' + sourceMacAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + vlanTags: + type: array + items: + type: string + minItems: 1 + maxItems: 2 + srcMacAddrEnd: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + destMacAddrEnd: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + + + ResourcesAllocationInfo: + description: describes the status of the PCC rule(s) related to certain media components. + type: object + required: + - mcResourcStatus + properties: + mcResourcStatus: + $ref: '#/components/schemas/MediaComponentResourcesStatus' + flows: + type: array + items: + $ref: '#/components/schemas/Flows' + minItems: 1 + TemporalValidity: + description: Indicates the time interval(s) during which the AF request is to be applied + type: object + properties: + startTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + stopTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' +# + QosNotificationControlInfo: + description: Indicates whether the QoS targets for a GRB flow are not guaranteed or guaranteed again + type: object + required: + - notifType + properties: + notifType: + $ref: '#/components/schemas/QosNotifType' + flows: + type: array + items: + $ref: '#/components/schemas/Flows' + minItems: 1 + altSerReq: + type: string +# + AcceptableServiceInfo: + description: Indicates the maximum bandwidth that shall be authorized by the PCF. + type: object + properties: + accBwMedComps: + type: object + additionalProperties: + $ref: '#/components/schemas/MediaComponent' + marBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + marBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + + UeIdentityInfo: + description: Represents 5GS-Level UE identities. + type: object + anyOf: + - required: [gpsi] + - required: [pei] + - required: [supi] + properties: + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' +# + AccessNetChargingIdentifier: + description: Describes the access network charging identifier. + type: object + required: + - accNetChaIdValue + properties: + accNetChaIdValue: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ChargingId' + flows: + type: array + items: + $ref: '#/components/schemas/Flows' + minItems: 1 +# + OutOfCreditInformation: + description: Indicates the SDFs without available credit and the corresponding termination action. + type: object + required: + - finUnitAct + properties: + finUnitAct: + $ref: 'TS32291_Nchf_ConvergedCharging.yaml#/components/schemas/FinalUnitAction' + flows: + type: array + items: + $ref: '#/components/schemas/Flows' + minItems: 1 +# + QosMonitoringInformation: + description: Indicates the QoS Monitoring information to report, i.e. UL and/or DL and or round trip delay. + type: object + properties: + repThreshDl: + type: integer + repThreshUl: + type: integer + repThreshRp: + type: integer +# +# + NewTsnBridge: + description: Contains the new 5GS Bridge information and may contain the DS-TT port and/or NW-TT port management information. + type: object + required: + - tsnBridgeInfo + properties: + tsnBridgeInfo: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/TsnBridgeInfo' + tsnPortManContDstt: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/PortManagementContainer' + tsnPortManContNwtts: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/PortManagementContainer' + minItems: 1 + +# + QosMonitoringInformationRm: + description: this data type is defined in the same way as the QosMonitoringInformation data type, but with the OpenAPI nullable property set to true. + type: object + properties: + repThreshDl: + type: integer + repThreshUl: + type: integer + repThreshRp: + type: integer + nullable: true +# + PcscfRestorationRequestData: + description: Indicates P-CSCF restoration. + type: object + oneOf: + - required: [ueIpv4] + - required: [ueIpv6] + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + ipDomain: + type: string + sliceInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + ueIpv4: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ueIpv6: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + +# +# + QosMonitoringReport: + description: QoS Monitoring reporting information + type: object + properties: + flows: + type: array + items: + $ref: '#/components/schemas/Flows' + minItems: 1 + ulDelays: + type: array + items: + type: integer + minItems: 1 + dlDelays: + type: array + items: + type: integer + minItems: 1 + rtDelays: + type: array + items: + type: integer + minItems: 1 +# + TsnQosContainer: + description: Indicates TSC Traffic QoS. + type: object + properties: + maxTscBurstSize: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtMaxDataBurstVol' + tscPackDelay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' + tscPrioLevel: + $ref: '#/components/schemas/TscPriorityLevel' +# +# + TsnQosContainerRm: + description: Indicates removable TSC Traffic QoS. + type: object + properties: + maxTscBurstSize: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtMaxDataBurstVolRm' + tscPackDelay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudgetRm' + tscPrioLevel: + $ref: '#/components/schemas/TscPriorityLevelRm' + nullable: true +# + TscaiInputContainer: + description: Indicates TSC Traffic pattern. + type: object + properties: + periodicity: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + burstArrivalTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + nullable: true +# +# EXTENDED PROBLEMDETAILS +# + ExtendedProblemDetails: + description: Extends ProblemDetails to also include the acceptable service info. + allOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + - type: object + properties: + acceptableServInfo: + $ref: '#/components/schemas/AcceptableServiceInfo' + +# +# SIMPLE DATA TYPES +# + AfAppId: + description: Contains an AF application identifier. + type: string + AspId: + description: Contains an identity of an application service provider. + type: string + CodecData: + description: Contains codec related information. + type: string + ContentVersion: + description: Represents the content version of some content. + type: integer + FlowDescription: + description: Defines a packet filter of an IP flow. + type: string + SponId: + description: Contains an identity of a sponsor. + type: string + ServiceUrn: + description: Contains values of the service URN and may include subservices. + type: string + TosTrafficClass: + description: 2-octet string, where each octet is encoded in hexadecimal representation. The first octet contains the IPv4 Type-of-Service or the IPv6 Traffic-Class field and the second octet contains the ToS/Traffic Class mask field. + type: string + TosTrafficClassRm: + description: this data type is defined in the same way as the TosTrafficClass data type, but with the OpenAPI nullable property set to true + type: string + nullable: true + TscPriorityLevel: + type: integer + minimum: 1 + maximum: 8 + TscPriorityLevelRm: + type: integer + minimum: 1 + maximum: 8 + nullable: true +# +# ENUMERATIONS DATA TYPES +# + MediaType: + anyOf: + - type: string + enum: + - AUDIO + - VIDEO + - DATA + - APPLICATION + - CONTROL + - TEXT + - MESSAGE + - OTHER + - type: string +# + ReservPriority: + anyOf: + - type: string + enum: + - PRIO_1 + - PRIO_2 + - PRIO_3 + - PRIO_4 + - PRIO_5 + - PRIO_6 + - PRIO_7 + - PRIO_8 + - PRIO_9 + - PRIO_10 + - PRIO_11 + - PRIO_12 + - PRIO_13 + - PRIO_14 + - PRIO_15 + - PRIO_16 + - type: string +# + ServAuthInfo: + anyOf: + - type: string + enum: + - TP_NOT_KNOWN + - TP_EXPIRED + - TP_NOT_YET_OCURRED + - type: string +# + SponsoringStatus: + anyOf: + - type: string + enum: + - SPONSOR_DISABLED + - SPONSOR_ENABLED + - type: string +# + AfEvent: + anyOf: + - type: string + enum: + - ACCESS_TYPE_CHANGE + - ANI_REPORT + - CHARGING_CORRELATION + - EPS_FALLBACK + - FAILED_RESOURCES_ALLOCATION + - OUT_OF_CREDIT + - PLMN_CHG + - QOS_MONITORING + - QOS_NOTIF + - RAN_NAS_CAUSE + - SUCCESSFUL_RESOURCES_ALLOCATION + - TSN_ETHER_PORT + - TSN_CONTAINER + - USAGE_REPORT + - type: string +# + AfNotifMethod: + anyOf: + - type: string + enum: + - EVENT_DETECTION + - ONE_TIME + - PERIODIC + - PDU_SESSION_RELEASE + - type: string +# + QosNotifType: + anyOf: + - type: string + enum: + - GUARANTEED + - NOT_GUARANTEED + - type: string +# + TerminationCause: + anyOf: + - type: string + enum: + - ALL_SDF_DEACTIVATION + - PDU_SESSION_TERMINATION + - PS_TO_CS_HO + - type: string +# + MediaComponentResourcesStatus: + anyOf: + - type: string + enum: + - ACTIVE + - INACTIVE + - type: string +# +# + FlowUsage: + anyOf: + - type: string + enum: + - NO_INFO + - RTCP + - AF_SIGNALLING + - type: string + + + FlowStatus: + anyOf: + - type: string + enum: + - ENABLED-UPLINK + - ENABLED-DOWNLINK + - ENABLED + - DISABLED + - REMOVED + - type: string +# + RequiredAccessInfo: + anyOf: + - type: string + enum: + - USER_LOCATION + - UE_TIME_ZONE + - type: string +# + SipForkingIndication: + anyOf: + - type: string + enum: + - SINGLE_DIALOGUE + - SEVERAL_DIALOGUES + - type: string +# + AfRequestedData: + anyOf: + - type: string + enum: + - UE_IDENTITY + - type: string +# + ServiceInfoStatus: + anyOf: + - type: string + enum: + - FINAL + - PRELIMINARY + - type: string +# + PreemptionControlInformation: + anyOf: + - type: string + enum: + - MOST_RECENT + - LEAST_RECENT + - HIGHEST_BW + - type: string +# + PrioritySharingIndicator: + anyOf: + - type: string + enum: + - ENABLED + - DISABLED + - type: string +# + PreemptionControlInformationRm: + anyOf: + - $ref: '#/components/schemas/PreemptionControlInformation' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/NullValue' diff --git a/lib/sbi/support/3gpp-spec/TS29591_Nnef_EventExposure.yaml b/lib/sbi/support/standard/TS29517_Naf_EventExposure.yaml similarity index 62% rename from lib/sbi/support/3gpp-spec/TS29591_Nnef_EventExposure.yaml rename to lib/sbi/support/standard/TS29517_Naf_EventExposure.yaml index ee9b75c4b8..44d99607bd 100644 --- a/lib/sbi/support/3gpp-spec/TS29591_Nnef_EventExposure.yaml +++ b/lib/sbi/support/standard/TS29517_Naf_EventExposure.yaml @@ -1,48 +1,51 @@ openapi: 3.0.0 info: - title: Nnef_EventExposure - version: 1.0.0.alpha-1 + version: 1.0.0.alpha-2 + title: Naf_EventExposure description: | - NEF Event Exposure Service. - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + AF Event Exposure Service. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. + externalDocs: - description: 3GPP TS 29.591 V16.0.0; 5G System; Application Function (AF) event exposure service; Stage 3. - url: http://www.3gpp.org/ftp/Specs/archive/29_series/29.591/ + description: 3GPP TS 29.517 V16.0.0; 5G System; Application Function Event Exposure Service; Stage 3. + url: http://www.3gpp.org/ftp/Specs/archive/29_series/29.517/ + servers: - - url: '{apiRoot}/nnef-eventexposure/v1' + - url: '{apiRoot}/naf-eventexposure/v1' variables: apiRoot: default: https://example.com - description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + description: apiRoot as defined in subclause 4.4 of 3GPP TS 29.501 + security: - {} - - oAuth2ClientCredentials: - - nnef-eventexposure -paths: + - oAuth2ClientCredentials: [] + +paths: /subscriptions: post: - summary: subscribe to notifications - operationId: CreateIndividualSubcription + summary: Creates a new Individual Application Event Exposure Subscription resource + operationId: PostAfEventExposureSubsc tags: - - Subscriptions (Collection) + - Application Event Subscription (Collection) requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/NefEventExposureSubsc' + $ref: '#/components/schemas/AfEventExposureSubsc' responses: '201': description: Success content: application/json: schema: - $ref: '#/components/schemas/NefEventExposureSubsc' + $ref: '#/components/schemas/AfEventExposureSubsc' headers: Location: - description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nnef-eventexposure/{apiVersion}/subscriptions/{subscriptionId}' + description: 'Contains the URI of the created individual application event subscription resource' required: true schema: type: string @@ -69,7 +72,7 @@ paths: default: $ref: 'TS29571_CommonData.yaml#/components/responses/default' callbacks: - myNotification: + AfEventExposureNotif: '{$request.body#/notifUri}': post: requestBody: @@ -77,7 +80,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/NefEventExposureNotif' + $ref: '#/components/schemas/AfEventExposureNotif' responses: '204': description: No Content, Notification was succesfull @@ -105,14 +108,14 @@ paths: $ref: 'TS29571_CommonData.yaml#/components/responses/default' /subscriptions/{subscriptionId}: get: - summary: retrieve subscription - operationId: GetIndividualSubcription + summary: "Reads an existing Individual Application Event Subscription" + operationId: GetAfEventExposureSubsc tags: - - IndividualSubscription (Document) + - Individual Application Event Subscription (Document) parameters: - name: subscriptionId in: path - description: Event Subscription ID + description: Application Event Subscription ID required: true schema: type: string @@ -122,7 +125,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/NefEventExposureSubsc' + $ref: '#/components/schemas/AfEventExposureSubsc' '400': $ref: 'TS29571_CommonData.yaml#/components/responses/400' '401': @@ -142,20 +145,20 @@ paths: default: $ref: 'TS29571_CommonData.yaml#/components/responses/default' put: - summary: update subscription - operationId: ReplaceIndividualSubcription + summary: "Modifies an existing Individual Application Event Subscription " + operationId: PutAfEventExposureSubsc tags: - - IndividualSubscription (Document) + - Individual Application Event Subscription (Document) requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/NefEventExposureSubsc' + $ref: '#/components/schemas/AfEventExposureSubsc' parameters: - name: subscriptionId in: path - description: Event Subscription ID + description: Application Event Subscription ID required: true schema: type: string @@ -165,7 +168,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/NefEventExposureSubsc' + $ref: '#/components/schemas/AfEventExposureSubsc' '204': description: No Content. Resource was succesfully modified '400': @@ -191,14 +194,14 @@ paths: default: $ref: 'TS29571_CommonData.yaml#/components/responses/default' delete: - summary: unsubscribe from notifications - operationId: DeleteIndividualSubcription + summary: "Cancels an existing Individual Application Event Subscription " + operationId: DeleteAfEventExposureSubsc tags: - - IndividualSubscription (Document) + - Individual Application Event Subscription (Document) parameters: - name: subscriptionId in: path - description: Event Subscription ID + description: Application Event Subscription ID required: true schema: type: string @@ -221,39 +224,19 @@ paths: $ref: 'TS29571_CommonData.yaml#/components/responses/503' default: $ref: 'TS29571_CommonData.yaml#/components/responses/default' + components: securitySchemes: oAuth2ClientCredentials: type: oauth2 flows: clientCredentials: - tokenUrl: '{nrfApiRoot}/oauth2/token' - scopes: - nnef-eventexposure: Access to the Nnef_EventExposure API + tokenUrl: '{tokenUri}' + scopes: {} + description: for trusted AF, the 'naf-eventexposure' shall be used as 'scopes' and '{nrfApiRoot}/oauth2/token' shall be used as 'tokenUri'. + schemas: - NefEventExposureSubsc: - type: object - properties: - eventsSubs: - type: array - items: - $ref: '#/components/schemas/NefEventSubs' - minItems: 1 - eventsRepInfo: - $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/EventReportingRequirement' - notifUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - notifId: - type: string - suppFeat: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - rspNotifUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - required: - - notifId - - notifUri - - suppFeat - NefEventExposureNotif: + AfEventExposureNotif: type: object properties: notifId: @@ -261,99 +244,153 @@ components: eventNotifs: type: array items: - $ref: '#/components/schemas/NefEventNotification' + $ref: '#/components/schemas/AfEventNotification' minItems: 1 required: - notifId - eventNotifs - NefEventNotification: + AfEventExposureSubsc: + type: object + properties: + eventSubs: + type: array + items: + $ref: '#/components/schemas/EventsSubs' + minItems: 1 + eventsRepInfo: + $ref: 'TS29523_Npcf_EventExposure.yaml#/components/schemas/ReportingInformation' + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + notifId: + type: string + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - eventSubs + - eventsRepInfo + - notifId + - notifUri + - suppFeat + AfEventNotification: type: object properties: event: - $ref: '#/components/schemas/NefEvent' + $ref: '#/components/schemas/AfEvent' timeStamp: $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' svcExprcInfos: type: array items: - $ref: '#/components/schemas/ServiceExperienceInfo' + $ref: '#/components/schemas/ServiceExperienceInfoPerApp' minItems: 1 ueMobilityInfos: type: array items: - $ref: '#/components/schemas/UeMobilityInfo' + $ref: '#/components/schemas/UeMobilityCollection' minItems: 1 ueCommInfos: type: array items: - $ref: '#/components/schemas/UeCommunicationInfo' + $ref: '#/components/schemas/UeCommunicationCollection' minItems: 1 excepInfos: type: array items: - $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/ExceptionInfo' + $ref: '#/components/schemas/ExceptionInfo' minItems: 1 required: - event - timeStamp - NefEventSubs: + EventsSubs: type: object properties: event: - $ref: '#/components/schemas/NefEvent' + $ref: '#/components/schemas/AfEvent' eventFilter: - $ref: '#/components/schemas/NefEventFilter' + $ref: '#/components/schemas/EventFilter' required: - event - NefEventFilter: + - eventFilter + EventFilter: type: object properties: - tgtUe: - $ref: '#/components/schemas/TargetUeIdentification' + gpsis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + supis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + exterGroupIds: + type: array + items: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + minItems: 1 + interGroupIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + anyUeInd: + type: boolean appIds: type: array items: $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' minItems: 1 locArea: - $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' - required: - - tgtUe - TargetUeIdentification: - type: object - properties: - supis: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - minItems: 1 - interGroupIds: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' - minItems: 1 - anyUeId: - type: boolean - ServiceExperienceInfo: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + ServiceExperienceInfoPerApp: type: object properties: appId: $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + svcExpPerFlows: + type: array + items: + $ref: '#/components/schemas/ServiceExperienceInfoPerFlow' + minItems: 1 + gpsis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 supis: type: array items: $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' minItems: 1 - svcExpPerFlows: - type: array - items: - $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/ServiceExperienceInfoPerFlow' - minItems: 1 required: - svcExpPerFlows - UeMobilityInfo: + ServiceExperienceInfoPerFlow: type: object properties: + svcExprc: + $ref: '#/components/schemas/SvcExperience' + timeIntev: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + dnai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + ipTrafficFilter: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + ethTrafficFilter: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + SvcExperience: + type: object + properties: + mos: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + upperRange: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + lowerRange: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + UeMobilityCollection: + type: object + properties: + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' supi: $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' appId: @@ -361,16 +398,20 @@ components: ueTrajs: type: array items: - $ref: '#/components/schemas/UeTrajectoryInfo' + $ref: '#/components/schemas/UeTrajectoryCollection' minItems: 1 required: - - supi + - appId - ueTrajs - UeCommunicationInfo: + UeCommunicationCollection: type: object properties: + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' supi: $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + exterGroupId: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' interGroupId: $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' appId: @@ -378,24 +419,53 @@ components: comms: type: array items: - $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/CommunicationCollection' + $ref: '#/components/schemas/CommunicationCollection' minItems: 1 required: + - appId - comms - UeTrajectoryInfo: + UeTrajectoryCollection: type: object properties: ts: $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - location: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + locArea: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' required: - ts - - location + - locArea + CommunicationCollection: + type: object + properties: + startTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + endTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ulVol: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + dlVol: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + required: + - startTime + - endTime + - ulVol + - dlVol + ExceptionInfo: + type: object + properties: + ipTrafficFilter: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + ethTrafficFilter: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + exceps: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/Exception' + minItems: 1 # Simple data types and Enumerations - NefEvent: + AfEvent: anyOf: - type: string enum: diff --git a/lib/sbi/support/3gpp-spec/TS29518_Namf_Communication.yaml b/lib/sbi/support/standard/TS29518_Namf_Communication.yaml similarity index 86% rename from lib/sbi/support/3gpp-spec/TS29518_Namf_Communication.yaml rename to lib/sbi/support/standard/TS29518_Namf_Communication.yaml index fa23d393fd..c8b7e6d588 100644 --- a/lib/sbi/support/3gpp-spec/TS29518_Namf_Communication.yaml +++ b/lib/sbi/support/standard/TS29518_Namf_Communication.yaml @@ -1,2439 +1,2622 @@ -openapi: 3.0.0 -info: - version: 1.1.0.alpha-1 - title: Namf_Communication - description: | - AMF Communication Service - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. -security: - - {} - - oAuth2ClientCredentials: - - namf-comm -externalDocs: - description: 3GPP TS 29.518 V15.3.0; 5G System; Access and Mobility Management Services - url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.518/' -servers: - - url: '{apiRoot}/namf-comm/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in subclause subclause 4.4 of 3GPP TS 29.501 -paths: - /ue-contexts/{ueContextId}: - put: - summary: Namf_Communication CreateUEContext service Operation - tags: - - Individual ueContext (Document) - operationId: CreateUEContext - parameters: - - name: ueContextId - in: path - description: UE Context Identifier - required: true - schema: - type: string - pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' - requestBody: - content: - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/UeContextCreateData' - binaryDataN2Information: - type: string - format: binary - binaryDataN2InformationExt1: - type: string - format: binary - binaryDataN2InformationExt2: - type: string - format: binary - binaryDataN2InformationExt3: - type: string - format: binary - binaryDataN2InformationExt4: - type: string - format: binary - binaryDataN2InformationExt5: - type: string - format: binary - binaryDataN2InformationExt6: - type: string - format: binary - binaryDataN2InformationExt7: - type: string - format: binary - binaryDataN2InformationExt8: - type: string - format: binary - binaryDataN2InformationExt9: - type: string - format: binary - binaryDataN2InformationExt10: - type: string - format: binary - binaryDataN2InformationExt11: - type: string - format: binary - binaryDataN2InformationExt12: - type: string - format: binary - binaryDataN2InformationExt13: - type: string - format: binary - binaryDataN2InformationExt14: - type: string - format: binary - binaryDataN2InformationExt15: - type: string - format: binary - binaryDataN2InformationExt16: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN2Information: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt1: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt2: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt3: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt4: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt5: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt6: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt7: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt8: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt9: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt10: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt11: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt12: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt13: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt14: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt15: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt16: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - required: true - callbacks: - onN2MessageNotify: - '{$request.body#/n2NotifyUri}': - post: - summary: Namf_Communication N2 Info Notify (UE Specific) service Operation - tags: - - N2 Info Notify - operationId: N2InfoNotify - requestBody: - description: UE Specific N2 Information Notification - content: - application/json: - schema: - $ref: '#/components/schemas/N2InformationNotification' - responses: - '200': - description: N2 Information Notification Response. - content: - application/json: - schema: - $ref: '#/components/schemas/N2InfoNotificationRspData' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/N2InfoNotificationRspData' - binaryDataN2Information: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN2Information: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - '204': - description: Expected response to a successful callback processing - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - responses: - '201': - description: UE context successfully created. - headers: - Location: - description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-comm//ue-contexts/{ueContextId}' - required: true - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/UeContextCreatedData' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/UeContextCreatedData' - binaryDataN2Information: - type: string - format: binary - binaryDataN2InformationExt1: - type: string - format: binary - binaryDataN2InformationExt2: - type: string - format: binary - binaryDataN2InformationExt3: - type: string - format: binary - binaryDataN2InformationExt4: - type: string - format: binary - binaryDataN2InformationExt5: - type: string - format: binary - binaryDataN2InformationExt6: - type: string - format: binary - binaryDataN2InformationExt7: - type: string - format: binary - binaryDataN2InformationExt8: - type: string - format: binary - binaryDataN2InformationExt9: - type: string - format: binary - binaryDataN2InformationExt10: - type: string - format: binary - binaryDataN2InformationExt11: - type: string - format: binary - binaryDataN2InformationExt12: - type: string - format: binary - binaryDataN2InformationExt13: - type: string - format: binary - binaryDataN2InformationExt14: - type: string - format: binary - binaryDataN2InformationExt15: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN2Information: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt1: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt2: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt3: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt4: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt5: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt6: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt7: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt8: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt9: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt10: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt11: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt12: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt13: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt14: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt15: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/UeContextCreateError' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/UeContextCreateError' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - description: Internal Server Error - content: - application/json: - schema: - $ref: '#/components/schemas/UeContextCreateError' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - description: Unexpected error - /ue-contexts/{ueContextId}/release: - post: - summary: Namf_Communication ReleaseUEContext service Operation - tags: - - Individual ueContext (Document) - operationId: ReleaseUEContext - parameters: - - name: ueContextId - in: path - description: UE Context Identifier - required: true - schema: - type: string - pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UEContextRelease' - required: true - responses: - '204': - description: UE Context successfully released - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - description: Unexpected error - /ue-contexts/{ueContextId}/assign-ebi: - post: - summary: Namf_Communication EBI Assignment service Operation - tags: - - Individual ueContext (Document) - operationId: EBIAssignment - parameters: - - name: ueContextId - in: path - description: UE Context Identifier - required: true - schema: - type: string - pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/AssignEbiData' - required: true - responses: - '200': - description: EBI Assignment successfully performed. - content: - application/json: - schema: - $ref: '#/components/schemas/AssignedEbiData' - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/AssignEbiError' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/AssignEbiError' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - description: Internal Server Error - content: - application/json: - schema: - $ref: '#/components/schemas/AssignEbiError' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - description: Unexpected error - /ue-contexts/{ueContextId}/transfer: - post: - summary: Namf_Communication UEContextTransfer service Operation - tags: - - Individual ueContext (Document) - operationId: UEContextTransfer - parameters: - - name: ueContextId - in: path - description: UE Context Identifier - required: true - schema: - type: string - pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UeContextTransferReqData' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/UeContextTransferReqData' - binaryDataN1Message: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1Message: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - required: true - responses: - '200': - description: UE context transfer successfully initiated. - content: - application/json: - schema: - $ref: '#/components/schemas/UeContextTransferRspData' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/UeContextTransferRspData' - binaryDataN2Information: - type: string - format: binary - binaryDataN2InformationExt1: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN2Information: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - binaryDataN2InformationExt1: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - description: Unexpected error - /ue-contexts/{ueContextId}/transfer-update: - post: - summary: Namf_Communication RegistrationStatusUpdate service Operation - tags: - - Individual ueContext (Document) - operationId: RegistrationStatusUpdate - parameters: - - name: ueContextId - in: path - description: UE Context Identifier - required: true - schema: - type: string - pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UeRegStatusUpdateReqData' - required: true - responses: - '200': - description: UE context transfer status successfully updated. - content: - application/json: - schema: - $ref: '#/components/schemas/UeRegStatusUpdateRspData' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - /ue-contexts/{ueContextId}/n1-n2-messages: - post: - summary: Namf_Communication N1N2 Message Transfer (UE Specific) service Operation - tags: - - n1N2Message collection (Document) - operationId: N1N2MessageTransfer - parameters: - - name: ueContextId - in: path - description: UE Context Identifier - required: true - schema: - type: string - pattern: '^(imsi-[0-9]{5,15}|nai-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|cid-.{1,255}|.+)$' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/N1N2MessageTransferReqData' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/N1N2MessageTransferReqData' - binaryDataN1Message: - type: string - format: binary - binaryDataN2Information: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1Message: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - binaryDataN2Information: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - required: true - responses: - '202': - description: N1N2 Message Transfer accepted. - content: - application/json: - schema: - $ref: '#/components/schemas/N1N2MessageTransferRspData' - '200': - description: N1N2 Message Transfer successfully initiated. - content: - application/json: - schema: - $ref: '#/components/schemas/N1N2MessageTransferRspData' - '307': - description: Temporary Redirect - content: - application/problem+json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - headers: - Location: - description: 'The URI of the resource located on the target NF Service Consumer (e.g. AMF) to which the request is redirected' - required: true - schema: - type: string - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '409': - description: Conflicts - content: - application/json: - schema: - $ref: '#/components/schemas/N1N2MessageTransferError' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - '504': - description: Gateway Timeout - content: - application/json: - schema: - $ref: '#/components/schemas/N1N2MessageTransferError' - default: - description: Unexpected error - callbacks: - onN1N2TransferFailure: - '{$request.body#/n1n2FailureTxfNotifURI}': - post: - summary: Namf_Communication N1N2Transfer Failure Notification service Operation - tags: - - N1N2 Transfer Failure Notification - operationId: N1N2TransferFailureNotification - requestBody: - description: N1N2Transfer Failure Notification - content: - application/json: - schema: - $ref: '#/components/schemas/N1N2MsgTxfrFailureNotification' - responses: - '204': - description: Expected response to a successful callback processing - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - /ue-contexts/{ueContextId}/n1-n2-messages/subscriptions: - post: - summary: Namf_Communication N1N2 Message Subscribe (UE Specific) service Operation - tags: - - N1N2 Subscriptions Collection for Individual UE Contexts (Document) - operationId: N1N2MessageSubscribe - parameters: - - name: ueContextId - in: path - description: UE Context Identifier - required: true - schema: - type: string - pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UeN1N2InfoSubscriptionCreateData' - required: true - responses: - '201': - description: N1N2 Message Subscription successfully created. - headers: - Location: - description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-comm//{ueContextId}/n1-n2-messages/subscriptions/{subscriptionId}' - required: true - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/UeN1N2InfoSubscriptionCreatedData' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - description: Unexpected error - callbacks: - onN1N2MessageNotify: - '{$request.body#/n1NotifyCallbackUri}': - post: - summary: Namf_Communication N1 Message Notify service Operation - tags: - - N1 Message Notify - operationId: N1MessageNotify - requestBody: - description: N1 Message Notification - content: - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/N1MessageNotification' - binaryDataN1Message: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1Message: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - responses: - '204': - description: Expected response to a successful callback processing - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - '{$request.body#/n2NotifyCallbackUri}': - post: - summary: Namf_Communication N2 Info Notify (UE Specific) service Operation - tags: - - N2 Info Notify - operationId: N2InfoNotify - requestBody: - description: UE Specific N2 Informaiton Notification - content: - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/N2InformationNotification' - binaryDataN1Message: - type: string - format: binary - binaryDataN2Information: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN1Message: - contentType: application/vnd.3gpp.5gnas - headers: - Content-Id: - schema: - type: string - binaryDataN2Information: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - responses: - '204': - description: Expected response to a successful callback processing - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - /ue-contexts/{ueContextId}/n1-n2-messages/subscriptions/{subscriptionId}: - delete: - summary: Namf_Communication N1N2 Message UnSubscribe (UE Specific) service Operation - tags: - - N1N2 Individual Subscription (Document) - operationId: N1N2MessageUnSubscribe - parameters: - - name: ueContextId - in: path - description: UE Context Identifier - required: true - schema: - type: string - pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' - - name: subscriptionId - in: path - description: Subscription Identifier - required: true - schema: - type: string - responses: - '204': - description: N1N2 Message Subscription successfully removed. - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - /non-ue-n2-messages/transfer: - post: - summary: Namf_Communication Non UE N2 Message Transfer service Operation - tags: - - Non UE N2Messages collection (Document) - operationId: NonUeN2MessageTransfer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/N2InformationTransferReqData' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/N2InformationTransferReqData' - binaryDataN2Information: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN2Information: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - required: true - responses: - '200': - description: Non UE N2 Message Transfer successfully initiated. - content: - application/json: - schema: - $ref: '#/components/schemas/N2InformationTransferRspData' - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/N2InformationTransferError' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/N2InformationTransferError' - '404': - description: Not Found - content: - application/json: - schema: - $ref: '#/components/schemas/N2InformationTransferError' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - description: Internal Server Error - content: - application/json: - schema: - $ref: '#/components/schemas/N2InformationTransferError' - '503': - description: Service Unavailable - content: - application/json: - schema: - $ref: '#/components/schemas/N2InformationTransferError' - default: - description: Unexpected error - /non-ue-n2-messages/subscriptions: - post: - summary: Namf_Communication Non UE N2 Info Subscribe service Operation - tags: - - Non UE N2Messages Subscriptions collection (Document) - operationId: NonUeN2InfoSubscribe - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/NonUeN2InfoSubscriptionCreateData' - required: true - responses: - '201': - description: Non UE N2 Info Subscription successfully created. - headers: - Location: - description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-comm//non-ue-n2-messages/subscriptions/{n2NotifySubscriptionId}' - required: true - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/NonUeN2InfoSubscriptionCreatedData' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - description: Unexpected error - callbacks: - onN2InfoNotify: - '{$request.body#/n2NotifyCallbackUri}': - post: - summary: Namf_Communication Non UE N2 Info Notify service Operation - tags: - - Non UE N2 Info Notify - operationId: NonUeN2InfoNotify - requestBody: - description: Non UE N2 Informaiton Notification - content: - application/json: - schema: - $ref: '#/components/schemas/N2InformationNotification' - multipart/related: # message with binary body part(s) - schema: - type: object - properties: # Request parts - jsonData: - $ref: '#/components/schemas/N2InformationNotification' - binaryDataN2Information: - type: string - format: binary - encoding: - jsonData: - contentType: application/json - binaryDataN2Information: - contentType: application/vnd.3gpp.ngap - headers: - Content-Id: - schema: - type: string - responses: - '204': - description: Expected response to a successful callback processing - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - /non-ue-n2-messages/subscriptions/{n2NotifySubscriptionId}: - delete: - summary: Namf_Communication Non UE N2 Info UnSubscribe service Operation - tags: - - Non UE N2 Message Notification Individual Subscription (Document) - operationId: NonUeN2InfoUnSubscribe - parameters: - - name: n2NotifySubscriptionId - in: path - description: N2 info Subscription Identifier - required: true - schema: - type: string - responses: - '204': - description: Non UE N2 INfo Subscription successfully removed. - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - /subscriptions: - post: - summary: Namf_Communication AMF Status Change Subscribe service Operation - tags: - - subscriptions collection (Document) - operationId: AMFStatusChangeSubscribe - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SubscriptionData' - required: true - responses: - '201': - description: N1N2 Message Subscription successfully created. - headers: - Location: - description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-comm//subscriptions/{subscriptionId}' - required: true - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/SubscriptionData' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - description: Unexpected error - callbacks: - onAmfStatusChange: - '{$request.body#/amfStatusUri}': - post: - summary: Amf Status Change Notify service Operation - tags: - - Amf Status Change Notify - operationId: AmfStatusChangeNotify - requestBody: - description: Amf Status Change Notification - content: - application/json: - schema: - $ref: '#/components/schemas/AmfStatusChangeNotification' - responses: - '204': - description: Expected response to a successful callback processing - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - /subscriptions/{subscriptionId}: - delete: - summary: Namf_Communication AMF Status Change UnSubscribe service Operation - tags: - - individual subscription (Document) - operationId: AMFStatusChangeUnSubscribe - parameters: - - name: subscriptionId - in: path - description: AMF Status Change Subscription Identifier - required: true - schema: - type: string - responses: - '204': - description: N1N2 Message Subscription successfully removed. - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - description: Unexpected error - put: - summary: Namf_Communication AMF Status Change Subscribe Modify service Operation - tags: - - individual subscription (Document) - operationId: AMFStatusChangeSubscribeModfy - parameters: - - name: subscriptionId - in: path - description: AMF Status Change Subscription Identifier - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SubscriptionData' - required: true - responses: - '202': - description: N1N2 Message Subscription successfully updated. - content: - application/json: - schema: - $ref: '#/components/schemas/SubscriptionData' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - description: Unexpected error - callbacks: - OnAmfStatusChange: - '{$request.body#/amfStatusUri}': - post: - summary: Amf Status Change Notify service Operation - tags: - - Amf Status Change Notify - operationId: AmfStatusChangeNOtify - requestBody: - description: Amf Status Change Notification - content: - application/json: - schema: - $ref: '#/components/schemas/AmfStatusChangeNotification' - responses: - '204': - description: Expected response to a successful callback processing - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' -components: - securitySchemes: - oAuth2ClientCredentials: - type: oauth2 - flows: - clientCredentials: - tokenUrl: '{nrfApiRoot}/oauth2/token' - scopes: - namf-comm: Access to the Namf_Communication API - schemas: -# -# STRUCTURED DATA TYPES -# - SubscriptionData: - type: object - properties: - amfStatusUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - guamiList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' - minItems: 1 - required: - - amfStatusUri - AmfStatusChangeNotification: - type: object - properties: - amfStatusInfoList: - type: array - items: - $ref: '#/components/schemas/AmfStatusInfo' - minItems: 1 - required: - - amfStatusInfoList - AmfStatusInfo: - type: object - properties: - guamiList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' - minItems: 1 - statusChange: - $ref: '#/components/schemas/StatusChange' - targetAmfRemoval: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfName' - targetAmfFailure: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfName' - required: - - guamiList - - statusChange - AssignEbiData: - type: object - properties: - pduSessionId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' - arpList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' - minItems: 1 - releasedEbiList: - type: array - items: - $ref: '#/components/schemas/EpsBearerId' - minItems: 1 - required: - - pduSessionId - AssignedEbiData: - type: object - properties: - pduSessionId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' - assignedEbiList: - type: array - items: - $ref: 'TS29502_Nsmf_PDUSession.yaml#/components/schemas/EbiArpMapping' - minItems: 0 - failedArpList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' - minItems: 1 - releasedEbiList: - type: array - items: - $ref: '#/components/schemas/EpsBearerId' - minItems: 1 - required: - - pduSessionId - - assignedEbiList - AssignEbiFailed: - type: object - properties: - pduSessionId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' - failedArpList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' - minItems: 1 - required: - - pduSessionId - UEContextRelease: - type: object - properties: - supi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - unauthenticatedSupi: - type: boolean - default: false - ngapCause: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' - required: - - ngapCause - N2InformationTransferReqData: - type: object - properties: - taiList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' - minItems: 1 - ratSelector: - $ref: '#/components/schemas/RatSelector' - ecgiList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' - minItems: 1 - ncgiList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' - minItems: 1 - globalRanNodeList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' - minItems: 1 - n2Information: - $ref: '#/components/schemas/N2InfoContainer' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - n2Information - NonUeN2InfoSubscriptionCreateData: - type: object - properties: - globalRanNodeList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' - minItems: 1 - anTypeList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - minItems: 1 - n2InformationClass: - $ref: '#/components/schemas/N2InformationClass' - n2NotifyCallbackUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - nfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - n2InformationClass - - n2NotifyCallbackUri - NonUeN2InfoSubscriptionCreatedData: - type: object - properties: - n2NotifySubscriptionId: - type: string - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - n2NotifySubscriptionId - UeN1N2InfoSubscriptionCreateData: - type: object - properties: - n2InformationClass: - $ref: '#/components/schemas/N2InformationClass' - n2NotifyCallbackUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - n1MessageClass: - $ref: '#/components/schemas/N1MessageClass' - n1NotifyCallbackUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - nfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - UeN1N2InfoSubscriptionCreatedData: - type: object - properties: - n1n2NotifySubscriptionId: - type: string - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - n1n2NotifySubscriptionId - N2InformationNotification: - type: object - properties: - n2NotifySubscriptionId: - type: string - n2InfoContainer: - $ref: '#/components/schemas/N2InfoContainer' - toReleaseSessionList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' - minItems: 1 - lcsCorrelationId: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CorrelationID' - notifyReason: - $ref: '#/components/schemas/N2InfoNotifyReason' - smfChangeInd: - $ref: '#/components/schemas/SmfChangeIndication' - required: - - n2NotifySubscriptionId - N2InfoContainer: - type: object - properties: - n2InformationClass: - $ref: '#/components/schemas/N2InformationClass' - smInfo: - $ref: '#/components/schemas/N2SmInformation' - ranInfo: - $ref: '#/components/schemas/N2RanInformation' - nrppaInfo: - $ref: '#/components/schemas/NrppaInformation' - pwsInfo: - $ref: '#/components/schemas/PwsInformation' - required: - - n2InformationClass - N1MessageNotification: - type: object - properties: - n1NotifySubscriptionId: - type: string - n1MessageContainer: - $ref: '#/components/schemas/N1MessageContainer' - lcsCorrelationId: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CorrelationID' - registrationCtxtContainer: - $ref: '#/components/schemas/RegistrationContextContainer' - required: - - n1MessageContainer - N1MessageContainer: - type: object - properties: - n1MessageClass: - $ref: '#/components/schemas/N1MessageClass' - n1MessageContent: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' - nfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - serviceInstanceId: - type: string - required: - - n1MessageClass - - n1MessageContent - N1N2MessageTransferReqData: - type: object - properties: - n1MessageContainer: - $ref: '#/components/schemas/N1MessageContainer' - n2InfoContainer: - $ref: '#/components/schemas/N2InfoContainer' - skipInd: - type: boolean - default: false - lastMsgIndication: - type: boolean - pduSessionId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' - lcsCorrelationId: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CorrelationID' - ppi: - $ref: '#/components/schemas/Ppi' - arp: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' - 5qi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/5Qi' - n1n2FailureTxfNotifURI: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - smfReallocationInd: - type: boolean - default: false - areaOfValidity: - $ref: '#/components/schemas/AreaOfValidity' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - N1N2MessageTransferRspData: - type: object - properties: - cause: - $ref: '#/components/schemas/N1N2MessageTransferCause' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - cause - RegistrationContextContainer: - type: object - properties: - ueContext: - $ref: '#/components/schemas/UeContext' - localTimeZone: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' - anType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - anN2ApId: - type: integer - ranNodeId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' - initialAmfName: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfName' - userLocation: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - rrcEstCause: - type: string - pattern: '^[0-9a-fA-F]+$' - ueContextRequest: - type: boolean - default: false - anN2IPv4Addr: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' - anN2IPv6Addr: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' - allowedNssai: - $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/AllowedNssai' - configuredNssai: - type: array - items: - $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/ConfiguredSnssai' - minItems: 1 - rejectedNssaiInPlmn: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - minItems: 1 - rejectedNssaiInTa: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - minItems: 1 - required: - - ueContext - - anType - - anN2ApId - - ranNodeId - - initialAmfName - - userLocation - AreaOfValidity: - type: object - properties: - taiList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' - minItems: 0 - required: - - taiList - UeContextTransferReqData: - type: object - properties: - reason: - $ref: '#/components/schemas/TransferReason' - accessType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - plmnId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' - regRequest: - $ref: '#/components/schemas/N1MessageContainer' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - reason - - accessType - UeContextTransferRspData: - type: object - properties: - ueContext: - $ref: '#/components/schemas/UeContext' - ueRadioCapability: - $ref: '#/components/schemas/N2InfoContent' - ueNbiotRadioCapability: - $ref: '#/components/schemas/N2InfoContent' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - ueContext - UeContext: - type: object - properties: - supi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - supiUnauthInd: - type: boolean - gpsiList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' - minItems: 1 - pei: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' - udmGroupId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' - ausfGroupId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' - routingIndicator: - type: string - groupList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' - minItems: 1 - drxParameter: - $ref: '#/components/schemas/DrxParameter' - subRfsp: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndex' - usedRfsp: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndex' - subUeAmbr: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' - smsSupport: - $ref: '#/components/schemas/SmsSupport' - smsfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - seafData: - $ref: '#/components/schemas/SeafData' - 5gMmCapability: - $ref: '#/components/schemas/5GMmCapability' - pcfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - pcfAmPolicyUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - amPolicyReqTriggerList: - type: array - items: - $ref: '#/components/schemas/PolicyReqTrigger' - minItems: 1 - pcfUePolicyUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - uePolicyReqTriggerList: - type: array - items: - $ref: '#/components/schemas/PolicyReqTrigger' - minItems: 1 - hpcfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - restrictedRatList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' - minItems: 1 - forbiddenAreaList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Area' - minItems: 1 - serviceAreaRestriction: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' - restrictedCoreNwTypeList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/CoreNetworkType' - minItems: 1 - eventSubscriptionList: - type: array - items: - $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/AmfEventSubscription' - minItems: 1 - mmContextList: - type: array - items: - $ref: '#/components/schemas/MmContext' - minItems: 1 - maxItems: 2 - sessionContextList: - type: array - items: - $ref: '#/components/schemas/PduSessionContext' - minItems: 1 - traceData: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' - remainingServiceGapTimer: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' - N2SmInformation: - type: object - properties: - pduSessionId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' - n2InfoContent: - $ref: '#/components/schemas/N2InfoContent' - sNssai: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - homePlmnSnssai: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - subjectToHo: - type: boolean - required: - - pduSessionId - N2InfoContent: - type: object - properties: - ngapMessageType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' - ngapIeType: - $ref: '#/components/schemas/NgapIeType' - ngapData: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' - required: - - ngapData - NrppaInformation: - type: object - properties: - nfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - nrppaPdu: - $ref: '#/components/schemas/N2InfoContent' - serviceInstanceId: - type: string - required: - - nfId - - nrppaPdu - PwsInformation: - type: object - properties: - messageIdentifier: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint16' - serialNumber: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint16' - pwsContainer: - $ref: '#/components/schemas/N2InfoContent' - sendRanResponse: - type: boolean - default: false - omcId: - $ref: '#/components/schemas/OmcIdentifier' - required: - - messageIdentifier - - serialNumber - - pwsContainer - N1N2MsgTxfrFailureNotification: - type: object - properties: - cause: - $ref: '#/components/schemas/N1N2MessageTransferCause' - n1n2MsgDataUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - required: - - cause - - n1n2MsgDataUri - N1N2MessageTransferError: - type: object - properties: - error: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - errInfo: - $ref: '#/components/schemas/N1N2MsgTxfrErrDetail' - required: - - error - N1N2MsgTxfrErrDetail: - type: object - properties: - retryAfter: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' - highestPrioArp: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' - N2InformationTransferRspData: - type: object - properties: - result: - $ref: '#/components/schemas/N2InformationTransferResult' - pwsRspData: - $ref: '#/components/schemas/PWSResponseData' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - result - MmContext: - type: object - properties: - accessType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - nasSecurityMode: - $ref: '#/components/schemas/NasSecurityMode' - nasDownlinkCount: - $ref: '#/components/schemas/NasCount' - nasUplinkCount: - $ref: '#/components/schemas/NasCount' - ueSecurityCapability: - $ref: '#/components/schemas/UeSecurityCapability' - s1UeNetworkCapability: - $ref: '#/components/schemas/S1UeNetworkCapability' - allowedNssai: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - minItems: 1 - nssaiMappingList: - type: array - items: - $ref: '#/components/schemas/NssaiMapping' - minItems: 1 - nsInstanceList: - type: array - items: - $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/NsiId' - minItems: 1 - expectedUEbehavior: - $ref: '#/components/schemas/ExpectedUeBehavior' - required: - - accessType - SeafData: - type: object - properties: - ngKsi: - $ref: '#/components/schemas/NgKsi' - keyAmf: - $ref: '#/components/schemas/KeyAmf' - nh: - type: string - pattern: '^[A-Fa-f0-9]+$' - ncc: - type: integer - minimum: 0 - maximum: 7 - keyAmfChangeInd: - type: boolean - keyAmfHDerivationInd: - type: boolean - required: - - ngKsi - - keyAmf - NasSecurityMode: - type: object - properties: - integrityAlgorithm: - $ref: '#/components/schemas/IntegrityAlgorithm' - cipheringAlgorithm: - $ref: '#/components/schemas/CipheringAlgorithm' - required: - - integrityAlgorithm - - cipheringAlgorithm - PduSessionContext: - type: object - properties: - pduSessionId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' - smContextRef: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - sNssai: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - dnn: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' - accessType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - allocatedEbiList: - type: array - items: - $ref: 'TS29502_Nsmf_PDUSession.yaml#/components/schemas/EbiArpMapping' - minItems: 1 - hsmfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - vsmfId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - nsInstance: - $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/NsiId' - smfServiceInstanceId: - type: string - required: - - pduSessionId - - smContextRef - - sNssai - - dnn - - accessType - NssaiMapping: - type: object - properties: - mappedSnssai: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - hSnssai: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' - required: - - mappedSnssai - - hSnssai - UeRegStatusUpdateReqData: - type: object - properties: - transferStatus: - $ref: '#/components/schemas/UeContextTransferStatus' - toReleaseSessionList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' - minItems: 1 - pcfReselectedInd: - type: boolean - required: - - transferStatus - UeRegStatusUpdateRspData: - type: object - properties: - regStatusTransferComplete: - type: boolean - required: - - regStatusTransferComplete - AssignEbiError: - type: object - properties: - error: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - failureDetails: - $ref: '#/components/schemas/AssignEbiFailed' - required: - - error - - failureDetails - UeContextCreateData: - type: object - properties: - ueContext: - $ref: '#/components/schemas/UeContext' - targetId: - $ref: '#/components/schemas/NgRanTargetId' - sourceToTargetData: - $ref: '#/components/schemas/N2InfoContent' - pduSessionList: - type: array - items: - $ref: '#/components/schemas/N2SmInformation' - minItems: 1 - mmeControlFteid: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' - n2NotifyUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - ueRadioCapability: - $ref: '#/components/schemas/N2InfoContent' - ngapCause: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - ueContext - - targetId - - sourceToTargetData - - pduSessionList - UeContextCreatedData: - type: object - properties: - ueContext: - $ref: '#/components/schemas/UeContext' - targetToSourceData: - $ref: '#/components/schemas/N2InfoContent' - pduSessionList: - type: array - items: - $ref: '#/components/schemas/N2SmInformation' - minItems: 1 - failedSessionList: - type: array - items: - $ref: '#/components/schemas/N2SmInformation' - minItems: 1 - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - pcfReselectedInd: - type: boolean - required: - - ueContext - - targetToSourceData - - pduSessionList - UeContextCreateError: - type: object - properties: - error: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - ngapCause: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' - required: - - error - NgRanTargetId: - type: object - properties: - ranNodeId: - $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' - tai: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' - required: - - ranNodeId - - tai - PWSResponseData: - type: object - properties: - ngapMessageType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' - serialNumber: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint16' - messageIdentifier: - type: integer - unknownTaiList: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' - minItems: 1 - required: - - ngapMessageType - - serialNumber - - messageIdentifier - PWSErrorData: - type: object - properties: - namfCause: - type: integer - required: - - namfCause - N2InformationTransferError: - type: object - properties: - error: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - pwdErrorInfo: - $ref: '#/components/schemas/PWSErrorData' - required: - - error - NgKsi: - type: object - properties: - tsc: - $ref: '#/components/schemas/ScType' - ksi: - type: integer - minimum: 0 - maximum: 6 - required: - - tsc - - ksi - KeyAmf: - type: object - properties: - keyType: - $ref: '#/components/schemas/KeyAmfType' - keyVal: - type: string - required: - - keyType - - keyVal - ExpectedUeBehavior: - type: object - properties: - expMoveTrajectory: - type: array - items: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - minItems: 1 - validityTime: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - required: - - expMoveTrajectory - - validityTime - N2RanInformation: - type: object - properties: - n2InfoContent: - $ref: '#/components/schemas/N2InfoContent' - required: - - n2InfoContent - N2InfoNotificationRspData: - type: object - properties: - n2InfoContent: - $ref: '#/components/schemas/N2InfoContent' -# -# SIMPLE DATA TYPES -# - EpsBearerId: - type: integer - minimum: 0 - maximum: 15 - Ppi: - type: integer - minimum: 0 - maximum: 7 - NasCount: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' - 5GMmCapability: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' - UeSecurityCapability: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' - S1UeNetworkCapability: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' - DrxParameter: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' - OmcIdentifier: - type: string - -# -# ENUMERATIONS -# - StatusChange: - anyOf: - - type: string - enum: - - AMF_UNAVAILABLE - - AMF_AVAILABLE - - type: string - N2InformationClass: - anyOf: - - type: string - enum: - - SM - - NRPPa - - PWS - - PWS-BCAL - - PWS-RF - - RAN - - type: string - N1MessageClass: - anyOf: - - type: string - enum: - - 5GMM - - SM - - LPP - - SMS - - UPDP - - type: string - N1N2MessageTransferCause: - anyOf: - - type: string - enum: - - ATTEMPTING_TO_REACH_UE - - N1_N2_TRANSFER_INITIATED - - WAITING_FOR_ASYNCHRONOUS_TRANSFER - - UE_NOT_RESPONDING - - N1_MSG_NOT_TRANSFERRED - - UE_NOT_REACHABLE_FOR_SESSION - - type: string - UeContextTransferStatus: - anyOf: - - type: string - enum: - - TRANSFERRED - - NOT_TRANSFERRED - - type: string - N2InformationTransferResult: - anyOf: - - type: string - enum: - - N2_INFO_TRANSFER_INITIATED - - type: string - CipheringAlgorithm: - anyOf: - - type: string - enum: - - NEA0 - - NEA1 - - NEA2 - - NEA3 - - type: string - IntegrityAlgorithm: - anyOf: - - type: string - enum: - - NIA0 - - NIA1 - - NIA2 - - NIA3 - - type: string - SmsSupport: - anyOf: - - type: string - enum: - - 3GPP - - NON_3GPP - - BOTH - - NONE - - type: string - ScType: - anyOf: - - type: string - enum: - - NATIVE - - MAPPED - - type: string - KeyAmfType: - anyOf: - - type: string - enum: - - KAMF - - KPRIMEAMF - - type: string - TransferReason: - anyOf: - - type: string - enum: - - INIT_REG - - MOBI_REG - - MOBI_REG_UE_VALIDATED - - type: string - PolicyReqTrigger: - anyOf: - - type: string - enum: - - LOCATION_CHANGE - - PRA_CHANGE - - SARI_CHANGE - - RFSP_INDEX_CHANGE - - ALLOWED_NSSAI_CHANGE - - type: string - RatSelector: - anyOf: - - type: string - enum: - - E-UTRA - - NR - - type: string - NgapIeType: - anyOf: - - type: string - enum: - - PDU_RES_SETUP_REQ - - PDU_RES_REL_CMD - - PDU_RES_MOD_REQ - - HANDOVER_CMD - - HANDOVER_REQUIRED - - HANDOVER_PREP_FAIL - - SRC_TO_TAR_CONTAINER - - TAR_TO_SRC_CONTAINER - - RAN_STATUS_TRANS_CONTAINER - - SON_CONFIG_TRANSFER - - NRPPA_PDU - - UE_RADIO_CAPABILITY - - type: string - N2InfoNotifyReason: - anyOf: - - type: string - enum: - - HANDOVER_COMPLETED - - type: string - SmfChangeIndication: - anyOf: - - type: string - enum: - - INSERTED - - CHANGED - - REMOVED - - type: string +openapi: 3.0.0 +info: + version: 1.1.0.alpha-4 + title: Namf_Communication + description: | + AMF Communication Service + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +security: + - {} + - oAuth2ClientCredentials: + - namf-comm +externalDocs: + description: 3GPP TS 29.518 V16.3.0; 5G System; Access and Mobility Management Services + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.518/' +servers: + - url: '{apiRoot}/namf-comm/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause clause 4.4 of 3GPP TS 29.501 +paths: + /ue-contexts/{ueContextId}: + put: + summary: Namf_Communication CreateUEContext service Operation + tags: + - Individual ueContext (Document) + operationId: CreateUEContext + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/UeContextCreateData' + binaryDataN2Information: + type: string + format: binary + binaryDataN2InformationExt1: + type: string + format: binary + binaryDataN2InformationExt2: + type: string + format: binary + binaryDataN2InformationExt3: + type: string + format: binary + binaryDataN2InformationExt4: + type: string + format: binary + binaryDataN2InformationExt5: + type: string + format: binary + binaryDataN2InformationExt6: + type: string + format: binary + binaryDataN2InformationExt7: + type: string + format: binary + binaryDataN2InformationExt8: + type: string + format: binary + binaryDataN2InformationExt9: + type: string + format: binary + binaryDataN2InformationExt10: + type: string + format: binary + binaryDataN2InformationExt11: + type: string + format: binary + binaryDataN2InformationExt12: + type: string + format: binary + binaryDataN2InformationExt13: + type: string + format: binary + binaryDataN2InformationExt14: + type: string + format: binary + binaryDataN2InformationExt15: + type: string + format: binary + binaryDataN2InformationExt16: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt1: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt2: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt3: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt4: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt5: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt6: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt7: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt8: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt9: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt10: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt11: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt12: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt13: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt14: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt15: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt16: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + required: true + callbacks: + onN2MessageNotify: + '{$request.body#/n2NotifyUri}': + post: + summary: Namf_Communication N2 Info Notify (UE Specific) service Operation + tags: + - N2 Info Notify + operationId: N2InfoNotify + requestBody: + description: UE Specific N2 Information Notification + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationNotification' + responses: + '200': + description: N2 Information Notification Response. + content: + application/json: + schema: + $ref: '#/components/schemas/N2InfoNotificationRspData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/N2InfoNotificationRspData' + binaryDataN2Information: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '204': + description: Expected response to a successful callback processing + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + responses: + '201': + description: UE context successfully created. + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-comm//ue-contexts/{ueContextId}' + required: true + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextCreatedData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/UeContextCreatedData' + binaryDataN2Information: + type: string + format: binary + binaryDataN2InformationExt1: + type: string + format: binary + binaryDataN2InformationExt2: + type: string + format: binary + binaryDataN2InformationExt3: + type: string + format: binary + binaryDataN2InformationExt4: + type: string + format: binary + binaryDataN2InformationExt5: + type: string + format: binary + binaryDataN2InformationExt6: + type: string + format: binary + binaryDataN2InformationExt7: + type: string + format: binary + binaryDataN2InformationExt8: + type: string + format: binary + binaryDataN2InformationExt9: + type: string + format: binary + binaryDataN2InformationExt10: + type: string + format: binary + binaryDataN2InformationExt11: + type: string + format: binary + binaryDataN2InformationExt12: + type: string + format: binary + binaryDataN2InformationExt13: + type: string + format: binary + binaryDataN2InformationExt14: + type: string + format: binary + binaryDataN2InformationExt15: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt1: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt2: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt3: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt4: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt5: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt6: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt7: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt8: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt9: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt10: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt11: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt12: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt13: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt14: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt15: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextCreateError' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextCreateError' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextCreateError' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /ue-contexts/{ueContextId}/release: + post: + summary: Namf_Communication ReleaseUEContext service Operation + tags: + - Individual ueContext (Document) + operationId: ReleaseUEContext + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UEContextRelease' + required: true + responses: + '204': + description: UE Context successfully released + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /ue-contexts/{ueContextId}/assign-ebi: + post: + summary: Namf_Communication EBI Assignment service Operation + tags: + - Individual ueContext (Document) + operationId: EBIAssignment + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AssignEbiData' + required: true + responses: + '200': + description: EBI Assignment successfully performed. + content: + application/json: + schema: + $ref: '#/components/schemas/AssignedEbiData' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/AssignEbiError' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/AssignEbiError' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/AssignEbiError' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/AssignEbiError' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /ue-contexts/{ueContextId}/transfer: + post: + summary: Namf_Communication UEContextTransfer service Operation + tags: + - Individual ueContext (Document) + operationId: UEContextTransfer + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextTransferReqData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/UeContextTransferReqData' + binaryDataN1Message: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1Message: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + required: true + responses: + '200': + description: UE context transfer successfully initiated. + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextTransferRspData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/UeContextTransferRspData' + binaryDataN2Information: + type: string + format: binary + binaryDataN2InformationExt1: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt1: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /ue-contexts/{ueContextId}/transfer-update: + post: + summary: Namf_Communication RegistrationStatusUpdate service Operation + tags: + - Individual ueContext (Document) + operationId: RegistrationStatusUpdate + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UeRegStatusUpdateReqData' + required: true + responses: + '200': + description: UE context transfer status successfully updated. + content: + application/json: + schema: + $ref: '#/components/schemas/UeRegStatusUpdateRspData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /ue-contexts/{ueContextId}/n1-n2-messages: + post: + summary: Namf_Communication N1N2 Message Transfer (UE Specific) service Operation + tags: + - n1N2Message collection (Document) + operationId: N1N2MessageTransfer + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|cid-.{1,255}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/N1N2MessageTransferReqData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/N1N2MessageTransferReqData' + binaryDataN1Message: + type: string + format: binary + binaryDataN2Information: + type: string + format: binary + binaryMtData: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1Message: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryMtData: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + required: true + responses: + '202': + description: N1N2 Message Transfer accepted. + content: + application/json: + schema: + $ref: '#/components/schemas/N1N2MessageTransferRspData' + headers: + Location: + description: 'The URI of the resource located on the AMF to which the status of the N1N2 message transfer is held' + required: true + schema: + type: string + '200': + description: N1N2 Message Transfer successfully initiated. + content: + application/json: + schema: + $ref: '#/components/schemas/N1N2MessageTransferRspData' + '307': + description: Temporary Redirect + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + headers: + Location: + description: 'The URI of the resource located on the target NF Service Consumer (e.g. AMF) to which the request is redirected' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '409': + description: Conflicts + content: + application/json: + schema: + $ref: '#/components/schemas/N1N2MessageTransferError' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + description: Gateway Timeout + content: + application/json: + schema: + $ref: '#/components/schemas/N1N2MessageTransferError' + default: + description: Unexpected error + callbacks: + onN1N2TransferFailure: + '{$request.body#/n1n2FailureTxfNotifURI}': + post: + summary: Namf_Communication N1N2Transfer Failure Notification service Operation + tags: + - N1N2 Transfer Failure Notification + operationId: N1N2TransferFailureNotification + requestBody: + description: N1N2Transfer Failure Notification + content: + application/json: + schema: + $ref: '#/components/schemas/N1N2MsgTxfrFailureNotification' + responses: + '204': + description: Expected response to a successful callback processing + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + /ue-contexts/{ueContextId}/n1-n2-messages/subscriptions: + post: + summary: Namf_Communication N1N2 Message Subscribe (UE Specific) service Operation + tags: + - N1N2 Subscriptions Collection for Individual UE Contexts (Document) + operationId: N1N2MessageSubscribe + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UeN1N2InfoSubscriptionCreateData' + required: true + responses: + '201': + description: N1N2 Message Subscription successfully created. + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-comm//{ueContextId}/ue-contexts/n1-n2-messages/subscriptions/{subscriptionId}' + required: true + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/UeN1N2InfoSubscriptionCreatedData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + onN1N2MessageNotify: + '{$request.body#/n1NotifyCallbackUri}': + post: + summary: Namf_Communication N1 Message Notify service Operation + tags: + - N1 Message Notify + operationId: N1MessageNotify + requestBody: + description: N1 Message Notification + content: + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/N1MessageNotification' + binaryDataN1Message: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1Message: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + responses: + '204': + description: Expected response to a successful callback processing + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '{$request.body#/n2NotifyCallbackUri}': + post: + summary: Namf_Communication N2 Info Notify (UE Specific) service Operation + tags: + - N2 Info Notify + operationId: N2InfoNotify + requestBody: + description: UE Specific N2 Information Notification + content: + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/N2InformationNotification' + binaryDataN1Message: + type: string + format: binary + binaryDataN2Information: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1Message: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + responses: + '204': + description: Expected response to a successful callback processing + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + /ue-contexts/{ueContextId}/n1-n2-messages/subscriptions/{subscriptionId}: + delete: + summary: Namf_Communication N1N2 Message UnSubscribe (UE Specific) service Operation + tags: + - N1N2 Individual Subscription (Document) + operationId: N1N2MessageUnSubscribe + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + - name: subscriptionId + in: path + description: Subscription Identifier + required: true + schema: + type: string + responses: + '204': + description: N1N2 Message Subscription successfully removed. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + /non-ue-n2-messages/transfer: + post: + summary: Namf_Communication Non UE N2 Message Transfer service Operation + tags: + - Non UE N2Messages collection (Document) + operationId: NonUeN2MessageTransfer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationTransferReqData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/N2InformationTransferReqData' + binaryDataN2Information: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + required: true + responses: + '200': + description: Non UE N2 Message Transfer successfully initiated. + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationTransferRspData' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationTransferError' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationTransferError' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationTransferError' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationTransferError' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationTransferError' + default: + description: Unexpected error + /non-ue-n2-messages/subscriptions: + post: + summary: Namf_Communication Non UE N2 Info Subscribe service Operation + tags: + - Non UE N2Messages Subscriptions collection (Document) + operationId: NonUeN2InfoSubscribe + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NonUeN2InfoSubscriptionCreateData' + required: true + responses: + '201': + description: Non UE N2 Info Subscription successfully created. + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-comm//non-ue-n2-messages/subscriptions/{n2NotifySubscriptionId}' + required: true + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/NonUeN2InfoSubscriptionCreatedData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + onN2InfoNotify: + '{$request.body#/n2NotifyCallbackUri}': + post: + summary: Namf_Communication Non UE N2 Info Notify service Operation + tags: + - Non UE N2 Info Notify + operationId: NonUeN2InfoNotify + requestBody: + description: Non UE N2 Information Notification + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationNotification' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/N2InformationNotification' + binaryDataN2Information: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + responses: + '204': + description: Expected response to a successful callback processing + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + /non-ue-n2-messages/subscriptions/{n2NotifySubscriptionId}: + delete: + summary: Namf_Communication Non UE N2 Info UnSubscribe service Operation + tags: + - Non UE N2 Message Notification Individual Subscription (Document) + operationId: NonUeN2InfoUnSubscribe + parameters: + - name: n2NotifySubscriptionId + in: path + description: N2 info Subscription Identifier + required: true + schema: + type: string + responses: + '204': + description: Non UE N2 INfo Subscription successfully removed. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + /subscriptions: + post: + summary: Namf_Communication AMF Status Change Subscribe service Operation + tags: + - subscriptions collection (Document) + operationId: AMFStatusChangeSubscribe + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionData' + required: true + responses: + '201': + description: N1N2 Message Subscription successfully created. + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-comm//subscriptions/{subscriptionId}' + required: true + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + onAmfStatusChange: + '{$request.body#/amfStatusUri}': + post: + summary: Amf Status Change Notify service Operation + tags: + - Amf Status Change Notify + operationId: AmfStatusChangeNotify + requestBody: + description: Amf Status Change Notification + content: + application/json: + schema: + $ref: '#/components/schemas/AmfStatusChangeNotification' + responses: + '204': + description: Expected response to a successful callback processing + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + /subscriptions/{subscriptionId}: + delete: + summary: Namf_Communication AMF Status Change UnSubscribe service Operation + tags: + - individual subscription (Document) + operationId: AMFStatusChangeUnSubscribe + parameters: + - name: subscriptionId + in: path + description: AMF Status Change Subscription Identifier + required: true + schema: + type: string + responses: + '204': + description: N1N2 Message Subscription successfully removed. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + put: + summary: Namf_Communication AMF Status Change Subscribe Modify service Operation + tags: + - individual subscription (Document) + operationId: AMFStatusChangeSubscribeModfy + parameters: + - name: subscriptionId + in: path + description: AMF Status Change Subscription Identifier + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionData' + required: true + responses: + '202': + description: N1N2 Message Subscription successfully updated. + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + OnAmfStatusChange: + '{$request.body#/amfStatusUri}': + post: + summary: Amf Status Change Notify service Operation + tags: + - Amf Status Change Notify + operationId: AmfStatusChangeNOtify + requestBody: + description: Amf Status Change Notification + content: + application/json: + schema: + $ref: '#/components/schemas/AmfStatusChangeNotification' + responses: + '204': + description: Expected response to a successful callback processing + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + namf-comm: Access to the Namf_Communication API + schemas: +# +# STRUCTURED DATA TYPES +# + SubscriptionData: + type: object + properties: + amfStatusUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + guamiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + minItems: 1 + required: + - amfStatusUri + AmfStatusChangeNotification: + type: object + properties: + amfStatusInfoList: + type: array + items: + $ref: '#/components/schemas/AmfStatusInfo' + minItems: 1 + required: + - amfStatusInfoList + AmfStatusInfo: + type: object + properties: + guamiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + minItems: 1 + statusChange: + $ref: '#/components/schemas/StatusChange' + targetAmfRemoval: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfName' + targetAmfFailure: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfName' + required: + - guamiList + - statusChange + AssignEbiData: + type: object + properties: + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + arpList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + minItems: 1 + releasedEbiList: + type: array + items: + $ref: '#/components/schemas/EpsBearerId' + minItems: 1 + oldGuami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + required: + - pduSessionId + AssignedEbiData: + type: object + properties: + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + assignedEbiList: + type: array + items: + $ref: 'TS29502_Nsmf_PDUSession.yaml#/components/schemas/EbiArpMapping' + minItems: 0 + failedArpList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + minItems: 1 + releasedEbiList: + type: array + items: + $ref: '#/components/schemas/EpsBearerId' + minItems: 1 + required: + - pduSessionId + - assignedEbiList + AssignEbiFailed: + type: object + properties: + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + failedArpList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + minItems: 1 + required: + - pduSessionId + UEContextRelease: + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + unauthenticatedSupi: + type: boolean + default: false + ngapCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + required: + - ngapCause + N2InformationTransferReqData: + type: object + properties: + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + ratSelector: + $ref: '#/components/schemas/RatSelector' + globalRanNodeList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + minItems: 1 + n2Information: + $ref: '#/components/schemas/N2InfoContainer' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - n2Information + NonUeN2InfoSubscriptionCreateData: + type: object + properties: + globalRanNodeList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + minItems: 1 + anTypeList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + minItems: 1 + n2InformationClass: + $ref: '#/components/schemas/N2InformationClass' + n2NotifyCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - n2InformationClass + - n2NotifyCallbackUri + NonUeN2InfoSubscriptionCreatedData: + type: object + properties: + n2NotifySubscriptionId: + type: string + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + n2InformationClass: + $ref: '#/components/schemas/N2InformationClass' + required: + - n2NotifySubscriptionId + UeN1N2InfoSubscriptionCreateData: + type: object + properties: + n2InformationClass: + $ref: '#/components/schemas/N2InformationClass' + n2NotifyCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + n1MessageClass: + $ref: '#/components/schemas/N1MessageClass' + n1NotifyCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + oldGuami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + UeN1N2InfoSubscriptionCreatedData: + type: object + properties: + n1n2NotifySubscriptionId: + type: string + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - n1n2NotifySubscriptionId + N2InformationNotification: + type: object + properties: + n2NotifySubscriptionId: + type: string + n2InfoContainer: + $ref: '#/components/schemas/N2InfoContainer' + toReleaseSessionList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + minItems: 1 + lcsCorrelationId: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CorrelationID' + notifyReason: + $ref: '#/components/schemas/N2InfoNotifyReason' + smfChangeInfoList: + type: array + items: + $ref: '#/components/schemas/SmfChangeInfo' + minItems: 1 + ranNodeId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + initialAmfName: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfName' + anN2IPv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + anN2IPv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + required: + - n2NotifySubscriptionId + N2InfoContainer: + type: object + properties: + n2InformationClass: + $ref: '#/components/schemas/N2InformationClass' + smInfo: + $ref: '#/components/schemas/N2SmInformation' + ranInfo: + $ref: '#/components/schemas/N2RanInformation' + nrppaInfo: + $ref: '#/components/schemas/NrppaInformation' + pwsInfo: + $ref: '#/components/schemas/PwsInformation' + required: + - n2InformationClass + N1MessageNotification: + type: object + properties: + n1NotifySubscriptionId: + type: string + n1MessageContainer: + $ref: '#/components/schemas/N1MessageContainer' + lcsCorrelationId: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CorrelationID' + registrationCtxtContainer: + $ref: '#/components/schemas/RegistrationContextContainer' + newLmfIdentification: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LMFIdentification' + required: + - n1MessageContainer + N1MessageContainer: + type: object + properties: + n1MessageClass: + $ref: '#/components/schemas/N1MessageClass' + n1MessageContent: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + nfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + serviceInstanceId: + type: string + required: + - n1MessageClass + - n1MessageContent + N1N2MessageTransferReqData: + type: object + properties: + n1MessageContainer: + $ref: '#/components/schemas/N1MessageContainer' + n2InfoContainer: + $ref: '#/components/schemas/N2InfoContainer' + mtData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + skipInd: + type: boolean + default: false + lastMsgIndication: + type: boolean + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + lcsCorrelationId: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CorrelationID' + ppi: + $ref: '#/components/schemas/Ppi' + arp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + 5qi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5Qi' + n1n2FailureTxfNotifURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + smfReallocationInd: + type: boolean + default: false + areaOfValidity: + $ref: '#/components/schemas/AreaOfValidity' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + oldGuami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + maAcceptedInd: + type: boolean + default: false + extBufSupport: + type: boolean + default: false + targetAccess: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + + N1N2MessageTransferRspData: + type: object + properties: + cause: + $ref: '#/components/schemas/N1N2MessageTransferCause' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - cause + RegistrationContextContainer: + type: object + properties: + ueContext: + $ref: '#/components/schemas/UeContext' + localTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + anType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + anN2ApId: + type: integer + ranNodeId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + initialAmfName: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfName' + userLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + rrcEstCause: + type: string + pattern: '^[0-9a-fA-F]+$' + ueContextRequest: + type: boolean + default: false + initialAmfN2ApId: + type: integer + anN2IPv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + anN2IPv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + allowedNssai: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/AllowedNssai' + configuredNssai: + type: array + items: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/ConfiguredSnssai' + minItems: 1 + rejectedNssaiInPlmn: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + rejectedNssaiInTa: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + required: + - ueContext + - anType + - anN2ApId + - ranNodeId + - initialAmfName + - userLocation + AreaOfValidity: + type: object + properties: + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 0 + required: + - taiList + UeContextTransferReqData: + type: object + properties: + reason: + $ref: '#/components/schemas/TransferReason' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + regRequest: + $ref: '#/components/schemas/N1MessageContainer' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - reason + - accessType + UeContextTransferRspData: + type: object + properties: + ueContext: + $ref: '#/components/schemas/UeContext' + ueRadioCapability: + $ref: '#/components/schemas/N2InfoContent' + ueNbiotRadioCapability: + $ref: '#/components/schemas/N2InfoContent' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - ueContext + UeContext: + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + supiUnauthInd: + type: boolean + gpsiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + udmGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + ausfGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + routingIndicator: + type: string + groupList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + drxParameter: + $ref: '#/components/schemas/DrxParameter' + subRfsp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndex' + usedRfsp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndex' + subUeAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + smsfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + seafData: + $ref: '#/components/schemas/SeafData' + 5gMmCapability: + $ref: '#/components/schemas/5GMmCapability' + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + pcfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + pcfAmpServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + pcfUepServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + pcfBinding: + $ref: '#/components/schemas/SbiBindingLevel' + pcfAmPolicyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + amPolicyReqTriggerList: + type: array + items: + $ref: '#/components/schemas/PolicyReqTrigger' + minItems: 1 + pcfUePolicyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + uePolicyReqTriggerList: + type: array + items: + $ref: '#/components/schemas/PolicyReqTrigger' + minItems: 1 + hpcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + restrictedRatList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + minItems: 1 + forbiddenAreaList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Area' + minItems: 1 + serviceAreaRestriction: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' + restrictedCoreNwTypeList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CoreNetworkType' + minItems: 1 + eventSubscriptionList: + type: array + items: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/AmfEventSubscription' + minItems: 1 + mmContextList: + type: array + items: + $ref: '#/components/schemas/MmContext' + minItems: 1 + maxItems: 2 + sessionContextList: + type: array + items: + $ref: '#/components/schemas/PduSessionContext' + minItems: 1 + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + serviceGapExpiryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + stnSr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/StnSr' + cMsisdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CMsisdn' + msClassmark2: + $ref: '#/components/schemas/MSClassmark2' + supportedCodecList: + type: array + items: + $ref: '#/components/schemas/SupportedCodec' + minItems: 1 + smallDataRateStatusInfos: + type: array + items: + $ref: '#/components/schemas/SmallDataRateStatusInfo' + minItems: 1 + restrictedPrimaryRatList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + minItems: 1 + restrictedSecondaryRatList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + minItems: 1 + v2xContext: + items: + $ref: '#/components/schemas/V2xContext' + lteCatMInd: + type: boolean + default: false + moExpDataCounter: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MoExpDataCounter' + N2SmInformation: + type: object + properties: + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + n2InfoContent: + $ref: '#/components/schemas/N2InfoContent' + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + homePlmnSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + subjectToHo: + type: boolean + required: + - pduSessionId + N2InfoContent: + type: object + properties: + ngapMessageType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + ngapIeType: + $ref: '#/components/schemas/NgapIeType' + ngapData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + required: + - ngapData + NrppaInformation: + type: object + properties: + nfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + nrppaPdu: + $ref: '#/components/schemas/N2InfoContent' + serviceInstanceId: + type: string + required: + - nfId + - nrppaPdu + PwsInformation: + type: object + properties: + messageIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint16' + serialNumber: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint16' + pwsContainer: + $ref: '#/components/schemas/N2InfoContent' + sendRanResponse: + type: boolean + default: false + omcId: + $ref: '#/components/schemas/OmcIdentifier' + required: + - messageIdentifier + - serialNumber + - pwsContainer + N1N2MsgTxfrFailureNotification: + type: object + properties: + cause: + $ref: '#/components/schemas/N1N2MessageTransferCause' + n1n2MsgDataUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + required: + - cause + - n1n2MsgDataUri + N1N2MessageTransferError: + type: object + properties: + error: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + errInfo: + $ref: '#/components/schemas/N1N2MsgTxfrErrDetail' + required: + - error + N1N2MsgTxfrErrDetail: + type: object + properties: + retryAfter: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + highestPrioArp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + maxWaitingTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + N2InformationTransferRspData: + type: object + properties: + result: + $ref: '#/components/schemas/N2InformationTransferResult' + pwsRspData: + $ref: '#/components/schemas/PWSResponseData' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - result + MmContext: + type: object + properties: + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + nasSecurityMode: + $ref: '#/components/schemas/NasSecurityMode' + nasDownlinkCount: + $ref: '#/components/schemas/NasCount' + nasUplinkCount: + $ref: '#/components/schemas/NasCount' + ueSecurityCapability: + $ref: '#/components/schemas/UeSecurityCapability' + s1UeNetworkCapability: + $ref: '#/components/schemas/S1UeNetworkCapability' + allowedNssai: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + nssaiMappingList: + type: array + items: + $ref: '#/components/schemas/NssaiMapping' + minItems: 1 + nsInstanceList: + type: array + items: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/NsiId' + minItems: 1 + expectedUEbehavior: + $ref: '#/components/schemas/ExpectedUeBehavior' + plmnAssiUeRadioCapId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnAssiUeRadioCapId' + manAssiUeRadioCapId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ManAssiUeRadioCapId' + ucmfDicEntryId: + type: string + required: + - accessType + SeafData: + type: object + properties: + ngKsi: + $ref: '#/components/schemas/NgKsi' + keyAmf: + $ref: '#/components/schemas/KeyAmf' + nh: + type: string + pattern: '^[A-Fa-f0-9]+$' + ncc: + type: integer + minimum: 0 + maximum: 7 + keyAmfChangeInd: + type: boolean + keyAmfHDerivationInd: + type: boolean + required: + - ngKsi + - keyAmf + NasSecurityMode: + type: object + properties: + integrityAlgorithm: + $ref: '#/components/schemas/IntegrityAlgorithm' + cipheringAlgorithm: + $ref: '#/components/schemas/CipheringAlgorithm' + required: + - integrityAlgorithm + - cipheringAlgorithm + PduSessionContext: + type: object + properties: + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + smContextRef: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + additionalAccessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + allocatedEbiList: + type: array + items: + $ref: 'TS29502_Nsmf_PDUSession.yaml#/components/schemas/EbiArpMapping' + minItems: 1 + hsmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + hsmfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + hsmfServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + smfBinding: + $ref: '#/components/schemas/SbiBindingLevel' + vsmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + vsmfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + vsmfServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + vsmfBinding: + $ref: '#/components/schemas/SbiBindingLevel' + ismfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + ismfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + ismfServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + ismfBinding: + $ref: '#/components/schemas/SbiBindingLevel' + nsInstance: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/NsiId' + smfServiceInstanceId: + type: string + maPduSession: + type: boolean + default: false + cnAssistedRanPara: + $ref: 'TS29502_Nsmf_PDUSession.yaml#/components/schemas/CnAssistedRanPara' + required: + - pduSessionId + - smContextRef + - sNssai + - dnn + - accessType + NssaiMapping: + type: object + properties: + mappedSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + hSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + required: + - mappedSnssai + - hSnssai + UeRegStatusUpdateReqData: + type: object + properties: + transferStatus: + $ref: '#/components/schemas/UeContextTransferStatus' + toReleaseSessionList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + minItems: 1 + pcfReselectedInd: + type: boolean + smfChangeInfoList: + type: array + items: + $ref: '#/components/schemas/SmfChangeInfo' + minItems: 1 + required: + - transferStatus + UeRegStatusUpdateRspData: + type: object + properties: + regStatusTransferComplete: + type: boolean + required: + - regStatusTransferComplete + AssignEbiError: + type: object + properties: + error: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + failureDetails: + $ref: '#/components/schemas/AssignEbiFailed' + required: + - error + - failureDetails + UeContextCreateData: + type: object + properties: + ueContext: + $ref: '#/components/schemas/UeContext' + targetId: + $ref: '#/components/schemas/NgRanTargetId' + sourceToTargetData: + $ref: '#/components/schemas/N2InfoContent' + pduSessionList: + type: array + items: + $ref: '#/components/schemas/N2SmInformation' + minItems: 1 + mmeControlFteid: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + n2NotifyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ueRadioCapability: + $ref: '#/components/schemas/N2InfoContent' + ngapCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - ueContext + - targetId + - sourceToTargetData + - pduSessionList + UeContextCreatedData: + type: object + properties: + ueContext: + $ref: '#/components/schemas/UeContext' + targetToSourceData: + $ref: '#/components/schemas/N2InfoContent' + pduSessionList: + type: array + items: + $ref: '#/components/schemas/N2SmInformation' + minItems: 1 + failedSessionList: + type: array + items: + $ref: '#/components/schemas/N2SmInformation' + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + pcfReselectedInd: + type: boolean + required: + - ueContext + - targetToSourceData + - pduSessionList + UeContextCreateError: + type: object + properties: + error: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + ngapCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + required: + - error + NgRanTargetId: + type: object + properties: + ranNodeId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + tai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + required: + - ranNodeId + - tai + PWSResponseData: + type: object + properties: + ngapMessageType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + serialNumber: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint16' + messageIdentifier: + type: integer + unknownTaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + required: + - ngapMessageType + - serialNumber + - messageIdentifier + PWSErrorData: + type: object + properties: + namfCause: + type: integer + required: + - namfCause + N2InformationTransferError: + type: object + properties: + error: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + pwdErrorInfo: + $ref: '#/components/schemas/PWSErrorData' + required: + - error + NgKsi: + type: object + properties: + tsc: + $ref: '#/components/schemas/ScType' + ksi: + type: integer + minimum: 0 + maximum: 6 + required: + - tsc + - ksi + KeyAmf: + type: object + properties: + keyType: + $ref: '#/components/schemas/KeyAmfType' + keyVal: + type: string + required: + - keyType + - keyVal + ExpectedUeBehavior: + type: object + properties: + expMoveTrajectory: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + minItems: 1 + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - expMoveTrajectory + - validityTime + N2RanInformation: + type: object + properties: + n2InfoContent: + $ref: '#/components/schemas/N2InfoContent' + required: + - n2InfoContent + N2InfoNotificationRspData: + type: object + properties: + n2InfoContent: + $ref: '#/components/schemas/N2InfoContent' + SmallDataRateStatusInfo: + type: object + properties: + Snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + Dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + SmallDataRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SmallDataRateStatus' + required: + - Snssai + - Dnn + - SmallDataRateStatus + SmfChangeInfo: + type: object + properties: + pduSessionIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + minItems: 1 + smfChangeInd: + $ref: '#/components/schemas/SmfChangeIndication' + required: + - pduSessionIdList + - smfChangeInd + + V2xContext: + type: object + properties: + nrV2xServicesAuth: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NrV2xAuth' + lteV2xServicesAuth: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LteV2xAuth' + nrUeSidelinkAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + lteUeSidelinkAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + Pc5QoSPara: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pc5QoSPara' +# +# SIMPLE DATA TYPES +# + EpsBearerId: + type: integer + minimum: 0 + maximum: 15 + Ppi: + type: integer + minimum: 0 + maximum: 7 + NasCount: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + 5GMmCapability: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + UeSecurityCapability: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + S1UeNetworkCapability: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + DrxParameter: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + OmcIdentifier: + type: string + MSClassmark2: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + SupportedCodec: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + +# +# ENUMERATIONS +# + StatusChange: + anyOf: + - type: string + enum: + - AMF_UNAVAILABLE + - AMF_AVAILABLE + - type: string + N2InformationClass: + anyOf: + - type: string + enum: + - SM + - NRPPa + - PWS + - PWS-BCAL + - PWS-RF + - RAN + - type: string + N1MessageClass: + anyOf: + - type: string + enum: + - 5GMM + - SM + - LPP + - SMS + - UPDP + - LCS + - type: string + N1N2MessageTransferCause: + anyOf: + - type: string + enum: + - ATTEMPTING_TO_REACH_UE + - N1_N2_TRANSFER_INITIATED + - WAITING_FOR_ASYNCHRONOUS_TRANSFER + - UE_NOT_RESPONDING + - N1_MSG_NOT_TRANSFERRED + - UE_NOT_REACHABLE_FOR_SESSION + - TEMPORARY_REJECT_REGISTRATION_ONGOING + - TEMPORARY_REJECT_HANDOVER_ONGOING + - type: string + UeContextTransferStatus: + anyOf: + - type: string + enum: + - TRANSFERRED + - NOT_TRANSFERRED + - type: string + N2InformationTransferResult: + anyOf: + - type: string + enum: + - N2_INFO_TRANSFER_INITIATED + - type: string + CipheringAlgorithm: + anyOf: + - type: string + enum: + - NEA0 + - NEA1 + - NEA2 + - NEA3 + - type: string + IntegrityAlgorithm: + anyOf: + - type: string + enum: + - NIA0 + - NIA1 + - NIA2 + - NIA3 + - type: string + SmsSupport: + anyOf: + - type: string + enum: + - 3GPP + - NON_3GPP + - BOTH + - NONE + - type: string + ScType: + anyOf: + - type: string + enum: + - NATIVE + - MAPPED + - type: string + KeyAmfType: + anyOf: + - type: string + enum: + - KAMF + - KPRIMEAMF + - type: string + TransferReason: + anyOf: + - type: string + enum: + - INIT_REG + - MOBI_REG + - MOBI_REG_UE_VALIDATED + - type: string + PolicyReqTrigger: + anyOf: + - type: string + enum: + - LOCATION_CHANGE + - PRA_CHANGE + - SARI_CHANGE + - RFSP_INDEX_CHANGE + - ALLOWED_NSSAI_CHANGE + - type: string + RatSelector: + anyOf: + - type: string + enum: + - E-UTRA + - NR + - type: string + NgapIeType: + anyOf: + - type: string + enum: + - PDU_RES_SETUP_REQ + - PDU_RES_REL_CMD + - PDU_RES_MOD_REQ + - HANDOVER_CMD + - HANDOVER_REQUIRED + - HANDOVER_PREP_FAIL + - SRC_TO_TAR_CONTAINER + - TAR_TO_SRC_CONTAINER + - RAN_STATUS_TRANS_CONTAINER + - SON_CONFIG_TRANSFER + - NRPPA_PDU + - UE_RADIO_CAPABILITY + - RIM_INFO_TRANSFER + - SECONDARY_RAT_USAGE + - type: string + N2InfoNotifyReason: + anyOf: + - type: string + enum: + - HANDOVER_COMPLETED + - type: string + SmfChangeIndication: + anyOf: + - type: string + enum: + - CHANGED + - REMOVED + - type: string + SbiBindingLevel: + anyOf: + - type: string + enum: + - NF_INSTANCE_BINDING + - NF_SET_BINDING + - NF_SERVICE_SET_BINDING + - type: string diff --git a/lib/sbi/support/standard/TS29518_Namf_EventExposure.yaml b/lib/sbi/support/standard/TS29518_Namf_EventExposure.yaml new file mode 100644 index 0000000000..af86848cc5 --- /dev/null +++ b/lib/sbi/support/standard/TS29518_Namf_EventExposure.yaml @@ -0,0 +1,586 @@ +openapi: 3.0.0 +info: + version: 1.1.0.alpha-3 + title: Namf_EventExposure + description: | + AMF Event Exposure Service + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +security: + - {} + - oAuth2ClientCredentials: + - namf-evts +externalDocs: + description: 3GPP TS 29.518 V16.3.0; 5G System; Access and Mobility Management Services + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.518/' +servers: + - url: '{apiRoot}/namf-evts/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause clause 4.4 of 3GPP TS 29.501 +paths: + /subscriptions: + post: + summary: Namf_EventExposure Subscribe service Operation + tags: + - Subscriptions collection (Document) + operationId: CreateSubscription + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AmfCreateEventSubscription' + required: true + responses: + '201': + description: Subsription Created + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-evts//subscriptions/{subscriptionId}' + required: true + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/AmfCreatedEventSubscription' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + onEventReport: + '{$request.body#/subscription/eventNotifyUri}': + post: + summary: Event Notificaiton Delivery + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AmfEventNotification' + required: true + responses: + '204': + description: Successful acknowledgement + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + onSubscriptionIdChangeEvtReport: + '{$request.body#/subscription/subsChangeNotifyUri}': + post: + summary: Event Notificaiton Delivery For Subscription Id Change + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AmfEventNotification' + required: true + responses: + '204': + description: Successful acknowledgement + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /subscriptions/{subscriptionId}: + patch: + summary: Namf_EventExposure Subscribe Modify service Operation + tags: + - Individual subscription (Document) + operationId: ModifySubscription + parameters: + - name: subscriptionId + in: path + required: true + description: Unique ID of the subscription to be modified + schema: + type: string + requestBody: + content: + application/json-patch+json: + schema: + oneOf: + - $ref: '#/components/schemas/AmfUpdateEventSubscriptionItem' + - $ref: '#/components/schemas/AmfUpdateEventOptionItem' + required: true + responses: + '200': + description: Subsription modified successfully + content: + application/json: + schema: + $ref: '#/components/schemas/AmfUpdatedEventSubscription' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + delete: + summary: Namf_EventExposure Unsubscribe service Operation + tags: + - Individual subscription (Document) + operationId: DeleteSubscription + parameters: + - name: subscriptionId + in: path + required: true + description: Unique ID of the subscription to be deleted + schema: + type: string + responses: + '204': + description: Subsription deleted successfully + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + namf-evts: Access to the Namf_EventExposure API + schemas: + AmfEventSubscription: + type: object + properties: + eventList: + type: array + items: + $ref: '#/components/schemas/AmfEvent' + minItems: 1 + eventNotifyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + notifyCorrelationId: + type: string + nfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + subsChangeNotifyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + subsChangeNotifyCorrelationId: + type: string + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + groupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + anyUE: + type: boolean + options: + $ref: '#/components/schemas/AmfEventMode' + required: + - eventList + - eventNotifyUri + - notifyCorrelationId + - nfId + AmfEvent: + type: object + properties: + type: + $ref: '#/components/schemas/AmfEventType' + immediateFlag: + type: boolean + areaList: + type: array + items: + $ref: '#/components/schemas/AmfEventArea' + minItems: 1 + locationFilterList: + type: array + items: + $ref: '#/components/schemas/LocationFilter' + minItems: 1 + refId: + $ref: 'TS29503_Nudm_EE.yaml#/components/schemas/ReferenceId' + trafficDescriptorList: + type: array + items: + $ref: '#/components/schemas/TrafficDescriptor' + minItems: 1 + required: + - type + AmfEventNotification: + type: object + properties: + notifyCorrelationId: + type: string + subsChangeNotifyCorrelationId: + type: string + reportList: + type: array + items: + $ref: '#/components/schemas/AmfEventReport' + minItems: 1 + AmfEventReport: + type: object + properties: + type: + $ref: '#/components/schemas/AmfEventType' + state: + $ref: '#/components/schemas/AmfEventState' + timeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + subscriptionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + anyUe: + type: boolean + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + areaList: + type: array + items: + $ref: '#/components/schemas/AmfEventArea' + minItems: 1 + refId: + $ref: 'TS29503_Nudm_EE.yaml#/components/schemas/ReferenceId' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + location: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + timezone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + accessTypeList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + minItems: 1 + rmInfoList: + type: array + items: + $ref: '#/components/schemas/RmInfo' + minItems: 1 + cmInfoList: + type: array + items: + $ref: '#/components/schemas/CmInfo' + minItems: 1 + reachability: + $ref: '#/components/schemas/UeReachability' + commFailure: + $ref: '#/components/schemas/CommunicationFailure' + numberOfUes: + type: integer + 5gsUserStateList: + type: array + items: + $ref: '#/components/schemas/5GsUserStateInfo' + minItems: 1 + typeCode: + type: string + pattern: '^imeitac-[0-9]{8}$' + registrationNumber: + type: integer + required: + - type + - state + - timeStamp + AmfEventMode: + type: object + properties: + trigger: + $ref: '#/components/schemas/AmfEventTrigger' + maxReports: + type: integer + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - trigger + AmfEventState: + type: object + properties: + active: + type: boolean + remainReports: + type: integer + remainDuration: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + required: + - active + RmInfo: + type: object + properties: + rmState: + $ref: '#/components/schemas/RmState' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + required: + - rmState + - accessType + CmInfo: + type: object + properties: + cmState: + $ref: '#/components/schemas/CmState' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + required: + - cmState + - accessType + CommunicationFailure: + type: object + properties: + nasReleaseCode: + type: string + ranReleaseCode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + AmfCreateEventSubscription: + type: object + properties: + subscription: + $ref: '#/components/schemas/AmfEventSubscription' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + oldGuami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + required: + - subscription + AmfCreatedEventSubscription: + type: object + properties: + subscription: + $ref: '#/components/schemas/AmfEventSubscription' + subscriptionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + reportList: + type: array + items: + $ref: '#/components/schemas/AmfEventReport' + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - subscription + - subscriptionId + AmfUpdateEventSubscriptionItem: + type: array + items: + type: object + properties: + op: + type: string + enum: + - add + - remove + - replace + path: + type: string + pattern: '\/eventList\/[0-]$|\/eventList\/[1-9][0-9]*$' + value: + $ref: '#/components/schemas/AmfEvent' + required: + - op + - path + minItems: 1 + AmfUpdateEventOptionItem: + type: object + properties: + op: + type: string + enum: + - replace + path: + type: string + pattern: '\/options\/expiry$' + value: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - op + - path + - value + AmfUpdatedEventSubscription: + type: object + properties: + subscription: + $ref: '#/components/schemas/AmfEventSubscription' + required: + - subscription + AmfEventArea: + type: object + properties: + presenceInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + ladnInfo: + $ref: '#/components/schemas/LadnInfo' + LadnInfo: + type: object + properties: + ladn: + type: string + presence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceState' + required: + - ladn + 5GsUserStateInfo: + type: object + properties: + 5gsUserState: + $ref: '#/components/schemas/5GsUserState' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + required: + - 5gsUserState + - accessType + TrafficDescriptor: + type: object + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dddTrafficDescriptorList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DddTrafficDescriptor' + minItems: 1 + 5gGuti: + type: string + AmfEventType: + anyOf: + - type: string + enum: + - LOCATION_REPORT + - PRESENCE_IN_AOI_REPORT + - TIMEZONE_REPORT + - ACCESS_TYPE_REPORT + - REGISTRATION_STATE_REPORT + - CONNECTIVITY_STATE_REPORT + - REACHABILITY_REPORT + - COMMUNICATION_FAILURE_REPORT + - UES_IN_AREA_REPORT + - SUBSCRIPTION_ID_CHANGE + - SUBSCRIPTION_ID_ADDITION + - LOSS_OF_CONNECTIVITY + - 5GS_USER_STATE_REPORT + - AVAILABILITY_AFTER_DDN_FAILURE + - TYPE_ALLOCATION_CODE_REPORT + - FREQUENT_MOBILITY_REGISTRATION_REPORT + - type: string + AmfEventTrigger: + anyOf: + - type: string + enum: + - ONE_TIME + - CONTINUOUS + - type: string + LocationFilter : + anyOf: + - type: string + enum: + - TAI + - CELL_ID + - N3IWF + - UE_IP + - UDP_PORT + - TNAP_ID + - GLI + - type: string + UeReachability: + anyOf: + - type: string + enum: + - UNREACHABLE + - REACHABLE + - REGULATORY_ONLY + - type: string + RmState: + anyOf: + - type: string + enum: + - REGISTERED + - DEREGISTERED + - type: string + CmState: + anyOf: + - type: string + enum: + - IDLE + - CONNECTED + - type: string + 5GsUserState: + anyOf: + - type: string + enum: + - DEREGISTERED + - REGISTERED_NOT_REACHABLE_FOR_PAGING + - REGISTERED_REACHABLE_FOR_PAGING + - CONNECTED_NOT_REACHABLE_FOR_PAGING + - CONNECTED_REACHABLE_FOR_PAGING + - NOT_PROVIDED_FROM_AMF + - type: string diff --git a/lib/sbi/support/3gpp-spec/TS29518_Namf_Location.yaml b/lib/sbi/support/standard/TS29518_Namf_Location.yaml similarity index 66% rename from lib/sbi/support/3gpp-spec/TS29518_Namf_Location.yaml rename to lib/sbi/support/standard/TS29518_Namf_Location.yaml index 1ad5651d74..7b78e71407 100644 --- a/lib/sbi/support/3gpp-spec/TS29518_Namf_Location.yaml +++ b/lib/sbi/support/standard/TS29518_Namf_Location.yaml @@ -1,311 +1,426 @@ -openapi: 3.0.0 -info: - version: 1.0.2 - title: Namf_Location - description: | - AMF Location Service - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. -security: - - {} - - oAuth2ClientCredentials: - - namf-loc -externalDocs: - description: 3GPP TS 29.518 V15.3.0; 5G System; Access and Mobility Management Services - url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.518/' -servers: - - url: '{apiRoot}/namf-loc/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in subclause subclause 4.4 of 3GPP TS 29.501 -paths: - /{ueContextId}/provide-pos-info: - post: - summary: Namf_Location ProvidePositioningInfo service Operation - tags: - - Individual UE context (Document) - operationId: ProvidePositioningInfo - parameters: - - name: ueContextId - in: path - description: UE Context Identifier - required: true - schema: - type: string - pattern: '^(imsi-[0-9]{5,15}|nai-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RequestPosInfo' - required: true - responses: - '200': - description: Expected response to a valid request - content: - application/json: - schema: - $ref: '#/components/schemas/ProvidePosInfo' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - '504': - $ref: 'TS29571_CommonData.yaml#/components/responses/504' - default: - description: Unexpected error - callbacks: - onUELocationNotification: - '{$request.body#/locationNotificationUri}': - post: - requestBody: - description: UE Location Event Notification - content: - application/json: - schema: - $ref: '#/components/schemas/NotifiedPosInfo' - responses: - '204': - description: Expected response to a successful callback processing - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - /{ueContextId}/provide-loc-info: - post: - summary: Namf_Location ProvideLocationInfo service Operation - tags: - - Individual UE context (Document) - operationId: ProvideLocationInfo - parameters: - - name: ueContextId - in: path - description: UE Context Identifier - required: true - schema: - type: string - pattern: '^(imsi-[0-9]{5,15}|nai-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RequestLocInfo' - required: true - responses: - '200': - description: Expected response to a valid request - content: - application/json: - schema: - $ref: '#/components/schemas/ProvideLocInfo' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - description: Unexpected error -components: - securitySchemes: - oAuth2ClientCredentials: - type: oauth2 - flows: - clientCredentials: - tokenUrl: '{nrfApiRoot}/oauth2/token' - scopes: - namf-loc: Access to the Namf_Location API - schemas: - RequestPosInfo: - type: object - properties: - lcsClientType: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/ExternalClientType' - lcsLocation: - $ref: '#/components/schemas/LocationType' - supi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - gpsi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' - priority: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LcsPriority' - lcsQoS: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LocationQoS' - velocityRequested: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/VelocityRequested' - lcsSupportedGADShapes: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/SupportedGADShapes' - locationNotificationUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - lcsClientType - - lcsLocation - ProvidePosInfo: - type: object - properties: - locationEstimate: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' - accuracyFulfilmentIndicator: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/AccuracyFulfilmentIndicator' - ageOfLocationEstimate: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/AgeOfLocationEstimate' - velocityEstimate: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/VelocityEstimate' - positioningDataList: - type: array - items: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/PositioningMethodAndUsage' - minItems: 0 - maxItems: 9 - gnssPositioningDataList: - type: array - items: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GnssPositioningMethodAndUsage' - minItems: 0 - maxItems: 9 - ecgi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' - ncgi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' - targetServingNode: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - civicAddress: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' - barometricPressure: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/BarometricPressure' - altitude: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/Altitude' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - NotifiedPosInfo: - type: object - properties: - locationEvent: - $ref: '#/components/schemas/LocationEvent' - supi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' - gpsi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' - pei: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' - locationEstimate: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' - ageOfLocationEstimate: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/AgeOfLocationEstimate' - velocityEstimate: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/VelocityEstimate' - positioningDataList: - type: array - items: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/PositioningMethodAndUsage' - minItems: 0 - maxItems: 9 - gnssPositioningDataList: - type: array - items: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GnssPositioningMethodAndUsage' - minItems: 0 - maxItems: 9 - ecgi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' - ncgi: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' - servingNode: - $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' - civicAddress: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' - barometricPressure: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/BarometricPressure' - altitude: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/Altitude' - required: - - locationEvent - RequestLocInfo: - type: object - properties: - req5gsLoc: - type: boolean - default: false - reqCurrentLoc: - type: boolean - default: false - reqRatType: - type: boolean - default: false - reqTimeZone: - type: boolean - default: false - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - ProvideLocInfo: - type: object - properties: - currentLoc: - type: boolean - location: - $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' - geoInfo: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' - locatoinAge: - $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/AgeOfLocationEstimate' - ratType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' - timezone: - $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - LocationType: - anyOf: - - type: string - enum: - - CURRENT_LOCATION - - CURRENT_OR_LAST_KNOWN_LOCATION - - INITIAL_LOCATION - - type: string - LocationEvent: - anyOf: - - type: string - enum: - - EMERGENCY_CALL_ORIGINATION - - EMERGENCY_CALL_RELEASE - - EMERGENCY_CALL_HANDOVER - - type: string +openapi: 3.0.0 +info: + version: 1.1.0.alpha-2 + title: Namf_Location + description: | + AMF Location Service + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +security: + - {} + - oAuth2ClientCredentials: + - namf-loc +externalDocs: + description: 3GPP TS 29.518 V16.3.0; 5G System; Access and Mobility Management Services + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.518/' +servers: + - url: '{apiRoot}/namf-loc/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause clause 4.4 of 3GPP TS 29.501 +paths: + /{ueContextId}/provide-pos-info: + post: + summary: Namf_Location ProvidePositioningInfo service Operation + tags: + - Individual UE context (Document) + operationId: ProvidePositioningInfo + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RequestPosInfo' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ProvidePosInfo' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + description: Unexpected error + callbacks: + onUELocationNotification: + '{$request.body#/locationNotificationUri}': + post: + requestBody: + description: UE Location Event Notification + content: + application/json: + schema: + $ref: '#/components/schemas/NotifiedPosInfo' + responses: + '204': + description: Expected response to a successful callback processing + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + /{ueContextId}/provide-loc-info: + post: + summary: Namf_Location ProvideLocationInfo service Operation + tags: + - Individual UE context (Document) + operationId: ProvideLocationInfo + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RequestLocInfo' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ProvideLocInfo' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueContextId}/cancel-pos-info: + post: + summary: Namf_Location CancelLocation service operation + tags: + - Individual UE context (Document) + operationId: CancelLocation + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CancelPosInfo' + required: true + responses: + '204': + description: Expected response to a successful cancellation + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + namf-loc: Access to the Namf_Location API + schemas: + RequestPosInfo: + type: object + properties: + lcsClientType: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/ExternalClientType' + lcsLocation: + $ref: '#/components/schemas/LocationType' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + priority: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LcsPriority' + lcsQoS: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LocationQoS' + velocityRequested: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/VelocityRequested' + lcsSupportedGADShapes: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/SupportedGADShapes' + additionalLcsSuppGADShapes: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/SupportedGADShapes' + minItems: 1 + locationNotificationUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + oldGuami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + lcsServiceType: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LcsServiceType' + ldrType: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LdrType' + hgmlcCallBackURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ldrReference: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LdrReference' + periodicEventInfo: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/PeriodicEventInfo' + areaEventInfo: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/AreaEventInfo' + motionEventInfo: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/MotionEventInfo' + externalClientIdentification: + $ref: 'TS29515_Ngmlc_Location.yaml#/components/schemas/ExternalClientIdentification' + afID: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + codeWord: + $ref: 'TS29515_Ngmlc_Location.yaml#/components/schemas/CodeWord' + lcsServiceAuthInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LcsServiceAuth' + required: + - lcsClientType + - lcsLocation + ProvidePosInfo: + type: object + properties: + locationEstimate: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + accuracyFulfilmentIndicator: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/AccuracyFulfilmentIndicator' + ageOfLocationEstimate: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/AgeOfLocationEstimate' + velocityEstimate: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/VelocityEstimate' + positioningDataList: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/PositioningMethodAndUsage' + minItems: 0 + maxItems: 9 + gnssPositioningDataList: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GnssPositioningMethodAndUsage' + minItems: 0 + maxItems: 9 + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + ncgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + targetServingNode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + civicAddress: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' + barometricPressure: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/BarometricPressure' + altitude: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/Altitude' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + servingLMFIdentification: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LMFIdentification' + NotifiedPosInfo: + type: object + properties: + locationEvent: + $ref: '#/components/schemas/LocationEvent' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + locationEstimate: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + ageOfLocationEstimate: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/AgeOfLocationEstimate' + velocityEstimate: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/VelocityEstimate' + positioningDataList: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/PositioningMethodAndUsage' + minItems: 0 + maxItems: 9 + gnssPositioningDataList: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GnssPositioningMethodAndUsage' + minItems: 0 + maxItems: 9 + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + ncgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + servingNode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + civicAddress: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' + barometricPressure: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/BarometricPressure' + altitude: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/Altitude' + hgmlcCallBackURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ldrReference: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LdrReference' + servingLMFIdentification: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LMFIdentification' + terminationCause: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/TerminationCause' + required: + - locationEvent + RequestLocInfo: + type: object + properties: + req5gsLoc: + type: boolean + default: false + reqCurrentLoc: + type: boolean + default: false + reqRatType: + type: boolean + default: false + reqTimeZone: + type: boolean + default: false + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + ProvideLocInfo: + type: object + properties: + currentLoc: + type: boolean + location: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + geoInfo: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + locationAge: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/AgeOfLocationEstimate' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + timezone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + oldGuami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + CancelPosInfo: + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + hgmlcCallBackURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ldrReference: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LdrReference' + servingLMFIdentification: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LMFIdentification' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - supi + - hgmlcCallBackURI + - ldrReference + LocationType: + anyOf: + - type: string + enum: + - CURRENT_LOCATION + - CURRENT_OR_LAST_KNOWN_LOCATION + - INITIAL_LOCATION + - NOTIFICATION_VERIFICATION_ONLY + - DEFERRED_LOCATION + - type: string + LocationEvent: + anyOf: + - type: string + enum: + - EMERGENCY_CALL_ORIGINATION + - EMERGENCY_CALL_RELEASE + - EMERGENCY_CALL_HANDOVER + - ACTIVATION_OF_DEFERRED_LOCATION + - UE_MOBILITY_FOR_DEFERRED_LOCATION + - CANCELLATION_OF_DEFERRED_LOCATION + - type: string diff --git a/lib/sbi/support/3gpp-spec/TS29518_Namf_MT.yaml b/lib/sbi/support/standard/TS29518_Namf_MT.yaml similarity index 77% rename from lib/sbi/support/3gpp-spec/TS29518_Namf_MT.yaml rename to lib/sbi/support/standard/TS29518_Namf_MT.yaml index 727120c1ae..92828b62db 100644 --- a/lib/sbi/support/3gpp-spec/TS29518_Namf_MT.yaml +++ b/lib/sbi/support/standard/TS29518_Namf_MT.yaml @@ -1,190 +1,219 @@ -openapi: 3.0.0 -info: - version: 1.0.2 - title: Namf_MT - description: | - AMF Mobile Termination Service - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. -security: - - {} - - oAuth2ClientCredentials: - - namf-mt -externalDocs: - description: 3GPP TS 29.518 V15.3.0; 5G System; Access and Mobility Management Services - url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.518/' -servers: - - url: '{apiRoot}/namf-mt/v1' - variables: - apiRoot: - default: https://example.com - description: apiRoot as defined in subclause subclause 4.4 of 3GPP TS 29.501 -paths: - '/ue-contexts/{ueContextId}': - get: - summary: Namf_MT Provide Domain Selection Info service Operation - tags: - - ueContext (Document) - operationId: Provide Domain Selection Info - parameters: - - name: ueContextId - in: path - description: UE Context Identifier - required: true - schema: - type: string - pattern: '^(imsi-[0-9]{5,15}|nai-.+|.+)$' - - name: info-class - in: query - description: UE Context Information Class - schema: - $ref: '#/components/schemas/UeContextInfoClass' - - name: supported-features - in: query - description: Supported Features - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - responses: - '200': - description: Requested UE Context Information returned - content: - application/json: - schema: - $ref: '#/components/schemas/UeContextInfo' - '307': - description: Temporary Redirect - content: - application/problem+json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - headers: - Location: - description: 'The URI of the resource located on the target NF Service Consumer (e.g. AMF) to which the request is redirected' - required: true - schema: - type: string - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '414': - $ref: 'TS29571_CommonData.yaml#/components/responses/414' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - description: Unexpected error - /ue-contexts/{ueContextId}/ue-reachind: - put: - summary: Namf_MT EnableUEReachability service Operation - tags: - - ueReachInd (Document) - operationId: EnableUeReachability - parameters: - - name: ueContextId - in: path - description: UE Context Identifier - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EnableUeReachabilityReqData' - required: true - responses: - '200': - description: UE has become reachable as desired - content: - application/json: - schema: - $ref: '#/components/schemas/EnableUeReachabilityRspData' - '307': - description: Temporary Redirect - content: - application/problem+json: - schema: - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' - headers: - Location: - description: 'The URI of the resource located on the target NF Service Consumer (e.g. AMF) to which the request is redirected' - required: true - schema: - type: string - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - '504': - $ref: 'TS29571_CommonData.yaml#/components/responses/504' - default: - description: Unexpected error -components: - securitySchemes: - oAuth2ClientCredentials: - type: oauth2 - flows: - clientCredentials: - tokenUrl: '{nrfApiRoot}/oauth2/token' - scopes: - namf-mt: Access to the Namf_MT API - schemas: - EnableUeReachabilityReqData: - type: object - properties: - reachability: - $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/UeReachability' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - reachability - EnableUeReachabilityRspData: - type: object - properties: - reachability: - $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/UeReachability' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - required: - - reachability - UeContextInfo: - type: object - properties: - supportVoPS: - type: boolean - supportVoPSn3gpp: - type: boolean - lastActTime: - $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - accessType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' - ratType: - $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' - supportedFeatures: - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' - UeContextInfoClass: - anyOf: - - type: string - enum: - - TADS - - type: string +openapi: 3.0.0 +info: + version: 1.1.0.alpha-3 + title: Namf_MT + description: | + AMF Mobile Terminated Service + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +security: + - {} + - oAuth2ClientCredentials: + - namf-mt +externalDocs: + description: 3GPP TS 29.518 V16.3.0; 5G System; Access and Mobility Management Services + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.518/' +servers: + - url: '{apiRoot}/namf-mt/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause clause 4.4 of 3GPP TS 29.501 +paths: + '/ue-contexts/{ueContextId}': + get: + summary: Namf_MT Provide Domain Selection Info service Operation + tags: + - ueContext (Document) + operationId: Provide Domain Selection Info + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|.+)$' + - name: info-class + in: query + description: UE Context Information Class + schema: + $ref: '#/components/schemas/UeContextInfoClass' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: old-guami + in: query + description: Old GUAMI + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + responses: + '200': + description: Requested UE Context Information returned + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextInfo' + '307': + description: Temporary Redirect + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + headers: + Location: + description: 'The URI of the resource located on the target NF Service Consumer (e.g. AMF) to which the request is redirected' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /ue-contexts/{ueContextId}/ue-reachind: + put: + summary: Namf_MT EnableUEReachability service Operation + tags: + - ueReachInd (Document) + operationId: EnableUeReachability + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EnableUeReachabilityReqData' + required: true + responses: + '200': + description: UE has become reachable as desired + content: + application/json: + schema: + $ref: '#/components/schemas/EnableUeReachabilityRspData' + '307': + description: Temporary Redirect + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + headers: + Location: + description: 'The URI of the resource located on the target NF Service Consumer (e.g. AMF) to which the request is redirected' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + description: Forbidden + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetailsEnableUeReachability' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + description: Gateway Timeout + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetailsEnableUeReachability' + default: + description: Unexpected error +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + namf-mt: Access to the Namf_MT API + schemas: + EnableUeReachabilityReqData: + type: object + properties: + reachability: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/UeReachability' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + oldGuami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + extBufSupport: + type: boolean + default: false + required: + - reachability + EnableUeReachabilityRspData: + type: object + properties: + reachability: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/UeReachability' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - reachability + UeContextInfo: + type: object + properties: + supportVoPS: + type: boolean + supportVoPSn3gpp: + type: boolean + lastActTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + ProblemDetailsEnableUeReachability: + allOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/AdditionInfoEnableUeReachability' + AdditionInfoEnableUeReachability: + type: object + properties: + maxWaitingTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + UeContextInfoClass: + anyOf: + - type: string + enum: + - TADS + - type: string diff --git a/lib/sbi/support/standard/TS29519_Application_Data.yaml b/lib/sbi/support/standard/TS29519_Application_Data.yaml new file mode 100644 index 0000000000..9fa6aad486 --- /dev/null +++ b/lib/sbi/support/standard/TS29519_Application_Data.yaml @@ -0,0 +1,2001 @@ +openapi: 3.0.0 +info: + version: '-' + title: Unified Data Repository Service API file for Application Data + description: | + The API version is defined in 3GPP TS 29.504 + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.519 V16.3.0; 5G System; Usage of the Unified Data Repository Service for Policy Data, Application Data and Structured Data for Exposure. + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.519/' + +paths: + /application-data/pfds: + get: + summary: Retrieve PFDs for application identifier(s) + operationId: ReadPFDData + tags: + - PFD Data (Store) + parameters: + - name: appId + in: query + description: Contains the information of the application identifier(s) for the querying PFD Data resource. If none appId is included in the URI, it applies to all application identifier(s) for the querying PFD Data resource. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + responses: + '200': + description: A representation of PFDs for request applications is returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PfdDataForAppExt' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /application-data/pfds/{appId}: + get: + summary: Retrieve the corresponding PFDs of the specified application identifier + operationId: ReadIndividualPFDData + tags: + - Individual PFD Data (Document) + parameters: + - name: appId + in: path + description: Indicate the application identifier for the request pfd(s). It shall apply the format of Data type ApplicationId. + required: true + schema: + type: string + responses: + '200': + description: A representation of PFDs for the request application identified by the application identifier is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdDataForAppExt' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete the corresponding PFDs of the specified application identifier + operationId: DeleteIndividualPFDData + tags: + - Individual PFD Data (Document) + parameters: + - name: appId + in: path + description: Indicate the application identifier for the request pfd(s). It shall apply the format of Data type ApplicationId. + required: true + schema: + type: string + responses: + '204': + description: Successful case. The Individual PFD Data resource related to the application identifier was deleted. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + summary: Create or update the corresponding PFDs for the specified application identifier + operationId: CreateOrReplaceIndividualPFDData + tags: + - Individual PFD Data (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PfdDataForAppExt' + parameters: + - name: appId + in: path + description: Indicate the application identifier for the request pfd(s). It shall apply the format of Data type ApplicationId. + required: true + schema: + type: string + responses: + '201': + description: The creation of an Individual PFD Data resource related to the application-identifier is confirmed and a representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdDataForAppExt' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr/{apiVersion}/application-data/pfds/{appId}' + required: true + schema: + type: string + '200': + description: Successful case. The upgrade of an Individual PFD Data resource related to the application identifier is confirmed and a representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdDataForAppExt' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /application-data/influenceData: + get: + summary: Retrieve Traffic Influence Data + operationId: ReadInfluenceData + tags: + - Influence Data (Store) + parameters: + - name: influence-Ids + in: query + description: Each element identifies a service. + required: false + schema: + type: array + items: + type: string + minItems: 1 + - name: dnns + in: query + description: Each element identifies a DNN. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + - name: snssais + in: query + description: Each element identifies a slice. + required: false + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + - name: internal-Group-Ids + in: query + description: Each element identifies a group of users. + required: false + schema: + type: array + items: + type: string + minItems: 1 + - name: supis + in: query + description: Each element identifies the user. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + - name: supp-feat + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: The Traffic Influence Data stored in the UDR are returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TrafficInfluData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /application-data/influenceData/{influenceId}: + put: + summary: Create or update an individual Influence Data resource + operationId: CreateOrReplaceIndividualInfluenceData + tags: + - Individual Influence Data (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluData' + parameters: + - name: influenceId + in: path + description: The Identifier of an Individual Influence Data to be created or updated. It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '201': + description: The creation of an Individual Traffic Influence Data resource is confirmed and a representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluData' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr/{apiVersion}/application-data/influenceData/{influenceId}' + required: true + schema: + type: string + '200': + description: The update of an Individual Traffic Influence Data resource is confirmed and a response body containing Traffic Influence Data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluData' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Modify part of the properties of an individual Influence Data resource + operationId: UpdateIndividualInfluenceData + tags: + - Individual Influence Data (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluDataPatch' + parameters: + - name: influenceId + in: path + description: The Identifier of an Individual Influence Data to be updated. It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '200': + description: The update of an Individual Traffic Influence Data resource is confirmed and a response body containing Traffic Influence Data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluData' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an individual Influence Data resource + operationId: DeleteIndividualInfluenceData + tags: + - Individual Influence Data (Document) + parameters: + - name: influenceId + in: path + description: The Identifier of an Individual Influence Data to be updated. It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '204': + description: The Individual Influence Data was deleted successfully. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /application-data/influenceData/subs-to-notify: + post: + summary: Create a new Individual Influence Data Subscription resource + operationId: CreateIndividualInfluenceDataSubscription + tags: + - Influence Data Subscriptions (Collection) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + responses: + '201': + description: The subscription was created successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + trafficInfluenceDataChangeNotification: + '{$request.body#/notificationUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + oneOf: + - $ref: '#/components/schemas/TrafficInfluData' + - $ref: '#/components/schemas/TrafficInfluDataNotif' + minItems: 1 + responses: + '204': + description: No Content, Notification was successful + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + get: + summary: Read Influence Data Subscriptions + operationId: ReadInfluenceDataSubscriptions + tags: + - Influence Data Subscriptions (Collection) + parameters: + - name: dnn + in: query + description: Identifies a DNN. + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - name: snssai + in: query + description: Identifies a slice. + required: false + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + - name: internal-Group-Id + in: query + description: Identifies a group of users. + required: false + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + - name: supi + in: query + description: Identifies a user. + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + responses: + '200': + description: The subscription information as request in the request URI query parameter(s) are returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TrafficInfluSub' + minItems: 0 + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /application-data/influenceData/subs-to-notify/{subscriptionId}: + get: + summary: Get an existing individual Influence Data Subscription resource + operationId: ReadIndividualInfluenceDataSubscription + tags: + - Individual Influence Data Subscription (Document) + parameters: + - name: subscriptionId + in: path + description: String identifying a subscription to the Individual Influence Data Subscription + required: true + schema: + type: string + responses: + '200': + description: The subscription information is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + summary: Modify an existing individual Influence Data Subscription resource + operationId: ReplaceIndividualInfluenceDataSubscription + tags: + - Individual Influence Data Subscription (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + parameters: + - name: subscriptionId + in: path + description: String identifying a subscription to the Individual Influence Data Subscription + required: true + schema: + type: string + responses: + '200': + description: The subscription was updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an individual Influence Data Subscription resource + operationId: DeleteIndividualInfluenceDataSubscription + tags: + - Individual Influence Data Subscription (Document) + parameters: + - name: subscriptionId + in: path + description: String identifying a subscription to the Individual Influence Data Subscription + required: true + schema: + type: string + responses: + '204': + description: The subscription was terminated successfully. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /application-data/bdtPolicyData: + get: + summary: Retrieve applied BDT Policy Data + operationId: ReadBdtPolicyData + tags: + - BdtPolicy Data (Store) + parameters: + - name: bdt-policy-ids + in: query + description: Each element identifies a service. + required: false + schema: + type: array + items: + type: string + minItems: 1 + - name: internal-group-ids + in: query + description: Each element identifies a group of users. + required: false + schema: + type: array + items: + type: string + minItems: 1 + - name: supis + in: query + description: Each element identifies the user. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + responses: + '200': + description: The applied BDT policy Data stored in the UDR are returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/BdtPolicyData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /application-data/bdtPolicyData/{bdtPolicyId}: + put: + summary: Create an individual applied BDT Policy Data resource + operationId: CreateIndividualAppliedBdtPolicyData + tags: + - Individual BDT Policy Data (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BdtPolicyData' + parameters: + - name: bdtPolicyId + in: path + description: The Identifier of an Individual Applied BDT Policy Data to be created or updated. It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '201': + description: The creation of an Individual Applied BDT Policy Data resource is confirmed and a representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BdtPolicyData' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr/{apiVersion}/application-data/bdtPolicyData/{bdtPolicyId}' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Modify part of the properties of an individual Applied BDT Policy Data resource + operationId: UpdateIndividualAppliedBdtPolicyData + tags: + - Individual Applied BDT Policy Data (Document) + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/BdtPolicyDataPatch' + parameters: + - name: bdtPolicyId + in: path + description: The Identifier of an Individual Applied BDT Policy Data to be updated. It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '200': + description: The update of an Individual Applied BDT Policy Data resource is confirmed and a response body containing Applied BDT Policy Data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BdtPolicyData' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an individual Applied BDT Policy Data resource + operationId: DeleteIndividualAppliedBdtPolicyData + tags: + - Individual Applied BDT Policy Data (Document) + parameters: + - name: bdtPolicyId + in: path + description: The Identifier of an Individual Applied BDT Policy Data to be updated. It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '204': + description: The Individual Applied BDT Policy Data was deleted successfully. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/iptvConfigData: + get: + summary: Retrieve IPTV configuration Data + operationId: ReadIPTVCongifurationData + tags: + - IPTV Configuration Data (Store) + parameters: + - name: config-ids + in: query + description: Each element identifies a configuration. + required: false + schema: + type: array + items: + type: string + minItems: 1 + - name: dnns + in: query + description: Each element identifies a DNN. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + - name: snssais + in: query + description: Each element identifies a slice. + required: false + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + - name: supis + in: query + description: Each element identifies the user. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + - name: inter-group-ids + in: query + description: Each element identifies a group of users. + required: false + schema: + type: array + items: + type: string + minItems: 1 + responses: + '200': + description: The IPTV configuration data stored in the UDR are returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/IptvConfigData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /application-data/iptvConfigData/{configurationId}: + put: + summary: Create or update an individual IPTV configuration resource + operationId: CreateOrReplaceIndividualIPTVConfigurationData + tags: + - Individual IPTV Configuration Data (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/IptvConfigData' + parameters: + - name: configurationId + in: path + description: The Identifier of an Individual IPTV Configuration Data to be created or updated. It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '201': + description: The creation of an Individual IPTV Configuration Data resource is confirmed and a representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/IptvConfigData' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '200': + description: The update of an Individual IPTV configuration resource. + content: + application/json: + schema: + $ref: '#/components/schemas/IptvConfigData' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Partial update an individual IPTV configuration resource + operationId: PartialReplaceIndividualIPTVConfigurationData + tags: + - Individual IPTV Configuration Data + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/IptvConfigDataPatch' + parameters: + - name: configurationId + in: path + description: The Identifier of an Individual IPTV Configuration Data to be updated. It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '200': + description: The update of an Individual IPTV configuration resource. + content: + application/json: + schema: + $ref: '#/components/schemas/IptvConfigData' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an individual IPTV configuration resource + operationId: DeleteIndividualIPTVConfigurationData + tags: + - Individual IPTV Configuration Data (Document) + parameters: + - name: configurationId + in: path + description: The Identifier of an Individual IPTV Configuration to be updated. It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '204': + description: The resource was deleted successfully. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /application-data/serviceParamData: + get: + summary: Retrieve Service Parameter Data + operationId: ReadServiceParameterData + tags: + - Service Parameter Data (Store) + parameters: + - name: service-param-ids + in: query + description: Each element identifies a service. + required: false + schema: + type: array + items: + type: string + minItems: 1 + - name: dnns + in: query + description: Each element identifies a DNN. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + - name: snssais + in: query + description: Each element identifies a slice. + required: false + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + - name: internal-group-ids + in: query + description: Each element identifies a group of users. + required: false + schema: + type: array + items: + type: string + minItems: 1 + - name: supis + in: query + description: Each element identifies the user. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + - name: ue-ipv4s + in: query + description: Each element identifies the user. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + - name: ue-ipv6s + in: query + description: Each element identifies the user. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + - name: ue-mac + in: query + description: Each element identifies the user. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + minItems: 1 + - name: supp-feat + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: The Service Parameter Data stored in the UDR are returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ServiceParameterData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /application-data/serviceParamData/{serviceParamId}: + put: + summary: Create or update an individual Service Parameter Data resource + operationId: CreateOrReplaceServiceParameterData + tags: + - Individual Service Parameter Data (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceParameterData' + parameters: + - name: serviceParamId + in: path + description: The Identifier of an Individual Service Parameter Data to be created or updated. It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '201': + description: The creation of an Individual Service Parameter Data resource is confirmed and a representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceParameterData' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr/{apiVersion}/application-data/serviceParamData/{serviceParamId}' + required: true + schema: + type: string + '200': + description: The update of an Individual Service Parameter Data resource is confirmed and a response body containing Service Parameter Data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceParameterData' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Modify part of the properties of an individual Service Parameter Data resource + operationId: UpdateIndividualServiceParameterData + tags: + - Individual Service Parameter Data (Document) + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/ServiceParameterDataPatch' + parameters: + - name: serviceParamId + in: path + description: The Identifier of an Individual Service Parameter Data to be updated. It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '200': + description: The update of an Individual Service Parameter Data resource is confirmed and a response body containing Service Parameter Data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceParameterData' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an individual Service Parameter Data resource + operationId: DeleteIndividualServiceParameterData + tags: + - Individual Service Parameter Data (Document) + parameters: + - name: serviceParamId + in: path + description: The Identifier of an Individual Service Parameter Data to be updated. It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '204': + description: The Individual Service Parameter Data was deleted successfully. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /application-data/subs-to-notify: + post: + summary: Create a subscription to receive notification of application data changes + operationId: CreateIndividualApplicationDataSubscription + tags: + - ApplicationDataSubscriptions (Collection) + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationDataSubs' + responses: + '201': + description: Upon success, a response body containing a representation of each Individual subscription resource shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationDataSubs' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + applicationDataChangeNotif: + '{$request.body#/notificationUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApplicationDataChangeNotif' + minItems: 1 + responses: + '204': + description: No Content, Notification was successful + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + get: + summary: Read Application Data change Subscriptions + operationId: ReadApplicationDataChangeSubscriptions + tags: + - ApplicationDataSubscriptions (Collection) + parameters: + - name: data-filter + in: query + description: The data filter for the query. + required: false + schema: + $ref: '#/components/schemas/DataFilter' + responses: + '200': + description: The subscription information as request in the request URI query parameter(s) are returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApplicationDataSubs' + minItems: 0 + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/subs-to-notify/{subsId}: + parameters: + - name: subsId + in: path + required: true + schema: + type: string + put: + summary: Modify a subscription to receive notification of application data changes + operationId: ReplaceIndividualApplicationDataSubscription + tags: + - IndividualApplicationDataSubscription (Document) + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationDataSubs' + responses: + '200': + description: The individual subscription resource was updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationDataSubs' + '204': + description: The individual subscription resource was updated successfully and no additional content is to be sent in the response message. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete the individual Application Data subscription + operationId: DeleteIndividualApplicationDataSubscription + tags: + - IndividualApplicationDataSubscription (Document) + responses: + '204': + description: Upon success, an empty response body shall be returned. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + get: + summary: Get an existing individual Application Data Subscription resource + operationId: ReadIndividualApplicationDataSubscription + tags: + - IndividualApplicationDataSubscription (Document) + parameters: + - name: subsId + in: path + description: String identifying a subscription to the Individual Application Data Subscription + required: true + schema: + type: string + responses: + '200': + description: The subscription information is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationDataSubs' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + schemas: + TrafficInfluData: + type: object + properties: + upPathChgNotifCorreId: + type: string + description: Contains the Notification Correlation Id allocated by the NEF for the UP path change notification. + appReloInd: + type: boolean + description: Identifies whether an application can be relocated once a location of the application has been selected. + afAppId: + type: string + description: Identifies an application. + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + ethTrafficFilters: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + minItems: 1 + description: Identifies Ethernet packet filters. Either "trafficFilters" or "ethTrafficFilters" shall be included if applicable. + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + interGroupId: + type: string + description: Identifies a group of users. + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + trafficFilters: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + minItems: 1 + description: Identifies IP packet filters. Either "trafficFilters" or "ethTrafficFilters" shall be included if applicable. + trafficRoutes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + minItems: 1 + description: Identifies the N6 traffic routing requirement. + traffCorreInd: + type: boolean + validStartTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + validEndTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + tempValidities: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TemporalValidity' + minItems: 1 + description: Identifies the temporal validities for the N6 traffic routing requirement. + nwAreaInfo: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + upPathChgNotifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + subscribedEvents: + type: array + items: + $ref: 'TS29522_TrafficInfluence.yaml#/components/schemas/SubscribedEvent' + minItems: 1 + dnaiChgType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DnaiChangeType' + afAckInd: + type: boolean + addrPreserInd: + type: boolean + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + allOf: + - oneOf: + - required: [afAppId] + - required: [trafficFilters] + - required: [ethTrafficFilters] + - oneOf: + - required: [supi] + - required: [interGroupId] + TrafficInfluDataPatch: + type: object + properties: + upPathChgNotifCorreId: + type: string + description: Contains the Notification Correlation Id allocated by the NEF for the UP path change notification. + appReloInd: + type: boolean + description: Identifies whether an application can be relocated once a location of the application has been selected. + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + ethTrafficFilters: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + minItems: 1 + description: Identifies Ethernet packet filters. Either "trafficFilters" or "ethTrafficFilters" shall be included if applicable. + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + internalGroupId: + type: string + description: Identifies a group of users. + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + trafficFilters: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + minItems: 1 + description: Identifies IP packet filters. Either "trafficFilters" or "ethTrafficFilters" shall be included if applicable. + trafficRoutes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + minItems: 1 + description: Identifies the N6 traffic routing requirement. + traffCorreInd: + type: boolean + validStartTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + validEndTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + tempValidities: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TemporalValidity' + minItems: 1 + nullable: true + description: Identifies the temporal validities for the N6 traffic routing requirement. + nwAreaInfo: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + upPathChgNotifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + afAckInd: + type: boolean + addrPreserInd: + type: boolean + TrafficInfluSub: + type: object + properties: + dnns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + description: Each element identifies a DNN. + snssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + description: Each element identifies a slice. + internalGroupIds: + type: array + items: + type: string + minItems: 1 + description: Each element identifies a group of users. + supis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + description: Each element identifies the user. + notificationUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - notificationUri + oneOf: + - required: [dnns] + - required: [snssais] + - required: [internalGroupIds] + - required: [supis] + TrafficInfluDataNotif: + type: object + properties: + resUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + trafficInfluData: + $ref: '#/components/schemas/TrafficInfluData' + required: + - resourceId + PfdDataForAppExt: + allOf: + - $ref: 'TS29551_Nnef_PFDmanagement.yaml#/components/schemas/PfdDataForApp' + - type: object + properties: + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + BdtPolicyData: + type: object + properties: + interGroupId: + type: string + description: Identifies a group of users. + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + bdtRefId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + required: + - bdtRefId + BdtPolicyDataPatch: + type: object + properties: + bdtRefId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + required: + - bdtRefId + IptvConfigData: + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + interGroupId: + type: string + description: Identifies a group of users. + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + afAppId: + type: string + multiAccCtrls: + type: object + additionalProperties: + $ref: 'TS29522_IPTVConfiguration.yaml#/components/schemas/MulticastAccessControl' + minProperties: 1 + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - afAppId + - multiAccCtrls + - suppFeat + oneOf: + - required: [interGroupId] + - required: [supi] + IptvConfigDataPatch: + type: object + properties: + multiAccCtrls: + type: object + additionalProperties: + $ref: 'TS29522_IPTVConfiguration.yaml#/components/schemas/MulticastAccessControl' + minProperties: 1 + ServiceParameterData: + type: object + properties: + appId: + type: string + description: Identifies an application. + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + interGroupId: + type: string + description: Identifies a group of users. + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + ipv4Addr: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv6Addr' + macAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + paramOverPc5: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/ParameterOverPc5' + paramOverUu: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/ParameterOverUu' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + ApplicationDataSubs: + description: Identifies a subscription to application data change notification. + type: object + properties: + notificationUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + dataFilters: + type: array + items: + $ref: '#/components/schemas/DataFilter' + minItems: 1 + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - notificationUri + ApplicationDataChangeNotif: + description: Contains changed application data for which notification was requested. + type: object + properties: + iptvConfigData: + $ref: '#/components/schemas/IptvConfigData' + pfdData: + $ref: 'TS29551_Nnef_PFDmanagement.yaml#/components/schemas/PfdChangeNotification' + bdtPolicyData: + $ref: '#/components/schemas/BdtPolicyData' + resUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + serParamData: + $ref: '#/components/schemas/ServiceParameterData' + required: + - resUri + DataFilter: + description: Identifies a data filter. + type: object + properties: + dataInd: + $ref: '#/components/schemas/DataInd' + dnns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + snssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + internalGroupIds: + type: array + items: + type: string + minItems: 1 + supis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + appIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + ueIpv4s: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + ueIpv6s: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + ueMacs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + minItems: 1 + required: + - dataInd + oneOf: + - required: [dnns] + - required: [snssais] + - required: [internalGroupIds] + - required: [supis] + - required: [ueIpv4s] + - required: [ueIpv6s] + - required: [ueMacs] + DataInd: + anyOf: + - type: string + enum: + - PFD + - IPTV + - BDT + - SVC_PARAM + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - PFD + - IPTV + - BDT + - SVC_PARAM diff --git a/lib/sbi/support/standard/TS29519_Exposure_Data.yaml b/lib/sbi/support/standard/TS29519_Exposure_Data.yaml new file mode 100644 index 0000000000..c531d86d32 --- /dev/null +++ b/lib/sbi/support/standard/TS29519_Exposure_Data.yaml @@ -0,0 +1,656 @@ +openapi: 3.0.0 +info: + version: '-' + title: Unified Data Repository Service API file for structured data for exposure + description: | + The API version is defined in 3GPP TS 29.504 + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.519 V16.3.0; 5G System; Usage of the Unified Data Repository Service for Policy Data, Application Data and Structured Data for Exposure. + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.519/' + +paths: + /exposure-data/{ueId}/access-and-mobility-data: + put: + summary: Creates and updates the access and mobility exposure data for a UE + operationId: CreateOrReplaceAccessAndMobilityData + tags: + - AccessAndMobilityData + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AccessAndMobilityData' + responses: + '201': + description: Upon success, a response body is returned containing a representation of the access and mobility data + content: + application/json: + schema: + $ref: '#/components/schemas/AccessAndMobilityData' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + get: + summary: Retrieves the access and mobility exposure data for a UE + operationId: QueryAccessAndMobilityData + tags: + - AccessAndMobilityData + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supp-feat + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: The response body contains the access and mobility data + content: + application/json: + schema: + $ref: '#/components/schemas/AccessAndMobilityData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Deletes the access and mobility exposure data for a UE + operationId: DeleteAccessAndMobilityData + tags: + - AccessAndMobilityData + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '204': + description: Upon success, an empty response body shall be returned + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Updates the access and mobility exposure data for a UE + operationId: UpdateAccessAndMobilityData + tags: + - AccessAndMobilityData + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/AccessAndMobilityData' + responses: + '204': + description: Successful case. The resource has been successfully updated and no additional content is to be sent in the response message. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /exposure-data/{ueId}/session-management-data/{pduSessionId}: + put: + summary: Creates and updates the session management data for a UE and for an individual PDU session + operationId: CreateOrReplaceSessionManagementData + tags: + - PduSessionManagementData + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: pduSessionId + in: path + description: PDU session id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PduSessionManagementData' + responses: + '201': + description: Upon success, a response body is returned containing a representation of the session management data + content: + application/json: + schema: + $ref: '#/components/schemas/PduSessionManagementData' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + get: + summary: Retrieves the session management data for a UE and for an individual PDU session + operationId: QuerySessionManagementData + tags: + - PduSessionManagementData + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: pduSessionId + in: path + description: PDU session id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + - name: ipv4-addr + in: query + description: IPv4 Address of the UE + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + - name: ipv6-prefix + in: query + description: IPv6 Address Prefix of the UE + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + - name: dnn + in: query + description: DNN of the UE + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + - name: supp-feat + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: The response body contains the session management data + content: + application/json: + schema: + $ref: '#/components/schemas/PduSessionManagementData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Deletes the session management data for a UE and for an individual PDU session + operationId: DeleteSessionManagementData + tags: + - PduSessionManagementData + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: pduSessionId + in: path + description: PDU session id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + responses: + '204': + description: Upon success, an empty response body shall be returned + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /exposure-data/subs-to-notify: + post: + summary: Create a subscription to receive notification of exposure data changes + operationId: CreateIndividualExposureDataSubscription + tags: + - ExposureDataSubscriptions (Collection) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ExposureDataSubscription' + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/ExposureDataSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + exposureDataChangeNotification: + '{$request.body#/notificationUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ExposureDataChangeNotification' + minItems: 1 + responses: + '204': + description: No Content, Notification was successful + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /exposure-data/subs-to-notify/{subId}: + put: + summary: updates a subscription to receive notifications of exposure data changes + operationId: ReplaceIndividualExposureDataSubscription + tags: + - IndividualExposureDataSubscription (Document) + parameters: + - name: subId + in: path + description: Subscription id + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ExposureDataSubscription' + responses: + '200': + description: Resource was successfully modified and a body with the modified subscription to notifications about exposure data is returned.. + content: + application/json: + schema: + $ref: '#/components/schemas/ExposureDataSubscription' + '204': + description: The individual subscription resource was successfully modified. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Deletes the individual Exposure Data subscription + operationId: DeleteIndividualExposureDataSubscription + tags: + - IndividualExposureDataSubscription (Document) + parameters: + - name: subId + in: path + description: Subscription id + required: true + schema: + type: string + responses: + '204': + description: Resource was successfully deleted. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +components: + schemas: + AccessAndMobilityData: + type: object + properties: + location: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + locationTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + timeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + timeZoneTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + regStates: + type: array + items: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/RmInfo' + regStatesTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + connStates: + type: array + items: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/CmInfo' + connStatesTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + reachabilityStatus: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/UeReachability' + reachabilityStatusTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + smsOverNasStatus: + $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/SmsSupport' + smsOverNasStatusTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + roamingStatus: + type: boolean + description: True The serving PLMN of the UE is different from the HPLMN of the UE; False The serving PLMN of the UE is the HPLMN of the UE. + roamingStatusTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + currentPlmn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + currentPlmnTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ratType: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + ratTypesTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + PduSessionManagementData: + type: object + properties: + pduSessionStatus: + $ref: '#/components/schemas/PduSessionStatus' + pduSessionStatusTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + dnai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + dnaiTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + n6TrafficRoutingInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + n6TrafficRoutingInfoTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Prefix: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + minItems: 1 + description: UE IPv6 prefix. + ipv6Addrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + pduSessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + ipAddrTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + ExposureDataSubscription: + type: object + properties: + notificationUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + monitoredResourceUris: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - notificationUri + - monitoredResourceUris + ExposureDataChangeNotification: + type: object + properties: + ueId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + accessAndMobilityData: + $ref: '#/components/schemas/AccessAndMobilityData' + pduSessionManagementData: + type: array + items: + $ref: '#/components/schemas/PduSessionManagementData' + minItems: 1 + delResources: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + PduSessionStatus: + anyOf: + - type: string + enum: + - "ACTIVE" + - "RELEASED" + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - "ACTIVE" + - "RELEASED" diff --git a/lib/sbi/support/3gpp-spec/TS29519_Policy_Data.yaml b/lib/sbi/support/standard/TS29519_Policy_Data.yaml similarity index 99% rename from lib/sbi/support/3gpp-spec/TS29519_Policy_Data.yaml rename to lib/sbi/support/standard/TS29519_Policy_Data.yaml index c2395ce67b..529bb762d1 100644 --- a/lib/sbi/support/3gpp-spec/TS29519_Policy_Data.yaml +++ b/lib/sbi/support/standard/TS29519_Policy_Data.yaml @@ -4,7 +4,7 @@ info: title: Unified Data Repository Service API file for policy data description: | The API version is defined in 3GPP TS 29.504 - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. externalDocs: description: 3GPP TS 29.519 V16.3.0; 5G System; Usage of the Unified Data Repository Service for Policy Data, Application Data and Structured Data for Exposure. diff --git a/lib/sbi/support/3gpp-spec/TS29520_Nnwdaf_AnalyticsInfo.yaml b/lib/sbi/support/standard/TS29520_Nnwdaf_AnalyticsInfo.yaml similarity index 99% rename from lib/sbi/support/3gpp-spec/TS29520_Nnwdaf_AnalyticsInfo.yaml rename to lib/sbi/support/standard/TS29520_Nnwdaf_AnalyticsInfo.yaml index 6147ca1f6d..2926028222 100644 --- a/lib/sbi/support/3gpp-spec/TS29520_Nnwdaf_AnalyticsInfo.yaml +++ b/lib/sbi/support/standard/TS29520_Nnwdaf_AnalyticsInfo.yaml @@ -4,7 +4,7 @@ info: title: Nnwdaf_AnalyticsInfo description: | Nnwdaf_AnalyticsInfo Service API. - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. externalDocs: description: 3GPP TS 29.520 V16.3.0; 5G System; Network Data Analytics Services. diff --git a/lib/sbi/support/3gpp-spec/TS29520_Nnwdaf_EventsSubscription.yaml b/lib/sbi/support/standard/TS29520_Nnwdaf_EventsSubscription.yaml similarity index 99% rename from lib/sbi/support/3gpp-spec/TS29520_Nnwdaf_EventsSubscription.yaml rename to lib/sbi/support/standard/TS29520_Nnwdaf_EventsSubscription.yaml index bcdff8b623..df246e188e 100644 --- a/lib/sbi/support/3gpp-spec/TS29520_Nnwdaf_EventsSubscription.yaml +++ b/lib/sbi/support/standard/TS29520_Nnwdaf_EventsSubscription.yaml @@ -4,7 +4,7 @@ info: title: Nnwdaf_EventsSubscription description: | Nnwdaf_EventsSubscription Service API. - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. externalDocs: description: 3GPP TS 29.520 V16.3.0; 5G System; Network Data Analytics Services. @@ -298,7 +298,7 @@ components: items: $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' minItems: 1 - description: Identification(s) of network slice to which the subscription applies. When subscribed event is "SLICE_LOAD_LEVEL", either information about slice(s) identified by snssai, or anySlice set to "TRUE" shall be included. It corresponds to snssais in the data model definition of 3GPP TS 29.520. When subscribed is "QOS_SUSTAINABILITY", the identifications of network slices is optional. + description: Identification(s) of network slice to which the subscription applies. When subscribed event is "SLICE_LOAD_LEVEL", either information about slice(s) identified by snssai, or anySlice set to "TRUE" shall be included. It corresponds to snssais in the data model definition of 3GPP TS 29.520. When subscribed is “QOS_SUSTAINABILITYâ€, the identifications of network slices is optional. maxAnaEntry: $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' tgtUe: diff --git a/lib/sbi/support/3gpp-spec/TS29522_5GLANParameterProvision.yaml b/lib/sbi/support/standard/TS29522_5GLANParameterProvision.yaml similarity index 99% rename from lib/sbi/support/3gpp-spec/TS29522_5GLANParameterProvision.yaml rename to lib/sbi/support/standard/TS29522_5GLANParameterProvision.yaml index d8f4da8cb4..7b7c1a3f93 100644 --- a/lib/sbi/support/3gpp-spec/TS29522_5GLANParameterProvision.yaml +++ b/lib/sbi/support/standard/TS29522_5GLANParameterProvision.yaml @@ -4,7 +4,7 @@ info: version: 1.0.0.alpha-2 description: | API for 5G LAN Parameter Provision. - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. externalDocs: description: 3GPP TS 29.522 V16.3.0; 5G System; Network Exposure Function Northbound APIs. diff --git a/lib/sbi/support/3gpp-spec/TS29522_AnalyticsExposure.yaml b/lib/sbi/support/standard/TS29522_AnalyticsExposure.yaml similarity index 99% rename from lib/sbi/support/3gpp-spec/TS29522_AnalyticsExposure.yaml rename to lib/sbi/support/standard/TS29522_AnalyticsExposure.yaml index 18df99d68a..3bf50e2a38 100644 --- a/lib/sbi/support/3gpp-spec/TS29522_AnalyticsExposure.yaml +++ b/lib/sbi/support/standard/TS29522_AnalyticsExposure.yaml @@ -4,7 +4,7 @@ info: version: 1.0.0.alpha-2 description: | API for Analytics Exposure. - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. externalDocs: description: 3GPP TS 29.522 V16.3.0; 5G System; Network Exposure Function Northbound APIs. @@ -695,7 +695,7 @@ components: Possible values are - UE_MOBILITY: The AF requests to be notified about analytics information of UE mobility. - UE_COMM: The AF requests to be notified about analytics information of UE communication. - - ABNORMAL_BEHAVIOR: The AF requests to be notified about analytics information of UE's abnormal behavior. + - ABNORMAL_BEHAVIOR: The AF requests to be notified about analytics information of UE’s abnormal behavior. - CONGESTION: The AF requests to be notified about analytics information of user data congestion information. - NETWORK_PERFORMANCE: The AF requests to be notified about analytics information of network performance. - QOS_SUSTAINABILITY: The AF requests to be notified about analytics information of QoS sustainability. diff --git a/lib/sbi/support/3gpp-spec/TS29522_ApplyingBdtPolicy.yaml b/lib/sbi/support/standard/TS29522_ApplyingBdtPolicy.yaml similarity index 99% rename from lib/sbi/support/3gpp-spec/TS29522_ApplyingBdtPolicy.yaml rename to lib/sbi/support/standard/TS29522_ApplyingBdtPolicy.yaml index a2a1eecf25..ef58a96877 100644 --- a/lib/sbi/support/3gpp-spec/TS29522_ApplyingBdtPolicy.yaml +++ b/lib/sbi/support/standard/TS29522_ApplyingBdtPolicy.yaml @@ -4,7 +4,7 @@ info: version: 1.0.0.alpha-3 description: | API for applicying BDT policy - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. externalDocs: description: 3GPP TS 29.522 V16.3.0; 5G System; Network Exposure Function Northbound APIs. diff --git a/lib/sbi/support/standard/TS29522_IPTVConfiguration.yaml b/lib/sbi/support/standard/TS29522_IPTVConfiguration.yaml new file mode 100644 index 0000000000..4cca2e002b --- /dev/null +++ b/lib/sbi/support/standard/TS29522_IPTVConfiguration.yaml @@ -0,0 +1,380 @@ +openapi: 3.0.0 +info: + title: 3gpp-iptvconfiguration + version: 1.0.0.alpha-2 + description: | + API for IPTV configuration. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.522 V16.3.0; 5G System; Network Exposure Function Northbound APIs. + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-iptvconfiguration/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in subclause 5.2.4 of 3GPP TS 29.122. +paths: + /{afId}/configurations: + get: + summary: read all of the active configurations for the AF + tags: + - AF level GET Operation + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get all of the active configurations for the AF) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/IptvConfigData' + minItems: 0 + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new configuration resource + tags: + - Configuration level POST Operation + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + requestBody: + description: new configuration creation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/IptvConfigData' + responses: + '201': + description: Created (Successful creation of configuration) + content: + application/json: + schema: + $ref: '#/components/schemas/IptvConfigData' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '204': + description: Successful case. The resource has been successfully created and no additional content is to be sent in the response message. + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/configurations/{configurationId}: + get: + summary: read an active configuration for the AF and the configuration Id + tags: + - Configuration level GET Operation + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: configurationId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get the active configuration) + content: + application/json: + schema: + $ref: '#/components/schemas/IptvConfigData' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Updates/replaces an existing configuration resource + tags: + - Configuration level PUT Operation + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: configurationId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing configuration + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/IptvConfigData' + responses: + '200': + description: OK (Successful deletion of the existing configuration) + content: + application/json: + schema: + $ref: '#/components/schemas/IptvConfigData' + '204': + description: Successful case. The resource has been successfully updated and no additional content is to be sent in the response message. + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Partial updates an existing configuration resource + tags: + - Configuration level PATCH Operation + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: configurationId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/IptvConfigDataPatch' + responses: + '200': + description: OK. The configuration was modified successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/IptvConfigData' + '204': + description: Successful case. The resource has been successfully updated and no additional content is to be sent in the response message. + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing configuration + tags: + - Configuration level DELETE Operation + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: configurationId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + responses: + '204': + description: No Content (Successful deletion of the existing configuration) + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + IptvConfigData: + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + exterGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + afAppId: + type: string + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + multiAccCtrls: + type: object + additionalProperties: + $ref: '#/components/schemas/MulticastAccessControl' + minProperties: 1 + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - afAppId + - multiAccCtrls + - suppFeat + IptvConfigDataPatch: + type: object + properties: + multiAccCtrls: + type: object + additionalProperties: + $ref: '#/components/schemas/MulticastAccessControl' + minProperties: 1 + MulticastAccessControl: + type: object + properties: + srcIpv4Addr: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv4Addr' + srcIpv6Addr: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv6Addr' + multicastV4Addr: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv4Addr' + multicastV6Addr: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv6Addr' + accStatus: + $ref: '#/components/schemas/AccessRightStatus' + required: + - accStatus + AccessRightStatus: + anyOf: + - type: string + enum: + - FULLY_ALLOWED + - PREVIEW_ALLOWED + - NO_ALLOWED + - type: string + description: > + Possible values are + - FULLY_ALLOWED: The User is fully allowed to access to the channel. + - PREVIEW_ALLOWED: The User is preview allowed to access to the channel. + - NO_ALLOWED: The User is not allowed to access to the channel. diff --git a/lib/sbi/support/3gpp-spec/TS29522_LpiParameterProvision.yaml b/lib/sbi/support/standard/TS29522_LpiParameterProvision.yaml similarity index 99% rename from lib/sbi/support/3gpp-spec/TS29522_LpiParameterProvision.yaml rename to lib/sbi/support/standard/TS29522_LpiParameterProvision.yaml index 8b83f4a16e..5f56db3d86 100644 --- a/lib/sbi/support/3gpp-spec/TS29522_LpiParameterProvision.yaml +++ b/lib/sbi/support/standard/TS29522_LpiParameterProvision.yaml @@ -4,7 +4,7 @@ info: version: 1.0.0.alpha-1 description: | API for Location Privacy Indication Parameters Provisioning. - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. externalDocs: description: 3GPP TS 29.522 V16.3.0; 5G System; Network Exposure Function Northbound APIs. diff --git a/lib/sbi/support/3gpp-spec/TS29522_NIDDConfigurationTrigger.yaml b/lib/sbi/support/standard/TS29522_NIDDConfigurationTrigger.yaml similarity index 97% rename from lib/sbi/support/3gpp-spec/TS29522_NIDDConfigurationTrigger.yaml rename to lib/sbi/support/standard/TS29522_NIDDConfigurationTrigger.yaml index b342a93105..831bdbc89b 100644 --- a/lib/sbi/support/3gpp-spec/TS29522_NIDDConfigurationTrigger.yaml +++ b/lib/sbi/support/standard/TS29522_NIDDConfigurationTrigger.yaml @@ -4,7 +4,7 @@ info: version: 1.0.0.alpha-1 description: | API for NIDD Configuration Trigger. - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. externalDocs: description: 3GPP TS 29.522 V16.3.0; 5G System; Network Exposure Function Northbound APIs. diff --git a/lib/sbi/support/standard/TS29522_ServiceParameter.yaml b/lib/sbi/support/standard/TS29522_ServiceParameter.yaml new file mode 100644 index 0000000000..78c6f623f0 --- /dev/null +++ b/lib/sbi/support/standard/TS29522_ServiceParameter.yaml @@ -0,0 +1,637 @@ +openapi: 3.0.0 +info: + title: 3gpp-service-parameter + version: 1.0.0.alpha-1 + description: | + API for AF service paramter + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.522 V16.3.0; 5G System; Network Exposure Function Northbound APIs. + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-service-parameter/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in subclause 5.2.4 of 3GPP TS 29.122. + +paths: + /{afId}/subscriptions: + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + get: + summary: read all of the active subscriptions for the AF + tags: + - ServiceParameter API SCS/AS level GET Operation + responses: + '200': + description: OK. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ServiceParameterData' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new subscription resource + tags: + - ServiceParameter API Subscription level POST Operation + requestBody: + description: Request to create a new subscription resource + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceParameterData' + responses: + '201': + description: Created (Successful creation of subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceParameterData' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/subscriptions/{subscriptionId}: + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + get: + summary: read an active subscriptions for the SCS/AS and the subscription Id + tags: + - ServiceParameter API Subscription level GET Operation + responses: + '200': + description: OK (Successful get the active subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceParameterData' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Updates/replaces an existing subscription resource + tags: + - TrafficInfluence API subscription level PUT Operation + requestBody: + description: Parameters to update/replace the existing subscription + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceParameterData' + responses: + '200': + description: OK (Successful update of the subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceParameterData' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Updates/replaces an existing subscription resource + tags: + - ServiceParameter API subscription level PATCH Operation + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/ServiceParameterDataPatch' + responses: + '200': + description: OK. The subscription was modified successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceParameterData' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing subscription + tags: + - ServiceParameter API Subscription level DELETE Operation + responses: + '204': + description: No Content (Successful deletion of the existing subscription) + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + ServiceParameterData: + type: object + properties: + afServiceId: + type: string + description: Identifies a service on behalf of which the AF is issuing the request. + appId: + type: string + description: Identifies an application. + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + anyUeInd: + type: boolean + description: Identifies whether the AF request applies to any UE. This attribute shall set to "true" if applicable for any UE, otherwise, set to "false". + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + ueIpv4: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv4Addr' + ueIpv6: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv6Addr' + ueMac: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + paramOverPc5: + $ref: '#/components/schemas/ParameterOverPc5' + paramOverUu: + $ref: '#/components/schemas/ParameterOverUu' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + ServiceParameterDataPatch: + type: object + properties: + paramOverPc5: + $ref: '#/components/schemas/ParameterOverPc5Rm' + ParamOverUu: + $ref: '#/components/schemas/ParameterOverUuRm' + ParameterOverPc5: + type: object + properties: + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + plmmRatServed: + type: array + items: + $ref: '#/components/schemas/PlmnRatServed' + minItems: 1 + authNotServed: + type: boolean + radioParamsNotServed: + type: array + items: + $ref: '#/components/schemas/RadioParameterNotServed' + minItems: 1 + serToTx: + type: array + items: + $ref: '#/components/schemas/ServiceToTx' + minItems: 1 + privacyParams: + type: array + items: + $ref: '#/components/schemas/PrivacyParameter' + minItems: 1 + configParaEutra: + $ref: '#/components/schemas/ConfigurationParametersEutra' + configParaNr: + $ref: '#/components/schemas/ConfigurationParametersNr' + ParameterOverUu: + type: object + properties: + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + serToPduSess: + type: array + items: + $ref: '#/components/schemas/ServiceToPduSession' + minItems: 1 + serToAppAddr: + type: array + items: + $ref: '#/components/schemas/ServiceApplicationServerAddress' + minItems: 1 + PlmnRatServed: + type: object + properties: + plmn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + rats: + type: array + items: + $ref: '#/components/schemas/V2xRatType' + required: + - plmn + - rats + RadioParameterNotServed: + type: object + properties: + radioParams: + type: string + rat: + $ref: '#/components/schemas/V2xRatType' + geographicalArea: + type: string + operManaged: + $ref: '#/components/schemas/OperatorManaged' + required: + - radioParams + - geographicalArea + - operManaged + - rat + ServiceToTx: + type: object + properties: + serIds: + type: array + items: + type: string + minItems: 1 + txProfile: + type: string + rat: + $ref: '#/components/schemas/V2xRatType' + required: + - serIds + - txProfile + - rat + PrivacyParameter: + type: object + properties: + serIds: + type: array + items: + type: string + minItems: 1 + geographicalArea: + type: string + timer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + required: + - serIds + - geographicalArea + - timer + ConfigurationParametersEutra: + type: object + properties: + serToLayer2Ids: + type: array + items: + $ref: '#/components/schemas/ServiceIdToLayer2Id' + minItems: 1 + ppppToPdbs: + type: array + items: + $ref: '#/components/schemas/PpppToPdb' + minItems: 1 + serIdToFrequs: + type: array + items: + $ref: '#/components/schemas/ServiceIdToFrequency' + minItems: 1 + serIdToPpprs: + type: array + items: + $ref: '#/components/schemas/ServiceIdToPppr' + minItems: 1 + ConfigurationParametersNr: + type: object + properties: + serToBroLayer2Ids: + type: array + items: + $ref: '#/components/schemas/ServiceIdToLayer2Id' + minItems: 1 + serToGroLayer2Ids: + type: array + items: + $ref: '#/components/schemas/ServiceIdToLayer2Id' + minItems: 1 + serToDefLayer2Ids: + type: array + items: + $ref: '#/components/schemas/ServiceIdToLayer2Id' + minItems: 1 + serIdToFrequs: + type: array + items: + $ref: '#/components/schemas/ServiceIdToFrequency' + minItems: 1 + pc5QosMappings: + type: array + items: + $ref: '#/components/schemas/Pc5QosMapping' + minItems: 1 + slrbConfigs: + type: array + items: + $ref: '#/components/schemas/SlrbConfigurations' + minItems: 1 + ServiceIdToLayer2Id: + type: object + properties: + serIds: + type: array + items: + type: string + minItems: 1 + desLayer2Id: + type: string + required: + - serIds + - desLayer2Id + PpppToPdb: + type: object + properties: + pppp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + pdb: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' + required: + - pppp + - pdb + ServiceIdToFrequency: + type: object + properties: + serIds: + type: array + items: + type: string + minItems: 1 + frequency: + type: number + geographicalArea: + type: string + required: + - serIds + - frequency + - geopraphicalArea + ServiceIdToPppr: + type: object + properties: + serIds: + type: array + items: + type: string + minItems: 1 + pppr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + required: + - serIds + - pppr + Pc5QosMapping: + type: object + properties: + serIds: + type: array + items: + type: string + minItems: 1 + pc5QoSFlowParam: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pc5QosFlowItem' + required: + - serIds + - pc5QosFlowParam + SlrbConfigurations: + type: object + properties: + pc5QosPara: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pc5QoSPara' + slrb: + type: string + required: + - pc5QosPara + - slrb + ServiceToPduSession: + type: object + properties: + serIds: + type: array + items: + type: string + minItems: 1 + pduSessionType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + sscMode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SscMode' + sliceInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + dnns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + required: + - serIds + ServiceApplicationServerAddress: + type: object + properties: + serIds: + type: array + items: + type: string + minItems: 1 + fqdn: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/Fqdn' + Ipv4Addrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + Ipv6Addrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + udpPortNumbers: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + minItems: 1 + tcpPortNumbers: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + minItems: 1 + plmns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + geopraphicalArea: + type: string + required: + - serIds + - plmns + - geographicalArea + ParameterOverPc5Rm: + type: string +# Editor's note: Type is FFS. String only used to pass Syntax check. + ParameterOverUuRm: + type: string +# Editor's note: Type is FFS. String only used to pass Syntax check. + OperatorManaged: + anyOf: + - type: string + enum: + - OPERATOR_MANAGED + - NON_OPERATOR_MANAGED + - type: string + description: > + Possible values are + - OPERATOR_MANAGED: The radio parameters are "operator managed". + - NON_OPERATOR_MANAGED: The radio parameters are "non-operator managed". + V2xRatType: + anyOf: + - type: string + enum: + - PC5_LTE + - PC5_NR + - type: string + description: > + Possible values are + - PC5_LTE: Indicates the LTE RAT type over PC5 interface. + - PC5_NR: Indicates the NR RAT type over NR interface. diff --git a/lib/sbi/support/standard/TS29522_TrafficInfluence.yaml b/lib/sbi/support/standard/TS29522_TrafficInfluence.yaml new file mode 100644 index 0000000000..b67851f691 --- /dev/null +++ b/lib/sbi/support/standard/TS29522_TrafficInfluence.yaml @@ -0,0 +1,564 @@ +openapi: 3.0.0 +info: + title: 3gpp-traffic-influence + version: 1.1.0.alpha-4 + description: | + API for AF traffic influence + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.522 V16.3.0; 5G System; Network Exposure Function Northbound APIs. + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-traffic-influence/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in subclause 5.2.4 of 3GPP TS 29.122. + +paths: + /{afId}/subscriptions: + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + get: + summary: read all of the active subscriptions for the AF + tags: + - TrafficInfluence API SCS/AS level GET Operation + responses: + '200': + description: OK. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TrafficInfluSub' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new subscription resource + tags: + - TrafficInfluence API Subscription level POST Operation + requestBody: + description: Request to create a new subscription resource + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + callbacks: + notificationDestination: + '{request.body#/notificationDestination}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EventNotification' + callbacks: + afAcknowledgement: + '{request.body#/afAckUri}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AfAckInfo' + responses: + '204': + description: No Content (successful acknowledgement) + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + responses: + '204': + description: No Content (successful notification) + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + responses: + '201': + description: Created (Successful creation of subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/subscriptions/{subscriptionId}: + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + get: + summary: read an active subscriptions for the SCS/AS and the subscription Id + tags: + - TrafficInfluence API Subscription level GET Operation + responses: + '200': + description: OK (Successful get the active subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Updates/replaces an existing subscription resource + tags: + - TrafficInfluence API subscription level PUT Operation + requestBody: + description: Parameters to update/replace the existing subscription + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + responses: + '200': + description: OK (Successful update of the subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Updates/replaces an existing subscription resource + tags: + - TrafficInfluence API subscription level PATCH Operation + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/TrafficInfluSubPatch' + responses: + '200': + description: OK. The subscription was modified successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing subscription + tags: + - TrafficInfluence API Subscription level DELETE Operation + responses: + '204': + description: No Content (Successful deletion of the existing subscription) + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + TrafficInfluSub: + type: object + properties: + afServiceId: + type: string + description: Identifies a service on behalf of which the AF is issuing the request. + afAppId: + type: string + description: Identifies an application. + afTransId: + type: string + description: Identifies an NEF Northbound interface transaction, generated by the AF. + appReloInd: + type: boolean + description: Identifies whether an application can be relocated once a location of the application has been selected. + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + anyUeInd: + type: boolean + description: Identifies whether the AF request applies to any UE. This attribute shall set to "true" if applicable for any UE, otherwise, set to "false". + subscribedEvents: + type: array + items: + $ref: '#/components/schemas/SubscribedEvent' + minItems: 1 + description: Identifies the requirement to be notified of the event(s). + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + ipv4Addr: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv6Addr' + macAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + dnaiChgType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DnaiChangeType' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + requestTestNotification: + type: boolean + description: Set to true by the SCS/AS to request the NEF to send a test notification as defined in subclause 5.2.5.3. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + trafficFilters: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + minItems: 1 + description: Identifies IP packet filters. + ethTrafficFilters: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + minItems: 1 + description: Identifies Ethernet packet filters. + trafficRoutes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + minItems: 1 + description: Identifies the N6 traffic routing requirement. + tfcCorrInd: + type: boolean + tempValidities: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TemporalValidity' + validGeoZoneIds: + type: array + items: + type: string + minItems: 1 + description: Identifies a geographic zone that the AF request applies only to the traffic of UE(s) located in this specific zone. + afAckInd: + type: boolean + addrPreserInd: + type: boolean + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + allOf: + - oneOf: + - required: [afAppId] + - required: [trafficFilters] + - required: [ethTrafficFilters] + - oneOf: + - required: [ipv4Addr] + - required: [ipv6Addr] + - required: [macAddr] + - required: [gpsi] + - required: [externalGroupId] + - required: [anyUeInd] + anyOf: + - not: + required: [subscribedEvents] + - required: [notificationDestination] + TrafficInfluSubPatch: + type: object + properties: + appReloInd: + type: boolean + description: Identifies whether an application can be relocated once a location of the application has been selected. + nullable: true + trafficFilters: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + minItems: 1 + description: Identifies IP packet filters. + ethTrafficFilters: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + minItems: 1 + description: Identifies Ethernet packet filters. + trafficRoutes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + minItems: 1 + description: Identifies the N6 traffic routing requirement. + tfcCorrInd: + type: boolean + nullable: true + tempValidities: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TemporalValidity' + minItems: 1 + nullable: true + validGeoZoneIds: + type: array + items: + type: string + minItems: 1 + description: Identifies a geographic zone that the AF request applies only to the traffic of UE(s) located in this specific zone. + nullable: true + afAckInd: + type: boolean + nullable: true + addrPreserInd: + type: boolean + nullable: true + EventNotification: + type: object + properties: + afTransId: + type: string + description: Identifies an NEF Northbound interface transaction, generated by the AF. + dnaiChgType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DnaiChangeType' + sourceTrafficRoute: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + subscribedEvent: + $ref: '#/components/schemas/SubscribedEvent' + targetTrafficRoute: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + sourceDnai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + targetDnai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + srcUeIpv4Addr: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv4Addr' + srcUeIpv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + tgtUeIpv4Addr: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv4Addr' + tgtUeIpv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + ueMac: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + afAckUri: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + required: + - dnaiChgType + - subscribedEvent + AfResultInfo: + type: object + properties: + afStatus: + $ref: '#/components/schemas/AfResultStatus' + trafficRoute: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + required: + - afStatus + AfAckInfo: + type: object + properties: + afTransId: + type: string + ackResult: + $ref: '#/components/schemas/AfResultInfo' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + required: + - ackResult + SubscribedEvent: + anyOf: + - type: string + enum: + - UP_PATH_CHANGE + - type: string + description: > + Possible values are + - UP_PATH_CHANGE: The AF requests to be notified when the UP path changes for the PDU session. + AfResultStatus: + anyOf: + - type: string + enum: + - SUCCESS + - TEMPORARY_CONGESTION + - RELOC_NO_ALLOWED + - OTHER + - type: string + description: > + Possible values are + - SUCCESS: The application layer is ready or the relocation is completed. + - TEMPORARY_CONGESTION: The application relocation fails due to temporary congestion. + - RELOC_NO_ALLOWED: The application relocation fails because application relocation is not allowed. + - OTHER: The application relocation fails due to other reason. diff --git a/lib/sbi/support/standard/TS29544_Nspaf_SecuredPacket.yaml b/lib/sbi/support/standard/TS29544_Nspaf_SecuredPacket.yaml new file mode 100644 index 0000000000..f7ff542fe7 --- /dev/null +++ b/lib/sbi/support/standard/TS29544_Nspaf_SecuredPacket.yaml @@ -0,0 +1,93 @@ +openapi: 3.0.0 +info: + title: 'Nspaf_SecuredPacket' + version: 1.0.0.alpha-2 + description: | + Nspaf Secured Packet Service. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.544, SP-AF Services, version 16.0.0 + url: http://www.3gpp.org/ftp/Specs/archive/29_series/29.544/ +servers: + - url: '{apiRoot}/nspaf-secured-packet/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 +security: + - {} + - oAuth2ClientCredentials: + - nspaf-secured-packet +paths: + /{supi}/provide-secured-packet: + post: + summary: request generation of a secured packet + operationId: ProvideSecuredPacket + tags: + - SecuredPacket Generation (Custom Operation) + parameters: + - name: supi + in: path + description: SUPI of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UiccConfigurationParameter' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SecuredPacket' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nspaf-secured-packet: Access to the nspaf-secured-packet API + schemas: + +# COMPLEX TYPES: + + UiccConfigurationParameter: + type: object + properties: + routingId: + $ref: '#/components/schemas/RoutingId' + steeringContainer: + type: array + items: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SteeringInfo' + minItems: 1 + +# SIMPLE TYPES: + + RoutingId: + type: string + pattern: '^[0-9]{1,4}$' + +# ENUMS: + + + diff --git a/lib/sbi/support/3gpp-spec/TS29486_VAE_MessageDelivery.yaml b/lib/sbi/support/standard/TS29551_Nnef_PFDmanagement.yaml similarity index 50% rename from lib/sbi/support/3gpp-spec/TS29486_VAE_MessageDelivery.yaml rename to lib/sbi/support/standard/TS29551_Nnef_PFDmanagement.yaml index 16c88f519d..0b37836857 100644 --- a/lib/sbi/support/3gpp-spec/TS29486_VAE_MessageDelivery.yaml +++ b/lib/sbi/support/standard/TS29551_Nnef_PFDmanagement.yaml @@ -1,49 +1,58 @@ openapi: 3.0.0 info: - version: 1.0.0.alpha-4 - title: VAE_MessageDelivery + title: Nnef_PFDmanagement Sevice API + version: 1.1.0.alpha-3 description: | - API for VAE Message Delivery Service - (C) 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + Packet Flow Description Management Service. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. +# externalDocs: - description: 3GPP TS 29.486 V16.0.0 V2X Application Enabler (VAE) Services - url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.486/' -security: - - {} - - oAuth2ClientCredentials: [] + description: 3GPP TS 29.551 v16.3.0, 5G System; Packet Flow Description Management Service + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.551/' +# servers: - - url: '{apiRoot}/vae-message-delivery/v1' + - url: '{apiRoot}/nnef-pfdmanagement/v1' variables: apiRoot: default: https://example.com - description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + description: apiRoot as defined in subclause 4.4 of 3GPP TS 29.501 +security: + - {} + - oAuth2ClientCredentials: + - nnef-pfdmanagement paths: - /subscriptions: - post: - summary: Create a new Individual Message Delivery Data Subscription resource - operationId: CreateIndividualMessageDeliveryDataSubscription + /applications: + get: + summary: Retrieve PFDs for all applications or for one or multiple applications with query parameter. tags: - - Message Delivery Data Subscriptions (Collection) - requestBody: - required: true - content: - application/json: + - PFD of applications + operationId: Nnef_PFDmanagement_Fetch + parameters: + - name: application-ids + description: The required application identifier(s) for the returned PFDs. + in: query + required: true schema: - $ref: '#/components/schemas/MessageDeliverySubscriptionData' + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + - name: supported-features + in: query + description: To filter irrelevant responses related to unsupported features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' responses: - '201': - description: The subscription was created successfully. + '200': + description: The PFDs for one or more application identifier(s) in the request URI are returned. content: application/json: schema: - $ref: '#/components/schemas/MessageDeliverySubscriptionData' - headers: - Location: - description: 'Contains the URI of the newly created resource' - required: true - schema: - type: string + type: array + items: + $ref: '#/components/schemas/PfdDataForApp' + minItems: 0 '400': $ref: 'TS29571_CommonData.yaml#/components/responses/400' '401': @@ -52,33 +61,103 @@ paths: $ref: 'TS29571_CommonData.yaml#/components/responses/403' '404': $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '411': - $ref: 'TS29571_CommonData.yaml#/components/responses/411' - '413': - $ref: 'TS29571_CommonData.yaml#/components/responses/413' - '415': - $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' '429': $ref: 'TS29571_CommonData.yaml#/components/responses/429' '500': $ref: 'TS29571_CommonData.yaml#/components/responses/500' '503': $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /applications/{appId}: + get: + summary: Retrieve the PFD for an application. + tags: + - Individual application PFD + operationId: Nnef_PFDmanagement_Fetch + parameters: + - name: appId + description: The required application identifier(s) for the returned PFDs. + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: To filter irrelevant responses related to unsupported features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: A representation of PFDs for an application in the request URI is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdDataForApp' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + + /subscriptions: + post: + summary: Subscribe the notification of PFD changes. + tags: + - PFD subscriptions + operationId: Nnef_PFDmanagement_Subscribe + requestBody: + description: a PfdSubscription resource to be created. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PfdSubscription' callbacks: - uplinkMessageDelivery: - '{$request.body#/notifUri}': + PfdChangeNotification: + '{request.body#/notifyUri}': post: + summary: Notification of PFD change. + tags: + - PfdChangeNotification data + operationId: Nnef_PFDmanagement_Notify requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/UplinkMessageDeliveryData' + type: array + items: + $ref: '#/components/schemas/PfdChangeNotification' + minItems: 1 responses: + '200': + description: The PFD operation in the notification is performed and the PfdChangeReport indicates failure reason. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PfdChangeReport' + minItems: 1 '204': - description: No Content, Notification was successful + description: The PFD operation in the notification is performed successfully. '400': $ref: 'TS29571_CommonData.yaml#/components/responses/400' '401': @@ -99,29 +178,21 @@ paths: $ref: 'TS29571_CommonData.yaml#/components/responses/500' '503': $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - - /subscriptions/{subscriptionId}: - get: - summary: Get an existing individual Message Delivery Subscription resource - operationId: ReadIndividualMessageDeliverySubscription - tags: - - Individual Message Delivery Subscription (Document) - parameters: - - name: subscriptionId - in: path - description: String identifying a subscription to the Individual Message Delivery Subscription - required: true - schema: - type: string + + responses: - '200': - description: The subscription information is returned. + '201': + description: The creation of a PfdSubscription resource is confirmed and a representation of that resource is returned. content: application/json: schema: - $ref: '#/components/schemas/MessageDeliverySubscriptionData' + $ref: '#/components/schemas/PfdSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nnef-pfdmanagement/v1/subscriptions/{subscriptionId}' + required: true + schema: + type: string '400': $ref: 'TS29571_CommonData.yaml#/components/responses/400' '401': @@ -130,81 +201,46 @@ paths: $ref: 'TS29571_CommonData.yaml#/components/responses/403' '404': $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '406': - $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' '429': $ref: 'TS29571_CommonData.yaml#/components/responses/429' '500': $ref: 'TS29571_CommonData.yaml#/components/responses/500' '503': $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - delete: - summary: Delete an individual Message Delivery Subscription resource - operationId: DeleteMessageDeliverySubscription + + /subscriptions/{subscriptionId}: + put: + summary: Updates/replaces an existing subscription resource tags: - - Individual Message Delivery Subscription (Document) + - Individual PFD subscription + operationId: Nnef_PFDmanagement_Subscribe parameters: - name: subscriptionId + description: Identify the subscription. in: path - description: String identifying a subscription to the Individual Message Delivery Subscription - required: true - schema: - type: string - responses: - '204': - description: The subscription was terminated successfully. - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - $ref: 'TS29571_CommonData.yaml#/components/responses/default' - - - /subscriptions/{subscriptionId}/message-deliveries: - post: - summary: VAE Message delivery resource create service Operation - tags: - - message deliveries collection (Collection) - operationId: CreateDownlinkMessageDelivery - parameters: - - name: subscriptionId - in: path - description: String identifying a subscription to the Individual Message Delivery Subscription required: true schema: type: string requestBody: + description: Parameters to update/replace the existing subscription + required: true content: application/json: schema: - $ref: '#/components/schemas/DownlinkMessageDeliveryData' - required: true + $ref: '#/components/schemas/PfdSubscription' responses: - '201': - description: Downlink Message Delivery Resource Created - headers: - Location: - description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/vae-message-delivery/v1/subscriptions/{subscriptionId}/message-deliveries/{dlDeliveryId}' - required: true - schema: - type: string + '200': + description: OK (Successful update of the subscription) content: application/json: schema: - $ref: '#/components/schemas/DownlinkMessageDeliveryData' + $ref: '#/components/schemas/PfdSubscription' '400': $ref: 'TS29571_CommonData.yaml#/components/responses/400' '401': @@ -225,73 +261,24 @@ paths: $ref: 'TS29571_CommonData.yaml#/components/responses/500' '503': $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - description: Unexpected error - /subscriptions/{subscriptionId}/message-deliveries/{dlDeliveryId}: - get: - summary: VAE Message delivery resource Read service Operation - tags: - - Individual downlink message delivery (Document) - operationId: ReadIndividualDownlinkMessageDelivery - parameters: - - name: subscriptionId - in: path - description: String identifying a subscription to the Individual Message Delivery Subscription - required: true - schema: - type: string - - name: dlDeliveryId - in: path - description: Identifier of a downlink messge delivery resource - required: true - schema: - type: string - responses: - '200': - description: OK. Resource representation is returned - content: - application/json: - schema: - $ref: '#/components/schemas/DownlinkMessageDeliveryData' - '400': - $ref: 'TS29571_CommonData.yaml#/components/responses/400' - '401': - $ref: 'TS29571_CommonData.yaml#/components/responses/401' - '403': - $ref: 'TS29571_CommonData.yaml#/components/responses/403' - '404': - $ref: 'TS29571_CommonData.yaml#/components/responses/404' - '406': - $ref: 'TS29571_CommonData.yaml#/components/responses/406' - '429': - $ref: 'TS29571_CommonData.yaml#/components/responses/429' - '500': - $ref: 'TS29571_CommonData.yaml#/components/responses/500' - '503': - $ref: 'TS29571_CommonData.yaml#/components/responses/503' default: $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: - summary: VAE Message delivery resource delete service Operation + summary: Delete a subscription of PFD change notification. tags: - - Individual message delivery (Document) - operationId: DeleteMessageDelivery + - Individual PFD subscription + operationId: Nnef_PFDmanagement_Unsubscribe parameters: - name: subscriptionId - in: path - description: String identifying a subscription to the Individual Message Delivery Subscription - required: true - schema: - type: string - - name: dlDeliveryId + description: Identify the subscription. in: path required: true - description: Unique ID of the message delivery to be deleted schema: type: string responses: '204': - description: No Content (Successful deletion of the existing subscription) + description: The PfdSubscription resource matching the subscriptionId was deleted successfully. '400': $ref: 'TS29571_CommonData.yaml#/components/responses/400' '401': @@ -306,78 +293,109 @@ paths: $ref: 'TS29571_CommonData.yaml#/components/responses/500' '503': $ref: 'TS29571_CommonData.yaml#/components/responses/503' - default: - description: Unexpected error + components: securitySchemes: oAuth2ClientCredentials: type: oauth2 - flows: - clientCredentials: - tokenUrl: '{tokenUrl}' - scopes: {} + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nnef-pfdmanagement: Access to the Nnef_PFDmanagement API schemas: - DownlinkMessageDeliveryData: +# +# STRUCTURED DATA TYPES +# + PfdContent: type: object properties: - ueId: - $ref: '#/components/schemas/V2xUeId' - groupId: - $ref: '#/components/schemas/V2xGroupId' - duration: + pfdId: + type: string + description: Identifies a PDF of an application identifier. + flowDescriptions: + type: array + items: + type: string + minItems: 1 + description: Represents a 3-tuple with protocol, server ip and server port for UL/DL application traffic. + urls: + type: array + items: + type: string + minItems: 1 + description: Indicates a URL or a regular expression which is used to match the significant parts of the URL. + domainNames: + type: array + items: + type: string + minItems: 1 + description: Indicates an FQDN or a regular expression as a domain name matching criteria. + dnProtocol: + $ref: 'TS29122_PfdManagement.yaml#/components/schemas/DomainNameProtocol' + + + PfdDataForApp: + type: object + properties: + applicationId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + pfds: + type: array + items: + $ref: '#/components/schemas/PfdContent' + minItems: 1 + cachingTime: $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' - geoId: - $ref: '#/components/schemas/GeoId' - payload: - $ref: '#/components/schemas/V2xMessagePayload' required: - - payload - MessageDeliverySubscriptionData: + - applicationId + - pfds + + PfdSubscription: type: object properties: - appSerId: - $ref: '#/components/schemas/AppServerId' - serviceId: - $ref: '#/components/schemas/V2xServiceId' - geoId: - $ref: '#/components/schemas/GeoId' - notifUri: + applicationIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + notifyUri: $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - requestTestNotification: - type: boolean - description: Set to true by the NF service consumer to request the VAE server to send a test notification as defined in clause 6.1.5.3. Set to false or omitted otherwise. - websockNotifConfig: - $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' - suppFeat: + supportedFeatures: $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' required: - - appSerId - - serviceId - - notifUri - UplinkMessageDeliveryData: + - notifyUri + - supportedFeatures + + PfdChangeNotification: type: object properties: - resourceUri: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' - ueId: - $ref: '#/components/schemas/V2xUeId' - geoId: - $ref: '#/components/schemas/GeoId' - payload: - $ref: '#/components/schemas/V2xMessagePayload' + applicationId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + removalFlag: + type: boolean + default: false + partialFlag: + type: boolean + default: false + pfds: + type: array + items: + $ref: '#/components/schemas/PfdContent' + minItems: 1 required: - - resourceUri - - ueId - - payload - AppServerId: - type: string - V2xUeId: - type: string - V2xGroupId: - type: string - V2xServiceId: - type: string - GeoId: - type: string - V2xMessagePayload: - $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + - applicationId + + PfdChangeReport: + type: object + properties: + pfdError: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + applicationId: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + required: + - pfdError + - applicationId diff --git a/lib/sbi/support/standard/TS29554_Npcf_BDTPolicyControl.yaml b/lib/sbi/support/standard/TS29554_Npcf_BDTPolicyControl.yaml new file mode 100644 index 0000000000..a6ead04e64 --- /dev/null +++ b/lib/sbi/support/standard/TS29554_Npcf_BDTPolicyControl.yaml @@ -0,0 +1,383 @@ +openapi: 3.0.0 +info: + title: Npcf_BDTPolicyControl Service API + version: 1.1.0.alpha-4 + description: | + PCF BDT Policy Control Service. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +# +externalDocs: + description: 3GPP TS 29.554 V16.3.0; 5G System; Background Data Transfer Policy Control Service. + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.554/' +# +servers: + - url: '{apiRoot}/npcf-bdtpolicycontrol/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in subclause 4.4 of 3GPP TS 29.501. +security: + - {} + - oAuth2ClientCredentials: + - npcf-bdtpolicycontrol +paths: + /bdtpolicies: + post: + summary: Create a new Individual BDT policy + operationId: CreateBDTPolicy + tags: + - BDT policies (Collection) + requestBody: + description: Contains information for the creation of a new Individual BDT policy resource. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BdtReqData' + responses: + '201': + description: Background data transfer policies offered to an ASP. + content: + application/json: + schema: + $ref: '#/components/schemas/BdtPolicy' + headers: + Location: + description: 'Contains the URI of the created individual BDT policy resource, according to the structure: {apiRoot}/npcf-bdtpolicycontrol/v1/bdtpolicies/{bdtPolicyId}' + required: true + schema: + type: string +# +# Error scenarios POST +# + '303': + description: See Other. The result of the POST request would be equivalent to the existing Individual BDT policy resource. The HTTP response shall contain a Location header field set to the URI of the existing individual BDT policy resource. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +# +# End error scenarios POST +# + callbacks: + BdtNotification: + '{$request.body#/notifUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Notification' + responses: + '204': + description: No Content, a reception of the BDT notification was successful. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +# + /bdtpolicies/{bdtPolicyId}: + get: + summary: Read an Individual BDT policy + operationId: GetBDTPolicy + tags: + - Individual BDT policy (Document) + parameters: + - name: bdtPolicyId + description: String identifying the individual BDT policy resource in the PCF. + in: path + required: true + schema: + type: string + responses: + '200': + description: Background data transfer policies offered to and selected by an ASP. + content: + application/json: + schema: + $ref: '#/components/schemas/BdtPolicy' +# +# Error scenarios GET +# + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +# +# End error scenarios GET +# + patch: + summary: Update an Individual BDT policy + operationId: UpdateBDTPolicy + tags: + - Individual BDT policy (Document) + parameters: + - name: bdtPolicyId + description: String identifying the individual BDT policy resource in the PCF. + in: path + required: true + schema: + type: string + requestBody: + description: Contains modification instruction to be performed on the BdtPolicy data structure to select a transfer policy and in addition, may indicate whether the BDT warning notification is enabled or disabled. + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/BdtPolicyDataPatch' + responses: + '200': + description: The Individual BDT Policy resource is modified and a representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BdtPolicy' + '204': + description: The Individual BDT Policy resource is modified. +# +# Error scenarios PATCH +# + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +# +# End error scenarios PATCH +# +# +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + npcf-bdtpolicycontrol: Access to the Npcf_BDTPolicyControl API + schemas: +# +# Structured data types +# + BdtPolicy: + description: Represents an Individual BDT policy resource. + type: object + properties: + bdtPolData: + $ref: '#/components/schemas/BdtPolicyData' + bdtReqData: + $ref: '#/components/schemas/BdtReqData' +# + BdtReqData: + description: Contains service requirements for creation a new Individual BDT policy resource. + type: object + required: + - aspId + - desTimeInt + - numOfUes + - volPerUe + properties: + aspId: + $ref: '#/components/schemas/AspId' + desTimeInt: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + interGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nwAreaInfo: + $ref: '#/components/schemas/NetworkAreaInfo' + numOfUes: + description: Indicates a number of UEs. + type: integer + volPerUe: + $ref: 'TS29122_CommonData.yaml#/components/schemas/UsageThreshold' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + warnNotifReq: + description: Indicates whether the BDT warning notification is enabled or disabled. + type: boolean + default: false +# + BdtPolicyData: + description: Describes the authorization data of an Individual BDT policy resource. + type: object + required: + - bdtRefId + - transfPolicies + properties: + bdtRefId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + transfPolicies: + description: Contains transfer policies. + type: array + items: + $ref: '#/components/schemas/TransferPolicy' + minItems: 1 + selTransPolicyId: + description: Contains an identity of the selected transfer policy. + type: integer + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' +# + BdtPolicyDataPatch: + description: A JSON Merge Patch body schema containing modification instruction to be performed on the BdtPolicy data structure to select a transfer policy and in addition, may indicate whether the BDT warning notification is enabled or disabled. Adds selTransPolicyId to BdtPolicyData data structure and modifies warnNotifReq from BdtReqData data structure. + type: object + required: + - selTransPolicyId + properties: + selTransPolicyId: + description: Contains an identity (i.e. transPolicyId value) of the selected transfer policy. + type: integer + warnNotifReq: + description: Indicates whether the BDT warning notification is enabled or disabled. + type: boolean +# + TransferPolicy: + description: Describes a transfer policy. + type: object + required: + - ratingGroup + - recTimeInt + - transPolicyId + properties: + maxBitRateDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + maxBitRateUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + ratingGroup: + description: Indicates a rating group for the recommended time window. + type: integer + recTimeInt: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + transPolicyId: + description: Contains an identity of a transfer policy. + type: integer + NetworkAreaInfo: + description: Describes a network area information in which the NF service consumer requests the number of UEs. + type: object + properties: + ecgis: + description: Contains a list of E-UTRA cell identities. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + minItems: 1 + ncgis: + description: Contains a list of NR cell identities. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + minItems: 1 + gRanNodeIds: + description: Contains a list of NG RAN nodes. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + minItems: 1 + tais: + description: Contains a list of tracking area identities. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 +# + Notification: + description: Describes a BDT notification. + type: object + required: + - bdtRefId + properties: + bdtRefId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + candPolicies: + description: Contains a list of the candidate transfer policies from which the AF may select a new transfer policy due to a network performance is below the criteria set by the operator. + type: array + items: + $ref: '#/components/schemas/TransferPolicy' + minItems: 1 + nwAreaInfo: + $ref: '#/components/schemas/NetworkAreaInfo' + timeWindow: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' +# +# Simple data types +# + AspId: + description: Contains an identity of an application service provider. + type: string +# +# diff --git a/lib/sbi/support/3gpp-spec/TS29571_CommonData.yaml b/lib/sbi/support/standard/TS29571_CommonData.yaml similarity index 62% rename from lib/sbi/support/3gpp-spec/TS29571_CommonData.yaml rename to lib/sbi/support/standard/TS29571_CommonData.yaml index f6643bdd50..aadfb12617 100644 --- a/lib/sbi/support/3gpp-spec/TS29571_CommonData.yaml +++ b/lib/sbi/support/standard/TS29571_CommonData.yaml @@ -1,1909 +1,2397 @@ -openapi: 3.0.0 -info: - version: '1.2.0.alpha-1' - title: 'Common Data Types' - description: | - Common Data Types for Service Based Interfaces. - (C) 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). - All rights reserved. -externalDocs: - description: 3GPP TS 29.571 Common Data Types for Service Based Interfaces, version 16.0.0 interim - url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.571/' - -paths: {} -components: - schemas: - -# -# Common Data Types for Generic usage definitiones as defined in subclause 5.2 -# - -# -# COMMON SIMPLE DATA TYPES -# - Binary: - format: binary - type: string - BinaryRm: - format: binary - type: string - nullable: true - Bytes: - format: byte - type: string - BytesRm: - format: byte - type: string - nullable: true - Date: - format: date - type: string - DateRm: - format: date - type: string - nullable: true - DateTime: - format: date-time - type: string - DateTimeRm: - format: date-time - type: string - nullable: true - DiameterIdentity: - type: string - pattern: '^([A-Za-z0-9]+([-A-Za-z0-9]+)\.)+[a-z]{2,}$' - DiameterIdentityRm: - type: string - pattern: '^([A-Za-z0-9]+([-A-Za-z0-9]+)\.)+[a-z]{2,}$' - nullable: true - Double: - format: double - type: number - DoubleRm: - format: double - type: number - nullable: true - DurationSec: - type: integer - DurationSecRm: - type: integer - nullable: true - Float: - format: float - type: number - FloatRm: - format: float - type: number - nullable: true - Int32: - format: int32 - type: integer - Int32Rm: - format: int32 - type: integer - nullable: true - Int64: - type: integer - format: int64 - Int64Rm: - format: int64 - type: integer - nullable: true - Ipv4Addr: - type: string - pattern: '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$' - example: '198.51.100.1' - Ipv4AddrRm: - type: string - pattern: '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$' - example: '198.51.100.1' - nullable: true - Ipv6Addr: - type: string - allOf: - - pattern: '^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))$' - - pattern: '^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))$' - example: '2001:db8:85a3::8a2e:370:7334' - Ipv6AddrRm: - type: string - allOf: - - pattern: '^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))$' - - pattern: '^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))$' - example: '2001:db8:85a3::8a2e:370:7334' - nullable: true - Ipv6Prefix: - type: string - allOf: - - pattern: '^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))(\/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))$' - - pattern: '^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))(\/.+)$' - example: '2001:db8:abcd:12::0/64' - Ipv6PrefixRm: - type: string - allOf: - - pattern: '^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))(\/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))$' - - pattern: '^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))(\/.+)$' - nullable: true - MacAddr48: - type: string - pattern: '^([0-9a-fA-F]{2})((-[0-9a-fA-F]{2}){5})$' - MacAddr48Rm: - type: string - pattern: '^([0-9a-fA-F]{2})((-[0-9a-fA-F]{2}){5})$' - nullable: true - SupportedFeatures: - type: string - pattern: '^[A-Fa-f0-9]*$' - Uinteger: - type: integer - minimum: 0 - UintegerRm: - type: integer - minimum: 0 - nullable: true - Uint16: - type: integer - minimum: 0 - maximum: 65535 - Uint16Rm: - type: integer - minimum: 0 - maximum: 65535 - nullable: true - Uint32: - format: int32 - type: integer - minimum: 0 - Uint32Rm: - format: int32 - type: integer - minimum: 0 - nullable: true - Uint64: - format: int64 - type: integer - minimum: 0 - Uint64Rm: - format: int64 - type: integer - minimum: 0 - nullable: true - Uri: - type: string - UriRm: - type: string - nullable: true - VarUeId: - type: string - pattern: '^(imsi-[0-9]{5,15}|nai-.+|msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|.+)$' - VarUeIdRm: - type: string - pattern: '^(imsi-[0-9]{5,15}|nai-.+|msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|.+)$' - nullable: true - TimeZone: - type: string - TimeZoneRm: - type: string - nullable: true - -# -# COMMON ENUMERATED DATA TYPES -# - - PatchOperation: - anyOf: - - type: string - enum: - - add - - copy - - move - - remove - - replace - - test - - type: string - UriScheme: - anyOf: - - type: string - enum: - - http - - https - - type: string - ChangeType: - anyOf: - - type: string - enum: - - ADD - - MOVE - - REMOVE - - REPLACE - - type: string - -# -# COMMON STRUCTURED DATA TYPES -# - - ProblemDetails: - type: object - properties: - type: - $ref: '#/components/schemas/Uri' - title: - type: string - status: - type: integer - detail: - type: string - instance: - $ref: '#/components/schemas/Uri' - cause: - type: string - invalidParams: - type: array - items: - $ref: '#/components/schemas/InvalidParam' - minItems: 1 - supportedFeatures: - $ref: '#/components/schemas/SupportedFeatures' - Link: - type: object - properties: - href: - $ref: '#/components/schemas/Uri' - LinkRm: - type: object - properties: - href: - $ref: '#/components/schemas/Uri' - nullable: true - PatchItem: - type: object - properties: - op: - $ref: '#/components/schemas/PatchOperation' - path: - type: string - from: - type: string - value: - nullable: true - required: - - op - - path - LinksValueSchema: - oneOf: - - type: array - items: - $ref: '#/components/schemas/Link' - minItems: 1 - - $ref: '#/components/schemas/Link' - SelfLink: - type: object - properties: - self: - $ref: '#/components/schemas/Link' - required: - - self - InvalidParam: - type: object - properties: - param: - type: string - reason: - type: string - required: - - param - ChangeItem: - type: object - properties: - op: - $ref: '#/components/schemas/ChangeType' - path: - type: string - from: - type: string - origValue: {} - newValue: {} - required: - - op - - path - NotifyItem: - type: object - required: - - resourceId - - changes - properties: - resourceId: - $ref: '#/components/schemas/Uri' - changes: - type: array - items: - $ref: '#/components/schemas/ChangeItem' - minItems: 1 - ComplexQuery: - oneOf: - - $ref: '#/components/schemas/Cnf' - - $ref: '#/components/schemas/Dnf' - Cnf: - type: object - required: - - cnfUnits - properties: - cnfUnits: - type: array - items: - $ref: '#/components/schemas/CnfUnit' - minItems: 1 - Dnf: - type: object - required: - - dnfUnits - properties: - dnfUnits: - type: array - items: - $ref: '#/components/schemas/DnfUnit' - minItems: 1 - CnfUnit: - type: object - required: - - cnfUnit - properties: - cnfUnit: - type: array - items: - $ref: '#/components/schemas/Atom' - minItems: 1 - DnfUnit: - type: object - required: - - dnfUnit - properties: - dnfUnit: - type: array - items: - $ref: '#/components/schemas/Atom' - minItems: 1 - Atom: - type: object - required: - - attr - - value - properties: - attr: - type: string - value: {} - negative: - type: boolean - NFDiscFactors: - type: object - properties: - targetNfType: - $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' - requesterNfType: - $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' - serviceNames: - type: array - items: - $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' - minItems: 1 - uniqueItems: true - requesterNfInstanceFqdn: - $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/Fqdn' - targetPlmnList: - type: array - items: - $ref: '#/components/schemas/PlmnId' - minItems: 1 - requesterPlmnList: - type: array - items: - $ref: '#/components/schemas/PlmnId' - minItems: 1 - targetNfInstanceId: - $ref: '#/components/schemas/NfInstanceId' - targetNfFqdn: - $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/Fqdn' - hnrfUri: - $ref: '#/components/schemas/Uri' - snssais: - type: array - items: - $ref: '#/components/schemas/Snssai' - minItems: 1 - plmnSpecificSnssaiList: - type: array - items: - $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/PlmnSnssai' - minItems: 1 - dnn: - $ref: '#/components/schemas/Dnn' - nsiList: - type: array - items: - type: string - minItems: 1 - tai: - $ref: '#/components/schemas/Tai' - amfRegionId: - $ref: '#/components/schemas/AmfRegionId' - amfSetId: - $ref: '#/components/schemas/AmfSetId' - guami: - $ref: '#/components/schemas/Guami' - supi: - $ref: '#/components/schemas/Supi' - ueIpv4Address: - $ref: '#/components/schemas/Ipv4Addr' - ipDomain: - type: string - ueIpv6Prefix: - $ref: '#/components/schemas/Ipv6Prefix' - pgwInd: - type: boolean - pgw: - $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/Fqdn' - gpsi: - $ref: '#/components/schemas/Gpsi' - externalGroupIdentity: - type: string - dataSet: - $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/DataSetId' - routingIndicator: - type: string - pattern: '^[0-9]{1,4}$' - groupIdList: - type: array - items: - $ref: '#/components/schemas/NfGroupId' - minItems: 1 - dnaiList: - type: array - items: - $ref: '#/components/schemas/Dnai' - minItems: 1 - pduSessionTypes: - type: array - items: - $ref: '#/components/schemas/PduSessionType' - minItems: 1 - upfIwkEpsInd: - type: boolean - chfSupportedPlmn: - $ref: '#/components/schemas/PlmnId' - preferredLocality: - type: string - accessType: - $ref: '#/components/schemas/AccessType' - requiredFeatures: - type: array - items: - $ref: '#/components/schemas/SupportedFeatures' - minItems: 1 - complexQuery: - $ref: '#/components/schemas/ComplexQuery' - - - - -# -# Data Types related to Subscription, Identification and Numbering as defined in subclause 5.3 -# - -# -# SIMPLE DATA TYPES -# - Dnn: - type: string - DnnRm: - type: string - nullable: true - Gpsi: - type: string - pattern: '^(msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|.+)$' - GpsiRm: - type: string - pattern: '^(msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|.+)$' - nullable: true - GroupId: - type: string - pattern: '^[A-Fa-f0-9]{8}-[0-9]{3}-[0-9]{2,3}-([A-Fa-f0-9][A-Fa-f0-9]){1,10}$' - GroupIdRm: - type: string - pattern: '^[A-Fa-f0-9]{8}-[0-9]{3}-[0-9]{2,3}-([A-Fa-f0-9][A-Fa-f0-9]){1,10}$' - nullable: true - Pei: - type: string - pattern: '^(imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' - PeiRm: - type: string - pattern: '^(imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' - nullable: true - Supi: - type: string - pattern: '^(imsi-[0-9]{5,15}|nai-.+|.+)$' - SupiRm: - type: string - pattern: '^(imsi-[0-9]{5,15}|nai-.+|.+)$' - nullable: true - NfInstanceId: - type: string - format: uuid - AmfId: - type: string - pattern: '^[A-Fa-f0-9]{6}$' - AmfRegionId: - type: string - pattern: '^[A-Fa-f0-9]{2}$' - AmfSetId: - type: string - pattern: '^[0-3][A-Fa-f0-9]{2}$' - RfspIndex: - type: integer - minimum: 1 - maximum: 256 - RfspIndexRm: - type: integer - minimum: 1 - maximum: 256 - nullable: true - NfGroupId: - type: string - MtcProviderInformation: - type: string - -# -# STRUCTURED DATA TYPES -# - Guami: - type: object - properties: - plmnId: - $ref: '#/components/schemas/PlmnId' - amfId: - $ref: '#/components/schemas/AmfId' - required: - - plmnId - - amfId - GuamiRm: - type: object - properties: - plmnId: - $ref: '#/components/schemas/PlmnId' - amfId: - $ref: '#/components/schemas/AmfId' - required: - - plmnId - - amfId - nullable: true - NetworkId: - type: object - properties: - mnc: - $ref: '#/components/schemas/Mnc' - mcc: - $ref: '#/components/schemas/Mcc' - - -# -# Data Types related to 5G Network as defined in subclause 5.4 -# - -# -# SIMPLE DATA TYPES -# - ApplicationId: - type: string - ApplicationIdRm: - type: string - nullable: true - PduSessionId: - type: integer - minimum: 0 - maximum: 255 - Mcc: - type: string - pattern: '^\d{3}$' - MccRm: - type: string - pattern: '^\d{3}$' - nullable: true - Mnc: - type: string - pattern: '^\d{2,3}$' - MncRm: - type: string - pattern: '^\d{2,3}$' - nullable: true - Tac: - type: string - pattern: '(^[A-Fa-f0-9]{4}$)|(^[A-Fa-f0-9]{6}$)' - TacRm: - type: string - pattern: '(^[A-Fa-f0-9]{4}$)|(^[A-Fa-f0-9]{6}$)' - nullable: true - EutraCellId: - type: string - pattern: '^[A-Fa-f0-9]{7}$' - EutraCellIdRm: - type: string - pattern: '^[A-Fa-f0-9]{7}$' - nullable: true - NrCellId: - type: string - pattern: '^[A-Fa-f0-9]{9}$' - NrCellIdRm: - type: string - pattern: '^[A-Fa-f0-9]{9}$' - nullable: true - Dnai: - type: string - DnaiRm: - type: string - nullable: true - 5GMmCause: - $ref: '#/components/schemas/Uinteger' - AmfName: - type: string - AreaCode: - type: string - AreaCodeRm: - type: string - nullable: true - N3IwfId: - type: string - pattern: '^[A-Fa-f0-9]+$' - NgeNbId: - type: string - pattern: '^(MacroNGeNB-[A-Fa-f0-9]{5}|LMacroNGeNB-[A-Fa-f0-9]{6}|SMacroNGeNB-[A-Fa-f0-9]{5})$' - -# -# ENUMERATED DATA TYPES -# - - AccessType: - type: string - enum: - - 3GPP_ACCESS - - NON_3GPP_ACCESS - AccessTypeRm: - type: string - enum: - - 3GPP_ACCESS - - NON_3GPP_ACCESS - nullable: true - RatType: - anyOf: - - type: string - enum: - - NR - - EUTRA - - WLAN - - VIRTUAL - - NBIOT - - type: string - RatTypeRm: - anyOf: - - type: string - enum: - - NR - - EUTRA - - WLAN - - VIRTUAL - - NBIOT - - type: string - nullable: true - PduSessionType: - anyOf: - - type: string - enum: - - IPV4 - - IPV6 - - IPV4V6 - - UNSTRUCTURED - - ETHERNET - - type: string - PduSessionTypeRm: - anyOf: - - type: string - enum: - - IPV4 - - IPV6 - - IPV4V6 - - UNSTRUCTURED - - ETHERNET - - type: string - nullable: true - UpIntegrity: - anyOf: - - type: string - enum: - - REQUIRED - - PREFERRED - - NOT_NEEDED - - type: string - UpIntegrityRm: - anyOf: - - type: string - enum: - - REQUIRED - - PREFERRED - - NOT_NEEDED - - type: string - nullable: true - UpConfidentiality: - anyOf: - - type: string - enum: - - REQUIRED - - PREFERRED - - NOT_NEEDED - - type: string - UpConfidentialityRm: - anyOf: - - type: string - enum: - - REQUIRED - - PREFERRED - - NOT_NEEDED - - type: string - nullable: true - SscMode: - anyOf: - - type: string - enum: - - SSC_MODE_1 - - SSC_MODE_2 - - SSC_MODE_3 - - type: string - SscModeRm: - anyOf: - - type: string - enum: - - SSC_MODE_1 - - SSC_MODE_2 - - SSC_MODE_3 - - type: string - nullable: true - DnaiChangeType: - anyOf: - - type: string - enum: - - EARLY - - EARLY_LATE - - LATE - - type: string - description: > - This string provides forward-compatibility with future - extensions to the enumeration but is not used to encode - content defined in the present version of this API. - description: > - Possible values are - - EARLY: Early notification of UP path reconfiguration. - - EARLY_LATE: Early and late notification of UP path reconfiguration. This value shall only be present in the subscription to the DNAI change event. - - LATE: Late notification of UP path reconfiguration. - DnaiChangeTypeRm: - anyOf: - - type: string - enum: - - EARLY - - EARLY_LATE - - LATE - - type: string - nullable: true - RestrictionType: - anyOf: - - type: string - enum: - - ALLOWED_AREAS - - NOT_ALLOWED_AREAS - - type: string - RestrictionTypeRm: - anyOf: - - type: string - enum: - - ALLOWED_AREAS - - NOT_ALLOWED_AREAS - - type: string - nullable: true - CoreNetworkType: - anyOf: - - type: string - enum: - - 5GC - - EPC - - type: string - CoreNetworkTypeRm: - anyOf: - - type: string - enum: - - 5GC - - EPC - - type: string - nullable: true - PresenceState: - anyOf: - - type: string - enum: - - IN_AREA - - OUT_OF_AREA - - UNKNOWN - - INACTIVE - - type: string - -# -# STRUCTURED DATA TYPES -# - - Snssai: - type: object - properties: - sst: - type: integer - minimum: 0 - maximum: 255 - sd: - type: string - pattern: '^[A-Fa-f0-9]{6}$' - required: - - sst - PlmnId: - type: object - properties: - mcc: - $ref: '#/components/schemas/Mcc' - mnc: - $ref: '#/components/schemas/Mnc' - required: - - mcc - - mnc - PlmnIdRm: - type: object - properties: - mcc: - $ref: '#/components/schemas/Mcc' - mnc: - $ref: '#/components/schemas/Mnc' - required: - - mcc - - mnc - nullable: true - Tai: - type: object - properties: - plmnId: - $ref: '#/components/schemas/PlmnId' - tac: - $ref: '#/components/schemas/Tac' - required: - - plmnId - - tac - TaiRm: - type: object - properties: - plmnId: - $ref: '#/components/schemas/PlmnId' - tac: - $ref: '#/components/schemas/Tac' - required: - - plmnId - - tac - nullable: true - Ecgi: - type: object - properties: - plmnId: - $ref: '#/components/schemas/PlmnId' - # PLMN Identity - eutraCellId: - $ref: '#/components/schemas/EutraCellId' - required: - - plmnId - - eutraCellId - EcgiRm: - type: object - properties: - plmnId: - $ref: '#/components/schemas/PlmnId' - # PLMN Identity - eutraCellId: - $ref: '#/components/schemas/EutraCellId' - required: - - plmnId - - eutraCellId - nullable: true - Ncgi: - type: object - properties: - plmnId: - $ref: '#/components/schemas/PlmnId' - nrCellId: - $ref: '#/components/schemas/NrCellId' - required: - - plmnId - - nrCellId - NcgiRm: - type: object - properties: - plmnId: - $ref: '#/components/schemas/PlmnId' - nrCellId: - $ref: '#/components/schemas/NrCellId' - required: - - plmnId - - nrCellId - nullable: true - UserLocation: - type: object - properties: - eutraLocation: - $ref: '#/components/schemas/EutraLocation' - nrLocation: - $ref: '#/components/schemas/NrLocation' - n3gaLocation: - $ref: '#/components/schemas/N3gaLocation' - EutraLocation: - type: object - properties: - tai: - $ref: '#/components/schemas/Tai' - ecgi: - $ref: '#/components/schemas/Ecgi' - ageOfLocationInformation: - type: integer - minimum: 0 - maximum: 32767 - ueLocationTimestamp: - $ref: '#/components/schemas/DateTime' - geographicalInformation: - type: string - pattern: '^[0-9A-F]{16}$' - geodeticInformation: - type: string - pattern: '^[0-9A-F]{20}$' - globalNgenbId: - $ref: '#/components/schemas/GlobalRanNodeId' - required: - - tai - - ecgi - EutraLocationRm: - type: object - properties: - tai: - $ref: '#/components/schemas/Tai' - ecgi: - $ref: '#/components/schemas/Ecgi' - ageOfLocationInformation: - type: integer - minimum: 0 - maximum: 32767 - ueLocationTimestamp: - $ref: '#/components/schemas/DateTime' - geographicalInformation: - type: string - pattern: '^[0-9A-F]{16}$' - geodeticInformation: - type: string - pattern: '^[0-9A-F]{20}$' - globalNgenbId: - $ref: '#/components/schemas/GlobalRanNodeId' - required: - - tai - - ecgi - nullable: true - NrLocation: - type: object - properties: - tai: - $ref: '#/components/schemas/Tai' - ncgi: - $ref: '#/components/schemas/Ncgi' - ageOfLocationInformation: - type: integer - minimum: 0 - maximum: 32767 - ueLocationTimestamp: - $ref: '#/components/schemas/DateTime' - geographicalInformation: - type: string - pattern: '^[0-9A-F]{16}$' - geodeticInformation: - type: string - pattern: '^[0-9A-F]{20}$' - globalGnbId: - $ref: '#/components/schemas/GlobalRanNodeId' - required: - - tai - - ncgi - NrLocationRm: - type: object - properties: - tai: - $ref: '#/components/schemas/Tai' - ncgi: - $ref: '#/components/schemas/Ncgi' - ageOfLocationInformation: - type: integer - minimum: 0 - maximum: 32767 - ueLocationTimestamp: - $ref: '#/components/schemas/DateTime' - geographicalInformation: - type: string - pattern: '^[0-9A-F]{16}$' - geodeticInformation: - type: string - pattern: '^[0-9A-F]{20}$' - globalGnbId: - $ref: '#/components/schemas/GlobalRanNodeId' - required: - - tai - - ncgi - nullable: true - N3gaLocation: - type: object - properties: - n3gppTai: - $ref: '#/components/schemas/Tai' - n3IwfId: - type: string - pattern: '^[A-Fa-f0-9]+$' - ueIpv4Addr: - $ref: '#/components/schemas/Ipv4Addr' - ueIpv6Addr: - $ref: '#/components/schemas/Ipv6Addr' - portNumber: - $ref: '#/components/schemas/Uinteger' - UpSecurity: - type: object - properties: - upIntegr: - $ref: '#/components/schemas/UpIntegrity' - upConfid: - $ref: '#/components/schemas/UpConfidentiality' - required: - - upIntegr - - upConfid - UpSecurityRm: - type: object - properties: - upIntegr: - $ref: '#/components/schemas/UpIntegrity' - upConfid: - $ref: '#/components/schemas/UpConfidentiality' - required: - - upIntegr - - upConfid - nullable: true - NgApCause: - type: object - properties: - group: - $ref: '#/components/schemas/Uinteger' - value: - $ref: '#/components/schemas/Uinteger' - required: - - group - - value - BackupAmfInfo: - type: object - properties: - backupAmf: - $ref: '#/components/schemas/AmfName' - guamiList: - type: array - items: - $ref: '#/components/schemas/Guami' - minItems: 1 - required: - - backupAmf - RefToBinaryData: - type: object - properties: - contentId: - type: string - required: - - contentId - RefToBinaryDataRm: - type: object - properties: - contentId: - type: string - required: - - contentId - nullable: true - RouteToLocation: - type: object - properties: - dnai: - $ref: '#/components/schemas/Dnai' - routeInfo: - $ref: '#/components/schemas/RouteInformation' - routeProfId: - type: string - nullable: true - required: - - dnai - anyOf: - - required: [ routeInfo ] - - required: [ routeProfId ] - nullable: true - RouteInformation: - type: object - properties: - ipv4Addr: - $ref: '#/components/schemas/Ipv4Addr' - ipv6Addr: - $ref: '#/components/schemas/Ipv6Addr' - portNumber: - $ref: '#/components/schemas/Uinteger' - required: - - portNumber - nullable: true - SubscribedDefaultQos: - type: object - required: - - 5qi - - arp - properties: - 5qi: - $ref: '#/components/schemas/5Qi' - arp: - $ref: '#/components/schemas/Arp' - priorityLevel: - $ref: '#/components/schemas/5QiPriorityLevel' - Area: - type: object - oneOf: - - required: - - tacs - - required: - - areaCode - properties: - tacs: - type: array - items: - $ref: '#/components/schemas/Tac' - minItems: 1 - areaCode: - $ref: '#/components/schemas/AreaCode' - ServiceAreaRestriction: - type: object - properties: - restrictionType: - $ref: '#/components/schemas/RestrictionType' - areas: - type: array - items: - $ref: '#/components/schemas/Area' - maxNumOfTAs: - $ref: '#/components/schemas/Uinteger' - maxNumOfTAsForNotAllowedAreas: - $ref: '#/components/schemas/Uinteger' - allOf: - # - # 1st condition: restrictionType and areas attributes shall be either both absent - # or both present - # - - oneOf: - - not: - required: [ restrictionType ] - - required: [ areas ] - # - # 2nd condition: if restrictionType takes value NOT_ALLOWED_AREAS, - # then maxNumOfTAs shall be absent - # - - anyOf: - - not: - required: [ restrictionType ] - properties: - restrictionType: - type: string - enum: [ NOT_ALLOWED_AREAS ] - - not: - required: [ maxNumOfTAs ] - # - # 3rd condition: if restrictionType takes value ALLOWED_AREAS, - # then maxNumOfTAsForNotAllowedAreas shall be absent - # - - anyOf: - - not: - required: [ restrictionType ] - properties: - restrictionType: - type: string - enum: [ ALLOWED_AREAS ] - - not: - required: [ maxNumOfTAsForNotAllowedAreas ] - PresenceInfo: - type: object - properties: - praId: - type: string - presenceState: - $ref: '#/components/schemas/PresenceState' - trackingAreaList: - type: array - items: - $ref: '#/components/schemas/Tai' - minItems: 1 - ecgiList: - type: array - items: - $ref: '#/components/schemas/Ecgi' - minItems: 1 - ncgiList: - type: array - items: - $ref: '#/components/schemas/Ncgi' - minItems: 1 - globalRanNodeIdList: - type: array - items: - $ref: '#/components/schemas/GlobalRanNodeId' - minItems: 1 - PresenceInfoRm: - type: object - properties: - praId: - type: string - presenceState: - $ref: '#/components/schemas/PresenceState' - trackingAreaList: - type: array - items: - $ref: '#/components/schemas/Tai' - minItems: 0 - ecgiList: - type: array - items: - $ref: '#/components/schemas/Ecgi' - minItems: 0 - ncgiList: - type: array - items: - $ref: '#/components/schemas/Ncgi' - minItems: 0 - globalRanNodeIdList: - type: array - items: - $ref: '#/components/schemas/GlobalRanNodeId' - nullable: true - GlobalRanNodeId: - type: object - properties: - plmnId: - $ref: '#/components/schemas/PlmnId' - n3IwfId: - $ref: '#/components/schemas/N3IwfId' - gNbId: - $ref: '#/components/schemas/GNbId' - ngeNbId: - $ref: '#/components/schemas/NgeNbId' - oneOf: - - required: [ n3IwfId ] - - required: [ gNbId ] - - required: [ ngeNbId ] - required: - - plmnId - GNbId: - type: object - properties: - bitLength: - type: integer - minimum: 22 - maximum: 32 - gNBValue: - type: string - pattern: '^[A-Fa-f0-9]{6,8}$' - required: - - bitLength - - gNBValue - MaPduCapability: - type: object - properties: - atsssLL: - type: boolean - default: false - mptcp: - type: boolean - default: boolean - AtsssCapability: - type: object - properties: - atsssLL: - type: boolean - default: false - mptcp: - type: boolean - default: false - - -# -# Data Types related to 5G QoS as defined in subclause 5.5 -# - -# -# SIMPLE DATA TYPES -# -# - Qfi: - type: integer - minimum: 0 - maximum: 63 - QfiRm: - type: integer - minimum: 0 - maximum: 63 - nullable: true - 5Qi: - type: integer - minimum: 0 - maximum: 255 - 5QiRm: - type: integer - minimum: 0 - maximum: 255 - nullable: true - BitRate: - type: string - pattern: '^\d+(\.\d+)? (bps|Kbps|Mbps|Gbps|Tbps)$' - BitRateRm: - type: string - pattern: '^\d+(\.\d+)? (bps|Kbps|Mbps|Gbps|Tbps)$' - nullable: true - ArpPriorityLevelRm: - type: integer - minimum: 1 - maximum: 15 - nullable: true - ArpPriorityLevel: - type: integer - minimum: 1 - maximum: 15 - nullable: true - description: nullable true shall not be used for this attribute - 5QiPriorityLevel: - type: integer - minimum: 1 - maximum: 127 - 5QiPriorityLevelRm: - type: integer - minimum: 1 - maximum: 127 - nullable: true - PacketDelBudget: - type: integer - minimum: 1 - PacketDelBudgetRm: - type: integer - minimum: 1 - nullable: true - PacketErrRate: - type: string - pattern: '^([0-9]E-[0-9])$' - PacketErrRateRm: - type: string - pattern: '^([0-9]E-[0-9])$' - nullable: true - PacketLossRate: - type: integer - minimum: 0 - maximum: 1000 - PacketLossRateRm: - type: integer - minimum: 0 - maximum: 1000 - nullable: true - AverWindow: - type: integer - minimum: 1 - maximum: 4095 - default: 2000 - AverWindowRm: - type: integer - maximum: 4095 - default: 2000 - minimum: 1 - nullable: true - MaxDataBurstVol: - type: integer - minimum: 1 - maximum: 4095 - MaxDataBurstVolRm: - type: integer - minimum: 1 - maximum: 4095 - nullable: true - SampleRatio: - type: integer - minimum: 1 - maximum: 100 - SampleRatioRm: - type: integer - minimum: 1 - maximum: 100 - nullable: true - -# -# ENUMERATED DATA TYPES -# - - PreemptionCapability: - anyOf: - - type: string - enum: - - NOT_PREEMPT - - MAY_PREEMPT - - type: string - PreemptionCapabilityRm: - anyOf: - - type: string - enum: - - NOT_PREEMPT - - MAY_PREEMPT - - type: string - nullable: true - PreemptionVulnerability: - anyOf: - - type: string - enum: - - NOT_PREEMPTABLE - - PREEMPTABLE - - type: string - PreemptionVulnerabilityRm: - anyOf: - - type: string - enum: - - NOT_PREEMPTABLE - - PREEMPTABLE - - type: string - nullable: true - ReflectiveQoSAttribute: - anyOf: - - type: string - enum: - - RQOS - - NO_RQOS - - type: string - ReflectiveQoSAttributeRm: - anyOf: - - type: string - enum: - - RQOS - - NO_RQOS - - type: string - nullable: true - NotificationControl: - anyOf: - - type: string - enum: - - REQUESTED - - NOT_REQUESTED - - type: string - NotificationControlRm: - anyOf: - - type: string - enum: - - REQUESTED - - NOT_REQUESTED - - type: string - nullable: true - QosResourceType: - anyOf: - - type: string - enum: - - NON_GBR - - NON_CRITICAL_GBR - - CRITICAL_GBR - - type: string - QosResourceTypeRm: - anyOf: - - type: string - enum: - - NON_GBR - - NON_CRITICAL_GBR - - CRITICAL_GBR - - type: string - nullable: true - AdditionalQosFlowInfo: - anyOf: - - type: string - enum: - - MORE_LIKELY - - type: string - nullable: true -# - -# -# STRUCTURED DATA TYPES -# - - Arp: - type: object - properties: - priorityLevel: - $ref: '#/components/schemas/ArpPriorityLevel' - preemptCap: - $ref: '#/components/schemas/PreemptionCapability' - preemptVuln: - $ref: '#/components/schemas/PreemptionVulnerability' - required: - - priorityLevel - - preemptCap - - preemptVuln - ArpRm: - type: object - properties: - priorityLevel: - $ref: '#/components/schemas/ArpPriorityLevel' - preemptCap: - $ref: '#/components/schemas/PreemptionCapability' - preemptVuln: - $ref: '#/components/schemas/PreemptionVulnerability' - required: - - priorityLevel - - preemptCap - - preemptVuln - nullable: true - Ambr: - type: object - properties: - uplink: - $ref: '#/components/schemas/BitRate' - downlink: - $ref: '#/components/schemas/BitRate' - required: - - uplink - - downlink - AmbrRm: - type: object - properties: - uplink: - $ref: '#/components/schemas/BitRate' - downlink: - $ref: '#/components/schemas/BitRate' - required: - - uplink - - downlink - nullable: true - Dynamic5Qi: - type: object - properties: - resourceType: - $ref: '#/components/schemas/QosResourceType' - priorityLevel: - $ref: '#/components/schemas/5QiPriorityLevel' - packetDelayBudget: - $ref: '#/components/schemas/PacketDelBudget' - packetErrRate: - $ref: '#/components/schemas/PacketErrRate' - averWindow: - $ref: '#/components/schemas/AverWindow' - maxDataBurstVol: - $ref: '#/components/schemas/MaxDataBurstVol' - required: - - resourceType - - priorityLevel - - packetDelayBudget - - packetErrRate - NonDynamic5Qi: - type: object - properties: - priorityLevel: - $ref: '#/components/schemas/5QiPriorityLevel' - averWindow: - $ref: '#/components/schemas/AverWindow' - maxDataBurstVol: - $ref: '#/components/schemas/MaxDataBurstVol' - minProperties: 0 - -# -# Data Types related to 5G Trace as defined in subclause 5.6 -# - -# -# SIMPLE DATA TYPES -# -# -# -# Enumerations -# - TraceDepth: - anyOf: - - type: string - enum: - - MINIMUM - - MEDIUM - - MAXIMUM - - MINIMUM_WO_VENDOR_EXTENSION - - MEDIUM_WO_VENDOR_EXTENSION - - MAXIMUM_WO_VENDOR_EXTENSION - - type: string - TraceDepthRm: - anyOf: - - type: string - enum: - - MINIMUM - - MEDIUM - - MAXIMUM - - MINIMUM_WO_VENDOR_EXTENSION - - MEDIUM_WO_VENDOR_EXTENSION - - MAXIMUM_WO_VENDOR_EXTENSION - - type: string - nullable: true -# -# STRUCTURED DATA TYPES -# - TraceData: - type: object - nullable: true - properties: - traceRef: - type: string - pattern: '^[0-9]{3}[0-9]{2,3}-[A-Fa-f0-9]{6}$' - traceDepth: - $ref: '#/components/schemas/TraceDepth' - neTypeList: - type: string - pattern: '^[A-Fa-f0-9]+$' - eventList: - type: string - pattern: '^[A-Fa-f0-9]+$' - collectionEntityIpv4Addr: - $ref: '#/components/schemas/Ipv4Addr' - collectionEntityIpv6Addr: - $ref: '#/components/schemas/Ipv6Addr' - interfaceList: - type: string - pattern: '^[A-Fa-f0-9]+$' - required: - - traceRef - - traceDepth - - neTypeList - - eventList - - -# Data Types related to 5G ODB as defined in subclause 5.7 - -# -# SIMPLE DATA TYPES -# -# -# -# Enumerations -# - RoamingOdb: - anyOf: - - type: string - enum: - - OUTSIDE_HOME_PLMN - - OUTSIDE_HOME_PLMN_COUNTRY - - type: string - - OdbPacketServices: - anyOf: - - type: string - enum: - - ALL_PACKET_SERVICES - - ROAMER_ACCESS_HPLMN_AP - - ROAMER_ACCESS_VPLMN_AP - - type: string - nullable: true - -# -# STRUCTURED DATA TYPES -# - - OdbData: - type: object - properties: - roamingOdb: - $ref: '#/components/schemas/RoamingOdb' - -# -# Data Types related to Charging as defined in subclause 5.8 -# - -# -# SIMPLE DATA TYPES -# -# - ChargingId: - $ref: '#/components/schemas/Uint32' - - RatingGroup: - $ref: '#/components/schemas/Uint32' - - ServiceId: - $ref: '#/components/schemas/Uint32' - - -# -# Enumerations -# - -# -# STRUCTURED DATA TYPES -# - SecondaryRatUsageReport: - type: object - properties: - secondaryRatType: - $ref: '#/components/schemas/RatType' - qosFlowsUsageData: - type: array - items: - $ref: '#/components/schemas/QosFlowUsageReport' - minItems: 1 - required: - - secondaryRatType - - qosFlowsUsageData - - QosFlowUsageReport: - type: object - properties: - qfi: - $ref: '#/components/schemas/Qfi' - startTimeStamp: - $ref: '#/components/schemas/DateTime' - endTimeStamp: - $ref: '#/components/schemas/DateTime' - downlinkVolume: - $ref: '#/components/schemas/Int64' - uplinkVolume: - $ref: '#/components/schemas/Int64' - required: - - qfi - - startTimeStamp - - endTimeStamp - - downlinkVolume - - uplinkVolume - - SecondaryRatUsageInfo: - type: object - properties: - secondaryRatType: - $ref: '#/components/schemas/RatType' - qosFlowsUsageData: - type: array - items: - $ref: '#/components/schemas/QosFlowUsageReport' - minItems: 1 - pduSessionUsageData: - type: array - items: - $ref: '#/components/schemas/VolumeTimedReport' - minItems: 1 - required: - - secondaryRatType - - VolumeTimedReport: - type: object - properties: - startTimeStamp: - $ref: '#/components/schemas/DateTime' - endTimeStamp: - $ref: '#/components/schemas/DateTime' - downlinkVolume: - $ref: '#/components/schemas/Int64' - uplinkVolume: - $ref: '#/components/schemas/Int64' - required: - - startTimeStamp - - endTimeStamp - - downlinkVolume - - uplinkVolume - - -# -# HTTP responses -# - - responses: - '400': - description: Bad request - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '401': - description: Unauthorized - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '403': - description: Forbidden - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '404': - description: Not Found - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '405': - description: Method Not Allowed - '408': - description: Request Timeout - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '406': - description: 406 Not Acceptable - '409': - description: Conflict - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '410': - description: Gone - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '411': - description: Length Required - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '412': - description: Precondition Failed - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '413': - description: Payload Too Large - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '414': - description: URI Too Long - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '415': - description: Unsupported Media Type - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '429': - description: Too Many Requests - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '500': - description: Internal Server Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '501': - description: Not Implemented - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '503': - description: Service Unavailable - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - '504': - description: Gateway Timeout - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - default: - description: Generic Error +openapi: 3.0.0 + +info: + version: '1.2.0.alpha-4' + title: 'Common Data Types' + description: | + Common Data Types for Service Based Interfaces. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.571 Common Data Types for Service Based Interfaces, version 16.3.0 + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.571/' + +paths: {} +components: + schemas: + +# +# Common Data Types for Generic usage definitiones as defined in clause 5.2 +# + +# +# COMMON SIMPLE DATA TYPES +# + Binary: + format: binary + type: string + BinaryRm: + format: binary + type: string + nullable: true + Bytes: + format: byte + type: string + BytesRm: + format: byte + type: string + nullable: true + Date: + format: date + type: string + DateRm: + format: date + type: string + nullable: true + DateTime: + format: date-time + type: string + DateTimeRm: + format: date-time + type: string + nullable: true + DiameterIdentity: + type: string + pattern: '^([A-Za-z0-9]+([-A-Za-z0-9]+)\.)+[a-z]{2,}$' + DiameterIdentityRm: + type: string + pattern: '^([A-Za-z0-9]+([-A-Za-z0-9]+)\.)+[a-z]{2,}$' + nullable: true + Double: + format: double + type: number + DoubleRm: + format: double + type: number + nullable: true + DurationSec: + type: integer + DurationSecRm: + type: integer + nullable: true + Float: + format: float + type: number + FloatRm: + format: float + type: number + nullable: true + Int32: + format: int32 + type: integer + Int32Rm: + format: int32 + type: integer + nullable: true + Int64: + type: integer + format: int64 + Int64Rm: + format: int64 + type: integer + nullable: true + Ipv4Addr: + type: string + pattern: '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$' + example: '198.51.100.1' + Ipv4AddrRm: + type: string + pattern: '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$' + example: '198.51.100.1' + nullable: true + Ipv4AddrMask: + type: string + pattern: '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$' + example: '198.51.0.0/16' + Ipv4AddrMaskRm: + type: string + pattern: '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$' + example: '198.51.0.0/16' + nullable: true + Ipv6Addr: + type: string + allOf: + - pattern: '^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))$' + - pattern: '^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))$' + example: '2001:db8:85a3::8a2e:370:7334' + Ipv6AddrRm: + type: string + allOf: + - pattern: '^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))$' + - pattern: '^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))$' + example: '2001:db8:85a3::8a2e:370:7334' + nullable: true + Ipv6Prefix: + type: string + allOf: + - pattern: '^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))(\/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))$' + - pattern: '^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))(\/.+)$' + example: '2001:db8:abcd:12::0/64' + Ipv6PrefixRm: + type: string + allOf: + - pattern: '^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))(\/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))$' + - pattern: '^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))(\/.+)$' + nullable: true + MacAddr48: + type: string + pattern: '^([0-9a-fA-F]{2})((-[0-9a-fA-F]{2}){5})$' + MacAddr48Rm: + type: string + pattern: '^([0-9a-fA-F]{2})((-[0-9a-fA-F]{2}){5})$' + nullable: true + SupportedFeatures: + type: string + pattern: '^[A-Fa-f0-9]*$' + Uinteger: + type: integer + minimum: 0 + UintegerRm: + type: integer + minimum: 0 + nullable: true + Uint16: + type: integer + minimum: 0 + maximum: 65535 + Uint16Rm: + type: integer + minimum: 0 + maximum: 65535 + nullable: true + Uint32: + format: int32 + type: integer + minimum: 0 + Uint32Rm: + format: int32 + type: integer + minimum: 0 + nullable: true + Uint64: + format: int64 + type: integer + minimum: 0 + Uint64Rm: + format: int64 + type: integer + minimum: 0 + nullable: true + Uri: + type: string + UriRm: + type: string + nullable: true + VarUeId: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|gci-.+|gli-.+|.+)$' + VarUeIdRm: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|gci-.+|gli-.+|.+)$' + nullable: true + TimeZone: + type: string + TimeZoneRm: + type: string + nullable: true + StnSr: + type: string + StnSrRm: + type: string + nullable: true + CMsisdn: + type: string + pattern: '^[0-9]{5,15}$' + CMsisdnRm: + type: string + pattern: '^[0-9]{5,15}$' + nullable: true + DayOfWeek: + type: integer + minimum: 1 + maximum: 7 + description: integer between and including 1 and 7 denoting a weekday. 1 shall indicate Monday, and the subsequent weekdays shall be indicated with the next higher numbers. 7 shall indicate Sunday. + TimeOfDay: + type: string + description: String with format partial-time or full-time as defined in clause 5.6 of IETF RFC 3339. Examples, 20:15:00, 20:15:00-08:00 (for 8 hours behind UTC). +# +# COMMON ENUMERATED DATA TYPES +# + + PatchOperation: + anyOf: + - type: string + enum: + - add + - copy + - move + - remove + - replace + - test + - type: string + UriScheme: + anyOf: + - type: string + enum: + - http + - https + - type: string + ChangeType: + anyOf: + - type: string + enum: + - ADD + - MOVE + - REMOVE + - REPLACE + - type: string + HttpMethod: + anyOf: + - type: string + enum: + - GET + - POST + - PUT + - DELETE + - PATCH + - OPTIONS + - HEAD + - CONNECT + - TRACE + - type: string + NullValue: + enum: + - null + +# +# COMMON STRUCTURED DATA TYPES +# + + ProblemDetails: + type: object + properties: + type: + $ref: '#/components/schemas/Uri' + title: + type: string + status: + type: integer + detail: + type: string + instance: + $ref: '#/components/schemas/Uri' + cause: + type: string + invalidParams: + type: array + items: + $ref: '#/components/schemas/InvalidParam' + minItems: 1 + supportedFeatures: + $ref: '#/components/schemas/SupportedFeatures' + Link: + type: object + properties: + href: + $ref: '#/components/schemas/Uri' + LinkRm: + type: object + properties: + href: + $ref: '#/components/schemas/Uri' + nullable: true + PatchItem: + type: object + properties: + op: + $ref: '#/components/schemas/PatchOperation' + path: + type: string + from: + type: string + value: {} + required: + - op + - path + LinksValueSchema: + oneOf: + - type: array + items: + $ref: '#/components/schemas/Link' + minItems: 1 + - $ref: '#/components/schemas/Link' + SelfLink: + type: object + properties: + self: + $ref: '#/components/schemas/Link' + required: + - self + InvalidParam: + type: object + properties: + param: + type: string + reason: + type: string + required: + - param + ChangeItem: + type: object + properties: + op: + $ref: '#/components/schemas/ChangeType' + path: + type: string + from: + type: string + origValue: {} + newValue: {} + required: + - op + - path + NotifyItem: + type: object + required: + - resourceId + - changes + properties: + resourceId: + $ref: '#/components/schemas/Uri' + changes: + type: array + items: + $ref: '#/components/schemas/ChangeItem' + minItems: 1 + ComplexQuery: + oneOf: + - $ref: '#/components/schemas/Cnf' + - $ref: '#/components/schemas/Dnf' + Cnf: + type: object + required: + - cnfUnits + properties: + cnfUnits: + type: array + items: + $ref: '#/components/schemas/CnfUnit' + minItems: 1 + Dnf: + type: object + required: + - dnfUnits + properties: + dnfUnits: + type: array + items: + $ref: '#/components/schemas/DnfUnit' + minItems: 1 + CnfUnit: + type: object + required: + - cnfUnit + properties: + cnfUnit: + type: array + items: + $ref: '#/components/schemas/Atom' + minItems: 1 + DnfUnit: + type: object + required: + - dnfUnit + properties: + dnfUnit: + type: array + items: + $ref: '#/components/schemas/Atom' + minItems: 1 + Atom: + type: object + required: + - attr + - value + properties: + attr: + type: string + value: {} + negative: + type: boolean + PatchResult: + type: object + required: + - report + properties: + report: + type: array + items: + $ref: '#/components/schemas/ReportItem' + minItems: 1 + ReportItem: + type: object + required: + - path + properties: + path: + type: string + HalTemplate: + type: object + required: + - method + properties: + title: + type: string + method: + $ref: '#/components/schemas/HttpMethod' + contentType: + type: string + properties: + type: array + items: + $ref: '#/components/schemas/Property' + minItems: 1 + Property: + type: object + required: + - name + properties: + name: + type: string + required: + type: boolean + regex: + type: string + value: + type: string + + + + +# +# Data Types related to Subscription, Identification and Numbering as defined in clause 5.3 +# + +# +# SIMPLE DATA TYPES +# + Dnn: + type: string + DnnRm: + type: string + nullable: true + WildcardDnn: + type: string + pattern: '^[*]$' + WildcardDnnRm: + type: string + pattern: '^[*]$' + nullable: true + Gpsi: + type: string + pattern: '^(msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|.+)$' + GpsiRm: + type: string + pattern: '^(msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|.+)$' + nullable: true + GroupId: + type: string + pattern: '^[A-Fa-f0-9]{8}-[0-9]{3}-[0-9]{2,3}-([A-Fa-f0-9][A-Fa-f0-9]){1,10}$' + GroupIdRm: + type: string + pattern: '^[A-Fa-f0-9]{8}-[0-9]{3}-[0-9]{2,3}-([A-Fa-f0-9][A-Fa-f0-9]){1,10}$' + nullable: true + ExternalGroupId: + type: string + pattern: '^extgroupid-[^@]+@[^@]+$' + ExternalGroupIdRm: + type: string + pattern: '^extgroupid-[^@]+@[^@]+$' + nullable: true + Pei: + type: string + pattern: '^(imei-[0-9]{15}|imeisv-[0-9]{16}|mac((-[0-9a-fA-F]{2}){6})(-untrusted)?|eui((-[0-9a-fA-F]{2}){8})|.+)$' + PeiRm: + type: string + pattern: '^(imei-[0-9]{15}|imeisv-[0-9]{16}|mac((-[0-9a-fA-F]{2}){6})(-untrusted)?|eui((-[0-9a-fA-F]{2}){8})|.+)$' + nullable: true + Supi: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gci-.+|gli-.+|.+)$' + SupiRm: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gci-.+|gli-.+|.+)$' + nullable: true + NfInstanceId: + type: string + format: uuid + AmfId: + type: string + pattern: '^[A-Fa-f0-9]{6}$' + AmfRegionId: + type: string + pattern: '^[A-Fa-f0-9]{2}$' + AmfSetId: + type: string + pattern: '^[0-3][A-Fa-f0-9]{2}$' + RfspIndex: + type: integer + minimum: 1 + maximum: 256 + RfspIndexRm: + type: integer + minimum: 1 + maximum: 256 + nullable: true + NfGroupId: + type: string + MtcProviderInformation: + type: string + CagId: + type: string + pattern: '^[A-Fa-f0-9]{8}$' + SupiOrSuci: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|suci-(0-[0-9]{3}-[0-9]{2,3}|[1-7]-.+)-[0-9]{1,4}-(0-0-.+|[a-fA-F1-9]-([1-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])-[a-fA-F0-9]+)|.+)$' + +# +# STRUCTURED DATA TYPES +# + Guami: + type: object + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + amfId: + $ref: '#/components/schemas/AmfId' + required: + - plmnId + - amfId + GuamiRm: + type: object + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + amfId: + $ref: '#/components/schemas/AmfId' + required: + - plmnId + - amfId + nullable: true + NetworkId: + type: object + properties: + mnc: + $ref: '#/components/schemas/Mnc' + mcc: + $ref: '#/components/schemas/Mcc' + + +# +# Data Types related to 5G Network as defined in clause 5.4 +# + +# +# SIMPLE DATA TYPES +# + ApplicationId: + type: string + ApplicationIdRm: + type: string + nullable: true + PduSessionId: + type: integer + minimum: 0 + maximum: 255 + Mcc: + type: string + pattern: '^\d{3}$' + MccRm: + type: string + pattern: '^\d{3}$' + nullable: true + Mnc: + type: string + pattern: '^\d{2,3}$' + MncRm: + type: string + pattern: '^\d{2,3}$' + nullable: true + Tac: + type: string + pattern: '(^[A-Fa-f0-9]{4}$)|(^[A-Fa-f0-9]{6}$)' + TacRm: + type: string + pattern: '(^[A-Fa-f0-9]{4}$)|(^[A-Fa-f0-9]{6}$)' + nullable: true + EutraCellId: + type: string + pattern: '^[A-Fa-f0-9]{7}$' + EutraCellIdRm: + type: string + pattern: '^[A-Fa-f0-9]{7}$' + nullable: true + NrCellId: + type: string + pattern: '^[A-Fa-f0-9]{9}$' + NrCellIdRm: + type: string + pattern: '^[A-Fa-f0-9]{9}$' + nullable: true + Dnai: + type: string + DnaiRm: + type: string + nullable: true + 5GMmCause: + $ref: '#/components/schemas/Uinteger' + AmfName: + type: string + AreaCode: + type: string + AreaCodeRm: + type: string + nullable: true + N3IwfId: + type: string + pattern: '^[A-Fa-f0-9]+$' + NgeNbId: + type: string + pattern: '^(MacroNGeNB-[A-Fa-f0-9]{5}|LMacroNGeNB-[A-Fa-f0-9]{6}|SMacroNGeNB-[A-Fa-f0-9]{5})$' + Nid: + type: string + pattern: '^[A-Fa-f0-9]{11}$' + NidRm: + type: string + pattern: '^[A-Fa-f0-9]{11}$' + nullable: true + NfSetId: + type: string + NfServiceSetId: + type: string + PlmnAssiUeRadioCapId: + $ref: '#/components/schemas/Bytes' + ManAssiUeRadioCapId: + $ref: '#/components/schemas/Bytes' + TypeAllocationCode: + type: string + pattern: '^[0-9]{8}$' + HfcNId: + type: string + maxLength: 6 + HfcNIdRm: + type: string + maxLength: 6 + nullable: true + ENbId: + type: string + pattern: '^(MacroeNB-[A-Fa-f0-9]{5}|LMacroeNB-[A-Fa-f0-9]{6}|SMacroeNB-[A-Fa-f0-9]{5}|HomeeNB-[A-Fa-f0-9]{7})$' + Gli: + $ref: '#/components/schemas/Bytes' + +# +# ENUMERATED DATA TYPES +# + + AccessType: + type: string + enum: + - 3GPP_ACCESS + - NON_3GPP_ACCESS + AccessTypeRm: + anyOf: + - $ref: '#/components/schemas/AccessType' + - $ref: '#/components/schemas/NullValue' + RatType: + anyOf: + - type: string + enum: + - NR + - EUTRA + - WLAN + - VIRTUAL + - NBIOT + - WIRELINE + - WIRELINE_CABLE + - WIRELINE_DSL + - WIRELINE_PON + - LTE-M + - NR_U + - EUTRA_U + - TRUSTED_N3GA + - TRUSTED_WLAN + - UTRA + - GERA + - type: string + RatTypeRm: + allOf: + - $ref: '#/components/schemas/RatType' + nullable: true + PduSessionType: + anyOf: + - type: string + enum: + - IPV4 + - IPV6 + - IPV4V6 + - UNSTRUCTURED + - ETHERNET + - type: string + PduSessionTypeRm: + anyOf: + - $ref: '#/components/schemas/PduSessionType' + - $ref: '#/components/schemas/NullValue' + UpIntegrity: + anyOf: + - type: string + enum: + - REQUIRED + - PREFERRED + - NOT_NEEDED + - type: string + UpIntegrityRm: + anyOf: + - $ref: '#/components/schemas/UpIntegrity' + - $ref: '#/components/schemas/NullValue' + UpConfidentiality: + anyOf: + - type: string + enum: + - REQUIRED + - PREFERRED + - NOT_NEEDED + - type: string + UpConfidentialityRm: + anyOf: + - $ref: '#/components/schemas/UpConfidentiality' + - $ref: '#/components/schemas/NullValue' + SscMode: + anyOf: + - type: string + enum: + - SSC_MODE_1 + - SSC_MODE_2 + - SSC_MODE_3 + - type: string + SscModeRm: + anyOf: + - $ref: '#/components/schemas/SscMode' + - $ref: '#/components/schemas/NullValue' + DnaiChangeType: + anyOf: + - type: string + enum: + - EARLY + - EARLY_LATE + - LATE + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - EARLY: Early notification of UP path reconfiguration. + - EARLY_LATE: Early and late notification of UP path reconfiguration. This value shall only be present in the subscription to the DNAI change event. + - LATE: Late notification of UP path reconfiguration. + DnaiChangeTypeRm: + anyOf: + - $ref: '#/components/schemas/DnaiChangeType' + - $ref: '#/components/schemas/NullValue' + RestrictionType: + anyOf: + - type: string + enum: + - ALLOWED_AREAS + - NOT_ALLOWED_AREAS + - type: string + RestrictionTypeRm: + anyOf: + - $ref: '#/components/schemas/RestrictionType' + - $ref: '#/components/schemas/NullValue' + CoreNetworkType: + anyOf: + - type: string + enum: + - 5GC + - EPC + - type: string + CoreNetworkTypeRm: + anyOf: + - $ref: '#/components/schemas/CoreNetworkType' + - $ref: '#/components/schemas/NullValue' + PresenceState: + anyOf: + - type: string + enum: + - IN_AREA + - OUT_OF_AREA + - UNKNOWN + - INACTIVE + - type: string + StationaryIndication: + anyOf: + - type: string + enum: + - STATIONARY + - MOBILE + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - STATIONARY: Identifies the UE is stationary + - MOBILE: Identifies the UE is mobile + StationaryIndicationRm: + anyOf: + - $ref: '#/components/schemas/StationaryIndication' + - $ref: '#/components/schemas/NullValue' + ScheduledCommunicationType: + anyOf: + - type: string + enum: + - DOWNLINK_ONLY + - UPLINK_ONLY + - BIDIRECTIONAL + - type: string + ScheduledCommunicationTypeRm: + anyOf: + - $ref: '#/components/schemas/ScheduledCommunicationType' + - $ref: '#/components/schemas/NullValue' + TrafficProfile: + anyOf: + - type: string + enum: + - SINGLE_TRANS_UL + - SINGLE_TRANS_DL + - DUAL_TRANS_UL_FIRST + - DUAL_TRANS_DL_FIRST + - MULTI_TRANS + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - SINGLE_TRANS_UL: Uplink single packet transmission. + - SINGLE_TRANS_DL: Downlink single packet transmission. + - DUAL_TRANS_UL_FIRST: Dual packet transmission, firstly uplink packet transmission with subsequent downlink packet transmission. + - DUAL_TRANS_DL_FIRST: Dual packet transmission, firstly downlink packet transmission with subsequent uplink packet transmission. + TrafficProfileRm: + anyOf: + - $ref: '#/components/schemas/TrafficProfile' + - $ref: '#/components/schemas/NullValue' + LcsServiceAuth: + anyOf: + - type: string + enum: + - "LOCATION_NOT_ALLOWED" + - "LOCATION_ALLOWED_WITH_NOTIFICATION" + - "LOCATION_ALLOWED_WITHOUT_NOTIFICATION" + - "LOCATION_ALLOWED_WITHOUT_RESPONSE" + - "LOCATION_RESTRICTED_WITHOUT_RESPONSE" + - "NOTIFICATION_ONLY" + - "NOTIFICATION_AND_VERIFICATION_ONLY" + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - "LOCATION_NOT_ALLOWED": Indicates the start of MO Exception Data delivery. + - "STOP": Indicates the stop of MO Exception Data delivery. + - "LOCATION_NOT_ALLOWED": Location not allowed + - "LOCATION_ALLOWED_WITH_NOTIFICATION": Location allowed with notification + - "LOCATION_ALLOWED_WITHOUT_NOTIFICATION": Location allowed without notification + - "LOCATION_ALLOWED_WITHOUT_RESPONSE": Location with notification and privacy verification; location allowed if no response + - "LOCATION_RESTRICTED_WITHOUT_RESPONSE": Location with notification and privacy verification; location restricted if no response + - "NOTIFICATION_ONLY": Notification only + - "NOTIFICATION_AND_VERIFICATION_ONLY": Notification and privacy verification only + UeAuth: + anyOf: + - type: string + enum: + - AUTHORIZED + - NOT_AUTHORIZED + - type: string + DlDataDeliveryStatus: + anyOf: + - type: string + enum: + - BUFFERED + - TRANSMITTED + - DISCARDED + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + 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. + DlDataDeliveryStatusRm: + anyOf: + - $ref: '#/components/schemas/DlDataDeliveryStatus' + - $ref: '#/components/schemas/NullValue' + MoExceptionDataFlag: + anyOf: + - type: string + enum: + - START + - STOP + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - "START": Indicates the start of MO Exception Data delivery. + - "STOP": Indicates the stop of MO Exception Data delivery. + +# +# STRUCTURED DATA TYPES +# + + Snssai: + type: object + properties: + sst: + type: integer + minimum: 0 + maximum: 255 + sd: + type: string + pattern: '^[A-Fa-f0-9]{6}$' + required: + - sst + PlmnId: + type: object + properties: + mcc: + $ref: '#/components/schemas/Mcc' + mnc: + $ref: '#/components/schemas/Mnc' + required: + - mcc + - mnc + PlmnIdRm: + type: object + properties: + mcc: + $ref: '#/components/schemas/Mcc' + mnc: + $ref: '#/components/schemas/Mnc' + required: + - mcc + - mnc + nullable: true + Tai: + type: object + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + tac: + $ref: '#/components/schemas/Tac' + nid: + $ref: '#/components/schemas/Nid' + required: + - plmnId + - tac + TaiRm: + type: object + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + tac: + $ref: '#/components/schemas/Tac' + nid: + $ref: '#/components/schemas/Nid' + required: + - plmnId + - tac + nullable: true + Ecgi: + type: object + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + # PLMN Identity + eutraCellId: + $ref: '#/components/schemas/EutraCellId' + nid: + $ref: '#/components/schemas/Nid' + required: + - plmnId + - eutraCellId + EcgiRm: + type: object + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + # PLMN Identity + eutraCellId: + $ref: '#/components/schemas/EutraCellId' + nid: + $ref: '#/components/schemas/Nid' + required: + - plmnId + - eutraCellId + nullable: true + Ncgi: + type: object + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + nrCellId: + $ref: '#/components/schemas/NrCellId' + nid: + $ref: '#/components/schemas/Nid' + required: + - plmnId + - nrCellId + NcgiRm: + type: object + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + nrCellId: + $ref: '#/components/schemas/NrCellId' + nid: + $ref: '#/components/schemas/Nid' + required: + - plmnId + - nrCellId + nullable: true + UserLocation: + type: object + properties: + eutraLocation: + $ref: '#/components/schemas/EutraLocation' + nrLocation: + $ref: '#/components/schemas/NrLocation' + n3gaLocation: + $ref: '#/components/schemas/N3gaLocation' + EutraLocation: + type: object + properties: + tai: + $ref: '#/components/schemas/Tai' + ecgi: + $ref: '#/components/schemas/Ecgi' + ignoreEcgi: + type: boolean + default: false + ageOfLocationInformation: + type: integer + minimum: 0 + maximum: 32767 + ueLocationTimestamp: + $ref: '#/components/schemas/DateTime' + geographicalInformation: + type: string + pattern: '^[0-9A-F]{16}$' + geodeticInformation: + type: string + pattern: '^[0-9A-F]{20}$' + globalNgenbId: + $ref: '#/components/schemas/GlobalRanNodeId' + globalENbId: + $ref: '#/components/schemas/GlobalRanNodeId' + required: + - tai + - ecgi + EutraLocationRm: + type: object + properties: + tai: + $ref: '#/components/schemas/Tai' + ecgi: + $ref: '#/components/schemas/Ecgi' + ageOfLocationInformation: + type: integer + minimum: 0 + maximum: 32767 + ueLocationTimestamp: + $ref: '#/components/schemas/DateTime' + geographicalInformation: + type: string + pattern: '^[0-9A-F]{16}$' + geodeticInformation: + type: string + pattern: '^[0-9A-F]{20}$' + globalNgenbId: + $ref: '#/components/schemas/GlobalRanNodeId' + globalENbId: + $ref: '#/components/schemas/GlobalRanNodeId' + required: + - tai + - ecgi + nullable: true + NrLocation: + type: object + properties: + tai: + $ref: '#/components/schemas/Tai' + ncgi: + $ref: '#/components/schemas/Ncgi' + ageOfLocationInformation: + type: integer + minimum: 0 + maximum: 32767 + ueLocationTimestamp: + $ref: '#/components/schemas/DateTime' + geographicalInformation: + type: string + pattern: '^[0-9A-F]{16}$' + geodeticInformation: + type: string + pattern: '^[0-9A-F]{20}$' + globalGnbId: + $ref: '#/components/schemas/GlobalRanNodeId' + required: + - tai + - ncgi + NrLocationRm: + type: object + properties: + tai: + $ref: '#/components/schemas/Tai' + ncgi: + $ref: '#/components/schemas/Ncgi' + ignoreNcgi: + type: boolean + default: false + ageOfLocationInformation: + type: integer + minimum: 0 + maximum: 32767 + ueLocationTimestamp: + $ref: '#/components/schemas/DateTime' + geographicalInformation: + type: string + pattern: '^[0-9A-F]{16}$' + geodeticInformation: + type: string + pattern: '^[0-9A-F]{20}$' + globalGnbId: + $ref: '#/components/schemas/GlobalRanNodeId' + required: + - tai + - ncgi + nullable: true + N3gaLocation: + type: object + properties: + n3gppTai: + $ref: '#/components/schemas/Tai' + n3IwfId: + type: string + pattern: '^[A-Fa-f0-9]+$' + ueIpv4Addr: + $ref: '#/components/schemas/Ipv4Addr' + ueIpv6Addr: + $ref: '#/components/schemas/Ipv6Addr' + portNumber: + $ref: '#/components/schemas/Uinteger' + ssId: + type: string + bssId: + type: string + civicAddress: + $ref: '#/components/schemas/Bytes' + hfcNodeId: + $ref: '#/components/schemas/HfcNodeId' + gli: + $ref: '#/components/schemas/Gli' + UpSecurity: + type: object + properties: + upIntegr: + $ref: '#/components/schemas/UpIntegrity' + upConfid: + $ref: '#/components/schemas/UpConfidentiality' + required: + - upIntegr + - upConfid + UpSecurityRm: + type: object + properties: + upIntegr: + $ref: '#/components/schemas/UpIntegrity' + upConfid: + $ref: '#/components/schemas/UpConfidentiality' + required: + - upIntegr + - upConfid + nullable: true + NgApCause: + type: object + properties: + group: + $ref: '#/components/schemas/Uinteger' + value: + $ref: '#/components/schemas/Uinteger' + required: + - group + - value + BackupAmfInfo: + type: object + properties: + backupAmf: + $ref: '#/components/schemas/AmfName' + guamiList: + type: array + items: + $ref: '#/components/schemas/Guami' + minItems: 1 + required: + - backupAmf + RefToBinaryData: + type: object + properties: + contentId: + type: string + required: + - contentId + RefToBinaryDataRm: + type: object + properties: + contentId: + type: string + required: + - contentId + nullable: true + RouteToLocation: + type: object + properties: + dnai: + $ref: '#/components/schemas/Dnai' + routeInfo: + $ref: '#/components/schemas/RouteInformation' + routeProfId: + type: string + nullable: true + required: + - dnai + anyOf: + - required: [ routeInfo ] + - required: [ routeProfId ] + nullable: true + RouteInformation: + type: object + properties: + ipv4Addr: + $ref: '#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: '#/components/schemas/Ipv6Addr' + portNumber: + $ref: '#/components/schemas/Uinteger' + required: + - portNumber + nullable: true + SubscribedDefaultQos: + type: object + required: + - 5qi + - arp + properties: + 5qi: + $ref: '#/components/schemas/5Qi' + arp: + $ref: '#/components/schemas/Arp' + priorityLevel: + $ref: '#/components/schemas/5QiPriorityLevel' + Area: + type: object + oneOf: + - required: + - tacs + - required: + - areaCode + properties: + tacs: + type: array + items: + $ref: '#/components/schemas/Tac' + minItems: 1 + areaCode: + $ref: '#/components/schemas/AreaCode' + ServiceAreaRestriction: + type: object + properties: + restrictionType: + $ref: '#/components/schemas/RestrictionType' + areas: + type: array + items: + $ref: '#/components/schemas/Area' + maxNumOfTAs: + $ref: '#/components/schemas/Uinteger' + maxNumOfTAsForNotAllowedAreas: + $ref: '#/components/schemas/Uinteger' + allOf: + # + # 1st condition: restrictionType and areas attributes shall be either both absent + # or both present + # + - oneOf: + - not: + required: [ restrictionType ] + - required: [ areas ] + # + # 2nd condition: if restrictionType takes value NOT_ALLOWED_AREAS, + # then maxNumOfTAs shall be absent + # + - anyOf: + - not: + required: [ restrictionType ] + properties: + restrictionType: + type: string + enum: [ NOT_ALLOWED_AREAS ] + - not: + required: [ maxNumOfTAs ] + # + # 3rd condition: if restrictionType takes value ALLOWED_AREAS, + # then maxNumOfTAsForNotAllowedAreas shall be absent + # + - anyOf: + - not: + required: [ restrictionType ] + properties: + restrictionType: + type: string + enum: [ ALLOWED_AREAS ] + - not: + required: [ maxNumOfTAsForNotAllowedAreas ] + WirelineArea: + type: object + properties: + globalLineIds: + type: array + items: + $ref: '#/components/schemas/Gli' + minItems: 1 + hfcNIds: + type: array + items: + $ref: '#/components/schemas/HfcNId' + minItems: 1 + areaCodeB: + $ref: '#/components/schemas/AreaCode' + areaCodeC: + $ref: '#/components/schemas/AreaCode' + WirelineServiceAreaRestriction: + type: object + properties: + restrictionType: + $ref: '#/components/schemas/RestrictionType' + areas: + type: array + items: + $ref: '#/components/schemas/WirelineArea' + PresenceInfo: + type: object + properties: + praId: + type: string + presenceState: + $ref: '#/components/schemas/PresenceState' + trackingAreaList: + type: array + items: + $ref: '#/components/schemas/Tai' + minItems: 1 + ecgiList: + type: array + items: + $ref: '#/components/schemas/Ecgi' + minItems: 1 + ncgiList: + type: array + items: + $ref: '#/components/schemas/Ncgi' + minItems: 1 + globalRanNodeIdList: + type: array + items: + $ref: '#/components/schemas/GlobalRanNodeId' + minItems: 1 + globaleNbIdList: + type: array + items: + $ref: '#/components/schemas/GlobalRanNodeId' + minItems: 1 + PresenceInfoRm: + type: object + properties: + praId: + type: string + presenceState: + $ref: '#/components/schemas/PresenceState' + trackingAreaList: + type: array + items: + $ref: '#/components/schemas/Tai' + minItems: 0 + ecgiList: + type: array + items: + $ref: '#/components/schemas/Ecgi' + minItems: 0 + ncgiList: + type: array + items: + $ref: '#/components/schemas/Ncgi' + minItems: 0 + globalRanNodeIdList: + type: array + items: + $ref: '#/components/schemas/GlobalRanNodeId' + globaleNbIdList: + type: array + items: + $ref: '#/components/schemas/GlobalRanNodeId' + minItems: 1 + nullable: true + GlobalRanNodeId: + type: object + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + n3IwfId: + $ref: '#/components/schemas/N3IwfId' + gNbId: + $ref: '#/components/schemas/GNbId' + ngeNbId: + $ref: '#/components/schemas/NgeNbId' + nid: + $ref: '#/components/schemas/Nid' + eNbId: + $ref: '#/components/schemas/ENbId' + oneOf: + - required: [ n3IwfId ] + - required: [ gNbId ] + - required: [ ngeNbId ] + - required: [ eNbId ] + required: + - plmnId + GNbId: + type: object + properties: + bitLength: + type: integer + minimum: 22 + maximum: 32 + gNBValue: + type: string + pattern: '^[A-Fa-f0-9]{6,8}$' + required: + - bitLength + - gNBValue + AtsssCapability: + type: object + properties: + atsssLL: + type: boolean + default: false + mptcp: + type: boolean + default: false + PlmnIdNid: + type: object + required: + - mcc + - mnc + properties: + mcc: + $ref: '#/components/schemas/Mcc' + mnc: + $ref: '#/components/schemas/Mnc' + nid: + $ref: '#/components/schemas/Nid' + SmallDataRateStatus: + type: object + properties: + remainPacketsUl: + type: integer + minimum: 0 + remainPacketsDl: + type: integer + minimum: 0 + validityTime: + $ref: '#/components/schemas/DateTime' + remainExReportsUl: + type: integer + minimum: 0 + remainExReportsDl: + type: integer + minimum: 0 + ApnRateStatus: + type: object + properties: + remainPacketsUl: + type: integer + minimum: 0 + remainPacketsDl: + type: integer + minimum: 0 + validityTime: + $ref: '#/components/schemas/DateTime' + remainExReportsUl: + type: integer + minimum: 0 + remainExReportsDl: + type: integer + minimum: 0 + HfcNodeId: + type: object + required: + - hfcNId + properties: + hfcNId: + $ref: '#/components/schemas/HfcNId' + HfcNodeIdRm: + type: object + required: + - hfcNId + properties: + hfcNId: + $ref: '#/components/schemas/HfcNId' + nullable: true + ScheduledCommunicationTime: + type: object + properties: + daysOfWeek: + type: array + items: + $ref: '#/components/schemas/DayOfWeek' + minItems: 1 + maxItems: 6 + description: Identifies the day(s) of the week. If absent, it indicates every day of the week. + timeOfDayStart: + $ref: '#/components/schemas/TimeOfDay' + timeOfDayEnd: + $ref: '#/components/schemas/TimeOfDay' + ScheduledCommunicationTimeRm: + anyOf: + - $ref: '#/components/schemas/ScheduledCommunicationTime' + - $ref: '#/components/schemas/NullValue' + BatteryIndication: + type: object + properties: + batteryInd: + type: boolean + replaceableInd: + type: boolean + rechargeableInd: + type: boolean + BatteryIndicationRm: + anyOf: + - $ref: '#/components/schemas/BatteryIndication' + - $ref: '#/components/schemas/NullValue' + AcsInfo: + type: object + properties: + acsUrl: + $ref: '#/components/schemas/Uri' + acsIpv4Addr: + $ref: '#/components/schemas/Ipv4Addr' + acsIpv6Addr: + $ref: '#/components/schemas/Ipv6Addr' + AcsInfoRm: + anyOf: + - $ref: '#/components/schemas/AcsInfo' + - $ref: '#/components/schemas/NullValue' + NrV2xAuth: + type: object + properties: + vehicleUeAuth: + $ref: '#/components/schemas/UeAuth' + pedestrianUeAuth: + $ref: '#/components/schemas/UeAuth' + LteV2xAuth: + type: object + properties: + vehicleUeAuth: + $ref: '#/components/schemas/UeAuth' + pedestrianUeAuth: + $ref: '#/components/schemas/UeAuth' + Pc5QoSPara: + type: object + required: + - pc5QosFlowList + properties: + pc5QosFlowList: + type: array + items: + $ref: '#/components/schemas/Pc5QosFlowItem' + pc5LinkAmbr: + $ref: '#/components/schemas/BitRate' + Pc5QosFlowItem: + type: object + required: + - pqi + properties: + pqi: + $ref: '#/components/schemas/5Qi' + pc5FlowBitRates: + $ref: '#/components/schemas/Pc5FlowBitRates' + range: + $ref: '#/components/schemas/Uinteger' + Pc5FlowBitRates: + type: object + properties: + guaFbr: + $ref: '#/components/schemas/BitRate' + maxFbr: + $ref: '#/components/schemas/BitRate' + UtraLocation: + type: object + oneOf: + - required: + - cgi + - required: + - sai + - required: + - rai + properties: + cgi: + $ref: '#/components/schemas/CellGlobalId' + sai: + $ref: '#/components/schemas/ServiceAreaId' + lai: + $ref: '#/components/schemas/LocationAreaId' + rai: + $ref: '#/components/schemas/RoutingAreaId' + ageOfLocationInformation: + type: integer + minimum: 0 + maximum: 32767 + ueLocationTimestamp: + $ref: '#/components/schemas/DateTime' + geographicalInformation: + type: string + pattern: '^[0-9A-F]{16}$' + geodeticInformation: + type: string + pattern: '^[0-9A-F]{20}$' + GeraLocation: + type: object + oneOf: + - required: + - cgi + - required: + - sai + - required: + - rai + properties: + locationNumber: + type: string + cgi: + $ref: '#/components/schemas/CellGlobalId' + sai: + $ref: '#/components/schemas/ServiceAreaId' + lai: + $ref: '#/components/schemas/LocationAreaId' + vlrNumber: + type: string + mscNumber: + type: string + ageOfLocationInformation: + type: integer + minimum: 0 + maximum: 32767 + ueLocationTimestamp: + $ref: '#/components/schemas/DateTime' + geographicalInformation: + type: string + pattern: '^[0-9A-F]{16}$' + geodeticInformation: + type: string + pattern: '^[0-9A-F]{20}$' + CellGlobalId: + type: object + required: + - plmnId + - lac + - cellId + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + lac: + type: string + cellId: + type: string + pattern: '^[A-Fa-f0-9]$' + ServiceAreaId: + type: object + required: + - plmnId + - lac + - sac + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + lac: + type: string + pattern: '^[A-Fa-f0-9]$' + sac: + type: string + pattern: '^[A-Fa-f0-9]$' + LocationAreaId: + type: object + required: + - plmnId + - lac + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + lac: + type: string + pattern: '^[A-Fa-f0-9]$' + RoutingAreaId: + type: object + required: + - plmnId + - lac + - rac + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + lac: + type: string + pattern: '^[A-Fa-f0-9]$' + rac: + type: string + pattern: '^[A-Fa-f0-9]$' + DddTrafficDescriptor: + type: object + properties: + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + portNumber: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + macAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + MoExpDataCounter: + type: object + required: + - counter + properties: + counter: + type: integer + timeStamp: + $ref: '#/components/schemas/DateTime' + + +# +# Data Types related to 5G QoS as defined in clause 5.5 +# + +# +# SIMPLE DATA TYPES +# +# + Qfi: + type: integer + minimum: 0 + maximum: 63 + QfiRm: + type: integer + minimum: 0 + maximum: 63 + nullable: true + 5Qi: + type: integer + minimum: 0 + maximum: 255 + 5QiRm: + type: integer + minimum: 0 + maximum: 255 + nullable: true + BitRate: + type: string + pattern: '^\d+(\.\d+)? (bps|Kbps|Mbps|Gbps|Tbps)$' + BitRateRm: + type: string + pattern: '^\d+(\.\d+)? (bps|Kbps|Mbps|Gbps|Tbps)$' + nullable: true + ArpPriorityLevelRm: + type: integer + minimum: 1 + maximum: 15 + nullable: true + ArpPriorityLevel: + type: integer + minimum: 1 + maximum: 15 + nullable: true + description: nullable true shall not be used for this attribute + 5QiPriorityLevel: + type: integer + minimum: 1 + maximum: 127 + 5QiPriorityLevelRm: + type: integer + minimum: 1 + maximum: 127 + nullable: true + PacketDelBudget: + type: integer + minimum: 1 + PacketDelBudgetRm: + type: integer + minimum: 1 + nullable: true + PacketErrRate: + type: string + pattern: '^([0-9]E-[0-9])$' + PacketErrRateRm: + type: string + pattern: '^([0-9]E-[0-9])$' + nullable: true + PacketLossRate: + type: integer + minimum: 0 + maximum: 1000 + PacketLossRateRm: + type: integer + minimum: 0 + maximum: 1000 + nullable: true + AverWindow: + type: integer + minimum: 1 + maximum: 4095 + default: 2000 + AverWindowRm: + type: integer + maximum: 4095 + default: 2000 + minimum: 1 + nullable: true + MaxDataBurstVol: + type: integer + minimum: 1 + maximum: 4095 + MaxDataBurstVolRm: + type: integer + minimum: 1 + maximum: 4095 + nullable: true + SamplingRatio: + type: integer + minimum: 1 + maximum: 100 + SamplingRatioRm: + type: integer + minimum: 1 + maximum: 100 + nullable: true + RgWirelineCharacteristics: + $ref: '#/components/schemas/Bytes' + RgWirelineCharacteristicsRm: + allOf: + - $ref: '#/components/schemas/RgWirelineCharacteristics' + - nullable: true + ExtMaxDataBurstVol: + type: integer + minimum: 4096 + maximum: 2000000 + ExtMaxDataBurstVolRm: + type: integer + minimum: 4096 + maximum: 2000000 + nullable: true + +# +# ENUMERATED DATA TYPES +# + + PreemptionCapability: + anyOf: + - type: string + enum: + - NOT_PREEMPT + - MAY_PREEMPT + - type: string + PreemptionCapabilityRm: + anyOf: + - $ref: '#/components/schemas/PreemptionCapability' + - $ref: '#/components/schemas/NullValue' + PreemptionVulnerability: + anyOf: + - type: string + enum: + - NOT_PREEMPTABLE + - PREEMPTABLE + - type: string + PreemptionVulnerabilityRm: + anyOf: + - $ref: '#/components/schemas/PreemptionVulnerability' + - $ref: '#/components/schemas/NullValue' + ReflectiveQoSAttribute: + anyOf: + - type: string + enum: + - RQOS + - NO_RQOS + - type: string + ReflectiveQoSAttributeRm: + anyOf: + - $ref: '#/components/schemas/ReflectiveQoSAttribute' + - $ref: '#/components/schemas/NullValue' + NotificationControl: + anyOf: + - type: string + enum: + - REQUESTED + - NOT_REQUESTED + - type: string + NotificationControlRm: + anyOf: + - $ref: '#/components/schemas/NotificationControl' + - $ref: '#/components/schemas/NullValue' + QosResourceType: + anyOf: + - type: string + enum: + - NON_GBR + - NON_CRITICAL_GBR + - CRITICAL_GBR + - type: string + QosResourceTypeRm: + anyOf: + - $ref: '#/components/schemas/QosResourceType' + - $ref: '#/components/schemas/NullValue' + AdditionalQosFlowInfo: + anyOf: + - anyOf: + - type: string + enum: + - MORE_LIKELY + - type: string + - $ref: '#/components/schemas/NullValue' +# + +# +# STRUCTURED DATA TYPES +# + + Arp: + type: object + properties: + priorityLevel: + $ref: '#/components/schemas/ArpPriorityLevel' + preemptCap: + $ref: '#/components/schemas/PreemptionCapability' + preemptVuln: + $ref: '#/components/schemas/PreemptionVulnerability' + required: + - priorityLevel + - preemptCap + - preemptVuln + ArpRm: + type: object + properties: + priorityLevel: + $ref: '#/components/schemas/ArpPriorityLevel' + preemptCap: + $ref: '#/components/schemas/PreemptionCapability' + preemptVuln: + $ref: '#/components/schemas/PreemptionVulnerability' + required: + - priorityLevel + - preemptCap + - preemptVuln + nullable: true + Ambr: + type: object + properties: + uplink: + $ref: '#/components/schemas/BitRate' + downlink: + $ref: '#/components/schemas/BitRate' + required: + - uplink + - downlink + AmbrRm: + type: object + properties: + uplink: + $ref: '#/components/schemas/BitRate' + downlink: + $ref: '#/components/schemas/BitRate' + required: + - uplink + - downlink + nullable: true + Dynamic5Qi: + type: object + properties: + resourceType: + $ref: '#/components/schemas/QosResourceType' + priorityLevel: + $ref: '#/components/schemas/5QiPriorityLevel' + packetDelayBudget: + $ref: '#/components/schemas/PacketDelBudget' + packetErrRate: + $ref: '#/components/schemas/PacketErrRate' + averWindow: + $ref: '#/components/schemas/AverWindow' + maxDataBurstVol: + $ref: '#/components/schemas/MaxDataBurstVol' + extMaxDataBurstVol: + $ref: '#/components/schemas/ExtMaxDataBurstVol' + required: + - resourceType + - priorityLevel + - packetDelayBudget + - packetErrRate + NonDynamic5Qi: + type: object + properties: + priorityLevel: + $ref: '#/components/schemas/5QiPriorityLevel' + averWindow: + $ref: '#/components/schemas/AverWindow' + maxDataBurstVol: + $ref: '#/components/schemas/MaxDataBurstVol' + extMaxDataBurstVol: + $ref: '#/components/schemas/ExtMaxDataBurstVol' + minProperties: 0 + Tmbr: + type: object + properties: + uplink: + $ref: '#/components/schemas/BitRate' + downlink: + $ref: '#/components/schemas/BitRate' + required: + - uplink + - downlink + TmbrRm: + anyOf: + - $ref: '#/components/schemas/Tmbr' + - $ref: '#/components/schemas/NullValue' + +# +# Data Types related to 5G Trace as defined in clause 5.6 +# + +# +# SIMPLE DATA TYPES +# +# +# +# Enumerations +# + TraceDepth: + anyOf: + - type: string + enum: + - MINIMUM + - MEDIUM + - MAXIMUM + - MINIMUM_WO_VENDOR_EXTENSION + - MEDIUM_WO_VENDOR_EXTENSION + - MAXIMUM_WO_VENDOR_EXTENSION + - type: string + TraceDepthRm: + anyOf: + - $ref: '#/components/schemas/TraceDepth' + - $ref: '#/components/schemas/NullValue' +# +# STRUCTURED DATA TYPES +# + TraceData: + type: object + nullable: true + properties: + traceRef: + type: string + pattern: '^[0-9]{3}[0-9]{2,3}-[A-Fa-f0-9]{6}$' + traceDepth: + $ref: '#/components/schemas/TraceDepth' + neTypeList: + type: string + pattern: '^[A-Fa-f0-9]+$' + eventList: + type: string + pattern: '^[A-Fa-f0-9]+$' + collectionEntityIpv4Addr: + $ref: '#/components/schemas/Ipv4Addr' + collectionEntityIpv6Addr: + $ref: '#/components/schemas/Ipv6Addr' + interfaceList: + type: string + pattern: '^[A-Fa-f0-9]+$' + required: + - traceRef + - traceDepth + - neTypeList + - eventList + + +# Data Types related to 5G ODB as defined in clause 5.7 + +# +# SIMPLE DATA TYPES +# +# +# +# Enumerations +# + RoamingOdb: + anyOf: + - type: string + enum: + - OUTSIDE_HOME_PLMN + - OUTSIDE_HOME_PLMN_COUNTRY + - type: string + + OdbPacketServices: + anyOf: + - anyOf: + - type: string + enum: + - ALL_PACKET_SERVICES + - ROAMER_ACCESS_HPLMN_AP + - ROAMER_ACCESS_VPLMN_AP + - type: string + - $ref: '#/components/schemas/NullValue' + +# +# STRUCTURED DATA TYPES +# + + OdbData: + type: object + properties: + roamingOdb: + $ref: '#/components/schemas/RoamingOdb' + +# +# Data Types related to Charging as defined in clause 5.8 +# + +# +# SIMPLE DATA TYPES +# +# + ChargingId: + $ref: '#/components/schemas/Uint32' + + ApplicationChargingId: + type: string + + RatingGroup: + $ref: '#/components/schemas/Uint32' + + ServiceId: + $ref: '#/components/schemas/Uint32' + + +# +# Enumerations +# + +# +# STRUCTURED DATA TYPES +# + SecondaryRatUsageReport: + type: object + properties: + secondaryRatType: + $ref: '#/components/schemas/RatType' + qosFlowsUsageData: + type: array + items: + $ref: '#/components/schemas/QosFlowUsageReport' + minItems: 1 + required: + - secondaryRatType + - qosFlowsUsageData + + QosFlowUsageReport: + type: object + properties: + qfi: + $ref: '#/components/schemas/Qfi' + startTimeStamp: + $ref: '#/components/schemas/DateTime' + endTimeStamp: + $ref: '#/components/schemas/DateTime' + downlinkVolume: + $ref: '#/components/schemas/Int64' + uplinkVolume: + $ref: '#/components/schemas/Int64' + required: + - qfi + - startTimeStamp + - endTimeStamp + - downlinkVolume + - uplinkVolume + + SecondaryRatUsageInfo: + type: object + properties: + secondaryRatType: + $ref: '#/components/schemas/RatType' + qosFlowsUsageData: + type: array + items: + $ref: '#/components/schemas/QosFlowUsageReport' + minItems: 1 + pduSessionUsageData: + type: array + items: + $ref: '#/components/schemas/VolumeTimedReport' + minItems: 1 + required: + - secondaryRatType + + VolumeTimedReport: + type: object + properties: + startTimeStamp: + $ref: '#/components/schemas/DateTime' + endTimeStamp: + $ref: '#/components/schemas/DateTime' + downlinkVolume: + $ref: '#/components/schemas/Int64' + uplinkVolume: + $ref: '#/components/schemas/Int64' + required: + - startTimeStamp + - endTimeStamp + - downlinkVolume + - uplinkVolume + + +# +# HTTP responses +# + + responses: + '400': + description: Bad request + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '401': + description: Unauthorized + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '403': + description: Forbidden + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '404': + description: Not Found + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '405': + description: Method Not Allowed + '408': + description: Request Timeout + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '406': + description: 406 Not Acceptable + '409': + description: Conflict + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '410': + description: Gone + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '411': + description: Length Required + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '412': + description: Precondition Failed + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '413': + description: Payload Too Large + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '414': + description: URI Too Long + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '415': + description: Unsupported Media Type + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '429': + description: Too Many Requests + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '500': + description: Internal Server Error + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '501': + description: Not Implemented + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '503': + description: Service Unavailable + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '504': + description: Gateway Timeout + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + default: + description: Generic Error + diff --git a/lib/sbi/support/standard/TS29572_Nlmf_Broadcast.yaml b/lib/sbi/support/standard/TS29572_Nlmf_Broadcast.yaml new file mode 100644 index 0000000000..28b10e6b63 --- /dev/null +++ b/lib/sbi/support/standard/TS29572_Nlmf_Broadcast.yaml @@ -0,0 +1,210 @@ +openapi: 3.0.0 + +info: + version: '1.0.0.alpha-1' + title: 'LMF Broadcast' + description: | + LMF Broadcast Service. + © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.572 V16.1.0; 5G System; Location Management Services; Stage 3 + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.572/' + +servers: + - url: '{apiRoot}/nlmf-broadcast/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +paths: + /cipher-key-data: + post: + summary: Request ciphering key data + operationId: CipheringKeyData + tags: + - Request Ciphering Key Data + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CipherRequestData' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/CipherResponseData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + CipheringKeyData: + '{$request.body#/amfCallBackURI}': + post: + requestBody: + description: Ciphering Key Data Notification + content: + application/json: + schema: + $ref: '#/components/schemas/CipheringKeyInfo' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/CipheringKeyResponse' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + schemas: +# +# COMPLEX TYPES +# + CipheringKeyInfo: + type: object + required: + - cipheringData + properties: + cipheringData: + type: array + items: + $ref: '#/components/schemas/CipheringDataSet' + minItems: 1 + CipheringKeyResponse: + type: object + properties: + cipheringDataReport: + type: array + items: + $ref: '#/components/schemas/CipheringSetReport' + minItems: 1 + CipheringDataSet: + type: object + required: + - cipheringSetID + - cipheringKey + - c0 + - validityStartTime + - validityDuration + properties: + cipheringSetID: + $ref: '#/components/schemas/CipheringSetID' + cipheringKey: + $ref: '#/components/schemas/CipheringKey' + c0: + $ref: '#/components/schemas/C0' + ltePosSibTypes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Binary' + nrPosSibTypes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Binary' + validityStartTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + validityDuration: + $ref: '#/components/schemas/ValidityDuration' + taiList: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Binary' + CipheringSetReport: + type: object + required: + - cipheringSetID + - storageOutcome + properties: + cipheringSetID: + $ref: '#/components/schemas/CipheringSetID' + storageOutcome: + $ref: '#/components/schemas/StorageOutcome' + CipherRequestData: + type: object + required: + - amfCallBackURI + properties: + amfCallBackURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + CipherResponseData: + type: object + required: + - dataAvailability + properties: + dataAvailability: + $ref: '#/components/schemas/DataAvailability' +# +# +# SIMPLE TYPES +# + CipheringSetID: + type: integer + minimum: 0 + maximum: 65535 + CipheringKey: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Binary' + C0: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Binary' + ValidityDuration: + type: integer + minimum: 1 + maximum: 65535 +# +# ENUMS +# + StorageOutcome: + anyOf: + - type: string + enum: + - STORAGE_SUCCESSFUL + - STORAGE_FAILED + DataAvailability: + anyOf: + - type: string + enum: + - CIPHERING_KEY_DATA_AVAILABLE + - CIPHERING_KEY_DATA_NOT_AVAILABLE diff --git a/lib/sbi/support/standard/TS29572_Nlmf_Location.yaml b/lib/sbi/support/standard/TS29572_Nlmf_Location.yaml new file mode 100644 index 0000000000..a679b94eeb --- /dev/null +++ b/lib/sbi/support/standard/TS29572_Nlmf_Location.yaml @@ -0,0 +1,1139 @@ +openapi: 3.0.0 + +info: + version: '1.1.0.alpha-3' + title: 'LMF Location' + description: | + LMF Location Service. + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.572 V16.2.0; 5G System; Location Management Services; Stage 3 + url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.572/' + +servers: + - url: '{apiRoot}/nlmf-loc/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +security: + - {} + - oAuth2ClientCredentials: + - nlmf-loc + +paths: + /determine-location: + post: + summary: Determine Location of an UE + operationId: DetermineLocation + tags: + - Determine Location + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InputData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/InputData' + binaryDataLppMessage: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataLppMessage: + contentType: application/vnd.3gpp.lpp + headers: + Content-Id: + schema: + type: string + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/LocationData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + EventNotify: + '{$request.body#/hgmlcCallBackURI}': + post: + requestBody: + description: UE Event Notification + content: + application/json: + schema: + $ref: '#/components/schemas/EventNotifyData' + responses: + '204': + description: Expected response to a valid notification + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /cancel-location: + post: + summary: request cancellation of periodic or triggered location + operationId: CancelLocation + tags: + - Cancel Location + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CancelLocData' + required: true + responses: + '204': + description: Expected response to a successful cancellation + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /location-context-transfer: + post: + summary: transfer context information for periodic or triggered location + operationId: LocationContextTransfer + tags: + - Location Context Transfer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LocContextData' + required: true + responses: + '204': + description: Expected response to successful location context transfer + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nlmf-loc: Access to the Nlmf_Location API + schemas: +# +# COMPLEX TYPES +# + InputData: + type: object + not: + required: [ ecgi, ncgi ] + properties: + externalClientType: + $ref: '#/components/schemas/ExternalClientType' + correlationID: + $ref: '#/components/schemas/CorrelationID' + amfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + locationQoS: + $ref: '#/components/schemas/LocationQoS' + supportedGADShapes: + type: array + items: + $ref: '#/components/schemas/SupportedGADShapes' + minItems: 1 + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + ecgiOnSecondNode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + ncgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + ncgiOnSecondNode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + priority: + $ref: '#/components/schemas/LcsPriority' + velocityRequested: + $ref: '#/components/schemas/VelocityRequested' + ueLcsCap: + $ref: '#/components/schemas/UeLcsCapability' + lcsServiceType: + $ref: '#/components/schemas/LcsServiceType' + ldrType: + $ref: '#/components/schemas/LdrType' + hgmlcCallBackURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ldrReference: + $ref: '#/components/schemas/LdrReference' + periodicEventInfo: + $ref: '#/components/schemas/PeriodicEventInfo' + areaEventInfo: + $ref: '#/components/schemas/AreaEventInfo' + motionEventInfo: + $ref: '#/components/schemas/MotionEventInfo' + reportingAccessTypes: + $ref: '#/components/schemas/ReportingAccessTypes' + ueConnectivityStates: + $ref: '#/components/schemas/UeConnectivityState' + ueLocationServiceInd: + $ref: '#/components/schemas/UeLocationServiceInd' + lppMessage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + + LocationData: + type: object + required: + - locationEstimate + properties: + locationEstimate: + $ref: '#/components/schemas/GeographicArea' + accuracyFulfilmentIndicator: + $ref: '#/components/schemas/AccuracyFulfilmentIndicator' + ageOfLocationEstimate: + $ref: '#/components/schemas/AgeOfLocationEstimate' + velocityEstimate: + $ref: '#/components/schemas/VelocityEstimate' + civicAddress: + $ref: '#/components/schemas/CivicAddress' + positioningDataList: + type: array + items: + $ref: '#/components/schemas/PositioningMethodAndUsage' + minItems: 1 + gnssPositioningDataList: + type: array + items: + $ref: '#/components/schemas/GnssPositioningMethodAndUsage' + minItems: 1 + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + ncgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + altitude: + $ref: '#/components/schemas/Altitude' + barometricPressure: + $ref: '#/components/schemas/BarometricPressure' + servingLMFIdentification: + $ref: '#/components/schemas/LMFIdentification' + GeographicArea: + anyOf: + - $ref: '#/components/schemas/Point' + - $ref: '#/components/schemas/PointUncertaintyCircle' + - $ref: '#/components/schemas/PointUncertaintyEllipse' + - $ref: '#/components/schemas/Polygon' + - $ref: '#/components/schemas/PointAltitude' + - $ref: '#/components/schemas/PointAltitudeUncertainty' + - $ref: '#/components/schemas/EllipsoidArc' + GADShape: + type: object + required: + - shape + properties: + shape: + $ref: '#/components/schemas/SupportedGADShapes' + discriminator: + propertyName: shape + mapping: + POINT: '#/components/schemas/Point' + POINT_UNCERTAINTY_CIRCLE: '#/components/schemas/PointUncertaintyCircle' + POINT_UNCERTAINTY_ELLIPSE: '#/components/schemas/PointUncertaintyEllipse' + POLYGON: '#/components/schemas/Polygon' + POINT_ALTITUDE: '#/components/schemas/PointAltitude' + POINT_ALTITUDE_UNCERTAINTY: '#/components/schemas/PointAltitudeUncertainty' + ELLIPSOID_ARC: '#/components/schemas/EllipsoidArc' + Point: + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - point + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + PointUncertaintyCircle: + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - point + - uncertainty + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + uncertainty: + $ref: '#/components/schemas/Uncertainty' + PointUncertaintyEllipse: + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - point + - uncertaintyEllipse + - confidence + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + uncertaintyEllipse: + $ref: '#/components/schemas/UncertaintyEllipse' + confidence: + $ref: '#/components/schemas/Confidence' + Polygon: + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - pointList + properties: + pointList: + $ref: '#/components/schemas/PointList' + PointAltitude: + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - point + - altitude + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + altitude: + $ref: '#/components/schemas/Altitude' + PointAltitudeUncertainty: + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - point + - altitude + - uncertaintyEllipse + - uncertaintyAltitude + - confidence + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + altitude: + $ref: '#/components/schemas/Altitude' + uncertaintyEllipse: + $ref: '#/components/schemas/UncertaintyEllipse' + uncertaintyAltitude: + $ref: '#/components/schemas/Uncertainty' + confidence: + $ref: '#/components/schemas/Confidence' + EllipsoidArc: + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - point + - innerRadius + - uncertaintyRadius + - offsetAngle + - includedAngle + - confidence + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + innerRadius: + $ref: '#/components/schemas/InnerRadius' + uncertaintyRadius: + $ref: '#/components/schemas/Uncertainty' + offsetAngle: + $ref: '#/components/schemas/Angle' + includedAngle: + $ref: '#/components/schemas/Angle' + confidence: + $ref: '#/components/schemas/Confidence' + GeographicalCoordinates: + type: object + required: + - lon + - lat + properties: + lon: + type: number + format: double + minimum: -180 + maximum: 180 + lat: + type: number + format: double + minimum: -90 + maximum: 90 + UncertaintyEllipse: + type: object + required: + - semiMajor + - semiMinor + - orientationMajor + properties: + semiMajor: + $ref: '#/components/schemas/Uncertainty' + semiMinor: + $ref: '#/components/schemas/Uncertainty' + orientationMajor: + $ref: '#/components/schemas/Orientation' + PointList: + type: array + items: + $ref: '#/components/schemas/GeographicalCoordinates' + minItems: 3 + maxItems: 15 + LocationQoS: + type: object + properties: + hAccuracy: + $ref: '#/components/schemas/Accuracy' + vAccuracy: + $ref: '#/components/schemas/Accuracy' + verticalRequested: + type: boolean + responseTime: + $ref: '#/components/schemas/ResponseTime' + lcsQosClass: + $ref: '#/components/schemas/LcsQosClass' + PositioningMethodAndUsage: + type: object + required: + - method + - mode + - usage + properties: + method: + $ref: '#/components/schemas/PositioningMethod' + mode: + $ref: '#/components/schemas/PositioningMode' + usage: + $ref: '#/components/schemas/Usage' + GnssPositioningMethodAndUsage: + type: object + required: + - mode + - gnss + - usage + properties: + mode: + $ref: '#/components/schemas/PositioningMode' + gnss: + $ref: '#/components/schemas/GnssId' + usage: + $ref: '#/components/schemas/Usage' + CivicAddress: + type: object + properties: + country: + type: string + A1: + type: string + A2: + type: string + A3: + type: string + A4: + type: string + A5: + type: string + A6: + type: string + PRD: + type: string + POD: + type: string + STS: + type: string + HNO: + type: string + HNS: + type: string + LMK: + type: string + LOC: + type: string + NAM: + type: string + PC: + type: string + BLD: + type: string + UNIT: + type: string + FLR: + type: string + ROOM: + type: string + PLC: + type: string + PCN: + type: string + POBOX: + type: string + ADDCODE: + type: string + SEAT: + type: string + RD: + type: string + RDSEC: + type: string + RDBR: + type: string + RDSUBBR: + type: string + PRM: + type: string + POM: + type: string + VelocityEstimate: + oneOf: + - $ref: '#/components/schemas/HorizontalVelocity' + - $ref: '#/components/schemas/HorizontalWithVerticalVelocity' + - $ref: '#/components/schemas/HorizontalVelocityWithUncertainty' + - $ref: '#/components/schemas/HorizontalWithVerticalVelocityAndUncertainty' + HorizontalVelocity: + type: object + required: + - hSpeed + - bearing + properties: + hSpeed: + $ref: '#/components/schemas/HorizontalSpeed' + bearing: + $ref: '#/components/schemas/Angle' + HorizontalWithVerticalVelocity: + type: object + required: + - hSpeed + - bearing + - vSpeed + - vDirection + properties: + hSpeed: + $ref: '#/components/schemas/HorizontalSpeed' + bearing: + $ref: '#/components/schemas/Angle' + vSpeed: + $ref: '#/components/schemas/VerticalSpeed' + vDirection: + $ref: '#/components/schemas/VerticalDirection' + HorizontalVelocityWithUncertainty: + type: object + required: + - hSpeed + - bearing + - hUncertainty + properties: + hSpeed: + $ref: '#/components/schemas/HorizontalSpeed' + bearing: + $ref: '#/components/schemas/Angle' + hUncertainty: + $ref: '#/components/schemas/SpeedUncertainty' + HorizontalWithVerticalVelocityAndUncertainty: + type: object + required: + - hSpeed + - bearing + - vSpeed + - vDirection + - hUncertainty + - vUncertainty + properties: + hSpeed: + $ref: '#/components/schemas/HorizontalSpeed' + bearing: + $ref: '#/components/schemas/Angle' + vSpeed: + $ref: '#/components/schemas/VerticalSpeed' + vDirection: + $ref: '#/components/schemas/VerticalDirection' + hUncertainty: + $ref: '#/components/schemas/SpeedUncertainty' + vUncertainty: + $ref: '#/components/schemas/SpeedUncertainty' + UeLcsCapability: + type: object + properties: + lppSupport: + type: boolean + default: true + ciotOptimisation: + type: boolean + default: false + PeriodicEventInfo: + type: object + required: + - reportingAmount + - reportingInterval + properties: + reportingAmount: + $ref: '#/components/schemas/ReportingAmount' + reportingInterval: + $ref: '#/components/schemas/ReportingInterval' + AreaEventInfo: + type: object + required: + - areaDefinition + properties: + areaDefinition: + type: array + items: + $ref: '#/components/schemas/ReportingArea' + minItems: 1 + maxItems: 250 + occurrenceInfo: + $ref: '#/components/schemas/OccurrenceInfo' + minimumInterval: + $ref: '#/components/schemas/MinimumInterval' + maximumInterval: + $ref: '#/components/schemas/MaximumInterval' + samplingInterval: + $ref: '#/components/schemas/SamplingInterval' + reportingDuration: + $ref: '#/components/schemas/ReportingDuration' + reportingLocationReq: + type: boolean + default: true + ReportingArea: + type: object + required: + - areaType + properties: + areaType: + $ref: '#/components/schemas/ReportingAreaType' + tai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + ncgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + MotionEventInfo: + type: object + required: + - linearDistance + properties: + linearDistance: + $ref: '#/components/schemas/LinearDistance' + occurrenceInfo: + $ref: '#/components/schemas/OccurrenceInfo' + minimumInterval: + $ref: '#/components/schemas/MinimumInterval' + maximumInterval: + $ref: '#/components/schemas/MaximumInterval' + samplingInterval: + $ref: '#/components/schemas/SamplingInterval' + reportingDuration: + $ref: '#/components/schemas/ReportingDuration' + reportingLocationReq: + type: boolean + default: true + ReportingAccessTypes: + type: array + items: + $ref: '#/components/schemas/ReportingAccessType' + minItems: 1 + CancelLocData: + type: object + required: + - hgmlcCallBackURI + - ldrReference + properties: + hgmlcCallBackURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ldrReference: + $ref: '#/components/schemas/LdrReference' + LocContextData: + type: object + required: + - amfId + - ldrType + - hgmlcCallBackURI + - ldrReference + - eventReportMessage + properties: + amfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + locationQoS: + $ref: '#/components/schemas/LocationQoS' + supportedGADShapes: + type: array + items: + $ref: '#/components/schemas/SupportedGADShapes' + minItems: 1 + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + ldrType: + $ref: '#/components/schemas/LdrType' + hgmlcCallBackURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ldrReference: + $ref: '#/components/schemas/LdrReference' + periodicEventInfo: + $ref: '#/components/schemas/PeriodicEventInfo' + areaEventInfo: + $ref: '#/components/schemas/AreaEventInfo' + motionEventInfo: + $ref: '#/components/schemas/MotionEventInfo' + eventReportMessage: + $ref: '#/components/schemas/EventReportMessage' + eventReportingStatus: + $ref: '#/components/schemas/EventReportingStatus' + ueLocationInfo: + $ref: '#/components/schemas/UELocationInfo' + EventReportMessage: + type: object + required: + - eventClass + - eventContent + properties: + eventClass: + $ref: '#/components/schemas/EventClass' + eventContent: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + EventReportingStatus: + type: object + properties: + eventReportCounter: + $ref: '#/components/schemas/EventReportCounter' + eventReportDuration: + $ref: '#/components/schemas/EventReportDuration' + UELocationInfo: + type: object + properties: + locationEstimate: + $ref: '#/components/schemas/GeographicArea' + ageOfLocationEstimate: + $ref: '#/components/schemas/AgeOfLocationEstimate' + velocityEstimate: + $ref: '#/components/schemas/VelocityEstimate' + ageOfVelocityEstimate: + $ref: '#/components/schemas/AgeOfLocationEstimate' + + EventNotifyData: + type: object + required: + - reportedEventType + - ldrReference + properties: + reportedEventType: + $ref: '#/components/schemas/ReportedEventType' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + hgmlcCallBackURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ldrReference: + $ref: '#/components/schemas/LdrReference' + locationEstimate: + $ref: '#/components/schemas/GeographicArea' + ageOfLocationEstimate: + $ref: '#/components/schemas/AgeOfLocationEstimate' + civicAddress: + $ref: '#/components/schemas/CivicAddress' + positioningDataList: + type: array + items: + $ref: '#/components/schemas/PositioningMethodAndUsage' + minItems: 1 + gnssPositioningDataList: + type: array + items: + $ref: '#/components/schemas/GnssPositioningMethodAndUsage' + minItems: 1 + servingLMFidentification: + $ref: '#/components/schemas/LMFIdentification' + terminationCause: + $ref: '#/components/schemas/TerminationCause' + + UeConnectivityState: + type: object + required: + - accessType + properties: + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + connectivitystate: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/CmState' +# +# +# SIMPLE TYPES +# + Altitude: + type: number + format: double + minimum: -32767 + maximum: 32767 + Angle: + type: integer + minimum: 0 + maximum: 360 + Uncertainty: + type: number + format: float + minimum: 0 + Orientation: + type: integer + minimum: 0 + maximum: 180 + Confidence: + type: integer + minimum: 0 + maximum: 100 + Accuracy: + type: number + format: float + minimum: 0 + InnerRadius: + type: integer + format: int32 + minimum: 0 + maximum: 327675 + CorrelationID: + type: string + minLength: 1 + maxLength: 255 + AgeOfLocationEstimate: + type: integer + minimum: 0 + maximum: 32767 + HorizontalSpeed: + type: number + format: float + minimum: 0 + maximum: 2047 + VerticalSpeed: + type: number + format: float + minimum: 0 + maximum: 255 + SpeedUncertainty: + type: number + format: float + minimum: 0 + maximum: 255 + BarometricPressure: + type: integer + minimum: 30000 + maximum: 115000 + LcsServiceType: + type: integer + minimum: 0 + maximum: 127 + LdrReference: + type: string + minLength: 2 + maxLength: 510 + ReportingAmount: + type: integer + minimum: 1 + maximum: 8639999 + ReportingInterval: + type: integer + minimum: 1 + maximum: 8639999 + MinimumInterval: + type: integer + minimum: 1 + maximum: 32767 + MaximumInterval: + type: integer + minimum: 1 + maximum: 86400 + SamplingInterval: + type: integer + minimum: 1 + maximum: 3600 + ReportingDuration: + type: integer + minimum: 1 + maximum: 8640000 + LinearDistance: + type: integer + minimum: 1 + maximum: 10000 + LMFIdentification: + type: string + EventReportCounter: + type: integer + minimum: 1 + maximum: 8640000 + EventReportDuration: + type: integer + minimum: 1 + maximum: 8640000 +# +# ENUMS +# + ExternalClientType: + anyOf: + - type: string + enum: + - EMERGENCY_SERVICES + - VALUE_ADDED_SERVICES + - PLMN_OPERATOR_SERVICES + - LAWFUL_INTERCEPT_SERVICES + - PLMN_OPERATOR_BROADCAST_SERVICES + - PLMN_OPERATOR_OM + - PLMN_OPERATOR_ANONYMOUS_STATISTICS + - PLMN_OPERATOR_TARGET_MS_SERVICE_SUPPORT + - type: string + SupportedGADShapes: + anyOf: + - type: string + enum: + - POINT + - POINT_UNCERTAINTY_CIRCLE + - POINT_UNCERTAINTY_ELLIPSE + - POLYGON + - POINT_ALTITUDE + - POINT_ALTITUDE_UNCERTAINTY + - ELLIPSOID_ARC + - type: string + ResponseTime: + anyOf: + - type: string + enum: + - LOW_DELAY + - DELAY_TOLERANT + - type: string + PositioningMethod: + anyOf: + - type: string + enum: + - CELLID + - ECID + - OTDOA + - BAROMETRIC_PRESSURE + - WLAN + - BLUETOOTH + - MBS + - MOTION_SENSOR + - type: string + PositioningMode: + anyOf: + - type: string + enum: + - UE_BASED + - UE_ASSISTED + - CONVENTIONAL + - type: string + GnssId: + anyOf: + - type: string + enum: + - GPS + - GALILEO + - SBAS + - MODERNIZED_GPS + - QZSS + - GLONASS + - type: string + Usage: + anyOf: + - type: string + enum: + - UNSUCCESS + - SUCCESS_RESULTS_NOT_USED + - SUCCESS_RESULTS_USED_TO_VERIFY_LOCATION + - SUCCESS_RESULTS_USED_TO_GENERATE_LOCATION + - SUCCESS_METHOD_NOT_DETERMINED + - type: string + LcsPriority: + anyOf: + - type: string + enum: + - HIGHEST_PRIORITY + - NORMAL_PRIORITY + - type: string + VelocityRequested: + anyOf: + - type: string + enum: + - VELOCITY_IS_NOT_REQUESTED + - VELOCITY_IS_REQUESTED + - type: string + AccuracyFulfilmentIndicator: + anyOf: + - type: string + enum: + - REQUESTED_ACCURACY_FULFILLED + - REQUESTED_ACCURACY_NOT_FULFILLED + - type: string + VerticalDirection: + type: string + enum: + - UPWARD + - DOWNWARD + LdrType: + anyOf: + - type: string + enum: + - UE_AVAILABLE + - PERIODIC + - ENTERING_INTO_AREA + - LEAVING_FROM_AREA + - BEING_INSIDE_AREA + - MOTION + - type: string + ReportingAreaType: + anyOf: + - type: string + enum: + - EPS_TRACKING_AREA_IDENTITY + - E-UTRAN_CELL_GLOBAL_IDENTIFICATION + - 5GS_TRACKING_AREA_IDENTITY + - NR_CELL_GLOBAL_IDENTITY + - type: string + OccurrenceInfo: + anyOf: + - type: string + enum: + - ONE_TIME_EVENT + - MULTIPLE_TIME_EVENT + - type: string + ReportingAccessType: + anyOf: + - type: string + enum: + - NR + - EUTRA_CONNECTED_TO_5GC + - NON_3GPP_CONNECTED_TO_5GC + - type: string + EventClass: + anyOf: + - type: string + enum: + - SUPPLEMENTARY_SERVICES + - type: string + ReportedEventType: + anyOf: + - type: string + enum: + - PERIODIC_EVENT + - ENTERING_AREA_EVENT + - LEAVING_AREA_EVENT + - BEING_INSIDE_AREA_EVENT + - MOTION_EVENT + - MAXIMUM_INTERVAL_EXPIRATION_EVENT + - LOCATION_CANCELLATION_EVENT + - type: string + TerminationCause: + anyOf: + - type: string + enum: + - TERMINATION_BY_UE + - TERMINATION_BY_NETWORK + - NORMAL_TERMINATION + - type: string + LcsQosClass: + anyOf: + - type: string + enum: + - BEST_EFFORT + - ASSURED + - type: string + + UeLocationServiceInd: + anyOf: + - type: string + enum: + - LOCATION_ESTIMATE + - LOCATION_ASSISTANCE_DATA + - type: string diff --git a/misc/netconf.sh b/misc/netconf.sh index 5f4d234b03..5af9389f57 100755 --- a/misc/netconf.sh +++ b/misc/netconf.sh @@ -21,6 +21,8 @@ else ifconfig lo0 alias 127.0.0.3 netmask 255.255.255.255 ifconfig lo0 alias 127.0.0.4 netmask 255.255.255.255 ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.0.6 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.0.7 netmask 255.255.255.255 if [ "$SYSTEM" = "Darwin" ]; then if ! test -f /etc/pf.anchors/org.open5gs; then sudo sh -c "echo 'nat on {en0} from 10.45.0.0/16 to any -> {en0}' > /etc/pf.anchors/org.open5gs" diff --git a/src/amf/amf-sm.c b/src/amf/amf-sm.c index 591c01cc4a..361bed7ce3 100644 --- a/src/amf/amf-sm.c +++ b/src/amf/amf-sm.c @@ -18,8 +18,10 @@ */ #include "sbi-path.h" +#include "nas-path.h" #include "nnrf-handler.h" #include "ngap-path.h" +#include "nas-security.h" void amf_state_initial(ogs_fsm_t *s, amf_event_t *e) { @@ -40,9 +42,6 @@ void amf_state_final(ogs_fsm_t *s, amf_event_t *e) void amf_state_operational(ogs_fsm_t *s, amf_event_t *e) { int rv; -#if 0 - ogs_pkbuf_t *recvbuf = NULL; -#endif char buf[OGS_ADDRSTRLEN]; ogs_sock_t *sock = NULL; @@ -54,11 +53,10 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e) ogs_pkbuf_t *pkbuf = NULL; int rc; -#if 0 ogs_nas_5gs_message_t nas_message; -#endif + ran_ue_t *ran_ue = NULL; + amf_ue_t *amf_ue = NULL; - ogs_sbi_server_t *server = NULL; ogs_sbi_session_t *session = NULL; ogs_sbi_request_t *sbi_request = NULL; @@ -96,8 +94,6 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e) ogs_assert(sbi_request); session = e->sbi.session; ogs_assert(session); - server = e->sbi.server; - ogs_assert(server); rv = ogs_sbi_parse_request(&sbi_message, sbi_request); if (rv != OGS_OK) { @@ -117,14 +113,13 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e) } SWITCH(sbi_message.h.service.name) - CASE(OGS_SBI_SERVICE_NAME_NRF_NFM) + CASE(OGS_SBI_SERVICE_NAME_NNRF_NFM) - SWITCH(sbi_message.h.resource.name) + SWITCH(sbi_message.h.resource.component[0]) CASE(OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY) SWITCH(sbi_message.h.method) CASE(OGS_SBI_HTTP_METHOD_POST) - amf_nnrf_handle_nf_status_notify( - server, session, &sbi_message); + amf_nnrf_handle_nf_status_notify(session, &sbi_message); break; DEFAULT @@ -139,10 +134,11 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e) DEFAULT ogs_error("Invalid resource name [%s]", - sbi_message.h.resource.name); + sbi_message.h.resource.component[0]); ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, &sbi_message, - "Unknown resource name", sbi_message.h.resource.name); + "Unknown resource name", + sbi_message.h.resource.component[0]); END break; @@ -150,7 +146,7 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e) ogs_error("Invalid API name [%s]", sbi_message.h.service.name); ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, &sbi_message, - "Invalid API name", sbi_message.h.resource.name); + "Invalid API name", sbi_message.h.resource.component[0]); END /* In lib/sbi/server.c, notify_completed() releases 'request' buffer. */ @@ -178,9 +174,9 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e) } SWITCH(sbi_message.h.service.name) - CASE(OGS_SBI_SERVICE_NAME_NRF_NFM) + CASE(OGS_SBI_SERVICE_NAME_NNRF_NFM) - SWITCH(sbi_message.h.resource.name) + SWITCH(sbi_message.h.resource.component[0]) CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES) nf_instance = e->sbi.data; ogs_assert(nf_instance); @@ -190,7 +186,7 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e) ogs_fsm_dispatch(&nf_instance->sm, e); if (OGS_FSM_CHECK(&nf_instance->sm, amf_nf_state_exception)) { - ogs_error("State machine exception"); + ogs_error("[%s] State machine exception", nf_instance->id); } break; @@ -205,8 +201,8 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e) amf_nnrf_handle_nf_status_subscribe( subscription, &sbi_message); } else { - ogs_error("HTTP response error : %d", - sbi_message.res_status); + ogs_error("[%s] HTTP response error [%d]", + subscription->id, sbi_message.res_status); } break; @@ -215,41 +211,106 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e) OGS_SBI_HTTP_STATUS_NO_CONTENT) { ogs_sbi_subscription_remove(subscription); } else { - ogs_error("HTTP response error : %d", - sbi_message.res_status); + ogs_error("[%s] HTTP response error [%d]", + subscription->id, sbi_message.res_status); } break; DEFAULT ogs_error("Invalid HTTP method [%s]", sbi_message.h.method); + ogs_assert_if_reached(); END break; DEFAULT ogs_error("Invalid resource name [%s]", - sbi_message.h.resource.name); + sbi_message.h.resource.component[0]); + ogs_assert_if_reached(); END break; - CASE(OGS_SBI_SERVICE_NAME_NRF_DISC) - SWITCH(sbi_message.h.resource.name) + CASE(OGS_SBI_SERVICE_NAME_NNRF_DISC) + SWITCH(sbi_message.h.resource.component[0]) CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES) - if (sbi_message.res_status == OGS_SBI_HTTP_STATUS_OK) { - amf_nnrf_handle_nf_discover(&sbi_message); - } else { - ogs_error("HTTP response error : %d", - sbi_message.res_status); - } + amf_ue = e->sbi.data; + ogs_assert(amf_ue); + + SWITCH(sbi_message.h.method) + CASE(OGS_SBI_HTTP_METHOD_GET) + if (sbi_message.res_status == OGS_SBI_HTTP_STATUS_OK) { + ogs_timer_stop(amf_ue->sbi_client_wait.timer); + + amf_nnrf_handle_nf_discover(amf_ue, &sbi_message); + } else { + ogs_error("[%s] HTTP response error [%d]", + amf_ue->suci, sbi_message.res_status); + } + break; + + DEFAULT + ogs_error("Invalid HTTP method [%s]", sbi_message.h.method); + ogs_assert_if_reached(); + END break; DEFAULT ogs_error("Invalid resource name [%s]", - sbi_message.h.resource.name); + sbi_message.h.resource.component[0]); + ogs_assert_if_reached(); END break; + CASE(OGS_SBI_SERVICE_NAME_NAUSF_AUTH) + amf_ue = e->sbi.data; + ogs_assert(amf_ue); + ogs_assert(OGS_FSM_STATE(&amf_ue->sm)); + + e->amf_ue = amf_ue; + e->sbi.message = &sbi_message;; + + ogs_fsm_dispatch(&amf_ue->sm, e); + if (OGS_FSM_CHECK(&amf_ue->sm, gmm_state_exception)) { + amf_ue_remove(amf_ue); + } + break; +#if 0 + SWITCH(sbi_message.h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_UE_AUTHENTICATIONS) + amf_ue = e->sbi.data; + ogs_assert(amf_ue); + + SWITCH(sbi_message.h.method) + CASE(OGS_SBI_HTTP_METHOD_POST) + if (sbi_message.res_status == OGS_SBI_HTTP_STATUS_OK) { + ogs_timer_stop(amf_ue->sbi_client_wait.timer); + + ogs_fatal("TODO"); + } else { + ogs_error("[%s] HTTP response error [%d]", + amf_ue->suci, sbi_message.res_status); + nas_5gs_send_nas_reject_from_sbi(amf_ue, + sbi_message.res_status); + } + break; + + DEFAULT + ogs_error("[%s] Invalid HTTP method [%s]", + amf_ue->suci, sbi_message.h.method); + ogs_assert_if_reached(); + END + break; + + DEFAULT + ogs_error("Invalid resource name [%s]", + sbi_message.h.resource.component[0]); + ogs_assert_if_reached(); + END + break; +#endif + DEFAULT ogs_error("Invalid API name [%s]", sbi_message.h.service.name); + ogs_assert_if_reached(); END ogs_sbi_message_free(&sbi_message); @@ -269,27 +330,30 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e) ogs_assert(OGS_FSM_STATE(&nf_instance->sm)); ogs_fsm_dispatch(&nf_instance->sm, e); - if (OGS_FSM_CHECK(&nf_instance->sm, amf_nf_state_de_registered)) { - amf_nf_fsm_fini(nf_instance); - ogs_sbi_nf_instance_remove(nf_instance); - - } else if (OGS_FSM_CHECK(&nf_instance->sm, - amf_nf_state_exception)) { - ogs_error("State machine exception"); - } + if (OGS_FSM_CHECK(&nf_instance->sm, amf_nf_state_exception)) + ogs_error("[%s] State machine exception [%d]", + nf_instance->id, e->timer_id); break; case AMF_TIMER_SUBSCRIPTION_VALIDITY: subscription = e->sbi.data; ogs_assert(subscription); - ogs_info("Subscription validity expired [%s]", subscription->id); + ogs_info("[%s] Subscription validity expired", subscription->id); ogs_sbi_subscription_remove(subscription); - amf_sbi_send_nf_status_subscribe(subscription->client, + ogs_nnrf_nfm_send_nf_status_subscribe(subscription->client, amf_self()->nf_type, subscription->nf_instance_id); break; + case AMF_TIMER_SBI_CLIENT_WAIT: + amf_ue = e->sbi.data; + ogs_assert(amf_ue); + + ogs_error("[%s] Cannot receive SBI message", amf_ue->suci); + nas_5gs_send_nas_reject_from_sbi(amf_ue, + OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT); + break; default: ogs_error("Unknown timer[%s:%d]", amf_timer_get_name(e->timer_id), e->timer_id); @@ -382,11 +446,9 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e) ogs_fsm_dispatch(&gnb->sm, e); } else { ogs_error("Cannot decode NGAP message"); -#if 0 ngap_send_error_indication( gnb, NULL, NULL, NGAP_Cause_PR_protocol, NGAP_CauseProtocol_abstract_syntax_error_falsely_constructed_message); -#endif } ogs_ngap_free(&ngap_message); @@ -394,19 +456,92 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e) break; case AMF_EVT_NGAP_TIMER: -#if 0 - gnb_ue = e->gnb_ue; - ogs_assert(gnb_ue); + ran_ue = e->ran_ue; + ogs_assert(ran_ue); gnb = e->gnb; ogs_assert(gnb); ogs_assert(OGS_FSM_STATE(&gnb->sm)); ogs_fsm_dispatch(&gnb->sm, e); -#else - ogs_fatal("Not implemeted"); -#endif break; + case AMF_EVT_5GMM_MESSAGE: + ran_ue = e->ran_ue; + ogs_assert(ran_ue); + pkbuf = e->pkbuf; + ogs_assert(pkbuf); + if (ogs_nas_5gmm_decode(&nas_message, pkbuf) != OGS_OK) { + ogs_error("ogs_nas_5gmm_decode() failed"); + ogs_pkbuf_free(pkbuf); + return; + } + + amf_ue = ran_ue->amf_ue; + if (!amf_ue) { + amf_ue = amf_ue_find_by_message(&nas_message); + if (!amf_ue) { + amf_ue = amf_ue_add(ran_ue); + ogs_assert(amf_ue); + } else { + /* Here, if the AMF_UE Context is found, + * the integrity check is not performed + * For example, REGISTRATION_REQUEST, + * TRACKING_AREA_UPDATE_REQUEST message + * + * Now, We will check the MAC in the NAS message*/ + ogs_nas_security_header_type_t h; + h.type = e->nas.type; + if (h.integrity_protected) { + /* Decryption was performed in NGAP handler. + * So, we disabled 'ciphered' + * not to decrypt NAS message */ + h.ciphered = 0; + if (nas_5gs_security_decode(amf_ue, h, pkbuf) != OGS_OK) { + ogs_error("[%s] nas_security_decode() failed", + amf_ue->suci); + ogs_pkbuf_free(pkbuf); + return; + } + } + } + + /* If NAS(amf_ue_t) has already been associated with + * older NG(ran_ue_t) context */ + if (ECM_CONNECTED(amf_ue)) { + /* Implcit NG release */ + ogs_debug("[%s] Implicit NG release", amf_ue->suci); + ogs_debug("[%s] RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%lld]", + amf_ue->suci, amf_ue->ran_ue->ran_ue_ngap_id, + (long long)amf_ue->ran_ue->amf_ue_ngap_id); + ran_ue_remove(amf_ue->ran_ue); + } + amf_ue_associate_ran_ue(amf_ue, ran_ue); + } + + ogs_assert(amf_ue); + ogs_assert(OGS_FSM_STATE(&amf_ue->sm)); + + e->amf_ue = amf_ue; + e->nas.message = &nas_message; + + ogs_fsm_dispatch(&amf_ue->sm, e); + if (OGS_FSM_CHECK(&amf_ue->sm, gmm_state_exception)) { +#if 0 + mme_send_delete_session_or_amf_ue_context_release(amf_ue); +#else + amf_ue_remove(amf_ue); +#endif + } + + ogs_pkbuf_free(pkbuf); + break; + case AMF_EVT_5GMM_TIMER: + amf_ue = e->amf_ue; + ogs_assert(amf_ue); + ogs_assert(OGS_FSM_STATE(&amf_ue->sm)); + + ogs_fsm_dispatch(&amf_ue->sm, e); + break; default: ogs_error("No handler for event %s", amf_event_get_name(e)); diff --git a/src/amf/amf-sm.h b/src/amf/amf-sm.h index f392a3b888..b9b48e8a71 100644 --- a/src/amf/amf-sm.h +++ b/src/amf/amf-sm.h @@ -45,6 +45,24 @@ void ngap_state_final(ogs_fsm_t *s, amf_event_t *e); void ngap_state_operational(ogs_fsm_t *s, amf_event_t *e); void ngap_state_exception(ogs_fsm_t *s, amf_event_t *e); +void gmm_state_initial(ogs_fsm_t *s, amf_event_t *e); +void gmm_state_final(ogs_fsm_t *s, amf_event_t *e); +void gmm_state_de_registered(ogs_fsm_t *s, amf_event_t *e); +void gmm_state_authentication(ogs_fsm_t *s, amf_event_t *e); +void gmm_state_security_mode(ogs_fsm_t *s, amf_event_t *e); +void gmm_state_initial_context_setup(ogs_fsm_t *s, amf_event_t *e); +void gmm_state_registered(ogs_fsm_t *s, amf_event_t *e); +void gmm_state_exception(ogs_fsm_t *s, amf_event_t *e); + +void gsm_state_initial(ogs_fsm_t *s, amf_event_t *e); +void gsm_state_final(ogs_fsm_t *s, amf_event_t *e); +void gsm_state_inactive(ogs_fsm_t *s, amf_event_t *e); +void gsm_state_active(ogs_fsm_t *s, amf_event_t *e); +void gsm_state_pdn_will_disconnect(ogs_fsm_t *s, amf_event_t *e); +void gsm_state_pdn_did_disconnect(ogs_fsm_t *s, amf_event_t *e); +void gsm_state_bearer_deactivated(ogs_fsm_t *s, amf_event_t *e); +void gsm_state_exception(ogs_fsm_t *s, amf_event_t *e); + #define amf_sm_debug(__pe) \ ogs_debug("%s(): %s", __func__, amf_event_get_name(__pe)) diff --git a/src/amf/app.c b/src/amf/app.c index b6b208cad6..44c0b1fb99 100644 --- a/src/amf/app.c +++ b/src/amf/app.c @@ -17,12 +17,14 @@ * along with this program. If not, see . */ +#include "ogs-sctp.h" #include "ogs-app.h" int app_initialize(const char *const argv[]) { int rv; + ogs_sctp_init(ogs_config()->usrsctp.udp_port); rv = amf_initialize(); if (rv != OGS_OK) { ogs_error("Failed to intialize AMF"); @@ -36,5 +38,6 @@ int app_initialize(const char *const argv[]) void app_terminate(void) { amf_terminate(); + ogs_sctp_final(); ogs_info("AMF terminate...done"); } diff --git a/src/amf/context.c b/src/amf/context.c index c73195af20..0ac125cfd4 100644 --- a/src/amf/context.c +++ b/src/amf/context.c @@ -22,8 +22,14 @@ static amf_context_t self; int __amf_log_domain; +int __gmm_log_domain; +int __gsm_log_domain; static OGS_POOL(amf_gnb_pool, amf_gnb_t); +static OGS_POOL(amf_ue_pool, amf_ue_t); +static OGS_POOL(ran_ue_pool, ran_ue_t); +static OGS_POOL(amf_sess_pool, amf_sess_t); +static OGS_POOL(amf_bearer_pool, amf_bearer_t); static int context_initialized = 0; @@ -34,19 +40,34 @@ void amf_context_init(void) /* Initialize AMF context */ memset(&self, 0, sizeof(amf_context_t)); + ogs_log_install_domain(&__ogs_sctp_domain, "sctp", ogs_core()->log.level); + ogs_log_install_domain(&__ogs_ngap_domain, "ngap", ogs_core()->log.level); + ogs_log_install_domain(&__ogs_nas_domain, "nas", ogs_core()->log.level); ogs_log_install_domain(&__amf_log_domain, "amf", ogs_core()->log.level); + ogs_log_install_domain(&__gmm_log_domain, "gmm", ogs_core()->log.level); + ogs_log_install_domain(&__gsm_log_domain, "gsm", ogs_core()->log.level); ogs_list_init(&self.ngap_list); ogs_list_init(&self.ngap_list6); /* Allocate TWICE the pool to check if maximum number of gNBs is reached */ ogs_pool_init(&amf_gnb_pool, ogs_config()->max.gnb*2); + ogs_pool_init(&amf_ue_pool, ogs_config()->pool.ue); + ogs_pool_init(&ran_ue_pool, ogs_config()->pool.ue); + ogs_pool_init(&amf_sess_pool, ogs_config()->pool.sess); + ogs_pool_init(&amf_bearer_pool, ogs_config()->pool.bearer); + ogs_pool_init(&self.m_tmsi, ogs_config()->pool.ue); ogs_list_init(&self.gnb_list); + ogs_list_init(&self.amf_ue_list); + self.gnb_addr_hash = ogs_hash_make(); self.gnb_id_hash = ogs_hash_make(); - - ogs_pool_init(&self.m_tmsi, ogs_config()->pool.ue); + self.amf_ue_ngap_id_hash = ogs_hash_make(); + self.imsi_ue_hash = ogs_hash_make(); + self.guti_ue_hash = ogs_hash_make(); + self.suci_hash = ogs_hash_make(); + self.supi_hash = ogs_hash_make(); context_initialized = 1; } @@ -56,14 +77,29 @@ void amf_context_final(void) ogs_assert(context_initialized == 1); amf_gnb_remove_all(); + amf_ue_remove_all(); ogs_assert(self.gnb_addr_hash); ogs_hash_destroy(self.gnb_addr_hash); ogs_assert(self.gnb_id_hash); ogs_hash_destroy(self.gnb_id_hash); - ogs_pool_final(&self.m_tmsi); + ogs_assert(self.amf_ue_ngap_id_hash); + ogs_hash_destroy(self.amf_ue_ngap_id_hash); + ogs_assert(self.imsi_ue_hash); + ogs_hash_destroy(self.imsi_ue_hash); + ogs_assert(self.guti_ue_hash); + ogs_hash_destroy(self.guti_ue_hash); + ogs_assert(self.suci_hash); + ogs_hash_destroy(self.suci_hash); + ogs_assert(self.supi_hash); + ogs_hash_destroy(self.supi_hash); + ogs_pool_final(&self.m_tmsi); + ogs_pool_final(&amf_bearer_pool); + ogs_pool_final(&amf_sess_pool); + ogs_pool_final(&amf_ue_pool); + ogs_pool_final(&ran_ue_pool); ogs_pool_final(&amf_gnb_pool); context_initialized = 0; @@ -129,13 +165,13 @@ static int amf_context_validation(void) ogs_config()->file); return OGS_ERROR; } + if (self.num_of_ciphering_order == 0) { ogs_error("no amf.security.ciphering_order in '%s'", ogs_config()->file); return OGS_ERROR; } - return OGS_OK; } @@ -806,10 +842,10 @@ amf_gnb_t *amf_gnb_add(ogs_sock_t *sock, ogs_sockaddr_t *addr) if (ogs_config()->sockopt.sctp.max_num_of_ostreams) { gnb->max_num_of_ostreams = ogs_config()->sockopt.sctp.max_num_of_ostreams; - ogs_info("[ENB] max_num_of_ostreams : %d", gnb->max_num_of_ostreams); + ogs_info("[GNB] max_num_of_ostreams : %d", gnb->max_num_of_ostreams); } - ogs_list_init(&gnb->gnb_ue_list); + ogs_list_init(&gnb->ran_ue_list); if (gnb->sock_type == SOCK_STREAM) { gnb->poll = ogs_pollset_add(amf_self()->pollset, @@ -845,9 +881,7 @@ int amf_gnb_remove(amf_gnb_t *gnb) ogs_hash_set(self.gnb_addr_hash, gnb->addr, sizeof(ogs_sockaddr_t), NULL); ogs_hash_set(self.gnb_id_hash, &gnb->gnb_id, sizeof(gnb->gnb_id), NULL); -#if 0 - gnb_ue_remove_in_gnb(gnb); -#endif + ran_ue_remove_in_gnb(gnb); if (gnb->sock_type == SOCK_STREAM) { ogs_pollset_remove(gnb->poll); @@ -910,6 +944,1123 @@ int amf_gnb_sock_type(ogs_sock_t *sock) return SOCK_STREAM; } +/** ran_ue_context handling function */ +ran_ue_t *ran_ue_add(amf_gnb_t *gnb, uint32_t ran_ue_ngap_id) +{ + ran_ue_t *ran_ue = NULL; + + ogs_assert(self.amf_ue_ngap_id_hash); + ogs_assert(gnb); + + ogs_pool_alloc(&ran_ue_pool, &ran_ue); + ogs_assert(ran_ue); + memset(ran_ue, 0, sizeof *ran_ue); + + ran_ue->ran_ue_ngap_id = ran_ue_ngap_id; + ran_ue->amf_ue_ngap_id = OGS_NEXT_ID(self.amf_ue_ngap_id, 1, 0xffffffff); + + /* + * SCTP output stream identification + * Default ogs_config()->parameter.sctp_streams : 30 + * 0 : Non UE signalling + * 1-29 : UE specific association + */ + ran_ue->gnb_ostream_id = + OGS_NEXT_ID(gnb->ostream_id, 1, gnb->max_num_of_ostreams-1); + + ran_ue->gnb = gnb; + + ogs_hash_set(self.amf_ue_ngap_id_hash, &ran_ue->amf_ue_ngap_id, + sizeof(ran_ue->amf_ue_ngap_id), ran_ue); + ogs_list_add(&gnb->ran_ue_list, ran_ue); + + return ran_ue; +} + +unsigned int ran_ue_count() +{ + ogs_assert(self.amf_ue_ngap_id_hash); + return ogs_hash_count(self.amf_ue_ngap_id_hash); +} + +void ran_ue_remove(ran_ue_t *ran_ue) +{ + ogs_assert(self.amf_ue_ngap_id_hash); + ogs_assert(ran_ue); + ogs_assert(ran_ue->gnb); + + /* De-associate S1 with NAS/EMM */ + ran_ue_deassociate(ran_ue); + + ogs_list_remove(&ran_ue->gnb->ran_ue_list, ran_ue); + ogs_hash_set(self.amf_ue_ngap_id_hash, &ran_ue->amf_ue_ngap_id, + sizeof(ran_ue->amf_ue_ngap_id), NULL); + + ogs_pool_free(&ran_ue_pool, ran_ue); +} + +void ran_ue_remove_in_gnb(amf_gnb_t *gnb) +{ + ran_ue_t *ran_ue = NULL, *next_ran_ue = NULL; + + ran_ue = ran_ue_first_in_gnb(gnb); + while (ran_ue) { + next_ran_ue = ran_ue_next_in_gnb(ran_ue); + + ran_ue_remove(ran_ue); + + ran_ue = next_ran_ue; + } +} + +void ran_ue_switch_to_gnb(ran_ue_t *ran_ue, amf_gnb_t *new_gnb) +{ + ogs_assert(ran_ue); + ogs_assert(ran_ue->gnb); + ogs_assert(new_gnb); + + /* Remove from the old gnb */ + ogs_list_remove(&ran_ue->gnb->ran_ue_list, ran_ue); + + /* Add to the new gnb */ + ogs_list_add(&new_gnb->ran_ue_list, ran_ue); + + /* Switch to gnb */ + ran_ue->gnb = new_gnb; +} + +ran_ue_t *ran_ue_find_by_ran_ue_ngap_id( + amf_gnb_t *gnb, uint32_t ran_ue_ngap_id) +{ + ran_ue_t *ran_ue = NULL; + + ran_ue = ran_ue_first_in_gnb(gnb); + while (ran_ue) { + if (ran_ue_ngap_id == ran_ue->ran_ue_ngap_id) + break; + + ran_ue = ran_ue_next_in_gnb(ran_ue); + } + + return ran_ue; +} + +ran_ue_t *ran_ue_find_by_amf_ue_ngap_id(uint64_t amf_ue_ngap_id) +{ + ogs_assert(self.amf_ue_ngap_id_hash); + return ogs_hash_get(self.amf_ue_ngap_id_hash, + &amf_ue_ngap_id, sizeof(amf_ue_ngap_id)); +} + +ran_ue_t *ran_ue_first_in_gnb(amf_gnb_t *gnb) +{ + return ogs_list_first(&gnb->ran_ue_list); +} + +ran_ue_t *ran_ue_next_in_gnb(ran_ue_t *ran_ue) +{ + return ogs_list_next(ran_ue); +} + +static int amf_ue_new_guti(amf_ue_t *amf_ue) +{ +#if 0 + served_guami_t *served_guami = NULL; + + ogs_assert(amf_ue); + ogs_assert(amf_self()->num_of_served_guami > 0); + + served_guami = &amf_self()->served_guami[0]; + + ogs_assert(served_guami->num_of_plmn_id > 0); + ogs_assert(served_guami->num_of_amf_gid > 0); + ogs_assert(served_guami->num_of_amf_code > 0); + + if (amf_ue->m_tmsi) { + /* AMF has a VALID GUTI + * As such, we need to remove previous GUTI in hash table */ + ogs_hash_set(self.guti_ue_hash, + &amf_ue->guti, sizeof(ogs_nas_5gs_guti_t), NULL); + ogs_assert(amf_m_tmsi_free(amf_ue->m_tmsi) == OGS_OK); + } + + memset(&amf_ue->guti, 0, sizeof(ogs_nas_5gs_guti_t)); + + /* Use the first configured plmn_id and amf group id */ + ogs_nas_from_plmn_id(&amf_ue->guti.nas_plmn_id, &served_guami->plmn_id[0]); + amf_ue->guti.amf_gid = served_guami->amf_gid[0]; + amf_ue->guti.amf_code = served_guami->amf_code[0]; + + amf_ue->m_tmsi = amf_m_tmsi_alloc(); + ogs_assert(amf_ue->m_tmsi); + amf_ue->guti.m_tmsi = *(amf_ue->m_tmsi); + ogs_hash_set(self.guti_ue_hash, + &amf_ue->guti, sizeof(ogs_nas_5gs_guti_t), amf_ue); +#endif + + return OGS_OK; +} + +amf_ue_t *amf_ue_add(ran_ue_t *ran_ue) +{ + amf_gnb_t *gnb = NULL; + amf_ue_t *amf_ue = NULL; + amf_event_t e; + + ogs_assert(ran_ue); + gnb = ran_ue->gnb; + ogs_assert(gnb); + + ogs_pool_alloc(&amf_ue_pool, &amf_ue); + ogs_assert(amf_ue); + memset(amf_ue, 0, sizeof *amf_ue); + + ogs_list_init(&amf_ue->sess_list); + + /* Initialize NAS Context */ + amf_ue->nas.connection_identifier = OGS_NAS_SECURITY_BEARER_3GPP; + amf_ue->nas.ksi = 1; + + /* Initialize Abba */ + amf_ue->abba_len = 2; + + /* Create New GUTI */ + amf_ue_new_guti(amf_ue); + +#if 0 + /* Clear VLR */ + amf_ue->csmap = NULL; + amf_ue->vlr_ostream_id = 0; +#endif + + /* Add All Timers */ + amf_ue->sbi_client_wait.timer = ogs_timer_add( + self.timer_mgr, amf_timer_sbi_client_wait_expire, amf_ue); + + amf_ue->t3513.timer = ogs_timer_add( + self.timer_mgr, amf_timer_t3513_expire, amf_ue); + amf_ue->t3513.pkbuf = NULL; + amf_ue->t3522.timer = ogs_timer_add( + self.timer_mgr, amf_timer_t3522_expire, amf_ue); + amf_ue->t3522.pkbuf = NULL; + amf_ue->t3550.timer = ogs_timer_add( + self.timer_mgr, amf_timer_t3550_expire, amf_ue); + amf_ue->t3550.pkbuf = NULL; + amf_ue->t3560.timer = ogs_timer_add( + self.timer_mgr, amf_timer_t3560_expire, amf_ue); + amf_ue->t3560.pkbuf = NULL; + amf_ue->t3570.timer = ogs_timer_add( + self.timer_mgr, amf_timer_t3570_expire, amf_ue); + amf_ue->t3570.pkbuf = NULL; + + /* Create FSM */ + e.amf_ue = amf_ue; + ogs_fsm_create(&amf_ue->sm, gmm_state_initial, gmm_state_final); + ogs_fsm_init(&amf_ue->sm, &e); + + ogs_list_add(&self.amf_ue_list, amf_ue); + + return amf_ue; +} + +void amf_ue_remove(amf_ue_t *amf_ue) +{ + amf_event_t e; + int i; + + ogs_assert(amf_ue); + + ogs_list_remove(&self.amf_ue_list, amf_ue); + + e.amf_ue = amf_ue; + ogs_fsm_fini(&amf_ue->sm, &e); + ogs_fsm_delete(&amf_ue->sm); + + /* Clear hash table */ + if (amf_ue->m_tmsi) { + ogs_hash_set(self.guti_ue_hash, + &amf_ue->guti, sizeof(ogs_nas_5gs_guti_t), NULL); + ogs_assert(amf_m_tmsi_free(amf_ue->m_tmsi) == OGS_OK); + } + if (amf_ue->imsi_len != 0) + ogs_hash_set(self.imsi_ue_hash, amf_ue->imsi, amf_ue->imsi_len, NULL); + if (amf_ue->suci) { + ogs_hash_set(self.suci_hash, amf_ue->suci, strlen(amf_ue->suci), NULL); + ogs_free(amf_ue->suci); + } + if (amf_ue->supi) { + ogs_hash_set(self.supi_hash, amf_ue->supi, strlen(amf_ue->supi), NULL); + ogs_free(amf_ue->supi); + } + + if (amf_ue->confirmation_url_for_5g_aka) + ogs_free(amf_ue->confirmation_url_for_5g_aka); + + /* Free UeRadioCapability */ + OGS_ASN_CLEAR_DATA(&amf_ue->ueRadioCapability); + + /* Clear Transparent Container */ + OGS_ASN_CLEAR_DATA(&amf_ue->container); + + /* Delete All Timers */ + CLEAR_AMF_UE_ALL_TIMERS(amf_ue); + ogs_timer_delete(amf_ue->sbi_client_wait.timer); + ogs_timer_delete(amf_ue->t3513.timer); + ogs_timer_delete(amf_ue->t3522.timer); + ogs_timer_delete(amf_ue->t3550.timer); + ogs_timer_delete(amf_ue->t3560.timer); + ogs_timer_delete(amf_ue->t3570.timer); + + amf_ue_deassociate(amf_ue); + + amf_sess_remove_all(amf_ue); + amf_pdn_remove_all(amf_ue); + + for (i = 0; i < OGS_SBI_MAX_NF_TYPE; i++) { + if (amf_ue->nf_types[i].nf_instance) + ogs_sbi_nf_instance_remove(amf_ue->nf_types[i].nf_instance); + } + + ogs_pool_free(&amf_ue_pool, amf_ue); +} + +void amf_ue_remove_all() +{ + amf_ue_t *amf_ue = NULL, *next = NULL;; + + ogs_list_for_each_safe(&self.amf_ue_list, next, amf_ue) + amf_ue_remove(amf_ue); +} + +amf_ue_t *amf_ue_find_by_imsi_bcd(char *imsi_bcd) +{ + uint8_t imsi[OGS_MAX_IMSI_LEN]; + int imsi_len = 0; + + ogs_assert(imsi_bcd); + + ogs_bcd_to_buffer(imsi_bcd, imsi, &imsi_len); + + return amf_ue_find_by_imsi(imsi, imsi_len); +} + +amf_ue_t *amf_ue_find_by_imsi(uint8_t *imsi, int imsi_len) +{ + ogs_assert(imsi && imsi_len); + + return (amf_ue_t *)ogs_hash_get(self.imsi_ue_hash, imsi, imsi_len); +} + +amf_ue_t *amf_ue_find_by_guti(ogs_nas_5gs_guti_t *guti) +{ + ogs_assert(guti); + + return (amf_ue_t *)ogs_hash_get( + self.guti_ue_hash, guti, sizeof(ogs_nas_5gs_guti_t)); +} + +amf_ue_t *amf_ue_find_by_teid(uint32_t teid) +{ + return ogs_pool_find(&amf_ue_pool, teid); +} + +amf_ue_t *amf_ue_find_by_suci(char *suci) +{ + ogs_assert(suci); + return (amf_ue_t *)ogs_hash_get(self.suci_hash, suci, strlen(suci)); +} + +amf_ue_t *amf_ue_find_by_supi(char *supi) +{ + ogs_assert(supi); + return (amf_ue_t *)ogs_hash_get(self.supi_hash, supi, strlen(supi)); +} + +amf_ue_t *amf_ue_find_by_message(ogs_nas_5gs_message_t *message) +{ + amf_ue_t *amf_ue = NULL; + ogs_nas_5gs_registration_request_t *registration_request = NULL; +#if 0 + ogs_nas_5gs_tracking_area_update_request_t *tau_request = NULL; + ogs_nas_5gs_extended_service_request_t *extended_service_request = NULL; +#endif + ogs_nas_5gs_mobile_identity_t *mobile_identity = NULL; + ogs_nas_5gs_mobile_identity_header_t *mobile_identity_header = NULL; + ogs_nas_5gs_mobile_identity_guti_t *mobile_identity_guti = NULL; + ogs_nas_5gs_guti_t nas_guti; + + char imsi_bcd[OGS_MAX_IMSI_BCD_LEN+1]; + char *ueid = NULL; + + ogs_assert(message); + + registration_request = &message->gmm.registration_request; + ogs_assert(registration_request); + mobile_identity = ®istration_request->mobile_identity; + ogs_assert(mobile_identity); + mobile_identity_header = + (ogs_nas_5gs_mobile_identity_header_t *)mobile_identity->buffer; + ogs_assert(mobile_identity_header); + + switch (message->gmm.h.message_type) { + case OGS_NAS_5GS_REGISTRATION_REQUEST: + switch (mobile_identity_header->type) { + case OGS_NAS_5GS_MOBILE_IDENTITY_SUCI: + ogs_nas_5gs_imsi_to_bcd(mobile_identity, imsi_bcd); + ueid = ogs_nas_5gs_ueid_from_mobile_identity(mobile_identity); + amf_ue = amf_ue_find_by_imsi_bcd(imsi_bcd); + if (amf_ue) { + ogs_trace("known UE by IMSI[%s]", imsi_bcd); + } else { + ogs_trace("Unknown UE by IMSI[%s]", imsi_bcd); + } + ogs_free(ueid); + break; + case OGS_NAS_5GS_MOBILE_IDENTITY_GUTI: + mobile_identity_guti = + (ogs_nas_5gs_mobile_identity_guti_t *)mobile_identity->buffer; + ogs_assert(mobile_identity_guti); + + memcpy(&nas_guti.nas_plmn_id, + &mobile_identity_guti->nas_plmn_id, OGS_PLMN_ID_LEN); + memcpy(&nas_guti.amf_id, + &mobile_identity_guti->amf_id, sizeof(ogs_amf_id_t)); + nas_guti.m_tmsi = be32toh(mobile_identity_guti->m_tmsi); + + amf_ue = amf_ue_find_by_guti(&nas_guti); + if (amf_ue) { + ogs_debug("Known UE by 5G-S_TMSI[AMF_ID:0x%x,M_TMSI:0x%x]", + ogs_amf_id_hexdump(&nas_guti.amf_id), nas_guti.m_tmsi); + } else { + ogs_warn("Unknown UE by 5G-S_TMSI[AMF_ID:0x%x,M_TMSI:0x%x]", + ogs_amf_id_hexdump(&nas_guti.amf_id), nas_guti.m_tmsi); + } + break; + default: + ogs_error("Unknown SUCI type [%d]", mobile_identity_header->type); + break; + } + break; +#if 0 + case OGS_NAS_5GS_TRACKING_AREA_UPDATE_REQUEST: + tau_request = &message->gmm.tracking_area_update_request; + eps_mobile_identity = &tau_request->old_guti; + + switch(eps_mobile_identity->imsi.type) { + case OGS_NAS_5GS_MOBILE_IDENTITY_GUTI: + eps_mobile_identity_guti = &eps_mobile_identity->guti; + + ogs_nas_guti.nas_plmn_id = eps_mobile_identity_guti->nas_plmn_id; + ogs_nas_guti.amf_gid = eps_mobile_identity_guti->amf_gid; + ogs_nas_guti.amf_code = eps_mobile_identity_guti->amf_code; + ogs_nas_guti.m_tmsi = eps_mobile_identity_guti->m_tmsi; + + amf_ue = amf_ue_find_by_guti(&ogs_nas_guti); + if (amf_ue) { + ogs_trace("Known UE by GUTI[G:%d,C:%d,M_TMSI:0x%x]", + ogs_nas_guti.amf_gid, + ogs_nas_guti.amf_code, + ogs_nas_guti.m_tmsi); + } else { + ogs_warn("Unknown UE by GUTI[G:%d,C:%d,M_TMSI:0x%x]", + ogs_nas_guti.amf_gid, + ogs_nas_guti.amf_code, + ogs_nas_guti.m_tmsi); + } + break; + default: + ogs_error("Unknown IMSI type [%d]", eps_mobile_identity->imsi.type); + break; + } + break; + case OGS_NAS_5GS_EXTENDED_SERVICE_REQUEST: + extended_service_request = &message->gmm.extended_service_request; + mobile_identity = &extended_service_request->m_tmsi; + + switch(mobile_identity->tmsi.type) { + case OGS_NAS_MOBILE_IDENTITY_TMSI: + mobile_identity_tmsi = &mobile_identity->tmsi; + served_guami = &amf_self()->served_guami[0]; + + /* Use the first configured plmn_id and amf group id */ + ogs_nas_from_plmn_id( + &ogs_nas_guti.nas_plmn_id, &served_guami->plmn_id[0]); + ogs_nas_guti.amf_gid = served_guami->amf_gid[0]; + ogs_nas_guti.amf_code = served_guami->amf_code[0]; + ogs_nas_guti.m_tmsi = mobile_identity_tmsi->tmsi; + + amf_ue = amf_ue_find_by_guti(&ogs_nas_guti); + if (amf_ue) { + ogs_trace("Known UE by GUTI[G:%d,C:%d,M_TMSI:0x%x]", + ogs_nas_guti.amf_gid, + ogs_nas_guti.amf_code, + ogs_nas_guti.m_tmsi); + } else { + ogs_warn("Unknown UE by GUTI[G:%d,C:%d,M_TMSI:0x%x]", + ogs_nas_guti.amf_gid, + ogs_nas_guti.amf_code, + ogs_nas_guti.m_tmsi); + } + break; + default: + ogs_error("Unknown TMSI type [%d]", mobile_identity->tmsi.type); + break; + } + break; +#endif + default: + break; + } + + return amf_ue; +} + +void amf_ue_set_suci(amf_ue_t *amf_ue, + ogs_nas_5gs_mobile_identity_t *mobile_identity) +{ + char imsi_bcd[OGS_MAX_IMSI_BCD_LEN+1]; + amf_ue_t *old_amf_ue = NULL; + + ogs_assert(amf_ue); + ogs_assert(mobile_identity); + + ogs_nas_5gs_imsi_to_bcd(mobile_identity, imsi_bcd); + + ogs_cpystrn(amf_ue->imsi_bcd, imsi_bcd, OGS_MAX_IMSI_BCD_LEN+1); + ogs_bcd_to_buffer(amf_ue->imsi_bcd, amf_ue->imsi, &amf_ue->imsi_len); + + /* Check if OLD amf_ue_t is existed */ + old_amf_ue = amf_ue_find_by_imsi(amf_ue->imsi, amf_ue->imsi_len); + if (old_amf_ue) { + /* Check if OLD amf_ue_t is different with NEW amf_ue_t */ + if (ogs_pool_index(&amf_ue_pool, amf_ue) != + ogs_pool_index(&amf_ue_pool, old_amf_ue)) { + ogs_warn("OLD UE Context Release [IMSI:%s]", amf_ue->imsi_bcd); + if (old_amf_ue->ran_ue) + ran_ue_deassociate(old_amf_ue->ran_ue); + amf_ue_remove(old_amf_ue); + } + } + + ogs_hash_set(self.imsi_ue_hash, amf_ue->imsi, amf_ue->imsi_len, amf_ue); + + if (amf_ue->suci) { + ogs_hash_set(self.suci_hash, amf_ue->suci, strlen(amf_ue->suci), NULL); + ogs_free(amf_ue->suci); + } + amf_ue->suci = ogs_nas_5gs_ueid_from_mobile_identity(mobile_identity); + ogs_assert(amf_ue->suci); + ogs_hash_set(self.suci_hash, amf_ue->suci, strlen(amf_ue->suci), amf_ue); + + amf_ue->guti_present = 1; +} + +void amf_ue_set_supi(amf_ue_t *amf_ue, char *supi) +{ + ogs_assert(supi); + + if (amf_ue->supi) { + ogs_hash_set(self.supi_hash, amf_ue->supi, strlen(amf_ue->supi), NULL); + ogs_free(amf_ue->supi); + } + amf_ue->supi = ogs_strdup(supi); + ogs_assert(amf_ue->supi); + ogs_hash_set(self.supi_hash, amf_ue->supi, strlen(amf_ue->supi), amf_ue); +} + +int amf_ue_have_indirect_tunnel(amf_ue_t *amf_ue) +{ + amf_sess_t *sess = NULL; + + sess = amf_sess_first(amf_ue); + while (sess) { + amf_bearer_t *bearer = amf_bearer_first(sess); + while (bearer) { + if (AMF_HAVE_GNB_DL_INDIRECT_TUNNEL(bearer) || + AMF_HAVE_GNB_UL_INDIRECT_TUNNEL(bearer) || + AMF_HAVE_SMF_DL_INDIRECT_TUNNEL(bearer) || + AMF_HAVE_SMF_UL_INDIRECT_TUNNEL(bearer)) { + return 1; + } + + bearer = amf_bearer_next(bearer); + } + sess = amf_sess_next(sess); + } + + return 0; +} + +int amf_ue_clear_indirect_tunnel(amf_ue_t *amf_ue) +{ + amf_sess_t *sess = NULL; + + ogs_assert(amf_ue); + + sess = amf_sess_first(amf_ue); + while (sess) { + amf_bearer_t *bearer = amf_bearer_first(sess); + while (bearer) { + CLEAR_INDIRECT_TUNNEL(bearer); + + bearer = amf_bearer_next(bearer); + } + sess = amf_sess_next(sess); + } + + return OGS_OK; +} + +void amf_ue_associate_ran_ue(amf_ue_t *amf_ue, ran_ue_t *ran_ue) +{ + ogs_assert(amf_ue); + ogs_assert(ran_ue); + + amf_ue->ran_ue = ran_ue; + ran_ue->amf_ue = amf_ue; +} + +void ran_ue_deassociate(ran_ue_t *ran_ue) +{ + ogs_assert(ran_ue); + ran_ue->amf_ue = NULL; +} + +void amf_ue_deassociate(amf_ue_t *amf_ue) +{ + ogs_assert(amf_ue); + amf_ue->ran_ue = NULL; +} + +void source_ue_associate_target_ue( + ran_ue_t *source_ue, ran_ue_t *target_ue) +{ + amf_ue_t *amf_ue = NULL; + + ogs_assert(source_ue); + ogs_assert(target_ue); + amf_ue = source_ue->amf_ue; + ogs_assert(amf_ue); + + target_ue->amf_ue = amf_ue; + target_ue->source_ue = source_ue; + source_ue->target_ue = target_ue; +} + +void source_ue_deassociate_target_ue(ran_ue_t *ran_ue) +{ + ran_ue_t *source_ue = NULL; + ran_ue_t *target_ue = NULL; + ogs_assert(ran_ue); + + if (ran_ue->target_ue) { + source_ue = ran_ue; + target_ue = ran_ue->target_ue; + + ogs_assert(source_ue->target_ue); + ogs_assert(target_ue->source_ue); + source_ue->target_ue = NULL; + target_ue->source_ue = NULL; + } else if (ran_ue->source_ue) { + target_ue = ran_ue; + source_ue = ran_ue->source_ue; + + ogs_assert(source_ue->target_ue); + ogs_assert(target_ue->source_ue); + source_ue->target_ue = NULL; + target_ue->source_ue = NULL; + } +} + +amf_sess_t *amf_sess_add(amf_ue_t *amf_ue, uint8_t pti) +{ + amf_sess_t *sess = NULL; + amf_bearer_t *bearer = NULL; + + ogs_assert(amf_ue); + ogs_assert(pti != OGS_NAS_PROCEDURE_TRANSACTION_IDENTITY_UNASSIGNED); + + ogs_pool_alloc(&amf_sess_pool, &sess); + ogs_assert(sess); + memset(sess, 0, sizeof *sess); + + ogs_list_init(&sess->bearer_list); + + sess->amf_ue = amf_ue; + sess->pti = pti; + + bearer = amf_bearer_add(sess); + ogs_assert(bearer); + + ogs_list_add(&amf_ue->sess_list, sess); + + return sess; +} + +void amf_sess_remove(amf_sess_t *sess) +{ + ogs_assert(sess); + ogs_assert(sess->amf_ue); + + ogs_list_remove(&sess->amf_ue->sess_list, sess); + + amf_bearer_remove_all(sess); + + OGS_NAS_CLEAR_DATA(&sess->ue_pco); + OGS_TLV_CLEAR_DATA(&sess->pgw_pco); + + ogs_pool_free(&amf_sess_pool, sess); +} + +void amf_sess_remove_all(amf_ue_t *amf_ue) +{ + amf_sess_t *sess = NULL, *next_sess = NULL; + + sess = amf_sess_first(amf_ue); + while (sess) { + next_sess = amf_sess_next(sess); + + amf_sess_remove(sess); + + sess = next_sess; + } +} + +amf_sess_t *amf_sess_find_by_pti(amf_ue_t *amf_ue, uint8_t pti) +{ + amf_sess_t *sess = NULL; + + sess = amf_sess_first(amf_ue); + while(sess) { + if (pti == sess->pti) + return sess; + + sess = amf_sess_next(sess); + } + + return NULL; +} + +amf_sess_t *amf_sess_find_by_ebi(amf_ue_t *amf_ue, uint8_t ebi) +{ + amf_bearer_t *bearer = NULL; + + bearer = amf_bearer_find_by_ue_ebi(amf_ue, ebi); + if (bearer) + return bearer->sess; + + return NULL; +} + +amf_sess_t *amf_sess_find_by_dnn(amf_ue_t *amf_ue, char *dnn) +{ + amf_sess_t *sess = NULL; + + sess = amf_sess_first(amf_ue); + while (sess) { + if (sess->pdn && strcmp(sess->pdn->apn, dnn) == 0) + return sess; + + sess = amf_sess_next(sess); + } + + return NULL; +} + +amf_sess_t *amf_sess_first(amf_ue_t *amf_ue) +{ + return ogs_list_first(&amf_ue->sess_list); +} + +amf_sess_t *amf_sess_next(amf_sess_t *sess) +{ + return ogs_list_next(sess); +} + +unsigned int amf_sess_count(amf_ue_t *amf_ue) +{ + unsigned int count = 0; + amf_sess_t *sess = NULL; + + sess = amf_sess_first(amf_ue); + while (sess) { + sess = amf_sess_next(sess); + count++; + } + + return count; +} + +amf_bearer_t *amf_bearer_add(amf_sess_t *sess) +{ + amf_event_t e; + + amf_bearer_t *bearer = NULL; + amf_ue_t *amf_ue = NULL; + + ogs_assert(sess); + amf_ue = sess->amf_ue; + ogs_assert(amf_ue); + + ogs_pool_alloc(&amf_bearer_pool, &bearer); + ogs_assert(bearer); + memset(bearer, 0, sizeof *bearer); + + bearer->ebi = OGS_NEXT_ID(amf_ue->ebi, + MIN_5GS_BEARER_ID, MAX_5GS_BEARER_ID); + + bearer->amf_ue = amf_ue; + bearer->sess = sess; + + ogs_list_add(&sess->bearer_list, bearer); + + bearer->t3589.timer = ogs_timer_add( + self.timer_mgr, amf_timer_t3589_expire, bearer); + bearer->t3589.pkbuf = NULL; + + e.bearer = bearer; + e.id = 0; + ogs_fsm_create(&bearer->sm, gsm_state_initial, gsm_state_final); + ogs_fsm_init(&bearer->sm, &e); + + return bearer; +} + +void amf_bearer_remove(amf_bearer_t *bearer) +{ + amf_event_t e; + + ogs_assert(bearer); + ogs_assert(bearer->sess); + + e.bearer = bearer; + ogs_fsm_fini(&bearer->sm, &e); + ogs_fsm_delete(&bearer->sm); + + CLEAR_BEARER_ALL_TIMERS(bearer); + ogs_timer_delete(bearer->t3589.timer); + + ogs_list_remove(&bearer->sess->bearer_list, bearer); + + OGS_TLV_CLEAR_DATA(&bearer->tft); + + ogs_pool_free(&amf_bearer_pool, bearer); +} + +void amf_bearer_remove_all(amf_sess_t *sess) +{ + amf_bearer_t *bearer = NULL, *next_bearer = NULL; + + ogs_assert(sess); + + bearer = amf_bearer_first(sess); + while (bearer) { + next_bearer = amf_bearer_next(bearer); + + amf_bearer_remove(bearer); + + bearer = next_bearer; + } +} + +amf_bearer_t *amf_bearer_find_by_sess_ebi(amf_sess_t *sess, uint8_t ebi) +{ + amf_bearer_t *bearer = NULL; + + ogs_assert(sess); + + bearer = amf_bearer_first(sess); + while (bearer) { + if (ebi == bearer->ebi) + return bearer; + + bearer = amf_bearer_next(bearer); + } + + return NULL; +} + +amf_bearer_t *amf_bearer_find_by_ue_ebi(amf_ue_t *amf_ue, uint8_t ebi) +{ + amf_sess_t *sess = NULL; + amf_bearer_t *bearer = NULL; + + ogs_assert(amf_ue); + + sess = amf_sess_first(amf_ue); + while (sess) { + bearer = amf_bearer_find_by_sess_ebi(sess, ebi); + if (bearer) { + return bearer; + } + + sess = amf_sess_next(sess); + } + + return NULL; +} + +amf_bearer_t *amf_bearer_find_or_add_by_message( + amf_ue_t *amf_ue, ogs_nas_5gs_message_t *message) +{ +#if 0 + uint8_t pti = OGS_NAS_PROCEDURE_TRANSACTION_IDENTITY_UNASSIGNED; + uint8_t ebi = OGS_NAS_5GS_BEARER_IDENTITY_UNASSIGNED; +#endif + + amf_bearer_t *bearer = NULL; +#if 0 + amf_sess_t *sess = NULL; +#endif + +#if 0 + ogs_assert(amf_ue); + ogs_assert(message); + + pti = message->esm.h.procedure_transaction_identity; + ebi = message->esm.h.eps_bearer_identity; + + ogs_debug("amf_bearer_find_or_add_by_message() [PTI:%d, EBI:%d]", + pti, ebi); + + if (ebi != OGS_NAS_5GS_BEARER_IDENTITY_UNASSIGNED) { + bearer = amf_bearer_find_by_ue_ebi(amf_ue, ebi); + if (!bearer) { + ogs_error("No Bearer : EBI[%d]", ebi); + nas_eps_send_attach_reject(amf_ue, + EMM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED, + ESM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED); + return NULL; + } + + return bearer; + } + + if (pti == OGS_NAS_PROCEDURE_TRANSACTION_IDENTITY_UNASSIGNED) { + ogs_error("Both PTI[%d] and EBI[%d] are 0", pti, ebi); + nas_eps_send_attach_reject(amf_ue, + EMM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED, + ESM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED); + return NULL; + } + + if (message->esm.h.message_type == OGS_NAS_5GS_PDN_DISCONNECT_REQUEST) { + ogs_nas_eps_pdn_disconnect_request_t *pdn_disconnect_request = + &message->esm.pdn_disconnect_request; + ogs_nas_linked_eps_bearer_identity_t *linked_eps_bearer_identity = + &pdn_disconnect_request->linked_eps_bearer_identity; + + bearer = amf_bearer_find_by_ue_ebi(amf_ue, + linked_eps_bearer_identity->eps_bearer_identity); + if (!bearer) { + ogs_error("No Bearer : Linked-EBI[%d]", + linked_eps_bearer_identity->eps_bearer_identity); + nas_eps_send_attach_reject(amf_ue, + EMM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED, + ESM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED); + return NULL; + } + } else if (message->esm.h.message_type == + OGS_NAS_5GS_BEARER_RESOURCE_ALLOCATION_REQUEST) { + ogs_nas_eps_bearer_resource_allocation_request_t + *bearer_allocation_request = + &message->esm.bearer_resource_allocation_request; + ogs_nas_linked_eps_bearer_identity_t *linked_eps_bearer_identity = + &bearer_allocation_request->linked_eps_bearer_identity; + + bearer = amf_bearer_find_by_ue_ebi(amf_ue, + linked_eps_bearer_identity->eps_bearer_identity); + if (!bearer) { + ogs_error("No Bearer : Linked-EBI[%d]", + linked_eps_bearer_identity->eps_bearer_identity); + nas_eps_send_attach_reject(amf_ue, + EMM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED, + ESM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED); + return NULL; + } + } else if (message->esm.h.message_type == + OGS_NAS_5GS_BEARER_RESOURCE_MODIFICATION_REQUEST) { + ogs_nas_eps_bearer_resource_modification_request_t + *bearer_modification_request = + &message->esm.bearer_resource_modification_request; + ogs_nas_linked_eps_bearer_identity_t *linked_eps_bearer_identity = + &bearer_modification_request->eps_bearer_identity_for_packet_filter; + + bearer = amf_bearer_find_by_ue_ebi(amf_ue, + linked_eps_bearer_identity->eps_bearer_identity); + if (!bearer) { + ogs_error("No Bearer : Linked-EBI[%d]", + linked_eps_bearer_identity->eps_bearer_identity); + nas_eps_send_attach_reject(amf_ue, + EMM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED, + ESM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED); + return NULL; + } + } + + if (bearer) { + sess = bearer->sess; + ogs_assert(sess); + sess->pti = pti; + + return bearer; + } + + if (message->esm.h.message_type == OGS_NAS_5GS_PDN_CONNECTIVITY_REQUEST) { + ogs_nas_eps_pdn_connectivity_request_t *pdn_connectivity_request = + &message->esm.pdn_connectivity_request; + if (pdn_connectivity_request->presencemask & + OGS_NAS_5GS_PDN_CONNECTIVITY_REQUEST_ACCESS_POINT_NAME_PRESENT) + sess = amf_sess_find_by_dnn(amf_ue, + pdn_connectivity_request->access_point_name.dnn); + else + sess = amf_sess_first(amf_ue); + + if (!sess) + sess = amf_sess_add(amf_ue, pti); + else + sess->pti = pti; + + ogs_assert(sess); + } else { + sess = amf_sess_find_by_pti(amf_ue, pti); + ogs_assert(sess); + } + + bearer = amf_default_bearer_in_sess(sess); + ogs_assert(bearer); +#endif + + return bearer; +} + +amf_bearer_t *amf_default_bearer_in_sess(amf_sess_t *sess) +{ + ogs_assert(sess); + return amf_bearer_first(sess); +} + +amf_bearer_t *amf_linked_bearer(amf_bearer_t *bearer) +{ + amf_sess_t *sess = NULL; + + ogs_assert(bearer); + sess = bearer->sess; + ogs_assert(sess); + + return amf_default_bearer_in_sess(sess); +} + +amf_bearer_t *amf_bearer_first(amf_sess_t *sess) +{ + ogs_assert(sess); + + return ogs_list_first(&sess->bearer_list); +} + +amf_bearer_t *amf_bearer_next(amf_bearer_t *bearer) +{ + ogs_assert(bearer); + return ogs_list_next(bearer); +} + +int amf_bearer_is_inactive(amf_ue_t *amf_ue) +{ + amf_sess_t *sess = NULL; + ogs_assert(amf_ue); + + sess = amf_sess_first(amf_ue); + while (sess) { + amf_bearer_t *bearer = amf_bearer_first(sess); + while (bearer) { + if (AMF_HAVE_GNB_S1U_PATH(bearer)) { + return 0; + } + + bearer = amf_bearer_next(bearer); + } + sess = amf_sess_next(sess); + } + + return 1; +} + +int amf_bearer_set_inactive(amf_ue_t *amf_ue) +{ + amf_sess_t *sess = NULL; + + ogs_assert(amf_ue); + sess = amf_sess_first(amf_ue); + while (sess) { + amf_bearer_t *bearer = amf_bearer_first(sess); + while (bearer) { + CLEAR_GNB_S1U_PATH(bearer); + + bearer = amf_bearer_next(bearer); + } + sess = amf_sess_next(sess); + } + + return OGS_OK; +} + +void amf_pdn_remove_all(amf_ue_t *amf_ue) +{ +#if 0 + ogs_diam_s6a_subscription_data_t *subscription_data = NULL; + + ogs_assert(amf_ue); + subscription_data = &amf_ue->subscription_data; + ogs_assert(subscription_data); + + subscription_data->num_of_pdn = 0; +#endif +} + +ogs_pdn_t *amf_pdn_find_by_dnn(amf_ue_t *amf_ue, char *dnn) +{ +#if 0 + ogs_diam_s6a_subscription_data_t *subscription_data = NULL; + ogs_pdn_t *pdn = NULL; + int i = 0; + + ogs_assert(amf_ue); + ogs_assert(dnn); + + subscription_data = &amf_ue->subscription_data; + ogs_assert(subscription_data); + + for (i = 0; i < subscription_data->num_of_pdn; i++) { + pdn = &subscription_data->pdn[i]; + if (strcmp(pdn->dnn, dnn) == 0) + return pdn; + } +#endif + + return NULL; +} + +ogs_pdn_t *amf_default_pdn(amf_ue_t *amf_ue) +{ +#if 0 + ogs_diam_s6a_subscription_data_t *subscription_data = NULL; + ogs_pdn_t *pdn = NULL; + int i = 0; + + ogs_assert(amf_ue); + subscription_data = &amf_ue->subscription_data; + ogs_assert(subscription_data); + + for (i = 0; i < subscription_data->num_of_pdn; i++) { + pdn = &subscription_data->pdn[i]; + if (pdn->context_identifier == subscription_data->context_identifier) + return pdn; + } +#endif + + return NULL; +} + int amf_find_served_tai(ogs_5gs_tai_t *tai) { int i = 0, j = 0, k = 0; @@ -1009,7 +2160,6 @@ int amf_m_tmsi_free(amf_m_tmsi_t *m_tmsi) return OGS_OK; } -#if 0 uint8_t amf_selected_int_algorithm(amf_ue_t *amf_ue) { int i; @@ -1017,7 +2167,7 @@ uint8_t amf_selected_int_algorithm(amf_ue_t *amf_ue) ogs_assert(amf_ue); for (i = 0; i < amf_self()->num_of_integrity_order; i++) { - if (amf_ue->ue_network_capability.eia & + if (amf_ue->ue_security_capability.nia & (0x80 >> amf_self()->integrity_order[i])) { return amf_self()->integrity_order[i]; } @@ -1033,7 +2183,7 @@ uint8_t amf_selected_enc_algorithm(amf_ue_t *amf_ue) ogs_assert(amf_ue); for (i = 0; i < amf_self()->num_of_ciphering_order; i++) { - if (amf_ue->ue_network_capability.eea & + if (amf_ue->ue_security_capability.nea & (0x80 >> amf_self()->ciphering_order[i])) { return amf_self()->ciphering_order[i]; } @@ -1041,4 +2191,3 @@ uint8_t amf_selected_enc_algorithm(amf_ue_t *amf_ue) return 0; } -#endif diff --git a/src/amf/context.h b/src/amf/context.h index aeec359a6b..0954323b17 100644 --- a/src/amf/context.h +++ b/src/amf/context.h @@ -36,11 +36,17 @@ extern "C" { #define MAX_NUM_OF_SERVED_GUAMI 8 extern int __amf_log_domain; +extern int __gmm_log_domain; +extern int __gsm_log_domain; #undef OGS_LOG_DOMAIN #define OGS_LOG_DOMAIN __amf_log_domain +typedef struct ran_ue_s ran_ue_t; +typedef struct amf_ue_s amf_ue_t; + typedef uint32_t amf_m_tmsi_t; +typedef uint32_t amf_p_tmsi_t; typedef struct amf_context_s { ogs_queue_t *queue; /* Queue for processing UPF control */ @@ -49,7 +55,7 @@ typedef struct amf_context_s { OpenAPI_nf_type_e nf_type; - /* Served GUMME */ + /* Served GUAMI */ uint8_t num_of_served_guami; struct { ogs_plmn_id_t plmn_id; @@ -87,26 +93,36 @@ typedef struct amf_context_s { uint8_t integrity_order[OGS_MAX_NUM_OF_ALGORITHM]; /* Network Name */ - ogs_nas_network_name_t short_name; /* Network short name */ - ogs_nas_network_name_t full_name; /* Network Full Name */ + ogs_nas_network_name_t short_name; /* Network short name */ + ogs_nas_network_name_t full_name; /* Network Full Name */ /* AMF Name */ const char *amf_name; - /* M-TMSI Pool */ - OGS_POOL(m_tmsi, amf_m_tmsi_t); - /* NGSetupResponse */ uint8_t relative_capacity; + /* Generator for unique identification */ + uint64_t amf_ue_ngap_id; /* amf_ue_ngap_id generator */ + + ogs_list_t gnb_list; /* GNB NGAP Client List */ + ogs_list_t amf_ue_list; + + ogs_hash_t *gnb_addr_hash; /* hash table for GNB Address */ + ogs_hash_t *gnb_id_hash; /* hash table for GNB-ID */ + ogs_hash_t *amf_ue_ngap_id_hash; /* hash table for AMF-UE-NGAP-ID */ + ogs_hash_t *imsi_ue_hash; /* hash table (IMSI : AMF_UE) */ + ogs_hash_t *guti_ue_hash; /* hash table (GUTI : AMF_UE) */ + ogs_hash_t *suci_hash; /* hash table (SUCI) */ + ogs_hash_t *supi_hash; /* hash table (SUPI) */ + + OGS_POOL(m_tmsi, amf_m_tmsi_t); /* M-TMSI Pool */ + uint16_t ngap_port; /* Default NGAP Port */ ogs_list_t ngap_list; /* AMF NGAP IPv4 Server List */ ogs_list_t ngap_list6; /* AMF NGAP IPv6 Server List */ - ogs_list_t gnb_list; /* ENB S1AP Client List */ - ogs_hash_t *gnb_addr_hash; /* hash table for GNB Address */ - ogs_hash_t *gnb_id_hash; /* hash table for GNB-ID */ } amf_context_t; typedef struct amf_gnb_s { @@ -114,14 +130,14 @@ typedef struct amf_gnb_s { ogs_fsm_t sm; /* A state machine */ - uint32_t gnb_id; /* eNB_ID received from eNB */ + uint32_t gnb_id; /* gNB_ID received from gNB */ int sock_type; /* SOCK_STREAM or SOCK_SEQPACKET */ - ogs_sock_t *sock; /* eNB S1AP Socket */ - ogs_sockaddr_t *addr; /* eNB S1AP Address */ - ogs_poll_t *poll; /* eNB S1AP Poll */ + ogs_sock_t *sock; /* gNB NGAP Socket */ + ogs_sockaddr_t *addr; /* gNB NGAP Address */ + ogs_poll_t *poll; /* gNB NGAP Poll */ struct { - bool ng_setup_success; /* eNB S1AP Setup complete successfuly */ + bool ng_setup_success; /* gNB NGAP Setup complete successfuly */ } state; uint16_t max_num_of_ostreams;/* SCTP Max num of outbound streams */ @@ -131,10 +147,387 @@ typedef struct amf_gnb_s { uint8_t num_of_supported_ta_list; ogs_5gs_tai_t supported_ta_list[OGS_MAX_NUM_OF_TAI*OGS_MAX_NUM_OF_BPLMN]; - ogs_list_t gnb_ue_list; + ogs_list_t ran_ue_list; } amf_gnb_t; +struct ran_ue_s { + ogs_lnode_t lnode; + + /* UE identity */ +#define INVALID_UE_NGAP_ID 0xffffffff /* Initial value of ran_ue_ngap_id */ + uint32_t ran_ue_ngap_id; /* eNB-UE-NGAP-ID received from eNB */ + uint64_t amf_ue_ngap_id; /* AMF-UE-NGAP-ID received from AMF */ + + uint16_t gnb_ostream_id; /* SCTP output stream id for eNB */ + + /* Handover Info */ + NGAP_HandoverType_t handover_type; + ran_ue_t *source_ue; + ran_ue_t *target_ue; + + /* Use amf_ue->tai, amf_ue->e_cgi. + * Do not access ran_ue->saved.tai ran_ue->saved.e_cgi. + * + * Save TAI and ECGI. And then, this will copy 'amf_ue_t' context later */ + struct { + ogs_5gs_tai_t tai; + ogs_nr_cgi_t cgi; + } saved; + + /* Store by UE Context Release Command + * Retrieve by UE Context Release Complete */ +#define NGAP_UE_CTX_REL_INVALID_ACTION 0 +#define NGAP_UE_CTX_REL_S1_CONTEXT_REMOVE 1 +#define NGAP_UE_CTX_REL_S1_REMOVE_AND_UNLINK 2 +#define NGAP_UE_CTX_REL_UE_CONTEXT_REMOVE 3 +#define NGAP_UE_CTX_REL_DELETE_INDIRECT_TUNNEL 4 + uint8_t ue_ctx_rel_action; + + /* Related Context */ + amf_gnb_t *gnb; + amf_ue_t *amf_ue; +}; + +struct amf_ue_s { + ogs_lnode_t lnode; + ogs_fsm_t sm; /* A state machine */ + + struct { +#define OGS_NAS_SECURITY_BEARER_3GPP 1 +#define OGS_NAS_SECURITY_BEARER_NON_3GPP 2 + uint8_t connection_identifier; + uint8_t type; + uint8_t ksi; + union { + ogs_nas_5gs_registration_type_t registration; +#if 0 + ogs_5gs_update_type_t update; + ogs_5gs_service_type_t service; + ogs_5gs_detach_type_t detach; +#endif + uint8_t data; + }; + } nas; + + /* UE identity */ + char *suci; /* TS33.501 : SUCI */ + char *supi; /* TS33.501 : SUPI */ + +#define AMF_UE_HAVE_SUCI(__aMF) \ + ((__aMF) && ((__aMF)->suci)) + uint8_t imsi[OGS_MAX_IMSI_LEN]; + int imsi_len; + char imsi_bcd[OGS_MAX_IMSI_BCD_LEN+1]; + ogs_nas_5gs_mobile_identity_imsi_t nas_mobile_identity_imsi; + + bool imeisv_presence; + uint8_t imeisv[OGS_MAX_IMEISV_LEN]; + int imeisv_len; + char imeisv_bcd[OGS_MAX_IMEISV_BCD_LEN+1]; + ogs_nas_mobile_identity_imeisv_t nas_mobile_identity_imeisv; + + amf_m_tmsi_t *m_tmsi; + amf_p_tmsi_t p_tmsi; + ogs_nas_5gs_guti_t guti; + int guti_present; + + uint16_t vlr_ostream_id; /* SCTP output stream id for VLR */ + + /* UE Info */ + ogs_5gs_tai_t tai; + ogs_nr_cgi_t cgi; + ogs_plmn_id_t last_visited_plmn_id; + + /* 5GMM Capability */ + struct { + bool lte_positioning_protocol_capability; + bool ho_attach; + bool s1_mode; + } gmm_capability; + +#define SECURITY_CONTEXT_IS_VALID(__aMF) \ + ((__aMF) && \ + ((__aMF)->security_context_available == 1) && \ + ((__aMF)->mac_failed == 0) && \ + ((__aMF)->nas.ksi != OGS_NAS_KSI_NO_KEY_IS_AVAILABLE)) +#define CLEAR_SECURITY_CONTEXT(__aMF) \ + do { \ + ogs_assert((__aMF)); \ + (__aMF)->security_context_available = 0; \ + (__aMF)->mac_failed = 0; \ + (__aMF)->nas.ksi = 0; \ + } while(0) + int security_context_available; + int mac_failed; + + /* Security Context */ + ogs_nas_ue_security_capability_t ue_security_capability; +#if 0 + ogs_nas_ue_network_capability_t ue_network_capability; + ogs_nas_ms_network_capability_t ms_network_capability; +#endif + char *confirmation_url_for_5g_aka; + uint8_t rand[OGS_RAND_LEN]; + uint8_t autn[OGS_AUTN_LEN]; + uint8_t xres_star[OGS_MAX_RES_LEN]; + + uint8_t abba[OGS_NAS_MAX_ABBA_LEN]; + uint8_t abba_len; + + uint8_t hxres_star[OGS_MAX_RES_LEN]; + uint8_t kamf[OGS_SHA256_DIGEST_SIZE]; + OpenAPI_auth_result_e auth_result; + + uint8_t knas_int[OGS_SHA256_DIGEST_SIZE/2]; + uint8_t knas_enc[OGS_SHA256_DIGEST_SIZE/2]; + uint32_t dl_count; + union { + struct { + ED3(uint8_t spare;, + uint16_t overflow;, + uint8_t sqn;) + } __attribute__ ((packed)); + uint32_t i32; + } ul_count; + uint8_t kgnb[OGS_SHA256_DIGEST_SIZE]; + + struct { + ED2(uint8_t nhcc_spare:5;, + uint8_t nhcc:3;) /* Next Hop Channing Counter */ + }; + uint8_t nh[OGS_SHA256_DIGEST_SIZE]; /* NH Security Key */ + + /* defined in 'lib/nas/common/types.h' + * #define OGS_NAS_SECURITY_ALGORITHMS_NEA0 0 + * #define OGS_NAS_SECURITY_ALGORITHMS_128_NEA1 1 + * #define OGS_NAS_SECURITY_ALGORITHMS_128_NEA2 2 + * #define OGS_NAS_SECURITY_ALGORITHMS_128_NEA3 3 */ + uint8_t selected_enc_algorithm; + /* defined in 'lib/nas/common/types.h' + * #define OGS_NAS_SECURITY_ALGORITHMS_NIA0 0 + * #define OGS_NAS_SECURITY_ALGORITHMS_128_NIA1 1 + * #define OGS_NAS_SECURITY_ALGORITHMS_128_NIA1 2 + * #define OGS_NAS_SECURITY_ALGORITHMS_128_NIA3 3 */ + uint8_t selected_int_algorithm; + + /* ESM Info */ +#define MIN_5GS_BEARER_ID 5 +#define MAX_5GS_BEARER_ID 15 + +#define CLEAR_5GS_BEARER_ID(__aMF) \ + do { \ + ogs_assert((__aMF)); \ + (__aMF)->ebi = MIN_5GS_BEARER_ID - 1; \ + } while(0) + uint8_t ebi; /* 5GS Bearer ID generator */ + ogs_list_t sess_list; + +#define ECM_CONNECTED(__aMF) \ + ((__aMF) && ((__aMF)->ran_ue != NULL)) +#define ECM_IDLE(__aMF) (!ECM_CONNECTED(__aMF)) + /* S1 UE context */ + ran_ue_t *ran_ue; + +#define CLEAR_AMF_UE_ALL_TIMERS(__aMF) \ + do { \ + CLEAR_AMF_UE_TIMER((__aMF)->sbi_client_wait); \ + CLEAR_AMF_UE_TIMER((__aMF)->t3513); \ + CLEAR_AMF_UE_TIMER((__aMF)->t3522); \ + CLEAR_AMF_UE_TIMER((__aMF)->t3550); \ + CLEAR_AMF_UE_TIMER((__aMF)->t3560); \ + CLEAR_AMF_UE_TIMER((__aMF)->t3570); \ + } while(0); +#define CLEAR_AMF_UE_TIMER(__aMF_UE_TIMER) \ + do { \ + ogs_timer_stop((__aMF_UE_TIMER).timer); \ + if ((__aMF_UE_TIMER).pkbuf) { \ + ogs_pkbuf_free((__aMF_UE_TIMER).pkbuf); \ + (__aMF_UE_TIMER).pkbuf = NULL; \ + } \ + (__aMF_UE_TIMER).retry_count = 0; \ + } while(0); + struct { + ogs_pkbuf_t *pkbuf; + ogs_timer_t *timer; + uint32_t retry_count;; + } sbi_client_wait, t3513, t3522, t3550, t3560, t3570; + + /* UE Radio Capability */ + OCTET_STRING_t ueRadioCapability; + + /* NGAP Transparent Container */ + OCTET_STRING_t container; + + /* + * If the AMF sends Delete-Session-Request to the SMF for all sessions, + * session_context_will_deleted = 1 + * When the AMF receives a Delete-Session-Response for the last session, + * session_context_will_deleted = 0 + */ + int session_context_will_deleted; + +#if 0 + amf_csmap_t *csmap; +#endif + +#define AMF_NF_INSTANCE_CLEAR(_cAUSE, _nFInstance) \ + do { \ + ogs_assert(_nFInstance); \ + if ((_nFInstance)->reference_count == 1) { \ + ogs_info("[%s] (%s) NF removed", (_nFInstance)->id, (_cAUSE)); \ + amf_nf_fsm_fini((_nFInstance)); \ + } else { \ + /* There is an assocation with other context */ \ + ogs_info("[%s:%d] (%s) NF suspended", \ + _nFInstance->id, _nFInstance->reference_count, (_cAUSE)); \ + OGS_FSM_TRAN(&_nFInstance->sm, amf_nf_state_de_registered); \ + ogs_fsm_dispatch(&_nFInstance->sm, NULL); \ + } \ + ogs_sbi_nf_instance_remove(_nFInstance); \ + } while(0) + + ogs_sbi_nf_types_t nf_types; +}; + +#define AMF_HAVE_SMF_S1U_PATH(__sESS) \ + ((__sESS) && (amf_bearer_first(__sESS)) && \ + ((amf_default_bearer_in_sess(__sESS)->smf_s1u_teid))) +#define CLEAR_SMF_S1U_PATH(__sESS) \ + do { \ + amf_bearer_t *__bEARER = NULL; \ + ogs_assert((__sESS)); \ + __bEARER = amf_default_bearer_in_sess(__sESS); \ + __bEARER->smf_s1u_teid = 0; \ + } while(0) + +#define SESSION_CONTEXT_IS_AVAILABLE(__aMF) \ + ((__aMF) && ((__aMF)->smf_s11_teid)) + +#define SESSION_CONTEXT_WILL_DELETED(__aMF) \ + ((__aMF) && ((__aMF)->session_context_will_deleted)) + +#define CLEAR_SESSION_CONTEXT(__aMF) \ + do { \ + ogs_assert((__aMF)); \ + (__aMF)->smf_s11_teid = 0; \ + (__aMF)->session_context_will_deleted = 0; \ + } while(0) +typedef struct amf_sess_s { + ogs_lnode_t lnode; + + uint8_t pti; /* Procedure Trasaction Identity */ + +#if 0 + /* PDN Connectivity Request */ + ogs_nas_request_type_t request_type; +#endif + + /* amf_bearer_first(sess) : Default Bearer Context */ + ogs_list_t bearer_list; + + /* Related Context */ + amf_ue_t *amf_ue; + +#define AMF_UE_HAVE_APN(__aMF) \ + ((__aMF) && (amf_sess_first(__aMF)) && \ + ((amf_sess_first(__aMF))->pdn)) + ogs_pdn_t *pdn; + + /* Save Protocol Configuration Options from UE */ + struct { + uint8_t length; + uint8_t *buffer; + } ue_pco; + + /* Save Protocol Configuration Options from PGW */ + ogs_tlv_octet_t pgw_pco; +} amf_sess_t; + +#define BEARER_CONTEXT_IS_ACTIVE(__aMF) \ + (amf_bearer_is_inactive(__aMF) == 0) +#define CLEAR_BEARER_CONTEXT(__aMF) \ + amf_bearer_set_inactive(__aMF) + +#define AMF_HAVE_GNB_S1U_PATH(__bEARER) \ + ((__bEARER) && ((__bEARER)->gnb_s1u_teid)) +#define CLEAR_GNB_S1U_PATH(__bEARER) \ + do { \ + ogs_assert((__bEARER)); \ + (__bEARER)->gnb_s1u_teid = 0; \ + } while(0) + +#define AMF_HAVE_GNB_DL_INDIRECT_TUNNEL(__bEARER) \ + ((__bEARER) && ((__bEARER)->gnb_dl_teid)) +#define AMF_HAVE_GNB_UL_INDIRECT_TUNNEL(__bEARER) \ + ((__bEARER) && ((__bEARER)->gnb_ul_teid)) +#define AMF_HAVE_SMF_DL_INDIRECT_TUNNEL(__bEARER) \ + ((__bEARER) && ((__bEARER)->smf_dl_teid)) +#define AMF_HAVE_SMF_UL_INDIRECT_TUNNEL(__bEARER) \ + ((__bEARER) && ((__bEARER)->smf_ul_teid)) +#define CLEAR_INDIRECT_TUNNEL(__bEARER) \ + do { \ + ogs_assert((__bEARER)); \ + (__bEARER)->gnb_dl_teid = 0; \ + (__bEARER)->gnb_ul_teid = 0; \ + (__bEARER)->smf_dl_teid = 0; \ + (__bEARER)->smf_ul_teid = 0; \ + } while(0) +typedef struct amf_bearer_s { + ogs_lnode_t lnode; + ogs_fsm_t sm; /* State Machine */ + + uint8_t ebi; /* 5GS Bearer ID */ + + uint32_t gnb_s1u_teid; + ogs_ip_t gnb_s1u_ip; + uint32_t smf_s1u_teid; + ogs_ip_t smf_s1u_ip; + + uint32_t target_s1u_teid; /* Target S1U TEID from HO-Req-Ack */ + ogs_ip_t target_s1u_ip; /* Target S1U ADDR from HO-Req-Ack */ + + uint32_t gnb_dl_teid; + ogs_ip_t gnb_dl_ip; + uint32_t gnb_ul_teid; + ogs_ip_t gnb_ul_ip; + + uint32_t smf_dl_teid; + ogs_ip_t smf_dl_ip; + uint32_t smf_ul_teid; + ogs_ip_t smf_ul_ip; + + ogs_qos_t qos; + ogs_tlv_octet_t tft; /* Saved TFT */ + +#define CLEAR_BEARER_ALL_TIMERS(__bEARER) \ + do { \ + CLEAR_BEARER_TIMER((__bEARER)->t3589); \ + } while(0); +#define CLEAR_BEARER_TIMER(__bEARER_TIMER) \ + do { \ + ogs_timer_stop((__bEARER_TIMER).timer); \ + if ((__bEARER_TIMER).pkbuf) \ + { \ + ogs_pkbuf_free((__bEARER_TIMER).pkbuf); \ + (__bEARER_TIMER).pkbuf = NULL; \ + } \ + (__bEARER_TIMER).retry_count = 0; \ + } while(0); + struct { + ogs_pkbuf_t *pkbuf; + ogs_timer_t *timer; + uint32_t retry_count;; + } t3589; + + /* Related Context */ + amf_ue_t *amf_ue; + amf_sess_t *sess; +#if 0 + ogs_gtp_xact_t *xact; +#endif +} amf_bearer_t; + void amf_context_init(void); void amf_context_final(void); amf_context_t *amf_self(void); @@ -149,16 +542,127 @@ amf_gnb_t *amf_gnb_find_by_gnb_id(uint32_t gnb_id); int amf_gnb_set_gnb_id(amf_gnb_t *gnb, uint32_t gnb_id); int amf_gnb_sock_type(ogs_sock_t *sock); +ran_ue_t *ran_ue_add(amf_gnb_t *gnb, uint32_t ran_ue_ngap_id); +unsigned int ran_ue_count(void); +void ran_ue_remove(ran_ue_t *ran_ue); +void ran_ue_remove_in_gnb(amf_gnb_t *gnb); +void ran_ue_switch_to_gnb(ran_ue_t *ran_ue, amf_gnb_t *new_gnb); +ran_ue_t *ran_ue_find_by_ran_ue_ngap_id( + amf_gnb_t *gnb, uint32_t ran_ue_ngap_id); +ran_ue_t *ran_ue_find_by_amf_ue_ngap_id(uint64_t amf_ue_ngap_id); +ran_ue_t *ran_ue_first_in_gnb(amf_gnb_t *gnb); +ran_ue_t *ran_ue_next_in_gnb(ran_ue_t *ran_ue); + +amf_ue_t *amf_ue_add(ran_ue_t *ran_ue); +void amf_ue_remove(amf_ue_t *amf_ue); +void amf_ue_remove_all(void); + +amf_ue_t *amf_ue_find_by_imsi(uint8_t *imsi, int imsi_len); +amf_ue_t *amf_ue_find_by_imsi_bcd(char *imsi_bcd); +amf_ue_t *amf_ue_find_by_guti(ogs_nas_5gs_guti_t *nas_guti); +amf_ue_t *amf_ue_find_by_teid(uint32_t teid); +amf_ue_t *amf_ue_find_by_suci(char *suci); +amf_ue_t *amf_ue_find_by_supi(char *supi); + +amf_ue_t *amf_ue_find_by_message(ogs_nas_5gs_message_t *message); +void amf_ue_set_suci(amf_ue_t *amf_ue, + ogs_nas_5gs_mobile_identity_t *mobile_identity); +void amf_ue_set_supi(amf_ue_t *amf_ue, char *supi); + +int amf_ue_have_indirect_tunnel(amf_ue_t *amf_ue); +int amf_ue_clear_indirect_tunnel(amf_ue_t *amf_ue); + +/* + * o RECV Initial UE-Message : S-TMSI + * o RECV Attach Request : IMSI, GUTI + * o RECV TAU Request : GUTI + * ### AMF_UE_ASSOCIATE_GNB_UE() ### + * ### AMF_UE_ECM_CONNECTED() ### + * + * o RECV Initial Context Setup Failure in EMM Registered State + * ### AMF_UE_DEASSOCIATE_GNB_UE() ### + * ### GNB_UE_REMOVE() ### + * ### AMF_UE_DEASSOCIATE() ### + * + * o SEND UE Context Release Command with NO_ACTION + * - RECV UE Context Release Complete + * ### GNB_UE_REMOVE() ### + * ### AMF_UE_DEASSOCIATE() ### + * + * o SEND UE Context Release Command with REMOVE_AMF_UE_CONTEXT + * - RECV UE Context Release Complete + * ### GNB_UE_REMOVE() ### + * ### AMF_UE_REMOVE() ### + * + * + * o RECV Handover Required + * ### SOURCE_UE_ASSOCIATE_TARGET_UE() #### + * - SEND Handover Request + * + * o RECV Handover Notify + * ### AMF_UE_ASSOCIATE_GNB_UE(TARGET) ### + * ### AMF_UE_ECM_CONNECTED(TARGET) ### + * - Modify Bearer Request/Response + * - UE Context Release Command/Complete + * ### SOURCE_UE_DEASSOCIATE_TARGET_UE() #### + * ### GNB_UE_REMOVE() #### + * - Delete Indirect Data Forwarding Tunnel Request/Response + * + * o RECV Handover Cancel + * - UE Context Release Command/Complete + * ### SOURCE_UE_DEASSOCIATE_TARGET_UE() #### + * ### GNB_UE_REMOVE() #### + * - Delete Indirect Data Forwarding Tunnel Request/Response + * + * o RECV Handover Failure + * - UE Context Release Command/Complete + * ### SOURCE_UE_DEASSOCIATE_TARGET_UE() #### + * ### GNB_UE_REMOVE() #### + * - Delete Indirect Data Forwarding Tunnel Request/Response + */ +void amf_ue_associate_ran_ue(amf_ue_t *amf_ue, ran_ue_t *ran_ue); +void ran_ue_deassociate(ran_ue_t *ran_ue); +void amf_ue_deassociate(amf_ue_t *amf_ue); +void source_ue_associate_target_ue(ran_ue_t *source_ue, ran_ue_t *target_ue); +void source_ue_deassociate_target_ue(ran_ue_t *ran_ue); + +amf_sess_t *amf_sess_add(amf_ue_t *amf_ue, uint8_t pti); +void amf_sess_remove(amf_sess_t *sess); +void amf_sess_remove_all(amf_ue_t *amf_ue); +amf_sess_t *amf_sess_find_by_pti(amf_ue_t *amf_ue, uint8_t pti); +amf_sess_t *amf_sess_find_by_ebi(amf_ue_t *amf_ue, uint8_t ebi); +amf_sess_t *amf_sess_find_by_dnn(amf_ue_t *amf_ue, char *dnn); +amf_sess_t *amf_sess_first(amf_ue_t *amf_ue); +amf_sess_t *amf_sess_next(amf_sess_t *sess); +unsigned int amf_sess_count(amf_ue_t *amf_ue); + +amf_bearer_t *amf_bearer_add(amf_sess_t *sess); +void amf_bearer_remove(amf_bearer_t *bearer); +void amf_bearer_remove_all(amf_sess_t *sess); +amf_bearer_t *amf_bearer_find_by_sess_ebi(amf_sess_t *sess, uint8_t ebi); +amf_bearer_t *amf_bearer_find_by_ue_ebi(amf_ue_t *amf_ue, uint8_t ebi); +amf_bearer_t *amf_bearer_find_or_add_by_message( + amf_ue_t *amf_ue, ogs_nas_5gs_message_t *message); +amf_bearer_t *amf_default_bearer_in_sess(amf_sess_t *sess); +amf_bearer_t *amf_linked_bearer(amf_bearer_t *bearer); +amf_bearer_t *amf_bearer_first(amf_sess_t *sess); +amf_bearer_t *amf_bearer_next(amf_bearer_t *bearer); + +int amf_bearer_is_inactive(amf_ue_t *amf_ue); +int amf_bearer_set_inactive(amf_ue_t *amf_ue); + +void amf_pdn_remove_all(amf_ue_t *amf_ue); +ogs_pdn_t *amf_pdn_find_by_dnn(amf_ue_t *amf_ue, char *dnn); +ogs_pdn_t *amf_default_pdn(amf_ue_t *amf_ue); + int amf_find_served_tai(ogs_5gs_tai_t *tai); int amf_m_tmsi_pool_generate(void); amf_m_tmsi_t *amf_m_tmsi_alloc(void); int amf_m_tmsi_free(amf_m_tmsi_t *tmsi); -#if 0 uint8_t amf_selected_int_algorithm(amf_ue_t *amf_ue); uint8_t amf_selected_enc_algorithm(amf_ue_t *amf_ue); -#endif #ifdef __cplusplus } diff --git a/src/amf/event.c b/src/amf/event.c index 4b4f9d708f..d92c4e0599 100644 --- a/src/amf/event.c +++ b/src/amf/event.c @@ -95,6 +95,15 @@ const char *amf_event_get_name(amf_event_t *e) case AMF_EVT_NGAP_LO_CONNREFUSED: return "AMF_EVT_NGAP_LO_CONNREFUSED"; + case AMF_EVT_5GMM_MESSAGE: + return "AMF_EVT_5GMM_MESSAGE"; + case AMF_EVT_5GMM_TIMER: + return "AMF_EVT_5GMM_TIMER"; + case AMF_EVT_5GSM_MESSAGE: + return "AMF_EVT_5GSM_MESSAGE"; + case AMF_EVT_5GSM_TIMER: + return "AMF_EVT_5GSM_TIMER"; + default: break; } diff --git a/src/amf/event.h b/src/amf/event.h index a14a81f572..c171c71d82 100644 --- a/src/amf/event.h +++ b/src/amf/event.h @@ -34,6 +34,16 @@ typedef struct ogs_sbi_message_s ogs_sbi_message_t; typedef struct ogs_sbi_nf_instance_s ogs_sbi_nf_instance_t; typedef struct ogs_sbi_subscription_s ogs_sbi_subscription_t; +typedef struct ogs_nas_5gs_message_s ogs_nas_5gs_message_t; +typedef struct NGAP_NGAP_PDU ogs_ngap_message_t; +typedef long NGAP_ProcedureCode_t; + +typedef struct amf_gnb_s amf_gnb_t; +typedef struct ran_ue_s ran_ue_t; +typedef struct amf_ue_s amf_ue_t; +typedef struct amf_sess_s amf_sess_t; +typedef struct amf_bearer_s amf_bearer_t; + typedef enum { AMF_EVT_BASE = OGS_FSM_USER_SIG, @@ -47,30 +57,20 @@ typedef enum { AMF_EVT_NGAP_LO_SCTP_COMM_UP, AMF_EVT_NGAP_LO_CONNREFUSED, + AMF_EVT_5GMM_MESSAGE, + AMF_EVT_5GMM_TIMER, + AMF_EVT_5GSM_MESSAGE, + AMF_EVT_5GSM_TIMER, + AMF_EVT_TOP, } amf_event_e; -typedef struct amf_gnb_s amf_gnb_t; -typedef struct ogs_nas_5gs_message_s ogs_nas_5gs_message_t; -typedef struct NGAP_NGAP_PDU ogs_ngap_message_t; -typedef long NGAP_ProcedureCode_t; - typedef struct amf_event_s { int id; ogs_pkbuf_t *pkbuf; int timer_id; - struct { - ogs_sock_t *sock; - ogs_sockaddr_t *addr; - uint16_t max_num_of_istreams; - uint16_t max_num_of_ostreams; - - NGAP_ProcedureCode_t code; - ogs_ngap_message_t *message; - } ngap; - struct { /* OGS_EVT_SBI_SERVER */ ogs_sbi_request_t *request; @@ -84,7 +84,28 @@ typedef struct amf_event_s { ogs_sbi_message_t *message; } sbi; + struct { + ogs_sock_t *sock; + ogs_sockaddr_t *addr; + uint16_t max_num_of_istreams; + uint16_t max_num_of_ostreams; + + NGAP_ProcedureCode_t code; + ogs_ngap_message_t *message; + } ngap; + + struct { + uint8_t type; + ogs_nas_5gs_message_t *message; + } nas; + amf_gnb_t *gnb; + ran_ue_t *ran_ue; + amf_ue_t *amf_ue; + amf_sess_t *sess; + amf_bearer_t *bearer; + + ogs_timer_t *timer; } amf_event_t; void amf_event_init(void); diff --git a/src/amf/gmm-build.c b/src/amf/gmm-build.c new file mode 100644 index 0000000000..6e21eb8215 --- /dev/null +++ b/src/amf/gmm-build.c @@ -0,0 +1,533 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "nas-security.h" +#include "gmm-build.h" +#include "amf-sm.h" + +#undef OGS_LOG_DOMAIN +#define OGS_LOG_DOMAIN __gmm_log_domain + +#if 0 +ogs_pkbuf_t *gmm_build_registration_accept( + amf_ue_t *amf_ue, ogs_pkbuf_t *esmbuf) +{ + ogs_nas_5gs_message_t message; + ogs_pkbuf_t *pkbuf = NULL; + ogs_nas_5gs_registration_accept_t *registration_accept = &message.gmm.registration_accept; + ogs_nas_5gs_registration_result_t *eps_registration_result = + ®istration_accept->eps_registration_result; + ogs_nas_gprs_timer_t *t3412_value = ®istration_accept->t3412_value; + int served_tai_index = 0; + ogs_nas_5gs_mobile_identity_t *nas_guti = ®istration_accept->guti; + ogs_nas_5gs_network_feature_support_t *eps_network_feature_support = + ®istration_accept->eps_network_feature_support; + ogs_nas_location_area_identification_t *lai = + ®istration_accept->location_area_identification; + ogs_nas_mobile_identity_t *ms_identity = ®istration_accept->ms_identity; + ogs_nas_mobile_identity_tmsi_t *tmsi = &ms_identity->tmsi;; + + ogs_assert(amf_ue); + ogs_assert(esmbuf); + + ogs_debug("Registration accept"); + + memset(&message, 0, sizeof(message)); + message.h.security_header_type = + OGS_NAS_SECURITY_HEADER_INTEGRITY_PROTECTED_AND_CIPHERED; + message.h.extended_protocol_discriminator = + OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM; + + message.gmm.h.extended_protocol_discriminator = + OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM; + message.gmm.h.message_type = OGS_NAS_5GS_REGISTRATION_ACCEPT; + + /* Set T3412 */ + eps_registration_result->result = amf_ue->nas_5gs.registration.value; + t3412_value->unit = OGS_NAS_GRPS_TIMER_UNIT_MULTIPLES_OF_DECI_HH; + t3412_value->value = 9; + + ogs_debug(" TAI[PLMN_ID:%06x,TAC:%d]", + ogs_plmn_id_hexdump(&amf_ue->tai.plmn_id), + amf_ue->tai.tac); + ogs_debug(" E_CGI[PLMN_ID:%06x,CELL_ID:%d]", + ogs_plmn_id_hexdump(&amf_ue->e_cgi.plmn_id), + amf_ue->e_cgi.cell_id); + served_tai_index = amf_find_served_tai(&amf_ue->tai); + ogs_debug(" SERVED_TAI_INDEX[%d]", served_tai_index); + ogs_assert(served_tai_index >= 0 && + served_tai_index < OGS_MAX_NUM_OF_SERVED_TAI); + ogs_nas_tai_list_build(®istration_accept->tai_list, + &amf_self()->served_tai[served_tai_index].list0, + &amf_self()->served_tai[served_tai_index].list2); + + registration_accept->esm_message_container.buffer = esmbuf->data; + registration_accept->esm_message_container.length = esmbuf->len; + + ogs_debug(" %s GUTI[G:%d,C:%d,M_TMSI:0x%x] IMSI:[%s]", + amf_ue->guti_present ? "[V]" : "[N]", + amf_ue->guti.amf_gid, amf_ue->guti.amf_code, + amf_ue->guti.m_tmsi, amf_ue->imsi_bcd); + if (amf_ue->guti_present) { + registration_accept->presencemask |= OGS_NAS_5GS_REGISTRATION_ACCEPT_GUTI_PRESENT; + nas_guti->length = sizeof(ogs_nas_5gs_mobile_identity_guti_t); + nas_guti->guti.odd_even = OGS_NAS_MOBILE_IDENTITY_EVEN; + nas_guti->guti.type = OGS_NAS_5GS_MOBILE_IDENTITY_GUTI; + nas_guti->guti.nas_plmn_id = amf_ue->guti.nas_plmn_id; + nas_guti->guti.amf_gid = amf_ue->guti.amf_gid; + nas_guti->guti.amf_code = amf_ue->guti.amf_code; + nas_guti->guti.m_tmsi = amf_ue->guti.m_tmsi; + } + amf_ue->guti_present = 0; + +#if 0 /* Need not to include T3402 */ + /* Set T3402 */ + registration_accept->presencemask |= OGS_NAS_5GS_REGISTRATION_ACCEPT_T3402_VALUE_PRESENT; + registration_accept->t3402_value.unit = OGS_NAS_GRPS_TIMER_UNIT_MULTIPLES_OF_1_MM; + registration_accept->t3402_value.value = 12; +#endif + + /* Set T3423 */ + registration_accept->presencemask |= OGS_NAS_5GS_REGISTRATION_ACCEPT_T3423_VALUE_PRESENT; + registration_accept->t3423_value.unit = OGS_NAS_GRPS_TIMER_UNIT_MULTIPLES_OF_DECI_HH; + registration_accept->t3423_value.value = 9; + registration_accept->presencemask |= + OGS_NAS_5GS_REGISTRATION_ACCEPT_EPS_NETWORK_FEATURE_SUPPORT_PRESENT; + eps_network_feature_support->length = 1; + eps_network_feature_support->ims_vops = 1; + + if (MME_P_TMSI_IS_AVAILABLE(amf_ue)) { + ogs_assert(amf_ue->csmap); + ogs_assert(amf_ue->p_tmsi); + + registration_accept->presencemask |= + OGS_NAS_5GS_REGISTRATION_ACCEPT_LOCATION_AREA_IDENTIFICATION_PRESENT; + lai->nas_plmn_id = amf_ue->csmap->lai.nas_plmn_id; + lai->lac = amf_ue->csmap->lai.lac; + ogs_debug(" LAI[PLMN_ID:%06x,LAC:%d]", + ogs_plmn_id_hexdump(&lai->nas_plmn_id), lai->lac); + + registration_accept->presencemask |= OGS_NAS_5GS_REGISTRATION_ACCEPT_MS_IDENTITY_PRESENT; + ms_identity->length = 5; + tmsi->spare = 0xf; + tmsi->odd_even = 0; + tmsi->type = OGS_NAS_MOBILE_IDENTITY_TMSI; + tmsi->tmsi = amf_ue->p_tmsi; + ogs_debug(" P-TMSI: 0x%08x", tmsi->tmsi); + } + + pkbuf = nas_5gs_security_encode(amf_ue, &message); + ogs_pkbuf_free(esmbuf); + + return pkbuf; +} +#endif + +ogs_pkbuf_t *gmm_build_registration_reject(ogs_nas_5gmm_cause_t gmm_cause) +{ + ogs_nas_5gs_message_t message; + ogs_nas_5gs_registration_reject_t *registration_reject = + &message.gmm.registration_reject; + + memset(&message, 0, sizeof(message)); + message.gmm.h.extended_protocol_discriminator = + OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM; + message.gmm.h.message_type = OGS_NAS_5GS_REGISTRATION_REJECT; + + registration_reject->gmm_cause = gmm_cause; + + return ogs_nas_5gs_plain_encode(&message); +} + +ogs_pkbuf_t *gmm_build_identity_request(amf_ue_t *amf_ue) +{ + ogs_nas_5gs_message_t message; + ogs_nas_5gs_identity_request_t *identity_request = + &message.gmm.identity_request; + + ogs_assert(amf_ue); + + memset(&message, 0, sizeof(message)); + message.gmm.h.extended_protocol_discriminator = + OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM; + message.gmm.h.message_type = OGS_NAS_5GS_IDENTITY_REQUEST; + + /* Request IMSI */ + ogs_debug(" Identity Type 2 : SUCI"); + identity_request->identity_type.value = OGS_NAS_5GS_MOBILE_IDENTITY_SUCI; + + return ogs_nas_5gs_plain_encode(&message); +} + +ogs_pkbuf_t *gmm_build_authentication_request(amf_ue_t *amf_ue) +{ + ogs_nas_5gs_message_t message; + ogs_nas_5gs_authentication_request_t *authentication_request = + &message.gmm.authentication_request; + + ogs_assert(amf_ue); + + memset(&message, 0, sizeof(message)); + message.gmm.h.extended_protocol_discriminator = + OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM; + message.gmm.h.message_type = OGS_NAS_5GS_AUTHENTICATION_REQUEST; + + authentication_request->ngksi.value = amf_ue->nas.ksi; + authentication_request->abba.length = amf_ue->abba_len; + memcpy(authentication_request->abba.value, amf_ue->abba, amf_ue->abba_len); + + authentication_request->presencemask |= + OGS_NAS_5GS_AUTHENTICATION_REQUEST_AUTHENTICATION_PARAMETER_RAND_PRESENT; + authentication_request->presencemask |= + OGS_NAS_5GS_AUTHENTICATION_REQUEST_AUTHENTICATION_PARAMETER_AUTN_PRESENT; + + memcpy(authentication_request->authentication_parameter_rand.rand, + amf_ue->rand, OGS_RAND_LEN); + memcpy(authentication_request->authentication_parameter_autn.autn, + amf_ue->autn, OGS_AUTN_LEN); + authentication_request->authentication_parameter_autn.length = + OGS_AUTN_LEN; + + return ogs_nas_5gs_plain_encode(&message); +} + +ogs_pkbuf_t *gmm_build_authentication_reject(void) +{ + ogs_nas_5gs_message_t message; + + memset(&message, 0, sizeof(message)); + + message.gmm.h.extended_protocol_discriminator = + OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM; + message.gmm.h.message_type = OGS_NAS_5GS_AUTHENTICATION_REJECT; + + return ogs_nas_5gs_plain_encode(&message); +} + +ogs_pkbuf_t *gmm_build_security_mode_command(amf_ue_t *amf_ue) +{ + ogs_nas_5gs_message_t message; + ogs_nas_5gs_security_mode_command_t *security_mode_command = + &message.gmm.security_mode_command; + ogs_nas_security_algorithms_t *selected_nas_security_algorithms = + &security_mode_command->selected_nas_security_algorithms; + ogs_nas_key_set_identifier_t *ngksi = &security_mode_command->ngksi; + ogs_nas_ue_security_capability_t *replayed_ue_security_capabilities = + &security_mode_command->replayed_ue_security_capabilities; + ogs_nas_imeisv_request_t *imeisv_request = + &security_mode_command->imeisv_request; + ogs_nas_additional_5g_security_information_t + *additional_security_information = + &security_mode_command->additional_security_information; + + ogs_assert(amf_ue); + + memset(&message, 0, sizeof(message)); + message.h.security_header_type = + OGS_NAS_SECURITY_HEADER_INTEGRITY_PROTECTED_AND_NEW_SECURITY_CONTEXT; + message.h.extended_protocol_discriminator = + OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM; + + message.gmm.h.extended_protocol_discriminator = + OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM; + message.gmm.h.message_type = OGS_NAS_5GS_SECURITY_MODE_COMMAND; + + amf_ue->selected_int_algorithm = amf_selected_int_algorithm(amf_ue); + amf_ue->selected_enc_algorithm = amf_selected_enc_algorithm(amf_ue); + + selected_nas_security_algorithms->type_of_integrity_protection_algorithm = + amf_ue->selected_int_algorithm; + selected_nas_security_algorithms->type_of_ciphering_algorithm = + amf_ue->selected_enc_algorithm; + + ngksi->tsc = 0; + ngksi->value = amf_ue->nas.ksi; + + replayed_ue_security_capabilities->nea = amf_ue->ue_security_capability.nea; + replayed_ue_security_capabilities->nia = amf_ue->ue_security_capability.nia; + replayed_ue_security_capabilities->eps_ea = + amf_ue->ue_security_capability.eps_ea; + replayed_ue_security_capabilities->eps_ia = + amf_ue->ue_security_capability.eps_ia; + + replayed_ue_security_capabilities->length = + sizeof(replayed_ue_security_capabilities->nea) + + sizeof(replayed_ue_security_capabilities->nia); + if (replayed_ue_security_capabilities->eps_ea || + replayed_ue_security_capabilities->eps_ia) + replayed_ue_security_capabilities->length = + sizeof(replayed_ue_security_capabilities->nea) + + sizeof(replayed_ue_security_capabilities->nia) + + sizeof(replayed_ue_security_capabilities->eps_ea) + + sizeof(replayed_ue_security_capabilities->eps_ia); + replayed_ue_security_capabilities->length = 8; + ogs_debug(" Replayed UE SEC[LEN:%d NEA:0x%x NIA:0x%x EEA:0x%x EIA:0x%x", + replayed_ue_security_capabilities->length, + replayed_ue_security_capabilities->nea, + replayed_ue_security_capabilities->nia, + replayed_ue_security_capabilities->eps_ea, + replayed_ue_security_capabilities->eps_ia); + ogs_debug(" Selected[Integrity:0x%x Encrypt:0x%x]", + amf_ue->selected_int_algorithm, amf_ue->selected_enc_algorithm); + + security_mode_command->presencemask |= + OGS_NAS_5GS_SECURITY_MODE_COMMAND_IMEISV_REQUEST_PRESENT; + imeisv_request->type = OGS_NAS_IMEISV_TYPE; + imeisv_request->imeisv_request_value = OGS_NAS_IMEISV_REQUESTED; + + security_mode_command->presencemask |= + OGS_NAS_5GS_SECURITY_MODE_COMMAND_ADDITIONAL_5G_SECURITY_INFORMATION_PRESENT; + additional_security_information->length = 1; + + if (amf_ue->selected_int_algorithm == OGS_NAS_SECURITY_ALGORITHMS_EIA0) { + ogs_error("Encrypt[0x%x] can be skipped with NEA0, " + "but Integrity[0x%x] cannot be bypassed with NIA0", + amf_ue->selected_enc_algorithm, amf_ue->selected_int_algorithm); + return NULL; + } + + ogs_kdf_nas_5gs(OGS_KDF_NAS_INT_ALG, amf_ue->selected_int_algorithm, + amf_ue->kamf, amf_ue->knas_int); + ogs_kdf_nas_5gs(OGS_KDF_NAS_ENC_ALG, amf_ue->selected_enc_algorithm, + amf_ue->kamf, amf_ue->knas_enc); + + return nas_5gs_security_encode(amf_ue, &message); +} + +#if 0 +ogs_pkbuf_t *gmm_build_detach_accept(amf_ue_t *amf_ue) +{ + ogs_nas_5gs_message_t message; + + ogs_assert(amf_ue); + + memset(&message, 0, sizeof(message)); + message.h.security_header_type = + OGS_NAS_SECURITY_HEADER_INTEGRITY_PROTECTED_AND_CIPHERED; + message.h.extended_protocol_discriminator = + OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM; + + ogs_debug("Detach accept"); + ogs_debug(" IMSI[%s]", amf_ue->imsi_bcd); + + message.gmm.h.extended_protocol_discriminator = + OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM; + message.gmm.h.message_type = OGS_NAS_5GS_DETACH_ACCEPT; + + return nas_5gs_security_encode(amf_ue, &message); +} + +ogs_pkbuf_t *gmm_build_tau_accept(amf_ue_t *amf_ue) +{ + ogs_nas_5gs_message_t message; + ogs_nas_5gs_tracking_area_update_accept_t *tau_accept = + &message.gmm.tracking_area_update_accept; + int served_tai_index = 0; + + amf_sess_t *sess = NULL; + + ogs_assert(amf_ue); + + memset(&message, 0, sizeof(message)); + message.h.security_header_type = + OGS_NAS_SECURITY_HEADER_INTEGRITY_PROTECTED_AND_CIPHERED; + message.h.extended_protocol_discriminator = + OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM; + + message.gmm.h.extended_protocol_discriminator = + OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM; + message.gmm.h.message_type = OGS_NAS_5GS_TRACKING_AREA_UPDATE_ACCEPT; + + tau_accept->eps_update_result.result = amf_ue->nas_5gs.update.value; + + /* Set T3412 */ + tau_accept->presencemask |= + OGS_NAS_5GS_TRACKING_AREA_UPDATE_ACCEPT_T3412_VALUE_PRESENT ; + tau_accept->t3412_value.unit = OGS_NAS_GRPS_TIMER_UNIT_MULTIPLES_OF_DECI_HH; + tau_accept->t3412_value.value = 9; + + /* Set TAI */ + tau_accept->presencemask |= + OGS_NAS_5GS_TRACKING_AREA_UPDATE_ACCEPT_TAI_LIST_PRESENT; + + ogs_debug(" TAI[PLMN_ID:%06x,TAC:%d]", + ogs_plmn_id_hexdump(&amf_ue->tai.plmn_id), + amf_ue->tai.tac); + ogs_debug(" E_CGI[PLMN_ID:%06x,CELL_ID:%d]", + ogs_plmn_id_hexdump(&amf_ue->e_cgi.plmn_id), + amf_ue->e_cgi.cell_id); + served_tai_index = amf_find_served_tai(&amf_ue->tai); + ogs_debug(" SERVED_TAI_INDEX[%d]", served_tai_index); + ogs_assert(served_tai_index >= 0 && + served_tai_index < OGS_MAX_NUM_OF_SERVED_TAI); + ogs_nas_tai_list_build(&tau_accept->tai_list, + &amf_self()->served_tai[served_tai_index].list0, + &amf_self()->served_tai[served_tai_index].list2); + + /* Set EPS bearer context status */ + tau_accept->presencemask |= + OGS_NAS_5GS_TRACKING_AREA_UPDATE_ACCEPT_EPS_BEARER_CONTEXT_STATUS_PRESENT; + tau_accept->eps_bearer_context_status.length = 2; + sess = amf_sess_first(amf_ue); + while (sess) { + amf_bearer_t *bearer = amf_bearer_first(sess); + while (bearer) { + switch (bearer->ebi) { + case 5: tau_accept->eps_bearer_context_status.ebi5 = 1; break; + case 6: tau_accept->eps_bearer_context_status.ebi6 = 1; break; + case 7: tau_accept->eps_bearer_context_status.ebi7 = 1; break; + case 8: tau_accept->eps_bearer_context_status.ebi8 = 1; break; + case 9: tau_accept->eps_bearer_context_status.ebi9 = 1; break; + case 10: tau_accept->eps_bearer_context_status.ebi10 = 1; break; + case 11: tau_accept->eps_bearer_context_status.ebi11 = 1; break; + case 12: tau_accept->eps_bearer_context_status.ebi12 = 1; break; + case 13: tau_accept->eps_bearer_context_status.ebi13 = 1; break; + case 14: tau_accept->eps_bearer_context_status.ebi14 = 1; break; + case 15: tau_accept->eps_bearer_context_status.ebi15 = 1; break; + default: break; + } + + bearer = amf_bearer_next(bearer); + } + sess = amf_sess_next(sess); + } + +#if 0 /* Need not to include T3402 */ + /* Set T3402 */ + tau_accept->presencemask |= + OGS_NAS_5GS_TRACKING_AREA_UPDATE_ACCEPT_T3402_VALUE_PRESENT; + tau_accept->t3402_value.unit = OGS_NAS_GRPS_TIMER_UNIT_MULTIPLES_OF_1_MM; + tau_accept->t3402_value.value = 12; +#endif + + /* Set T3423 */ + tau_accept->presencemask |= + OGS_NAS_5GS_TRACKING_AREA_UPDATE_ACCEPT_T3423_VALUE_PRESENT; + tau_accept->t3423_value.unit = OGS_NAS_GRPS_TIMER_UNIT_MULTIPLES_OF_DECI_HH; + tau_accept->t3423_value.value = 9; + + /* Set EPS network feature support */ + tau_accept->presencemask |= + OGS_NAS_5GS_TRACKING_AREA_UPDATE_ACCEPT_EPS_NETWORK_FEATURE_SUPPORT_PRESENT; + tau_accept->eps_network_feature_support.length = 1; + tau_accept->eps_network_feature_support.ims_vops = 1; + + return nas_5gs_security_encode(amf_ue, &message); +} + +ogs_pkbuf_t *gmm_build_tau_reject( + ogs_nas_5gmm_cause_t gmm_cause, amf_ue_t *amf_ue) +{ + ogs_nas_5gs_message_t message; + ogs_nas_5gs_tracking_area_update_reject_t *tau_reject = + &message.gmm.tracking_area_update_reject; + + ogs_assert(amf_ue); + + ogs_debug("Tracking area update reject"); + ogs_debug(" IMSI[%s] Cause[%d]", + MME_UE_HAVE_IMSI(amf_ue) ? amf_ue->imsi_bcd : "Unknown", gmm_cause); + + memset(&message, 0, sizeof(message)); + message.gmm.h.extended_protocol_discriminator = + OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM; + message.gmm.h.message_type = OGS_NAS_5GS_TRACKING_AREA_UPDATE_REJECT; + + tau_reject->gmm_cause = gmm_cause; + + return ogs_nas_5gs_plain_encode(&message); +} + +ogs_pkbuf_t *gmm_build_service_reject( + ogs_nas_5gmm_cause_t gmm_cause, amf_ue_t *amf_ue) +{ + ogs_nas_5gs_message_t message; + ogs_nas_5gs_service_reject_t *service_reject = &message.gmm.service_reject; + + ogs_assert(amf_ue); + + ogs_debug("Service reject"); + ogs_debug(" Cause[%d]", gmm_cause); + + memset(&message, 0, sizeof(message)); + message.gmm.h.extended_protocol_discriminator = + OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM; + message.gmm.h.message_type = OGS_NAS_5GS_SERVICE_REJECT; + + service_reject->gmm_cause = gmm_cause; + + return ogs_nas_5gs_plain_encode(&message); +} + +ogs_pkbuf_t *gmm_build_cs_service_notification(amf_ue_t *amf_ue) +{ + ogs_nas_5gs_message_t message; + ogs_nas_5gs_cs_service_notification_t *cs_service_notification = + &message.gmm.cs_service_notification; + ogs_nas_paging_identity_t *paging_identity = + &cs_service_notification->paging_identity; + + ogs_assert(amf_ue); + + memset(&message, 0, sizeof(message)); + message.h.security_header_type = + OGS_NAS_SECURITY_HEADER_INTEGRITY_PROTECTED_AND_CIPHERED; + message.h.extended_protocol_discriminator = + OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM; + + message.gmm.h.extended_protocol_discriminator = + OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM; + message.gmm.h.message_type = OGS_NAS_5GS_CS_SERVICE_NOTIFICATION; + + /* FIXME : Does it right to use TMSI */ + paging_identity->identity = OGS_NAS_PAGING_IDENTITY_TMSI; + ogs_debug(" Paging Identity[%d]", paging_identity->identity); + + /* FIXME : What optional filed should be included in this message? */ + + return nas_5gs_security_encode(amf_ue, &message); +} + +ogs_pkbuf_t *gmm_build_downlink_nas_transport( + amf_ue_t *amf_ue, uint8_t *buffer, uint8_t length) +{ + ogs_nas_5gs_message_t message; + ogs_nas_5gs_downlink_nas_transport_t *downlink_nas_transport = + &message.gmm.downlink_nas_transport; + ogs_nas_5gs_message_container_t *nas_message_container = + &downlink_nas_transport->nas_message_container; + + ogs_assert(amf_ue); + + memset(&message, 0, sizeof(message)); + message.h.security_header_type = + OGS_NAS_SECURITY_HEADER_INTEGRITY_PROTECTED_AND_CIPHERED; + message.h.extended_protocol_discriminator = + OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM; + + message.gmm.h.extended_protocol_discriminator = + OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM; + message.gmm.h.message_type = OGS_NAS_5GS_DOWNLINK_NAS_TRANSPORT; + + nas_message_container->length = length; + memcpy(nas_message_container->buffer, buffer, length); + + return nas_5gs_security_encode(amf_ue, &message); +} +#endif diff --git a/src/amf/gmm-build.h b/src/amf/gmm-build.h new file mode 100644 index 0000000000..9e9b756f9d --- /dev/null +++ b/src/amf/gmm-build.h @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef GMM_BUILD_H +#define GMM_BUILD_H + +#include "context.h" + +#ifdef __cplusplus +extern "C" { +#endif + +ogs_pkbuf_t *gmm_build_registration_accept( + amf_ue_t *amf_ue, ogs_pkbuf_t *esmbuf); +ogs_pkbuf_t *gmm_build_registration_reject(ogs_nas_5gmm_cause_t gmm_cause); + +ogs_pkbuf_t *gmm_build_identity_request(amf_ue_t *amf_ue); +ogs_pkbuf_t *gmm_build_security_mode_command(amf_ue_t *amf_ue); + +ogs_pkbuf_t *gmm_build_authentication_request(amf_ue_t *amf_ue); +ogs_pkbuf_t *gmm_build_authentication_reject(void); + +ogs_pkbuf_t *gmm_build_detach_accept(amf_ue_t *amf_ue); + +ogs_pkbuf_t *gmm_build_tau_accept(amf_ue_t *amf_ue); +ogs_pkbuf_t *gmm_build_tau_reject( + ogs_nas_5gmm_cause_t gmm_cause, amf_ue_t *amf_ue); + +ogs_pkbuf_t *gmm_build_service_reject( + ogs_nas_5gmm_cause_t gmm_cause, amf_ue_t *amf_ue); + +ogs_pkbuf_t *gmm_build_cs_service_notification(amf_ue_t *amf_ue); +ogs_pkbuf_t *gmm_build_downlink_nas_transport( + amf_ue_t *amf_ue, uint8_t *buffer, uint8_t length); + +#ifdef __cplusplus +} +#endif + +#endif /* GMM_BUILD_H */ diff --git a/src/amf/gmm-handler.c b/src/amf/gmm-handler.c new file mode 100644 index 0000000000..a65c3ae3c0 --- /dev/null +++ b/src/amf/gmm-handler.c @@ -0,0 +1,730 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "nas-security.h" + +#include "ngap-path.h" +#include "nas-path.h" + +#include "gmm-handler.h" +#include "sbi-path.h" + +#undef OGS_LOG_DOMAIN +#define OGS_LOG_DOMAIN __gmm_log_domain + +int gmm_handle_registration_request(amf_ue_t *amf_ue, + ogs_nas_5gs_registration_request_t *registration_request) +{ + int served_tai_index = 0; + + ran_ue_t *ran_ue = NULL; + ogs_nas_5gs_registration_type_t *registration_type = NULL; + ogs_nas_5gs_mobile_identity_t *mobile_identity = NULL; + ogs_nas_5gs_mobile_identity_header_t *mobile_identity_header = NULL; + ogs_nas_5gs_mobile_identity_guti_t *mobile_identity_guti = NULL; + ogs_nas_5gs_guti_t nas_guti; + + ogs_assert(registration_request); + registration_type = ®istration_request->registration_type; + ogs_assert(registration_type); + mobile_identity = ®istration_request->mobile_identity; + ogs_assert(mobile_identity); + mobile_identity_header = + (ogs_nas_5gs_mobile_identity_header_t *)mobile_identity->buffer; + ogs_assert(mobile_identity_header); + + ogs_assert(amf_ue); + ran_ue = amf_ue->ran_ue; + ogs_assert(ran_ue); + + switch (mobile_identity_header->type) { + case OGS_NAS_5GS_MOBILE_IDENTITY_SUCI: + amf_ue_set_suci(amf_ue, mobile_identity); + ogs_debug("[%s] SUCI", amf_ue->suci); + break; + case OGS_NAS_5GS_MOBILE_IDENTITY_GUTI: + mobile_identity_guti = + (ogs_nas_5gs_mobile_identity_guti_t *)mobile_identity->buffer; + ogs_assert(mobile_identity_guti); + + memcpy(&nas_guti.nas_plmn_id, + &mobile_identity_guti->nas_plmn_id, OGS_PLMN_ID_LEN); + memcpy(&nas_guti.amf_id, + &mobile_identity_guti->amf_id, sizeof(ogs_amf_id_t)); + nas_guti.m_tmsi = be32toh(mobile_identity_guti->m_tmsi); + + ogs_debug("[%s] 5G-S_GUTI[AMF_ID:0x%x,M_TMSI:0x%x]", + AMF_UE_HAVE_SUCI(amf_ue) ? amf_ue->suci : "Unknown ID", + ogs_amf_id_hexdump(&nas_guti.amf_id), nas_guti.m_tmsi); + break; + default: + ogs_error("Unknown SUCI type [%d]", mobile_identity_header->type); + break; + } + + + /* Set 5GS Registration Type */ + memcpy(&amf_ue->nas.registration, registration_type, + sizeof(ogs_nas_5gs_registration_type_t)); + amf_ue->nas.type = OGS_NAS_5GS_REGISTRATION_REQUEST; + amf_ue->nas.ksi = registration_type->type; + ogs_debug("[%s] OGS_NAS_5GS TYPE[%d] KSI[%d] REGISTRATION[0x%x]", + amf_ue->suci, amf_ue->nas.type, amf_ue->nas.ksi, amf_ue->nas.data); + /* + * REGISTRATION_REQUEST + * Clear EBI generator + * Clear Timer and Message + * + * TAU_REQUEST + * Clear Timer and Message + * + * SERVICE_REQUEST + * Clear Timer and Message + * + * EXTENDED_SERVICE_REQUEST + * Clear Timer and Message + */ + CLEAR_AMF_UE_ALL_TIMERS(amf_ue); + + CLEAR_5GS_BEARER_ID(amf_ue); + if (SECURITY_CONTEXT_IS_VALID(amf_ue)) { + ogs_kdf_kgnb_and_kn3iwf( + amf_ue->kamf, amf_ue->ul_count.i32, + OGS_KDF_ACCESS_TYPE_3GPP, amf_ue->kgnb); + ogs_kdf_nh_gnb(amf_ue->kamf, amf_ue->kgnb, amf_ue->nh); + amf_ue->nhcc = 1; + } + + ogs_debug("[%s] OLD TAI[PLMN_ID:%06x,TAC:%d]", amf_ue->suci, + ogs_plmn_id_hexdump(&amf_ue->tai.plmn_id), amf_ue->tai.tac.v); + ogs_debug("[%s] OLD NR_CGI[PLMN_ID:%06x,CELL_ID:0x%llx]", amf_ue->suci, + ogs_plmn_id_hexdump(&amf_ue->cgi.plmn_id), + (long long)amf_ue->cgi.cell_id); + ogs_debug("[%s] TAI[PLMN_ID:%06x,TAC:%d]", amf_ue->suci, + ogs_plmn_id_hexdump(&ran_ue->saved.tai.plmn_id), + ran_ue->saved.tai.tac.v); + ogs_debug("[%s] NR_CGI[PLMN_ID:%06x,CELL_ID:0x%llx]", amf_ue->suci, + ogs_plmn_id_hexdump(&ran_ue->saved.cgi.plmn_id), + (long long)ran_ue->saved.cgi.cell_id); + + /* Copy TAI and ECGI from ran_ue */ + memcpy(&amf_ue->tai, &ran_ue->saved.tai, sizeof(ogs_5gs_tai_t)); + memcpy(&amf_ue->cgi, &ran_ue->saved.cgi, sizeof(ogs_nr_cgi_t)); + + /* Check TAI */ + served_tai_index = amf_find_served_tai(&amf_ue->tai); + if (served_tai_index < 0) { + /* Send Registration Reject */ + ogs_warn("[%s] Cannot find Served TAI[PLMN_ID:%06x,TAC:%d]", + amf_ue->suci, + ogs_plmn_id_hexdump(&amf_ue->tai.plmn_id), amf_ue->tai.tac.v); + nas_5gs_send_registration_reject(amf_ue, + OGS_5GMM_CAUSE_TRACKING_AREA_NOT_ALLOWED); + return OGS_ERROR; + } + ogs_debug("[%s] SERVED_TAI_INDEX[%d]", amf_ue->suci, served_tai_index); + + /* Store UE specific information */ + if (registration_request->presencemask & + OGS_NAS_5GS_REGISTRATION_REQUEST_LAST_VISITED_REGISTERED_TAI_PRESENT) { + ogs_nas_5gs_tai_t *last_visited_registered_tai = + ®istration_request->last_visited_registered_tai; + + ogs_nas_to_plmn_id(&amf_ue->last_visited_plmn_id, + &last_visited_registered_tai->nas_plmn_id); + ogs_debug("[%s] Visited_PLMN_ID:%06x", amf_ue->suci, + ogs_plmn_id_hexdump(&amf_ue->last_visited_plmn_id)); + } + + if (registration_request->presencemask & + OGS_NAS_5GS_REGISTRATION_REQUEST_5GMM_CAPABILITY_PRESENT) { + ogs_nas_5gmm_capability_t *gmm_capability = + ®istration_request->gmm_capability; + + amf_ue->gmm_capability.lte_positioning_protocol_capability + = gmm_capability->lte_positioning_protocol_capability; + amf_ue->gmm_capability.ho_attach = gmm_capability->ho_attach; + amf_ue->gmm_capability.s1_mode = gmm_capability->s1_mode; + + ogs_debug("[%s] 5GMM Capability:[LPP:%d, HO_ATTACH:%d, S1_MODE:%d]", + amf_ue->suci, + amf_ue->gmm_capability.lte_positioning_protocol_capability, + amf_ue->gmm_capability.ho_attach, + amf_ue->gmm_capability.s1_mode); + } + + if (registration_request->presencemask & + OGS_NAS_5GS_REGISTRATION_REQUEST_UE_SECURITY_CAPABILITY_PRESENT) { + memcpy(&amf_ue->ue_security_capability, + ®istration_request->ue_security_capability, + ogs_min(sizeof(amf_ue->ue_security_capability), + registration_request->ue_security_capability.length)); + } + + if (amf_selected_int_algorithm(amf_ue) == + OGS_NAS_SECURITY_ALGORITHMS_NIA0) { + ogs_warn("[%s] NEA0 can be used in Encrypt[0x%x], " + "but Integrity[0x%x] cannot be bypassed with NIA0", amf_ue->suci, + amf_selected_enc_algorithm(amf_ue), + amf_selected_int_algorithm(amf_ue)); + nas_5gs_send_registration_reject(amf_ue, + OGS_5GMM_CAUSE_UE_SECURITY_CAPABILITIES_MISMATCH); + return OGS_ERROR; + } + + return OGS_OK; +} + +int gmm_handle_authentication_response(amf_ue_t *amf_ue, + ogs_nas_5gs_authentication_response_t *authentication_response) +{ + int rv; + ogs_nas_authentication_response_parameter_t + *authentication_response_parameter = NULL; + uint8_t hxres_star[OGS_MAX_RES_LEN]; + + ogs_assert(amf_ue); + ogs_assert(authentication_response); + + authentication_response_parameter = &authentication_response-> + authentication_response_parameter; + + ogs_debug("[%s] Authentication response", amf_ue->suci); + + CLEAR_AMF_UE_TIMER(amf_ue->t3560); + + if (authentication_response_parameter->length != OGS_MAX_RES_LEN) { + ogs_error("[%s] Invalid length [%d]", + amf_ue->suci, authentication_response_parameter->length); + return OGS_ERROR; + } + + ogs_kdf_hxres_star( + amf_ue->rand, authentication_response_parameter->res, hxres_star); + + if (memcmp(hxres_star, amf_ue->hxres_star, OGS_MAX_RES_LEN) != 0) { + ogs_log_hexdump(OGS_LOG_WARN, + authentication_response_parameter->res, + authentication_response_parameter->length); + ogs_log_hexdump(OGS_LOG_WARN, hxres_star, OGS_MAX_RES_LEN); + ogs_log_hexdump(OGS_LOG_WARN, + amf_ue->hxres_star, OGS_MAX_RES_LEN); + return OGS_ERROR; + } + + memcpy(amf_ue->xres_star, authentication_response_parameter->res, + authentication_response_parameter->length); + + rv = amf_nausf_auth_discover_and_send_authenticate(amf_ue); + if (rv == OGS_ERROR) { + ogs_error("[%s] Cannot send SBI message", amf_ue->suci); + return OGS_ERROR; + } + + return OGS_OK; +} + +#if 0 +int gmm_handle_registration_complete(amf_ue_t *amf_ue, + ogs_nas_5gs_registration_complete_t *registration_complete) +{ + int rv; + ogs_pkbuf_t *gmmbuf = NULL; + + ogs_nas_5gs_message_t message; + ogs_nas_5gs_gmm_information_t *gmm_information = + &message.gmm.gmm_information; + ogs_nas_time_zone_and_time_t *universal_time_and_local_time_zone = + &gmm_information->universal_time_and_local_time_zone; + ogs_nas_daylight_saving_time_t *network_daylight_saving_time = + &gmm_information->network_daylight_saving_time; + + struct timeval tv; + struct tm gmt, local; + + ogs_gettimeofday(&tv); + ogs_gmtime(tv.tv_sec, &gmt); + ogs_localtime(tv.tv_sec, &local); + + ogs_assert(amf_ue); + + ogs_debug(" GMT Time[Y:M:D H:M:S GMT] - %d:%d:%d, %d:%d:%d, %d", + gmt.tm_year, gmt.tm_mon, gmt.tm_mday, + gmt.tm_hour, gmt.tm_min, gmt.tm_sec, + (int)gmt.tm_gmtoff); + ogs_debug(" LOCAL Time[Y:M:D H:M:S GMT] - %d:%d:%d, %d:%d:%d, %d", + local.tm_year, local.tm_mon, local.tm_mday, + local.tm_hour, local.tm_min, local.tm_sec, + (int)local.tm_gmtoff); + + rv = nas_5gs_send_gmm_to_esm( + amf_ue, ®istration_complete->esm_message_container); + if (rv != OGS_OK) { + ogs_error("nas_5gs_send_gmm_to_esm() failed"); + return OGS_ERROR; + } + + memset(&message, 0, sizeof(message)); + message.h.security_header_type = + OGS_NAS_SECURITY_HEADER_INTEGRITY_PROTECTED_AND_CIPHERED; + message.h.protocol_discriminator = OGS_NAS_PROTOCOL_DISCRIMINATOR_EMM; + + message.gmm.h.protocol_discriminator = OGS_NAS_PROTOCOL_DISCRIMINATOR_EMM; + message.gmm.h.message_type = OGS_NAS_5GS_EMM_INFORMATION; + + gmm_information->presencemask |= + OGS_NAS_5GS_EMM_INFORMATION_UNIVERSAL_TIME_AND_LOCAL_TIME_ZONE_PRESENT; + universal_time_and_local_time_zone->year = + OGS_OGS_NAS_TIME_TO_BCD(gmt.tm_year % 100); + universal_time_and_local_time_zone->mon = + OGS_OGS_NAS_TIME_TO_BCD(gmt.tm_mon+1); + universal_time_and_local_time_zone->mday = + OGS_OGS_NAS_TIME_TO_BCD(gmt.tm_mday); + universal_time_and_local_time_zone->hour = + OGS_OGS_NAS_TIME_TO_BCD(gmt.tm_hour); + universal_time_and_local_time_zone->min = + OGS_OGS_NAS_TIME_TO_BCD(gmt.tm_min); + universal_time_and_local_time_zone->sec = + OGS_OGS_NAS_TIME_TO_BCD(gmt.tm_sec); + if (local.tm_gmtoff >= 0) { + universal_time_and_local_time_zone->timezone = + OGS_OGS_NAS_TIME_TO_BCD(local.tm_gmtoff / 900); + } else { + universal_time_and_local_time_zone->timezone = + OGS_OGS_NAS_TIME_TO_BCD((-local.tm_gmtoff) / 900); + universal_time_and_local_time_zone->timezone |= 0x08; + } + ogs_debug(" Timezone:0x%x", + universal_time_and_local_time_zone->timezone); + + gmm_information->presencemask |= + OGS_NAS_5GS_EMM_INFORMATION_NETWORK_DAYLIGHT_SAVING_TIME_PRESENT; + network_daylight_saving_time->length = 1; + + if (amf_self()->full_name.length) { + gmm_information->presencemask |= + OGS_NAS_5GS_EMM_INFORMATION_FULL_NAME_FOR_NETWORK_PRESENT; + memcpy(&gmm_information->full_name_for_network, + &amf_self()->full_name, sizeof(ogs_nas_network_name_t)); + } + + if (amf_self()->short_name.length) { + gmm_information->presencemask |= + OGS_NAS_5GS_EMM_INFORMATION_SHORT_NAME_FOR_NETWORK_PRESENT; + memcpy(&gmm_information->short_name_for_network, + &amf_self()->short_name, sizeof(ogs_nas_network_name_t)); + } + + gmmbuf = nas_5gs_security_encode(amf_ue, &message); + if (gmmbuf) + nas_5gs_send_to_downlink_nas_transport(amf_ue, gmmbuf); + + ogs_debug("[EMM] EMM information"); + ogs_debug(" IMSI[%s]", amf_ue->imsi_bcd); + + return OGS_OK; +} + +int gmm_handle_identity_response(amf_ue_t *amf_ue, + ogs_nas_5gs_identity_response_t *identity_response) +{ + ogs_nas_mobile_identity_t *mobile_identity = NULL; + ran_ue_t *ran_ue = NULL; + + ogs_assert(identity_response); + + ogs_assert(amf_ue); + ran_ue = amf_ue->ran_ue; + ogs_assert(ran_ue); + + mobile_identity = &identity_response->mobile_identity; + + if (mobile_identity->imsi.type == OGS_NAS_IDENTITY_TYPE_2_IMSI) { + char imsi_bcd[OGS_MAX_IMSI_BCD_LEN+1]; + + if (sizeof(ogs_nas_mobile_identity_imsi_t) != mobile_identity->length) { + ogs_error("mobile_identity length (%d != %d)", + (int)sizeof(ogs_nas_mobile_identity_imsi_t), + mobile_identity->length); + return OGS_ERROR; + } + memcpy(&amf_ue->nas_mobile_identity_imsi, + &mobile_identity->imsi, mobile_identity->length); + ogs_nas_imsi_to_bcd( + &mobile_identity->imsi, mobile_identity->length, imsi_bcd); + amf_ue_set_imsi(amf_ue, imsi_bcd); + + if (amf_ue->imsi_len != OGS_MAX_IMSI_LEN) { + ogs_error("Invalid IMSI LEN[%d]", amf_ue->imsi_len); + return OGS_ERROR; + } + } else { + ogs_warn("Not supported Identity type[%d]", mobile_identity->imsi.type); + } + + return OGS_OK; +} + +int gmm_handle_deregistration_request(amf_ue_t *amf_ue, + ogs_nas_5gs_deregistration_request_from_ue_t *deregistration_request) +{ + ogs_nas_deregistration_type_t *deregistration_type = NULL; + + ogs_assert(deregistration_request); + ogs_assert(amf_ue); + + deregistration_type = &deregistration_request->deregistration_type; + + /* Set 5GS Attach Type */ + memcpy(&amf_ue->nas.deregistration, deregistration_type, sizeof(ogs_nas_deregistration_type_t)); + amf_ue->nas.type = AMF_5GS_TYPE_DETACH_REQUEST_FROM_UE; + amf_ue->nas.ksi = deregistration_type->nas_key_set_identifier; + ogs_debug(" OGS_NAS_5GS TYPE[%d] KSI[%d] DETACH[0x%x]", + amf_ue->nas.type, amf_ue->nas.ksi, amf_ue->nas.data); + + switch (deregistration_request->deregistration_type.value) { + /* 0 0 1 : 5GS deregistration */ + case OGS_NAS_DETACH_TYPE_FROM_UE_5GS_DETACH: + ogs_debug(" 5GS Detach"); + break; + /* 0 1 0 : IMSI deregistration */ + case OGS_NAS_DETACH_TYPE_FROM_UE_IMSI_DETACH: + ogs_debug(" IMSI Detach"); + break; + case 6: /* 1 1 0 : reserved */ + case 7: /* 1 1 1 : reserved */ + ogs_warn("Unknown Detach type[%d]", + deregistration_request->deregistration_type.value); + break; + /* 0 1 1 : combined 5GS/IMSI deregistration */ + case OGS_NAS_DETACH_TYPE_FROM_UE_COMBINED_5GS_IMSI_DETACH: + ogs_debug(" Combined 5GS/IMSI Detach"); + default: /* all other values */ + break; + } + if (deregistration_request->deregistration_type.switch_off) + ogs_debug(" Switch-Off"); + + return OGS_OK; +} + +int gmm_handle_service_request(amf_ue_t *amf_ue, + ogs_nas_5gs_service_request_t *service_request) +{ + ogs_nas_ksi_and_sequence_number_t *ksi_and_sequence_number = + &service_request->ksi_and_sequence_number; + + ogs_assert(amf_ue); + + /* Set 5GS Update Type */ + amf_ue->nas.type = AMF_5GS_TYPE_SERVICE_REQUEST; + amf_ue->nas.ksi = ksi_and_sequence_number->ksi; + ogs_debug(" OGS_NAS_5GS TYPE[%d] KSI[%d]", + amf_ue->nas.type, amf_ue->nas.ksi); + + /* + * REGISTRATION_REQUEST + * Clear EBI generator + * Clear Timer and Message + * + * TAU_REQUEST + * Clear Timer and Message + * + * SERVICE_REQUEST + * Clear Timer and Message + * + * EXTENDED_SERVICE_REQUEST + * Clear Timer and Message + */ + CLEAR_AMF_UE_ALL_TIMERS(amf_ue); + + if (SECURITY_CONTEXT_IS_VALID(amf_ue)) { + ogs_kdf_kgnb_and_kn3iwf( + amf_ue->kamf, amf_ue->ul_count.i32, + OGS_KDF_ACCESS_TYPE_3GPP, amf_ue->kgnb); + ogs_kdf_nh_gnb(amf_ue->kamf, amf_ue->kgnb, amf_ue->nh); + amf_ue->nhcc = 1; + } + + ogs_debug(" GUTI[G:%d,C:%d,M_TMSI:0x%x] IMSI[%s]", + amf_ue->guti.amf_gid, + amf_ue->guti.amf_code, + amf_ue->guti.m_tmsi, + AMF_UE_HAVE_IMSI(amf_ue) ? amf_ue->imsi_bcd : "Unknown"); + + return OGS_OK; +} + +int gmm_handle_tau_request(amf_ue_t *amf_ue, + ogs_nas_5gs_tracking_area_update_request_t *tau_request) +{ + int served_tai_index = 0; + + ogs_nas_5gs_mobile_identity_guti_t *5gs_mobile_identity_guti = NULL; + ogs_nas_5gs_guti_t nas_guti; + + ogs_nas_5gs_update_type_t *5gs_update_type = + &tau_request->5gs_update_type; + ogs_nas_5gs_mobile_identity_t *5gs_mobile_identity = + &tau_request->old_guti; + ran_ue_t *ran_ue = NULL; + + ogs_assert(amf_ue); + ran_ue = amf_ue->ran_ue; + ogs_assert(ran_ue); + + /* Set 5GS Update Type */ + memcpy(&amf_ue->nas.update, 5gs_update_type, + sizeof(ogs_nas_5gs_update_type_t)); + amf_ue->nas.type = AMF_5GS_TYPE_TAU_REQUEST; + amf_ue->nas.ksi = 5gs_update_type->nas_key_set_identifier; + ogs_debug(" OGS_NAS_5GS TYPE[%d] KSI[%d] UPDATE[0x%x]", + amf_ue->nas.type, amf_ue->nas.ksi, + amf_ue->nas.data); + + /* + * REGISTRATION_REQUEST + * Clear EBI generator + * Clear Timer and Message + * + * TAU_REQUEST + * Clear Timer and Message + * + * SERVICE_REQUEST + * Clear Timer and Message + * + * EXTENDED_SERVICE_REQUEST + * Clear Timer and Message + */ + CLEAR_AMF_UE_ALL_TIMERS(amf_ue); + + CLEAR_SERVICE_INDICATOR(amf_ue); + if (BEARER_CONTEXT_IS_ACTIVE(amf_ue)) + ogs_debug(" Bearer-Active"); + else + ogs_debug(" Bearer-Inactive"); + + if (amf_ue->nas.update.active_flag) + ogs_debug(" Active flag"); + else + ogs_debug(" No Active flag"); + + ogs_debug(" OLD TAI[PLMN_ID:%06x,TAC:%d]", + ogs_plmn_id_hexdump(&amf_ue->tai.plmn_id), amf_ue->tai.tac); + ogs_debug(" OLD NR_CGI[PLMN_ID:%06x,CELL_ID:%d]", + ogs_plmn_id_hexdump(&amf_ue->e_cgi.plmn_id), amf_ue->e_cgi.cell_id); + ogs_debug(" TAI[PLMN_ID:%06x,TAC:%d]", + ogs_plmn_id_hexdump(&ran_ue->saved.tai.plmn_id), + ran_ue->saved.tai.tac); + ogs_debug(" NR_CGI[PLMN_ID:%06x,CELL_ID:%d]", + ogs_plmn_id_hexdump(&ran_ue->saved.e_cgi.plmn_id), + ran_ue->saved.e_cgi.cell_id); + + /* Copy TAI and ECGI from ran_ue */ + memcpy(&amf_ue->tai, &ran_ue->saved.tai, sizeof(ogs_5gs_tai_t)); + memcpy(&amf_ue->e_cgi, &ran_ue->saved.e_cgi, sizeof(ogs_e_cgi_t)); + + /* Check TAI */ + served_tai_index = amf_find_served_tai(&amf_ue->tai); + if (served_tai_index < 0) { + /* Send TAU reject */ + ogs_warn("Cannot find Served TAI[PLMN_ID:%06x,TAC:%d]", + ogs_plmn_id_hexdump(&amf_ue->tai.plmn_id), amf_ue->tai.tac); + nas_5gs_send_tau_reject(amf_ue, EMM_CAUSE_TRACKING_AREA_NOT_ALLOWED); + return OGS_ERROR; + } + ogs_debug(" SERVED_TAI_INDEX[%d]", served_tai_index); + + /* Store UE specific information */ + if (tau_request->presencemask & + OGS_NAS_5GS_TRACKING_AREA_UPDATE_REQUEST_LAST_VISITED_REGISTERED_TAI_PRESENT) { + ogs_nas_5gs_tai_t *last_visited_registered_tai = + &tau_request->last_visited_registered_tai; + + ogs_nas_to_plmn_id(&amf_ue->last_visited_plmn_id, + &last_visited_registered_tai->nas_plmn_id); + ogs_debug(" Visited_PLMN_ID:%06x", + ogs_plmn_id_hexdump(&amf_ue->last_visited_plmn_id)); + } + + if (tau_request->presencemask & + OGS_NAS_5GS_TRACKING_AREA_UPDATE_REQUEST_UE_NETWORK_CAPABILITY_PRESENT) { + memcpy(&amf_ue->ue_network_capability, + &tau_request->ue_network_capability, + sizeof(tau_request->ue_network_capability)); + } + + if (tau_request->presencemask & + OGS_NAS_5GS_TRACKING_AREA_UPDATE_REQUEST_MS_NETWORK_CAPABILITY_PRESENT) { + memcpy(&amf_ue->ms_network_capability, + &tau_request->ms_network_capability, + sizeof(tau_request->ms_network_capability)); + } + + /* TODO: + * 1) Consider if AMF is changed or not. + * 2) Consider if SGW is changed or not. + */ + switch (5gs_mobile_identity->imsi.type) { + case OGS_NAS_5GS_MOBILE_IDENTITY_GUTI: + 5gs_mobile_identity_guti = &5gs_mobile_identity->guti; + + nas_guti.nas_plmn_id = 5gs_mobile_identity_guti->nas_plmn_id; + nas_guti.amf_gid = 5gs_mobile_identity_guti->amf_gid; + nas_guti.amf_code = 5gs_mobile_identity_guti->amf_code; + nas_guti.m_tmsi = 5gs_mobile_identity_guti->m_tmsi; + + ogs_debug(" GUTI[G:%d,C:%d,M_TMSI:0x%x] IMSI:[%s]", + nas_guti.amf_gid, + nas_guti.amf_code, + nas_guti.m_tmsi, + AMF_UE_HAVE_IMSI(amf_ue) + ? amf_ue->imsi_bcd : "Unknown"); + break; + default: + ogs_warn("Not implemented[%d]", + 5gs_mobile_identity->imsi.type); + + return OGS_OK; + } + + return OGS_OK; +} + +int gmm_handle_extended_service_request(amf_ue_t *amf_ue, + ogs_nas_5gs_extended_service_request_t *extended_service_request) +{ + int served_tai_index = 0; + + ogs_nas_service_type_t *service_type = + &extended_service_request->service_type; + ogs_nas_mobile_identity_t *mobile_identity = + &extended_service_request->m_tmsi; + ogs_nas_mobile_identity_tmsi_t *mobile_identity_tmsi = NULL; + ran_ue_t *ran_ue = NULL; + + ogs_assert(amf_ue); + ran_ue = amf_ue->ran_ue; + ogs_assert(ran_ue); + + /* Set Service Type */ + memcpy(&amf_ue->nas.service, service_type, + sizeof(ogs_nas_service_type_t)); + amf_ue->nas.type = AMF_5GS_TYPE_EXTENDED_SERVICE_REQUEST; + amf_ue->nas.ksi = service_type->nas_key_set_identifier; + ogs_debug(" OGS_NAS_5GS TYPE[%d] KSI[%d] SERVICE[0x%x]", + amf_ue->nas.type, amf_ue->nas.ksi, amf_ue->nas.value); + + /* + * REGISTRATION_REQUEST + * Clear EBI generator + * Clear Timer and Message + * + * TAU_REQUEST + * Clear Timer and Message + * + * SERVICE_REQUEST + * Clear Timer and Message + * + * EXTENDED_SERVICE_REQUEST + * Clear Timer and Message + */ + CLEAR_AMF_UE_ALL_TIMERS(amf_ue); + + ogs_debug(" OLD TAI[PLMN_ID:%06x,TAC:%d]", + ogs_plmn_id_hexdump(&amf_ue->tai.plmn_id), amf_ue->tai.tac); + ogs_debug(" OLD NR_CGI[PLMN_ID:%06x,CELL_ID:%d]", + ogs_plmn_id_hexdump(&amf_ue->e_cgi.plmn_id), amf_ue->e_cgi.cell_id); + ogs_debug(" TAI[PLMN_ID:%06x,TAC:%d]", + ogs_plmn_id_hexdump(&ran_ue->saved.tai.plmn_id), + ran_ue->saved.tai.tac); + ogs_debug(" NR_CGI[PLMN_ID:%06x,CELL_ID:%d]", + ogs_plmn_id_hexdump(&ran_ue->saved.e_cgi.plmn_id), + ran_ue->saved.e_cgi.cell_id); + + /* Copy TAI and ECGI from ran_ue */ + memcpy(&amf_ue->tai, &ran_ue->saved.tai, sizeof(ogs_5gs_tai_t)); + memcpy(&amf_ue->e_cgi, &ran_ue->saved.e_cgi, sizeof(ogs_e_cgi_t)); + + /* Check TAI */ + served_tai_index = amf_find_served_tai(&amf_ue->tai); + if (served_tai_index < 0) { + /* Send TAU reject */ + ogs_warn("Cannot find Served TAI[PLMN_ID:%06x,TAC:%d]", + ogs_plmn_id_hexdump(&amf_ue->tai.plmn_id), amf_ue->tai.tac); + nas_5gs_send_tau_reject(amf_ue, EMM_CAUSE_TRACKING_AREA_NOT_ALLOWED); + return OGS_ERROR; + } + ogs_debug(" SERVED_TAI_INDEX[%d]", served_tai_index); + + switch(mobile_identity->tmsi.type) { + case OGS_NAS_MOBILE_IDENTITY_TMSI: + mobile_identity_tmsi = &mobile_identity->tmsi; + + ogs_debug(" M-TMSI:[0x%x] IMSI:[%s]", + mobile_identity_tmsi->tmsi, + AMF_UE_HAVE_IMSI(amf_ue) ? amf_ue->imsi_bcd : "Unknown"); + break; + default: + ogs_error("Unknown TMSI type [%d]", mobile_identity->tmsi.type); + break; + } + + return OGS_OK; +} +#endif + +int gmm_handle_security_mode_complete(amf_ue_t *amf_ue, + ogs_nas_5gs_security_mode_complete_t *security_mode_complete) +{ + ogs_nas_5gs_mobile_identity_t *imeisv = NULL; + ogs_nas_mobile_identity_imeisv_t *mobile_identity_imeisv = NULL; + + ogs_assert(amf_ue); + ogs_assert(security_mode_complete); + + if (security_mode_complete->presencemask & + OGS_NAS_5GS_SECURITY_MODE_COMMAND_IMEISV_REQUEST_PRESENT) { + + imeisv = &security_mode_complete->imeisv; + ogs_assert(imeisv); + mobile_identity_imeisv = + (ogs_nas_mobile_identity_imeisv_t *)imeisv->buffer; + ogs_assert(mobile_identity_imeisv); + + switch (mobile_identity_imeisv->type) { + case OGS_NAS_5GS_MOBILE_IDENTITY_IMEISV: + memcpy(&amf_ue->nas_mobile_identity_imeisv, + mobile_identity_imeisv, imeisv->length); + ogs_nas_imeisv_to_bcd(mobile_identity_imeisv, imeisv->length, + amf_ue->imeisv_bcd); + ogs_bcd_to_buffer(amf_ue->imeisv_bcd, + amf_ue->imeisv, &amf_ue->imeisv_len); + amf_ue->imeisv_presence = true; + break; + default: + ogs_warn("[%s] Invalid IMEISV Type [%d]", + amf_ue->supi, mobile_identity_imeisv->type); + break; + + } + } + + return OGS_OK; +} diff --git a/src/amf/gmm-handler.h b/src/amf/gmm-handler.h new file mode 100644 index 0000000000..5dadae59bd --- /dev/null +++ b/src/amf/gmm-handler.h @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef GMM_HANDLER_H +#define GMM_HANDLER_H + +#include "context.h" + +#ifdef __cplusplus +extern "C" { +#endif + +int gmm_handle_registration_request(amf_ue_t *amf_ue, + ogs_nas_5gs_registration_request_t *registration_request); +int gmm_handle_authentication_response(amf_ue_t *amf_ue, + ogs_nas_5gs_authentication_response_t *authentication_response); +#if 0 +int gmm_handle_registration_complete(amf_ue_t *amf_ue, + ogs_nas_5gs_registration_complete_t *registration_complete); + +int gmm_handle_identity_response(amf_ue_t *amf_ue, + ogs_nas_5gs_identity_response_t *identity_response); + +int gmm_handle_deregistration_request(amf_ue_t *amf_ue, + ogs_nas_5gs_deregistration_request_from_ue_t *deregistration_request); + +int gmm_handle_service_request(amf_ue_t *amf_ue, + ogs_nas_5gs_service_request_t *service_request); + +int gmm_handle_tau_request(amf_ue_t *amf_ue, + ogs_nas_5gs_tracking_area_update_request_t *tau_request); + +int gmm_handle_extended_service_request(amf_ue_t *amf_ue, + ogs_nas_5gs_extended_service_request_t *extended_service_request); +#endif + +int gmm_handle_security_mode_complete(amf_ue_t *amf_ue, + ogs_nas_5gs_security_mode_complete_t *security_mode_complete); + +#ifdef __cplusplus +} +#endif + +#endif /* GMM_HANDLER_H */ diff --git a/src/amf/gmm-sm.c b/src/amf/gmm-sm.c new file mode 100644 index 0000000000..c777c5f075 --- /dev/null +++ b/src/amf/gmm-sm.c @@ -0,0 +1,1009 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "ngap-handler.h" +#include "gmm-handler.h" +#include "gmm-build.h" +#if 0 +#include "gsm-handler.h" +#endif +#include "nas-path.h" +#include "nas-security.h" +#include "ngap-path.h" +#if 0 +#include "sgsap-types.h" +#include "sgsap-path.h" +#include "amf-path.h" +#endif +#include "nausf-handler.h" +#include "sbi-path.h" +#include "amf-sm.h" + +#undef OGS_LOG_DOMAIN +#define OGS_LOG_DOMAIN __gmm_log_domain + +void gmm_state_initial(ogs_fsm_t *s, amf_event_t *e) +{ + ogs_assert(s); + + amf_sm_debug(e); + + OGS_FSM_TRAN(s, &gmm_state_de_registered); +} + +void gmm_state_final(ogs_fsm_t *s, amf_event_t *e) +{ + ogs_assert(s); + + amf_sm_debug(e); +} + +static void common_register_state(ogs_fsm_t *s, amf_event_t *e); + +void gmm_state_de_registered(ogs_fsm_t *s, amf_event_t *e) +{ + amf_ue_t *amf_ue = NULL; + ogs_assert(s); + ogs_assert(e); + + amf_sm_debug(e); + + amf_ue = e->amf_ue; + ogs_assert(amf_ue); + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + CLEAR_AMF_UE_ALL_TIMERS(amf_ue); + break; + case OGS_FSM_EXIT_SIG: + break; + default: + break; + } + + common_register_state(s, e); +} + +void gmm_state_registered(ogs_fsm_t *s, amf_event_t *e) +{ + ogs_assert(s); + ogs_assert(e); + + amf_sm_debug(e); + + common_register_state(s, e); +} + +static void common_register_state(ogs_fsm_t *s, amf_event_t *e) +{ + int rv; + + amf_ue_t *amf_ue = NULL; + ran_ue_t *ran_ue = NULL; + ogs_nas_5gs_message_t *message = NULL; +#if 0 + NGAP_ProcedureCode_t procedureCode; +#endif + + ogs_assert(e); + + amf_ue = e->amf_ue; + ogs_assert(amf_ue); + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + return; + case OGS_FSM_EXIT_SIG: + return; + case AMF_EVT_5GMM_MESSAGE: + message = e->nas.message; + ogs_assert(message); + + ran_ue = amf_ue->ran_ue; + ogs_assert(ran_ue); + +#if 0 + if (message->gmm.h.security_header_type + == OGS_NAS_SECURITY_HEADER_FOR_SERVICE_REQUEST_MESSAGE) { + ogs_debug("Service request"); + rv = gmm_handle_service_request( + amf_ue, &message->gmm.service_request); + if (rv != OGS_OK) { + ogs_error("gmm_handle_service_request() failed"); + OGS_FSM_TRAN(s, gmm_state_exception); + return; + } + + if (!AMF_UE_HAVE_IMSI(amf_ue)) { + ogs_warn("Service request : Unknown UE"); + nas_5gs_send_service_reject(amf_ue, + GMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK); + OGS_FSM_TRAN(s, &gmm_state_exception); + return; + } + + if (!SECURITY_CONTEXT_IS_VALID(amf_ue)) { + ogs_warn("No Security Context : IMSI[%s]", amf_ue->imsi_bcd); + nas_5gs_send_service_reject(amf_ue, + GMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK); + OGS_FSM_TRAN(s, &gmm_state_exception); + return; + } + + if (!SESSION_CONTEXT_IS_AVAILABLE(amf_ue)) { + ogs_warn("No Session Context : IMSI[%s]", amf_ue->imsi_bcd); + nas_5gs_send_service_reject(amf_ue, + GMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK); + OGS_FSM_TRAN(s, &gmm_state_exception); + return; + } + + ngap_send_initial_context_setup_request(amf_ue); + return; + } +#endif + + switch (message->gmm.h.message_type) { +#if 0 + case OGS_NAS_5GS_IDENTITY_RESPONSE: + ogs_debug("Identity response"); + CLEAR_AMF_UE_TIMER(amf_ue->t3570); + + rv = gmm_handle_identity_response(amf_ue, + &message->gmm.identity_response); + if (rv != OGS_OK) { + ogs_error("gmm_handle_identity_response() failed"); + OGS_FSM_TRAN(s, gmm_state_exception); + return; + } + + if (!AMF_UE_HAVE_IMSI(amf_ue)) { + ogs_error("No IMSI"); + OGS_FSM_TRAN(s, gmm_state_exception); + return; + } + + ogs_debug(" IMSI[%s]", amf_ue->imsi_bcd); + break; +#endif + case OGS_NAS_5GS_REGISTRATION_REQUEST: + ogs_debug("Registration request[%s]", amf_ue->imsi_bcd); + rv = gmm_handle_registration_request( + amf_ue, &message->gmm.registration_request); + if (rv != OGS_OK) { + ogs_error("gmm_handle_registration_request() failed"); + OGS_FSM_TRAN(s, gmm_state_exception); + return; + } + break; +#if 0 + case OGS_NAS_5GS_TRACKING_AREA_UPDATE_REQUEST: + ogs_debug("Tracking area update request"); + rv = gmm_handle_tau_request( + amf_ue, &message->gmm.tracking_area_update_request); + if (rv != OGS_OK) { + ogs_error("gmm_handle_tau_request() failed"); + OGS_FSM_TRAN(s, gmm_state_exception); + return; + } + + if (!AMF_UE_HAVE_IMSI(amf_ue)) { + ogs_warn("TAU request : Unknown UE"); + nas_5gs_send_tau_reject(amf_ue, + GMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK); + OGS_FSM_TRAN(s, &gmm_state_exception); + return; + } + + break; + case OGS_NAS_5GS_TRACKING_AREA_UPDATE_COMPLETE: + ogs_debug("Tracking area update complete"); + ogs_debug(" IMSI[%s]", amf_ue->imsi_bcd); + return; + case OGS_NAS_5GS_EXTENDED_SERVICE_REQUEST: + ogs_debug("Extended service request"); + rv = gmm_handle_extended_service_request( + amf_ue, &message->gmm.extended_service_request); + if (rv != OGS_OK) { + ogs_error("gmm_handle_extended_service_request() failed"); + OGS_FSM_TRAN(s, gmm_state_exception); + return; + } + + if (!AMF_UE_HAVE_IMSI(amf_ue)) { + ogs_warn("Extended Service request : Unknown UE"); + nas_5gs_send_service_reject(amf_ue, + GMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK); + OGS_FSM_TRAN(s, &gmm_state_exception); + return; + } + + break; + case OGS_NAS_5GS_5GMM_STATUS: + ogs_warn("5GMM STATUS : IMSI[%s] Cause[%d]", + amf_ue->imsi_bcd, + message->gmm.gmm_status.gmm_cause); + OGS_FSM_TRAN(s, &gmm_state_exception); + return; + case OGS_NAS_5GS_DEREGISTRATION_REQUEST: + ogs_debug("Deregistration request"); + ogs_debug(" IMSI[%s]", amf_ue->imsi_bcd); + rv = gmm_handle_deregistration_request( + amf_ue, &message->gmm.deregistration_request_from_ue); + if (rv != OGS_OK) + { + ogs_error("gmm_handle_registration_request() failed"); + OGS_FSM_TRAN(s, gmm_state_exception); + return; + } + + if (AMF_P_TMSI_IS_AVAILABLE(amf_ue)) { + sgsap_send_deregistration_indication(amf_ue); + } else { + amf_send_delete_session_or_deregistration(amf_ue); + } + + OGS_FSM_TRAN(s, &gmm_state_de_registered); + return; + case OGS_NAS_5GS_UPLINK_NAS_TRANSPORT: + ogs_debug("Uplink NAS Transport"); + ogs_debug(" IMSI[%s]", amf_ue->imsi_bcd); + if (AMF_SGSAP_IS_CONNECTED(amf_ue)) { + sgsap_send_uplink_unitdata(amf_ue, &message->gmm. + uplink_nas_transport.nas_message_container); + } else { + NGAP_AMF_UE_NGAP_ID_t AMF_UE_NGAP_ID; + NGAP_ENB_UE_NGAP_ID_t ENB_UE_NGAP_ID; + + ogs_warn("No connection of MSC/VLR"); + AMF_UE_NGAP_ID = ran_ue->amf_ue_ngap_id; + ENB_UE_NGAP_ID = ran_ue->ran_ue_ngap_id; + + ngap_send_error_indication(ran_ue->gnb, + &AMF_UE_NGAP_ID, &ENB_UE_NGAP_ID, + NGAP_Cause_PR_transport, + NGAP_CauseTransport_transport_resource_unavailable); + } + + return; +#endif + default: + ogs_warn("Unknown message[%d]", message->gmm.h.message_type); + return; + } + break; + case AMF_EVT_5GMM_TIMER: + switch (e->timer_id) { + case AMF_TIMER_T3513: + if (amf_ue->t3513.retry_count >= + amf_timer_cfg(AMF_TIMER_T3513)->max_count) { + /* Paging failed */ + ogs_warn("Paging to IMSI[%s] failed. Stop paging", + amf_ue->imsi_bcd); + CLEAR_AMF_UE_TIMER(amf_ue->t3513); + + } else { + amf_ue->t3513.retry_count++; + /* + * If t3513 is timeout, the saved pkbuf is used. + * We don't have to set CNDomain. + * So, we just set CNDomain to 0 + */ +#if 0 + ngap_send_paging(amf_ue, 0); +#endif + } + break; + case AMF_TIMER_T3570: + if (amf_ue->t3570.retry_count >= + amf_timer_cfg(AMF_TIMER_T3570)->max_count) { + ogs_warn("Retransmission of Identity-Request failed. " + "Stop retransmission"); + CLEAR_AMF_UE_TIMER(amf_ue->t3570); + OGS_FSM_TRAN(&amf_ue->sm, &gmm_state_exception); + } else { + amf_ue->t3570.retry_count++; +#if 0 + nas_5gs_send_identity_request(amf_ue); +#endif + } + break; + default: + ogs_error("Unknown timer[%s:%d]", + amf_timer_get_name(e->timer_id), e->timer_id); + break; + } + return; + default: + ogs_error("Unknown event[%s]", amf_event_get_name(e)); + return; + } + +#if 0 + if (!AMF_UE_HAVE_IMSI(amf_ue)) { + CLEAR_AMF_UE_TIMER(amf_ue->t3570); + nas_5gs_send_identity_request(amf_ue); + return; + } +#endif + + ran_ue = amf_ue->ran_ue; + ogs_assert(ran_ue); + + switch (amf_ue->nas.type) { + case OGS_NAS_5GS_REGISTRATION_REQUEST: + if (SECURITY_CONTEXT_IS_VALID(amf_ue)) { +#if 0 + rv = nas_5gs_send_emm_to_esm(amf_ue, + &amf_ue->pdn_connectivity_request); + if (rv != OGS_OK) { + ogs_error("nas_5gs_send_emm_to_esm() failed"); + nas_5gs_send_attach_reject(amf_ue, + GMM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED, + GSM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED); + OGS_FSM_TRAN(s, &gmm_state_exception); + } else { + OGS_FSM_TRAN(s, &gmm_state_initial_context_setup); + } +#endif + } else { +#if 0 + if (SESSION_CONTEXT_IS_AVAILABLE(amf_ue)) { + amf_gtp_send_delete_all_sessions(amf_ue); + } else { + amf_sbi_send_authenticate(amf_ue); + } +#else + rv = amf_nausf_auth_discover_and_send_authenticate(amf_ue); + if (rv == OGS_ERROR) { + ogs_error("[%s] Cannot send SBI message", amf_ue->suci); + nas_5gs_send_registration_reject( + amf_ue, OGS_5GMM_CAUSE_5GS_SERVICES_NOT_ALLOWED); + OGS_FSM_TRAN(s, &gmm_state_exception); + break; + } +#endif + OGS_FSM_TRAN(s, &gmm_state_authentication); + } + break; +#if 0 + case AMF_EPS_TYPE_TAU_REQUEST: + procedureCode = e->ngap_code; + + if (!SESSION_CONTEXT_IS_AVAILABLE(amf_ue)) { + ogs_warn("No PDN Connection : UE[%s]", amf_ue->imsi_bcd); + nas_5gs_send_tau_reject(amf_ue, + GMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK); + OGS_FSM_TRAN(s, gmm_state_exception); + break; + } + + if (!SECURITY_CONTEXT_IS_VALID(amf_ue)) { + amf_s6a_send_air(amf_ue, NULL); + OGS_FSM_TRAN(&amf_ue->sm, &gmm_state_authentication); + break; + } + + if (procedureCode == NGAP_ProcedureCode_id_initialUEMessage) { + ogs_debug(" Iniital UE Message"); + if (amf_ue->nas_5gs.update.active_flag) { + nas_5gs_send_tau_accept(amf_ue, + NGAP_ProcedureCode_id_InitialContextSetup); + } else { + nas_5gs_send_tau_accept(amf_ue, + NGAP_ProcedureCode_id_downlinkNASTransport); + amf_send_release_access_bearer_or_ue_context_release(ran_ue); + } + } else if (procedureCode == NGAP_ProcedureCode_id_uplinkNASTransport) { + ogs_debug(" Uplink NAS Transport"); + nas_5gs_send_tau_accept(amf_ue, + NGAP_ProcedureCode_id_downlinkNASTransport); + } else { + ogs_fatal("Invalid Procedure Code[%d]", (int)procedureCode); + } + break; + case AMF_EPS_TYPE_EXTENDED_SERVICE_REQUEST: + procedureCode = e->ngap_code; + + if (!AMF_P_TMSI_IS_AVAILABLE(amf_ue)) { + ogs_warn("No P-TMSI : UE[%s]", amf_ue->imsi_bcd); + nas_5gs_send_service_reject(amf_ue, + GMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK); + OGS_FSM_TRAN(s, gmm_state_exception); + break; + } + + if (!SESSION_CONTEXT_IS_AVAILABLE(amf_ue)) { + ogs_warn("No PDN Connection : UE[%s]", amf_ue->imsi_bcd); + nas_5gs_send_service_reject(amf_ue, + GMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK); + OGS_FSM_TRAN(s, gmm_state_exception); + break; + } + + if (!SECURITY_CONTEXT_IS_VALID(amf_ue)) { + ogs_warn("No Security Context : IMSI[%s]", amf_ue->imsi_bcd); + nas_5gs_send_service_reject(amf_ue, + GMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK); + OGS_FSM_TRAN(s, &gmm_state_exception); + return; + } + + if (procedureCode == NGAP_ProcedureCode_id_initialUEMessage) { + ogs_debug(" Initial UE Message"); + if (amf_ue->nas_5gs.service.value == + OGS_NAS_SERVICE_TYPE_CS_FALLBACK_FROM_UE || + amf_ue->nas_5gs.service.value == + OGS_NAS_SERVICE_TYPE_CS_FALLBACK_EMERGENCY_CALL_FROM_UE) { + ogs_debug(" MO-CSFB-INDICATION[%d]", + amf_ue->nas_5gs.service.value); + sgsap_send_mo_csfb_indication(amf_ue); + } else if (amf_ue->nas_5gs.service.value == + OGS_NAS_SERVICE_TYPE_CS_FALLBACK_TO_UE) { + ogs_debug(" SERVICE_REQUEST[%d]", + amf_ue->nas_5gs.service.value); + sgsap_send_service_request(amf_ue, SGSAP_EMM_IDLE_MODE); + } else { + ogs_warn(" Unknown CSFB Service Type[%d]", + amf_ue->nas_5gs.service.value); + nas_5gs_send_service_reject(amf_ue, + GMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK); + OGS_FSM_TRAN(s, &gmm_state_exception); + return; + } + + ngap_send_initial_context_setup_request(amf_ue); + + } else if (procedureCode == NGAP_ProcedureCode_id_uplinkNASTransport) { + ogs_debug(" Uplink NAS Transport"); + if (amf_ue->nas_5gs.service.value == + OGS_NAS_SERVICE_TYPE_CS_FALLBACK_FROM_UE || + amf_ue->nas_5gs.service.value == + OGS_NAS_SERVICE_TYPE_CS_FALLBACK_EMERGENCY_CALL_FROM_UE) { + ogs_debug(" MO-CSFB-INDICATION[%d]", + amf_ue->nas_5gs.service.value); + sgsap_send_mo_csfb_indication(amf_ue); + } else if (amf_ue->nas_5gs.service.value == + OGS_NAS_SERVICE_TYPE_CS_FALLBACK_TO_UE) { + ogs_debug(" SERVICE_REQUEST[%d]", + amf_ue->nas_5gs.service.value); + sgsap_send_service_request(amf_ue, SGSAP_EMM_CONNECTED_MODE); + } else { + ogs_warn(" Unknown CSFB Service Type[%d]", + amf_ue->nas_5gs.service.value); + nas_5gs_send_service_reject(amf_ue, + GMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK); + OGS_FSM_TRAN(s, &gmm_state_exception); + return; + } + + ngap_send_ue_context_modification_request(amf_ue); + } else { + ogs_fatal("Invalid Procedure Code[%d]", (int)procedureCode); + } + + break; +#endif + default: + ogs_fatal("Invalid NAS-5GS[%d]", amf_ue->nas.type); + break; + } +} + +void gmm_state_authentication(ogs_fsm_t *s, amf_event_t *e) +{ + int rv; + amf_ue_t *amf_ue = NULL; + ogs_nas_5gs_message_t *message = NULL; + + ogs_sbi_response_t *sbi_response = NULL; + ogs_sbi_message_t *sbi_message = NULL; + + ogs_assert(s); + ogs_assert(e); + + amf_sm_debug(e); + + amf_ue = e->amf_ue; + ogs_assert(amf_ue); + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + break; + case OGS_FSM_EXIT_SIG: + break; + case AMF_EVT_5GMM_MESSAGE: + message = e->nas.message; + ogs_assert(message); + + switch (message->gmm.h.message_type) { + case OGS_NAS_5GS_AUTHENTICATION_RESPONSE: + rv = gmm_handle_authentication_response( + amf_ue, &message->gmm.authentication_response); + + if (rv != OGS_OK) { + nas_5gs_send_authentication_reject(amf_ue); + OGS_FSM_TRAN(&amf_ue->sm, &gmm_state_exception); + } + break; + + case OGS_NAS_5GS_AUTHENTICATION_FAILURE: + { + ogs_fatal("[%s] Not implemented", amf_ue->suci); + ogs_assert_if_reached(); +#if 0 + ogs_nas_5gs_authentication_failure_t *authentication_failure = + &message->gmm.authentication_failure; + ogs_nas_authentication_failure_parameter_t + *authentication_failure_parameter = + &authentication_failure-> + authentication_failure_parameter; + + ogs_debug("Authentication failure"); + ogs_debug(" IMSI[%s] GMM_CAUSE[%d]", amf_ue->imsi_bcd, + authentication_failure->gmm_cause); + + CLEAR_AMF_UE_TIMER(amf_ue->t3560); + + switch (authentication_failure->gmm_cause) { + case GMM_CAUSE_MAC_FAILURE: + ogs_warn("Authentication failure(MAC failure)"); + break; + case GMM_CAUSE_NON_EPS_AUTHENTICATION_UNACCEPTABLE: + ogs_error("Authentication failure" + "(Non-EPS authentication unacceptable)"); + break; + case GMM_CAUSE_SYNCH_FAILURE: + ogs_warn("Authentication failure(Synch failure)"); + amf_s6a_send_air(amf_ue, + authentication_failure_parameter); + return; + default: + ogs_error("Unknown GMM_CAUSE{%d] in Authentication" + " failure", + authentication_failure->gmm_cause); + break; + } + + nas_5gs_send_authentication_reject(amf_ue); + OGS_FSM_TRAN(&amf_ue->sm, &gmm_state_exception); +#endif + + break; + } + case OGS_NAS_5GS_REGISTRATION_REQUEST: + ogs_warn("[%s] Registration request", amf_ue->suci); + rv = gmm_handle_registration_request( + amf_ue, &message->gmm.registration_request); + if (rv != OGS_OK) { + ogs_error("[%s] Cannot handle NGAP message", amf_ue->suci); + OGS_FSM_TRAN(s, gmm_state_exception); + break; + } + + rv = amf_nausf_auth_discover_and_send_authenticate(amf_ue); + if (rv == OGS_ERROR) { + ogs_error("[%s] Cannot send SBI message", amf_ue->suci); + nas_5gs_send_registration_reject( + amf_ue, OGS_5GMM_CAUSE_5GS_SERVICES_NOT_ALLOWED); + OGS_FSM_TRAN(s, &gmm_state_exception); + break; + } + + break; + case OGS_NAS_5GS_5GMM_STATUS: + ogs_warn("[%s] 5GMM STATUS : Cause[%d]", + amf_ue->suci, message->gmm.gmm_status.gmm_cause); + OGS_FSM_TRAN(s, &gmm_state_exception); + break; + case OGS_NAS_5GS_DEREGISTRATION_REQUEST: + ogs_debug("[%s] Deregistration request", amf_ue->suci); +#if 0 + rv = gmm_handle_deregistration_request( + amf_ue, &message->gmm.deregistration_request_from_ue); + if (rv != OGS_OK) { + ogs_error("gmm_handle_registration_request() failed"); + OGS_FSM_TRAN(s, gmm_state_exception); + return; + } + + amf_send_delete_session_or_deregistration(amf_ue); +#endif + OGS_FSM_TRAN(s, &gmm_state_de_registered); + break; + default: + ogs_warn("Unknown message[%d]", message->gmm.h.message_type); + break; + } + break; + case AMF_EVT_5GMM_TIMER: + switch (e->timer_id) { + case AMF_TIMER_T3560: + if (amf_ue->t3560.retry_count >= + amf_timer_cfg(AMF_TIMER_T3560)->max_count) { + ogs_warn("[%s] Retransmission failed. Stop retransmission", + amf_ue->suci); + nas_5gs_send_authentication_reject(amf_ue); + OGS_FSM_TRAN(&amf_ue->sm, &gmm_state_exception); + } else { + amf_ue->t3560.retry_count++; + nas_5gs_send_authentication_request(amf_ue); + } + break; + default: + ogs_error("[%s] Unknown timer[%s:%d]", amf_ue->suci, + amf_timer_get_name(e->timer_id), e->timer_id); + break; + } + break; + case AMF_EVT_SBI_CLIENT: + sbi_response = e->sbi.response; + ogs_assert(sbi_response); + sbi_message = e->sbi.message; + ogs_assert(sbi_message); + + SWITCH(sbi_message->h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_UE_AUTHENTICATIONS) + ogs_timer_stop(amf_ue->sbi_client_wait.timer); + + if (sbi_message->res_status != OGS_SBI_HTTP_STATUS_CREATED && + sbi_message->res_status != OGS_SBI_HTTP_STATUS_OK) { + ogs_error("[%s] HTTP response error [%d]", + amf_ue->suci, sbi_message->res_status); + nas_5gs_send_authentication_reject(amf_ue); + OGS_FSM_TRAN(&amf_ue->sm, &gmm_state_exception); + break; + } + + SWITCH(sbi_message->h.method) + CASE(OGS_SBI_HTTP_METHOD_POST) + rv = amf_nausf_auth_handle_authenticate(amf_ue, sbi_message); + if (rv != OGS_OK) { + ogs_error("[%s] Cannot handle SBI message", amf_ue->suci); + nas_5gs_send_authentication_reject(amf_ue); + OGS_FSM_TRAN(&amf_ue->sm, &gmm_state_exception); + } + break; + CASE(OGS_SBI_HTTP_METHOD_PUT) + rv = amf_nausf_auth_handle_authenticate_confirmation( + amf_ue, sbi_message); + if (rv != OGS_OK) { + ogs_error("[%s] Cannot handle SBI message", amf_ue->suci); + nas_5gs_send_authentication_reject(amf_ue); + OGS_FSM_TRAN(&amf_ue->sm, &gmm_state_exception); + } else { + OGS_FSM_TRAN(&amf_ue->sm, &gmm_state_security_mode); + } + break; + DEFAULT + ogs_error("[%s] Invalid HTTP method [%s]", + amf_ue->suci, sbi_message->h.method); + ogs_assert_if_reached(); + END + break; + + DEFAULT + ogs_error("Invalid resource name [%s]", + sbi_message->h.resource.component[0]); + ogs_assert_if_reached(); + END + break; + default: + ogs_error("Unknown event[%s]", amf_event_get_name(e)); + break; + } +} + +void gmm_state_security_mode(ogs_fsm_t *s, amf_event_t *e) +{ + int rv; + amf_ue_t *amf_ue = NULL; + ogs_nas_5gs_message_t *message = NULL; + ogs_nas_security_header_type_t h; + + ogs_assert(s); + ogs_assert(e); + + amf_sm_debug(e); + + amf_ue = e->amf_ue; + ogs_assert(amf_ue); + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + CLEAR_AMF_UE_TIMER(amf_ue->t3560); + nas_5gs_send_security_mode_command(amf_ue); + break; + case OGS_FSM_EXIT_SIG: + break; + case AMF_EVT_5GMM_MESSAGE: + message = e->nas.message; + ogs_assert(message); + +#if 0 + if (message->gmm.h.security_header_type + == OGS_NAS_SECURITY_HEADER_FOR_SERVICE_REQUEST_MESSAGE) { + ogs_debug("Service request"); + nas_5gs_send_service_reject(amf_ue, + GMM_CAUSE_SECURITY_MODE_REJECTED_UNSPECIFIED); + OGS_FSM_TRAN(s, &gmm_state_exception); + return; + } +#endif + + switch (message->gmm.h.message_type) { + case OGS_NAS_5GS_SECURITY_MODE_COMPLETE: + ogs_debug("[%s] Security mode complete", amf_ue->supi); + + CLEAR_AMF_UE_TIMER(amf_ue->t3560); + + /* Now, We will check the MAC in the NAS message*/ + h.type = e->nas.type; + if (h.integrity_protected == 0) { + ogs_error("[%s] Security-mode : No Integrity Protected", + amf_ue->supi); + + nas_5gs_send_registration_reject(amf_ue, + OGS_5GMM_CAUSE_SECURITY_MODE_REJECTED_UNSPECIFIED); + OGS_FSM_TRAN(s, &gmm_state_exception); + break; + } + + if (!SECURITY_CONTEXT_IS_VALID(amf_ue)) { + ogs_warn("[%s] No Security Context", amf_ue->supi); + nas_5gs_send_registration_reject(amf_ue, + OGS_5GMM_CAUSE_SECURITY_MODE_REJECTED_UNSPECIFIED); + OGS_FSM_TRAN(s, &gmm_state_exception); + break; + } + + gmm_handle_security_mode_complete( + amf_ue, &message->gmm.security_mode_complete); + + ogs_kdf_kgnb_and_kn3iwf( + amf_ue->kamf, amf_ue->ul_count.i32, + OGS_KDF_ACCESS_TYPE_3GPP, amf_ue->kgnb); + ogs_kdf_nh_gnb(amf_ue->kamf, amf_ue->kgnb, amf_ue->nh); + amf_ue->nhcc = 1; + +#if 0 + amf_s6a_send_ulr(amf_ue); +#endif + if (amf_ue->nas.type == OGS_NAS_5GS_REGISTRATION_REQUEST) { + OGS_FSM_TRAN(s, &gmm_state_initial_context_setup); +#if 0 + } else if (amf_ue->nas.type == + AMF_EPS_TYPE_SERVICE_REQUEST || + amf_ue->nas.type == AMF_EPS_TYPE_TAU_REQUEST) { + OGS_FSM_TRAN(s, &gmm_state_registered); + } else { + ogs_fatal("Invalid OGS_NAS_5GS[%d]", amf_ue->nas.type); +#endif + } + break; + case OGS_NAS_5GS_SECURITY_MODE_REJECT: + ogs_warn("[%s] Security mode reject : Cause[%d]", + amf_ue->supi, + message->gmm.security_mode_reject.gmm_cause); + CLEAR_AMF_UE_TIMER(amf_ue->t3560); + OGS_FSM_TRAN(s, &gmm_state_exception); + break; + case OGS_NAS_5GS_REGISTRATION_REQUEST: + ogs_warn("[%s] Registration request", amf_ue->suci); + rv = gmm_handle_registration_request( + amf_ue, &message->gmm.registration_request); + if (rv != OGS_OK) { + ogs_error("[%s] Cannot handle NAS message", amf_ue->suci); + OGS_FSM_TRAN(s, gmm_state_exception); + break; + } + + rv = amf_nausf_auth_discover_and_send_authenticate(amf_ue); + if (rv == OGS_ERROR) { + ogs_error("[%s] Cannot send SBI message", amf_ue->suci); + nas_5gs_send_registration_reject( + amf_ue, OGS_5GMM_CAUSE_5GS_SERVICES_NOT_ALLOWED); + OGS_FSM_TRAN(s, &gmm_state_exception); + break; + } + + OGS_FSM_TRAN(s, &gmm_state_authentication); + break; +#if 0 + case OGS_NAS_5GS_TRACKING_AREA_UPDATE_REQUEST: + ogs_debug("Tracking area update request"); + nas_5gs_send_tau_reject(amf_ue, + GMM_CAUSE_SECURITY_MODE_REJECTED_UNSPECIFIED); + OGS_FSM_TRAN(s, &gmm_state_exception); + break; +#endif + case OGS_NAS_5GS_5GMM_STATUS: + ogs_warn("[%s] 5GMM STATUS : Cause[%d]", + amf_ue->supi, message->gmm.gmm_status.gmm_cause); + OGS_FSM_TRAN(s, &gmm_state_exception); + break; + case OGS_NAS_5GS_DEREGISTRATION_REQUEST: +#if 0 + ogs_debug("Deregistration request"); + ogs_debug(" IMSI[%s]", amf_ue->imsi_bcd); + rv = gmm_handle_deregistration_request( + amf_ue, &message->gmm.deregistration_request_from_ue); + if (rv != OGS_OK) { + ogs_error("gmm_handle_registration_request() failed"); + OGS_FSM_TRAN(s, gmm_state_exception); + break; + } + + amf_send_delete_session_or_deregistration(amf_ue); + OGS_FSM_TRAN(s, &gmm_state_de_registered); +#endif + break; + default: + ogs_warn("Unknown message[%d]", message->gmm.h.message_type); + break; + } + break; + case AMF_EVT_5GMM_TIMER: + switch (e->timer_id) { + case AMF_TIMER_T3560: + if (amf_ue->t3560.retry_count >= + amf_timer_cfg(AMF_TIMER_T3560)->max_count) { + ogs_warn("Retransmission of IMSI[%s] failed. " + "Stop retransmission", + amf_ue->imsi_bcd); + nas_5gs_send_registration_reject(amf_ue, + OGS_5GMM_CAUSE_SECURITY_MODE_REJECTED_UNSPECIFIED); + OGS_FSM_TRAN(&amf_ue->sm, &gmm_state_exception); + } else { + amf_ue->t3560.retry_count++; + nas_5gs_send_security_mode_command(amf_ue); + } + break; + default: + ogs_error("Unknown timer[%s:%d]", + amf_timer_get_name(e->timer_id), e->timer_id); + break; + } + break; + default: + ogs_error("Unknown event[%s]", amf_event_get_name(e)); + break; + } +} + +void gmm_state_initial_context_setup(ogs_fsm_t *s, amf_event_t *e) +{ +#if 0 + int rv; +#endif + amf_ue_t *amf_ue = NULL; + ogs_nas_5gs_message_t *message = NULL; + + ogs_assert(s); + ogs_assert(e); + + amf_sm_debug(e); + + amf_ue = e->amf_ue; + ogs_assert(amf_ue); + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + ogs_fatal("Under Development"); + break; + case OGS_FSM_EXIT_SIG: + break; + case AMF_EVT_5GMM_MESSAGE: + message = e->nas.message; + ogs_assert(message); + +#if 0 + switch (message->gmm.h.message_type) { + case OGS_NAS_5GS_REGISTRATION_COMPLETE: + ogs_debug("Registration complete"); + ogs_debug(" IMSI[%s]", amf_ue->imsi_bcd); + + rv = gmm_handle_registration_complete( + amf_ue, &message->gmm.registration_complete); + if (rv != OGS_OK) { + ogs_error("gmm_handle_registration_complete() failed " + "in gmm_state_initial_context_setup"); + OGS_FSM_TRAN(s, gmm_state_exception); + break; + } + if (AMF_P_TMSI_IS_AVAILABLE(amf_ue)) + sgsap_send_tmsi_reallocation_complete(amf_ue); + + OGS_FSM_TRAN(s, &gmm_state_registered); + break; + case OGS_NAS_5GS_REGISTRATION_REQUEST: + ogs_warn("Registration request[%s]", amf_ue->imsi_bcd); + rv = gmm_handle_registration_request( + amf_ue, &message->gmm.registration_request); + if (rv != OGS_OK) { + ogs_error("gmm_handle_registration_request() failed"); + OGS_FSM_TRAN(s, gmm_state_exception); + return; + } + + amf_gtp_send_delete_all_sessions(amf_ue); + OGS_FSM_TRAN(s, &gmm_state_authentication); + break; + case OGS_NAS_5GS_5GMM_STATUS: + ogs_warn("5GMM STATUS : IMSI[%s] Cause[%d]", + amf_ue->imsi_bcd, + message->gmm.gmm_status.gmm_cause); + OGS_FSM_TRAN(s, &gmm_state_exception); + break; + case OGS_NAS_5GS_DEREGISTRATION_REQUEST: + ogs_debug("Deregistration request"); + ogs_debug(" IMSI[%s]", amf_ue->imsi_bcd); + rv = gmm_handle_deregistration_request( + amf_ue, &message->gmm.deregistration_request_from_ue); + if (rv != OGS_OK) { + ogs_error("gmm_handle_registration_request() failed"); + OGS_FSM_TRAN(s, gmm_state_exception); + return; + } + + amf_send_delete_session_or_deregistration(amf_ue); + OGS_FSM_TRAN(s, &gmm_state_de_registered); + break; + default: + ogs_warn("Unknown message[%d]", + message->gmm.h.message_type); + break; + } +#endif + break; + case AMF_EVT_5GMM_TIMER: + switch (e->timer_id) { + default: + ogs_error("Unknown timer[%s:%d]", + amf_timer_get_name(e->timer_id), e->timer_id); + break; + } + break; + default: + ogs_error("Unknown event[%s]", amf_event_get_name(e)); + break; + } +} + +void gmm_state_exception(ogs_fsm_t *s, amf_event_t *e) +{ + amf_ue_t *amf_ue = NULL; + + ogs_assert(e); + amf_sm_debug(e); + + amf_ue = e->amf_ue; + ogs_assert(amf_ue); + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + CLEAR_AMF_UE_ALL_TIMERS(amf_ue); + break; + case OGS_FSM_EXIT_SIG: + break; + default: + ogs_error("Unknown event[%s]", amf_event_get_name(e)); + break; + } +} diff --git a/src/amf/gsm-sm.c b/src/amf/gsm-sm.c new file mode 100644 index 0000000000..484b20b51d --- /dev/null +++ b/src/amf/gsm-sm.c @@ -0,0 +1,360 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#if 0 +#include "5gmm-handler.h" +#include "5gsm-build.h" +#include "5gsm-handler.h" +#include "nas-path.h" +#endif +#include "context.h" + +#undef OGS_LOG_DOMAIN +#define OGS_LOG_DOMAIN __gsm_log_domain + +void gsm_state_initial(ogs_fsm_t *s, amf_event_t *e) +{ + ogs_assert(s); + + amf_sm_debug(e); + + OGS_FSM_TRAN(s, &gsm_state_inactive); +} + +void gsm_state_final(ogs_fsm_t *s, amf_event_t *e) +{ + ogs_assert(s); + + amf_sm_debug(e); +} + +void gsm_state_inactive(ogs_fsm_t *s, amf_event_t *e) +{ +#if 0 + int rv; + amf_ue_t *amf_ue = NULL; + amf_sess_t *sess = NULL; + amf_bearer_t *bearer = NULL; + ogs_nas_eps_message_t *message = NULL; + + ogs_assert(s); + ogs_assert(e); + + amf_sm_debug(e); + + bearer = e->bearer; + ogs_assert(bearer); + sess = bearer->sess; + ogs_assert(sess); + amf_ue = sess->amf_ue; + ogs_assert(amf_ue); + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + CLEAR_BEARER_ALL_TIMERS(bearer); + break; + case OGS_FSM_EXIT_SIG: + break; + case MME_EVT_ESM_MESSAGE: + message = e->nas_message; + ogs_assert(message); + + switch (message->gsm.h.message_type) { + case OGS_NAS_EPS_PDN_CONNECTIVITY_REQUEST: + ogs_debug("[ESM] PDN Connectivity request"); + ogs_debug(" IMSI[%s] PTI[%d] EBI[%d]", + amf_ue->imsi_bcd, sess->pti, bearer->ebi); + rv = gsm_handle_pdn_connectivity_request( + bearer, &message->gsm.pdn_connectivity_request); + if (rv != OGS_OK) { + OGS_FSM_TRAN(s, gsm_state_exception); + break; + } + break; + case OGS_NAS_EPS_ESM_INFORMATION_RESPONSE: + ogs_debug("[ESM] ESM information response"); + ogs_debug(" IMSI[%s] PTI[%d] EBI[%d]", + amf_ue->imsi_bcd, sess->pti, bearer->ebi); + + CLEAR_BEARER_TIMER(bearer->t3489); + rv = gsm_handle_information_response( + sess, &message->gsm.esm_information_response); + if (rv != OGS_OK) { + OGS_FSM_TRAN(s, gsm_state_exception); + break; + } + break; + case OGS_NAS_EPS_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_ACCEPT: + ogs_debug("[ESM] Activate default EPS bearer " + "context accept"); + ogs_debug(" IMSI[%s] PTI[%d] EBI[%d]", + amf_ue->imsi_bcd, sess->pti, bearer->ebi); + /* Check if Initial Context Setup Response or + * E-RAB Setup Response is received */ + if (MME_HAVE_ENB_S1U_PATH(bearer)) { + amf_gtp_send_modify_bearer_request(bearer, 0); + } + + nas_eps_send_activate_all_dedicated_bearers(bearer); + OGS_FSM_TRAN(s, gsm_state_active); + break; + case OGS_NAS_EPS_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_ACCEPT: + ogs_debug("[ESM] Activate dedicated EPS bearer " + "context accept"); + ogs_debug(" IMSI[%s] PTI[%d] EBI[%d]", + amf_ue->imsi_bcd, sess->pti, bearer->ebi); + /* Check if Initial Context Setup Response or + * E-RAB Setup Response is received */ + if (MME_HAVE_ENB_S1U_PATH(bearer)) { + amf_gtp_send_create_bearer_response(bearer); + } + + OGS_FSM_TRAN(s, gsm_state_active); + break; + default: + ogs_error("Unknown message(type:%d)", + message->gsm.h.message_type); + break; + } + break; + case MME_EVT_ESM_TIMER: + switch (e->timer_id) { + case MME_TIMER_T3489: + if (bearer->t3489.retry_count >= + amf_timer_cfg(MME_TIMER_T3489)->max_count) { + ogs_warn("[EMM] Retransmission of IMSI[%s] failed. " + "Stop retransmission", + amf_ue->imsi_bcd); + OGS_FSM_TRAN(&bearer->sm, &gsm_state_exception); + + nas_eps_send_pdn_connectivity_reject(sess, + ESM_CAUSE_ESM_INFORMATION_NOT_RECEIVED); + } else { + bearer->t3489.retry_count++; + nas_eps_send_esm_information_request(bearer); + } + break; + default: + ogs_error("Unknown timer[%s:%d]", + amf_timer_get_name(e->timer_id), e->timer_id); + break; + } + break; + default: + ogs_error("Unknown event %s", amf_event_get_name(e)); + break; + } +#endif +} + +#if 0 +void gsm_state_active(ogs_fsm_t *s, amf_event_t *e) +{ + int rv; + amf_ue_t *amf_ue = NULL; + amf_sess_t *sess = NULL; + amf_bearer_t *bearer = NULL; + ogs_nas_eps_message_t *message = NULL; + + ogs_assert(s); + ogs_assert(e); + + amf_sm_debug(e); + + bearer = e->bearer; + ogs_assert(bearer); + sess = bearer->sess; + ogs_assert(sess); + amf_ue = sess->amf_ue; + ogs_assert(amf_ue); + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + break; + case OGS_FSM_EXIT_SIG: + break; + case MME_EVT_ESM_MESSAGE: + message = e->nas_message; + ogs_assert(message); + + switch (message->gsm.h.message_type) { + case OGS_NAS_EPS_PDN_CONNECTIVITY_REQUEST: + ogs_debug("[ESM] PDN Connectivity request"); + ogs_debug(" IMSI[%s] PTI[%d] EBI[%d]", + amf_ue->imsi_bcd, sess->pti, bearer->ebi); + rv = gsm_handle_pdn_connectivity_request( + bearer, &message->gsm.pdn_connectivity_request); + if (rv != OGS_OK) { + OGS_FSM_TRAN(s, gsm_state_exception); + break; + } + + OGS_FSM_TRAN(s, gsm_state_inactive); + break; + case OGS_NAS_EPS_PDN_DISCONNECT_REQUEST: + ogs_debug("[ESM] PDN disconnect request"); + ogs_debug(" IMSI[%s] PTI[%d] EBI[%d]", + amf_ue->imsi_bcd, sess->pti, bearer->ebi); + if (MME_HAVE_SGW_S1U_PATH(sess)) { + amf_gtp_send_delete_session_request(sess); + } else { + nas_eps_send_deactivate_bearer_context_request(bearer); + } + OGS_FSM_TRAN(s, gsm_state_pdn_will_disconnect); + break; + case OGS_NAS_EPS_MODIFY_EPS_BEARER_CONTEXT_ACCEPT: + ogs_debug("[ESM] Modify EPS bearer context accept"); + ogs_debug(" IMSI[%s] PTI[%d] EBI[%d]", + amf_ue->imsi_bcd, sess->pti, bearer->ebi); + + amf_gtp_send_update_bearer_response(bearer); + break; + case OGS_NAS_EPS_DEACTIVATE_EPS_BEARER_CONTEXT_ACCEPT: + ogs_debug("[ESM] Deactivate EPS bearer " + "context accept"); + ogs_debug(" IMSI[%s] PTI[%d] EBI[%d]", + amf_ue->imsi_bcd, sess->pti, bearer->ebi); + amf_gtp_send_delete_bearer_response(bearer); + OGS_FSM_TRAN(s, gsm_state_bearer_deactivated); + break; + case OGS_NAS_EPS_BEARER_RESOURCE_ALLOCATION_REQUEST: + ogs_debug("[ESM] Bearer resource allocation request"); + ogs_debug(" IMSI[%s] PTI[%d] EBI[%d]", + amf_ue->imsi_bcd, sess->pti, bearer->ebi); + gsm_handle_bearer_resource_allocation_request(bearer, message); + break; + case OGS_NAS_EPS_BEARER_RESOURCE_MODIFICATION_REQUEST: + ogs_debug("[ESM] Bearer resource modification request"); + ogs_debug(" IMSI[%s] PTI[%d] EBI[%d]", + amf_ue->imsi_bcd, sess->pti, bearer->ebi); + gsm_handle_bearer_resource_modification_request(bearer, message); + break; + default: + ogs_error("Unknown message(type:%d)", + message->gsm.h.message_type); + break; + } + break; + default: + ogs_error("Unknown event %s", amf_event_get_name(e)); + break; + } +} + +void gsm_state_pdn_will_disconnect(ogs_fsm_t *s, amf_event_t *e) +{ + amf_ue_t *amf_ue = NULL; + amf_sess_t *sess = NULL; + amf_bearer_t *bearer = NULL; + ogs_nas_eps_message_t *message = NULL; + + ogs_assert(s); + ogs_assert(e); + + amf_sm_debug(e); + + bearer = e->bearer; + ogs_assert(bearer); + sess = bearer->sess; + ogs_assert(sess); + amf_ue = sess->amf_ue; + ogs_assert(amf_ue); + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + break; + case OGS_FSM_EXIT_SIG: + break; + case MME_EVT_ESM_MESSAGE: + message = e->nas_message; + ogs_assert(message); + + switch (message->gsm.h.message_type) { + case OGS_NAS_EPS_DEACTIVATE_EPS_BEARER_CONTEXT_ACCEPT: + ogs_debug("[ESM] [D] Deactivate EPS bearer " + "context accept"); + ogs_debug(" IMSI[%s] PTI[%d] EBI[%d]", + amf_ue->imsi_bcd, sess->pti, bearer->ebi); + OGS_FSM_TRAN(s, gsm_state_pdn_did_disconnect); + break; + default: + ogs_error("Unknown message(type:%d)", + message->gsm.h.message_type); + break; + } + break; + + default: + ogs_error("Unknown event %s", amf_event_get_name(e)); + break; + } +} + +void gsm_state_pdn_did_disconnect(ogs_fsm_t *s, amf_event_t *e) +{ + ogs_assert(e); + amf_sm_debug(e); + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + break; + case OGS_FSM_EXIT_SIG: + break; + default: + ogs_error("Unknown event %s", amf_event_get_name(e)); + break; + } +} + +void gsm_state_bearer_deactivated(ogs_fsm_t *s, amf_event_t *e) +{ + ogs_assert(e); + amf_sm_debug(e); + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + break; + case OGS_FSM_EXIT_SIG: + break; + default: + ogs_error("Unknown event %s", amf_event_get_name(e)); + break; + } +} +#endif + +void gsm_state_exception(ogs_fsm_t *s, amf_event_t *e) +{ + amf_bearer_t *bearer = NULL; + ogs_assert(e); + amf_sm_debug(e); + + bearer = e->bearer; + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + CLEAR_BEARER_ALL_TIMERS(bearer); + break; + case OGS_FSM_EXIT_SIG: + break; + default: + ogs_error("Unknown event %s", amf_event_get_name(e)); + break; + } +} diff --git a/src/amf/meson.build b/src/amf/meson.build index b14dc98f10..ddfea5d233 100644 --- a/src/amf/meson.build +++ b/src/amf/meson.build @@ -20,9 +20,12 @@ libamf_sources = files(''' event.c timer.c + nausf-build.c + nausf-handler.c + nnrf-handler.c - nnrf-build.c sbi-path.c + nf-sm.c ngap-sctp.c @@ -31,6 +34,14 @@ libamf_sources = files(''' ngap-path.c ngap-sm.c + nas-security.c + + gmm-build.c + gmm-handler.c + nas-path.c + gmm-sm.c + + gsm-sm.c amf-sm.c init.c diff --git a/src/amf/nas-path.c b/src/amf/nas-path.c new file mode 100644 index 0000000000..255d82bc39 --- /dev/null +++ b/src/amf/nas-path.c @@ -0,0 +1,587 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "ngap-path.h" +#include "ngap-build.h" +#include "gmm-build.h" +#if 0 +#include "gsm-build.h" +#endif +#include "nas-path.h" + +int nas_5gs_send_to_gnb(amf_ue_t *amf_ue, ogs_pkbuf_t *pkbuf) +{ + ran_ue_t *ran_ue = NULL; + + ogs_assert(amf_ue); + ran_ue = amf_ue->ran_ue; + ogs_assert(ran_ue); + + return ngap_send_to_ran_ue(ran_ue, pkbuf); +} + +#if 0 +int nas_5gs_send_gmm_to_esm(amf_ue_t *amf_ue, + ogs_nas_esm_message_container_t *esm_message_container) +{ + int rv; + ogs_pkbuf_t *gsmbuf = NULL; + + ogs_assert(amf_ue); + ogs_assert(esm_message_container); + ogs_assert(esm_message_container->length); + + /* The Packet Buffer(pkbuf_t) for NAS message MUST make a HEADROOM. + * When calculating AES_CMAC, we need to use the headroom of the packet. */ + gsmbuf = ogs_pkbuf_alloc(NULL, + OGS_NAS_HEADROOM+esm_message_container->length); + ogs_pkbuf_reserve(gsmbuf, OGS_NAS_HEADROOM); + ogs_pkbuf_put_data(gsmbuf, + esm_message_container->buffer, esm_message_container->length); + + rv = ngap_send_to_esm(amf_ue, gsmbuf); + if (rv != OGS_OK) { + ogs_error("ngap_send_to_esm() failed"); + } + + return rv; +} +#endif + +int nas_5gs_send_to_downlink_nas_transport(amf_ue_t *amf_ue, ogs_pkbuf_t *pkbuf) +{ + int rv; + ogs_pkbuf_t *ngapbuf = NULL; + ran_ue_t *ran_ue = NULL; + + ogs_assert(pkbuf); + ogs_assert(amf_ue); + ran_ue = amf_ue->ran_ue; + if (!ran_ue) { + ogs_warn("NG context has already been removed"); + ogs_pkbuf_free(pkbuf); + + } else { + ngapbuf = ngap_build_downlink_nas_transport(ran_ue, pkbuf); + if (!ngapbuf) { + ogs_error("ngap_build_downlink_nas_transport() failed"); + return OGS_ERROR; + } + + rv = nas_5gs_send_to_gnb(amf_ue, ngapbuf); + if (rv != OGS_OK) { + ogs_error("nas_5gs_send_to_gnb() failed"); + return OGS_ERROR; + } + } + + return OGS_OK; +} + +void nas_5gs_send_nas_reject( + amf_ue_t *amf_ue, ogs_nas_5gmm_cause_t gmm_cause) +{ + ogs_assert(amf_ue); + + switch(amf_ue->nas.type) { + case OGS_NAS_5GS_REGISTRATION_REQUEST: + if (OGS_FSM_CHECK(&amf_ue->sm, gmm_state_authentication)) { + nas_5gs_send_authentication_reject(amf_ue); + } else { + nas_5gs_send_registration_reject(amf_ue, gmm_cause); + } + break; + default: + ogs_fatal("Unknown type : %d", amf_ue->nas.type); + ogs_assert_if_reached(); + break; + } +} + +void nas_5gs_send_nas_reject_from_sbi(amf_ue_t *amf_ue, int status) +{ + ogs_nas_5gmm_cause_t gmm_cause; + + ogs_assert(amf_ue); + + switch(status) { + case OGS_SBI_HTTP_STATUS_NOT_FOUND: + gmm_cause = OGS_5GMM_CAUSE_5GS_SERVICES_NOT_ALLOWED; + break; + default: + gmm_cause = OGS_5GMM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED; + } + + nas_5gs_send_nas_reject(amf_ue, gmm_cause); +} + +#if 0 +void nas_5gs_send_registration_accept(amf_ue_t *amf_ue) +{ + int rv; + amf_sess_t *sess = NULL; + amf_bearer_t *bearer = NULL; + ogs_pkbuf_t *ngapbuf = NULL; + ogs_pkbuf_t *gsmbuf = NULL, *gmmbuf = NULL; + + ogs_assert(amf_ue); + sess = amf_sess_first(amf_ue); + ogs_assert(sess); + ogs_assert(amf_sess_next(sess) == NULL); + bearer = amf_default_bearer_in_sess(sess); + ogs_assert(bearer); + ogs_assert(amf_bearer_next(bearer) == NULL); + + gsmbuf = esm_build_activate_default_bearer_context_request(sess); + ogs_expect_or_return(gsmbuf); + + gmmbuf = gmm_build_registration_accept(amf_ue, gsmbuf); + ogs_expect_or_return(gmmbuf); + + ngapbuf = ngap_build_initial_context_setup_request(amf_ue, gmmbuf); + ogs_expect_or_return(ngapbuf); + + rv = nas_5gs_send_to_gnb(amf_ue, ngapbuf); + ogs_expect_or_return(rv == OGS_OK); +} +#endif + +void nas_5gs_send_registration_reject( + amf_ue_t *amf_ue, ogs_nas_5gmm_cause_t gmm_cause) +{ + int rv; + ogs_pkbuf_t *gmmbuf = NULL; + + ogs_assert(amf_ue); + + ogs_warn("[%s] Registration reject [%d]", amf_ue->suci, gmm_cause); + + gmmbuf = gmm_build_registration_reject(gmm_cause); + ogs_expect_or_return(gmmbuf); + rv = nas_5gs_send_to_downlink_nas_transport(amf_ue, gmmbuf); + ogs_expect_or_return(rv == OGS_OK); +} + +void nas_5gs_send_identity_request(amf_ue_t *amf_ue) +{ + ogs_pkbuf_t *gmmbuf = NULL; + + ogs_assert(amf_ue); + + ogs_debug("Identity request"); + + if (amf_ue->t3570.pkbuf) { + gmmbuf = amf_ue->t3570.pkbuf; + ogs_expect_or_return(gmmbuf); + } else { + gmmbuf = gmm_build_identity_request(amf_ue); + ogs_expect_or_return(gmmbuf); + } + + amf_ue->t3570.pkbuf = ogs_pkbuf_copy(gmmbuf); + ogs_timer_start(amf_ue->t3570.timer, + amf_timer_cfg(AMF_TIMER_T3570)->duration); + + nas_5gs_send_to_downlink_nas_transport(amf_ue, gmmbuf); +} + +void nas_5gs_send_authentication_request(amf_ue_t *amf_ue) +{ + int rv; + ogs_pkbuf_t *gmmbuf = NULL; + + ogs_assert(amf_ue); + + ogs_debug("[%s] Authentication request", amf_ue->suci); + + if (amf_ue->t3560.pkbuf) { + gmmbuf = amf_ue->t3560.pkbuf; + ogs_expect_or_return(gmmbuf); + } else { + gmmbuf = gmm_build_authentication_request(amf_ue); + ogs_expect_or_return(gmmbuf); + } + + amf_ue->t3560.pkbuf = ogs_pkbuf_copy(gmmbuf); + ogs_timer_start(amf_ue->t3560.timer, + amf_timer_cfg(AMF_TIMER_T3560)->duration); + + rv = nas_5gs_send_to_downlink_nas_transport(amf_ue, gmmbuf); + ogs_expect(rv == OGS_OK); +} + +void nas_5gs_send_authentication_reject(amf_ue_t *amf_ue) +{ + int rv; + ogs_pkbuf_t *gmmbuf = NULL; + + ogs_assert(amf_ue); + + ogs_debug("[%s] Authentication reject", amf_ue->suci); + + gmmbuf = gmm_build_authentication_reject(); + ogs_expect_or_return(gmmbuf); + + rv = nas_5gs_send_to_downlink_nas_transport(amf_ue, gmmbuf); + ogs_expect(rv == OGS_OK); +} + +void nas_5gs_send_security_mode_command(amf_ue_t *amf_ue) +{ + int rv; + ogs_pkbuf_t *gmmbuf = NULL; + + ogs_assert(amf_ue); + + ogs_debug("[%s] Security mode command", amf_ue->supi); + + if (amf_ue->t3560.pkbuf) { + gmmbuf = amf_ue->t3560.pkbuf; + ogs_expect_or_return(gmmbuf); + } else { + gmmbuf = gmm_build_security_mode_command(amf_ue); + ogs_expect_or_return(gmmbuf); + } + + amf_ue->t3560.pkbuf = ogs_pkbuf_copy(gmmbuf); + ogs_timer_start(amf_ue->t3560.timer, + amf_timer_cfg(AMF_TIMER_T3560)->duration); + + rv = nas_5gs_send_to_downlink_nas_transport(amf_ue, gmmbuf); + ogs_expect(rv == OGS_OK); +} + +#if 0 +void nas_5gs_send_detach_accept(amf_ue_t *amf_ue) +{ + ran_ue_t *ran_ue = NULL; + ogs_pkbuf_t *gmmbuf = NULL; + + ogs_assert(amf_ue); + ran_ue = amf_ue->ran_ue; + ogs_assert(ran_ue); + + /* reply with detach accept */ + if (amf_ue->nas_5gs.detach.switch_off == 0) { + int rv; + gmmbuf = gmm_build_detach_accept(amf_ue); + ogs_expect_or_return(gmmbuf); + + rv = nas_5gs_send_to_downlink_nas_transport(amf_ue, gmmbuf); + ogs_expect_or_return(rv == OGS_OK); + } + + ngap_send_ue_context_release_command(ran_ue, + NGAP_Cause_PR_nas, NGAP_CauseNas_detach, + NGAP_UE_CTX_REL_NG_REMOVE_AND_UNLINK, 0); +} + + +void nas_5gs_send_pdn_connectivity_reject( + amf_sess_t *sess, ogs_nas_gsm_cause_t gsm_cause) +{ + int rv; + amf_ue_t *amf_ue; + ogs_pkbuf_t *gsmbuf = NULL; + + ogs_assert(sess); + amf_ue = sess->amf_ue; + ogs_assert(amf_ue); + + if (OGS_FSM_CHECK(&amf_ue->sm, gmm_state_registered)) { + gsmbuf = esm_build_pdn_connectivity_reject(sess, gsm_cause); + ogs_expect_or_return(gsmbuf); + + rv = nas_5gs_send_to_downlink_nas_transport(amf_ue, gsmbuf); + ogs_expect(rv == OGS_OK); + } else { + /* During the UE-registration process, we'll send Registration-Reject + * with pyggybacking PDN-connectivity-Reject */ + nas_5gs_send_registration_reject(amf_ue, + EMM_CAUSE_EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED, gsm_cause); + } +} + +void nas_5gs_send_esm_information_request(amf_bearer_t *bearer) +{ + int rv; + amf_ue_t *amf_ue = NULL; + ogs_pkbuf_t *gsmbuf = NULL; + + ogs_assert(bearer); + amf_ue = bearer->amf_ue; + ogs_assert(amf_ue); + + if (bearer->t3589.pkbuf) { + gsmbuf = bearer->t3589.pkbuf; + ogs_expect_or_return(gsmbuf); + } else { + gsmbuf = esm_build_information_request(bearer); + ogs_expect_or_return(gsmbuf); + } + + bearer->t3589.pkbuf = ogs_pkbuf_copy(gsmbuf); + ogs_timer_start(bearer->t3589.timer, + amf_timer_cfg(AMF_TIMER_T3589)->duration); + + rv = nas_5gs_send_to_downlink_nas_transport(amf_ue, gsmbuf); + ogs_expect(rv == OGS_OK); +} + +void nas_5gs_send_activate_default_bearer_context_request(amf_bearer_t *bearer) +{ + int rv; + ogs_pkbuf_t *ngapbuf = NULL; + ogs_pkbuf_t *gsmbuf = NULL; + amf_sess_t *sess = NULL; + amf_ue_t *amf_ue = NULL; + + ogs_assert(bearer); + sess = bearer->sess; + ogs_assert(sess); + amf_ue = bearer->amf_ue; + ogs_assert(amf_ue); + + gsmbuf = esm_build_activate_default_bearer_context_request(sess); + ogs_expect_or_return(gsmbuf); + + ngapbuf = ngap_build_e_rab_setup_request(bearer, gsmbuf); + ogs_expect_or_return(ngapbuf); + + rv = nas_5gs_send_to_gnb(amf_ue, ngapbuf); + ogs_expect(rv == OGS_OK); +} + +void nas_5gs_send_activate_dedicated_bearer_context_request( + amf_bearer_t *bearer) +{ + int rv; + ogs_pkbuf_t *ngapbuf = NULL; + ogs_pkbuf_t *gsmbuf = NULL; + amf_ue_t *amf_ue = NULL; + + ogs_assert(bearer); + amf_ue = bearer->amf_ue; + ogs_assert(amf_ue); + + gsmbuf = esm_build_activate_dedicated_bearer_context_request(bearer); + ogs_expect_or_return(gsmbuf); + + ngapbuf = ngap_build_e_rab_setup_request(bearer, gsmbuf); + ogs_expect_or_return(ngapbuf); + + rv = nas_5gs_send_to_gnb(amf_ue, ngapbuf); + ogs_expect(rv == OGS_OK); +} + +void nas_5gs_send_activate_all_dedicated_bearers(amf_bearer_t *default_bearer) +{ + ogs_assert(default_bearer); + + amf_bearer_t *dedicated_bearer = amf_bearer_next(default_bearer); + while (dedicated_bearer) { + nas_5gs_send_activate_dedicated_bearer_context_request( + dedicated_bearer); + dedicated_bearer = amf_bearer_next(dedicated_bearer); + } +} + +void nas_5gs_send_modify_bearer_context_request( + amf_bearer_t *bearer, int qos_presence, int tft_presence) +{ + int rv; + ogs_pkbuf_t *ngapbuf = NULL; + ogs_pkbuf_t *gsmbuf = NULL; + amf_ue_t *amf_ue = NULL; + + ogs_assert(bearer); + amf_ue = bearer->amf_ue; + ogs_assert(amf_ue); + + gsmbuf = esm_build_modify_bearer_context_request( + bearer, qos_presence, tft_presence); + ogs_expect_or_return(gsmbuf); + + if (qos_presence == 1) { + ngapbuf = ngap_build_e_rab_modify_request(bearer, gsmbuf); + ogs_expect_or_return(ngapbuf); + + rv = nas_5gs_send_to_gnb(amf_ue, ngapbuf); + ogs_expect(rv == OGS_OK); + } else { + rv = nas_5gs_send_to_downlink_nas_transport(amf_ue, gsmbuf); + ogs_expect(rv == OGS_OK); + } +} + +void nas_5gs_send_deactivate_bearer_context_request(amf_bearer_t *bearer) +{ + int rv; + ogs_pkbuf_t *ngapbuf = NULL; + ogs_pkbuf_t *gsmbuf = NULL; + amf_ue_t *amf_ue = NULL; + + ogs_assert(bearer); + amf_ue = bearer->amf_ue; + ogs_assert(amf_ue); + + gsmbuf = esm_build_deactivate_bearer_context_request( + bearer, ESM_CAUSE_REGULAR_DEACTIVATION); + ogs_expect_or_return(gsmbuf); + + ngapbuf = ngap_build_e_rab_release_command(bearer, gsmbuf, + NGAP_Cause_PR_nas, NGAP_CauseNas_normal_release); + ogs_expect_or_return(ngapbuf); + + rv = nas_5gs_send_to_gnb(amf_ue, ngapbuf); + ogs_expect(rv == OGS_OK); +} + +void nas_5gs_send_bearer_resource_allocation_reject( + amf_bearer_t *bearer, ogs_nas_gsm_cause_t gsm_cause) +{ + int rv; + amf_ue_t *amf_ue; + ogs_pkbuf_t *gsmbuf = NULL; + + ogs_assert(bearer); + amf_ue = bearer->amf_ue; + ogs_assert(bearer); + + gsmbuf = esm_build_bearer_resource_allocation_reject(bearer, gsm_cause); + ogs_expect_or_return(gsmbuf); + + rv = nas_5gs_send_to_downlink_nas_transport(amf_ue, gsmbuf); + ogs_expect(rv == OGS_OK); +} + +void nas_5gs_send_bearer_resource_modification_reject( + amf_bearer_t *bearer, ogs_nas_gsm_cause_t gsm_cause) +{ + int rv; + amf_ue_t *amf_ue; + ogs_pkbuf_t *gsmbuf = NULL; + + ogs_assert(bearer); + amf_ue = bearer->amf_ue; + ogs_assert(bearer); + + gsmbuf = esm_build_bearer_resource_modification_reject(bearer, gsm_cause); + ogs_expect_or_return(gsmbuf); + + rv = nas_5gs_send_to_downlink_nas_transport(amf_ue, gsmbuf); + ogs_expect(rv == OGS_OK); +} + +void nas_5gs_send_tau_accept( + amf_ue_t *amf_ue, NGAP_ProcedureCode_t procedureCode) +{ + int rv; + ogs_pkbuf_t *gmmbuf = NULL; + + ogs_assert(amf_ue); + + ogs_debug("Tracking area update accept"); + ogs_debug(" IMSI[%s]", amf_ue->imsi_bcd); + + gmmbuf = gmm_build_tau_accept(amf_ue); + ogs_expect_or_return(gmmbuf); + + if (procedureCode == NGAP_ProcedureCode_id_InitialContextSetup) { + ogs_pkbuf_t *ngapbuf = NULL; + ngapbuf = ngap_build_initial_context_setup_request(amf_ue, gmmbuf); + ogs_expect_or_return(ngapbuf); + + rv = nas_5gs_send_to_gnb(amf_ue, ngapbuf); + ogs_expect(rv == OGS_OK); + } else if (procedureCode == NGAP_ProcedureCode_id_downlinkNASTransport) { + rv = nas_5gs_send_to_downlink_nas_transport(amf_ue, gmmbuf); + ogs_expect(rv == OGS_OK); + } else + ogs_assert_if_reached(); +} + +void nas_5gs_send_tau_reject(amf_ue_t *amf_ue, ogs_nas_gmm_cause_t gmm_cause) +{ + int rv; + ogs_pkbuf_t *gmmbuf = NULL; + + ogs_assert(amf_ue); + + /* Build TAU reject */ + gmmbuf = gmm_build_tau_reject(gmm_cause, amf_ue); + ogs_expect_or_return(gmmbuf); + + rv = nas_5gs_send_to_downlink_nas_transport(amf_ue, gmmbuf); + ogs_expect(rv == OGS_OK); +} + +void nas_5gs_send_service_reject(amf_ue_t *amf_ue, + ogs_nas_gmm_cause_t gmm_cause) +{ + int rv; + ogs_pkbuf_t *gmmbuf = NULL; + + ogs_assert(amf_ue); + + /* Build Service Reject */ + gmmbuf = gmm_build_service_reject(gmm_cause, amf_ue); + ogs_expect_or_return(gmmbuf); + + rv = nas_5gs_send_to_downlink_nas_transport(amf_ue, gmmbuf); + ogs_expect(rv == OGS_OK); +} + +void nas_5gs_send_cs_service_notification(amf_ue_t *amf_ue) +{ + int rv; + ogs_pkbuf_t *gmmbuf = NULL; + + ogs_assert(amf_ue); + + ogs_debug("CS Service Notification"); + ogs_debug(" IMSI[%s]", amf_ue->imsi_bcd); + + gmmbuf = gmm_build_cs_service_notification(amf_ue); + ogs_expect_or_return(gmmbuf); + + rv = nas_5gs_send_to_downlink_nas_transport(amf_ue, gmmbuf); + ogs_expect(rv == OGS_OK); +} + +void nas_5gs_send_downlink_nas_transport( + amf_ue_t *amf_ue, uint8_t *buffer, uint8_t length) +{ + int rv; + ogs_pkbuf_t *gmmbuf = NULL; + + ogs_assert(amf_ue); + ogs_assert(buffer); + ogs_assert(length); + + ogs_debug("Downlink NAS transport"); + ogs_debug(" IMSI[%s]", amf_ue->imsi_bcd); + + gmmbuf = gmm_build_downlink_nas_transport(amf_ue, buffer, length); + ogs_expect_or_return(gmmbuf); + + rv = nas_5gs_send_to_downlink_nas_transport(amf_ue, gmmbuf); + ogs_expect(rv == OGS_OK); +} +#endif diff --git a/src/amf/nas-path.h b/src/amf/nas-path.h new file mode 100644 index 0000000000..c8ee7cb0ae --- /dev/null +++ b/src/amf/nas-path.h @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef NAS_5GS_PATH_H +#define NAS_5GS_PATH_H + +#include "context.h" + +#ifdef __cplusplus +extern "C" { +#endif + +int nas_5gs_send_to_gnb(amf_ue_t *amf_ue, ogs_pkbuf_t *pkbuf); +#if 0 +int nas_5gs_send_gmm_to_gsm( + amf_ue_t *amf_ue, ogs_nas_5gsm_message_container_t *esm_message_container); +#endif +int nas_5gs_send_to_downlink_nas_transport( + amf_ue_t *amf_ue, ogs_pkbuf_t *pkbuf); + +void nas_5gs_send_nas_reject( + amf_ue_t *amf_ue, ogs_nas_5gmm_cause_t gmm_cause); +void nas_5gs_send_nas_reject_from_sbi( + amf_ue_t *amf_ue, int status); + +void nas_5gs_send_registration_accept(amf_ue_t *amf_ue); +void nas_5gs_send_registration_reject( + amf_ue_t *amf_ue, ogs_nas_5gmm_cause_t gmm_cause); + +void nas_5gs_send_identity_request(amf_ue_t *amf_ue); + +void nas_5gs_send_authentication_request(amf_ue_t *amf_ue); +void nas_5gs_send_authentication_reject(amf_ue_t *amf_ue); + +void nas_5gs_send_security_mode_command(amf_ue_t *amf_ue); + +#if 0 +void nas_5gs_send_detach_accept(amf_ue_t *amf_ue); + +void nas_5gs_send_pdn_connectivity_reject( + amf_sess_t *sess, ogs_nas_5gsm_cause_t gsm_cause); +void nas_5gs_send_gsm_information_request(amf_bearer_t *bearer); +void nas_5gs_send_activate_default_bearer_context_request(amf_bearer_t *bearer); +void nas_5gs_send_activate_dedicated_bearer_context_request( + amf_bearer_t *bearer); +void nas_5gs_send_activate_all_dedicated_bearers(amf_bearer_t *default_bearer); +void nas_5gs_send_modify_bearer_context_request( + amf_bearer_t *bearer, int qos_presence, int tft_presence); +void nas_5gs_send_deactivate_bearer_context_request(amf_bearer_t *bearer); +void nas_5gs_send_bearer_resource_allocation_reject( + amf_bearer_t *bearer, ogs_nas_5gsm_cause_t gsm_cause); +void nas_5gs_send_bearer_resource_modification_reject( + amf_bearer_t *bearer, ogs_nas_5gsm_cause_t gsm_cause); + +void nas_5gs_send_tau_accept( + amf_ue_t *amf_ue, S1AP_ProcedureCode_t procedureCode); +void nas_5gs_send_tau_reject(amf_ue_t *amf_ue, ogs_nas_5gsm_cause_t gmm_cause); + +void nas_5gs_send_service_reject( + amf_ue_t *amf_ue, ogs_nas_5gmm_cause_t gmm_cause); + +void nas_5gs_send_cs_service_notification(amf_ue_t *amf_ue); +void nas_5gs_send_downlink_nas_transport( + amf_ue_t *amf_ue, uint8_t *buffer, uint8_t length); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* NAS_5GS_PATH_H */ diff --git a/src/amf/nas-security.c b/src/amf/nas-security.c new file mode 100644 index 0000000000..731205a29c --- /dev/null +++ b/src/amf/nas-security.c @@ -0,0 +1,192 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "nas-security.h" + +#define NAS_SECURITY_DOWNLINK_DIRECTION 1 +#define NAS_SECURITY_UPLINK_DIRECTION 0 + +#define NAS_SECURITY_MAC_SIZE 4 + +ogs_pkbuf_t *nas_5gs_security_encode( + amf_ue_t *amf_ue, ogs_nas_5gs_message_t *message) +{ + int integrity_protected = 0; + int new_security_context = 0; + int ciphered = 0; + ogs_nas_5gs_security_header_t h; + ogs_pkbuf_t *new = NULL; + + ogs_assert(amf_ue); + ogs_assert(message); + + switch (message->h.security_header_type) { + case OGS_NAS_SECURITY_HEADER_PLAIN_NAS_MESSAGE: + return ogs_nas_5gs_plain_encode(message); + case OGS_NAS_SECURITY_HEADER_INTEGRITY_PROTECTED: + integrity_protected = 1; + break; + case OGS_NAS_SECURITY_HEADER_INTEGRITY_PROTECTED_AND_CIPHERED: + integrity_protected = 1; + ciphered = 1; + break; + case OGS_NAS_SECURITY_HEADER_INTEGRITY_PROTECTED_AND_NEW_SECURITY_CONTEXT: + integrity_protected = 1; + new_security_context = 1; + break; + case OGS_NAS_SECURITY_HEADER_INTEGRITY_PROTECTED_AND_CIPHTERD_WITH_NEW_INTEGRITY_CONTEXT: + integrity_protected = 1; + new_security_context = 1; + ciphered = 1; + break; + default: + ogs_error("Not implemented(securiry header type:0x%x)", + message->h.security_header_type); + return NULL; + } + + if (new_security_context) { + amf_ue->dl_count = 0; + amf_ue->ul_count.i32 = 0; + } + + if (amf_ue->selected_enc_algorithm == 0) + ciphered = 0; + if (amf_ue->selected_int_algorithm == 0) + integrity_protected = 0; + + memset(&h, 0, sizeof(h)); + h.security_header_type = message->h.security_header_type; + h.extended_protocol_discriminator = + message->h.extended_protocol_discriminator; + h.sequence_number = (amf_ue->dl_count & 0xff); + + new = ogs_nas_5gs_plain_encode(message); + if (!new) { + ogs_error("ogs_nas_5gs_plain_encode() failed"); + return NULL; + } + + if (ciphered) { + /* encrypt NAS message */ + ogs_nas_encrypt(amf_ue->selected_enc_algorithm, + amf_ue->knas_enc, amf_ue->dl_count, + amf_ue->nas.connection_identifier, + NAS_SECURITY_DOWNLINK_DIRECTION, new); + } + + /* encode sequence number */ + ogs_assert(ogs_pkbuf_push(new, 1)); + *(uint8_t *)(new->data) = h.sequence_number; + + if (integrity_protected) { + uint8_t mac[NAS_SECURITY_MAC_SIZE]; + + /* calculate NAS MAC(message authentication code) */ + ogs_nas_mac_calculate(amf_ue->selected_int_algorithm, + amf_ue->knas_int, amf_ue->dl_count, + amf_ue->nas.connection_identifier, + NAS_SECURITY_DOWNLINK_DIRECTION, new, mac); + memcpy(&h.message_authentication_code, mac, sizeof(mac)); + } + + /* increase dl_count */ + amf_ue->dl_count = (amf_ue->dl_count + 1) & 0xffffff; /* Use 24bit */ + + /* encode all security header */ + ogs_assert(ogs_pkbuf_push(new, 6)); + memcpy(new->data, &h, sizeof(ogs_nas_5gs_security_header_t)); + + amf_ue->security_context_available = 1; + + return new; +} + +int nas_5gs_security_decode(amf_ue_t *amf_ue, + ogs_nas_security_header_type_t security_header_type, ogs_pkbuf_t *pkbuf) +{ + ogs_assert(amf_ue); + ogs_assert(pkbuf); + ogs_assert(pkbuf->data); + + if (!amf_ue->security_context_available) { + security_header_type.integrity_protected = 0; + security_header_type.new_security_context = 0; + security_header_type.ciphered = 0; + } + + if (security_header_type.new_security_context) { + amf_ue->ul_count.i32 = 0; + } + + if (amf_ue->selected_enc_algorithm == 0) + security_header_type.ciphered = 0; + if (amf_ue->selected_int_algorithm == 0) + security_header_type.integrity_protected = 0; + + if (security_header_type.ciphered || + security_header_type.integrity_protected) { + ogs_nas_5gs_security_header_t *h = NULL; + + /* NAS Security Header */ + ogs_assert(ogs_pkbuf_push(pkbuf, 7)); + h = (ogs_nas_5gs_security_header_t *)pkbuf->data; + + /* NAS Security Header.Sequence_Number */ + ogs_assert(ogs_pkbuf_pull(pkbuf, 6)); + + /* calculate ul_count */ + if (amf_ue->ul_count.sqn > h->sequence_number) + amf_ue->ul_count.overflow++; + amf_ue->ul_count.sqn = h->sequence_number; + + if (security_header_type.integrity_protected) { + uint8_t mac[NAS_SECURITY_MAC_SIZE]; + uint32_t mac32; + uint32_t original_mac = h->message_authentication_code; + + /* calculate NAS MAC(message authentication code) */ + ogs_nas_mac_calculate(amf_ue->selected_int_algorithm, + amf_ue->knas_int, amf_ue->ul_count.i32, + amf_ue->nas.connection_identifier, + NAS_SECURITY_UPLINK_DIRECTION, pkbuf, mac); + h->message_authentication_code = original_mac; + + memcpy(&mac32, mac, NAS_SECURITY_MAC_SIZE); + if (h->message_authentication_code != mac32) { + ogs_warn("NAS MAC verification failed(0x%x != 0x%x)", + ntohl(h->message_authentication_code), ntohl(mac32)); + amf_ue->mac_failed = 1; + } + } + + /* NAS EMM Header or ESM Header */ + ogs_assert(ogs_pkbuf_pull(pkbuf, 1)); + + if (security_header_type.ciphered) { + /* decrypt NAS message */ + ogs_nas_encrypt(amf_ue->selected_enc_algorithm, + amf_ue->knas_enc, amf_ue->ul_count.i32, + amf_ue->nas.connection_identifier, + NAS_SECURITY_UPLINK_DIRECTION, pkbuf); + } + } + + return OGS_OK; +} diff --git a/src/amf/nas-security.h b/src/amf/nas-security.h new file mode 100644 index 0000000000..57c2511605 --- /dev/null +++ b/src/amf/nas-security.h @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef NAS_5GS_SECURITY_H +#define NAS_5GS_SECURITY_H + +#include "ogs-crypt.h" +#include "context.h" + +#ifdef __cplusplus +extern "C" { +#endif + +ogs_pkbuf_t *nas_5gs_security_encode( + amf_ue_t *amf_ue, ogs_nas_5gs_message_t *message); +int nas_5gs_security_decode(amf_ue_t *amf_ue, + ogs_nas_security_header_type_t security_header_type, ogs_pkbuf_t *pkbuf); + +#ifdef __cplusplus +} +#endif + +#endif /* NAS_5GS_SECURITY_H */ + diff --git a/src/amf/nausf-build.c b/src/amf/nausf-build.c new file mode 100644 index 0000000000..9800cfda94 --- /dev/null +++ b/src/amf/nausf-build.c @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "nausf-build.h" + +ogs_sbi_request_t *amf_nausf_auth_build_authenticate(amf_ue_t *amf_ue) +{ + ogs_sbi_message_t message; + ogs_sbi_request_t *request = NULL; + + OpenAPI_authentication_info_t *AuthenticationInfo = NULL; + + ogs_assert(amf_ue); + + memset(&message, 0, sizeof(message)); + message.h.method = (char *)OGS_SBI_HTTP_METHOD_POST; + message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NAUSF_AUTH; + message.h.api.version = (char *)OGS_SBI_API_VERSION; + message.h.resource.component[0] = + (char *)OGS_SBI_RESOURCE_NAME_UE_AUTHENTICATIONS; + + message.http.accept = (char *)(OGS_SBI_CONTENT_3GPPHAL_TYPE "," + OGS_SBI_CONTENT_PROBLEM_TYPE); + + AuthenticationInfo = ogs_calloc(1, sizeof(*AuthenticationInfo)); + ogs_assert(AuthenticationInfo); + + ogs_assert(amf_ue->suci); + AuthenticationInfo->supi_or_suci = amf_ue->suci; + AuthenticationInfo->serving_network_name = + ogs_plmn_id_string(&amf_ue->tai.plmn_id); + + message.AuthenticationInfo = AuthenticationInfo; + + request = ogs_sbi_build_request(&message); + ogs_assert(request); + + ogs_free(AuthenticationInfo->serving_network_name); + ogs_free(AuthenticationInfo); + + return request; +} + +ogs_sbi_request_t *amf_nausf_auth_build_authenticate_confirmation( + amf_ue_t *amf_ue) +{ + ogs_sbi_message_t message; + ogs_sbi_request_t *request = NULL; + + char xres_star_string[OGS_KEYSTRLEN(OGS_MAX_RES_LEN)]; + + OpenAPI_confirmation_data_t *ConfirmationData = NULL; + + ogs_assert(amf_ue); + ogs_assert(amf_ue->confirmation_url_for_5g_aka); + + memset(&message, 0, sizeof(message)); + message.h.method = (char *)OGS_SBI_HTTP_METHOD_PUT; + message.h.url = amf_ue->confirmation_url_for_5g_aka; + + ConfirmationData = ogs_calloc(1, sizeof(*ConfirmationData)); + ogs_assert(ConfirmationData); + + ogs_hex_to_ascii(amf_ue->xres_star, sizeof(amf_ue->xres_star), + xres_star_string, sizeof(xres_star_string)); + + ConfirmationData->res_star = xres_star_string; + + message.ConfirmationData = ConfirmationData; + + request = ogs_sbi_build_request(&message); + ogs_assert(request); + + ogs_free(ConfirmationData); + + return request; +} diff --git a/src/amf/nausf-build.h b/src/amf/nausf-build.h new file mode 100644 index 0000000000..c59d42b903 --- /dev/null +++ b/src/amf/nausf-build.h @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef AMF_NAUSF_BUILD_H +#define AMF_NAUSF_BUILD_H + +#include "context.h" + +#ifdef __cplusplus +extern "C" { +#endif + +ogs_sbi_request_t *amf_nausf_auth_build_authenticate(amf_ue_t *amf_ue); +ogs_sbi_request_t *amf_nausf_auth_build_authenticate_confirmation( + amf_ue_t *amf_ue); + +#ifdef __cplusplus +} +#endif + +#endif /* AMF_NAUSF_BUILD_H */ diff --git a/src/amf/nausf-handler.c b/src/amf/nausf-handler.c new file mode 100644 index 0000000000..38ea2fd362 --- /dev/null +++ b/src/amf/nausf-handler.c @@ -0,0 +1,155 @@ +/* + * Copyright (C) 2019 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "nausf-handler.h" +#include "nas-path.h" + +int amf_nausf_auth_handle_authenticate( + amf_ue_t *amf_ue, ogs_sbi_message_t *message) +{ + OpenAPI_ue_authentication_ctx_t *UeAuthenticationCtx = NULL; + OpenAPI_av5g_aka_t *AV5G_AKA = NULL; + OpenAPI_links_value_schema_t *LinksValueSchemeValue = NULL; + OpenAPI_map_t *LinksValueScheme = NULL; + OpenAPI_lnode_t *node = NULL; + + ogs_assert(amf_ue); + ogs_assert(message); + + UeAuthenticationCtx = message->UeAuthenticationCtx; + if (!UeAuthenticationCtx) { + ogs_error("[%s] No UeAuthenticationCtx", amf_ue->suci); + return OGS_ERROR; + } + + if (UeAuthenticationCtx->auth_type != OpenAPI_auth_type_5G_AKA) { + ogs_error("[%s] Not supported Auth Method [%d]", + amf_ue->suci, UeAuthenticationCtx->auth_type); + return OGS_ERROR; + } + + AV5G_AKA = UeAuthenticationCtx->_5g_auth_data; + if (!AV5G_AKA) { + ogs_error("[%s] No Av5gAka", amf_ue->suci); + return OGS_ERROR; + } + + if (!AV5G_AKA->rand) { + ogs_error("[%s] No Av5gAka.rand", amf_ue->suci); + return OGS_ERROR; + } + + if (!AV5G_AKA->hxres_star) { + ogs_error("[%s] No Av5gAka.hxresStar", amf_ue->suci); + return OGS_ERROR; + } + + if (!AV5G_AKA->autn) { + ogs_error("[%s] No Av5gAka.autn", amf_ue->suci); + return OGS_ERROR; + } + + if (!UeAuthenticationCtx->_links) { + ogs_error("[%s] No _links", amf_ue->suci); + return OGS_ERROR; + } + + OpenAPI_list_for_each(UeAuthenticationCtx->_links, node) { + LinksValueScheme = node->data; + if (LinksValueScheme) { + if (strcmp(LinksValueScheme->key, + OGS_SBI_RESOURCE_NAME_5G_AKA) == 0) { + LinksValueSchemeValue = LinksValueScheme->value; + break; + } + } + } + + if (!LinksValueSchemeValue) { + ogs_error("[%s] No _links.5g-aka", amf_ue->suci); + return OGS_ERROR; + } + + if (!LinksValueSchemeValue->href) { + ogs_error("[%s] No _links.5g-aka.href", amf_ue->suci); + return OGS_ERROR; + } + + if (amf_ue->confirmation_url_for_5g_aka) + ogs_free(amf_ue->confirmation_url_for_5g_aka); + + amf_ue->confirmation_url_for_5g_aka = + ogs_strdup(LinksValueSchemeValue->href); + + ogs_ascii_to_hex(AV5G_AKA->rand, strlen(AV5G_AKA->rand), + amf_ue->rand, sizeof(amf_ue->rand)); + ogs_ascii_to_hex(AV5G_AKA->hxres_star, strlen(AV5G_AKA->hxres_star), + amf_ue->hxres_star, sizeof(amf_ue->hxres_star)); + ogs_ascii_to_hex(AV5G_AKA->autn, strlen(AV5G_AKA->autn), + amf_ue->autn, sizeof(amf_ue->autn)); + + nas_5gs_send_authentication_request(amf_ue); + + return OGS_OK; +} + +int amf_nausf_auth_handle_authenticate_confirmation( + amf_ue_t *amf_ue, ogs_sbi_message_t *message) +{ + uint8_t kseaf[OGS_SHA256_DIGEST_SIZE]; + + OpenAPI_confirmation_data_response_t *ConfirmationDataResponse; + + ogs_assert(amf_ue); + ogs_assert(message); + + ConfirmationDataResponse = message->ConfirmationDataResponse; + if (!ConfirmationDataResponse) { + ogs_error("[%s] No ConfirmationDataResponse", amf_ue->suci); + return OGS_ERROR; + } + + if (!ConfirmationDataResponse->supi) { + ogs_error("[%s] No supi", amf_ue->suci); + return OGS_ERROR; + } + + if (!ConfirmationDataResponse->kseaf) { + ogs_error("[%s] No Kseaf", amf_ue->suci); + return OGS_ERROR; + } + + amf_ue->auth_result = ConfirmationDataResponse->auth_result; + if (amf_ue->auth_result == OpenAPI_auth_result_AUTHENTICATION_SUCCESS) { + + amf_ue_set_supi(amf_ue, ConfirmationDataResponse->supi); + ogs_ascii_to_hex(ConfirmationDataResponse->kseaf, + strlen(ConfirmationDataResponse->kseaf), kseaf, sizeof(kseaf)); + + ogs_kdf_kamf(amf_ue->supi, amf_ue->abba, amf_ue->abba_len, + kseaf, amf_ue->kamf); + + return OGS_OK; + + } else { + + ogs_error("[%s] Authentication failed", amf_ue->suci); + return OGS_ERROR; + } +} diff --git a/src/amf/nausf-handler.h b/src/amf/nausf-handler.h new file mode 100644 index 0000000000..b6f2ea269a --- /dev/null +++ b/src/amf/nausf-handler.h @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2019 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef AMF_NAUSF_HANDLER_H +#define AMF_NAUSF_HANDLER_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "context.h" + +int amf_nausf_auth_handle_authenticate( + amf_ue_t *amf_ue, ogs_sbi_message_t *message); +int amf_nausf_auth_handle_authenticate_confirmation( + amf_ue_t *amf_ue, ogs_sbi_message_t *message); + +#ifdef __cplusplus +} +#endif + +#endif /* AMF_NAUSF_HANDLER_H */ diff --git a/src/amf/nf-sm.c b/src/amf/nf-sm.c index e70452a442..d19a1c6cce 100644 --- a/src/amf/nf-sm.c +++ b/src/amf/nf-sm.c @@ -118,7 +118,7 @@ void amf_nf_state_will_register(ogs_fsm_t *s, amf_event_t *e) amf_timer_cfg(AMF_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL)-> duration); - amf_sbi_send_nf_register(nf_instance); + ogs_nnrf_nfm_send_nf_register(nf_instance); break; case OGS_FSM_EXIT_SIG: @@ -130,9 +130,9 @@ void amf_nf_state_will_register(ogs_fsm_t *s, amf_event_t *e) ogs_assert(message); SWITCH(message->h.service.name) - CASE(OGS_SBI_SERVICE_NAME_NRF_NFM) + CASE(OGS_SBI_SERVICE_NAME_NNRF_NFM) - SWITCH(message->h.resource.name) + SWITCH(message->h.resource.component[0]) CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES) if (message->res_status == OGS_SBI_HTTP_STATUS_OK || @@ -140,20 +140,21 @@ void amf_nf_state_will_register(ogs_fsm_t *s, amf_event_t *e) amf_nnrf_handle_nf_register(nf_instance, message); OGS_FSM_TRAN(s, &amf_nf_state_registered); } else { - ogs_error("HTTP Response Status Code [%d]", - message->res_status); + ogs_error("[%s] HTTP Response Status Code [%d]", + nf_instance->id, message->res_status); OGS_FSM_TRAN(s, &amf_nf_state_exception); } break; DEFAULT - ogs_error("Invalid resource name [%s]", - message->h.resource.name); + ogs_error("[%s] Invalid resource name [%s]", + nf_instance->id, message->h.resource.component[0]); END break; DEFAULT - ogs_error("Invalid API name [%s]", message->h.service.name); + ogs_error("[%s] Invalid API name [%s]", + nf_instance->id, message->h.service.name); END break; @@ -165,17 +166,17 @@ void amf_nf_state_will_register(ogs_fsm_t *s, amf_event_t *e) addr = client->addr; ogs_assert(addr); - ogs_warn("Retry to registration with NRF [%s]", nf_instance->id); + ogs_warn("[%s] Retry to registration with NRF", nf_instance->id); ogs_timer_start(nf_instance->t_registration_interval, amf_timer_cfg(AMF_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL)-> duration); - amf_sbi_send_nf_register(nf_instance); + ogs_nnrf_nfm_send_nf_register(nf_instance); break; default: - ogs_error("Unknown timer[%s:%d]", + ogs_error("[%s] Unknown timer[%s:%d]", nf_instance->id, amf_timer_get_name(e->timer_id), e->timer_id); } break; @@ -202,7 +203,7 @@ void amf_nf_state_registered(ogs_fsm_t *s, amf_event_t *e) switch (e->id) { case OGS_FSM_ENTRY_SIG: if (NF_INSTANCE_IS_SELF(nf_instance->id)) { - ogs_info("NF registered [%s]", nf_instance->id); + ogs_info("[%s] NF registered", nf_instance->id); client = nf_instance->client; ogs_assert(client); @@ -215,7 +216,7 @@ void amf_nf_state_registered(ogs_fsm_t *s, amf_event_t *e) OGS_SBI_HEARTBEAT_RETRYCOUNT)); } - amf_sbi_send_nf_status_subscribe(client, + ogs_nnrf_nfm_send_nf_status_subscribe(client, amf_self()->nf_type, nf_instance->id); } @@ -223,14 +224,14 @@ void amf_nf_state_registered(ogs_fsm_t *s, amf_event_t *e) case OGS_FSM_EXIT_SIG: if (NF_INSTANCE_IS_SELF(nf_instance->id)) { - ogs_info("NF de-registered [%s]", nf_instance->id); + ogs_info("[%s] NF de-registered", nf_instance->id); if (nf_instance->time.heartbeat) { ogs_timer_stop(nf_instance->t_heartbeat_interval); ogs_timer_stop(nf_instance->t_heartbeat); } - amf_sbi_send_nf_de_register(nf_instance); + ogs_nnrf_nfm_send_nf_de_register(nf_instance); } break; @@ -239,9 +240,9 @@ void amf_nf_state_registered(ogs_fsm_t *s, amf_event_t *e) ogs_assert(message); SWITCH(message->h.service.name) - CASE(OGS_SBI_SERVICE_NAME_NRF_NFM) + CASE(OGS_SBI_SERVICE_NAME_NNRF_NFM) - SWITCH(message->h.resource.name) + SWITCH(message->h.resource.component[0]) CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES) if (message->res_status == OGS_SBI_HTTP_STATUS_NO_CONTENT || @@ -251,19 +252,21 @@ void amf_nf_state_registered(ogs_fsm_t *s, amf_event_t *e) ogs_time_from_sec(nf_instance->time.heartbeat * OGS_SBI_HEARTBEAT_RETRYCOUNT)); } else { - ogs_error("HTTP response error : %d", message->res_status); + ogs_error("[%s] HTTP response error [%d]", + nf_instance->id, message->res_status); } break; DEFAULT - ogs_error("Invalid resource name [%s]", - message->h.resource.name); + ogs_error("[%s] Invalid resource name [%s]", + nf_instance->id, message->h.resource.component[0]); END break; DEFAULT - ogs_error("Invalid API name [%s]", message->h.service.name); + ogs_error("[%s] Invalid API name [%s]", + nf_instance->id, message->h.service.name); END break; @@ -275,7 +278,7 @@ void amf_nf_state_registered(ogs_fsm_t *s, amf_event_t *e) ogs_time_from_sec(nf_instance->time.heartbeat)); } - amf_sbi_send_nf_update(nf_instance); + ogs_nnrf_nfm_send_nf_update(nf_instance); break; case AMF_TIMER_NF_INSTANCE_HEARTBEAT: @@ -284,13 +287,13 @@ void amf_nf_state_registered(ogs_fsm_t *s, amf_event_t *e) case AMF_TIMER_NF_INSTANCE_VALIDITY: if (NF_INSTANCE_IS_OTHERS(nf_instance->id)) { - ogs_info("NF expired [%s]", nf_instance->id); + ogs_info("[%s] NF expired", nf_instance->id); OGS_FSM_TRAN(s, &amf_nf_state_de_registered); } break; default: - ogs_error("Unknown timer[%s:%d]", + ogs_error("[%s] Unknown timer[%s:%d]", nf_instance->id, amf_timer_get_name(e->timer_id), e->timer_id); break; } @@ -316,7 +319,7 @@ void amf_nf_state_de_registered(ogs_fsm_t *s, amf_event_t *e) switch (e->id) { case OGS_FSM_ENTRY_SIG: if (NF_INSTANCE_IS_SELF(nf_instance->id)) { - ogs_info("NF de-registered [%s]", nf_instance->id); + ogs_info("[%s] NF de-registered", nf_instance->id); } break; @@ -365,20 +368,21 @@ void amf_nf_state_exception(ogs_fsm_t *s, amf_event_t *e) addr = client->addr; ogs_assert(addr); - ogs_warn("Retry to registration with NRF [%s]", nf_instance->id); + ogs_warn("[%s] Retry to registration with NRF", nf_instance->id); OGS_FSM_TRAN(s, &amf_nf_state_will_register); break; default: - ogs_error("Unknown timer[%s:%d]", + ogs_error("[%s] Unknown timer[%s:%d]", nf_instance->id, amf_timer_get_name(e->timer_id), e->timer_id); break; } break; default: - ogs_error("Unknown event %s", amf_event_get_name(e)); + ogs_error("[%s] Unknown event %s", + nf_instance->id, amf_event_get_name(e)); break; } } diff --git a/src/amf/ngap-build.c b/src/amf/ngap-build.c index 4ef046c489..92fc7bcac6 100644 --- a/src/amf/ngap-build.c +++ b/src/amf/ngap-build.c @@ -17,12 +17,9 @@ * along with this program. If not, see . */ -#if 0 -#include "amf-kdf.h" -#endif #include "ngap-build.h" -ogs_pkbuf_t *ngap_build_setup_rsp(void) +ogs_pkbuf_t *ngap_build_ng_setup_response(void) { int i, j; @@ -38,7 +35,7 @@ ogs_pkbuf_t *ngap_build_setup_rsp(void) memset(&pdu, 0, sizeof (NGAP_NGAP_PDU_t)); pdu.present = NGAP_NGAP_PDU_PR_successfulOutcome; - pdu.choice.successfulOutcome = + pdu.choice.successfulOutcome = CALLOC(1, sizeof(NGAP_SuccessfulOutcome_t)); successfulOutcome = pdu.choice.successfulOutcome; @@ -110,10 +107,10 @@ ogs_pkbuf_t *ngap_build_setup_rsp(void) ogs_ngap_uint8_to_AMFRegionID( ogs_amf_region_id(&amf_self()->served_guami[i].amf_id), aMFRegionID); - ogs_ngap_uint16_to_NGAP_AMFSetID( + ogs_ngap_uint16_to_AMFSetID( ogs_amf_set_id(&amf_self()->served_guami[i].amf_id), aMFSetID); - ogs_ngap_uint8_to_NGAP_NGAP_AMFPointer( + ogs_ngap_uint8_to_AMFPointer( ogs_amf_pointer(&amf_self()->served_guami[i].amf_id), aMFPointer); @@ -163,7 +160,7 @@ ogs_pkbuf_t *ngap_build_setup_rsp(void) return ogs_ngap_encode(&pdu); } -ogs_pkbuf_t *ngap_build_setup_failure( +ogs_pkbuf_t *ngap_build_ng_setup_failure( NGAP_Cause_PR group, long cause, long time_to_wait) { NGAP_NGAP_PDU_t pdu; @@ -179,7 +176,7 @@ ogs_pkbuf_t *ngap_build_setup_failure( memset(&pdu, 0, sizeof (NGAP_NGAP_PDU_t)); pdu.present = NGAP_NGAP_PDU_PR_unsuccessfulOutcome; - pdu.choice.unsuccessfulOutcome = + pdu.choice.unsuccessfulOutcome = CALLOC(1, sizeof(NGAP_UnsuccessfulOutcome_t)); unsuccessfulOutcome = pdu.choice.unsuccessfulOutcome; @@ -190,15 +187,6 @@ ogs_pkbuf_t *ngap_build_setup_failure( NGSetupFailure = &unsuccessfulOutcome->value.choice.NGSetupFailure; - ie = CALLOC(1, sizeof(NGAP_NGSetupFailureIEs_t)); - ASN_SEQUENCE_ADD(&NGSetupFailure->protocolIEs, ie); - - ie->id = NGAP_ProtocolIE_ID_id_Cause; - ie->criticality = NGAP_Criticality_ignore; - ie->value.present = NGAP_NGSetupFailureIEs__value_PR_Cause; - - Cause = &ie->value.choice.Cause; - if (time_to_wait > -1) { ie = CALLOC(1, sizeof(NGAP_NGSetupFailureIEs_t)); ASN_SEQUENCE_ADD(&NGSetupFailure->protocolIEs, ie); @@ -210,6 +198,14 @@ ogs_pkbuf_t *ngap_build_setup_failure( TimeToWait = &ie->value.choice.TimeToWait; } + ie = CALLOC(1, sizeof(NGAP_NGSetupFailureIEs_t)); + ASN_SEQUENCE_ADD(&NGSetupFailure->protocolIEs, ie); + + ie->id = NGAP_ProtocolIE_ID_id_Cause; + ie->criticality = NGAP_Criticality_ignore; + ie->value.present = NGAP_NGSetupFailureIEs__value_PR_Cause; + + Cause = &ie->value.choice.Cause; Cause->present = group; Cause->choice.radioNetwork = cause; @@ -219,9 +215,8 @@ ogs_pkbuf_t *ngap_build_setup_failure( return ogs_ngap_encode(&pdu); } -#if 0 ogs_pkbuf_t *ngap_build_downlink_nas_transport( - gnb_ue_t *gnb_ue, ogs_pkbuf_t *emmbuf) + ran_ue_t *ran_ue, ogs_pkbuf_t *gmmbuf) { NGAP_NGAP_PDU_t pdu; NGAP_InitiatingMessage_t *initiatingMessage = NULL; @@ -229,22 +224,22 @@ ogs_pkbuf_t *ngap_build_downlink_nas_transport( NGAP_DownlinkNASTransport_IEs_t *ie = NULL; NGAP_AMF_UE_NGAP_ID_t *AMF_UE_NGAP_ID = NULL; - NGAP_ENB_UE_NGAP_ID_t *ENB_UE_NGAP_ID = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; NGAP_NAS_PDU_t *NAS_PDU = NULL; - ogs_assert(emmbuf); - ogs_assert(gnb_ue); + ogs_assert(gmmbuf); + ogs_assert(ran_ue); - ogs_debug("[AMF] DownlinkNASTransport"); + ogs_debug("DownlinkNASTransport"); memset(&pdu, 0, sizeof (NGAP_NGAP_PDU_t)); pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage; - pdu.choice.initiatingMessage = + pdu.choice.initiatingMessage = CALLOC(1, sizeof(NGAP_InitiatingMessage_t)); initiatingMessage = pdu.choice.initiatingMessage; initiatingMessage->procedureCode = - NGAP_ProcedureCode_id_downlinkNASTransport; + NGAP_ProcedureCode_id_DownlinkNASTransport; initiatingMessage->criticality = NGAP_Criticality_ignore; initiatingMessage->value.present = NGAP_InitiatingMessage__value_PR_DownlinkNASTransport; @@ -264,11 +259,11 @@ ogs_pkbuf_t *ngap_build_downlink_nas_transport( ie = CALLOC(1, sizeof(NGAP_DownlinkNASTransport_IEs_t)); ASN_SEQUENCE_ADD(&DownlinkNASTransport->protocolIEs, ie); - ie->id = NGAP_ProtocolIE_ID_id_eNB_UE_NGAP_ID; + ie->id = NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID; ie->criticality = NGAP_Criticality_reject; - ie->value.present = NGAP_DownlinkNASTransport_IEs__value_PR_ENB_UE_NGAP_ID; + ie->value.present = NGAP_DownlinkNASTransport_IEs__value_PR_RAN_UE_NGAP_ID; - ENB_UE_NGAP_ID = &ie->value.choice.ENB_UE_NGAP_ID; + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; ie = CALLOC(1, sizeof(NGAP_DownlinkNASTransport_IEs_t)); ASN_SEQUENCE_ADD(&DownlinkNASTransport->protocolIEs, ie); @@ -279,22 +274,23 @@ ogs_pkbuf_t *ngap_build_downlink_nas_transport( NAS_PDU = &ie->value.choice.NAS_PDU; - ogs_debug(" ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - gnb_ue->gnb_ue_ngap_id, gnb_ue->amf_ue_ngap_id); + ogs_debug(" RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%lld]", + ran_ue->ran_ue_ngap_id, (long long)ran_ue->amf_ue_ngap_id); - *AMF_UE_NGAP_ID = gnb_ue->amf_ue_ngap_id; - *ENB_UE_NGAP_ID = gnb_ue->gnb_ue_ngap_id; + asn_uint642INTEGER(AMF_UE_NGAP_ID, ran_ue->amf_ue_ngap_id); + *RAN_UE_NGAP_ID = ran_ue->ran_ue_ngap_id; - NAS_PDU->size = emmbuf->len; + NAS_PDU->size = gmmbuf->len; NAS_PDU->buf = CALLOC(NAS_PDU->size, sizeof(uint8_t)); - memcpy(NAS_PDU->buf, emmbuf->data, NAS_PDU->size); - ogs_pkbuf_free(emmbuf); + memcpy(NAS_PDU->buf, gmmbuf->data, NAS_PDU->size); + ogs_pkbuf_free(gmmbuf); return ogs_ngap_encode(&pdu); } +#if 0 ogs_pkbuf_t *ngap_build_initial_context_setup_request( - amf_ue_t *amf_ue, ogs_pkbuf_t *emmbuf) + amf_ue_t *amf_ue, ogs_pkbuf_t *gmmbuf) { int rv; @@ -304,28 +300,28 @@ ogs_pkbuf_t *ngap_build_initial_context_setup_request( NGAP_InitialContextSetupRequestIEs_t *ie = NULL; NGAP_AMF_UE_NGAP_ID_t *AMF_UE_NGAP_ID = NULL; - NGAP_ENB_UE_NGAP_ID_t *ENB_UE_NGAP_ID = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; NGAP_UEAggregateMaximumBitrate_t *UEAggregateMaximumBitrate = NULL; NGAP_E_RABToBeSetupListCtxtSUReq_t *E_RABToBeSetupListCtxtSUReq = NULL; NGAP_UESecurityCapabilities_t *UESecurityCapabilities = NULL; NGAP_SecurityKey_t *SecurityKey = NULL; - gnb_ue_t *gnb_ue = NULL; + ran_ue_t *ran_ue = NULL; amf_sess_t *sess = NULL; amf_bearer_t *bearer = NULL; ogs_diam_s6a_subscription_data_t *subscription_data = NULL; ogs_assert(amf_ue); - gnb_ue = amf_ue->gnb_ue; - ogs_assert(gnb_ue); + ran_ue = amf_ue->ran_ue; + ogs_assert(ran_ue); subscription_data = &amf_ue->subscription_data; ogs_assert(subscription_data); - ogs_debug("[AMF] Initial context setup request"); + ogs_debug("Initial context setup request"); memset(&pdu, 0, sizeof (NGAP_NGAP_PDU_t)); pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage; - pdu.choice.initiatingMessage = + pdu.choice.initiatingMessage = CALLOC(1, sizeof(NGAP_InitiatingMessage_t)); initiatingMessage = pdu.choice.initiatingMessage; @@ -351,12 +347,12 @@ ogs_pkbuf_t *ngap_build_initial_context_setup_request( ie = CALLOC(1, sizeof(NGAP_InitialContextSetupRequestIEs_t)); ASN_SEQUENCE_ADD(&InitialContextSetupRequest->protocolIEs, ie); - ie->id = NGAP_ProtocolIE_ID_id_eNB_UE_NGAP_ID; + ie->id = NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID; ie->criticality = NGAP_Criticality_reject; ie->value.present = - NGAP_InitialContextSetupRequestIEs__value_PR_ENB_UE_NGAP_ID; + NGAP_InitialContextSetupRequestIEs__value_PR_RAN_UE_NGAP_ID; - ENB_UE_NGAP_ID = &ie->value.choice.ENB_UE_NGAP_ID; + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; ie = CALLOC(1, sizeof(NGAP_InitialContextSetupRequestIEs_t)); ASN_SEQUENCE_ADD(&InitialContextSetupRequest->protocolIEs, ie); @@ -378,11 +374,11 @@ ogs_pkbuf_t *ngap_build_initial_context_setup_request( E_RABToBeSetupListCtxtSUReq = &ie->value.choice.E_RABToBeSetupListCtxtSUReq; - ogs_debug(" ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - gnb_ue->gnb_ue_ngap_id, gnb_ue->amf_ue_ngap_id); + ogs_debug(" RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + ran_ue->ran_ue_ngap_id, ran_ue->amf_ue_ngap_id); - *AMF_UE_NGAP_ID = gnb_ue->amf_ue_ngap_id; - *ENB_UE_NGAP_ID = gnb_ue->gnb_ue_ngap_id; + *AMF_UE_NGAP_ID = ran_ue->amf_ue_ngap_id; + *RAN_UE_NGAP_ID = ran_ue->ran_ue_ngap_id; asn_uint642INTEGER( &UEAggregateMaximumBitrate->uEaggregateMaximumBitRateUL, @@ -456,14 +452,14 @@ ogs_pkbuf_t *ngap_build_initial_context_setup_request( ogs_asn_uint32_to_OCTET_STRING( bearer->sgw_s1u_teid, &e_rab->gTP_TEID); - if (emmbuf && emmbuf->len) { + if (gmmbuf && gmmbuf->len) { nasPdu = (NGAP_NAS_PDU_t *)CALLOC( 1, sizeof(NGAP_NAS_PDU_t)); - nasPdu->size = emmbuf->len; + nasPdu->size = gmmbuf->len; nasPdu->buf = CALLOC(nasPdu->size, sizeof(uint8_t)); - memcpy(nasPdu->buf, emmbuf->data, nasPdu->size); + memcpy(nasPdu->buf, gmmbuf->data, nasPdu->size); e_rab->nAS_PDU = nasPdu; - ogs_pkbuf_free(emmbuf); + ogs_pkbuf_free(gmmbuf); } bearer = amf_bearer_next(bearer); @@ -584,23 +580,23 @@ ogs_pkbuf_t *ngap_build_ue_context_modification_request(amf_ue_t *amf_ue) NGAP_UEContextModificationRequestIEs_t *ie = NULL; NGAP_AMF_UE_NGAP_ID_t *AMF_UE_NGAP_ID = NULL; - NGAP_ENB_UE_NGAP_ID_t *ENB_UE_NGAP_ID = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; NGAP_UESecurityCapabilities_t *UESecurityCapabilities = NULL; NGAP_SecurityKey_t *SecurityKey = NULL; NGAP_CSFallbackIndicator_t *CSFallbackIndicator = NULL; NGAP_LAI_t *LAI = NULL; - gnb_ue_t *gnb_ue = NULL; + ran_ue_t *ran_ue = NULL; ogs_assert(amf_ue); - gnb_ue = amf_ue->gnb_ue; - ogs_assert(gnb_ue); + ran_ue = amf_ue->ran_ue; + ogs_assert(ran_ue); - ogs_debug("[AMF] UE context modification request"); + ogs_debug("UE context modification request"); memset(&pdu, 0, sizeof (NGAP_NGAP_PDU_t)); pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage; - pdu.choice.initiatingMessage = + pdu.choice.initiatingMessage = CALLOC(1, sizeof(NGAP_InitiatingMessage_t)); initiatingMessage = pdu.choice.initiatingMessage; @@ -626,18 +622,18 @@ ogs_pkbuf_t *ngap_build_ue_context_modification_request(amf_ue_t *amf_ue) ie = CALLOC(1, sizeof(NGAP_UEContextModificationRequestIEs_t)); ASN_SEQUENCE_ADD(&UEContextModificationRequest->protocolIEs, ie); - ie->id = NGAP_ProtocolIE_ID_id_eNB_UE_NGAP_ID; + ie->id = NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID; ie->criticality = NGAP_Criticality_reject; ie->value.present = - NGAP_UEContextModificationRequestIEs__value_PR_ENB_UE_NGAP_ID, + NGAP_UEContextModificationRequestIEs__value_PR_RAN_UE_NGAP_ID, - ENB_UE_NGAP_ID = &ie->value.choice.ENB_UE_NGAP_ID; + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; - *AMF_UE_NGAP_ID = gnb_ue->amf_ue_ngap_id; - *ENB_UE_NGAP_ID = gnb_ue->gnb_ue_ngap_id; + *AMF_UE_NGAP_ID = ran_ue->amf_ue_ngap_id; + *RAN_UE_NGAP_ID = ran_ue->ran_ue_ngap_id; - ogs_debug(" ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - gnb_ue->gnb_ue_ngap_id, gnb_ue->amf_ue_ngap_id); + ogs_debug(" RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + ran_ue->ran_ue_ngap_id, ran_ue->amf_ue_ngap_id); if (amf_ue->nas_eps.type == AMF_EPS_TYPE_EXTENDED_SERVICE_REQUEST && AMF_P_TMSI_IS_AVAILABLE(amf_ue)) { @@ -718,7 +714,7 @@ ogs_pkbuf_t *ngap_build_ue_context_modification_request(amf_ue_t *amf_ue) } ogs_pkbuf_t *ngap_build_ue_context_release_command( - gnb_ue_t *gnb_ue, NGAP_Cause_PR group, long cause) + ran_ue_t *ran_ue, NGAP_Cause_PR group, long cause) { NGAP_NGAP_PDU_t pdu; NGAP_InitiatingMessage_t *initiatingMessage = NULL; @@ -728,16 +724,16 @@ ogs_pkbuf_t *ngap_build_ue_context_release_command( NGAP_UE_NGAP_IDs_t *UE_NGAP_IDs = NULL; NGAP_Cause_t *Cause = NULL; - ogs_assert(gnb_ue); + ogs_assert(ran_ue); - if (gnb_ue->amf_ue_ngap_id == 0) { + if (ran_ue->amf_ue_ngap_id == 0) { ogs_error("invalid amf ue ngap id"); return NULL; } memset(&pdu, 0, sizeof (NGAP_NGAP_PDU_t)); pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage; - pdu.choice.initiatingMessage = + pdu.choice.initiatingMessage = CALLOC(1, sizeof(NGAP_InitiatingMessage_t)); initiatingMessage = pdu.choice.initiatingMessage; @@ -767,17 +763,17 @@ ogs_pkbuf_t *ngap_build_ue_context_release_command( Cause = &ie->value.choice.Cause; - if (gnb_ue->gnb_ue_ngap_id == INVALID_UE_NGAP_ID) { + if (ran_ue->ran_ue_ngap_id == INVALID_UE_NGAP_ID) { UE_NGAP_IDs->present = NGAP_UE_NGAP_IDs_PR_mME_UE_NGAP_ID; - UE_NGAP_IDs->choice.mME_UE_NGAP_ID = gnb_ue->amf_ue_ngap_id; + UE_NGAP_IDs->choice.mME_UE_NGAP_ID = ran_ue->amf_ue_ngap_id; } else { UE_NGAP_IDs->present = NGAP_UE_NGAP_IDs_PR_uE_NGAP_ID_pair; UE_NGAP_IDs->choice.uE_NGAP_ID_pair = CALLOC(1, sizeof(NGAP_UE_NGAP_ID_pair_t)); UE_NGAP_IDs->choice.uE_NGAP_ID_pair->mME_UE_NGAP_ID = - gnb_ue->amf_ue_ngap_id; - UE_NGAP_IDs->choice.uE_NGAP_ID_pair->eNB_UE_NGAP_ID = - gnb_ue->gnb_ue_ngap_id; + ran_ue->amf_ue_ngap_id; + UE_NGAP_IDs->choice.uE_NGAP_ID_pair->RAN_UE_NGAP_ID = + ran_ue->ran_ue_ngap_id; } Cause->present = group; @@ -788,7 +784,7 @@ ogs_pkbuf_t *ngap_build_ue_context_release_command( ogs_pkbuf_t *ngap_build_e_rab_setup_request( - amf_bearer_t *bearer, ogs_pkbuf_t *esmbuf) + amf_bearer_t *bearer, ogs_pkbuf_t *gsmbuf) { int rv; @@ -798,7 +794,7 @@ ogs_pkbuf_t *ngap_build_e_rab_setup_request( NGAP_E_RABSetupRequestIEs_t *ie = NULL; NGAP_AMF_UE_NGAP_ID_t *AMF_UE_NGAP_ID = NULL; - NGAP_ENB_UE_NGAP_ID_t *ENB_UE_NGAP_ID = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; NGAP_E_RABToBeSetupListBearerSUReq_t *E_RABToBeSetupListBearerSUReq = NULL; NGAP_E_RABToBeSetupItemBearerSUReqIEs_t *item = NULL; @@ -807,19 +803,19 @@ ogs_pkbuf_t *ngap_build_e_rab_setup_request( NGAP_NAS_PDU_t *nasPdu = NULL; amf_ue_t *amf_ue = NULL; - gnb_ue_t *gnb_ue = NULL; + ran_ue_t *ran_ue = NULL; - ogs_assert(esmbuf); + ogs_assert(gsmbuf); ogs_assert(bearer); amf_ue = bearer->amf_ue; ogs_assert(amf_ue); - gnb_ue = amf_ue->gnb_ue; - ogs_assert(gnb_ue); + ran_ue = amf_ue->ran_ue; + ogs_assert(ran_ue); memset(&pdu, 0, sizeof (NGAP_NGAP_PDU_t)); pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage; - pdu.choice.initiatingMessage = + pdu.choice.initiatingMessage = CALLOC(1, sizeof(NGAP_InitiatingMessage_t)); initiatingMessage = pdu.choice.initiatingMessage; @@ -842,11 +838,11 @@ ogs_pkbuf_t *ngap_build_e_rab_setup_request( ie = CALLOC(1, sizeof(NGAP_E_RABSetupRequestIEs_t)); ASN_SEQUENCE_ADD(&E_RABSetupRequest->protocolIEs, ie); - ie->id = NGAP_ProtocolIE_ID_id_eNB_UE_NGAP_ID; + ie->id = NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID; ie->criticality = NGAP_Criticality_reject; - ie->value.present = NGAP_E_RABSetupRequestIEs__value_PR_ENB_UE_NGAP_ID; + ie->value.present = NGAP_E_RABSetupRequestIEs__value_PR_RAN_UE_NGAP_ID; - ENB_UE_NGAP_ID = &ie->value.choice.ENB_UE_NGAP_ID; + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; ie = CALLOC(1, sizeof(NGAP_E_RABSetupRequestIEs_t)); ASN_SEQUENCE_ADD(&E_RABSetupRequest->protocolIEs, ie); @@ -859,11 +855,11 @@ ogs_pkbuf_t *ngap_build_e_rab_setup_request( E_RABToBeSetupListBearerSUReq = &ie->value.choice.E_RABToBeSetupListBearerSUReq; - ogs_debug(" ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - gnb_ue->gnb_ue_ngap_id, gnb_ue->amf_ue_ngap_id); + ogs_debug(" RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + ran_ue->ran_ue_ngap_id, ran_ue->amf_ue_ngap_id); - *AMF_UE_NGAP_ID = gnb_ue->amf_ue_ngap_id; - *ENB_UE_NGAP_ID = gnb_ue->gnb_ue_ngap_id; + *AMF_UE_NGAP_ID = ran_ue->amf_ue_ngap_id; + *RAN_UE_NGAP_ID = ran_ue->ran_ue_ngap_id; item = CALLOC(1, sizeof(NGAP_E_RABToBeSetupItemBearerSUReqIEs_t)); ASN_SEQUENCE_ADD(&E_RABToBeSetupListBearerSUReq->list, item); @@ -916,16 +912,16 @@ ogs_pkbuf_t *ngap_build_e_rab_setup_request( ogs_debug(" SGW-NGU-TEID[%d]", bearer->sgw_s1u_teid); nasPdu = &e_rab->nAS_PDU; - nasPdu->size = esmbuf->len; + nasPdu->size = gsmbuf->len; nasPdu->buf = CALLOC(nasPdu->size, sizeof(uint8_t)); - memcpy(nasPdu->buf, esmbuf->data, nasPdu->size); - ogs_pkbuf_free(esmbuf); + memcpy(nasPdu->buf, gsmbuf->data, nasPdu->size); + ogs_pkbuf_free(gsmbuf); return ogs_ngap_encode(&pdu); } ogs_pkbuf_t *ngap_build_e_rab_modify_request( - amf_bearer_t *bearer, ogs_pkbuf_t *esmbuf) + amf_bearer_t *bearer, ogs_pkbuf_t *gsmbuf) { NGAP_NGAP_PDU_t pdu; NGAP_InitiatingMessage_t *initiatingMessage = NULL; @@ -933,7 +929,7 @@ ogs_pkbuf_t *ngap_build_e_rab_modify_request( NGAP_E_RABModifyRequestIEs_t *ie = NULL; NGAP_AMF_UE_NGAP_ID_t *AMF_UE_NGAP_ID = NULL; - NGAP_ENB_UE_NGAP_ID_t *ENB_UE_NGAP_ID = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; NGAP_E_RABToBeModifiedListBearerModReq_t *E_RABToBeModifiedListBearerModReq = NULL; @@ -943,20 +939,20 @@ ogs_pkbuf_t *ngap_build_e_rab_modify_request( NGAP_NAS_PDU_t *nasPdu = NULL; amf_ue_t *amf_ue = NULL; - gnb_ue_t *gnb_ue = NULL; + ran_ue_t *ran_ue = NULL; - ogs_assert(esmbuf); + ogs_assert(gsmbuf); ogs_assert(bearer); amf_ue = bearer->amf_ue; ogs_assert(amf_ue); - gnb_ue = amf_ue->gnb_ue; - ogs_assert(gnb_ue); + ran_ue = amf_ue->ran_ue; + ogs_assert(ran_ue); - ogs_debug("[AMF] E-RAB modify request"); + ogs_debug("E-RAB modify request"); memset(&pdu, 0, sizeof (NGAP_NGAP_PDU_t)); pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage; - pdu.choice.initiatingMessage = + pdu.choice.initiatingMessage = CALLOC(1, sizeof(NGAP_InitiatingMessage_t)); initiatingMessage = pdu.choice.initiatingMessage; @@ -979,11 +975,11 @@ ogs_pkbuf_t *ngap_build_e_rab_modify_request( ie = CALLOC(1, sizeof(NGAP_E_RABModifyRequestIEs_t)); ASN_SEQUENCE_ADD(&E_RABModifyRequest->protocolIEs, ie); - ie->id = NGAP_ProtocolIE_ID_id_eNB_UE_NGAP_ID; + ie->id = NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID; ie->criticality = NGAP_Criticality_reject; - ie->value.present = NGAP_E_RABModifyRequestIEs__value_PR_ENB_UE_NGAP_ID; + ie->value.present = NGAP_E_RABModifyRequestIEs__value_PR_RAN_UE_NGAP_ID; - ENB_UE_NGAP_ID = &ie->value.choice.ENB_UE_NGAP_ID; + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; ie = CALLOC(1, sizeof(NGAP_E_RABModifyRequestIEs_t)); ASN_SEQUENCE_ADD(&E_RABModifyRequest->protocolIEs, ie); @@ -996,11 +992,11 @@ ogs_pkbuf_t *ngap_build_e_rab_modify_request( E_RABToBeModifiedListBearerModReq = &ie->value.choice.E_RABToBeModifiedListBearerModReq; - ogs_debug(" ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - gnb_ue->gnb_ue_ngap_id, gnb_ue->amf_ue_ngap_id); + ogs_debug(" RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + ran_ue->ran_ue_ngap_id, ran_ue->amf_ue_ngap_id); - *AMF_UE_NGAP_ID = gnb_ue->amf_ue_ngap_id; - *ENB_UE_NGAP_ID = gnb_ue->gnb_ue_ngap_id; + *AMF_UE_NGAP_ID = ran_ue->amf_ue_ngap_id; + *RAN_UE_NGAP_ID = ran_ue->ran_ue_ngap_id; item = CALLOC(1, sizeof(NGAP_E_RABToBeModifiedItemBearerModReqIEs_t)); ASN_SEQUENCE_ADD(&E_RABToBeModifiedListBearerModReq->list, item); @@ -1048,16 +1044,16 @@ ogs_pkbuf_t *ngap_build_e_rab_modify_request( } nasPdu = &e_rab->nAS_PDU; - nasPdu->size = esmbuf->len; + nasPdu->size = gsmbuf->len; nasPdu->buf = CALLOC(nasPdu->size, sizeof(uint8_t)); - memcpy(nasPdu->buf, esmbuf->data, nasPdu->size); - ogs_pkbuf_free(esmbuf); + memcpy(nasPdu->buf, gsmbuf->data, nasPdu->size); + ogs_pkbuf_free(gsmbuf); return ogs_ngap_encode(&pdu); } ogs_pkbuf_t *ngap_build_e_rab_release_command( - amf_bearer_t *bearer, ogs_pkbuf_t *esmbuf, + amf_bearer_t *bearer, ogs_pkbuf_t *gsmbuf, NGAP_Cause_PR group, long cause) { NGAP_NGAP_PDU_t pdu; @@ -1066,7 +1062,7 @@ ogs_pkbuf_t *ngap_build_e_rab_release_command( NGAP_E_RABReleaseCommandIEs_t *ie = NULL; NGAP_AMF_UE_NGAP_ID_t *AMF_UE_NGAP_ID = NULL; - NGAP_ENB_UE_NGAP_ID_t *ENB_UE_NGAP_ID = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; NGAP_UEAggregateMaximumBitrate_t *UEAggregateMaximumBitrate = NULL; NGAP_E_RABList_t *E_RABList = NULL; NGAP_NAS_PDU_t *nasPdu = NULL; @@ -1075,24 +1071,24 @@ ogs_pkbuf_t *ngap_build_e_rab_release_command( NGAP_E_RABItem_t *e_rab = NULL; amf_ue_t *amf_ue = NULL; - gnb_ue_t *gnb_ue = NULL; + ran_ue_t *ran_ue = NULL; ogs_diam_s6a_subscription_data_t *subscription_data = NULL; - ogs_assert(esmbuf); + ogs_assert(gsmbuf); ogs_assert(bearer); amf_ue = bearer->amf_ue; ogs_assert(amf_ue); - gnb_ue = amf_ue->gnb_ue; - ogs_assert(gnb_ue); + ran_ue = amf_ue->ran_ue; + ogs_assert(ran_ue); subscription_data = &amf_ue->subscription_data; ogs_assert(subscription_data); - ogs_debug("[AMF] E-RAB release command"); + ogs_debug("E-RAB release command"); memset(&pdu, 0, sizeof (NGAP_NGAP_PDU_t)); pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage; - pdu.choice.initiatingMessage = + pdu.choice.initiatingMessage = CALLOC(1, sizeof(NGAP_InitiatingMessage_t)); initiatingMessage = pdu.choice.initiatingMessage; @@ -1115,11 +1111,11 @@ ogs_pkbuf_t *ngap_build_e_rab_release_command( ie = CALLOC(1, sizeof(NGAP_E_RABReleaseCommandIEs_t)); ASN_SEQUENCE_ADD(&E_RABReleaseCommand->protocolIEs, ie); - ie->id = NGAP_ProtocolIE_ID_id_eNB_UE_NGAP_ID; + ie->id = NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID; ie->criticality = NGAP_Criticality_reject; - ie->value.present = NGAP_E_RABReleaseCommandIEs__value_PR_ENB_UE_NGAP_ID; + ie->value.present = NGAP_E_RABReleaseCommandIEs__value_PR_RAN_UE_NGAP_ID; - ENB_UE_NGAP_ID = &ie->value.choice.ENB_UE_NGAP_ID; + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; ie = CALLOC(1, sizeof(NGAP_E_RABReleaseCommandIEs_t)); ASN_SEQUENCE_ADD(&E_RABReleaseCommand->protocolIEs, ie); @@ -1149,11 +1145,11 @@ ogs_pkbuf_t *ngap_build_e_rab_release_command( nasPdu = &ie->value.choice.NAS_PDU; - ogs_debug(" ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - gnb_ue->gnb_ue_ngap_id, gnb_ue->amf_ue_ngap_id); + ogs_debug(" RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + ran_ue->ran_ue_ngap_id, ran_ue->amf_ue_ngap_id); - *AMF_UE_NGAP_ID = gnb_ue->amf_ue_ngap_id; - *ENB_UE_NGAP_ID = gnb_ue->gnb_ue_ngap_id; + *AMF_UE_NGAP_ID = ran_ue->amf_ue_ngap_id; + *RAN_UE_NGAP_ID = ran_ue->ran_ue_ngap_id; asn_uint642INTEGER( &UEAggregateMaximumBitrate->uEaggregateMaximumBitRateUL, @@ -1178,10 +1174,10 @@ ogs_pkbuf_t *ngap_build_e_rab_release_command( ogs_debug(" EBI[%d] Gruop[%d] Cause[%d]", bearer->ebi, group, (int)cause); - nasPdu->size = esmbuf->len; + nasPdu->size = gsmbuf->len; nasPdu->buf = CALLOC(nasPdu->size, sizeof(uint8_t)); - memcpy(nasPdu->buf, esmbuf->data, nasPdu->size); - ogs_pkbuf_free(esmbuf); + memcpy(nasPdu->buf, gsmbuf->data, nasPdu->size); + ogs_pkbuf_free(gsmbuf); return ogs_ngap_encode(&pdu); } @@ -1209,11 +1205,11 @@ ogs_pkbuf_t *ngap_build_paging( ogs_assert(amf_ue); - ogs_debug("[AMF] Paging"); + ogs_debug("Paging"); memset(&pdu, 0, sizeof (NGAP_NGAP_PDU_t)); pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage; - pdu.choice.initiatingMessage = + pdu.choice.initiatingMessage = CALLOC(1, sizeof(NGAP_InitiatingMessage_t)); initiatingMessage = pdu.choice.initiatingMessage; @@ -1323,11 +1319,11 @@ ogs_pkbuf_t *ngap_build_amf_configuration_transfer( ogs_assert(son_configuration_transfer); - ogs_debug("[AMF] AMF Configuration Transfer"); + ogs_debug("AMF Configuration Transfer"); memset(&pdu, 0, sizeof (NGAP_NGAP_PDU_t)); pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage; - pdu.choice.initiatingMessage = + pdu.choice.initiatingMessage = CALLOC(1, sizeof(NGAP_InitiatingMessage_t)); initiatingMessage = pdu.choice.initiatingMessage; @@ -1365,20 +1361,20 @@ ogs_pkbuf_t *ngap_build_path_switch_ack(amf_ue_t *amf_ue) NGAP_PathSwitchRequestAcknowledgeIEs_t *ie = NULL; NGAP_AMF_UE_NGAP_ID_t *AMF_UE_NGAP_ID = NULL; - NGAP_ENB_UE_NGAP_ID_t *ENB_UE_NGAP_ID = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; NGAP_SecurityContext_t *SecurityContext = NULL; - gnb_ue_t *gnb_ue = NULL; + ran_ue_t *ran_ue = NULL; ogs_assert(amf_ue); - gnb_ue = amf_ue->gnb_ue; - ogs_assert(gnb_ue); + ran_ue = amf_ue->ran_ue; + ogs_assert(ran_ue); - ogs_debug("[AMF] Path switch acknowledge"); + ogs_debug("Path switch acknowledge"); memset(&pdu, 0, sizeof (NGAP_NGAP_PDU_t)); pdu.present = NGAP_NGAP_PDU_PR_successfulOutcome; - pdu.choice.successfulOutcome = + pdu.choice.successfulOutcome = CALLOC(1, sizeof(NGAP_SuccessfulOutcome_t)); successfulOutcome = pdu.choice.successfulOutcome; @@ -1403,12 +1399,12 @@ ogs_pkbuf_t *ngap_build_path_switch_ack(amf_ue_t *amf_ue) ie = CALLOC(1, sizeof(NGAP_PathSwitchRequestAcknowledgeIEs_t)); ASN_SEQUENCE_ADD(&PathSwitchRequestAcknowledge->protocolIEs, ie); - ie->id = NGAP_ProtocolIE_ID_id_eNB_UE_NGAP_ID; + ie->id = NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID; ie->criticality = NGAP_Criticality_ignore; ie->value.present = - NGAP_PathSwitchRequestAcknowledgeIEs__value_PR_ENB_UE_NGAP_ID; + NGAP_PathSwitchRequestAcknowledgeIEs__value_PR_RAN_UE_NGAP_ID; - ENB_UE_NGAP_ID = &ie->value.choice.ENB_UE_NGAP_ID; + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; ie = CALLOC(1, sizeof(NGAP_PathSwitchRequestAcknowledgeIEs_t)); ASN_SEQUENCE_ADD(&PathSwitchRequestAcknowledge->protocolIEs, ie); @@ -1420,11 +1416,11 @@ ogs_pkbuf_t *ngap_build_path_switch_ack(amf_ue_t *amf_ue) SecurityContext = &ie->value.choice.SecurityContext; - ogs_debug(" ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - gnb_ue->gnb_ue_ngap_id, gnb_ue->amf_ue_ngap_id); + ogs_debug(" RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + ran_ue->ran_ue_ngap_id, ran_ue->amf_ue_ngap_id); - *AMF_UE_NGAP_ID = gnb_ue->amf_ue_ngap_id; - *ENB_UE_NGAP_ID = gnb_ue->gnb_ue_ngap_id; + *AMF_UE_NGAP_ID = ran_ue->amf_ue_ngap_id; + *RAN_UE_NGAP_ID = ran_ue->ran_ue_ngap_id; SecurityContext->nextHopChainingCount = amf_ue->nhcc; SecurityContext->nextHopParameter.size = OGS_SHA256_DIGEST_SIZE; @@ -1439,7 +1435,7 @@ ogs_pkbuf_t *ngap_build_path_switch_ack(amf_ue_t *amf_ue) } ogs_pkbuf_t *ngap_build_path_switch_failure( - uint32_t gnb_ue_ngap_id, uint32_t amf_ue_ngap_id, + uint32_t ran_ue_ngap_id, uint32_t amf_ue_ngap_id, NGAP_Cause_PR group, long cause) { NGAP_NGAP_PDU_t pdu; @@ -1448,14 +1444,14 @@ ogs_pkbuf_t *ngap_build_path_switch_failure( NGAP_PathSwitchRequestFailureIEs_t *ie = NULL; NGAP_AMF_UE_NGAP_ID_t *AMF_UE_NGAP_ID = NULL; - NGAP_ENB_UE_NGAP_ID_t *ENB_UE_NGAP_ID = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; NGAP_Cause_t *Cause = NULL; - ogs_debug("[AMF] Path switch failure"); + ogs_debug("Path switch failure"); memset(&pdu, 0, sizeof (NGAP_NGAP_PDU_t)); pdu.present = NGAP_NGAP_PDU_PR_unsuccessfulOutcome; - pdu.choice.unsuccessfulOutcome = + pdu.choice.unsuccessfulOutcome = CALLOC(1, sizeof(NGAP_UnsuccessfulOutcome_t)); unsuccessfulOutcome = pdu.choice.unsuccessfulOutcome; @@ -1481,12 +1477,12 @@ ogs_pkbuf_t *ngap_build_path_switch_failure( ie = CALLOC(1, sizeof(NGAP_PathSwitchRequestFailureIEs_t)); ASN_SEQUENCE_ADD(&PathSwitchRequestFailure->protocolIEs, ie); - ie->id = NGAP_ProtocolIE_ID_id_eNB_UE_NGAP_ID; + ie->id = NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID; ie->criticality = NGAP_Criticality_ignore; ie->value.present = - NGAP_PathSwitchRequestFailureIEs__value_PR_ENB_UE_NGAP_ID; + NGAP_PathSwitchRequestFailureIEs__value_PR_RAN_UE_NGAP_ID; - ENB_UE_NGAP_ID = &ie->value.choice.ENB_UE_NGAP_ID; + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; ie = CALLOC(1, sizeof(NGAP_PathSwitchRequestFailureIEs_t)); ASN_SEQUENCE_ADD(&PathSwitchRequestFailure->protocolIEs, ie); @@ -1497,19 +1493,19 @@ ogs_pkbuf_t *ngap_build_path_switch_failure( Cause = &ie->value.choice.Cause; - ogs_debug(" ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - gnb_ue_ngap_id, amf_ue_ngap_id); + ogs_debug(" RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + ran_ue_ngap_id, amf_ue_ngap_id); ogs_debug(" Group[%d] Cause[%d]", group, (int)cause); *AMF_UE_NGAP_ID = amf_ue_ngap_id; - *ENB_UE_NGAP_ID = gnb_ue_ngap_id; + *RAN_UE_NGAP_ID = ran_ue_ngap_id; Cause->present = group; Cause->choice.radioNetwork = cause; return ogs_ngap_encode(&pdu); } -ogs_pkbuf_t *ngap_build_handover_command(gnb_ue_t *source_ue) +ogs_pkbuf_t *ngap_build_handover_command(ran_ue_t *source_ue) { int rv; @@ -1519,7 +1515,7 @@ ogs_pkbuf_t *ngap_build_handover_command(gnb_ue_t *source_ue) NGAP_HandoverCommandIEs_t *ie = NULL; NGAP_AMF_UE_NGAP_ID_t *AMF_UE_NGAP_ID = NULL; - NGAP_ENB_UE_NGAP_ID_t *ENB_UE_NGAP_ID = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; NGAP_HandoverType_t *HandoverType = NULL; NGAP_E_RABSubjecttoDataForwardingList_t *E_RABSubjecttoDataForwardingList = NULL; @@ -1533,11 +1529,11 @@ ogs_pkbuf_t *ngap_build_handover_command(gnb_ue_t *source_ue) ogs_assert(source_ue); amf_ue = source_ue->amf_ue; - ogs_debug("[AMF] Handover command"); + ogs_debug("Handover command"); memset(&pdu, 0, sizeof (NGAP_NGAP_PDU_t)); pdu.present = NGAP_NGAP_PDU_PR_successfulOutcome; - pdu.choice.successfulOutcome = + pdu.choice.successfulOutcome = CALLOC(1, sizeof(NGAP_SuccessfulOutcome_t)); successfulOutcome = pdu.choice.successfulOutcome; @@ -1562,11 +1558,11 @@ ogs_pkbuf_t *ngap_build_handover_command(gnb_ue_t *source_ue) ie = CALLOC(1, sizeof(NGAP_HandoverCommandIEs_t)); ASN_SEQUENCE_ADD(&HandoverCommand->protocolIEs, ie); - ie->id = NGAP_ProtocolIE_ID_id_eNB_UE_NGAP_ID; + ie->id = NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID; ie->criticality = NGAP_Criticality_reject; - ie->value.present = NGAP_HandoverCommandIEs__value_PR_ENB_UE_NGAP_ID; + ie->value.present = NGAP_HandoverCommandIEs__value_PR_RAN_UE_NGAP_ID; - ENB_UE_NGAP_ID = &ie->value.choice.ENB_UE_NGAP_ID; + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; ie = CALLOC(1, sizeof(NGAP_HandoverCommandIEs_t)); ASN_SEQUENCE_ADD(&HandoverCommand->protocolIEs, ie); @@ -1578,11 +1574,11 @@ ogs_pkbuf_t *ngap_build_handover_command(gnb_ue_t *source_ue) HandoverType = &ie->value.choice.HandoverType; *AMF_UE_NGAP_ID = source_ue->amf_ue_ngap_id; - *ENB_UE_NGAP_ID = source_ue->gnb_ue_ngap_id; + *RAN_UE_NGAP_ID = source_ue->ran_ue_ngap_id; *HandoverType = source_ue->handover_type; - ogs_debug(" ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - source_ue->gnb_ue_ngap_id, source_ue->amf_ue_ngap_id); + ogs_debug(" RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + source_ue->ran_ue_ngap_id, source_ue->amf_ue_ngap_id); sess = amf_sess_first(amf_ue); while (sess) { @@ -1681,7 +1677,7 @@ ogs_pkbuf_t *ngap_build_handover_command(gnb_ue_t *source_ue) } ogs_pkbuf_t *ngap_build_handover_preparation_failure( - gnb_ue_t *source_ue, NGAP_Cause_t *cause) + ran_ue_t *source_ue, NGAP_Cause_t *cause) { NGAP_NGAP_PDU_t pdu; NGAP_UnsuccessfulOutcome_t *unsuccessfulOutcome = NULL; @@ -1689,17 +1685,17 @@ ogs_pkbuf_t *ngap_build_handover_preparation_failure( NGAP_HandoverPreparationFailureIEs_t *ie = NULL; NGAP_AMF_UE_NGAP_ID_t *AMF_UE_NGAP_ID = NULL; - NGAP_ENB_UE_NGAP_ID_t *ENB_UE_NGAP_ID = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; NGAP_Cause_t *Cause = NULL; ogs_assert(source_ue); ogs_assert(cause); - ogs_debug("[AMF] Handover preparation failure"); + ogs_debug("Handover preparation failure"); memset(&pdu, 0, sizeof (NGAP_NGAP_PDU_t)); pdu.present = NGAP_NGAP_PDU_PR_unsuccessfulOutcome; - pdu.choice.unsuccessfulOutcome = + pdu.choice.unsuccessfulOutcome = CALLOC(1, sizeof(NGAP_UnsuccessfulOutcome_t)); unsuccessfulOutcome = pdu.choice.unsuccessfulOutcome; @@ -1725,12 +1721,12 @@ ogs_pkbuf_t *ngap_build_handover_preparation_failure( ie = CALLOC(1, sizeof(NGAP_HandoverPreparationFailureIEs_t)); ASN_SEQUENCE_ADD(&HandoverPreparationFailure->protocolIEs, ie); - ie->id = NGAP_ProtocolIE_ID_id_eNB_UE_NGAP_ID; + ie->id = NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID; ie->criticality = NGAP_Criticality_ignore; ie->value.present = - NGAP_HandoverPreparationFailureIEs__value_PR_ENB_UE_NGAP_ID; + NGAP_HandoverPreparationFailureIEs__value_PR_RAN_UE_NGAP_ID; - ENB_UE_NGAP_ID = &ie->value.choice.ENB_UE_NGAP_ID; + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; ie = CALLOC(1, sizeof(NGAP_HandoverPreparationFailureIEs_t)); ASN_SEQUENCE_ADD(&HandoverPreparationFailure->protocolIEs, ie); @@ -1741,13 +1737,13 @@ ogs_pkbuf_t *ngap_build_handover_preparation_failure( Cause = &ie->value.choice.Cause; - ogs_debug(" ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - source_ue->gnb_ue_ngap_id, source_ue->amf_ue_ngap_id); + ogs_debug(" RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + source_ue->ran_ue_ngap_id, source_ue->amf_ue_ngap_id); ogs_debug(" Group[%d] Cause[%d]", cause->present, (int)cause->choice.radioNetwork); *AMF_UE_NGAP_ID = source_ue->amf_ue_ngap_id; - *ENB_UE_NGAP_ID = source_ue->gnb_ue_ngap_id; + *RAN_UE_NGAP_ID = source_ue->ran_ue_ngap_id; Cause->present = cause->present; Cause->choice.radioNetwork = cause->choice.radioNetwork; @@ -1755,8 +1751,8 @@ ogs_pkbuf_t *ngap_build_handover_preparation_failure( } ogs_pkbuf_t *ngap_build_handover_request( - amf_ue_t *amf_ue, gnb_ue_t *target_ue, - NGAP_ENB_UE_NGAP_ID_t *gnb_ue_ngap_id, + amf_ue_t *amf_ue, ran_ue_t *target_ue, + NGAP_RAN_UE_NGAP_ID_t *ran_ue_ngap_id, NGAP_AMF_UE_NGAP_ID_t *amf_ue_ngap_id, NGAP_HandoverType_t *handovertype, NGAP_Cause_t *cause, @@ -1793,11 +1789,11 @@ ogs_pkbuf_t *ngap_build_handover_request( subscription_data = &amf_ue->subscription_data; ogs_assert(subscription_data); - ogs_debug("[AMF] Handover request"); + ogs_debug("Handover request"); memset(&pdu, 0, sizeof (NGAP_NGAP_PDU_t)); pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage; - pdu.choice.initiatingMessage = + pdu.choice.initiatingMessage = CALLOC(1, sizeof(NGAP_InitiatingMessage_t)); initiatingMessage = pdu.choice.initiatingMessage; @@ -1999,7 +1995,7 @@ ogs_pkbuf_t *ngap_build_handover_request( return ogs_ngap_encode(&pdu); } -ogs_pkbuf_t *ngap_build_handover_cancel_ack(gnb_ue_t *source_ue) +ogs_pkbuf_t *ngap_build_handover_cancel_ack(ran_ue_t *source_ue) { NGAP_NGAP_PDU_t pdu; NGAP_SuccessfulOutcome_t *successfulOutcome = NULL; @@ -2007,15 +2003,15 @@ ogs_pkbuf_t *ngap_build_handover_cancel_ack(gnb_ue_t *source_ue) NGAP_HandoverCancelAcknowledgeIEs_t *ie = NULL; NGAP_AMF_UE_NGAP_ID_t *AMF_UE_NGAP_ID = NULL; - NGAP_ENB_UE_NGAP_ID_t *ENB_UE_NGAP_ID = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; ogs_assert(source_ue); - ogs_debug("[AMF] Handover cancel acknowledge"); + ogs_debug("Handover cancel acknowledge"); memset(&pdu, 0, sizeof (NGAP_NGAP_PDU_t)); pdu.present = NGAP_NGAP_PDU_PR_successfulOutcome; - pdu.choice.successfulOutcome = + pdu.choice.successfulOutcome = CALLOC(1, sizeof(NGAP_SuccessfulOutcome_t)); successfulOutcome = pdu.choice.successfulOutcome; @@ -2040,25 +2036,25 @@ ogs_pkbuf_t *ngap_build_handover_cancel_ack(gnb_ue_t *source_ue) ie = CALLOC(1, sizeof(NGAP_HandoverCancelAcknowledgeIEs_t)); ASN_SEQUENCE_ADD(&HandoverCancelAcknowledge->protocolIEs, ie); - ie->id = NGAP_ProtocolIE_ID_id_eNB_UE_NGAP_ID; + ie->id = NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID; ie->criticality = NGAP_Criticality_ignore; ie->value.present = - NGAP_HandoverCancelAcknowledgeIEs__value_PR_ENB_UE_NGAP_ID; + NGAP_HandoverCancelAcknowledgeIEs__value_PR_RAN_UE_NGAP_ID; - ENB_UE_NGAP_ID = &ie->value.choice.ENB_UE_NGAP_ID; + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; *AMF_UE_NGAP_ID = source_ue->amf_ue_ngap_id; - *ENB_UE_NGAP_ID = source_ue->gnb_ue_ngap_id; + *RAN_UE_NGAP_ID = source_ue->ran_ue_ngap_id; - ogs_debug(" Source : ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - source_ue->gnb_ue_ngap_id, source_ue->amf_ue_ngap_id); + ogs_debug(" Source : RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + source_ue->ran_ue_ngap_id, source_ue->amf_ue_ngap_id); return ogs_ngap_encode(&pdu); } ogs_pkbuf_t *ngap_build_amf_status_transfer( - gnb_ue_t *target_ue, - NGAP_ENB_StatusTransfer_TransparentContainer_t + ran_ue_t *target_ue, + NGAP_RAN_StatusTransfer_TransparentContainer_t *gnb_statustransfer_transparentContainer) { int rv; @@ -2069,18 +2065,18 @@ ogs_pkbuf_t *ngap_build_amf_status_transfer( NGAP_AMFStatusTransferIEs_t *ie = NULL; NGAP_AMF_UE_NGAP_ID_t *AMF_UE_NGAP_ID = NULL; - NGAP_ENB_UE_NGAP_ID_t *ENB_UE_NGAP_ID = NULL; - NGAP_ENB_StatusTransfer_TransparentContainer_t - *ENB_StatusTransfer_TransparentContainer = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; + NGAP_RAN_StatusTransfer_TransparentContainer_t + *RAN_StatusTransfer_TransparentContainer = NULL; ogs_assert(target_ue); ogs_assert(gnb_statustransfer_transparentContainer); - ogs_debug("[AMF] AMF status transfer"); + ogs_debug("AMF status transfer"); memset(&pdu, 0, sizeof (NGAP_NGAP_PDU_t)); pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage; - pdu.choice.initiatingMessage = + pdu.choice.initiatingMessage = CALLOC(1, sizeof(NGAP_InitiatingMessage_t)); initiatingMessage = pdu.choice.initiatingMessage; @@ -2103,41 +2099,42 @@ ogs_pkbuf_t *ngap_build_amf_status_transfer( ie = CALLOC(1, sizeof(NGAP_AMFStatusTransferIEs_t)); ASN_SEQUENCE_ADD(&AMFStatusTransfer->protocolIEs, ie); - ie->id = NGAP_ProtocolIE_ID_id_eNB_UE_NGAP_ID; + ie->id = NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID; ie->criticality = NGAP_Criticality_reject; - ie->value.present = NGAP_AMFStatusTransferIEs__value_PR_ENB_UE_NGAP_ID; + ie->value.present = NGAP_AMFStatusTransferIEs__value_PR_RAN_UE_NGAP_ID; - ENB_UE_NGAP_ID = &ie->value.choice.ENB_UE_NGAP_ID; + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; ie = CALLOC(1, sizeof(NGAP_AMFStatusTransferIEs_t)); ASN_SEQUENCE_ADD(&AMFStatusTransfer->protocolIEs, ie); - ie->id = NGAP_ProtocolIE_ID_id_eNB_StatusTransfer_TransparentContainer; + ie->id = NGAP_ProtocolIE_ID_id_RAN_StatusTransfer_TransparentContainer; ie->criticality = NGAP_Criticality_reject; ie->value.present = - NGAP_AMFStatusTransferIEs__value_PR_ENB_StatusTransfer_TransparentContainer; + NGAP_AMFStatusTransferIEs__value_PR_RAN_StatusTransfer_TransparentContainer; - ENB_StatusTransfer_TransparentContainer = - &ie->value.choice.ENB_StatusTransfer_TransparentContainer; + RAN_StatusTransfer_TransparentContainer = + &ie->value.choice.RAN_StatusTransfer_TransparentContainer; *AMF_UE_NGAP_ID = target_ue->amf_ue_ngap_id; - *ENB_UE_NGAP_ID = target_ue->gnb_ue_ngap_id; + *RAN_UE_NGAP_ID = target_ue->ran_ue_ngap_id; - ogs_debug(" Target : ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - target_ue->gnb_ue_ngap_id, target_ue->amf_ue_ngap_id); + ogs_debug(" Target : RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + target_ue->ran_ue_ngap_id, target_ue->amf_ue_ngap_id); rv = ogs_asn_copy_ie( - &asn_DEF_NGAP_ENB_StatusTransfer_TransparentContainer, + &asn_DEF_NGAP_RAN_StatusTransfer_TransparentContainer, gnb_statustransfer_transparentContainer, - ENB_StatusTransfer_TransparentContainer); + RAN_StatusTransfer_TransparentContainer); ogs_assert(rv == OGS_OK); return ogs_ngap_encode(&pdu); } +#endif ogs_pkbuf_t *ngap_build_error_indication( - NGAP_AMF_UE_NGAP_ID_t *amf_ue_ngap_id, - NGAP_ENB_UE_NGAP_ID_t *gnb_ue_ngap_id, + uint64_t *amf_ue_ngap_id, + NGAP_RAN_UE_NGAP_ID_t *ran_ue_ngap_id, NGAP_Cause_PR group, long cause) { NGAP_NGAP_PDU_t pdu; @@ -2146,14 +2143,14 @@ ogs_pkbuf_t *ngap_build_error_indication( NGAP_ErrorIndicationIEs_t *ie = NULL; NGAP_AMF_UE_NGAP_ID_t *AMF_UE_NGAP_ID = NULL; - NGAP_ENB_UE_NGAP_ID_t *ENB_UE_NGAP_ID = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; NGAP_Cause_t *Cause = NULL; - ogs_debug("[AMF] Error Indication"); + ogs_debug("Error Indication"); memset(&pdu, 0, sizeof (NGAP_NGAP_PDU_t)); pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage; - pdu.choice.initiatingMessage = + pdu.choice.initiatingMessage = CALLOC(1, sizeof(NGAP_InitiatingMessage_t)); initiatingMessage = pdu.choice.initiatingMessage; @@ -2174,22 +2171,22 @@ ogs_pkbuf_t *ngap_build_error_indication( AMF_UE_NGAP_ID = &ie->value.choice.AMF_UE_NGAP_ID; - *AMF_UE_NGAP_ID = *amf_ue_ngap_id; - ogs_debug(" AMF_UE_NGAP_ID[%d]", (int)*amf_ue_ngap_id); + asn_uint642INTEGER(AMF_UE_NGAP_ID, *amf_ue_ngap_id); + ogs_debug(" AMF_UE_NGAP_ID[%lld]", (long long)*amf_ue_ngap_id); } - if (gnb_ue_ngap_id) { + if (ran_ue_ngap_id) { ie = CALLOC(1, sizeof(NGAP_ErrorIndicationIEs_t)); ASN_SEQUENCE_ADD(&ErrorIndication->protocolIEs, ie); - ie->id = NGAP_ProtocolIE_ID_id_eNB_UE_NGAP_ID; + ie->id = NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID; ie->criticality = NGAP_Criticality_ignore; - ie->value.present = NGAP_ErrorIndicationIEs__value_PR_ENB_UE_NGAP_ID; + ie->value.present = NGAP_ErrorIndicationIEs__value_PR_RAN_UE_NGAP_ID; - ENB_UE_NGAP_ID = &ie->value.choice.ENB_UE_NGAP_ID; + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; - *ENB_UE_NGAP_ID = *gnb_ue_ngap_id; - ogs_debug(" ENB_UE_NGAP_ID[%d]", (int)*gnb_ue_ngap_id); + *RAN_UE_NGAP_ID = *ran_ue_ngap_id; + ogs_debug(" RAN_UE_NGAP_ID[%d]", (int)*ran_ue_ngap_id); } ie = CALLOC(1, sizeof(NGAP_ErrorIndicationIEs_t)); @@ -2210,6 +2207,7 @@ ogs_pkbuf_t *ngap_build_error_indication( return ogs_ngap_encode(&pdu); } +#if 0 ogs_pkbuf_t *ngap_build_s1_reset( NGAP_Cause_PR group, long cause, NGAP_UE_associatedLogicalNG_ConnectionListRes_t *partOfNG_Interface) @@ -2222,11 +2220,11 @@ ogs_pkbuf_t *ngap_build_s1_reset( NGAP_Cause_t *Cause = NULL; NGAP_ResetType_t *ResetType = NULL; - ogs_debug("[AMF] Reset"); + ogs_debug("Reset"); memset(&pdu, 0, sizeof (NGAP_NGAP_PDU_t)); pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage; - pdu.choice.initiatingMessage = + pdu.choice.initiatingMessage = CALLOC(1, sizeof(NGAP_InitiatingMessage_t)); initiatingMessage = pdu.choice.initiatingMessage; @@ -2275,7 +2273,7 @@ ogs_pkbuf_t *ngap_build_s1_reset( ogs_pkbuf_t *ngap_build_s1_reset_partial( NGAP_Cause_PR group, long cause, NGAP_AMF_UE_NGAP_ID_t *amf_ue_ngap_id, - NGAP_ENB_UE_NGAP_ID_t *gnb_ue_ngap_id) + NGAP_RAN_UE_NGAP_ID_t *ran_ue_ngap_id) { NGAP_UE_associatedLogicalNG_ConnectionListRes_t *partOfNG_Interface = NULL; NGAP_UE_associatedLogicalNG_ConnectionItemRes_t *ie2 = NULL; @@ -2295,7 +2293,7 @@ ogs_pkbuf_t *ngap_build_s1_reset_partial( item = &ie2->value.choice.UE_associatedLogicalNG_ConnectionItem; item->mME_UE_NGAP_ID = amf_ue_ngap_id; - item->eNB_UE_NGAP_ID = gnb_ue_ngap_id; + item->RAN_UE_NGAP_ID = ran_ue_ngap_id; return ngap_build_s1_reset(group, cause, partOfNG_Interface); } @@ -2309,11 +2307,11 @@ ogs_pkbuf_t *ngap_build_s1_reset_ack( NGAP_ResetAcknowledgeIEs_t *ie = NULL; - ogs_debug("[AMF] Reset acknowledge"); + ogs_debug("Reset acknowledge"); memset(&pdu, 0, sizeof (NGAP_NGAP_PDU_t)); pdu.present = NGAP_NGAP_PDU_PR_successfulOutcome; - pdu.choice.successfulOutcome = + pdu.choice.successfulOutcome = CALLOC(1, sizeof(NGAP_SuccessfulOutcome_t)); successfulOutcome = pdu.choice.successfulOutcome; @@ -2353,8 +2351,8 @@ ogs_pkbuf_t *ngap_build_s1_reset_ack( ogs_assert(item1); if (item1->mME_UE_NGAP_ID == NULL && - item1->eNB_UE_NGAP_ID == NULL) { - ogs_warn("No AMF_UE_NGAP_ID & ENB_UE_NGAP_ID"); + item1->RAN_UE_NGAP_ID == NULL) { + ogs_warn("No AMF_UE_NGAP_ID & RAN_UE_NGAP_ID"); continue; } @@ -2378,16 +2376,16 @@ ogs_pkbuf_t *ngap_build_s1_reset_ack( *item2->mME_UE_NGAP_ID = *item1->mME_UE_NGAP_ID; } - if (item1->eNB_UE_NGAP_ID) { - item2->eNB_UE_NGAP_ID = CALLOC(1, - sizeof(NGAP_ENB_UE_NGAP_ID_t)); - ogs_assert(item2->eNB_UE_NGAP_ID); - *item2->eNB_UE_NGAP_ID = *item1->eNB_UE_NGAP_ID; + if (item1->RAN_UE_NGAP_ID) { + item2->RAN_UE_NGAP_ID = CALLOC(1, + sizeof(NGAP_RAN_UE_NGAP_ID_t)); + ogs_assert(item2->RAN_UE_NGAP_ID); + *item2->RAN_UE_NGAP_ID = *item1->RAN_UE_NGAP_ID; } - ogs_debug(" AMF_UE_NGAP_ID[%d] ENB_UE_NGAP_ID[%d]", + ogs_debug(" AMF_UE_NGAP_ID[%d] RAN_UE_NGAP_ID[%d]", item2->mME_UE_NGAP_ID ? (int)*item2->mME_UE_NGAP_ID : -1, - item2->eNB_UE_NGAP_ID ? (int)*item2->eNB_UE_NGAP_ID : -1); + item2->RAN_UE_NGAP_ID ? (int)*item2->RAN_UE_NGAP_ID : -1); } } @@ -2408,13 +2406,13 @@ ogs_pkbuf_t *ngap_build_write_replace_warning_request(sbc_pws_data_t *sbc_pws) NGAP_DataCodingScheme_t *DataCodingScheme = NULL; NGAP_WarningMessageContents_t *WarningMessageContents = NULL; - ogs_debug("[AMF] Write-replace warning request"); + ogs_debug("Write-replace warning request"); ogs_assert(sbc_pws); memset(&pdu, 0, sizeof (NGAP_NGAP_PDU_t)); pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage; - pdu.choice.initiatingMessage = + pdu.choice.initiatingMessage = CALLOC(1, sizeof(NGAP_InitiatingMessage_t)); initiatingMessage = pdu.choice.initiatingMessage; @@ -2546,13 +2544,13 @@ ogs_pkbuf_t *ngap_build_kill_request(sbc_pws_data_t *sbc_pws) NGAP_MessageIdentifier_t *MessageIdentifier = NULL; NGAP_SerialNumber_t *SerialNumber = NULL; - ogs_debug("[AMF] Kill request"); + ogs_debug("Kill request"); ogs_assert(sbc_pws); memset(&pdu, 0, sizeof (NGAP_NGAP_PDU_t)); pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage; - pdu.choice.initiatingMessage = + pdu.choice.initiatingMessage = CALLOC(1, sizeof(NGAP_InitiatingMessage_t)); initiatingMessage = pdu.choice.initiatingMessage; diff --git a/src/amf/ngap-build.h b/src/amf/ngap-build.h index dbd9e4d240..7c46f6ade1 100644 --- a/src/amf/ngap-build.h +++ b/src/amf/ngap-build.h @@ -26,26 +26,26 @@ extern "C" { #endif -ogs_pkbuf_t *ngap_build_setup_rsp(void); -ogs_pkbuf_t *ngap_build_setup_failure( +ogs_pkbuf_t *ngap_build_ng_setup_response(void); +ogs_pkbuf_t *ngap_build_ng_setup_failure( NGAP_Cause_PR group, long cause, long time_to_wait); -#if 0 ogs_pkbuf_t *ngap_build_downlink_nas_transport( - gnb_ue_t *gnb_ue, ogs_pkbuf_t *emmbuf); + ran_ue_t *ran_ue, ogs_pkbuf_t *gmmbuf); +#if 0 ogs_pkbuf_t *ngap_build_initial_context_setup_request( - amf_ue_t *amf_ue, ogs_pkbuf_t *emmbuf); + amf_ue_t *amf_ue, ogs_pkbuf_t *gmmbuf); ogs_pkbuf_t *ngap_build_ue_context_modification_request(amf_ue_t *amf_ue); ogs_pkbuf_t *ngap_build_ue_context_release_command( - gnb_ue_t *gnb_ue, NGAP_Cause_PR group, long cause); + ran_ue_t *ran_ue, NGAP_Cause_PR group, long cause); ogs_pkbuf_t *ngap_build_e_rab_setup_request( - amf_bearer_t *bearer, ogs_pkbuf_t *esmbuf); + amf_bearer_t *bearer, ogs_pkbuf_t *gsmbuf); ogs_pkbuf_t *ngap_build_e_rab_modify_request( - amf_bearer_t *bearer, ogs_pkbuf_t *esmbuf); + amf_bearer_t *bearer, ogs_pkbuf_t *gsmbuf); ogs_pkbuf_t *ngap_build_e_rab_release_command( - amf_bearer_t *bearer, ogs_pkbuf_t *esmbuf, NGAP_Cause_PR group, long cause); + amf_bearer_t *bearer, ogs_pkbuf_t *gsmbuf, NGAP_Cause_PR group, long cause); ogs_pkbuf_t *ngap_build_paging( amf_ue_t *amf_ue, NGAP_CNDomain_t cn_domain); @@ -55,16 +55,16 @@ ogs_pkbuf_t *ngap_build_amf_configuration_transfer( ogs_pkbuf_t *ngap_build_path_switch_ack(amf_ue_t *amf_ue); ogs_pkbuf_t *ngap_build_path_switch_failure( - uint32_t gnb_ue_ngap_id, uint32_t amf_ue_ngap_id, + uint32_t ran_ue_ngap_id, uint32_t amf_ue_ngap_id, NGAP_Cause_PR group, long cause); -ogs_pkbuf_t *ngap_build_handover_command(gnb_ue_t *source_ue); +ogs_pkbuf_t *ngap_build_handover_command(ran_ue_t *source_ue); ogs_pkbuf_t *ngap_build_handover_preparation_failure( - gnb_ue_t *source_ue, NGAP_Cause_t *cause); + ran_ue_t *source_ue, NGAP_Cause_t *cause); ogs_pkbuf_t *ngap_build_handover_request( - amf_ue_t *amf_ue, gnb_ue_t *target_ue, - NGAP_ENB_UE_NGAP_ID_t *gnb_ue_ngap_id, + amf_ue_t *amf_ue, ran_ue_t *target_ue, + NGAP_RAN_UE_NGAP_ID_t *ran_ue_ngap_id, NGAP_AMF_UE_NGAP_ID_t *amf_ue_ngap_id, NGAP_HandoverType_t *handovertype, NGAP_Cause_t *cause, @@ -72,18 +72,20 @@ ogs_pkbuf_t *ngap_build_handover_request( *source_totarget_transparentContainer); ogs_pkbuf_t *ngap_build_handover_cancel_ack( - gnb_ue_t *source_ue); + ran_ue_t *source_ue); ogs_pkbuf_t *ngap_build_amf_status_transfer( - gnb_ue_t *target_ue, - NGAP_ENB_StatusTransfer_TransparentContainer_t + ran_ue_t *target_ue, + NGAP_RAN_StatusTransfer_TransparentContainer_t *gnb_statustransfer_transparentContainer); +#endif ogs_pkbuf_t *ngap_build_error_indication( - NGAP_AMF_UE_NGAP_ID_t *amf_ue_ngap_id, - NGAP_ENB_UE_NGAP_ID_t *gnb_ue_ngap_id, + uint64_t *amf_ue_ngap_id, + NGAP_RAN_UE_NGAP_ID_t *ran_ue_ngap_id, NGAP_Cause_PR group, long cause); +#if 0 ogs_pkbuf_t *ngap_build_s1_reset( NGAP_Cause_PR group, long cause, NGAP_UE_associatedLogicalS1_ConnectionListRes_t *partOfS1_Interface); @@ -91,7 +93,7 @@ ogs_pkbuf_t *ngap_build_s1_reset( ogs_pkbuf_t *ngap_build_s1_reset_partial( NGAP_Cause_PR group, long cause, NGAP_AMF_UE_NGAP_ID_t *amf_ue_ngap_id, - NGAP_ENB_UE_NGAP_ID_t *gnb_ue_ngap_id); + NGAP_RAN_UE_NGAP_ID_t *ran_ue_ngap_id); ogs_pkbuf_t *ngap_build_s1_reset_ack( NGAP_UE_associatedLogicalS1_ConnectionListRes_t *partOfS1_Interface); diff --git a/src/amf/ngap-handler.c b/src/amf/ngap-handler.c index 1703bf733b..17e4d94fc3 100644 --- a/src/amf/ngap-handler.c +++ b/src/amf/ngap-handler.c @@ -65,10 +65,11 @@ void ngap_handle_ng_setup_request(amf_gnb_t *gnb, ogs_ngap_message_t *message) NGAP_SupportedTAList_t *SupportedTAList = NULL; NGAP_PagingDRX_t *PagingDRX = NULL; - uint32_t gnb_id; NGAP_Cause_PR group = NGAP_Cause_PR_NOTHING; long cause = 0; + uint32_t gnb_id; + ogs_assert(gnb); ogs_assert(gnb->sock); @@ -78,7 +79,7 @@ void ngap_handle_ng_setup_request(amf_gnb_t *gnb, ogs_ngap_message_t *message) NGSetupRequest = &initiatingMessage->value.choice.NGSetupRequest; ogs_assert(NGSetupRequest); - ogs_debug("[AMF] NG-Setup request"); + ogs_debug("NG-Setup request"); for (i = 0; i < NGSetupRequest->protocolIEs.list.count; i++) { ie = NGSetupRequest->protocolIEs.list.array[i]; @@ -134,13 +135,10 @@ void ngap_handle_ng_setup_request(amf_gnb_t *gnb, ogs_ngap_message_t *message) gnb->num_of_supported_ta_list = 0; for (i = 0; i < SupportedTAList->list.count; i++) { NGAP_SupportedTAItem_t *SupportedTAItem = NULL; - NGAP_TAC_t *tAC = NULL; SupportedTAItem = (NGAP_SupportedTAItem_t *) SupportedTAList->list.array[i]; ogs_assert(SupportedTAItem); - tAC = &SupportedTAItem->tAC; - ogs_assert(tAC); for (j = 0; j < SupportedTAItem->broadcastPLMNList.list.count; j++) { NGAP_BroadcastPLMNItem_t *BroadcastPLMNItem = NULL; @@ -153,11 +151,9 @@ void ngap_handle_ng_setup_request(amf_gnb_t *gnb, ogs_ngap_message_t *message) &BroadcastPLMNItem->pLMNIdentity; ogs_assert(pLMNIdentity); - memcpy(&gnb->supported_ta_list[gnb->num_of_supported_ta_list].tac, - tAC->buf, sizeof(ogs_uint24_t)); - gnb->supported_ta_list[gnb->num_of_supported_ta_list].tac = - ogs_be24toh( - gnb->supported_ta_list[gnb->num_of_supported_ta_list].tac); + ogs_asn_OCTET_STRING_to_uint24(&SupportedTAItem->tAC, + &gnb->supported_ta_list[gnb->num_of_supported_ta_list].tac); + memcpy(&gnb->supported_ta_list [gnb->num_of_supported_ta_list].plmn_id, pLMNIdentity->buf, sizeof(ogs_plmn_id_t)); @@ -205,7 +201,6 @@ void ngap_handle_ng_setup_request(amf_gnb_t *gnb, ogs_ngap_message_t *message) ngap_send_ng_setup_response(gnb); } -#if 0 void ngap_handle_initial_ue_message(amf_gnb_t *gnb, ogs_ngap_message_t *message) { int i; @@ -215,17 +210,15 @@ void ngap_handle_initial_ue_message(amf_gnb_t *gnb, ogs_ngap_message_t *message) NGAP_InitialUEMessage_t *InitialUEMessage = NULL; NGAP_InitialUEMessage_IEs_t *ie = NULL; - NGAP_ENB_UE_NGAP_ID_t *ENB_UE_NGAP_ID = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; NGAP_NAS_PDU_t *NAS_PDU = NULL; - NGAP_TAI_t *TAI = NULL; - NGAP_EUTRAN_CGI_t *EUTRAN_CGI = NULL; - NGAP_S_TMSI_t *S_TMSI = NULL; + NGAP_UserLocationInformation_t *UserLocationInformation = NULL; + NGAP_FiveG_S_TMSI_t *FiveG_S_TMSI = NULL; - NGAP_PLMNidentity_t *pLMNidentity = NULL; - NGAP_TAC_t *tAC = NULL; - NGAP_CellIdentity_t *cell_ID = NULL; + NGAP_Cause_PR group = NGAP_Cause_PR_NOTHING; + long cause = 0; - gnb_ue_t *gnb_ue = NULL; + ran_ue_t *ran_ue = NULL; ogs_assert(gnb); ogs_assert(gnb->sock); @@ -236,112 +229,123 @@ void ngap_handle_initial_ue_message(amf_gnb_t *gnb, ogs_ngap_message_t *message) InitialUEMessage = &initiatingMessage->value.choice.InitialUEMessage; ogs_assert(InitialUEMessage); - ogs_debug("[AMF] Initial UE Message"); + ogs_debug("Initial UE Message"); for (i = 0; i < InitialUEMessage->protocolIEs.list.count; i++) { ie = InitialUEMessage->protocolIEs.list.array[i]; switch (ie->id) { - case NGAP_ProtocolIE_ID_id_eNB_UE_NGAP_ID: - ENB_UE_NGAP_ID = &ie->value.choice.ENB_UE_NGAP_ID; + case NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID: + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; break; case NGAP_ProtocolIE_ID_id_NAS_PDU: NAS_PDU = &ie->value.choice.NAS_PDU; break; - case NGAP_ProtocolIE_ID_id_TAI: - TAI = &ie->value.choice.TAI; + case NGAP_ProtocolIE_ID_id_UserLocationInformation: + UserLocationInformation = &ie->value.choice.UserLocationInformation; break; - case NGAP_ProtocolIE_ID_id_EUTRAN_CGI: - EUTRAN_CGI = &ie->value.choice.EUTRAN_CGI; - break; - case NGAP_ProtocolIE_ID_id_S_TMSI: - S_TMSI = &ie->value.choice.S_TMSI; + case NGAP_ProtocolIE_ID_id_FiveG_S_TMSI: + FiveG_S_TMSI = &ie->value.choice.FiveG_S_TMSI; break; default: break; } } - ogs_debug(" IP[%s] ENB_ID[%d]", + ogs_debug(" IP[%s] RAN_ID[%d]", OGS_ADDR(gnb->addr, buf), gnb->gnb_id); - ogs_assert(ENB_UE_NGAP_ID); - gnb_ue = gnb_ue_find_by_gnb_ue_ngap_id(gnb, *ENB_UE_NGAP_ID); - if (!gnb_ue) { - gnb_ue = gnb_ue_add(gnb, *ENB_UE_NGAP_ID); - ogs_assert(gnb_ue); + if (!RAN_UE_NGAP_ID) { + ogs_warn("No RAN_UE_NGAP_ID"); + group = NGAP_Cause_PR_protocol; + cause = NGAP_CauseProtocol_semantic_error; + ngap_send_ng_setup_failure(gnb, group, cause); + return; + } + + if (!UserLocationInformation) { + ogs_warn("No UserLocationInformation"); + group = NGAP_Cause_PR_protocol; + cause = NGAP_CauseProtocol_semantic_error; + ngap_send_ng_setup_failure(gnb, group, cause); + return; + } + + ran_ue = ran_ue_find_by_ran_ue_ngap_id(gnb, *RAN_UE_NGAP_ID); + if (!ran_ue) { + ran_ue = ran_ue_add(gnb, *RAN_UE_NGAP_ID); + ogs_assert(ran_ue); /* Find AMF_UE if S_TMSI included */ - if (S_TMSI) { - served_guamfi_t *served_guamfi = &amf_self()->served_guamfi[0]; + if (FiveG_S_TMSI) { ogs_nas_5gs_guti_t nas_guti; amf_ue_t *amf_ue = NULL; + uint8_t region; + uint16_t set; + uint8_t pointer; + uint32_t m_tmsi; memset(&nas_guti, 0, sizeof(ogs_nas_5gs_guti_t)); - /* Use the first configured plmn_id and amf group id */ - ogs_nas_from_plmn_id(&nas_guti.nas_plmn_id, &served_guamfi->plmn_id[0]); - nas_guti.amf_gid = served_guamfi->amf_gid[0]; + /* Use the first configured plmn_id and amf id */ + ogs_nas_from_plmn_id(&nas_guti.nas_plmn_id, + &amf_self()->served_guami[0].plmn_id); + region = amf_self()->served_guami[0].amf_id.region; + + /* Getting from 5G-S_TMSI */ + ogs_ngap_AMFSetID_to_uint16(&FiveG_S_TMSI->aMFSetID, &set); + ogs_ngap_AMFPointer_to_uint8(&FiveG_S_TMSI->aMFSetID, &pointer); + + ogs_amf_id_build(&nas_guti.amf_id, region, set, pointer); - /* size must be 1 */ - memcpy(&nas_guti.amf_code, S_TMSI->mMEC.buf, S_TMSI->mMEC.size); /* size must be 4 */ - memcpy(&nas_guti.m_tmsi, S_TMSI->m_TMSI.buf, S_TMSI->m_TMSI.size); - nas_guti.m_tmsi = ntohl(nas_guti.m_tmsi); + ogs_asn_OCTET_STRING_to_uint32(&FiveG_S_TMSI->fiveG_TMSI, &m_tmsi); + nas_guti.m_tmsi = m_tmsi; amf_ue = amf_ue_find_by_guti(&nas_guti); if (!amf_ue) { - ogs_warn("Unknown UE by S_TMSI[G:%d,C:%d,M_TMSI:0x%x]", - nas_guti.amf_gid, nas_guti.amf_code, nas_guti.m_tmsi); + ogs_warn("Unknown UE by 5G-S_TMSI[AMF_ID:0x%x,M_TMSI:0x%x]", + ogs_amf_id_hexdump(&nas_guti.amf_id), nas_guti.m_tmsi); } else { - ogs_debug(" S_TMSI[G:%d,C:%d,M_TMSI:0x%x] IMSI:[%s]", - amf_ue->guti.amf_gid, - amf_ue->guti.amf_code, - amf_ue->guti.m_tmsi, - AMF_UE_HAVE_IMSI(amf_ue) - ? amf_ue->imsi_bcd : "Unknown"); - + ogs_debug("[%s] 5G-S_TMSI[AMF_ID:0x%x,M_TMSI:0x%x]", + AMF_UE_HAVE_SUCI(amf_ue) ? amf_ue->suci : "Unknown ID", + ogs_amf_id_hexdump(&amf_ue->guti.amf_id), + amf_ue->guti.m_tmsi); /* If NAS(amf_ue_t) has already been associated with - * older S1(gnb_ue_t) context */ + * older NG(ran_ue_t) context */ if (ECM_CONNECTED(amf_ue)) { - /* Implcit S1 release */ - ogs_debug("Implicit S1 release"); - ogs_debug(" ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - amf_ue->gnb_ue->gnb_ue_ngap_id, - amf_ue->gnb_ue->amf_ue_ngap_id); - gnb_ue_remove(amf_ue->gnb_ue); + /* Implcit NG release */ + ogs_debug("Implicit NG release"); + ogs_debug(" RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%lld]", + amf_ue->ran_ue->ran_ue_ngap_id, + (long long)amf_ue->ran_ue->amf_ue_ngap_id); + ran_ue_remove(amf_ue->ran_ue); } - amf_ue_associate_gnb_ue(amf_ue, gnb_ue); + amf_ue_associate_ran_ue(amf_ue, ran_ue); } } } - ogs_assert(TAI); - pLMNidentity = &TAI->pLMNidentity; - ogs_assert(pLMNidentity && pLMNidentity->size == sizeof(ogs_plmn_id_t)); - tAC = &TAI->tAC; - ogs_assert(tAC && tAC->size == sizeof(uint16_t)); + if (UserLocationInformation->present == + NGAP_UserLocationInformation_PR_userLocationInformationNR) { + NGAP_UserLocationInformationNR_t *userLocationInformationNR = + UserLocationInformation->choice.userLocationInformationNR; - memcpy(&gnb_ue->saved.tai.plmn_id, pLMNidentity->buf, - sizeof(gnb_ue->saved.tai.plmn_id)); - memcpy(&gnb_ue->saved.tai.tac, tAC->buf, sizeof(gnb_ue->saved.tai.tac)); - gnb_ue->saved.tai.tac = ntohs(gnb_ue->saved.tai.tac); - - ogs_assert(EUTRAN_CGI); - pLMNidentity = &EUTRAN_CGI->pLMNidentity; - ogs_assert(pLMNidentity && pLMNidentity->size == sizeof(ogs_plmn_id_t)); - cell_ID = &EUTRAN_CGI->cell_ID; - ogs_assert(cell_ID); - memcpy(&gnb_ue->saved.e_cgi.plmn_id, pLMNidentity->buf, - sizeof(gnb_ue->saved.e_cgi.plmn_id)); - memcpy(&gnb_ue->saved.e_cgi.cell_id, cell_ID->buf, - sizeof(gnb_ue->saved.e_cgi.cell_id)); - gnb_ue->saved.e_cgi.cell_id = (ntohl(gnb_ue->saved.e_cgi.cell_id) >> 4); + ogs_ngap_ASN_to_nr_cgi( + &userLocationInformationNR->nR_CGI, &ran_ue->saved.cgi); + ogs_ngap_ASN_to_5gs_tai( + &userLocationInformationNR->tAI, &ran_ue->saved.tai); - ogs_debug(" ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d] TAC[%d]", - gnb_ue->gnb_ue_ngap_id, gnb_ue->amf_ue_ngap_id, gnb_ue->saved.tai.tac); + } else + ogs_error("Not implemented UserLocationInformation[%d]", + UserLocationInformation->present); - ngap_send_to_nas(gnb_ue, - NGAP_ProcedureCode_id_initialUEMessage, NAS_PDU); + ogs_debug(" RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%lld] " + "TAC[%d] CellID[0x%llx]", + ran_ue->ran_ue_ngap_id, (long long)ran_ue->amf_ue_ngap_id, + ran_ue->saved.tai.tac.v, (long long)ran_ue->saved.cgi.cell_id); + + ngap_send_to_nas(ran_ue, + NGAP_ProcedureCode_id_InitialUEMessage, NAS_PDU); } void ngap_handle_uplink_nas_transport( @@ -354,10 +358,10 @@ void ngap_handle_uplink_nas_transport( NGAP_UplinkNASTransport_t *UplinkNASTransport = NULL; NGAP_UplinkNASTransport_IEs_t *ie = NULL; - NGAP_ENB_UE_NGAP_ID_t *ENB_UE_NGAP_ID = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; NGAP_NAS_PDU_t *NAS_PDU = NULL; - gnb_ue_t *gnb_ue = NULL; + ran_ue_t *ran_ue = NULL; ogs_assert(gnb); ogs_assert(gnb->sock); @@ -368,13 +372,13 @@ void ngap_handle_uplink_nas_transport( UplinkNASTransport = &initiatingMessage->value.choice.UplinkNASTransport; ogs_assert(UplinkNASTransport); - ogs_debug("[AMF] Uplink NAS transport"); + ogs_debug("Uplink NAS transport"); for (i = 0; i < UplinkNASTransport->protocolIEs.list.count; i++) { ie = UplinkNASTransport->protocolIEs.list.array[i]; switch (ie->id) { - case NGAP_ProtocolIE_ID_id_eNB_UE_NGAP_ID: - ENB_UE_NGAP_ID = &ie->value.choice.ENB_UE_NGAP_ID; + case NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID: + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; break; case NGAP_ProtocolIE_ID_id_NAS_PDU: NAS_PDU = &ie->value.choice.NAS_PDU; @@ -384,20 +388,21 @@ void ngap_handle_uplink_nas_transport( } } - ogs_debug(" IP[%s] ENB_ID[%d]", + ogs_debug(" IP[%s] RAN_ID[%d]", OGS_ADDR(gnb->addr, buf), gnb->gnb_id); - ogs_assert(ENB_UE_NGAP_ID); - gnb_ue = gnb_ue_find_by_gnb_ue_ngap_id(gnb, *ENB_UE_NGAP_ID); - ogs_expect_or_return(gnb_ue); + ogs_assert(RAN_UE_NGAP_ID); + ran_ue = ran_ue_find_by_ran_ue_ngap_id(gnb, *RAN_UE_NGAP_ID); + ogs_expect_or_return(ran_ue); - ogs_debug(" ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - gnb_ue->gnb_ue_ngap_id, gnb_ue->amf_ue_ngap_id); + ogs_debug(" RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%lld]", + ran_ue->ran_ue_ngap_id, (long long)ran_ue->amf_ue_ngap_id); - ngap_send_to_nas(gnb_ue, - NGAP_ProcedureCode_id_uplinkNASTransport, NAS_PDU); + ngap_send_to_nas(ran_ue, + NGAP_ProcedureCode_id_UplinkNASTransport, NAS_PDU); } +#if 0 void ngap_handle_ue_capability_info_indication( amf_gnb_t *gnb, ogs_ngap_message_t *message) { @@ -408,10 +413,10 @@ void ngap_handle_ue_capability_info_indication( NGAP_UECapabilityInfoIndication_t *UECapabilityInfoIndication = NULL; NGAP_UECapabilityInfoIndicationIEs_t *ie = NULL; - NGAP_ENB_UE_NGAP_ID_t *ENB_UE_NGAP_ID = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; NGAP_UERadioCapability_t *UERadioCapability = NULL; - gnb_ue_t *gnb_ue = NULL; + ran_ue_t *ran_ue = NULL; ogs_assert(gnb); ogs_assert(gnb->sock); @@ -428,8 +433,8 @@ void ngap_handle_ue_capability_info_indication( for (i = 0; i < UECapabilityInfoIndication->protocolIEs.list.count; i++) { ie = UECapabilityInfoIndication->protocolIEs.list.array[i]; switch (ie->id) { - case NGAP_ProtocolIE_ID_id_eNB_UE_NGAP_ID: - ENB_UE_NGAP_ID = &ie->value.choice.ENB_UE_NGAP_ID; + case NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID: + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; break; case NGAP_ProtocolIE_ID_id_UERadioCapability: UERadioCapability = &ie->value.choice.UERadioCapability; @@ -439,19 +444,19 @@ void ngap_handle_ue_capability_info_indication( } } - ogs_debug(" IP[%s] ENB_ID[%d]", + ogs_debug(" IP[%s] RAN_ID[%d]", OGS_ADDR(gnb->addr, buf), gnb->gnb_id); - ogs_assert(ENB_UE_NGAP_ID); - gnb_ue = gnb_ue_find_by_gnb_ue_ngap_id(gnb, *ENB_UE_NGAP_ID); - ogs_assert(gnb_ue); + ogs_assert(RAN_UE_NGAP_ID); + ran_ue = ran_ue_find_by_ran_ue_ngap_id(gnb, *RAN_UE_NGAP_ID); + ogs_assert(ran_ue); - ogs_debug(" ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - gnb_ue->gnb_ue_ngap_id, gnb_ue->amf_ue_ngap_id); + ogs_debug(" RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + ran_ue->ran_ue_ngap_id, ran_ue->amf_ue_ngap_id); - if (gnb_ue->amf_ue) { + if (ran_ue->amf_ue) { ogs_assert(UERadioCapability); - OGS_NGAP_STORE_DATA(&gnb_ue->amf_ue->ueRadioCapability, + OGS_NGAP_STORE_DATA(&ran_ue->amf_ue->ueRadioCapability, UERadioCapability); } } @@ -467,11 +472,11 @@ void ngap_handle_initial_context_setup_response( NGAP_InitialContextSetupResponse_t *InitialContextSetupResponse = NULL; NGAP_InitialContextSetupResponseIEs_t *ie = NULL; - NGAP_ENB_UE_NGAP_ID_t *ENB_UE_NGAP_ID = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; NGAP_E_RABSetupListCtxtSURes_t *E_RABSetupListCtxtSURes = NULL; amf_ue_t *amf_ue = NULL; - gnb_ue_t *gnb_ue = NULL; + ran_ue_t *ran_ue = NULL; ogs_assert(gnb); ogs_assert(gnb->sock); @@ -488,8 +493,8 @@ void ngap_handle_initial_context_setup_response( for (i = 0; i < InitialContextSetupResponse->protocolIEs.list.count; i++) { ie = InitialContextSetupResponse->protocolIEs.list.array[i]; switch (ie->id) { - case NGAP_ProtocolIE_ID_id_eNB_UE_NGAP_ID: - ENB_UE_NGAP_ID = &ie->value.choice.ENB_UE_NGAP_ID; + case NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID: + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; break; case NGAP_ProtocolIE_ID_id_E_RABSetupListCtxtSURes: E_RABSetupListCtxtSURes = @@ -500,17 +505,17 @@ void ngap_handle_initial_context_setup_response( } } - ogs_debug(" IP[%s] ENB_ID[%d]", + ogs_debug(" IP[%s] RAN_ID[%d]", OGS_ADDR(gnb->addr, buf), gnb->gnb_id); - ogs_assert(ENB_UE_NGAP_ID); - gnb_ue = gnb_ue_find_by_gnb_ue_ngap_id(gnb, *ENB_UE_NGAP_ID); - ogs_expect_or_return(gnb_ue); - amf_ue = gnb_ue->amf_ue; + ogs_assert(RAN_UE_NGAP_ID); + ran_ue = ran_ue_find_by_ran_ue_ngap_id(gnb, *RAN_UE_NGAP_ID); + ogs_expect_or_return(ran_ue); + amf_ue = ran_ue->amf_ue; ogs_assert(amf_ue); - ogs_debug(" ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - gnb_ue->gnb_ue_ngap_id, gnb_ue->amf_ue_ngap_id); + ogs_debug(" RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + ran_ue->ran_ue_ngap_id, ran_ue->amf_ue_ngap_id); ogs_assert(E_RABSetupListCtxtSURes); for (i = 0; i < E_RABSetupListCtxtSURes->list.count; i++) { @@ -535,7 +540,7 @@ void ngap_handle_initial_context_setup_response( &e_rab->transportLayerAddress, &bearer->gnb_s1u_ip); ogs_assert(rv == OGS_OK); - ogs_debug(" EBI[%d] ENB-S1U-TEID[%d]", + ogs_debug(" EBI[%d] RAN-S1U-TEID[%d]", bearer->ebi, bearer->gnb_s1u_teid); if (OGS_FSM_CHECK(&bearer->sm, esm_state_active)) { @@ -566,11 +571,11 @@ void ngap_handle_initial_context_setup_failure( NGAP_InitialContextSetupFailure_t *InitialContextSetupFailure = NULL; NGAP_InitialContextSetupFailureIEs_t *ie = NULL; - NGAP_ENB_UE_NGAP_ID_t *ENB_UE_NGAP_ID = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; NGAP_Cause_t *Cause = NULL; amf_ue_t *amf_ue = NULL; - gnb_ue_t *gnb_ue = NULL; + ran_ue_t *ran_ue = NULL; ogs_assert(gnb); ogs_assert(gnb->sock); @@ -587,8 +592,8 @@ void ngap_handle_initial_context_setup_failure( for (i = 0; i < InitialContextSetupFailure->protocolIEs.list.count; i++) { ie = InitialContextSetupFailure->protocolIEs.list.array[i]; switch (ie->id) { - case NGAP_ProtocolIE_ID_id_eNB_UE_NGAP_ID: - ENB_UE_NGAP_ID = &ie->value.choice.ENB_UE_NGAP_ID; + case NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID: + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; break; case NGAP_ProtocolIE_ID_id_Cause: Cause = &ie->value.choice.Cause; @@ -598,21 +603,21 @@ void ngap_handle_initial_context_setup_failure( } } - ogs_debug(" IP[%s] ENB_ID[%d]", + ogs_debug(" IP[%s] RAN_ID[%d]", OGS_ADDR(gnb->addr, buf), gnb->gnb_id); - ogs_assert(ENB_UE_NGAP_ID); + ogs_assert(RAN_UE_NGAP_ID); ogs_assert(Cause); - gnb_ue = gnb_ue_find_by_gnb_ue_ngap_id(gnb, *ENB_UE_NGAP_ID); - if (gnb_ue == NULL) { + ran_ue = ran_ue_find_by_ran_ue_ngap_id(gnb, *RAN_UE_NGAP_ID); + if (ran_ue == NULL) { ogs_warn("Initial context setup failure : " - "cannot find eNB-UE-NGAP-ID[%d]", (int)*ENB_UE_NGAP_ID); + "cannot find RAN-UE-NGAP-ID[%d]", (int)*RAN_UE_NGAP_ID); return; } - ogs_debug(" ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - gnb_ue->gnb_ue_ngap_id, gnb_ue->amf_ue_ngap_id); + ogs_debug(" RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + ran_ue->ran_ue_ngap_id, ran_ue->amf_ue_ngap_id); ogs_debug(" Cause[Group:%d Cause:%d]", Cause->present, (int)Cause->choice.radioNetwork); @@ -622,14 +627,14 @@ void ngap_handle_initial_context_setup_failure( /* * 19.2.2.3 in Spec 36.300 * - * In case of failure, eNB and AMF behaviours are not mandated. + * In case of failure, RAN and AMF behaviours are not mandated. * * Both implicit release (local release at each node) and * explicit release (AMF-initiated UE Context Release procedure) - * may in principle be adopted. The eNB should ensure - * that no hanging resources remain at the eNB. + * may in principle be adopted. The RAN should ensure + * that no hanging resources remain at the RAN. */ - amf_send_delete_session_or_gnb_ue_context_release(gnb_ue); + amf_send_delete_session_or_ran_ue_context_release(ran_ue); } void ngap_handle_ue_context_modification_response( @@ -642,10 +647,10 @@ void ngap_handle_ue_context_modification_response( NGAP_UEContextModificationResponse_t *UEContextModificationResponse = NULL; NGAP_UEContextModificationResponseIEs_t *ie = NULL; - NGAP_ENB_UE_NGAP_ID_t *ENB_UE_NGAP_ID = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; amf_ue_t *amf_ue = NULL; - gnb_ue_t *gnb_ue = NULL; + ran_ue_t *ran_ue = NULL; ogs_assert(gnb); ogs_assert(gnb->sock); @@ -662,25 +667,25 @@ void ngap_handle_ue_context_modification_response( for (i = 0; i < UEContextModificationResponse->protocolIEs.list.count; i++) { ie = UEContextModificationResponse->protocolIEs.list.array[i]; switch (ie->id) { - case NGAP_ProtocolIE_ID_id_eNB_UE_NGAP_ID: - ENB_UE_NGAP_ID = &ie->value.choice.ENB_UE_NGAP_ID; + case NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID: + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; break; default: break; } } - ogs_debug(" IP[%s] ENB_ID[%d]", + ogs_debug(" IP[%s] RAN_ID[%d]", OGS_ADDR(gnb->addr, buf), gnb->gnb_id); - ogs_assert(ENB_UE_NGAP_ID); - gnb_ue = gnb_ue_find_by_gnb_ue_ngap_id(gnb, *ENB_UE_NGAP_ID); - ogs_assert(gnb_ue); - amf_ue = gnb_ue->amf_ue; + ogs_assert(RAN_UE_NGAP_ID); + ran_ue = ran_ue_find_by_ran_ue_ngap_id(gnb, *RAN_UE_NGAP_ID); + ogs_assert(ran_ue); + amf_ue = ran_ue->amf_ue; ogs_assert(amf_ue); - ogs_debug(" ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - gnb_ue->gnb_ue_ngap_id, gnb_ue->amf_ue_ngap_id); + ogs_debug(" RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + ran_ue->ran_ue_ngap_id, ran_ue->amf_ue_ngap_id); CLEAR_SERVICE_INDICATOR(amf_ue); } @@ -695,10 +700,10 @@ void ngap_handle_ue_context_modification_failure( NGAP_UEContextModificationFailure_t *UEContextModificationFailure = NULL; NGAP_UEContextModificationFailureIEs_t *ie = NULL; - NGAP_ENB_UE_NGAP_ID_t *ENB_UE_NGAP_ID = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; NGAP_Cause_t *Cause = NULL; - gnb_ue_t *gnb_ue = NULL; + ran_ue_t *ran_ue = NULL; amf_ue_t *amf_ue = NULL; ogs_assert(gnb); @@ -716,8 +721,8 @@ void ngap_handle_ue_context_modification_failure( for (i = 0; i < UEContextModificationFailure->protocolIEs.list.count; i++) { ie = UEContextModificationFailure->protocolIEs.list.array[i]; switch (ie->id) { - case NGAP_ProtocolIE_ID_id_eNB_UE_NGAP_ID: - ENB_UE_NGAP_ID = &ie->value.choice.ENB_UE_NGAP_ID; + case NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID: + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; break; case NGAP_ProtocolIE_ID_id_Cause: Cause = &ie->value.choice.Cause; @@ -727,26 +732,26 @@ void ngap_handle_ue_context_modification_failure( } } - ogs_debug(" IP[%s] ENB_ID[%d]", + ogs_debug(" IP[%s] RAN_ID[%d]", OGS_ADDR(gnb->addr, buf), gnb->gnb_id); - ogs_assert(ENB_UE_NGAP_ID); + ogs_assert(RAN_UE_NGAP_ID); ogs_assert(Cause); - gnb_ue = gnb_ue_find_by_gnb_ue_ngap_id(gnb, *ENB_UE_NGAP_ID); - if (gnb_ue == NULL) { + ran_ue = ran_ue_find_by_ran_ue_ngap_id(gnb, *RAN_UE_NGAP_ID); + if (ran_ue == NULL) { ogs_warn("Initial context setup failure : " - "cannot find eNB-UE-NGAP-ID[%d]", (int)*ENB_UE_NGAP_ID); + "cannot find RAN-UE-NGAP-ID[%d]", (int)*RAN_UE_NGAP_ID); goto cleanup; } - ogs_debug(" ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - gnb_ue->gnb_ue_ngap_id, gnb_ue->amf_ue_ngap_id); + ogs_debug(" RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + ran_ue->ran_ue_ngap_id, ran_ue->amf_ue_ngap_id); ogs_debug(" Cause[Group:%d Cause:%d]", Cause->present, (int)Cause->choice.radioNetwork); cleanup: - amf_ue = gnb_ue->amf_ue; + amf_ue = ran_ue->amf_ue; ogs_assert(amf_ue); CLEAR_SERVICE_INDICATOR(amf_ue); } @@ -763,10 +768,10 @@ void ngap_handle_e_rab_setup_response( NGAP_E_RABSetupResponse_t *E_RABSetupResponse = NULL; NGAP_E_RABSetupResponseIEs_t *ie = NULL; - NGAP_ENB_UE_NGAP_ID_t *ENB_UE_NGAP_ID = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; NGAP_E_RABSetupListBearerSURes_t *E_RABSetupListBearerSURes = NULL; - gnb_ue_t *gnb_ue = NULL; + ran_ue_t *ran_ue = NULL; amf_ue_t *amf_ue = NULL; ogs_assert(gnb); @@ -783,8 +788,8 @@ void ngap_handle_e_rab_setup_response( for (i = 0; i < E_RABSetupResponse->protocolIEs.list.count; i++) { ie = E_RABSetupResponse->protocolIEs.list.array[i]; switch (ie->id) { - case NGAP_ProtocolIE_ID_id_eNB_UE_NGAP_ID: - ENB_UE_NGAP_ID = &ie->value.choice.ENB_UE_NGAP_ID; + case NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID: + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; break; case NGAP_ProtocolIE_ID_id_E_RABSetupListBearerSURes: E_RABSetupListBearerSURes = @@ -795,17 +800,17 @@ void ngap_handle_e_rab_setup_response( } } - ogs_debug(" IP[%s] ENB_ID[%d]", + ogs_debug(" IP[%s] RAN_ID[%d]", OGS_ADDR(gnb->addr, buf), gnb->gnb_id); - ogs_assert(ENB_UE_NGAP_ID); - gnb_ue = gnb_ue_find_by_gnb_ue_ngap_id(gnb, *ENB_UE_NGAP_ID); - ogs_assert(gnb_ue); - amf_ue = gnb_ue->amf_ue; + ogs_assert(RAN_UE_NGAP_ID); + ran_ue = ran_ue_find_by_ran_ue_ngap_id(gnb, *RAN_UE_NGAP_ID); + ogs_assert(ran_ue); + amf_ue = ran_ue->amf_ue; ogs_assert(amf_ue); - ogs_debug(" ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - gnb_ue->gnb_ue_ngap_id, gnb_ue->amf_ue_ngap_id); + ogs_debug(" RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + ran_ue->ran_ue_ngap_id, ran_ue->amf_ue_ngap_id); ogs_assert(E_RABSetupListBearerSURes); for (i = 0; i < E_RABSetupListBearerSURes->list.count; i++) { @@ -858,10 +863,10 @@ void ngap_handle_ue_context_release_request( NGAP_UEContextReleaseRequest_IEs_t *ie = NULL; NGAP_AMF_UE_NGAP_ID_t *AMF_UE_NGAP_ID = NULL; - NGAP_ENB_UE_NGAP_ID_t *ENB_UE_NGAP_ID = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; NGAP_Cause_t *Cause = NULL; - gnb_ue_t *gnb_ue = NULL; + ran_ue_t *ran_ue = NULL; ogs_assert(gnb); ogs_assert(gnb->sock); @@ -881,8 +886,8 @@ void ngap_handle_ue_context_release_request( case NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID: AMF_UE_NGAP_ID = &ie->value.choice.AMF_UE_NGAP_ID; break; - case NGAP_ProtocolIE_ID_id_eNB_UE_NGAP_ID: - ENB_UE_NGAP_ID = &ie->value.choice.ENB_UE_NGAP_ID; + case NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID: + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; break; case NGAP_ProtocolIE_ID_id_Cause: Cause = &ie->value.choice.Cause; @@ -892,23 +897,23 @@ void ngap_handle_ue_context_release_request( } } - ogs_debug(" IP[%s] ENB_ID[%d]", + ogs_debug(" IP[%s] RAN_ID[%d]", OGS_ADDR(gnb->addr, buf), gnb->gnb_id); ogs_assert(AMF_UE_NGAP_ID); - gnb_ue = gnb_ue_find_by_amf_ue_ngap_id(*AMF_UE_NGAP_ID); - if (!gnb_ue) { - ogs_warn("No ENB UE Context : AMF_UE_NGAP_ID[%d]", + ran_ue = ran_ue_find_by_amf_ue_ngap_id(*AMF_UE_NGAP_ID); + if (!ran_ue) { + ogs_warn("No RAN UE Context : AMF_UE_NGAP_ID[%d]", (int)*AMF_UE_NGAP_ID); ngap_send_error_indication(gnb, - AMF_UE_NGAP_ID, ENB_UE_NGAP_ID, + AMF_UE_NGAP_ID, RAN_UE_NGAP_ID, NGAP_Cause_PR_radioNetwork, NGAP_CauseRadioNetwork_unknown_amf_ue_ngap_id); return; } - ogs_debug(" ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - gnb_ue->gnb_ue_ngap_id, gnb_ue->amf_ue_ngap_id); + ogs_debug(" RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + ran_ue->ran_ue_ngap_id, ran_ue->amf_ue_ngap_id); ogs_assert(Cause); ogs_debug(" Cause[Group:%d Cause:%d]", @@ -928,7 +933,7 @@ void ngap_handle_ue_context_release_request( break; } - amf_send_release_access_bearer_or_ue_context_release(gnb_ue); + amf_send_release_access_bearer_or_ue_context_release(ran_ue); } void ngap_handle_ue_context_release_complete( @@ -945,7 +950,7 @@ void ngap_handle_ue_context_release_complete( NGAP_AMF_UE_NGAP_ID_t *AMF_UE_NGAP_ID = NULL; amf_ue_t *amf_ue = NULL; - gnb_ue_t *gnb_ue = NULL; + ran_ue_t *ran_ue = NULL; ogs_assert(gnb); ogs_assert(gnb->sock); @@ -970,13 +975,13 @@ void ngap_handle_ue_context_release_complete( } } - ogs_debug(" IP[%s] ENB_ID[%d]", + ogs_debug(" IP[%s] RAN_ID[%d]", OGS_ADDR(gnb->addr, buf), gnb->gnb_id); ogs_assert(AMF_UE_NGAP_ID); - gnb_ue = gnb_ue_find_by_amf_ue_ngap_id(*AMF_UE_NGAP_ID); - if (!gnb_ue) { - ogs_warn("No ENB UE Context : AMF_UE_NGAP_ID[%d]", + ran_ue = ran_ue_find_by_amf_ue_ngap_id(*AMF_UE_NGAP_ID); + if (!ran_ue) { + ogs_warn("No RAN UE Context : AMF_UE_NGAP_ID[%d]", (int)*AMF_UE_NGAP_ID); ngap_send_error_indication(gnb, AMF_UE_NGAP_ID, NULL, @@ -985,31 +990,31 @@ void ngap_handle_ue_context_release_complete( return; } - amf_ue = gnb_ue->amf_ue; + amf_ue = ran_ue->amf_ue; - ogs_debug(" ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - gnb_ue->gnb_ue_ngap_id, gnb_ue->amf_ue_ngap_id); + ogs_debug(" RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + ran_ue->ran_ue_ngap_id, ran_ue->amf_ue_ngap_id); - switch (gnb_ue->ue_ctx_rel_action) { + switch (ran_ue->ue_ctx_rel_action) { case NGAP_UE_CTX_REL_S1_CONTEXT_REMOVE: ogs_debug(" No Action"); - gnb_ue_remove(gnb_ue); + ran_ue_remove(ran_ue); break; case NGAP_UE_CTX_REL_S1_REMOVE_AND_UNLINK: ogs_debug(" Action: S1 normal release"); - gnb_ue_remove(gnb_ue); + ran_ue_remove(ran_ue); amf_ue_deassociate(amf_ue); break; case NGAP_UE_CTX_REL_UE_CONTEXT_REMOVE: ogs_debug(" Action: UE context remove()"); - gnb_ue_remove(gnb_ue); + ran_ue_remove(ran_ue); amf_ue_remove(amf_ue); break; case NGAP_UE_CTX_REL_DELETE_INDIRECT_TUNNEL: ogs_debug(" Action: Delete indirect tunnel"); - source_ue_deassociate_target_ue(gnb_ue); - gnb_ue_remove(gnb_ue); + source_ue_deassociate_target_ue(ran_ue); + ran_ue_remove(ran_ue); ogs_assert(amf_ue); if (amf_ue_have_indirect_tunnel(amf_ue)) { @@ -1024,7 +1029,7 @@ void ngap_handle_ue_context_release_complete( } break; default: - ogs_fatal("Invalid Action[%d]", gnb_ue->ue_ctx_rel_action); + ogs_fatal("Invalid Action[%d]", ran_ue->ue_ctx_rel_action); ogs_assert_if_reached(); break; } @@ -1041,7 +1046,7 @@ void ngap_handle_path_switch_request( NGAP_PathSwitchRequest_t *PathSwitchRequest = NULL; NGAP_PathSwitchRequestIEs_t *ie = NULL; - NGAP_ENB_UE_NGAP_ID_t *ENB_UE_NGAP_ID = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; NGAP_E_RABToBeSwitchedDLList_t *E_RABToBeSwitchedDLList = NULL; NGAP_AMF_UE_NGAP_ID_t *AMF_UE_NGAP_ID = NULL; NGAP_EUTRAN_CGI_t *EUTRAN_CGI = NULL; @@ -1055,7 +1060,7 @@ void ngap_handle_path_switch_request( NGAP_IntegrityProtectionAlgorithms_t *integrityProtectionAlgorithms = NULL; uint16_t eea = 0, eia = 0; - gnb_ue_t *gnb_ue = NULL; + ran_ue_t *ran_ue = NULL; amf_ue_t *amf_ue = NULL; ogs_pkbuf_t *ngapbuf = NULL; @@ -1073,8 +1078,8 @@ void ngap_handle_path_switch_request( for (i = 0; i < PathSwitchRequest->protocolIEs.list.count; i++) { ie = PathSwitchRequest->protocolIEs.list.array[i]; switch (ie->id) { - case NGAP_ProtocolIE_ID_id_eNB_UE_NGAP_ID: - ENB_UE_NGAP_ID = &ie->value.choice.ENB_UE_NGAP_ID; + case NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID: + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; break; case NGAP_ProtocolIE_ID_id_E_RABToBeSwitchedDLList: E_RABToBeSwitchedDLList = @@ -1097,7 +1102,7 @@ void ngap_handle_path_switch_request( } } - ogs_debug(" IP[%s] ENB_ID[%d]", + ogs_debug(" IP[%s] RAN_ID[%d]", OGS_ADDR(gnb->addr, buf), gnb->gnb_id); ogs_assert(EUTRAN_CGI); @@ -1119,14 +1124,14 @@ void ngap_handle_path_switch_request( &UESecurityCapabilities->integrityProtectionAlgorithms; ogs_assert(AMF_UE_NGAP_ID); - ogs_assert(ENB_UE_NGAP_ID); - gnb_ue = gnb_ue_find_by_amf_ue_ngap_id(*AMF_UE_NGAP_ID); - if (!gnb_ue) { - ogs_error("Cannot find UE from sourceAMF-UE-NGAP-ID[%d] and eNB[%s:%d]", + ogs_assert(RAN_UE_NGAP_ID); + ran_ue = ran_ue_find_by_amf_ue_ngap_id(*AMF_UE_NGAP_ID); + if (!ran_ue) { + ogs_error("Cannot find UE from sourceAMF-UE-NGAP-ID[%d] and RAN[%s:%d]", (int)*AMF_UE_NGAP_ID, OGS_ADDR(gnb->addr, buf), gnb->gnb_id); ngapbuf = ngap_build_path_switch_failure( - *ENB_UE_NGAP_ID, *AMF_UE_NGAP_ID, + *RAN_UE_NGAP_ID, *AMF_UE_NGAP_ID, NGAP_Cause_PR_radioNetwork, NGAP_CauseRadioNetwork_unknown_amf_ue_ngap_id); ogs_expect_or_return(ngapbuf); @@ -1136,37 +1141,37 @@ void ngap_handle_path_switch_request( return; } - ogs_debug(" ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - gnb_ue->gnb_ue_ngap_id, gnb_ue->amf_ue_ngap_id); + ogs_debug(" RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + ran_ue->ran_ue_ngap_id, ran_ue->amf_ue_ngap_id); - amf_ue = gnb_ue->amf_ue; + amf_ue = ran_ue->amf_ue; ogs_assert(amf_ue); if (SECURITY_CONTEXT_IS_VALID(amf_ue)) { amf_ue->nhcc++; - amf_kdf_nh(amf_ue->kasme, amf_ue->nh, amf_ue->nh); + amf_kdf_nh_gnb(amf_ue->kamf, amf_ue->nh, amf_ue->nh); } else { ngapbuf = ngap_build_path_switch_failure( - *ENB_UE_NGAP_ID, *AMF_UE_NGAP_ID, + *RAN_UE_NGAP_ID, *AMF_UE_NGAP_ID, NGAP_Cause_PR_nas, NGAP_CauseNas_authentication_failure); ogs_expect_or_return(ngapbuf); - ngap_send_to_gnb_ue(gnb_ue, ngapbuf); + ngap_send_to_ran_ue(ran_ue, ngapbuf); return; } - gnb_ue->gnb_ue_ngap_id = *ENB_UE_NGAP_ID; + ran_ue->ran_ue_ngap_id = *RAN_UE_NGAP_ID; - memcpy(&gnb_ue->saved.tai.plmn_id, pLMNidentity->buf, - sizeof(gnb_ue->saved.tai.plmn_id)); - memcpy(&gnb_ue->saved.tai.tac, tAC->buf, sizeof(gnb_ue->saved.tai.tac)); - gnb_ue->saved.tai.tac = ntohs(gnb_ue->saved.tai.tac); + memcpy(&ran_ue->saved.tai.plmn_id, pLMNidentity->buf, + sizeof(ran_ue->saved.tai.plmn_id)); + memcpy(&ran_ue->saved.tai.tac, tAC->buf, sizeof(ran_ue->saved.tai.tac)); + ran_ue->saved.tai.tac = ntohs(ran_ue->saved.tai.tac); - memcpy(&gnb_ue->saved.e_cgi.plmn_id, pLMNidentity->buf, - sizeof(gnb_ue->saved.e_cgi.plmn_id)); - memcpy(&gnb_ue->saved.e_cgi.cell_id, cell_ID->buf, - sizeof(gnb_ue->saved.e_cgi.cell_id)); - gnb_ue->saved.e_cgi.cell_id = (ntohl(gnb_ue->saved.e_cgi.cell_id) >> 4); + memcpy(&ran_ue->saved.e_cgi.plmn_id, pLMNidentity->buf, + sizeof(ran_ue->saved.e_cgi.plmn_id)); + memcpy(&ran_ue->saved.e_cgi.cell_id, cell_ID->buf, + sizeof(ran_ue->saved.e_cgi.cell_id)); + ran_ue->saved.e_cgi.cell_id = (ntohl(ran_ue->saved.e_cgi.cell_id) >> 4); ogs_debug(" OLD TAI[PLMN_ID:%06x,TAC:%d]", ogs_plmn_id_hexdump(&amf_ue->tai.plmn_id), @@ -1175,15 +1180,15 @@ void ngap_handle_path_switch_request( ogs_plmn_id_hexdump(&amf_ue->e_cgi.plmn_id), amf_ue->e_cgi.cell_id); ogs_debug(" TAI[PLMN_ID:%06x,TAC:%d]", - ogs_plmn_id_hexdump(&gnb_ue->saved.tai.plmn_id), - gnb_ue->saved.tai.tac); + ogs_plmn_id_hexdump(&ran_ue->saved.tai.plmn_id), + ran_ue->saved.tai.tac); ogs_debug(" E_CGI[PLMN_ID:%06x,CELL_ID:%d]", - ogs_plmn_id_hexdump(&gnb_ue->saved.e_cgi.plmn_id), - gnb_ue->saved.e_cgi.cell_id); + ogs_plmn_id_hexdump(&ran_ue->saved.e_cgi.plmn_id), + ran_ue->saved.e_cgi.cell_id); - /* Copy TAI and ECGI from gnb_ue */ - memcpy(&amf_ue->tai, &gnb_ue->saved.tai, sizeof(ogs_5gs_tai_t)); - memcpy(&amf_ue->e_cgi, &gnb_ue->saved.e_cgi, sizeof(ogs_e_cgi_t)); + /* Copy TAI and ECGI from ran_ue */ + memcpy(&amf_ue->tai, &ran_ue->saved.tai, sizeof(ogs_5gs_tai_t)); + memcpy(&amf_ue->e_cgi, &ran_ue->saved.e_cgi, sizeof(ogs_e_cgi_t)); memcpy(&eea, encryptionAlgorithms->buf, sizeof(eea)); eea = ntohs(eea); @@ -1226,7 +1231,7 @@ void ngap_handle_path_switch_request( } /* Switch to gnb */ - gnb_ue_switch_to_gnb(gnb_ue, gnb); + ran_ue_switch_to_gnb(ran_ue, gnb); } void ngap_handle_gnb_configuration_transfer( @@ -1236,9 +1241,9 @@ void ngap_handle_gnb_configuration_transfer( int i; NGAP_InitiatingMessage_t *initiatingMessage = NULL; - NGAP_ENBConfigurationTransfer_t *ENBConfigurationTransfer = NULL; + NGAP_RANConfigurationTransfer_t *RANConfigurationTransfer = NULL; - NGAP_ENBConfigurationTransferIEs_t *ie = NULL; + NGAP_RANConfigurationTransferIEs_t *ie = NULL; NGAP_SONConfigurationTransfer_t *SONConfigurationTransfer = NULL; ogs_assert(gnb); @@ -1247,13 +1252,13 @@ void ngap_handle_gnb_configuration_transfer( ogs_assert(message); initiatingMessage = message->choice.initiatingMessage; ogs_assert(initiatingMessage); - ENBConfigurationTransfer = - &initiatingMessage->value.choice.ENBConfigurationTransfer; - ogs_assert(ENBConfigurationTransfer); + RANConfigurationTransfer = + &initiatingMessage->value.choice.RANConfigurationTransfer; + ogs_assert(RANConfigurationTransfer); - ogs_debug("[AMF] ENB configuration transfer"); - for (i = 0; i < ENBConfigurationTransfer->protocolIEs.list.count; i++) { - ie = ENBConfigurationTransfer->protocolIEs.list.array[i]; + ogs_debug("[AMF] RAN configuration transfer"); + for (i = 0; i < RANConfigurationTransfer->protocolIEs.list.count; i++) { + ie = RANConfigurationTransfer->protocolIEs.list.array[i]; switch (ie->id) { case NGAP_ProtocolIE_ID_id_SONConfigurationTransferECT: SONConfigurationTransfer = @@ -1264,47 +1269,47 @@ void ngap_handle_gnb_configuration_transfer( } } - ogs_debug(" IP[%s] ENB_ID[%d]", + ogs_debug(" IP[%s] RAN_ID[%d]", OGS_ADDR(gnb->addr, buf), gnb->gnb_id); if (SONConfigurationTransfer) { - NGAP_TargeteNB_ID_t *targeteNB_ID = - &SONConfigurationTransfer->targeteNB_ID; - NGAP_SourceeNB_ID_t *sourceeNB_ID = - &SONConfigurationTransfer->sourceeNB_ID; + NGAP_TargetRAN_ID_t *targetRAN_ID = + &SONConfigurationTransfer->targetRAN_ID; + NGAP_SourceRAN_ID_t *sourceRAN_ID = + &SONConfigurationTransfer->sourceRAN_ID; amf_gnb_t *target_gnb = NULL; uint32_t source_gnb_id, target_gnb_id; uint16_t source_tac, target_tac; - ogs_ngap_ENB_ID_to_uint32( - &sourceeNB_ID->global_ENB_ID.eNB_ID, &source_gnb_id); - ogs_ngap_ENB_ID_to_uint32( - &targeteNB_ID->global_ENB_ID.eNB_ID, &target_gnb_id); + ogs_ngap_RAN_ID_to_uint32( + &sourceRAN_ID->global_RAN_ID.RAN_ID, &source_gnb_id); + ogs_ngap_RAN_ID_to_uint32( + &targetRAN_ID->global_RAN_ID.RAN_ID, &target_gnb_id); - memcpy(&source_tac, sourceeNB_ID->selected_TAI.tAC.buf, + memcpy(&source_tac, sourceRAN_ID->selected_TAI.tAC.buf, sizeof(source_tac)); source_tac = ntohs(source_tac); - memcpy(&target_tac, targeteNB_ID->selected_TAI.tAC.buf, + memcpy(&target_tac, targetRAN_ID->selected_TAI.tAC.buf, sizeof(target_tac)); target_tac = ntohs(target_tac); - ogs_debug(" Source : ENB_ID[%s:%d], TAC[%d]", - sourceeNB_ID->global_ENB_ID.eNB_ID.present == - NGAP_ENB_ID_PR_homeENB_ID ? "Home" : - sourceeNB_ID->global_ENB_ID.eNB_ID.present == - NGAP_ENB_ID_PR_macroENB_ID ? "Macro" : "Others", + ogs_debug(" Source : RAN_ID[%s:%d], TAC[%d]", + sourceRAN_ID->global_RAN_ID.RAN_ID.present == + NGAP_RAN_ID_PR_homeRAN_ID ? "Home" : + sourceRAN_ID->global_RAN_ID.RAN_ID.present == + NGAP_RAN_ID_PR_macroRAN_ID ? "Macro" : "Others", source_gnb_id, source_tac); - ogs_debug(" Target : ENB_ID[%s:%d], TAC[%d]", - targeteNB_ID->global_ENB_ID.eNB_ID.present == - NGAP_ENB_ID_PR_homeENB_ID ? "Home" : - targeteNB_ID->global_ENB_ID.eNB_ID.present == - NGAP_ENB_ID_PR_macroENB_ID ? "Macro" : "Others", + ogs_debug(" Target : RAN_ID[%s:%d], TAC[%d]", + targetRAN_ID->global_RAN_ID.RAN_ID.present == + NGAP_RAN_ID_PR_homeRAN_ID ? "Home" : + targetRAN_ID->global_RAN_ID.RAN_ID.present == + NGAP_RAN_ID_PR_macroRAN_ID ? "Macro" : "Others", target_gnb_id, target_tac); target_gnb = amf_gnb_find_by_gnb_id(target_gnb_id); if (target_gnb == NULL) { - ogs_warn("eNB configuration transfer : cannot find target eNB-id[%d]", + ogs_warn("RAN configuration transfer : cannot find target RAN-id[%d]", target_gnb_id); return; } @@ -1323,7 +1328,7 @@ void ngap_handle_handover_required(amf_gnb_t *gnb, ogs_ngap_message_t *message) NGAP_HandoverRequired_t *HandoverRequired = NULL; NGAP_HandoverRequiredIEs_t *ie = NULL; - NGAP_ENB_UE_NGAP_ID_t *ENB_UE_NGAP_ID = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; NGAP_AMF_UE_NGAP_ID_t *AMF_UE_NGAP_ID = NULL; NGAP_HandoverType_t *HandoverType = NULL; NGAP_Cause_t *Cause = NULL; @@ -1340,7 +1345,7 @@ void ngap_handle_handover_required(amf_gnb_t *gnb, ogs_ngap_message_t *message) HandoverRequired = &initiatingMessage->value.choice.HandoverRequired; ogs_assert(HandoverRequired); - gnb_ue_t *source_ue = NULL; + ran_ue_t *source_ue = NULL; amf_ue_t *amf_ue = NULL; amf_gnb_t *target_gnb = NULL; uint32_t target_gnb_id = 0; @@ -1349,8 +1354,8 @@ void ngap_handle_handover_required(amf_gnb_t *gnb, ogs_ngap_message_t *message) for (i = 0; i < HandoverRequired->protocolIEs.list.count; i++) { ie = HandoverRequired->protocolIEs.list.array[i]; switch (ie->id) { - case NGAP_ProtocolIE_ID_id_eNB_UE_NGAP_ID: - ENB_UE_NGAP_ID = &ie->value.choice.ENB_UE_NGAP_ID; + case NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID: + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; break; case NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID: AMF_UE_NGAP_ID = &ie->value.choice.AMF_UE_NGAP_ID; @@ -1373,14 +1378,14 @@ void ngap_handle_handover_required(amf_gnb_t *gnb, ogs_ngap_message_t *message) } } - ogs_debug(" IP[%s] ENB_ID[%d]", + ogs_debug(" IP[%s] RAN_ID[%d]", OGS_ADDR(gnb->addr, buf), gnb->gnb_id); ogs_assert(TargetID); switch (TargetID->present) { - case NGAP_TargetID_PR_targeteNB_ID: - ogs_ngap_ENB_ID_to_uint32( - &TargetID->choice.targeteNB_ID->global_ENB_ID.eNB_ID, + case NGAP_TargetID_PR_targetRAN_ID: + ogs_ngap_RAN_ID_to_uint32( + &TargetID->choice.targetRAN_ID->global_RAN_ID.RAN_ID, &target_gnb_id); break; default: @@ -1390,26 +1395,26 @@ void ngap_handle_handover_required(amf_gnb_t *gnb, ogs_ngap_message_t *message) target_gnb = amf_gnb_find_by_gnb_id(target_gnb_id); if (target_gnb == NULL) { - ogs_warn("Handover required : cannot find target eNB-id[%d]", + ogs_warn("Handover required : cannot find target RAN-id[%d]", target_gnb_id); return; } - ogs_assert(ENB_UE_NGAP_ID); + ogs_assert(RAN_UE_NGAP_ID); ogs_assert(AMF_UE_NGAP_ID); - source_ue = gnb_ue_find_by_gnb_ue_ngap_id(gnb, *ENB_UE_NGAP_ID); + source_ue = ran_ue_find_by_ran_ue_ngap_id(gnb, *RAN_UE_NGAP_ID); ogs_assert(source_ue); ogs_assert(source_ue->amf_ue_ngap_id == *AMF_UE_NGAP_ID); - ogs_debug(" Source : ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - source_ue->gnb_ue_ngap_id, source_ue->amf_ue_ngap_id); + ogs_debug(" Source : RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + source_ue->ran_ue_ngap_id, source_ue->amf_ue_ngap_id); amf_ue = source_ue->amf_ue; ogs_assert(amf_ue); if (SECURITY_CONTEXT_IS_VALID(amf_ue)) { amf_ue->nhcc++; - amf_kdf_nh(amf_ue->kasme, amf_ue->nh, amf_ue->nh); + amf_kdf_nh_gnb(amf_ue->kamf, amf_ue->nh, amf_ue->nh); } else { ogs_assert(Cause); @@ -1422,7 +1427,7 @@ void ngap_handle_handover_required(amf_gnb_t *gnb, ogs_ngap_message_t *message) source_ue->handover_type = *HandoverType; ngap_send_handover_request(amf_ue, target_gnb, - ENB_UE_NGAP_ID, AMF_UE_NGAP_ID, + RAN_UE_NGAP_ID, AMF_UE_NGAP_ID, HandoverType, Cause, Source_ToTarget_TransparentContainer); } @@ -1438,13 +1443,13 @@ void ngap_handle_handover_request_ack(amf_gnb_t *gnb, ogs_ngap_message_t *messag NGAP_HandoverRequestAcknowledgeIEs_t *ie = NULL; NGAP_AMF_UE_NGAP_ID_t *AMF_UE_NGAP_ID = NULL; - NGAP_ENB_UE_NGAP_ID_t *ENB_UE_NGAP_ID = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; NGAP_E_RABAdmittedList_t *E_RABAdmittedList = NULL; NGAP_Target_ToSource_TransparentContainer_t *Target_ToSource_TransparentContainer = NULL; - gnb_ue_t *source_ue = NULL; - gnb_ue_t *target_ue = NULL; + ran_ue_t *source_ue = NULL; + ran_ue_t *target_ue = NULL; amf_ue_t *amf_ue = NULL; ogs_assert(gnb); @@ -1464,8 +1469,8 @@ void ngap_handle_handover_request_ack(amf_gnb_t *gnb, ogs_ngap_message_t *messag case NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID: AMF_UE_NGAP_ID = &ie->value.choice.AMF_UE_NGAP_ID; break; - case NGAP_ProtocolIE_ID_id_eNB_UE_NGAP_ID: - ENB_UE_NGAP_ID = &ie->value.choice.ENB_UE_NGAP_ID; + case NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID: + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; break; case NGAP_ProtocolIE_ID_id_E_RABAdmittedList: E_RABAdmittedList = &ie->value.choice.E_RABAdmittedList; @@ -1478,28 +1483,28 @@ void ngap_handle_handover_request_ack(amf_gnb_t *gnb, ogs_ngap_message_t *messag break; } } - ogs_debug(" IP[%s] ENB_ID[%d]", + ogs_debug(" IP[%s] RAN_ID[%d]", OGS_ADDR(gnb->addr, buf), gnb->gnb_id); ogs_assert(AMF_UE_NGAP_ID); - ogs_assert(ENB_UE_NGAP_ID); + ogs_assert(RAN_UE_NGAP_ID); ogs_assert(E_RABAdmittedList); ogs_assert(Target_ToSource_TransparentContainer); - target_ue = gnb_ue_find_by_amf_ue_ngap_id(*AMF_UE_NGAP_ID); + target_ue = ran_ue_find_by_amf_ue_ngap_id(*AMF_UE_NGAP_ID); ogs_assert(target_ue); - target_ue->gnb_ue_ngap_id = *ENB_UE_NGAP_ID; + target_ue->ran_ue_ngap_id = *RAN_UE_NGAP_ID; source_ue = target_ue->source_ue; ogs_assert(source_ue); amf_ue = source_ue->amf_ue; ogs_assert(amf_ue); - ogs_debug(" Source : ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - source_ue->gnb_ue_ngap_id, source_ue->amf_ue_ngap_id); - ogs_debug(" Target : ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - target_ue->gnb_ue_ngap_id, target_ue->amf_ue_ngap_id); + ogs_debug(" Source : RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + source_ue->ran_ue_ngap_id, source_ue->amf_ue_ngap_id); + ogs_debug(" Target : RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + target_ue->ran_ue_ngap_id, target_ue->amf_ue_ngap_id); for (i = 0; i < E_RABAdmittedList->list.count; i++) { NGAP_E_RABAdmittedItemIEs_t *ie2 = NULL; @@ -1569,8 +1574,8 @@ void ngap_handle_handover_failure(amf_gnb_t *gnb, ogs_ngap_message_t *message) NGAP_AMF_UE_NGAP_ID_t *AMF_UE_NGAP_ID = NULL; NGAP_Cause_t *Cause = NULL; - gnb_ue_t *target_ue = NULL; - gnb_ue_t *source_ue = NULL; + ran_ue_t *target_ue = NULL; + ran_ue_t *source_ue = NULL; ogs_assert(gnb); ogs_assert(gnb->sock); @@ -1596,28 +1601,28 @@ void ngap_handle_handover_failure(amf_gnb_t *gnb, ogs_ngap_message_t *message) } } - ogs_debug(" IP[%s] ENB_ID[%d]", + ogs_debug(" IP[%s] RAN_ID[%d]", OGS_ADDR(gnb->addr, buf), gnb->gnb_id); ogs_assert(AMF_UE_NGAP_ID); ogs_assert(Cause); - target_ue = gnb_ue_find_by_amf_ue_ngap_id(*AMF_UE_NGAP_ID); + target_ue = ran_ue_find_by_amf_ue_ngap_id(*AMF_UE_NGAP_ID); ogs_assert(target_ue); source_ue = target_ue->source_ue; ogs_assert(source_ue); - ogs_debug(" Source : ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - source_ue->gnb_ue_ngap_id, source_ue->amf_ue_ngap_id); - ogs_debug(" Target : ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - target_ue->gnb_ue_ngap_id, target_ue->amf_ue_ngap_id); + ogs_debug(" Source : RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + source_ue->ran_ue_ngap_id, source_ue->amf_ue_ngap_id); + ogs_debug(" Target : RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + target_ue->ran_ue_ngap_id, target_ue->amf_ue_ngap_id); ngap_send_handover_preparation_failure(source_ue, Cause); ngap_send_ue_context_release_command( target_ue, NGAP_Cause_PR_radioNetwork, - NGAP_CauseRadioNetwork_ho_failure_in_target_EPC_eNB_or_target_system, + NGAP_CauseRadioNetwork_ho_failure_in_target_EPC_RAN_or_target_system, NGAP_UE_CTX_REL_DELETE_INDIRECT_TUNNEL, 0); } @@ -1631,11 +1636,11 @@ void ngap_handle_handover_cancel(amf_gnb_t *gnb, ogs_ngap_message_t *message) NGAP_HandoverCancelIEs_t *ie = NULL; NGAP_AMF_UE_NGAP_ID_t *AMF_UE_NGAP_ID = NULL; - NGAP_ENB_UE_NGAP_ID_t *ENB_UE_NGAP_ID = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; NGAP_Cause_t *Cause = NULL; - gnb_ue_t *source_ue = NULL; - gnb_ue_t *target_ue = NULL; + ran_ue_t *source_ue = NULL; + ran_ue_t *target_ue = NULL; ogs_assert(gnb); ogs_assert(gnb->sock); @@ -1653,8 +1658,8 @@ void ngap_handle_handover_cancel(amf_gnb_t *gnb, ogs_ngap_message_t *message) case NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID: AMF_UE_NGAP_ID = &ie->value.choice.AMF_UE_NGAP_ID; break; - case NGAP_ProtocolIE_ID_id_eNB_UE_NGAP_ID: - ENB_UE_NGAP_ID = &ie->value.choice.ENB_UE_NGAP_ID; + case NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID: + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; break; case NGAP_ProtocolIE_ID_id_Cause: Cause = &ie->value.choice.Cause; @@ -1663,24 +1668,24 @@ void ngap_handle_handover_cancel(amf_gnb_t *gnb, ogs_ngap_message_t *message) break; } } - ogs_debug(" IP[%s] ENB_ID[%d]", + ogs_debug(" IP[%s] RAN_ID[%d]", OGS_ADDR(gnb->addr, buf), gnb->gnb_id); ogs_assert(AMF_UE_NGAP_ID); - ogs_assert(ENB_UE_NGAP_ID); + ogs_assert(RAN_UE_NGAP_ID); ogs_assert(Cause); - source_ue = gnb_ue_find_by_gnb_ue_ngap_id(gnb, *ENB_UE_NGAP_ID); + source_ue = ran_ue_find_by_ran_ue_ngap_id(gnb, *RAN_UE_NGAP_ID); ogs_assert(source_ue); ogs_assert(source_ue->amf_ue_ngap_id == *AMF_UE_NGAP_ID); target_ue = source_ue->target_ue; ogs_assert(target_ue); - ogs_debug(" Source : ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - source_ue->gnb_ue_ngap_id, source_ue->amf_ue_ngap_id); - ogs_debug(" Target : ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - target_ue->gnb_ue_ngap_id, target_ue->amf_ue_ngap_id); + ogs_debug(" Source : RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + source_ue->ran_ue_ngap_id, source_ue->amf_ue_ngap_id); + ogs_debug(" Target : RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + target_ue->ran_ue_ngap_id, target_ue->amf_ue_ngap_id); ngap_send_handover_cancel_ack(source_ue); @@ -1691,8 +1696,8 @@ void ngap_handle_handover_cancel(amf_gnb_t *gnb, ogs_ngap_message_t *message) ogs_time_from_msec(300)); ogs_debug("[AMF] Handover Cancel : " - "UE[eNB-UE-NGAP-ID(%d)] --> eNB[%s:%d]", - source_ue->gnb_ue_ngap_id, + "UE[RAN-UE-NGAP-ID(%d)] --> RAN[%s:%d]", + source_ue->ran_ue_ngap_id, OGS_ADDR(gnb->addr, buf), gnb->gnb_id); } @@ -1702,15 +1707,15 @@ void ngap_handle_gnb_status_transfer(amf_gnb_t *gnb, ogs_ngap_message_t *message int i; NGAP_InitiatingMessage_t *initiatingMessage = NULL; - NGAP_ENBStatusTransfer_t *ENBStatusTransfer = NULL; + NGAP_RANStatusTransfer_t *RANStatusTransfer = NULL; - NGAP_ENBStatusTransferIEs_t *ie = NULL; + NGAP_RANStatusTransferIEs_t *ie = NULL; NGAP_AMF_UE_NGAP_ID_t *AMF_UE_NGAP_ID = NULL; - NGAP_ENB_UE_NGAP_ID_t *ENB_UE_NGAP_ID = NULL; - NGAP_ENB_StatusTransfer_TransparentContainer_t - *ENB_StatusTransfer_TransparentContainer = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; + NGAP_RAN_StatusTransfer_TransparentContainer_t + *RAN_StatusTransfer_TransparentContainer = NULL; - gnb_ue_t *source_ue = NULL, *target_ue = NULL; + ran_ue_t *source_ue = NULL, *target_ue = NULL; ogs_assert(gnb); ogs_assert(gnb->sock); @@ -1718,48 +1723,48 @@ void ngap_handle_gnb_status_transfer(amf_gnb_t *gnb, ogs_ngap_message_t *message ogs_assert(message); initiatingMessage = message->choice.initiatingMessage; ogs_assert(initiatingMessage); - ENBStatusTransfer = &initiatingMessage->value.choice.ENBStatusTransfer; - ogs_assert(ENBStatusTransfer); + RANStatusTransfer = &initiatingMessage->value.choice.RANStatusTransfer; + ogs_assert(RANStatusTransfer); - ogs_debug("[AMF] ENB status transfer"); - for (i = 0; i < ENBStatusTransfer->protocolIEs.list.count; i++) { - ie = ENBStatusTransfer->protocolIEs.list.array[i]; + ogs_debug("[AMF] RAN status transfer"); + for (i = 0; i < RANStatusTransfer->protocolIEs.list.count; i++) { + ie = RANStatusTransfer->protocolIEs.list.array[i]; switch (ie->id) { case NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID: AMF_UE_NGAP_ID = &ie->value.choice.AMF_UE_NGAP_ID; break; - case NGAP_ProtocolIE_ID_id_eNB_UE_NGAP_ID: - ENB_UE_NGAP_ID = &ie->value.choice.ENB_UE_NGAP_ID; + case NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID: + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; break; - case NGAP_ProtocolIE_ID_id_eNB_StatusTransfer_TransparentContainer: - ENB_StatusTransfer_TransparentContainer = - &ie->value.choice.ENB_StatusTransfer_TransparentContainer; + case NGAP_ProtocolIE_ID_id_RAN_StatusTransfer_TransparentContainer: + RAN_StatusTransfer_TransparentContainer = + &ie->value.choice.RAN_StatusTransfer_TransparentContainer; break; default: break; } } - ogs_debug(" IP[%s] ENB_ID[%d]", + ogs_debug(" IP[%s] RAN_ID[%d]", OGS_ADDR(gnb->addr, buf), gnb->gnb_id); ogs_assert(AMF_UE_NGAP_ID); - ogs_assert(ENB_UE_NGAP_ID); - ogs_assert(ENB_StatusTransfer_TransparentContainer); + ogs_assert(RAN_UE_NGAP_ID); + ogs_assert(RAN_StatusTransfer_TransparentContainer); - source_ue = gnb_ue_find_by_gnb_ue_ngap_id(gnb, *ENB_UE_NGAP_ID); + source_ue = ran_ue_find_by_ran_ue_ngap_id(gnb, *RAN_UE_NGAP_ID); ogs_assert(source_ue); ogs_assert(source_ue->amf_ue_ngap_id == *AMF_UE_NGAP_ID); target_ue = source_ue->target_ue; ogs_assert(target_ue); - ogs_debug(" Source : ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - source_ue->gnb_ue_ngap_id, source_ue->amf_ue_ngap_id); - ogs_debug(" Target : ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - target_ue->gnb_ue_ngap_id, target_ue->amf_ue_ngap_id); + ogs_debug(" Source : RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + source_ue->ran_ue_ngap_id, source_ue->amf_ue_ngap_id); + ogs_debug(" Target : RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + target_ue->ran_ue_ngap_id, target_ue->amf_ue_ngap_id); ngap_send_amf_status_transfer(target_ue, - ENB_StatusTransfer_TransparentContainer); + RAN_StatusTransfer_TransparentContainer); } void ngap_handle_handover_notification(amf_gnb_t *gnb, ogs_ngap_message_t *message) @@ -1772,7 +1777,7 @@ void ngap_handle_handover_notification(amf_gnb_t *gnb, ogs_ngap_message_t *messa NGAP_HandoverNotifyIEs_t *ie = NULL; NGAP_AMF_UE_NGAP_ID_t *AMF_UE_NGAP_ID = NULL; - NGAP_ENB_UE_NGAP_ID_t *ENB_UE_NGAP_ID = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; NGAP_EUTRAN_CGI_t *EUTRAN_CGI = NULL; NGAP_TAI_t *TAI = NULL; @@ -1780,8 +1785,8 @@ void ngap_handle_handover_notification(amf_gnb_t *gnb, ogs_ngap_message_t *messa NGAP_CellIdentity_t *cell_ID = NULL; NGAP_TAC_t *tAC = NULL; - gnb_ue_t *source_ue = NULL; - gnb_ue_t *target_ue = NULL; + ran_ue_t *source_ue = NULL; + ran_ue_t *target_ue = NULL; amf_ue_t *amf_ue = NULL; amf_sess_t *sess = NULL; amf_bearer_t *bearer = NULL; @@ -1802,8 +1807,8 @@ void ngap_handle_handover_notification(amf_gnb_t *gnb, ogs_ngap_message_t *messa case NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID: AMF_UE_NGAP_ID = &ie->value.choice.AMF_UE_NGAP_ID; break; - case NGAP_ProtocolIE_ID_id_eNB_UE_NGAP_ID: - ENB_UE_NGAP_ID = &ie->value.choice.ENB_UE_NGAP_ID; + case NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID: + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; break; case NGAP_ProtocolIE_ID_id_EUTRAN_CGI: EUTRAN_CGI = &ie->value.choice.EUTRAN_CGI; @@ -1815,7 +1820,7 @@ void ngap_handle_handover_notification(amf_gnb_t *gnb, ogs_ngap_message_t *messa break; } } - ogs_debug(" IP[%s] ENB_ID[%d]", + ogs_debug(" IP[%s] RAN_ID[%d]", OGS_ADDR(gnb->addr, buf), gnb->gnb_id); ogs_assert(EUTRAN_CGI); @@ -1830,9 +1835,9 @@ void ngap_handle_handover_notification(amf_gnb_t *gnb, ogs_ngap_message_t *messa tAC = &TAI->tAC; ogs_assert(tAC && tAC->size == sizeof(uint16_t)); - ogs_assert(ENB_UE_NGAP_ID); + ogs_assert(RAN_UE_NGAP_ID); ogs_assert(AMF_UE_NGAP_ID); - target_ue = gnb_ue_find_by_gnb_ue_ngap_id(gnb, *ENB_UE_NGAP_ID); + target_ue = ran_ue_find_by_ran_ue_ngap_id(gnb, *RAN_UE_NGAP_ID); ogs_assert(target_ue); ogs_assert(target_ue->amf_ue_ngap_id == *AMF_UE_NGAP_ID); @@ -1841,12 +1846,12 @@ void ngap_handle_handover_notification(amf_gnb_t *gnb, ogs_ngap_message_t *messa amf_ue = source_ue->amf_ue; ogs_assert(amf_ue); - ogs_debug(" Source : ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - source_ue->gnb_ue_ngap_id, source_ue->amf_ue_ngap_id); - ogs_debug(" Target : ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - target_ue->gnb_ue_ngap_id, target_ue->amf_ue_ngap_id); + ogs_debug(" Source : RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + source_ue->ran_ue_ngap_id, source_ue->amf_ue_ngap_id); + ogs_debug(" Target : RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + target_ue->ran_ue_ngap_id, target_ue->amf_ue_ngap_id); - amf_ue_associate_gnb_ue(amf_ue, target_ue); + amf_ue_associate_ran_ue(amf_ue, target_ue); memcpy(&target_ue->saved.tai.plmn_id, pLMNidentity->buf, sizeof(target_ue->saved.tai.plmn_id)); @@ -1874,7 +1879,7 @@ void ngap_handle_handover_notification(amf_gnb_t *gnb, ogs_ngap_message_t *messa ogs_plmn_id_hexdump(&target_ue->saved.e_cgi.plmn_id), target_ue->saved.e_cgi.cell_id); - /* Copy TAI and ECGI from gnb_ue */ + /* Copy TAI and ECGI from ran_ue */ memcpy(&amf_ue->tai, &target_ue->saved.tai, sizeof(ogs_5gs_tai_t)); memcpy(&amf_ue->e_cgi, &target_ue->saved.e_cgi, sizeof(ogs_e_cgi_t)); @@ -1936,7 +1941,7 @@ void ngap_handle_s1_reset( } } - ogs_debug(" IP[%s] ENB_ID[%d]", + ogs_debug(" IP[%s] RAN_ID[%d]", OGS_ADDR(gnb->addr, buf), gnb->gnb_id); ogs_assert(Cause); @@ -1962,7 +1967,7 @@ void ngap_handle_s1_reset( case NGAP_ResetType_PR_s1_Interface: ogs_debug(" NGAP_ResetType_PR_s1_Interface"); - gnb_ue_remove_in_gnb(gnb); + ran_ue_remove_in_gnb(gnb); break; case NGAP_ResetType_PR_partOfS1_Interface: ogs_debug(" NGAP_ResetType_PR_partOfS1_Interface"); @@ -1973,7 +1978,7 @@ void ngap_handle_s1_reset( NGAP_UE_associatedLogicalS1_ConnectionItemRes_t *ie2 = NULL; NGAP_UE_associatedLogicalS1_ConnectionItem_t *item = NULL; - gnb_ue_t *gnb_ue = NULL; + ran_ue_t *ran_ue = NULL; ie2 = (NGAP_UE_associatedLogicalS1_ConnectionItemRes_t *) partOfS1_Interface->list.array[i]; @@ -1982,26 +1987,26 @@ void ngap_handle_s1_reset( item = &ie2->value.choice.UE_associatedLogicalS1_ConnectionItem; ogs_assert(item); - ogs_debug(" AMF_UE_NGAP_ID[%d] ENB_UE_NGAP_ID[%d]", + ogs_debug(" AMF_UE_NGAP_ID[%d] RAN_UE_NGAP_ID[%d]", item->mME_UE_NGAP_ID ? (int)*item->mME_UE_NGAP_ID : -1, - item->eNB_UE_NGAP_ID ? (int)*item->eNB_UE_NGAP_ID : -1); + item->RAN_UE_NGAP_ID ? (int)*item->RAN_UE_NGAP_ID : -1); if (item->mME_UE_NGAP_ID) - gnb_ue = gnb_ue_find_by_amf_ue_ngap_id( + ran_ue = ran_ue_find_by_amf_ue_ngap_id( *item->mME_UE_NGAP_ID); - else if (item->eNB_UE_NGAP_ID) - gnb_ue = gnb_ue_find_by_gnb_ue_ngap_id(gnb, - *item->eNB_UE_NGAP_ID); + else if (item->RAN_UE_NGAP_ID) + ran_ue = ran_ue_find_by_ran_ue_ngap_id(gnb, + *item->RAN_UE_NGAP_ID); - if (gnb_ue == NULL) { + if (ran_ue == NULL) { ogs_warn("Cannot find S1 Context " - "(AMF_UE_NGAP_ID[%d] ENB_UE_NGAP_ID[%d])", + "(AMF_UE_NGAP_ID[%d] RAN_UE_NGAP_ID[%d])", item->mME_UE_NGAP_ID ? (int)*item->mME_UE_NGAP_ID : -1, - item->eNB_UE_NGAP_ID ? (int)*item->eNB_UE_NGAP_ID : -1); + item->RAN_UE_NGAP_ID ? (int)*item->RAN_UE_NGAP_ID : -1); continue; } - gnb_ue_remove(gnb_ue); + ran_ue_remove(ran_ue); } break; default: @@ -2032,7 +2037,7 @@ void ngap_handle_write_replace_warning_response( ogs_debug("[AMF] Write replace warning response"); - ogs_debug(" IP[%s] ENB_ID[%d]", + ogs_debug(" IP[%s] RAN_ID[%d]", OGS_ADDR(gnb->addr, buf), gnb->gnb_id); } @@ -2057,7 +2062,7 @@ void ngap_handle_kill_response( ogs_debug("[AMF] Kill response"); - ogs_debug(" IP[%s] ENB_ID[%d]", + ogs_debug(" IP[%s] RAN_ID[%d]", OGS_ADDR(gnb->addr, buf), gnb->gnb_id); } #endif diff --git a/src/amf/ngap-handler.h b/src/amf/ngap-handler.h index b1ff28e25e..aa88880b49 100644 --- a/src/amf/ngap-handler.h +++ b/src/amf/ngap-handler.h @@ -28,11 +28,11 @@ extern "C" { void ngap_handle_ng_setup_request( amf_gnb_t *gnb, ogs_ngap_message_t *message); -#if 0 void ngap_handle_initial_ue_message( amf_gnb_t *gnb, ogs_ngap_message_t *message); void ngap_handle_uplink_nas_transport( amf_gnb_t *gnb, ogs_ngap_message_t *message); +#if 0 void ngap_handle_ue_capability_info_indication( amf_gnb_t *gnb, ogs_ngap_message_t *message); void ngap_handle_initial_context_setup_response( diff --git a/src/amf/ngap-path.c b/src/amf/ngap-path.c index e25173d79e..af76a7ded9 100644 --- a/src/amf/ngap-path.c +++ b/src/amf/ngap-path.c @@ -23,6 +23,7 @@ #include "ngap-build.h" #include "ngap-path.h" +#include "nas-security.h" int ngap_open(void) { @@ -71,7 +72,7 @@ int ngap_send_to_gnb(amf_gnb_t *gnb, ogs_pkbuf_t *pkbuf, uint16_t stream_no) ogs_assert(pkbuf); ogs_assert(gnb->sock); - ogs_debug(" IP[%s] ENB_ID[%d]", + ogs_debug(" IP[%s] RAN_ID[%d]", OGS_ADDR(gnb->addr, buf), gnb->gnb_id); rv = ngap_send(gnb->sock, pkbuf, @@ -88,22 +89,21 @@ int ngap_send_to_gnb(amf_gnb_t *gnb, ogs_pkbuf_t *pkbuf, uint16_t stream_no) return rv; } -#if 0 -int ngap_send_to_gnb_ue(gnb_ue_t *gnb_ue, ogs_pkbuf_t *pkbuf) +int ngap_send_to_ran_ue(ran_ue_t *ran_ue, ogs_pkbuf_t *pkbuf) { amf_gnb_t *gnb = NULL; - ogs_assert(gnb_ue); - gnb = gnb_ue->gnb; + ogs_assert(ran_ue); + gnb = ran_ue->gnb; ogs_assert(gnb); - return ngap_send_to_gnb(gnb, pkbuf, gnb_ue->gnb_ostream_id); + return ngap_send_to_gnb(gnb, pkbuf, ran_ue->gnb_ostream_id); } -int ngap_delayed_send_to_gnb_ue( - gnb_ue_t *gnb_ue, ogs_pkbuf_t *pkbuf, ogs_time_t duration) +int ngap_delayed_send_to_ran_ue( + ran_ue_t *ran_ue, ogs_pkbuf_t *pkbuf, ogs_time_t duration) { - ogs_assert(gnb_ue); + ogs_assert(ran_ue); ogs_assert(pkbuf); if (duration) { @@ -115,21 +115,21 @@ int ngap_delayed_send_to_gnb_ue( amf_self()->timer_mgr, amf_timer_ng_delayed_send, e); ogs_assert(e->timer); e->pkbuf = pkbuf; - e->gnb_ue = gnb_ue; - e->gnb = gnb_ue->gnb; + e->ran_ue = ran_ue; + e->gnb = ran_ue->gnb; ogs_timer_start(e->timer, duration); return OGS_OK; } else { amf_gnb_t *gnb = NULL; - gnb = gnb_ue->gnb; + gnb = ran_ue->gnb; ogs_assert(gnb); - return ngap_send_to_gnb_ue(gnb_ue, pkbuf); + return ngap_send_to_ran_ue(ran_ue, pkbuf); } } -int ngap_send_to_esm(amf_ue_t *amf_ue, ogs_pkbuf_t *esmbuf) +int ngap_send_to_5gsm(amf_ue_t *amf_ue, ogs_pkbuf_t *esmbuf) { int rv; amf_event_t *e = NULL; @@ -137,7 +137,7 @@ int ngap_send_to_esm(amf_ue_t *amf_ue, ogs_pkbuf_t *esmbuf) ogs_assert(amf_ue); ogs_assert(esmbuf); - e = amf_event_new(AMF_EVT_ESM_MESSAGE); + e = amf_event_new(AMF_EVT_5GSM_MESSAGE); ogs_assert(e); e->amf_ue = amf_ue; e->pkbuf = esmbuf; @@ -151,17 +151,17 @@ int ngap_send_to_esm(amf_ue_t *amf_ue, ogs_pkbuf_t *esmbuf) return rv; } -int ngap_send_to_nas(gnb_ue_t *gnb_ue, +int ngap_send_to_nas(ran_ue_t *ran_ue, NGAP_ProcedureCode_t procedureCode, NGAP_NAS_PDU_t *nasPdu) { - ogs_nas_eps_security_header_t *sh = NULL; + ogs_nas_5gs_security_header_t *sh = NULL; ogs_nas_security_header_type_t security_header_type; - ogs_nas_emm_header_t *h = NULL; + ogs_nas_5gmm_header_t *h = NULL; ogs_pkbuf_t *nasbuf = NULL; amf_event_t *e = NULL; - ogs_assert(gnb_ue); + ogs_assert(ran_ue); ogs_assert(nasPdu); /* The Packet Buffer(pkbuf_t) for NAS message MUST make a HEADROOM. @@ -170,35 +170,32 @@ int ngap_send_to_nas(gnb_ue_t *gnb_ue, ogs_pkbuf_reserve(nasbuf, OGS_NAS_HEADROOM); ogs_pkbuf_put_data(nasbuf, nasPdu->buf, nasPdu->size); - sh = (ogs_nas_eps_security_header_t *)nasbuf->data; + sh = (ogs_nas_5gs_security_header_t *)nasbuf->data; ogs_assert(sh); memset(&security_header_type, 0, sizeof(ogs_nas_security_header_type_t)); switch(sh->security_header_type) { case OGS_NAS_SECURITY_HEADER_PLAIN_NAS_MESSAGE: break; - case OGS_NAS_SECURITY_HEADER_FOR_SERVICE_REQUEST_MESSAGE: - security_header_type.service_request = 1; - break; case OGS_NAS_SECURITY_HEADER_INTEGRITY_PROTECTED: security_header_type.integrity_protected = 1; - ogs_pkbuf_pull(nasbuf, 6); + ogs_pkbuf_pull(nasbuf, 7); break; case OGS_NAS_SECURITY_HEADER_INTEGRITY_PROTECTED_AND_CIPHERED: security_header_type.integrity_protected = 1; security_header_type.ciphered = 1; - ogs_pkbuf_pull(nasbuf, 6); + ogs_pkbuf_pull(nasbuf, 7); break; case OGS_NAS_SECURITY_HEADER_INTEGRITY_PROTECTED_AND_NEW_SECURITY_CONTEXT: security_header_type.integrity_protected = 1; security_header_type.new_security_context = 1; - ogs_pkbuf_pull(nasbuf, 6); + ogs_pkbuf_pull(nasbuf, 7); break; case OGS_NAS_SECURITY_HEADER_INTEGRITY_PROTECTED_AND_CIPHTERD_WITH_NEW_INTEGRITY_CONTEXT: security_header_type.integrity_protected = 1; security_header_type.ciphered = 1; security_header_type.new_security_context = 1; - ogs_pkbuf_pull(nasbuf, 6); + ogs_pkbuf_pull(nasbuf, 7); break; default: ogs_error("Not implemented(security header type:0x%x)", @@ -206,23 +203,24 @@ int ngap_send_to_nas(gnb_ue_t *gnb_ue, return OGS_ERROR; } - if (gnb_ue->amf_ue) { - if (nas_eps_security_decode(gnb_ue->amf_ue, + if (ran_ue->amf_ue) { + if (nas_5gs_security_decode(ran_ue->amf_ue, security_header_type, nasbuf) != OGS_OK) { ogs_error("nas_eps_security_decode failed()"); return OGS_ERROR; } } - h = (ogs_nas_emm_header_t *)nasbuf->data; + h = (ogs_nas_5gmm_header_t *)nasbuf->data; ogs_assert(h); - if (h->protocol_discriminator == OGS_NAS_PROTOCOL_DISCRIMINATOR_EMM) { + if (h->extended_protocol_discriminator == + OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM) { int rv; - e = amf_event_new(AMF_EVT_EMM_MESSAGE); + e = amf_event_new(AMF_EVT_5GMM_MESSAGE); ogs_assert(e); - e->gnb_ue = gnb_ue; - e->ngap_code = procedureCode; - e->nas_type = security_header_type.type; + e->ran_ue = ran_ue; + e->ngap.code = procedureCode; + e->nas.type = security_header_type.type; e->pkbuf = nasbuf; rv = ogs_queue_push(amf_self()->queue, e); if (rv != OGS_OK) { @@ -231,24 +229,24 @@ int ngap_send_to_nas(gnb_ue_t *gnb_ue, amf_event_free(e); } return rv; - } else if (h->protocol_discriminator == OGS_NAS_PROTOCOL_DISCRIMINATOR_ESM) { - amf_ue_t *amf_ue = gnb_ue->amf_ue; + } else if (h->extended_protocol_discriminator == + OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GSM) { + amf_ue_t *amf_ue = ran_ue->amf_ue; ogs_assert(amf_ue); - return ngap_send_to_esm(amf_ue, nasbuf); + return ngap_send_to_5gsm(amf_ue, nasbuf); } else { - ogs_error("Unknown/Unimplemented NAS Protocol discriminator 0x%02x", - h->protocol_discriminator); + ogs_error("Unknown NAS Protocol discriminator 0x%02x", + h->extended_protocol_discriminator); return OGS_ERROR; } } -#endif void ngap_send_ng_setup_response(amf_gnb_t *gnb) { ogs_pkbuf_t *ngap_buffer; - ogs_debug("[AMF] NG-Setup response"); - ngap_buffer = ngap_build_setup_rsp(); + ogs_debug("NG-Setup response"); + ngap_buffer = ngap_build_ng_setup_response(); ogs_expect_or_return(ngap_buffer); ogs_expect(OGS_OK == @@ -260,8 +258,9 @@ void ngap_send_ng_setup_failure( { ogs_pkbuf_t *ngap_buffer; - ogs_debug("[AMF] NG-Setup failure"); - ngap_buffer = ngap_build_setup_failure(group, cause, NGAP_TimeToWait_v10s); + ogs_debug("NG-Setup failure"); + ngap_buffer = ngap_build_ng_setup_failure( + group, cause, NGAP_TimeToWait_v10s); ogs_expect_or_return(ngap_buffer); ogs_expect(OGS_OK == @@ -298,41 +297,41 @@ void ngap_send_ue_context_modification_request(amf_ue_t *amf_ue) } void ngap_send_ue_context_release_command( - gnb_ue_t *gnb_ue, NGAP_Cause_PR group, long cause, + ran_ue_t *ran_ue, NGAP_Cause_PR group, long cause, uint8_t action, uint32_t delay) { int rv; ogs_pkbuf_t *ngapbuf = NULL; - ogs_assert(gnb_ue); + ogs_assert(ran_ue); ogs_debug("[AMF] UE Context release command"); - ogs_debug(" ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - gnb_ue->gnb_ue_ngap_id, gnb_ue->amf_ue_ngap_id); + ogs_debug(" RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + ran_ue->ran_ue_ngap_id, ran_ue->amf_ue_ngap_id); if (delay) { ogs_assert(action != NGAP_UE_CTX_REL_INVALID_ACTION); - gnb_ue->ue_ctx_rel_action = action; + ran_ue->ue_ctx_rel_action = action; ogs_debug(" Group[%d] Cause[%d] Action[%d] Delay[%d]", group, (int)cause, action, delay); - ngapbuf = ngap_build_ue_context_release_command(gnb_ue, group, cause); + ngapbuf = ngap_build_ue_context_release_command(ran_ue, group, cause); ogs_expect_or_return(ngapbuf); - rv = ngap_delayed_send_to_gnb_ue(gnb_ue, ngapbuf, delay); + rv = ngap_delayed_send_to_ran_ue(ran_ue, ngapbuf, delay); ogs_expect(rv == OGS_OK); } else { ogs_assert(action != NGAP_UE_CTX_REL_INVALID_ACTION); - gnb_ue->ue_ctx_rel_action = action; + ran_ue->ue_ctx_rel_action = action; ogs_debug(" Group[%d] Cause[%d] Action[%d] Delay[%d]", group, (int)cause, action, delay); - ngapbuf = ngap_build_ue_context_release_command(gnb_ue, group, cause); + ngapbuf = ngap_build_ue_context_release_command(ran_ue, group, cause); ogs_expect_or_return(ngapbuf); - rv = ngap_delayed_send_to_gnb_ue(gnb_ue, ngapbuf, 0); + rv = ngap_delayed_send_to_ran_ue(ran_ue, ngapbuf, 0); ogs_expect(rv == OGS_OK); } } @@ -402,7 +401,7 @@ void ngap_send_path_switch_ack(amf_ue_t *amf_ue) ogs_expect(rv == OGS_OK); } -void ngap_send_handover_command(gnb_ue_t *source_ue) +void ngap_send_handover_command(ran_ue_t *source_ue) { int rv; ogs_pkbuf_t *ngapbuf = NULL; @@ -412,12 +411,12 @@ void ngap_send_handover_command(gnb_ue_t *source_ue) ngapbuf = ngap_build_handover_command(source_ue); ogs_expect_or_return(ngapbuf); - rv = ngap_send_to_gnb_ue(source_ue, ngapbuf); + rv = ngap_send_to_ran_ue(source_ue, ngapbuf); ogs_expect(rv == OGS_OK); } void ngap_send_handover_preparation_failure( - gnb_ue_t *source_ue, NGAP_Cause_t *cause) + ran_ue_t *source_ue, NGAP_Cause_t *cause) { int rv; ogs_pkbuf_t *ngapbuf = NULL; @@ -428,11 +427,11 @@ void ngap_send_handover_preparation_failure( ngapbuf = ngap_build_handover_preparation_failure(source_ue, cause); ogs_expect_or_return(ngapbuf); - rv = ngap_send_to_gnb_ue(source_ue, ngapbuf); + rv = ngap_send_to_ran_ue(source_ue, ngapbuf); ogs_expect(rv == OGS_OK); } -void ngap_send_handover_cancel_ack(gnb_ue_t *source_ue) +void ngap_send_handover_cancel_ack(ran_ue_t *source_ue) { int rv; ogs_pkbuf_t *ngapbuf = NULL; @@ -442,7 +441,7 @@ void ngap_send_handover_cancel_ack(gnb_ue_t *source_ue) ngapbuf = ngap_build_handover_cancel_ack(source_ue); ogs_expect_or_return(ngapbuf); - rv = ngap_send_to_gnb_ue(source_ue, ngapbuf); + rv = ngap_send_to_ran_ue(source_ue, ngapbuf); ogs_expect(rv == OGS_OK); } @@ -450,7 +449,7 @@ void ngap_send_handover_cancel_ack(gnb_ue_t *source_ue) void ngap_send_handover_request( amf_ue_t *amf_ue, amf_gnb_t *target_gnb, - NGAP_ENB_UE_NGAP_ID_t *gnb_ue_ngap_id, + NGAP_RAN_UE_NGAP_ID_t *ran_ue_ngap_id, NGAP_AMF_UE_NGAP_ID_t *amf_ue_ngap_id, NGAP_HandoverType_t *handovertype, NGAP_Cause_t *cause, @@ -460,40 +459,40 @@ void ngap_send_handover_request( int rv; ogs_pkbuf_t *ngapbuf = NULL; - gnb_ue_t *source_ue = NULL, *target_ue = NULL; + ran_ue_t *source_ue = NULL, *target_ue = NULL; ogs_debug("[AMF] Handover request"); ogs_assert(target_gnb); ogs_assert(amf_ue); - source_ue = amf_ue->gnb_ue; + source_ue = amf_ue->ran_ue; ogs_assert(source_ue); ogs_assert(source_ue->target_ue == NULL); - target_ue = gnb_ue_add(target_gnb, INVALID_UE_NGAP_ID); + target_ue = ran_ue_add(target_gnb, INVALID_UE_NGAP_ID); ogs_assert(target_ue); - ogs_debug(" Source : ENB_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", - source_ue->gnb_ue_ngap_id, source_ue->amf_ue_ngap_id); - ogs_debug(" Target : ENB_UE_NGAP_ID[Unknown] AMF_UE_NGAP_ID[%d]", + ogs_debug(" Source : RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%d]", + source_ue->ran_ue_ngap_id, source_ue->amf_ue_ngap_id); + ogs_debug(" Target : RAN_UE_NGAP_ID[Unknown] AMF_UE_NGAP_ID[%d]", target_ue->amf_ue_ngap_id); source_ue_associate_target_ue(source_ue, target_ue); ngapbuf = ngap_build_handover_request(amf_ue, target_ue, - gnb_ue_ngap_id, amf_ue_ngap_id, + ran_ue_ngap_id, amf_ue_ngap_id, handovertype, cause, source_totarget_transparentContainer); ogs_expect_or_return(ngapbuf); - rv = ngap_send_to_gnb_ue(target_ue, ngapbuf); + rv = ngap_send_to_ran_ue(target_ue, ngapbuf); ogs_expect(rv == OGS_OK); } void ngap_send_amf_status_transfer( - gnb_ue_t *target_ue, - NGAP_ENB_StatusTransfer_TransparentContainer_t + ran_ue_t *target_ue, + NGAP_RAN_StatusTransfer_TransparentContainer_t *gnb_statustransfer_transparentContainer) { int rv; @@ -505,14 +504,15 @@ void ngap_send_amf_status_transfer( gnb_statustransfer_transparentContainer); ogs_expect_or_return(ngapbuf); - rv = ngap_send_to_gnb_ue(target_ue, ngapbuf); + rv = ngap_send_to_ran_ue(target_ue, ngapbuf); ogs_expect(rv == OGS_OK); } +#endif void ngap_send_error_indication( amf_gnb_t *gnb, - NGAP_AMF_UE_NGAP_ID_t *amf_ue_ngap_id, - NGAP_ENB_UE_NGAP_ID_t *gnb_ue_ngap_id, + uint64_t *amf_ue_ngap_id, + NGAP_RAN_UE_NGAP_ID_t *ran_ue_ngap_id, NGAP_Cause_PR group, long cause) { int rv; @@ -521,13 +521,14 @@ void ngap_send_error_indication( ogs_assert(gnb); ngapbuf = ngap_build_error_indication( - amf_ue_ngap_id, gnb_ue_ngap_id, group, cause); + amf_ue_ngap_id, ran_ue_ngap_id, group, cause); ogs_expect_or_return(ngapbuf); rv = ngap_send_to_gnb(gnb, ngapbuf, NGAP_NON_UE_SIGNALLING); ogs_expect(rv == OGS_OK); } +#if 0 void ngap_send_ng_reset_ack( amf_gnb_t *gnb, NGAP_UE_associatedLogicalNG_ConnectionListRes_t *partOfNG_Interface) diff --git a/src/amf/ngap-path.h b/src/amf/ngap-path.h index 1365d49add..5231ad9653 100644 --- a/src/amf/ngap-path.h +++ b/src/amf/ngap-path.h @@ -40,14 +40,12 @@ int ngap_send(ogs_sock_t *sock, int ngap_send_to_gnb( amf_gnb_t *gnb, ogs_pkbuf_t *pkb, uint16_t stream_no); -#if 0 -int ngap_send_to_gnb_ue(gnb_ue_t *gnb_ue, ogs_pkbuf_t *pkbuf); -int ngap_delayed_send_to_gnb_ue(gnb_ue_t *gnb_ue, +int ngap_send_to_ran_ue(ran_ue_t *ran_ue, ogs_pkbuf_t *pkbuf); +int ngap_delayed_send_to_ran_ue(ran_ue_t *ran_ue, ogs_pkbuf_t *pkbuf, ogs_time_t duration); -int ngap_send_to_nas(gnb_ue_t *gnb_ue, +int ngap_send_to_nas(ran_ue_t *ran_ue, NGAP_ProcedureCode_t procedureCode, NGAP_NAS_PDU_t *nasPdu); -int ngap_send_to_esm(amf_ue_t *amf_ue, ogs_pkbuf_t *esmbuf); -#endif +int ngap_send_to_5gsm(amf_ue_t *amf_ue, ogs_pkbuf_t *esmbuf); void ngap_send_ng_setup_response(amf_gnb_t *gnb); void ngap_send_ng_setup_failure( @@ -57,7 +55,7 @@ void ngap_send_ng_setup_failure( void ngap_send_initial_context_setup_request(amf_ue_t *amf_ue); void ngap_send_ue_context_modification_request(amf_ue_t *amf_ue); void ngap_send_ue_context_release_command( - gnb_ue_t *gnb_ue, NGAP_Cause_PR group, long cause, + ran_ue_t *ran_ue, NGAP_Cause_PR group, long cause, uint8_t action, uint32_t delay); void ngap_send_paging(amf_ue_t *amf_ue, NGAP_CNDomain_t cn_domain); @@ -68,31 +66,33 @@ void ngap_send_amf_configuration_transfer( void ngap_send_path_switch_ack(amf_ue_t *amf_ue); -void ngap_send_handover_command(gnb_ue_t *source_ue); +void ngap_send_handover_command(ran_ue_t *source_ue); void ngap_send_handover_preparation_failure( - gnb_ue_t *source_ue, NGAP_Cause_t *cause); + ran_ue_t *source_ue, NGAP_Cause_t *cause); void ngap_send_handover_request( amf_ue_t *amf_ue, amf_gnb_t *target_gnb, - NGAP_ENB_UE_NGAP_ID_t *gnb_ue_ngap_id, + NGAP_RAN_UE_NGAP_ID_t *ran_ue_ngap_id, NGAP_AMF_UE_NGAP_ID_t *amf_ue_ngap_id, NGAP_HandoverType_t *handovertype, NGAP_Cause_t *cause, NGAP_Source_ToTarget_TransparentContainer_t *source_totarget_transparentContainer); -void ngap_send_handover_cancel_ack(gnb_ue_t *source_ue); +void ngap_send_handover_cancel_ack(ran_ue_t *source_ue); void ngap_send_amf_status_transfer( - gnb_ue_t *target_ue, - NGAP_ENB_StatusTransfer_TransparentContainer_t + ran_ue_t *target_ue, + NGAP_RAN_StatusTransfer_TransparentContainer_t *gnb_statustransfer_transparentContainer); +#endif void ngap_send_error_indication( amf_gnb_t *gnb, - NGAP_AMF_UE_NGAP_ID_t *amf_ue_ngap_id, - NGAP_ENB_UE_NGAP_ID_t *gnb_ue_ngap_id, + uint64_t *amf_ue_ngap_id, + NGAP_RAN_UE_NGAP_ID_t *ran_ue_ngap_id, NGAP_Cause_PR group, long cause); +#if 0 void ngap_send_ng_reset_ack( amf_gnb_t *gnb, NGAP_UE_associatedLogicalNG_ConnectionListRes_t *partOfNG_Interface); diff --git a/src/amf/ngap-sm.c b/src/amf/ngap-sm.c index 68f8eab826..db6cd05075 100644 --- a/src/amf/ngap-sm.c +++ b/src/amf/ngap-sm.c @@ -67,21 +67,21 @@ void ngap_state_operational(ogs_fsm_t *s, amf_event_t *e) ogs_assert(pdu); switch (pdu->present) { - case NGAP_NGAP_PDU_PR_initiatingMessage : + case NGAP_NGAP_PDU_PR_initiatingMessage: initiatingMessage = pdu->choice.initiatingMessage; ogs_assert(initiatingMessage); switch (initiatingMessage->procedureCode) { - case NGAP_ProcedureCode_id_NGSetup : + case NGAP_ProcedureCode_id_NGSetup: ngap_handle_ng_setup_request(gnb, pdu); break; -#if 0 - case NGAP_ProcedureCode_id_initialUEMessage : + case NGAP_ProcedureCode_id_InitialUEMessage: ngap_handle_initial_ue_message(gnb, pdu); break; - case NGAP_ProcedureCode_id_uplinkNASTransport : + case NGAP_ProcedureCode_id_UplinkNASTransport: ngap_handle_uplink_nas_transport(gnb, pdu); break; +#if 0 case NGAP_ProcedureCode_id_UECapabilityInfoIndication : ngap_handle_ue_capability_info_indication( gnb, pdu); break; diff --git a/src/amf/nnrf-build.c b/src/amf/nnrf-build.c deleted file mode 100644 index 73fd5e492b..0000000000 --- a/src/amf/nnrf-build.c +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Copyright (C) 2019,2020 by Sukchan Lee - * - * This file is part of Open5GS. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "nnrf-build.h" - -ogs_sbi_request_t *amf_nnrf_build_nf_register( - ogs_sbi_nf_instance_t *nf_instance) -{ - ogs_sbi_message_t message; - ogs_sbi_request_t *request = NULL; - ogs_sbi_client_t *client = NULL; - - OpenAPI_nf_profile_t *NFProfile = NULL; - - ogs_assert(nf_instance); - client = nf_instance->client; - ogs_assert(client); - - memset(&message, 0, sizeof(message)); - message.h.method = (char *)OGS_SBI_HTTP_METHOD_PUT; - message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NRF_NFM; - message.h.api.version = (char *)OGS_SBI_API_VERSION; - message.h.resource.name = (char *)OGS_SBI_RESOURCE_NAME_NF_INSTANCES; - message.h.resource.id = ogs_sbi_self()->nf_instance_id; - - message.http.content_encoding = (char*)ogs_sbi_self()->content_encoding; - - NFProfile = ogs_sbi_nnrf_build_nf_profile(nf_instance); - ogs_assert(NFProfile); - - NFProfile->heart_beat_timer = nf_instance->time.heartbeat; - - message.NFProfile = NFProfile; - - request = ogs_sbi_build_request(&message); - ogs_assert(request); - - ogs_sbi_nnrf_free_nf_profile(NFProfile); - - return request; -} - -ogs_sbi_request_t *amf_nnrf_build_nf_update(ogs_sbi_nf_instance_t *nf_instance) -{ - ogs_sbi_message_t message; - ogs_sbi_request_t *request = NULL; - - OpenAPI_list_t *PatchItemList; - OpenAPI_patch_item_t item; - - ogs_assert(nf_instance); - - memset(&message, 0, sizeof(message)); - message.h.method = (char *)OGS_SBI_HTTP_METHOD_PATCH; - message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NRF_NFM; - message.h.api.version = (char *)OGS_SBI_API_VERSION; - message.h.resource.name = (char *)OGS_SBI_RESOURCE_NAME_NF_INSTANCES; - message.h.resource.id = ogs_sbi_self()->nf_instance_id; - message.http.content_type = (char *)OGS_SBI_CONTENT_PATCH_TYPE; - - PatchItemList = OpenAPI_list_create(); - ogs_assert(PatchItemList); - - memset(&item, 0, sizeof(item)); - item.op = OpenAPI_patch_operation_replace; - item.path = (char *)"/nfStatus"; - item.value = OpenAPI_nf_status_ToString(OpenAPI_nf_status_REGISTERED); - - OpenAPI_list_add(PatchItemList, &item); - - message.PatchItemList = PatchItemList; - - request = ogs_sbi_build_request(&message); - ogs_assert(request); - - OpenAPI_list_free(PatchItemList); - - return request; -} - -ogs_sbi_request_t *amf_nnrf_build_nf_de_register( - ogs_sbi_nf_instance_t *nf_instance) -{ - ogs_sbi_message_t message; - ogs_sbi_request_t *request = NULL; - - ogs_assert(nf_instance); - - memset(&message, 0, sizeof(message)); - message.h.method = (char *)OGS_SBI_HTTP_METHOD_DELETE; - message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NRF_NFM; - message.h.api.version = (char *)OGS_SBI_API_VERSION; - message.h.resource.name = (char *)OGS_SBI_RESOURCE_NAME_NF_INSTANCES; - message.h.resource.id = nf_instance->id; - - request = ogs_sbi_build_request(&message); - ogs_assert(request); - - return request; -} - -ogs_sbi_request_t *amf_nnrf_build_nf_status_subscribe( - ogs_sbi_subscription_t *subscription) -{ - ogs_sbi_message_t message; - ogs_sbi_request_t *request = NULL; - ogs_sbi_server_t *server = NULL; - - OpenAPI_subscription_data_t *SubscriptionData = NULL; - - ogs_assert(subscription); - ogs_assert(subscription->nf_type); - - memset(&message, 0, sizeof(message)); - message.h.method = (char *)OGS_SBI_HTTP_METHOD_POST; - message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NRF_NFM; - message.h.api.version = (char *)OGS_SBI_API_VERSION; - message.h.resource.name = (char *)OGS_SBI_RESOURCE_NAME_SUBSCRIPTIONS; - - SubscriptionData = ogs_calloc(1, sizeof(*SubscriptionData)); - ogs_assert(SubscriptionData); - - server = ogs_list_first(&ogs_sbi_self()->server_list); - ogs_assert(server); - - SubscriptionData->nf_status_notification_uri = ogs_sbi_server_uri(server, - OGS_SBI_SERVICE_NAME_NRF_NFM, OGS_SBI_API_VERSION, - OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY, NULL); - ogs_assert(SubscriptionData->nf_status_notification_uri); - - SubscriptionData->req_nf_type = subscription->nf_type; - SubscriptionData->req_nf_instance_id = subscription->nf_instance_id; - - message.SubscriptionData = SubscriptionData; - - request = ogs_sbi_build_request(&message); - ogs_assert(request); - - ogs_free(SubscriptionData->nf_status_notification_uri); - ogs_free(SubscriptionData); - - return request; -} - -ogs_sbi_request_t *amf_nnrf_build_nf_status_unsubscribe( - ogs_sbi_subscription_t *subscription) -{ - ogs_sbi_message_t message; - ogs_sbi_request_t *request = NULL; - - ogs_assert(subscription); - - memset(&message, 0, sizeof(message)); - message.h.method = (char *)OGS_SBI_HTTP_METHOD_DELETE; - message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NRF_NFM; - message.h.api.version = (char *)OGS_SBI_API_VERSION; - message.h.resource.name = (char *)OGS_SBI_RESOURCE_NAME_SUBSCRIPTIONS; - message.h.resource.id = subscription->id; - - request = ogs_sbi_build_request(&message); - ogs_assert(request); - - return request; -} - -ogs_sbi_request_t *amf_nnrf_build_nf_discover( - OpenAPI_nf_type_e target_nf_type, OpenAPI_nf_type_e requester_nf_type) -{ - ogs_sbi_message_t message; - ogs_sbi_request_t *request = NULL; - - ogs_assert(target_nf_type); - ogs_assert(requester_nf_type); - - memset(&message, 0, sizeof(message)); - message.h.method = (char *)OGS_SBI_HTTP_METHOD_GET; - message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NRF_DISC; - message.h.api.version = (char *)OGS_SBI_API_VERSION; - message.h.resource.name = (char *)OGS_SBI_RESOURCE_NAME_NF_INSTANCES; - - message.param.target_nf_type = target_nf_type; - message.param.requester_nf_type = requester_nf_type; - - request = ogs_sbi_build_request(&message); - ogs_assert(request); - - return request; -} diff --git a/src/amf/nnrf-handler.c b/src/amf/nnrf-handler.c index e5c11d3c8c..0462d60152 100644 --- a/src/amf/nnrf-handler.c +++ b/src/amf/nnrf-handler.c @@ -18,6 +18,7 @@ */ #include "sbi-path.h" +#include "nas-path.h" #include "nnrf-handler.h" void amf_nnrf_handle_nf_register( @@ -79,10 +80,12 @@ void amf_nnrf_handle_nf_status_subscribe( duration = diff - (int)VALIDITY_MARGIN; if (duration < (int)VALIDITY_MINIMUM) { - ogs_warn("Validation period [%d seconds, %s] is too small", + ogs_warn("[%s] Validation period [%d seconds, %s] is too small", + subscription->id, (int)diff, SubscriptionData->validity_time); duration = VALIDITY_MINIMUM; - ogs_warn("Forced to %d seconds", VALIDITY_MINIMUM); + ogs_warn("[%s] Forced to %d seconds", + subscription->id, VALIDITY_MINIMUM); } subscription->t_validity = ogs_timer_add(amf_self()->timer_mgr, @@ -94,7 +97,7 @@ void amf_nnrf_handle_nf_status_subscribe( } } -bool amf_nnrf_handle_nf_status_notify(ogs_sbi_server_t *server, +bool amf_nnrf_handle_nf_status_notify( ogs_sbi_session_t *session, ogs_sbi_message_t *message) { ogs_sbi_response_t *response = NULL; @@ -137,7 +140,7 @@ bool amf_nnrf_handle_nf_status_notify(ogs_sbi_server_t *server, } if (NF_INSTANCE_IS_SELF(NFProfile->nf_instance_id)) { - ogs_error("The notification is not allowed [%s]", + ogs_error("[%s] The notification is not allowed", NFProfile->nf_instance_id); ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_FORBIDDEN, message, "The notification is not allowed", @@ -147,7 +150,6 @@ bool amf_nnrf_handle_nf_status_notify(ogs_sbi_server_t *server, if (NotificationData->event == OpenAPI_notification_event_type_NF_REGISTERED) { - ogs_sbi_client_t *client = NULL; nf_instance = ogs_sbi_nf_instance_find(NFProfile->nf_instance_id); if (!nf_instance) { @@ -155,41 +157,47 @@ bool amf_nnrf_handle_nf_status_notify(ogs_sbi_server_t *server, ogs_assert(nf_instance); amf_nf_fsm_init(nf_instance); - ogs_info("(NRF-notify) NF registered [%s]", nf_instance->id); - } else - ogs_warn("(NRF-notify) NF [%s] has already been added", + + ogs_info("[%s] (NRF-notify) NF registered", nf_instance->id); + } else { + OGS_FSM_TRAN(&nf_instance->sm, amf_nf_state_registered); + ogs_fsm_dispatch(&nf_instance->sm, NULL); + + ogs_warn("[%s] (NRF-notify) NF has already been added", NFProfile->nf_instance_id); + } handled = ogs_sbi_nnrf_handle_nf_profile( nf_instance, NFProfile, session, message); - if (!handled) return false; - - ogs_info("(NRF-notify) NF Profile updated [%s]", nf_instance->id); - - client = ogs_sbi_nf_instance_find_client(nf_instance); - if (!client) { - ogs_error("Cannot find client [%s]", nf_instance->id); - ogs_sbi_server_send_error(session, - OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "Cannot find client", nf_instance->id); + if (!handled) { + AMF_NF_INSTANCE_CLEAR("NRF-notify", nf_instance); return false; } - amf_sbi_nf_associate_client(nf_instance, client); + + ogs_info("[%s] (NRF-notify) NF Profile updated", nf_instance->id); + + handled = ogs_sbi_client_associate(nf_instance); + if (!handled) { + ogs_error("[%s] Cannot associate NF EndPoint", nf_instance->id); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_BAD_REQUEST, + message, "Cannot find NF EndPoint", nf_instance->id); + AMF_NF_INSTANCE_CLEAR("NRF-notify", nf_instance); + return false; + } + + amf_sbi_setup_client_callback(nf_instance); } else if (NotificationData->event == OpenAPI_notification_event_type_NF_DEREGISTERED) { nf_instance = ogs_sbi_nf_instance_find(NFProfile->nf_instance_id); if (nf_instance) { - ogs_info("(NRF-notify) NF de-registered [%s]", nf_instance->id); - amf_nf_fsm_fini(nf_instance); - ogs_sbi_nf_instance_remove(nf_instance); - - /* FIXME : Remove unnecessary Client */ + AMF_NF_INSTANCE_CLEAR("NRF-notify", nf_instance); } else { - ogs_warn("(NRF-notify) Not found [%s]", NFProfile->nf_instance_id); + ogs_warn("[%s] (NRF-notify) Not found", NFProfile->nf_instance_id); ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_NOT_FOUND, - message, "Not found", message->h.resource.id); + message, "Not found", message->h.resource.component[1]); return false; } } else { @@ -203,20 +211,23 @@ bool amf_nnrf_handle_nf_status_notify(ogs_sbi_server_t *server, return false; } - response = ogs_sbi_build_response(message); + response = ogs_sbi_build_response(message, OGS_SBI_HTTP_STATUS_NO_CONTENT); ogs_assert(response); - ogs_sbi_server_send_response(session, response, - OGS_SBI_HTTP_STATUS_NO_CONTENT); + ogs_sbi_server_send_response(session, response); return true; } -void amf_nnrf_handle_nf_discover(ogs_sbi_message_t *message) +void amf_nnrf_handle_nf_discover(amf_ue_t *amf_ue, ogs_sbi_message_t *message) { + int rv; + ogs_sbi_nf_instance_t *nf_instance = NULL; + OpenAPI_search_result_t *SearchResult = NULL; OpenAPI_lnode_t *node = NULL; bool handled; + ogs_assert(amf_ue); ogs_assert(message); SearchResult = message->SearchResult; @@ -227,8 +238,6 @@ void amf_nnrf_handle_nf_discover(ogs_sbi_message_t *message) OpenAPI_list_for_each(SearchResult->nf_instances, node) { OpenAPI_nf_profile_t *NFProfile = NULL; - ogs_sbi_nf_instance_t *nf_instance = NULL; - ogs_sbi_client_t *client = NULL; if (!node->data) continue; @@ -240,10 +249,15 @@ void amf_nnrf_handle_nf_discover(ogs_sbi_message_t *message) ogs_assert(nf_instance); amf_nf_fsm_init(nf_instance); - ogs_info("(NF-discover) NF registered [%s]", nf_instance->id); - } else - ogs_warn("(NF-discover) NF [%s] has already been added", + + ogs_info("[%s] (NF-discover) NF registered", nf_instance->id); + } else { + OGS_FSM_TRAN(&nf_instance->sm, amf_nf_state_registered); + ogs_fsm_dispatch(&nf_instance->sm, NULL); + + ogs_warn("[%s] (NF-discover) NF has already been added", NFProfile->nf_instance_id); + } if (NF_INSTANCE_IS_OTHERS(nf_instance->id)) { handled = ogs_sbi_nnrf_handle_nf_profile( @@ -251,15 +265,23 @@ void amf_nnrf_handle_nf_discover(ogs_sbi_message_t *message) if (!handled) { ogs_error("ogs_sbi_nnrf_handle_nf_profile() failed [%s]", nf_instance->id); + AMF_NF_INSTANCE_CLEAR("NRF-discover", nf_instance); continue; } - client = ogs_sbi_nf_instance_find_client(nf_instance); - if (!client) { - ogs_error("Cannot find client [%s]", nf_instance->id); + handled = ogs_sbi_client_associate(nf_instance); + if (!handled) { + ogs_error("[%s] Cannot assciate NF EndPoint", nf_instance->id); + AMF_NF_INSTANCE_CLEAR("NRF-discover", nf_instance); continue; } - amf_sbi_nf_associate_client(nf_instance, client); + + amf_sbi_setup_client_callback(nf_instance); + + if (!OGS_SBI_NF_INSTANCE_GET( + amf_ue->nf_types, nf_instance->nf_type)) + ogs_sbi_nf_types_associate(amf_ue->nf_types, + nf_instance->nf_type, amf_nf_state_registered); /* TIME : Update validity from NRF */ if (SearchResult->validity_period) { @@ -270,9 +292,32 @@ void amf_nnrf_handle_nf_discover(ogs_sbi_message_t *message) ogs_time_from_sec(nf_instance->time.validity)); } else - ogs_warn("NF Instance validity-time should not 0"); + ogs_warn("[%s] NF Instance validity-time should not 0", + nf_instance->id); - ogs_info("(NF-discover) NF Profile updated [%s]", nf_instance->id); + ogs_info("[%s] (NF-discover) NF Profile updated", nf_instance->id); } } + + if (OGS_FSM_CHECK(&amf_ue->sm, gmm_state_authentication)) { + nf_instance = OGS_SBI_NF_INSTANCE_GET( + amf_ue->nf_types, OpenAPI_nf_type_AUSF); + if (!nf_instance) { + ogs_error("[%s] (NF discover) No AUSF", amf_ue->suci); + nas_5gs_send_nas_reject( + amf_ue, OGS_5GMM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED); + amf_ue_remove(amf_ue); + } else { + rv = amf_nausf_auth_send_authenticate(amf_ue, nf_instance); + if (rv != OGS_OK) { + ogs_error("[%s] Cannot send SBI message", amf_ue->suci); + nas_5gs_send_nas_reject( + amf_ue, OGS_5GMM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED); + amf_ue_remove(amf_ue); + } + } + } else { + ogs_fatal("Should implement other case"); + ogs_assert_if_reached(); + } } diff --git a/src/amf/nnrf-handler.h b/src/amf/nnrf-handler.h index 7ef42d1cf2..2fc49e7dcc 100644 --- a/src/amf/nnrf-handler.h +++ b/src/amf/nnrf-handler.h @@ -20,7 +20,6 @@ #ifndef AMF_NNRF_HANDLER_H #define AMF_NNRF_HANDLER_H -#include "ogs-sbi.h" #include "context.h" #ifdef __cplusplus @@ -32,10 +31,10 @@ void amf_nnrf_handle_nf_register( void amf_nnrf_handle_nf_status_subscribe( ogs_sbi_subscription_t *subscription, ogs_sbi_message_t *message); -bool amf_nnrf_handle_nf_status_notify(ogs_sbi_server_t *server, +bool amf_nnrf_handle_nf_status_notify( ogs_sbi_session_t *session, ogs_sbi_message_t *message); -void amf_nnrf_handle_nf_discover(ogs_sbi_message_t *message); +void amf_nnrf_handle_nf_discover(amf_ue_t *amf_ue, ogs_sbi_message_t *message); #ifdef __cplusplus } diff --git a/src/amf/sbi-path.c b/src/amf/sbi-path.c index e525c374d4..dc8e89cd76 100644 --- a/src/amf/sbi-path.c +++ b/src/amf/sbi-path.c @@ -17,8 +17,9 @@ * along with this program. If not, see . */ -#include "context.h" #include "sbi-path.h" +#include "nas-path.h" +#include "nausf-build.h" static int server_cb(ogs_sbi_server_t *server, ogs_sbi_session_t *session, ogs_sbi_request_t *request) @@ -71,25 +72,22 @@ static int client_cb(ogs_sbi_response_t *response, void *data) int amf_sbi_open(void) { ogs_sbi_nf_instance_t *nf_instance = NULL; - ogs_sbi_client_t *client = NULL; ogs_sbi_server_start_all(server_cb); - ogs_list_for_each(&ogs_sbi_self()->client_list, client) { + ogs_list_for_each(&ogs_sbi_self()->nf_instance_list, nf_instance) { ogs_sbi_nf_service_t *service = NULL; - nf_instance = ogs_sbi_nf_instance_build_default( - amf_self()->nf_type, client); - ogs_assert(nf_instance); + ogs_sbi_nf_instance_build_default(nf_instance, amf_self()->nf_type); service = ogs_sbi_nf_service_build_default(nf_instance, - (char*)OGS_SBI_SERVICE_NAME_SMF_PDUSESSION, client); + (char*)OGS_SBI_SERVICE_NAME_NSMF_PDUSESSION); ogs_assert(service); ogs_sbi_nf_service_add_version(service, (char*)OGS_SBI_API_VERSION, (char*)OGS_SBI_API_FULL_VERSION, NULL); - amf_sbi_nf_associate_client(nf_instance, client); amf_nf_fsm_init(nf_instance); + amf_sbi_setup_client_callback(nf_instance); } return OGS_OK; @@ -100,100 +98,120 @@ void amf_sbi_close(void) ogs_sbi_server_stop_all(); } -void amf_sbi_nf_associate_client( - ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_client_t *client) +void amf_sbi_setup_client_callback(ogs_sbi_nf_instance_t *nf_instance) { + ogs_sbi_client_t *client = NULL; + ogs_sbi_nf_service_t *nf_service = NULL; ogs_assert(nf_instance); + + client = nf_instance->client; ogs_assert(client); - OGS_SETUP_SBI_CLIENT(nf_instance, client); client->cb = client_cb; + + ogs_list_for_each(&nf_instance->nf_service_list, nf_service) { + client = nf_service->client; + if (client) + client->cb = client_cb; + } } -void amf_sbi_send_nf_register(ogs_sbi_nf_instance_t *nf_instance) +static ogs_sbi_nf_instance_t *find_or_discover_nf_instance( + amf_ue_t *amf_ue, OpenAPI_nf_type_e nf_type) +{ + bool nrf = true; + bool nf = true; + + if (!OGS_SBI_NF_INSTANCE_GET(amf_ue->nf_types, OpenAPI_nf_type_NRF)) + nrf = ogs_sbi_nf_types_associate( + amf_ue->nf_types, OpenAPI_nf_type_NRF, amf_nf_state_registered); + if (!OGS_SBI_NF_INSTANCE_GET(amf_ue->nf_types, nf_type)) + nf = ogs_sbi_nf_types_associate( + amf_ue->nf_types, nf_type, amf_nf_state_registered); + + if (nrf == false && nf == false) { + ogs_error("[%s] Cannot discover AUSF", amf_ue->suci); + nas_5gs_send_nas_reject( + amf_ue, OGS_5GMM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED); + return NULL; + } + + if (nf == false) { + ogs_warn("[%s] Try to discover AUSF", amf_ue->suci); + ogs_timer_start(amf_ue->sbi_client_wait.timer, + amf_timer_cfg(AMF_TIMER_SBI_CLIENT_WAIT)->duration); + + ogs_nnrf_disc_send_nf_discover( + amf_ue->nf_types[OpenAPI_nf_type_NRF].nf_instance, + nf_type, OpenAPI_nf_type_AMF, amf_ue); + + return NULL; + } + + return amf_ue->nf_types[nf_type].nf_instance; +} + +int amf_nausf_auth_send_authenticate( + amf_ue_t *amf_ue, ogs_sbi_nf_instance_t *nf_instance) { ogs_sbi_request_t *request = NULL; ogs_sbi_client_t *client = NULL; + ogs_sockaddr_t *addr = NULL; + char buf[OGS_ADDRSTRLEN]; + ogs_assert(amf_ue); ogs_assert(nf_instance); - client = nf_instance->client; - ogs_assert(client); - request = amf_nnrf_build_nf_register(nf_instance); - ogs_assert(request); - ogs_sbi_client_send_request(client, request, nf_instance); + if (amf_ue->confirmation_url_for_5g_aka) { + addr = ogs_sbi_getaddr_from_uri(amf_ue->confirmation_url_for_5g_aka); + if (!addr) { + ogs_error("[%s] Invalid confirmation URL [%s]", amf_ue->suci, + amf_ue->confirmation_url_for_5g_aka); + return OGS_ERROR; + } + client = ogs_sbi_client_find(addr); + if (!client) { + ogs_error("[%s] Cannot find client [%s:%d]", amf_ue->suci, + OGS_ADDR(addr, buf), OGS_PORT(addr)); + ogs_freeaddrinfo(addr); + return OGS_ERROR; + } + ogs_freeaddrinfo(addr); + + request = amf_nausf_auth_build_authenticate_confirmation(amf_ue); + ogs_assert(request); + } else { + client = ogs_sbi_client_find_by_service_name( + nf_instance, (char *)OGS_SBI_SERVICE_NAME_NAUSF_AUTH); + if (!client) { + ogs_error("[%s] Cannot find client [%s:%s]", amf_ue->suci, + nf_instance->id, OGS_SBI_SERVICE_NAME_NAUSF_AUTH); + return OGS_ERROR; + } + + request = amf_nausf_auth_build_authenticate(amf_ue); + ogs_assert(request); + } + + ogs_timer_start(amf_ue->sbi_client_wait.timer, + amf_timer_cfg(AMF_TIMER_SBI_CLIENT_WAIT)->duration); + + ogs_sbi_client_send_request(client, request, amf_ue); + + return OGS_OK; } -void amf_sbi_send_nf_update(ogs_sbi_nf_instance_t *nf_instance) +int amf_nausf_auth_discover_and_send_authenticate(amf_ue_t *amf_ue) { - ogs_sbi_request_t *request = NULL; - ogs_sbi_client_t *client = NULL; + ogs_sbi_nf_instance_t *nf_instance = NULL; - ogs_assert(nf_instance); - client = nf_instance->client; - ogs_assert(client); + ogs_assert(amf_ue); - request = amf_nnrf_build_nf_update(nf_instance); - ogs_assert(request); - ogs_sbi_client_send_request(client, request, nf_instance); -} - -void amf_sbi_send_nf_de_register(ogs_sbi_nf_instance_t *nf_instance) -{ - ogs_sbi_request_t *request = NULL; - ogs_sbi_client_t *client = NULL; - - ogs_assert(nf_instance); - client = nf_instance->client; - ogs_assert(client); - - request = amf_nnrf_build_nf_de_register(nf_instance); - ogs_assert(request); - ogs_sbi_client_send_request(client, request, nf_instance); -} - -void amf_sbi_send_nf_status_subscribe(ogs_sbi_client_t *client, - OpenAPI_nf_type_e nf_type, char *nf_instance_id) -{ - ogs_sbi_request_t *request = NULL; - ogs_sbi_subscription_t *subscription = NULL; - - ogs_assert(client); - - subscription = ogs_sbi_subscription_add(); - ogs_assert(subscription); - subscription->client = client; - subscription->nf_type = nf_type; - if (nf_instance_id) - subscription->nf_instance_id = ogs_strdup(nf_instance_id); - - request = amf_nnrf_build_nf_status_subscribe(subscription); - ogs_assert(request); - ogs_sbi_client_send_request(client, request, subscription); -} - -void amf_sbi_send_nf_status_unsubscribe(ogs_sbi_subscription_t *subscription) -{ - ogs_sbi_request_t *request = NULL; - ogs_sbi_client_t *client = NULL; - - ogs_assert(subscription); - client = subscription->client; - ogs_assert(client); - - request = amf_nnrf_build_nf_status_unsubscribe(subscription); - ogs_assert(request); - ogs_sbi_client_send_request(client, request, subscription); -} - -void amf_sbi_send_nf_discover(ogs_sbi_client_t *client, - OpenAPI_nf_type_e target_nf_type, OpenAPI_nf_type_e requester_nf_type) -{ - ogs_sbi_request_t *request = NULL; - - ogs_assert(client); - - request = amf_nnrf_build_nf_discover(target_nf_type, requester_nf_type); - ogs_assert(request); - ogs_sbi_client_send_request(client, request, NULL); + if (!nf_instance) + nf_instance = find_or_discover_nf_instance( + amf_ue, OpenAPI_nf_type_AUSF); + + if (!nf_instance) return OGS_RETRY; + + return amf_nausf_auth_send_authenticate(amf_ue, nf_instance); } diff --git a/src/amf/sbi-path.h b/src/amf/sbi-path.h index c3ab0887f9..f1a4ffae25 100644 --- a/src/amf/sbi-path.h +++ b/src/amf/sbi-path.h @@ -20,7 +20,7 @@ #ifndef AMF_SBI_PATH_H #define AMF_SBI_PATH_H -#include "nnrf-build.h" +#include "nausf-build.h" #ifdef __cplusplus extern "C" { @@ -29,20 +29,11 @@ extern "C" { int amf_sbi_open(void); void amf_sbi_close(void); -void amf_sbi_nf_associate_client( - ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_client_t *client); - -void amf_sbi_send_nf_register(ogs_sbi_nf_instance_t *nf_instance); -void amf_sbi_send_nf_update(ogs_sbi_nf_instance_t *nf_instance); -void amf_sbi_send_nf_de_register(ogs_sbi_nf_instance_t *nf_instance); - -void amf_sbi_send_nf_status_subscribe(ogs_sbi_client_t *client, - OpenAPI_nf_type_e nf_type, char *nf_instance_id); -void amf_sbi_send_nf_status_unsubscribe(ogs_sbi_subscription_t *subscription); - -void amf_sbi_send_nf_discover(ogs_sbi_client_t *client, - OpenAPI_nf_type_e target_nf_type, OpenAPI_nf_type_e requester_nf_type); +void amf_sbi_setup_client_callback(ogs_sbi_nf_instance_t *nf_instance); +int amf_nausf_auth_send_authenticate( + amf_ue_t *amf_ue, ogs_sbi_nf_instance_t *nf_instance); +int amf_nausf_auth_discover_and_send_authenticate(amf_ue_t *amf_ue); #ifdef __cplusplus } diff --git a/src/amf/timer.c b/src/amf/timer.c index 327cccb988..39e3fd0132 100644 --- a/src/amf/timer.c +++ b/src/amf/timer.c @@ -22,8 +22,43 @@ static amf_timer_cfg_t g_amf_timer_cfg[MAX_NUM_OF_AMF_TIMER] = { [AMF_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL] = { .duration = ogs_time_from_sec(3) }, + [AMF_TIMER_SBI_CLIENT_WAIT] = + { .duration = ogs_time_from_sec(2) }, + + /* Paging procedure for EPS services initiated */ + [AMF_TIMER_T3513] = + { .max_count = 2, .duration = ogs_time_from_sec(2) }, + + /* DETACH REQUEST sent */ + [AMF_TIMER_T3522] = + { .max_count = 4, .duration = ogs_time_from_sec(3) }, + + /* ATTACH ACCEPT sent + * TRACKING AREA UPDATE ACCEPT sent with GUTI + * TRACKING AREA UPDATE ACCEPT sent with TMSI + * GUTI REALLOCATION COMMAND sent */ + [AMF_TIMER_T3550] = + { .max_count = 4, .duration = ogs_time_from_sec(6) }, + + /* AUTHENTICATION REQUEST sent + * SECURITY MODE COMMAND sent */ + [AMF_TIMER_T3560] = + { .max_count = 4, .duration = ogs_time_from_sec(6) }, + + /* IDENTITY REQUEST sent */ + [AMF_TIMER_T3570] = + { .max_count = 4, .duration = ogs_time_from_sec(3) }, + + /* 5GSM INFORMATION REQUEST sent */ + [AMF_TIMER_T3589] = + { .max_count = 2, .duration = ogs_time_from_sec(4) }, }; +static void gmm_timer_event_send( + amf_timer_e timer_id, amf_ue_t *amf_ue); +static void gsm_timer_event_send( + amf_timer_e timer_id, amf_bearer_t *bearer); + amf_timer_cfg_t *amf_timer_cfg(amf_timer_e id) { ogs_assert(id < MAX_NUM_OF_AMF_TIMER); @@ -43,6 +78,26 @@ const char *amf_timer_get_name(amf_timer_e id) return "AMF_TIMER_NF_INSTANCE_VALIDITY"; case AMF_TIMER_SUBSCRIPTION_VALIDITY: return "AMF_TIMER_SUBSCRIPTION_VALIDITY"; + case AMF_TIMER_SBI_CLIENT_WAIT: + return "AMF_TIMER_SBI_CLIENT_WAIT"; + case AMF_TIMER_NG_DELAYED_SEND: + return "AMF_TIMER_NG_DELAYED_SEND"; + case AMF_TIMER_T3513: + return "AMF_TIMER_T3513"; + case AMF_TIMER_T3522: + return "AMF_TIMER_T3522"; + case AMF_TIMER_T3550: + return "AMF_TIMER_T3550"; + case AMF_TIMER_T3560: + return "AMF_TIMER_T3560"; + case AMF_TIMER_T3570: + return "AMF_TIMER_T3570"; + case AMF_TIMER_T3589: + return "AMF_TIMER_T3589"; +#if 0 + case AMF_TIMER_SGS_CLI_CONN_TO_SRV: + return "AMF_TIMER_SGS_CLI_CONN_TO_SRV"; +#endif default: break; } @@ -50,7 +105,23 @@ const char *amf_timer_get_name(amf_timer_e id) return "UNKNOWN_TIMER"; } -static void timer_send_event(int timer_id, void *data) +void amf_timer_ng_delayed_send(void *data) +{ + int rv; + amf_event_t *e = data; + ogs_assert(e); + + e->timer_id = AMF_TIMER_NG_DELAYED_SEND; + + rv = ogs_queue_push(amf_self()->queue, e); + if (rv != OGS_OK) { + ogs_warn("ogs_queue_push() failed:%d", (int)rv); + ogs_timer_delete(e->timer); + amf_event_free(e); + } +} + +static void sbi_timer_send_event(int timer_id, void *data) { int rv; amf_event_t *e = NULL; @@ -67,6 +138,12 @@ static void timer_send_event(int timer_id, void *data) e->timer_id = timer_id; e->sbi.data = data; break; + case AMF_TIMER_SBI_CLIENT_WAIT: + e = amf_event_new(AMF_EVT_SBI_TIMER); + ogs_assert(e); + e->timer_id = timer_id; + e->sbi.data = data; + break; default: ogs_fatal("Unknown timer id[%d]", timer_id); ogs_assert_if_reached(); @@ -83,25 +160,96 @@ static void timer_send_event(int timer_id, void *data) void amf_timer_nf_instance_registration_interval(void *data) { - timer_send_event(AMF_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL, data); + sbi_timer_send_event(AMF_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL, data); } void amf_timer_nf_instance_heartbeat_interval(void *data) { - timer_send_event(AMF_TIMER_NF_INSTANCE_HEARTBEAT_INTERVAL, data); + sbi_timer_send_event(AMF_TIMER_NF_INSTANCE_HEARTBEAT_INTERVAL, data); } void amf_timer_nf_instance_heartbeat(void *data) { - timer_send_event(AMF_TIMER_NF_INSTANCE_HEARTBEAT, data); + sbi_timer_send_event(AMF_TIMER_NF_INSTANCE_HEARTBEAT, data); } void amf_timer_nf_instance_validity(void *data) { - timer_send_event(AMF_TIMER_NF_INSTANCE_VALIDITY, data); + sbi_timer_send_event(AMF_TIMER_NF_INSTANCE_VALIDITY, data); } void amf_timer_subscription_validity(void *data) { - timer_send_event(AMF_TIMER_SUBSCRIPTION_VALIDITY, data); + sbi_timer_send_event(AMF_TIMER_SUBSCRIPTION_VALIDITY, data); +} + +void amf_timer_sbi_client_wait_expire(void *data) +{ + sbi_timer_send_event(AMF_TIMER_SBI_CLIENT_WAIT, data); +} + +static void gmm_timer_event_send( + amf_timer_e timer_id, amf_ue_t *amf_ue) +{ + int rv; + amf_event_t *e = NULL; + ogs_assert(amf_ue); + + e = amf_event_new(AMF_EVT_5GMM_TIMER); + e->timer_id = timer_id; + e->amf_ue = amf_ue; + + rv = ogs_queue_push(amf_self()->queue, e); + if (rv != OGS_OK) { + ogs_warn("ogs_queue_push() failed:%d", (int)rv); + amf_event_free(e); + } +} + +void amf_timer_t3513_expire(void *data) +{ + gmm_timer_event_send(AMF_TIMER_T3513, data); +} +void amf_timer_t3522_expire(void *data) +{ + gmm_timer_event_send(AMF_TIMER_T3522, data); +} +void amf_timer_t3550_expire(void *data) +{ + gmm_timer_event_send(AMF_TIMER_T3550, data); +} +void amf_timer_t3560_expire(void *data) +{ + gmm_timer_event_send(AMF_TIMER_T3560, data); +} +void amf_timer_t3570_expire(void *data) +{ + gmm_timer_event_send(AMF_TIMER_T3570, data); +} + +static void gsm_timer_event_send( + amf_timer_e timer_id, amf_bearer_t *bearer) +{ + int rv; + amf_event_t *e = NULL; + amf_ue_t *amf_ue = NULL; + ogs_assert(bearer); + amf_ue = bearer->amf_ue; + ogs_assert(bearer); + + e = amf_event_new(AMF_EVT_5GSM_TIMER); + e->timer_id = timer_id; + e->amf_ue = amf_ue; + e->bearer = bearer; + + rv = ogs_queue_push(amf_self()->queue, e); + if (rv != OGS_OK) { + ogs_warn("ogs_queue_push() failed:%d", (int)rv); + amf_event_free(e); + } +} + +void amf_timer_t3589_expire(void *data) +{ + gsm_timer_event_send(AMF_TIMER_T3589, data); } diff --git a/src/amf/timer.h b/src/amf/timer.h index 509e78fc71..f4df7b88d9 100644 --- a/src/amf/timer.h +++ b/src/amf/timer.h @@ -35,6 +35,16 @@ typedef enum { AMF_TIMER_NF_INSTANCE_HEARTBEAT, AMF_TIMER_NF_INSTANCE_VALIDITY, AMF_TIMER_SUBSCRIPTION_VALIDITY, + AMF_TIMER_SBI_CLIENT_WAIT, + + AMF_TIMER_NG_DELAYED_SEND, + + AMF_TIMER_T3513, + AMF_TIMER_T3522, + AMF_TIMER_T3550, + AMF_TIMER_T3560, + AMF_TIMER_T3570, + AMF_TIMER_T3589, MAX_NUM_OF_AMF_TIMER, @@ -54,6 +64,16 @@ void amf_timer_nf_instance_heartbeat_interval(void *data); void amf_timer_nf_instance_heartbeat(void *data); void amf_timer_nf_instance_validity(void *data); void amf_timer_subscription_validity(void *data); +void amf_timer_sbi_client_wait_expire(void *data); + +void amf_timer_ng_delayed_send(void *data); + +void amf_timer_t3513_expire(void *data); +void amf_timer_t3522_expire(void *data); +void amf_timer_t3550_expire(void *data); +void amf_timer_t3560_expire(void *data); +void amf_timer_t3570_expire(void *data); +void amf_timer_t3589_expire(void *data); #ifdef __cplusplus } diff --git a/src/ausf/app.c b/src/ausf/app.c new file mode 100644 index 0000000000..e9d573a1a2 --- /dev/null +++ b/src/ausf/app.c @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "ogs-app.h" + +int app_initialize(const char *const argv[]) +{ + int rv; + + rv = ausf_initialize(); + if (rv != OGS_OK) { + ogs_error("Failed to intialize AUSF"); + return rv; + } + ogs_info("AUSF initialize...done"); + + return OGS_OK; +} + +void app_terminate(void) +{ + ausf_terminate(); + ogs_info("AUSF terminate...done"); +} diff --git a/src/ausf/ausf-sm.c b/src/ausf/ausf-sm.c new file mode 100644 index 0000000000..6350ff6f4f --- /dev/null +++ b/src/ausf/ausf-sm.c @@ -0,0 +1,362 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "sbi-path.h" +#include "nnrf-handler.h" + +void ausf_state_initial(ogs_fsm_t *s, ausf_event_t *e) +{ + ausf_sm_debug(e); + + ogs_assert(s); + + OGS_FSM_TRAN(s, &ausf_state_operational); +} + +void ausf_state_final(ogs_fsm_t *s, ausf_event_t *e) +{ + ausf_sm_debug(e); +} + +void ausf_state_operational(ogs_fsm_t *s, ausf_event_t *e) +{ + int rv; + + ogs_sbi_session_t *session = NULL; + ogs_sbi_request_t *request = NULL; + + ogs_sbi_nf_instance_t *nf_instance = NULL; + ogs_sbi_subscription_t *subscription = NULL; + ogs_sbi_response_t *response = NULL; + ogs_sbi_message_t message; + + ausf_ue_t *ausf_ue = NULL; + + ausf_sm_debug(e); + + ogs_assert(s); + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + rv = ausf_sbi_open(); + if (rv != OGS_OK) { + ogs_fatal("Can't establish SBI path"); + } + + break; + + case OGS_FSM_EXIT_SIG: + ausf_sbi_close(); + break; + + case AUSF_EVT_SBI_SERVER: + request = e->sbi.request; + ogs_assert(request); + session = e->sbi.session; + ogs_assert(session); + + rv = ogs_sbi_parse_request(&message, request); + if (rv != OGS_OK) { + /* 'message' buffer is released in ogs_sbi_parse_request() */ + ogs_error("cannot parse HTTP message"); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + NULL, "cannot parse HTTP message", NULL); + break; + } + + if (strcmp(message.h.api.version, OGS_SBI_API_VERSION) != 0) { + ogs_error("Not supported version [%s]", message.h.api.version); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + &message, "Not supported version", NULL); + ogs_sbi_message_free(&message); + break; + } + + SWITCH(message.h.service.name) + CASE(OGS_SBI_SERVICE_NAME_NNRF_NFM) + + SWITCH(message.h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY) + SWITCH(message.h.method) + CASE(OGS_SBI_HTTP_METHOD_POST) + ausf_nnrf_handle_nf_status_notify(session, &message); + break; + + DEFAULT + ogs_error("Invalid HTTP method [%s]", + message.h.method); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, + &message, + "Invalid HTTP method", message.h.method); + END + break; + + DEFAULT + ogs_error("Invalid resource name [%s]", + message.h.resource.component[0]); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, &message, + "Unknown resource name", + message.h.resource.component[0]); + END + break; + + CASE(OGS_SBI_SERVICE_NAME_NAUSF_AUTH) + SWITCH(message.h.method) + CASE(OGS_SBI_HTTP_METHOD_POST) + if (message.AuthenticationInfo && + message.AuthenticationInfo->supi_or_suci) { + ausf_ue = ausf_ue_find_by_suci( + message.AuthenticationInfo->supi_or_suci); + if (!ausf_ue) { + ausf_ue = ausf_ue_add( + message.AuthenticationInfo->supi_or_suci); + ogs_assert(ausf_ue); + } + } + break; + CASE(OGS_SBI_HTTP_METHOD_PUT) + if (message.h.resource.component[1]) { + ausf_ue = ausf_ue_find_by_ctx_id( + message.h.resource.component[1]); + } + break; + DEFAULT + END + + if (!ausf_ue) { + ogs_error("Not found [%s]", message.h.method); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_NOT_FOUND, + &message, "Not found", message.h.method); + break; + } + + ogs_assert(OGS_FSM_STATE(&ausf_ue->sm)); + + OGS_SETUP_SBI_SESSION(ausf_ue, session); + + if (ausf_ue->state.method) + ogs_free(ausf_ue->state.method); + ausf_ue->state.method = ogs_strdup(message.h.method); + + e->ausf_ue = ausf_ue; + e->sbi.message = &message; + ogs_fsm_dispatch(&ausf_ue->sm, e); + if (OGS_FSM_CHECK(&ausf_ue->sm, ausf_ue_state_exception)) { + ogs_error("[%s] State machine exception", ausf_ue->suci); + ausf_ue_remove(ausf_ue); + } + break; + + DEFAULT + ogs_error("Invalid API name [%s]", message.h.service.name); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, &message, + "Invalid API name", message.h.resource.component[0]); + END + + /* In lib/sbi/server.c, notify_completed() releases 'request' buffer. */ + ogs_sbi_message_free(&message); + break; + + case AUSF_EVT_SBI_CLIENT: + ogs_assert(e); + + response = e->sbi.response; + ogs_assert(response); + rv = ogs_sbi_parse_response(&message, response); + if (rv != OGS_OK) { + ogs_error("cannot parse HTTP response"); + ogs_sbi_message_free(&message); + ogs_sbi_response_free(response); + break; + } + + if (strcmp(message.h.api.version, OGS_SBI_API_VERSION) != 0) { + ogs_error("Not supported version [%s]", message.h.api.version); + ogs_sbi_message_free(&message); + ogs_sbi_response_free(response); + break; + } + + SWITCH(message.h.service.name) + CASE(OGS_SBI_SERVICE_NAME_NNRF_NFM) + + SWITCH(message.h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES) + nf_instance = e->sbi.data; + ogs_assert(nf_instance); + ogs_assert(OGS_FSM_STATE(&nf_instance->sm)); + + e->sbi.message = &message; + ogs_fsm_dispatch(&nf_instance->sm, e); + + if (OGS_FSM_CHECK(&nf_instance->sm, ausf_nf_state_exception)) { + ogs_error("[%s] State machine exception", nf_instance->id); + } + break; + + CASE(OGS_SBI_RESOURCE_NAME_SUBSCRIPTIONS) + subscription = e->sbi.data; + ogs_assert(subscription); + + SWITCH(message.h.method) + CASE(OGS_SBI_HTTP_METHOD_POST) + if (message.res_status == OGS_SBI_HTTP_STATUS_CREATED || + message.res_status == OGS_SBI_HTTP_STATUS_OK) { + ausf_nnrf_handle_nf_status_subscribe( + subscription, &message); + } else { + ogs_error("[%s] HTTP response error [%d]", + subscription->id, message.res_status); + } + break; + + CASE(OGS_SBI_HTTP_METHOD_DELETE) + if (message.res_status == + OGS_SBI_HTTP_STATUS_NO_CONTENT) { + ogs_sbi_subscription_remove(subscription); + } else { + ogs_error("[%s] HTTP response error [%d]", + subscription->id, message.res_status); + } + break; + + DEFAULT + ogs_error("[%s] Invalid HTTP method [%s]", + subscription->id, message.h.method); + ogs_assert_if_reached(); + END + break; + + DEFAULT + ogs_error("Invalid resource name [%s]", + message.h.resource.component[0]); + ogs_assert_if_reached(); + END + break; + + CASE(OGS_SBI_SERVICE_NAME_NNRF_DISC) + SWITCH(message.h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES) + ausf_ue = e->sbi.data; + ogs_assert(ausf_ue); + + SWITCH(message.h.method) + CASE(OGS_SBI_HTTP_METHOD_GET) + if (message.res_status == OGS_SBI_HTTP_STATUS_OK) { + ogs_timer_stop(ausf_ue->sbi_client_wait.timer); + + ausf_nnrf_handle_nf_discover(ausf_ue, &message); + } else { + ogs_error("[%s] HTTP response error [%d]", + ausf_ue->suci, message.res_status); + } + break; + + DEFAULT + ogs_error("[%s] Invalid HTTP method [%s]", + ausf_ue->suci, message.h.method); + ogs_assert_if_reached(); + END + break; + + DEFAULT + ogs_error("Invalid resource name [%s]", + message.h.resource.component[0]); + ogs_assert_if_reached(); + END + break; + + CASE(OGS_SBI_SERVICE_NAME_NUDM_UEAU) + ausf_ue = e->sbi.data; + ogs_assert(ausf_ue); + ogs_assert(OGS_FSM_STATE(&ausf_ue->sm)); + + e->ausf_ue = ausf_ue; + e->sbi.message = &message; + ogs_fsm_dispatch(&ausf_ue->sm, e); + if (OGS_FSM_CHECK(&ausf_ue->sm, ausf_ue_state_exception)) { + ogs_error("[%s] State machine exception", ausf_ue->suci); + ausf_ue_remove(ausf_ue); + } + break; + + DEFAULT + ogs_error("Invalid API name [%s]", message.h.service.name); + ogs_assert_if_reached(); + END + + ogs_sbi_message_free(&message); + ogs_sbi_response_free(response); + break; + + case AUSF_EVT_SBI_TIMER: + ogs_assert(e); + + switch(e->timer_id) { + case AUSF_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL: + case AUSF_TIMER_NF_INSTANCE_HEARTBEAT_INTERVAL: + case AUSF_TIMER_NF_INSTANCE_HEARTBEAT: + case AUSF_TIMER_NF_INSTANCE_VALIDITY: + nf_instance = e->sbi.data; + ogs_assert(nf_instance); + ogs_assert(OGS_FSM_STATE(&nf_instance->sm)); + + ogs_fsm_dispatch(&nf_instance->sm, e); + if (OGS_FSM_CHECK(&nf_instance->sm, ausf_nf_state_exception)) + ogs_error("[%s] State machine exception [%d]", + nf_instance->id, e->timer_id); + break; + + case AUSF_TIMER_SUBSCRIPTION_VALIDITY: + subscription = e->sbi.data; + ogs_assert(subscription); + + ogs_info("[%s] Subscription validity expired", subscription->id); + ogs_sbi_subscription_remove(subscription); + + ogs_nnrf_nfm_send_nf_status_subscribe(subscription->client, + ausf_self()->nf_type, subscription->nf_instance_id); + break; + + case AUSF_TIMER_SBI_CLIENT_WAIT: + ausf_ue = e->sbi.data; + ogs_assert(ausf_ue); + session = ausf_ue->session; + ogs_assert(session); + + ogs_error("[%s] Cannot receive SBI message", ausf_ue->suci); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT, NULL, + "Cannot receive SBI message", ausf_ue->suci); + break; + default: + ogs_error("Unknown timer[%s:%d]", + ausf_timer_get_name(e->timer_id), e->timer_id); + } + break; + + default: + ogs_error("No handler for event %s", ausf_event_get_name(e)); + break; + } +} diff --git a/src/ausf/ausf-sm.h b/src/ausf/ausf-sm.h new file mode 100644 index 0000000000..c43eefd270 --- /dev/null +++ b/src/ausf/ausf-sm.h @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef AUSF_SM_H +#define AUSF_SM_H + +#include "event.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void ausf_state_initial(ogs_fsm_t *s, ausf_event_t *e); +void ausf_state_final(ogs_fsm_t *s, ausf_event_t *e); +void ausf_state_operational(ogs_fsm_t *s, ausf_event_t *e); + +void ausf_nf_fsm_init(ogs_sbi_nf_instance_t *nf_instance); +void ausf_nf_fsm_fini(ogs_sbi_nf_instance_t *nf_instance); + +void ausf_nf_state_initial(ogs_fsm_t *s, ausf_event_t *e); +void ausf_nf_state_final(ogs_fsm_t *s, ausf_event_t *e); +void ausf_nf_state_will_register(ogs_fsm_t *s, ausf_event_t *e); +void ausf_nf_state_registered(ogs_fsm_t *s, ausf_event_t *e); +void ausf_nf_state_de_registered(ogs_fsm_t *s, ausf_event_t *e); +void ausf_nf_state_exception(ogs_fsm_t *s, ausf_event_t *e); + +void ausf_ue_state_initial(ogs_fsm_t *s, ausf_event_t *e); +void ausf_ue_state_final(ogs_fsm_t *s, ausf_event_t *e); +void ausf_ue_state_operational(ogs_fsm_t *s, ausf_event_t *e); +void ausf_ue_state_exception(ogs_fsm_t *s, ausf_event_t *e); + +#define ausf_sm_debug(__pe) \ + ogs_debug("%s(): %s", __func__, ausf_event_get_name(__pe)) + +#ifdef __cplusplus +} +#endif + +#endif /* AUSF_SM_H */ diff --git a/src/ausf/context.c b/src/ausf/context.c new file mode 100644 index 0000000000..54d29a641b --- /dev/null +++ b/src/ausf/context.c @@ -0,0 +1,229 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "sbi-path.h" + +static ausf_context_t self; + +int __ausf_log_domain; + +static OGS_POOL(ausf_ue_pool, ausf_ue_t); + +static int context_initialized = 0; + +void ausf_context_init(void) +{ + ogs_assert(context_initialized == 0); + + /* Initialize AUSF context */ + memset(&self, 0, sizeof(ausf_context_t)); + + ogs_log_install_domain(&__ausf_log_domain, "ausf", ogs_core()->log.level); + + /* Allocate TWICE the pool to check if maximum number of gNBs is reached */ + ogs_pool_init(&ausf_ue_pool, ogs_config()->pool.ue); + + ogs_list_init(&self.ausf_ue_list); + self.suci_hash = ogs_hash_make(); + self.supi_hash = ogs_hash_make(); + + context_initialized = 1; +} + +void ausf_context_final(void) +{ + ogs_assert(context_initialized == 1); + + ausf_ue_remove_all(); + + ogs_assert(self.suci_hash); + ogs_hash_destroy(self.suci_hash); + ogs_assert(self.supi_hash); + ogs_hash_destroy(self.supi_hash); + + ogs_pool_final(&ausf_ue_pool); + + context_initialized = 0; +} + +ausf_context_t *ausf_self(void) +{ + return &self; +} + +static int ausf_context_prepare(void) +{ + self.nf_type = OpenAPI_nf_type_AUSF; + + return OGS_OK; +} + +static int ausf_context_validation(void) +{ + return OGS_OK; +} + +int ausf_context_parse_config(void) +{ + int rv; + yaml_document_t *document = NULL; + ogs_yaml_iter_t root_iter; + + document = ogs_config()->document; + ogs_assert(document); + + rv = ausf_context_prepare(); + if (rv != OGS_OK) return rv; + + ogs_yaml_iter_init(&root_iter, document); + while (ogs_yaml_iter_next(&root_iter)) { + const char *root_key = ogs_yaml_iter_key(&root_iter); + ogs_assert(root_key); + if (!strcmp(root_key, "ausf")) { + ogs_yaml_iter_t ausf_iter; + ogs_yaml_iter_recurse(&root_iter, &ausf_iter); + while (ogs_yaml_iter_next(&ausf_iter)) { + const char *ausf_key = ogs_yaml_iter_key(&ausf_iter); + ogs_assert(ausf_key); + if (!strcmp(ausf_key, "sbi")) { + /* handle config in sbi library */ + } else + ogs_warn("unknown key `%s`", ausf_key); + } + } + } + + rv = ausf_context_validation(); + if (rv != OGS_OK) return rv; + + return OGS_OK; +} + +ausf_ue_t *ausf_ue_add(char *suci) +{ + ausf_event_t e; + ausf_ue_t *ausf_ue = NULL; + + ogs_assert(suci); + + ogs_pool_alloc(&ausf_ue_pool, &ausf_ue); + ogs_assert(ausf_ue); + memset(ausf_ue, 0, sizeof *ausf_ue); + + ausf_ue->ctx_id = + ogs_msprintf("%ld", ogs_pool_index(&ausf_ue_pool, ausf_ue)); + ogs_assert(ausf_ue->ctx_id); + + ausf_ue->suci = ogs_strdup(suci); + ogs_assert(ausf_ue->suci); + ogs_hash_set(self.suci_hash, ausf_ue->suci, strlen(ausf_ue->suci), ausf_ue); + + ausf_ue->supi = ogs_supi_from_suci(ausf_ue->suci); + ogs_assert(ausf_ue->supi); + ogs_hash_set(self.supi_hash, ausf_ue->supi, strlen(ausf_ue->supi), ausf_ue); + + ausf_ue->sbi_client_wait.timer = ogs_timer_add( + self.timer_mgr, ausf_timer_sbi_client_wait_expire, ausf_ue); + + e.ausf_ue = ausf_ue; + ogs_fsm_create(&ausf_ue->sm, ausf_ue_state_initial, ausf_ue_state_final); + ogs_fsm_init(&ausf_ue->sm, &e); + + ogs_list_add(&self.ausf_ue_list, ausf_ue); + + return ausf_ue; +} + +void ausf_ue_remove(ausf_ue_t *ausf_ue) +{ + ausf_event_t e; + int i; + + ogs_assert(ausf_ue); + + ogs_list_remove(&self.ausf_ue_list, ausf_ue); + + e.ausf_ue = ausf_ue; + ogs_fsm_fini(&ausf_ue->sm, &e); + ogs_fsm_delete(&ausf_ue->sm); + + ogs_timer_delete(ausf_ue->sbi_client_wait.timer); + + ogs_assert(ausf_ue->ctx_id); + ogs_free(ausf_ue->ctx_id); + + ogs_assert(ausf_ue->suci); + ogs_hash_set(self.suci_hash, ausf_ue->suci, strlen(ausf_ue->suci), NULL); + ogs_free(ausf_ue->suci); + + ogs_assert(ausf_ue->supi); + ogs_hash_set(self.supi_hash, ausf_ue->supi, strlen(ausf_ue->supi), NULL); + ogs_free(ausf_ue->supi); + + if (ausf_ue->state.method) + ogs_free(ausf_ue->state.method); + + if (ausf_ue->auth_events_url) + ogs_free(ausf_ue->auth_events_url); + + if (ausf_ue->serving_network_name) + ogs_free(ausf_ue->serving_network_name); + + for (i = 0; i < OGS_SBI_MAX_NF_TYPE; i++) { + if (ausf_ue->nf_types[i].nf_instance) + ogs_sbi_nf_instance_remove(ausf_ue->nf_types[i].nf_instance); + } + + ogs_pool_free(&ausf_ue_pool, ausf_ue); +} + +void ausf_ue_remove_all() +{ + ausf_ue_t *ausf_ue = NULL, *next = NULL;; + + ogs_list_for_each_safe(&self.ausf_ue_list, next, ausf_ue) + ausf_ue_remove(ausf_ue); +} + +ausf_ue_t *ausf_ue_find_by_suci(char *suci) +{ + ogs_assert(suci); + return (ausf_ue_t *)ogs_hash_get(self.suci_hash, suci, strlen(suci)); +} + +ausf_ue_t *ausf_ue_find_by_supi(char *supi) +{ + ogs_assert(supi); + return (ausf_ue_t *)ogs_hash_get(self.supi_hash, supi, strlen(supi)); +} + +ausf_ue_t *ausf_ue_find_by_suci_or_supi(char *suci_or_supi) +{ + ogs_assert(suci_or_supi); + if (strncmp(suci_or_supi, "suci-", strlen("suci-")) == 0) + return ausf_ue_find_by_suci(suci_or_supi); + else + return ausf_ue_find_by_supi(suci_or_supi); +} + +ausf_ue_t *ausf_ue_find_by_ctx_id(char *ctx_id) +{ + ogs_assert(ctx_id); + return ogs_pool_find(&ausf_ue_pool, atoll(ctx_id)); +} diff --git a/src/ausf/context.h b/src/ausf/context.h new file mode 100644 index 0000000000..3f77c12de3 --- /dev/null +++ b/src/ausf/context.h @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef AUSF_CONTEXT_H +#define AUSF_CONTEXT_H + +#include "ogs-app.h" +#include "ogs-crypt.h" +#include "ogs-sbi.h" + +#include "ausf-sm.h" +#include "timer.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define MAX_NUM_OF_SERVED_GUAMI 8 + +extern int __ausf_log_domain; + +#undef OGS_LOG_DOMAIN +#define OGS_LOG_DOMAIN __ausf_log_domain + +typedef struct ausf_context_s { + ogs_queue_t *queue; /* Queue for processing UPF control */ + ogs_timer_mgr_t *timer_mgr; /* Timer Manager */ + ogs_pollset_t *pollset; /* Poll Set for I/O Multiplexing */ + + OpenAPI_nf_type_e nf_type; + + ogs_list_t ausf_ue_list; + ogs_hash_t *suci_hash; + ogs_hash_t *supi_hash; + +} ausf_context_t; + +struct ausf_ue_s { + ogs_lnode_t lnode; + ogs_fsm_t sm; /* A state machine */ + + struct { + char *method; + } state; + + char *ctx_id; + char *suci; + char *supi; + char *serving_network_name; + + OpenAPI_auth_type_e auth_type; + char *auth_events_url; + OpenAPI_auth_result_e auth_result; + + uint8_t rand[OGS_RAND_LEN]; + uint8_t xres_star[OGS_MAX_RES_LEN]; + uint8_t hxres_star[OGS_MAX_RES_LEN]; + uint8_t kausf[OGS_SHA256_DIGEST_SIZE]; + uint8_t kseaf[OGS_SHA256_DIGEST_SIZE]; + + struct { + ogs_timer_t *timer; + } sbi_client_wait; + +#define AUSF_NF_INSTANCE_CLEAR(_cAUSE, _nFInstance) \ + do { \ + ogs_assert(_nFInstance); \ + if ((_nFInstance)->reference_count == 1) { \ + ogs_info("[%s] (%s) NF removed", (_nFInstance)->id, (_cAUSE)); \ + ausf_nf_fsm_fini((_nFInstance)); \ + } else { \ + /* There is an assocation with other context */ \ + ogs_info("[%s:%d] (%s) NF suspended", \ + _nFInstance->id, _nFInstance->reference_count, (_cAUSE)); \ + OGS_FSM_TRAN(&_nFInstance->sm, ausf_nf_state_de_registered); \ + ogs_fsm_dispatch(&_nFInstance->sm, NULL); \ + } \ + ogs_sbi_nf_instance_remove(_nFInstance); \ + } while(0) + + ogs_sbi_nf_types_t nf_types; + + ogs_sbi_session_t *session; +}; + +void ausf_context_init(void); +void ausf_context_final(void); +ausf_context_t *ausf_self(void); + +int ausf_context_parse_config(void); + +ausf_ue_t *ausf_ue_add(char *suci); +void ausf_ue_remove(ausf_ue_t *ausf_ue); +void ausf_ue_remove_all(void); +ausf_ue_t *ausf_ue_find_by_suci(char *suci); +ausf_ue_t *ausf_ue_find_by_supi(char *supi); +ausf_ue_t *ausf_ue_find_by_suci_or_supi(char *suci_or_supi); +ausf_ue_t *ausf_ue_find_by_ctx_id(char *ctx_id); + +#ifdef __cplusplus +} +#endif + +#endif /* AUSF_CONTEXT_H */ diff --git a/src/ausf/event.c b/src/ausf/event.c new file mode 100644 index 0000000000..9185e068b1 --- /dev/null +++ b/src/ausf/event.c @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "event.h" +#include "context.h" + +#define EVENT_POOL 32 /* FIXME : 32 */ +static OGS_POOL(pool, ausf_event_t); + +void ausf_event_init(void) +{ + ogs_pool_init(&pool, EVENT_POOL); + + ausf_self()->queue = ogs_queue_create(EVENT_POOL); + ogs_assert(ausf_self()->queue); + ausf_self()->timer_mgr = ogs_timer_mgr_create(); + ogs_assert(ausf_self()->timer_mgr); + ausf_self()->pollset = ogs_pollset_create(); + ogs_assert(ausf_self()->pollset); +} + +void ausf_event_final(void) +{ + if (ausf_self()->pollset) + ogs_pollset_destroy(ausf_self()->pollset); + if (ausf_self()->timer_mgr) + ogs_timer_mgr_destroy(ausf_self()->timer_mgr); + if (ausf_self()->queue) + ogs_queue_destroy(ausf_self()->queue); + + ogs_pool_final(&pool); +} + +ausf_event_t *ausf_event_new(ausf_event_e id) +{ + ausf_event_t *e = NULL; + + ogs_pool_alloc(&pool, &e); + ogs_assert(e); + memset(e, 0, sizeof(*e)); + + e->id = id; + + return e; +} + +void ausf_event_free(ausf_event_t *e) +{ + ogs_assert(e); + ogs_pool_free(&pool, e); +} + +const char *ausf_event_get_name(ausf_event_t *e) +{ + if (e == NULL) + return OGS_FSM_NAME_INIT_SIG; + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + return OGS_FSM_NAME_ENTRY_SIG; + case OGS_FSM_EXIT_SIG: + return OGS_FSM_NAME_EXIT_SIG; + + case AUSF_EVT_SBI_SERVER: + return "AUSF_EVT_SBI_SERVER"; + case AUSF_EVT_SBI_CLIENT: + return "AUSF_EVT_SBI_CLIENT"; + case AUSF_EVT_SBI_TIMER: + return "AUSF_EVT_SBI_TIMER"; + + default: + break; + } + + return "UNKNOWN_EVENT"; +} diff --git a/src/ausf/event.h b/src/ausf/event.h new file mode 100644 index 0000000000..69326a0633 --- /dev/null +++ b/src/ausf/event.h @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef AUSF_EVENT_H +#define AUSF_EVENT_H + +#include "ogs-core.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct ogs_sbi_server_s ogs_sbi_server_t; +typedef struct ogs_sbi_session_s ogs_sbi_session_t; +typedef struct ogs_sbi_request_s ogs_sbi_request_t; +typedef struct ogs_sbi_response_s ogs_sbi_response_t; +typedef struct ogs_sbi_message_s ogs_sbi_message_t; +typedef struct ogs_sbi_nf_instance_s ogs_sbi_nf_instance_t; +typedef struct ogs_sbi_subscription_s ogs_sbi_subscription_t; + +typedef struct ausf_ue_s ausf_ue_t; + +typedef enum { + AUSF_EVT_BASE = OGS_FSM_USER_SIG, + + AUSF_EVT_SBI_SERVER, + AUSF_EVT_SBI_CLIENT, + AUSF_EVT_SBI_TIMER, + + AUSF_EVT_TOP, + +} ausf_event_e; + +typedef struct ausf_event_s { + int id; + int timer_id; + + struct { + /* OGS_EVT_SBI_SERVER */ + ogs_sbi_request_t *request; + ogs_sbi_session_t *session; + ogs_sbi_server_t *server; + + /* OGS_EVT_SBI_CLIENT */ + ogs_sbi_response_t *response; + void *data; + + ogs_sbi_message_t *message; + } sbi; + + ausf_ue_t *ausf_ue; + + ogs_timer_t *timer; +} ausf_event_t; + +void ausf_event_init(void); +void ausf_event_final(void); + +ausf_event_t *ausf_event_new(ausf_event_e id); +void ausf_event_free(ausf_event_t *e); + +const char *ausf_event_get_name(ausf_event_t *e); + +#ifdef __cplusplus +} +#endif + +#endif /* AUSF_EVENT_H */ diff --git a/src/ausf/init.c b/src/ausf/init.c new file mode 100644 index 0000000000..24f1f52be2 --- /dev/null +++ b/src/ausf/init.c @@ -0,0 +1,134 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "context.h" + +static ogs_thread_t *thread; +static void ausf_main(void *data); +static int initialized = 0; + +int ausf_initialize() +{ + int rv; + + ausf_context_init(); + ausf_event_init(); /* Create event with poll, timer */ + ogs_sbi_context_init(ausf_self()->pollset, ausf_self()->timer_mgr); + + rv = ogs_sbi_context_parse_config("ausf", "nrf"); + if (rv != OGS_OK) return rv; + + rv = ausf_context_parse_config(); + if (rv != OGS_OK) return rv; + + rv = ogs_log_config_domain( + ogs_config()->logger.domain, ogs_config()->logger.level); + if (rv != OGS_OK) return rv; + + thread = ogs_thread_create(ausf_main, NULL); + if (!thread) return OGS_ERROR; + + initialized = 1; + + return OGS_OK; +} + +static ogs_timer_t *t_termination_holding = NULL; + +static void event_termination(void) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + + /* Sending NF Instance De-registeration to NRF */ + ogs_list_for_each(&ogs_sbi_self()->nf_instance_list, nf_instance) + ausf_nf_fsm_fini(nf_instance); + + /* Starting holding timer */ + t_termination_holding = ogs_timer_add(ausf_self()->timer_mgr, NULL, NULL); + ogs_assert(t_termination_holding); +#define TERMINATION_HOLDING_TIME ogs_time_from_msec(300) + ogs_timer_start(t_termination_holding, TERMINATION_HOLDING_TIME); + + /* Sending termination event to the queue */ + ogs_queue_term(ausf_self()->queue); + ogs_pollset_notify(ausf_self()->pollset); +} + +void ausf_terminate(void) +{ + if (!initialized) return; + + /* Daemon terminating */ + event_termination(); + ogs_thread_destroy(thread); + ogs_timer_delete(t_termination_holding); + + ausf_context_final(); + ogs_sbi_context_final(); + + ausf_event_final(); /* Destroy event */ +} + +static void ausf_main(void *data) +{ + ogs_fsm_t ausf_sm; + int rv; + + ogs_fsm_create(&ausf_sm, ausf_state_initial, ausf_state_final); + ogs_fsm_init(&ausf_sm, 0); + + for ( ;; ) { + ogs_pollset_poll(ausf_self()->pollset, + ogs_timer_mgr_next(ausf_self()->timer_mgr)); + + /* + * After ogs_pollset_poll(), ogs_timer_mgr_expire() must be called. + * + * The reason is why ogs_timer_mgr_next() can get the corrent value + * when ogs_timer_stop() is called internally in ogs_timer_mgr_expire(). + * + * You should not use event-queue before ogs_timer_mgr_expire(). + * In this case, ogs_timer_mgr_expire() does not work + * because 'if rv == OGS_DONE' statement is exiting and + * not calling ogs_timer_mgr_expire(). + */ + ogs_timer_mgr_expire(ausf_self()->timer_mgr); + + for ( ;; ) { + ausf_event_t *e = NULL; + + rv = ogs_queue_trypop(ausf_self()->queue, (void**)&e); + ogs_assert(rv != OGS_ERROR); + + if (rv == OGS_DONE) + goto done; + + if (rv == OGS_RETRY) + break; + + ogs_assert(e); + ogs_fsm_dispatch(&ausf_sm, e); + ausf_event_free(e); + } + } +done: + + ogs_fsm_fini(&ausf_sm, 0); + ogs_fsm_delete(&ausf_sm); +} diff --git a/src/ausf/meson.build b/src/ausf/meson.build new file mode 100644 index 0000000000..97271e84bb --- /dev/null +++ b/src/ausf/meson.build @@ -0,0 +1,63 @@ +# Copyright (C) 2019,2020 by Sukchan Lee + +# This file is part of Open5GS. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +libausf_sources = files(''' + context.c + event.c + timer.c + + nnrf-handler.c + nf-sm.c + + nausf-handler.c + + nudm-build.c + nudm-handler.c + ue-sm.c + + sbi-path.c + ausf-sm.c + + init.c +'''.split()) + +libausf = static_library('ausf', + sources : libausf_sources, + link_with : libipfw, + dependencies : [libapp_dep, + libcrypt_dep, + libsbi_dep], + install : false) + +libausf_dep = declare_dependency( + link_with : libausf, + dependencies : [libapp_dep, + libcrypt_dep, + libsbi_dep]) + +ausf_sources = files(''' + app.c + ../main.c +'''.split()) + +executable('open5gs-ausfd', + sources : ausf_sources, + c_args : '-DDEFAULT_CONFIG_FILENAME="@0@/ausf.yaml"'.format(open5gs_sysconfdir), + include_directories : srcinc, + dependencies : libausf_dep, + install_rpath : libdir, + install : true) diff --git a/src/ausf/nausf-handler.c b/src/ausf/nausf-handler.c new file mode 100644 index 0000000000..c5c54ceb3f --- /dev/null +++ b/src/ausf/nausf-handler.c @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "sbi-path.h" +#include "nnrf-handler.h" +#include "nausf-handler.h" + +bool ausf_nausf_auth_handle_authenticate( + ausf_ue_t *ausf_ue, ogs_sbi_message_t *recvmsg) +{ + ogs_sbi_session_t *session = NULL; + + OpenAPI_authentication_info_t *AuthenticationInfo = NULL; + char *serving_network_name = NULL; + + ogs_assert(ausf_ue); + session = ausf_ue->session; + ogs_assert(session); + ogs_assert(recvmsg); + + AuthenticationInfo = recvmsg->AuthenticationInfo; + if (!AuthenticationInfo) { + ogs_error("[%s] No AuthenticationInfo", ausf_ue->suci); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + recvmsg, "[%s] No AuthenticationInfo", ausf_ue->suci); + return false; + } + + serving_network_name = AuthenticationInfo->serving_network_name; + if (!serving_network_name) { + ogs_error("[%s] No servingNetworkName", ausf_ue->suci); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + recvmsg, "[%s] No servingNetworkName", ausf_ue->suci); + return false; + } + + ausf_ue->serving_network_name = ogs_strdup(serving_network_name); + ogs_assert(ausf_ue->serving_network_name); + + ausf_nudm_ueau_discover_and_send_get(ausf_ue); + + return true; +} + +bool ausf_nausf_auth_handle_authenticate_confirmation( + ausf_ue_t *ausf_ue, ogs_sbi_message_t *recvmsg) +{ + ogs_sbi_session_t *session = NULL; + + OpenAPI_confirmation_data_t *ConfirmationData = NULL; + char *res_star_string = NULL; + uint8_t res_star[OGS_KEYSTRLEN(OGS_MAX_RES_LEN)]; + + ogs_assert(ausf_ue); + session = ausf_ue->session; + ogs_assert(session); + ogs_assert(recvmsg); + + ConfirmationData = recvmsg->ConfirmationData; + if (!ConfirmationData) { + ogs_error("[%s] No ConfirmationData", ausf_ue->suci); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + recvmsg, "[%s] No ConfirmationData", ausf_ue->suci); + return false; + } + + res_star_string = ConfirmationData->res_star; + if (!res_star_string) { + ogs_error("[%s] No ConfirmationData.resStar", ausf_ue->suci); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + recvmsg, "[%s] No ConfirmationData.resStar", ausf_ue->suci); + return false; + } + + ogs_ascii_to_hex(res_star_string, strlen(res_star_string), + res_star, sizeof(res_star)); + + if (memcmp(res_star, ausf_ue->xres_star, OGS_MAX_RES_LEN) != 0) { + ogs_log_hexdump(OGS_LOG_WARN, res_star, OGS_MAX_RES_LEN); + ogs_log_hexdump(OGS_LOG_WARN, ausf_ue->xres_star, OGS_MAX_RES_LEN); + + ausf_ue->auth_result = OpenAPI_auth_result_AUTHENTICATION_FAILURE; + } else { + ausf_ue->auth_result = OpenAPI_auth_result_AUTHENTICATION_SUCCESS; + } + + ausf_nudm_ueau_discover_and_send_result_confirmation_inform(ausf_ue); + + return true; +} diff --git a/src/ausf/nausf-handler.h b/src/ausf/nausf-handler.h new file mode 100644 index 0000000000..6fb7cfa58a --- /dev/null +++ b/src/ausf/nausf-handler.h @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef AUSF_NAUSF_HANDLER_H +#define AUSF_NAUSF_HANDLER_H + +#include "context.h" + +#ifdef __cplusplus +extern "C" { +#endif + +bool ausf_nausf_auth_handle_authenticate( + ausf_ue_t *ausf_ue, ogs_sbi_message_t *recvmsg); +bool ausf_nausf_auth_handle_authenticate_confirmation( + ausf_ue_t *ausf_ue, ogs_sbi_message_t *recvmsg); + +#ifdef __cplusplus +} +#endif + +#endif /* AUSF_NAUSF_HANDLER_H */ diff --git a/src/ausf/nf-sm.c b/src/ausf/nf-sm.c new file mode 100644 index 0000000000..209c1e8f9f --- /dev/null +++ b/src/ausf/nf-sm.c @@ -0,0 +1,390 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "context.h" + +#include "sbi-path.h" +#include "nnrf-handler.h" + +void ausf_nf_fsm_init(ogs_sbi_nf_instance_t *nf_instance) +{ + ausf_event_t e; + + ogs_assert(nf_instance); + + e.sbi.data = nf_instance; + + ogs_fsm_create(&nf_instance->sm, + ausf_nf_state_initial, ausf_nf_state_final); + ogs_fsm_init(&nf_instance->sm, &e); +} + +void ausf_nf_fsm_fini(ogs_sbi_nf_instance_t *nf_instance) +{ + ausf_event_t e; + + ogs_assert(nf_instance); + e.sbi.data = nf_instance; + + ogs_fsm_fini(&nf_instance->sm, &e); + ogs_fsm_delete(&nf_instance->sm); +} + +void ausf_nf_state_initial(ogs_fsm_t *s, ausf_event_t *e) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + + ogs_assert(s); + ogs_assert(e); + + ausf_sm_debug(e); + + nf_instance = e->sbi.data; + ogs_assert(nf_instance); + ogs_assert(nf_instance->id); + + nf_instance->t_registration_interval = ogs_timer_add(ausf_self()->timer_mgr, + ausf_timer_nf_instance_registration_interval, nf_instance); + ogs_assert(nf_instance->t_registration_interval); + nf_instance->t_heartbeat_interval = ogs_timer_add(ausf_self()->timer_mgr, + ausf_timer_nf_instance_heartbeat_interval, nf_instance); + ogs_assert(nf_instance->t_heartbeat_interval); + nf_instance->t_heartbeat = ogs_timer_add(ausf_self()->timer_mgr, + ausf_timer_nf_instance_heartbeat, nf_instance); + ogs_assert(nf_instance->t_heartbeat); + nf_instance->t_validity = ogs_timer_add(ausf_self()->timer_mgr, + ausf_timer_nf_instance_validity, nf_instance); + ogs_assert(nf_instance->t_validity); + + if (NF_INSTANCE_IS_SELF(nf_instance->id)) { + OGS_FSM_TRAN(s, &ausf_nf_state_will_register); + } else { + OGS_FSM_TRAN(s, &ausf_nf_state_registered); + } +} + +void ausf_nf_state_final(ogs_fsm_t *s, ausf_event_t *e) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + + ogs_assert(s); + ogs_assert(e); + + ausf_sm_debug(e); + + nf_instance = e->sbi.data; + ogs_assert(nf_instance); + + ogs_timer_delete(nf_instance->t_registration_interval); + ogs_timer_delete(nf_instance->t_heartbeat_interval); + ogs_timer_delete(nf_instance->t_heartbeat); + ogs_timer_delete(nf_instance->t_validity); +} + +void ausf_nf_state_will_register(ogs_fsm_t *s, ausf_event_t *e) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + ogs_sbi_client_t *client = NULL; + ogs_sbi_message_t *message = NULL; + ogs_sockaddr_t *addr = NULL; + + ogs_assert(s); + ogs_assert(e); + + ausf_sm_debug(e); + + nf_instance = e->sbi.data; + ogs_assert(nf_instance); + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + ogs_timer_start(nf_instance->t_registration_interval, + ausf_timer_cfg(AUSF_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL)-> + duration); + + ogs_nnrf_nfm_send_nf_register(nf_instance); + break; + + case OGS_FSM_EXIT_SIG: + ogs_timer_stop(nf_instance->t_registration_interval); + break; + + case AUSF_EVT_SBI_CLIENT: + message = e->sbi.message; + ogs_assert(message); + + SWITCH(message->h.service.name) + CASE(OGS_SBI_SERVICE_NAME_NNRF_NFM) + + SWITCH(message->h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES) + + if (message->res_status == OGS_SBI_HTTP_STATUS_OK || + message->res_status == OGS_SBI_HTTP_STATUS_CREATED) { + ausf_nnrf_handle_nf_register(nf_instance, message); + OGS_FSM_TRAN(s, &ausf_nf_state_registered); + } else { + ogs_error("[%s] HTTP response error [%d]", + nf_instance->id, message->res_status); + OGS_FSM_TRAN(s, &ausf_nf_state_exception); + } + break; + + DEFAULT + ogs_error("[%s] Invalid resource name [%s]", + nf_instance->id, message->h.resource.component[0]); + END + break; + + DEFAULT + ogs_error("[%s] Invalid API name [%s]", + nf_instance->id, message->h.service.name); + END + break; + + case AUSF_EVT_SBI_TIMER: + switch(e->timer_id) { + case AUSF_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL: + client = nf_instance->client; + ogs_assert(client); + addr = client->addr; + ogs_assert(addr); + + ogs_warn("[%s] Retry to registration with NRF", nf_instance->id); + + ogs_timer_start(nf_instance->t_registration_interval, + ausf_timer_cfg(AUSF_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL)-> + duration); + + ogs_nnrf_nfm_send_nf_register(nf_instance); + break; + + default: + ogs_error("[%s] Unknown timer[%s:%d]", nf_instance->id, + ausf_timer_get_name(e->timer_id), e->timer_id); + } + break; + + default: + ogs_error("Unknown event %s", ausf_event_get_name(e)); + break; + } +} + +void ausf_nf_state_registered(ogs_fsm_t *s, ausf_event_t *e) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + ogs_sbi_client_t *client = NULL; + ogs_sbi_message_t *message = NULL; + ogs_assert(s); + ogs_assert(e); + + ausf_sm_debug(e); + + nf_instance = e->sbi.data; + ogs_assert(nf_instance); + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + if (NF_INSTANCE_IS_SELF(nf_instance->id)) { + ogs_info("[%s] NF registered", nf_instance->id); + + client = nf_instance->client; + ogs_assert(client); + + if (nf_instance->time.heartbeat) { + ogs_timer_start(nf_instance->t_heartbeat_interval, + ogs_time_from_sec(nf_instance->time.heartbeat)); + ogs_timer_start(nf_instance->t_heartbeat, + ogs_time_from_sec(nf_instance->time.heartbeat * + OGS_SBI_HEARTBEAT_RETRYCOUNT)); + } + + ogs_nnrf_nfm_send_nf_status_subscribe(client, + ausf_self()->nf_type, nf_instance->id); + } + + break; + + case OGS_FSM_EXIT_SIG: + if (NF_INSTANCE_IS_SELF(nf_instance->id)) { + ogs_info("[%s] NF de-registered", nf_instance->id); + + if (nf_instance->time.heartbeat) { + ogs_timer_stop(nf_instance->t_heartbeat_interval); + ogs_timer_stop(nf_instance->t_heartbeat); + } + + ogs_nnrf_nfm_send_nf_de_register(nf_instance); + } + break; + + case AUSF_EVT_SBI_CLIENT: + message = e->sbi.message; + ogs_assert(message); + + SWITCH(message->h.service.name) + CASE(OGS_SBI_SERVICE_NAME_NNRF_NFM) + + SWITCH(message->h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES) + + if (message->res_status == OGS_SBI_HTTP_STATUS_NO_CONTENT || + message->res_status == OGS_SBI_HTTP_STATUS_OK) { + if (nf_instance->time.heartbeat) + ogs_timer_start(nf_instance->t_heartbeat, + ogs_time_from_sec(nf_instance->time.heartbeat * + OGS_SBI_HEARTBEAT_RETRYCOUNT)); + } else { + ogs_error("[%s] HTTP response error [%d]", + nf_instance->id, message->res_status); + } + + break; + + DEFAULT + ogs_error("[%s] Invalid resource name [%s]", + nf_instance->id, message->h.resource.component[0]); + END + break; + + DEFAULT + ogs_error("[%s] Invalid API name [%s]", + nf_instance->id, message->h.service.name); + END + break; + + case AUSF_EVT_SBI_TIMER: + switch(e->timer_id) { + case AUSF_TIMER_NF_INSTANCE_HEARTBEAT_INTERVAL: + if (nf_instance->time.heartbeat) { + ogs_timer_start(nf_instance->t_heartbeat_interval, + ogs_time_from_sec(nf_instance->time.heartbeat)); + } + + ogs_nnrf_nfm_send_nf_update(nf_instance); + break; + + case AUSF_TIMER_NF_INSTANCE_HEARTBEAT: + OGS_FSM_TRAN(s, &ausf_nf_state_will_register); + break; + + case AUSF_TIMER_NF_INSTANCE_VALIDITY: + if (NF_INSTANCE_IS_OTHERS(nf_instance->id)) { + ogs_info("[%s] NF expired", nf_instance->id); + OGS_FSM_TRAN(s, &ausf_nf_state_de_registered); + } + break; + + default: + ogs_error("[%s] Unknown timer[%s:%d]", nf_instance->id, + ausf_timer_get_name(e->timer_id), e->timer_id); + break; + } + break; + + default: + ogs_error("[%s] Unknown event %s", + nf_instance->id, ausf_event_get_name(e)); + break; + } +} + +void ausf_nf_state_de_registered(ogs_fsm_t *s, ausf_event_t *e) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + ogs_assert(s); + ogs_assert(e); + + ausf_sm_debug(e); + + nf_instance = e->sbi.data; + ogs_assert(nf_instance); + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + if (NF_INSTANCE_IS_SELF(nf_instance->id)) { + ogs_info("[%s] NF de-registered", nf_instance->id); + } + break; + + case OGS_FSM_EXIT_SIG: + break; + + default: + ogs_error("[%s] Unknown event %s", + nf_instance->id, ausf_event_get_name(e)); + break; + } +} + +void ausf_nf_state_exception(ogs_fsm_t *s, ausf_event_t *e) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + ogs_sbi_client_t *client = NULL; + ogs_sockaddr_t *addr = NULL; + ogs_assert(s); + ogs_assert(e); + + ausf_sm_debug(e); + + nf_instance = e->sbi.data; + ogs_assert(nf_instance); + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + if (NF_INSTANCE_IS_SELF(nf_instance->id)) { + ogs_timer_start(nf_instance->t_registration_interval, + ausf_timer_cfg(AUSF_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL)-> + duration); + } + break; + + case OGS_FSM_EXIT_SIG: + if (NF_INSTANCE_IS_SELF(nf_instance->id)) { + ogs_timer_stop(nf_instance->t_registration_interval); + } + break; + + case AUSF_EVT_SBI_TIMER: + switch(e->timer_id) { + case AUSF_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL: + client = nf_instance->client; + ogs_assert(client); + addr = client->addr; + ogs_assert(addr); + + ogs_warn("[%s] Retry to registration with NRF", nf_instance->id); + + OGS_FSM_TRAN(s, &ausf_nf_state_will_register); + break; + + default: + ogs_error("[%s] Unknown timer[%s:%d]", nf_instance->id, + ausf_timer_get_name(e->timer_id), e->timer_id); + break; + } + break; + + default: + ogs_error("[%s] Unknown event %s", + nf_instance->id, ausf_event_get_name(e)); + break; + } +} diff --git a/src/ausf/nnrf-handler.c b/src/ausf/nnrf-handler.c new file mode 100644 index 0000000000..f54387a74f --- /dev/null +++ b/src/ausf/nnrf-handler.c @@ -0,0 +1,328 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "sbi-path.h" +#include "nnrf-handler.h" + +void ausf_nnrf_handle_nf_register( + ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_message_t *message) +{ + OpenAPI_nf_profile_t *NFProfile = NULL; + ogs_sbi_client_t *client = NULL; + + ogs_assert(message); + ogs_assert(nf_instance); + client = nf_instance->client; + ogs_assert(client); + + NFProfile = message->NFProfile; + if (!NFProfile) { + ogs_error("No NFProfile"); + return; + } + + /* TIME : Update heartbeat from NRF */ + nf_instance->time.heartbeat = NFProfile->heart_beat_timer; +} + +void ausf_nnrf_handle_nf_status_subscribe( + ogs_sbi_subscription_t *subscription, ogs_sbi_message_t *message) +{ + OpenAPI_subscription_data_t *SubscriptionData = NULL; + ogs_sbi_client_t *client = NULL; + + ogs_assert(message); + ogs_assert(subscription); + client = subscription->client; + ogs_assert(client); + + SubscriptionData = message->SubscriptionData; + if (!SubscriptionData) { + ogs_error("No SubscriptionData"); + return; + } + + if (!SubscriptionData->subscription_id) { + ogs_error("No SubscriptionId"); + return; + } + ogs_sbi_subscription_set_id( + subscription, SubscriptionData->subscription_id); + + if (SubscriptionData->validity_time) { + struct timeval tv; + struct tm local, next; + ogs_time_t diff, duration; + if (ogs_strptime(SubscriptionData->validity_time, + OGS_TIME_ISO8601_FORMAT, &next)) { + ogs_gettimeofday(&tv); + ogs_localtime(tv.tv_sec, &local); + diff = ogs_mktime(&next) - ogs_mktime(&local); +#define VALIDITY_MARGIN 5 /* 5 seconds */ +#define VALIDITY_MINIMUM 60 /* 60 seconds */ + duration = diff - (int)VALIDITY_MARGIN; + + if (duration < (int)VALIDITY_MINIMUM) { + ogs_warn("[%s] Validation period [%d seconds, %s] is too small", + subscription->id, + (int)diff, SubscriptionData->validity_time); + duration = VALIDITY_MINIMUM; + ogs_warn("[%s] Forced to %d seconds", + subscription->id, VALIDITY_MINIMUM); + } + + subscription->t_validity = ogs_timer_add(ausf_self()->timer_mgr, + ausf_timer_subscription_validity, subscription); + ogs_assert(subscription->t_validity); + ogs_timer_start( + subscription->t_validity, ogs_time_from_sec(duration)); + } + } +} + +bool ausf_nnrf_handle_nf_status_notify( + ogs_sbi_session_t *session, ogs_sbi_message_t *message) +{ + ogs_sbi_response_t *response = NULL; + OpenAPI_notification_data_t *NotificationData = NULL; + OpenAPI_nf_profile_t *NFProfile = NULL; + ogs_sbi_nf_instance_t *nf_instance = NULL; + bool handled; + + ogs_assert(session); + ogs_assert(message); + + NotificationData = message->NotificationData; + if (!NotificationData) { + ogs_error("No NotificationData"); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + message, "No NotificationData", NULL); + return false; + } + + NFProfile = NotificationData->nf_profile; + if (!NFProfile) { + ogs_error("No NFProfile"); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + message, "No NFProfile", NULL); + return false; + } + + if (!NFProfile->nf_instance_id) { + ogs_error("No NFProfile.NFInstanceId"); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + message, "No NFProfile", "NFInstanceId"); + return false; + } + + if (!NFProfile->nf_instance_id) { + ogs_error("No NFProfile.NFInstanceId"); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + message, "No NFProfile", "NFInstanceId"); + return false; + } + + if (NF_INSTANCE_IS_SELF(NFProfile->nf_instance_id)) { + ogs_error("The notification is not allowed [%s]", + NFProfile->nf_instance_id); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_FORBIDDEN, + message, "The notification is not allowed", + NFProfile->nf_instance_id); + return false; + } + + if (NotificationData->event == + OpenAPI_notification_event_type_NF_REGISTERED) { + + nf_instance = ogs_sbi_nf_instance_find(NFProfile->nf_instance_id); + if (!nf_instance) { + nf_instance = ogs_sbi_nf_instance_add(NFProfile->nf_instance_id); + ogs_assert(nf_instance); + + ausf_nf_fsm_init(nf_instance); + + ogs_info("[%s] (NRF-notify) NF registered", nf_instance->id); + } else { + OGS_FSM_TRAN(&nf_instance->sm, ausf_nf_state_registered); + ogs_fsm_dispatch(&nf_instance->sm, NULL); + + ogs_warn("[%s] (NRF-notify) NF has already been added", + NFProfile->nf_instance_id); + } + + handled = ogs_sbi_nnrf_handle_nf_profile( + nf_instance, NFProfile, session, message); + if (!handled) { + AUSF_NF_INSTANCE_CLEAR("NRF-notify", nf_instance); + return false; + } + + ogs_info("[%s] (NRF-notify) NF Profile updated", nf_instance->id); + + handled = ogs_sbi_client_associate(nf_instance); + if (!handled) { + ogs_error("[%s] Cannot associate NF EndPoint", nf_instance->id); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_BAD_REQUEST, + message, "Cannot find NF EndPoint", nf_instance->id); + AUSF_NF_INSTANCE_CLEAR("NRF-notify", nf_instance); + return false; + } + + ausf_sbi_setup_client_callback(nf_instance); + + } else if (NotificationData->event == + OpenAPI_notification_event_type_NF_DEREGISTERED) { + nf_instance = ogs_sbi_nf_instance_find(NFProfile->nf_instance_id); + if (nf_instance) { + AUSF_NF_INSTANCE_CLEAR("NRF-notify", nf_instance); + } else { + ogs_warn("[%s] (NRF-notify) Not found", NFProfile->nf_instance_id); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_NOT_FOUND, + message, "Not found", message->h.resource.component[1]); + return false; + } + } else { + char *eventstr = OpenAPI_notification_event_type_ToString( + NotificationData->event); + ogs_error("Not supported event [%d:%s]", + NotificationData->event, eventstr ? eventstr : "Unknown"); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + message, "Not supported event", + eventstr ? eventstr : "Unknown"); + return false; + } + + response = ogs_sbi_build_response(message, OGS_SBI_HTTP_STATUS_NO_CONTENT); + ogs_assert(response); + ogs_sbi_server_send_response(session, response); + + return true; +} + +void ausf_nnrf_handle_nf_discover( + ausf_ue_t *ausf_ue, ogs_sbi_message_t *message) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + ogs_sbi_session_t *session = NULL; + + OpenAPI_search_result_t *SearchResult = NULL; + OpenAPI_lnode_t *node = NULL; + bool handled; + + ogs_assert(ausf_ue); + session = ausf_ue->session; + ogs_assert(session); + ogs_assert(message); + + SearchResult = message->SearchResult; + if (!SearchResult) { + ogs_error("No SearchResult"); + return; + } + + OpenAPI_list_for_each(SearchResult->nf_instances, node) { + OpenAPI_nf_profile_t *NFProfile = NULL; + + if (!node->data) continue; + + NFProfile = node->data; + + nf_instance = ogs_sbi_nf_instance_find(NFProfile->nf_instance_id); + if (!nf_instance) { + nf_instance = ogs_sbi_nf_instance_add(NFProfile->nf_instance_id); + ogs_assert(nf_instance); + + ausf_nf_fsm_init(nf_instance); + + ogs_info("[%s] (NF-discover) NF registered", nf_instance->id); + } else { + OGS_FSM_TRAN(&nf_instance->sm, ausf_nf_state_registered); + ogs_fsm_dispatch(&nf_instance->sm, NULL); + + ogs_warn("[%s] (NF-discover) NF has already been added", + NFProfile->nf_instance_id); + } + + if (NF_INSTANCE_IS_OTHERS(nf_instance->id)) { + handled = ogs_sbi_nnrf_handle_nf_profile( + nf_instance, NFProfile, NULL, NULL); + if (!handled) { + ogs_error("[%s] ogs_sbi_nnrf_handle_nf_profile() failed", + nf_instance->id); + AUSF_NF_INSTANCE_CLEAR("NRF-discover", nf_instance); + continue; + } + + handled = ogs_sbi_client_associate(nf_instance); + if (!handled) { + ogs_error("[%s] Cannot assciate NF EndPoint", nf_instance->id); + AUSF_NF_INSTANCE_CLEAR("NRF-discover", nf_instance); + continue; + } + + ausf_sbi_setup_client_callback(nf_instance); + + if (!OGS_SBI_NF_INSTANCE_GET( + ausf_ue->nf_types, nf_instance->nf_type)) + ogs_sbi_nf_types_associate(ausf_ue->nf_types, + nf_instance->nf_type, ausf_nf_state_registered); + + /* TIME : Update validity from NRF */ + if (SearchResult->validity_period) { + nf_instance->time.validity = SearchResult->validity_period; + + ogs_assert(nf_instance->t_validity); + ogs_timer_start(nf_instance->t_validity, + ogs_time_from_sec(nf_instance->time.validity)); + + } else + ogs_warn("[%s] NF Instance validity-time should not 0", + nf_instance->id); + + ogs_info("[%s] (NF-discover) NF Profile updated", nf_instance->id); + } + } + + nf_instance = OGS_SBI_NF_INSTANCE_GET( + ausf_ue->nf_types, OpenAPI_nf_type_UDM); + if (!nf_instance) { + ogs_error("[%s] (NF discover) No UDM", ausf_ue->suci); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_SERVICE_UNAVAILABLE, NULL, + "(NF discover) No UDM", ausf_ue->suci); + ausf_ue_remove(ausf_ue); + } else { + ogs_assert(ausf_ue->state.method); + SWITCH(ausf_ue->state.method) + CASE(OGS_SBI_HTTP_METHOD_POST) + ausf_nudm_ueau_send_get(ausf_ue, nf_instance); + break; + CASE(OGS_SBI_HTTP_METHOD_PUT) + ausf_nudm_ueau_send_result_confirmation_inform( + ausf_ue, nf_instance); + break; + DEFAULT + ogs_fatal("[%s] Unknown state [%s]", + ausf_ue->suci, ausf_ue->state.method); + ogs_assert_if_reached(); + END + } +} diff --git a/src/ausf/nnrf-handler.h b/src/ausf/nnrf-handler.h new file mode 100644 index 0000000000..bdcbad4084 --- /dev/null +++ b/src/ausf/nnrf-handler.h @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef AUSF_NNRF_HANDLER_H +#define AUSF_NNRF_HANDLER_H + +#include "context.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void ausf_nnrf_handle_nf_register( + ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_message_t *message); +void ausf_nnrf_handle_nf_status_subscribe( + ogs_sbi_subscription_t *subscription, ogs_sbi_message_t *message); + +bool ausf_nnrf_handle_nf_status_notify( + ogs_sbi_session_t *session, ogs_sbi_message_t *message); + +void ausf_nnrf_handle_nf_discover( + ausf_ue_t *ausf_ue, ogs_sbi_message_t *message); + +#ifdef __cplusplus +} +#endif + +#endif /* AUSF_NNRF_HANDLER_H */ diff --git a/src/ausf/nudm-build.c b/src/ausf/nudm-build.c new file mode 100644 index 0000000000..80b380164f --- /dev/null +++ b/src/ausf/nudm-build.c @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2019 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "nudm-build.h" + +ogs_sbi_request_t *ausf_nudm_ueau_build_get(ausf_ue_t *ausf_ue) +{ + ogs_sbi_message_t message; + ogs_sbi_request_t *request = NULL; + + OpenAPI_authentication_info_request_t *AuthenticationInfoRequest = NULL; + + ogs_assert(ausf_ue); + + memset(&message, 0, sizeof(message)); + message.h.method = (char *)OGS_SBI_HTTP_METHOD_POST; + message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NUDM_UEAU; + message.h.api.version = (char *)OGS_SBI_API_VERSION; + message.h.resource.component[0] = ausf_ue->suci; + message.h.resource.component[1] = + (char *)OGS_SBI_RESOURCE_NAME_SECURITY_INFORMATION; + message.h.resource.component[2] = + (char *)OGS_SBI_RESOURCE_NAME_GENERATE_AUTH_DATA; + + AuthenticationInfoRequest = + ogs_calloc(1, sizeof(*AuthenticationInfoRequest)); + ogs_assert(AuthenticationInfoRequest); + + AuthenticationInfoRequest->serving_network_name = + ausf_ue->serving_network_name; + AuthenticationInfoRequest->ausf_instance_id = + ogs_sbi_self()->nf_instance_id; + + message.AuthenticationInfoRequest = AuthenticationInfoRequest; + + request = ogs_sbi_build_request(&message); + ogs_assert(request); + + ogs_free(AuthenticationInfoRequest); + + return request; +} + +ogs_sbi_request_t *ausf_nudm_ueau_build_result_confirmation_inform( + ausf_ue_t *ausf_ue) +{ + ogs_sbi_message_t message; + ogs_sbi_request_t *request = NULL; + + char buf[OGS_TIME_ISO8601_FORMATTED_LENGTH]; + struct timeval tv; + struct tm local; + + OpenAPI_auth_event_t *AuthEvent = NULL; + + ogs_assert(ausf_ue); + + memset(&message, 0, sizeof(message)); + message.h.method = (char *)OGS_SBI_HTTP_METHOD_POST; + message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NUDM_UEAU; + message.h.api.version = (char *)OGS_SBI_API_VERSION; + message.h.resource.component[0] = ausf_ue->supi; + message.h.resource.component[1] = (char *)OGS_SBI_RESOURCE_NAME_AUTH_EVENTS; + + AuthEvent = ogs_calloc(1, sizeof(*AuthEvent)); + ogs_assert(AuthEvent); + + ogs_gettimeofday(&tv); + ogs_localtime(tv.tv_sec, &local); + ogs_strftime(buf, OGS_TIME_ISO8601_FORMATTED_LENGTH, + OGS_TIME_ISO8601_FORMAT, &local); + AuthEvent->time_stamp = buf; + + AuthEvent->nf_instance_id = ogs_sbi_self()->nf_instance_id; + if (ausf_ue->auth_result == OpenAPI_auth_result_AUTHENTICATION_SUCCESS) + AuthEvent->success = true; + else + AuthEvent->success = false; + AuthEvent->auth_type = ausf_ue->auth_type; + AuthEvent->serving_network_name = ausf_ue->serving_network_name; + + message.AuthEvent = AuthEvent; + + request = ogs_sbi_build_request(&message); + ogs_assert(request); + + ogs_free(AuthEvent); + + return request; +} diff --git a/src/mme/mme-kdf.h b/src/ausf/nudm-build.h similarity index 53% rename from src/mme/mme-kdf.h rename to src/ausf/nudm-build.h index a6e5b1a119..ca8da1361b 100644 --- a/src/mme/mme-kdf.h +++ b/src/ausf/nudm-build.h @@ -17,25 +17,21 @@ * along with this program. If not, see . */ -#ifndef MME_KDF_H -#define MME_KDF_H +#ifndef AUSF_NUDM_BUILD_H +#define AUSF_NUDM_BUILD_H -/* Algorithm Type Distinguishers */ -#define MME_KDF_NAS_ENC_ALG 0x01 -#define MME_KDF_NAS_INT_ALG 0x02 +#include "context.h" -/* Algorithm Identity defined in nas_ies.h -#define NAS_SECURITY_ALGORITHMS_EIA0_EEA0 0 -#define NAS_SECURITY_ALGORITHMS_128_EIA1_EEA1 1 -#define NAS_SECURITY_ALGORITHMS_128_EIA1_EEA2 2 -#define NAS_SECURITY_ALGORITHMS_128_EIA3_EEA3 3 -*/ +#ifdef __cplusplus +extern "C" { +#endif -void mme_kdf_nas(uint8_t algorithm_type_distinguishers, - uint8_t algorithm_identity, const uint8_t *kasme, uint8_t *knas); +ogs_sbi_request_t *ausf_nudm_ueau_build_get(ausf_ue_t *ausf_ue); +ogs_sbi_request_t *ausf_nudm_ueau_build_result_confirmation_inform( + ausf_ue_t *ausf_ue); -void mme_kdf_enb(const uint8_t *kasme, uint32_t ul_count, uint8_t *kenb); +#ifdef __cplusplus +} +#endif -void mme_kdf_nh(const uint8_t *kasme, const uint8_t *sync_input, uint8_t *kenb); - -#endif /* MME_KDF_H */ +#endif /* AUSF_NUDM_BUILD_H */ diff --git a/src/ausf/nudm-handler.c b/src/ausf/nudm-handler.c new file mode 100644 index 0000000000..15680b5245 --- /dev/null +++ b/src/ausf/nudm-handler.c @@ -0,0 +1,272 @@ +/* + * Copyright (C) 2019 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "nudm-handler.h" + +static const char *links_member_name(OpenAPI_auth_type_e auth_type) +{ + if (auth_type == OpenAPI_auth_type_5G_AKA || + auth_type == OpenAPI_auth_type_EAP_AKA_PRIME) { + return OGS_SBI_RESOURCE_NAME_5G_AKA; + } else if (auth_type == OpenAPI_auth_type_EAP_TLS) { + return OGS_SBI_RESOURCE_NAME_EAP_SESSION; + } + + ogs_assert_if_reached(); + return NULL; +} + +bool ausf_nudm_ueau_handle_get(ausf_ue_t *ausf_ue, ogs_sbi_message_t *recvmsg) +{ + ogs_sbi_server_t *server = NULL; + ogs_sbi_session_t *session = NULL; + + ogs_sbi_message_t sendmsg; + ogs_sbi_header_t header; + ogs_sbi_response_t *response = NULL; + + char hxres_star_string[OGS_KEYSTRLEN(OGS_MAX_RES_LEN)]; + + OpenAPI_authentication_info_result_t *AuthenticationInfoResult = NULL; + OpenAPI_authentication_vector_t *AuthenticationVector = NULL; + OpenAPI_ue_authentication_ctx_t UeAuthenticationCtx; + OpenAPI_av5g_aka_t AV5G_AKA; + OpenAPI_map_t *LinksValueScheme = NULL; + OpenAPI_links_value_schema_t LinksValueSchemeValue; + + ogs_assert(ausf_ue); + session = ausf_ue->session; + ogs_assert(session); + server = ogs_sbi_session_get_server(session); + ogs_assert(server); + + ogs_assert(recvmsg); + + AuthenticationInfoResult = recvmsg->AuthenticationInfoResult; + if (!AuthenticationInfoResult) { + ogs_error("[%s] No AuthenticationInfoResult", ausf_ue->suci); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, + recvmsg, "No AuthenticationInfoResult", ausf_ue->suci); + return false; + } + + if (AuthenticationInfoResult->auth_type != + OpenAPI_auth_type_5G_AKA) { + ogs_error("[%s] Not supported Auth Method [%d]", + ausf_ue->suci, AuthenticationInfoResult->auth_type); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_FORBIDDEN, + recvmsg, "Not supported Auth Method", ausf_ue->suci); + return false; + } + + AuthenticationVector = + AuthenticationInfoResult->authentication_vector; + if (!AuthenticationVector) { + ogs_error("[%s] No AuthenticationVector", ausf_ue->suci); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, + recvmsg, "No AuthenticationVector", ausf_ue->suci); + return false; + } + + if (AuthenticationVector->av_type != OpenAPI_av_type_5G_HE_AKA) { + ogs_error("[%s] Not supported Auth Method [%d]", + ausf_ue->suci, AuthenticationVector->av_type); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_FORBIDDEN, + recvmsg, "Not supported Auth Method", ausf_ue->suci); + return false; + } + + if (!AuthenticationVector->rand) { + ogs_error("[%s] No AuthenticationVector.rand", ausf_ue->suci); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, + recvmsg, "No AuthenticationVector.rand", ausf_ue->suci); + return false; + } + + if (!AuthenticationVector->xres_star) { + ogs_error("[%s] No AuthenticationVector.xresStar", + ausf_ue->suci); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, + recvmsg, "No AuthenticationVector.xresStar", ausf_ue->suci); + return false; + } + + if (!AuthenticationVector->autn) { + ogs_error("[%s] No AuthenticationVector.autn", ausf_ue->suci); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, + recvmsg, "No AuthenticationVector.autn", ausf_ue->suci); + return false; + } + + if (!AuthenticationVector->kausf) { + ogs_error("[%s] No AuthenticationVector.kausf", ausf_ue->suci); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, + recvmsg, "No AuthenticationVector.kausf", ausf_ue->suci); + return false; + } + + ausf_ue->auth_type = AuthenticationInfoResult->auth_type; + + ogs_ascii_to_hex( + AuthenticationVector->rand, + strlen(AuthenticationVector->rand), + ausf_ue->rand, sizeof(ausf_ue->rand)); + ogs_ascii_to_hex( + AuthenticationVector->xres_star, + strlen(AuthenticationVector->xres_star), + ausf_ue->xres_star, sizeof(ausf_ue->xres_star)); + ogs_ascii_to_hex( + AuthenticationVector->kausf, + strlen(AuthenticationVector->kausf), + ausf_ue->kausf, sizeof(ausf_ue->kausf)); + + memset(&UeAuthenticationCtx, 0, sizeof(UeAuthenticationCtx)); + + UeAuthenticationCtx.auth_type = ausf_ue->auth_type; + + memset(&AV5G_AKA, 0, sizeof(AV5G_AKA)); + AV5G_AKA.rand = AuthenticationVector->rand; + AV5G_AKA.autn = AuthenticationVector->autn; + + ogs_kdf_hxres_star(ausf_ue->rand, ausf_ue->xres_star, + ausf_ue->hxres_star); + ogs_hex_to_ascii(ausf_ue->hxres_star, sizeof(ausf_ue->hxres_star), + hxres_star_string, sizeof(hxres_star_string)); + AV5G_AKA.hxres_star = hxres_star_string; + + UeAuthenticationCtx._5g_auth_data = &AV5G_AKA; + + memset(&LinksValueSchemeValue, 0, sizeof(LinksValueSchemeValue)); + + memset(&header, 0, sizeof(header)); + header.service.name = (char *)OGS_SBI_SERVICE_NAME_NAUSF_AUTH; + header.api.version = (char *)OGS_SBI_API_VERSION; + header.resource.component[0] = + (char *)OGS_SBI_RESOURCE_NAME_UE_AUTHENTICATIONS; + header.resource.component[1] = ausf_ue->ctx_id; + header.resource.component[2] = + (char *)OGS_SBI_RESOURCE_NAME_5G_AKA_CONFIRMATION; + LinksValueSchemeValue.href = ogs_sbi_server_uri(server, &header); + LinksValueScheme = OpenAPI_map_create( + (char *)links_member_name(UeAuthenticationCtx.auth_type), + &LinksValueSchemeValue); + + UeAuthenticationCtx._links = OpenAPI_list_create(); + OpenAPI_list_add(UeAuthenticationCtx._links, LinksValueScheme); + + memset(&sendmsg, 0, sizeof(sendmsg)); + + memset(&header, 0, sizeof(header)); + header.service.name = (char *)OGS_SBI_SERVICE_NAME_NAUSF_AUTH; + header.api.version = (char *)OGS_SBI_API_VERSION; + header.resource.component[0] = + (char *)OGS_SBI_RESOURCE_NAME_UE_AUTHENTICATIONS; + header.resource.component[1] = ausf_ue->ctx_id; + + sendmsg.http.location = ogs_sbi_server_uri(server, &header); + sendmsg.http.content_type = (char *)OGS_SBI_CONTENT_3GPPHAL_TYPE; + + sendmsg.UeAuthenticationCtx = &UeAuthenticationCtx; + + response = ogs_sbi_build_response(&sendmsg, + OGS_SBI_HTTP_STATUS_CREATED); + ogs_assert(response); + ogs_sbi_server_send_response(session, response); + + OpenAPI_list_free(UeAuthenticationCtx._links); + OpenAPI_map_free(LinksValueScheme); + + ogs_free(LinksValueSchemeValue.href); + ogs_free(sendmsg.http.location); + + return true; +} + +bool ausf_nudm_ueau_handle_result_confirmation_inform( + ausf_ue_t *ausf_ue, ogs_sbi_message_t *recvmsg) +{ + ogs_sbi_session_t *session = NULL; + + ogs_sbi_message_t sendmsg; + ogs_sbi_response_t *response = NULL; + + char kseaf_string[OGS_KEYSTRLEN(OGS_SHA256_DIGEST_SIZE)]; + + OpenAPI_confirmation_data_response_t ConfirmationDataResponse; + OpenAPI_auth_event_t *AuthEvent = NULL; + + ogs_assert(ausf_ue); + session = ausf_ue->session; + ogs_assert(session); + + ogs_assert(recvmsg); + + AuthEvent = recvmsg->AuthEvent; + if (!AuthEvent) { + ogs_error("[%s] No AuthEvent", ausf_ue->suci); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + recvmsg, "No AuthEvent", ausf_ue->suci); + return false; + } + + if (!recvmsg->http.location) { + ogs_error("[%s] No Location", ausf_ue->suci); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + recvmsg, "No Location", ausf_ue->suci); + return false; + } + + if (ausf_ue->auth_events_url) + ogs_free(ausf_ue->auth_events_url); + ausf_ue->auth_events_url = ogs_strdup(recvmsg->http.location); + + memset(&ConfirmationDataResponse, 0, sizeof(ConfirmationDataResponse)); + + if (AuthEvent->success == true) + ausf_ue->auth_result = OpenAPI_auth_result_AUTHENTICATION_SUCCESS; + else + ausf_ue->auth_result = OpenAPI_auth_result_AUTHENTICATION_FAILURE; + + ConfirmationDataResponse.auth_result = ausf_ue->auth_result; + ConfirmationDataResponse.supi = ausf_ue->supi; + + ogs_kdf_kseaf(ausf_ue->serving_network_name, + ausf_ue->kausf, ausf_ue->kseaf); + ogs_hex_to_ascii(ausf_ue->kseaf, sizeof(ausf_ue->kseaf), + kseaf_string, sizeof(kseaf_string)); + ConfirmationDataResponse.kseaf = kseaf_string; + + memset(&sendmsg, 0, sizeof(sendmsg)); + + sendmsg.ConfirmationDataResponse = &ConfirmationDataResponse; + + response = ogs_sbi_build_response(&sendmsg, OGS_SBI_HTTP_STATUS_OK); + ogs_assert(response); + ogs_sbi_server_send_response(session, response); + + return true; +} diff --git a/src/ausf/nudm-handler.h b/src/ausf/nudm-handler.h new file mode 100644 index 0000000000..01d2633bae --- /dev/null +++ b/src/ausf/nudm-handler.h @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2019 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef AUSF_NUDM_HANDLER_H +#define AUSF_NUDM_HANDLER_H + +#include "context.h" + +#ifdef __cplusplus +extern "C" { +#endif + +bool ausf_nudm_ueau_handle_get(ausf_ue_t *ausf_ue, ogs_sbi_message_t *recvmsg); +bool ausf_nudm_ueau_handle_result_confirmation_inform( + ausf_ue_t *ausf_ue, ogs_sbi_message_t *recvmsg); +#ifdef __cplusplus +} +#endif + +#endif /* AUSF_NUDM_HANDLER_H */ diff --git a/src/ausf/sbi-path.c b/src/ausf/sbi-path.c new file mode 100644 index 0000000000..4d61b34b89 --- /dev/null +++ b/src/ausf/sbi-path.c @@ -0,0 +1,238 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "sbi-path.h" + +static int server_cb(ogs_sbi_server_t *server, + ogs_sbi_session_t *session, ogs_sbi_request_t *request) +{ + ausf_event_t *e = NULL; + int rv; + + ogs_assert(session); + ogs_assert(request); + + e = ausf_event_new(AUSF_EVT_SBI_SERVER); + ogs_assert(e); + + e->sbi.server = server; + e->sbi.session = session; + e->sbi.request = request; + + rv = ogs_queue_push(ausf_self()->queue, e); + if (rv != OGS_OK) { + ogs_warn("ogs_queue_push() failed:%d", (int)rv); + ausf_event_free(e); + return OGS_ERROR; + } + + return OGS_OK; +} + +static int client_cb(ogs_sbi_response_t *response, void *data) +{ + ausf_event_t *e = NULL; + int rv; + + ogs_assert(response); + + e = ausf_event_new(AUSF_EVT_SBI_CLIENT); + ogs_assert(e); + e->sbi.response = response; + e->sbi.data = data; + + rv = ogs_queue_push(ausf_self()->queue, e); + if (rv != OGS_OK) { + ogs_warn("ogs_queue_push() failed:%d", (int)rv); + ausf_event_free(e); + return OGS_ERROR; + } + + return OGS_OK; +} + +int ausf_sbi_open(void) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + + ogs_sbi_server_start_all(server_cb); + + ogs_list_for_each(&ogs_sbi_self()->nf_instance_list, nf_instance) { + ogs_sbi_nf_service_t *service = NULL; + + ogs_sbi_nf_instance_build_default(nf_instance, ausf_self()->nf_type); + + service = ogs_sbi_nf_service_build_default(nf_instance, + (char*)OGS_SBI_SERVICE_NAME_NAUSF_AUTH); + ogs_assert(service); + ogs_sbi_nf_service_add_version(service, (char*)OGS_SBI_API_VERSION, + (char*)OGS_SBI_API_FULL_VERSION, NULL); + + ausf_nf_fsm_init(nf_instance); + ausf_sbi_setup_client_callback(nf_instance); + } + + return OGS_OK; +} + +void ausf_sbi_close(void) +{ + ogs_sbi_server_stop_all(); +} + +void ausf_sbi_setup_client_callback(ogs_sbi_nf_instance_t *nf_instance) +{ + ogs_sbi_client_t *client = NULL; + ogs_sbi_nf_service_t *nf_service = NULL; + ogs_assert(nf_instance); + + client = nf_instance->client; + ogs_assert(client); + + client->cb = client_cb; + + ogs_list_for_each(&nf_instance->nf_service_list, nf_service) { + client = nf_service->client; + if (client) + client->cb = client_cb; + } +} + +static ogs_sbi_nf_instance_t *find_or_discover_nf_instance( + ausf_ue_t *ausf_ue, OpenAPI_nf_type_e nf_type) +{ + ogs_sbi_session_t *session = NULL; + bool nrf = true; + bool nf = true; + + ogs_assert(ausf_ue); + session = ausf_ue->session; + ogs_assert(session); + ogs_assert(nf_type); + + if (!OGS_SBI_NF_INSTANCE_GET(ausf_ue->nf_types, OpenAPI_nf_type_NRF)) + nrf = ogs_sbi_nf_types_associate( + ausf_ue->nf_types, OpenAPI_nf_type_NRF, ausf_nf_state_registered); + if (!OGS_SBI_NF_INSTANCE_GET(ausf_ue->nf_types, nf_type)) + nf = ogs_sbi_nf_types_associate( + ausf_ue->nf_types, nf_type, ausf_nf_state_registered); + + if (nrf == false && nf == false) { + ogs_error("[%s] Cannot discover UDM", ausf_ue->suci); + + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_SERVICE_UNAVAILABLE, NULL, + "Cannot discover UDM", ausf_ue->suci); + + return NULL; + } + + if (nf == false) { + ogs_warn("[%s] Try to discover UDM", ausf_ue->suci); + ogs_timer_start(ausf_ue->sbi_client_wait.timer, + ausf_timer_cfg(AUSF_TIMER_SBI_CLIENT_WAIT)->duration); + + ogs_nnrf_disc_send_nf_discover( + ausf_ue->nf_types[OpenAPI_nf_type_NRF].nf_instance, + nf_type, OpenAPI_nf_type_AUSF, ausf_ue); + + return NULL; + } + + return ausf_ue->nf_types[nf_type].nf_instance; +} + +void ausf_nudm_ueau_send_get( + ausf_ue_t *ausf_ue, ogs_sbi_nf_instance_t *nf_instance) +{ + ogs_sbi_session_t *session = NULL; + ogs_sbi_request_t *request = NULL; + ogs_sbi_client_t *client = NULL; + + ogs_assert(ausf_ue); + session = ausf_ue->session; + ogs_assert(session); + ogs_assert(nf_instance); + + client = ogs_sbi_client_find_by_service_name( + nf_instance, (char *)OGS_SBI_SERVICE_NAME_NUDM_UEAU); + ogs_assert(client); + + ogs_timer_start(ausf_ue->sbi_client_wait.timer, + ausf_timer_cfg(AUSF_TIMER_SBI_CLIENT_WAIT)->duration); + + request = ausf_nudm_ueau_build_get(ausf_ue); + ogs_assert(request); + ogs_sbi_client_send_request(client, request, ausf_ue); +} + +void ausf_nudm_ueau_discover_and_send_get(ausf_ue_t *ausf_ue) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + + ogs_assert(ausf_ue); + + if (!nf_instance) + nf_instance = find_or_discover_nf_instance( + ausf_ue, OpenAPI_nf_type_UDM); + + if (!nf_instance) return; + + ausf_nudm_ueau_send_get(ausf_ue, nf_instance); +} + +void ausf_nudm_ueau_send_result_confirmation_inform( + ausf_ue_t *ausf_ue, ogs_sbi_nf_instance_t *nf_instance) +{ + ogs_sbi_session_t *session = NULL; + ogs_sbi_request_t *request = NULL; + ogs_sbi_client_t *client = NULL; + + ogs_assert(ausf_ue); + session = ausf_ue->session; + ogs_assert(session); + ogs_assert(nf_instance); + + client = ogs_sbi_client_find_by_service_name( + nf_instance, (char *)OGS_SBI_SERVICE_NAME_NUDM_UEAU); + ogs_assert(client); + + ogs_timer_start(ausf_ue->sbi_client_wait.timer, + ausf_timer_cfg(AUSF_TIMER_SBI_CLIENT_WAIT)->duration); + + request = ausf_nudm_ueau_build_result_confirmation_inform(ausf_ue); + ogs_assert(request); + ogs_sbi_client_send_request(client, request, ausf_ue); +} + +void ausf_nudm_ueau_discover_and_send_result_confirmation_inform( + ausf_ue_t *ausf_ue) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + + ogs_assert(ausf_ue); + + if (!nf_instance) + nf_instance = find_or_discover_nf_instance( + ausf_ue, OpenAPI_nf_type_UDM); + + if (!nf_instance) return; + + ausf_nudm_ueau_send_result_confirmation_inform(ausf_ue, nf_instance); +} diff --git a/src/ausf/sbi-path.h b/src/ausf/sbi-path.h new file mode 100644 index 0000000000..c436992676 --- /dev/null +++ b/src/ausf/sbi-path.h @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef AUSF_SBI_PATH_H +#define AUSF_SBI_PATH_H + +#include "nudm-build.h" + +#ifdef __cplusplus +extern "C" { +#endif + +int ausf_sbi_open(void); +void ausf_sbi_close(void); + +void ausf_sbi_setup_client_callback(ogs_sbi_nf_instance_t *nf_instance); + +void ausf_nudm_ueau_send_get( + ausf_ue_t *ausf_ue, ogs_sbi_nf_instance_t *nf_instance); +void ausf_nudm_ueau_discover_and_send_get(ausf_ue_t *ausf_ue); + +void ausf_nudm_ueau_send_result_confirmation_inform( + ausf_ue_t *ausf_ue, ogs_sbi_nf_instance_t *nf_instance); +void ausf_nudm_ueau_discover_and_send_result_confirmation_inform( + ausf_ue_t *ausf_ue); + +#ifdef __cplusplus +} +#endif + +#endif /* AUSF_SBI_PATH_H */ diff --git a/src/ausf/timer.c b/src/ausf/timer.c new file mode 100644 index 0000000000..5c6afff776 --- /dev/null +++ b/src/ausf/timer.c @@ -0,0 +1,117 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "context.h" + +static ausf_timer_cfg_t g_ausf_timer_cfg[MAX_NUM_OF_AUSF_TIMER] = { + [AUSF_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL] = + { .duration = ogs_time_from_sec(3) }, + [AUSF_TIMER_SBI_CLIENT_WAIT] = + { .duration = ogs_time_from_sec(2) }, +}; + +ausf_timer_cfg_t *ausf_timer_cfg(ausf_timer_e id) +{ + ogs_assert(id < MAX_NUM_OF_AUSF_TIMER); + return &g_ausf_timer_cfg[id]; +} + +const char *ausf_timer_get_name(ausf_timer_e id) +{ + switch (id) { + case AUSF_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL: + return "AUSF_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL"; + case AUSF_TIMER_NF_INSTANCE_HEARTBEAT_INTERVAL: + return "AUSF_TIMER_NF_INSTANCE_HEARTBEAT_INTERVAL"; + case AUSF_TIMER_NF_INSTANCE_HEARTBEAT: + return "AUSF_TIMER_NF_INSTANCE_HEARTBEAT"; + case AUSF_TIMER_NF_INSTANCE_VALIDITY: + return "AUSF_TIMER_NF_INSTANCE_VALIDITY"; + case AUSF_TIMER_SUBSCRIPTION_VALIDITY: + return "AUSF_TIMER_SUBSCRIPTION_VALIDITY"; + case AUSF_TIMER_SBI_CLIENT_WAIT: + return "AUSF_TIMER_SBI_CLIENT_WAIT"; + default: + break; + } + + return "UNKNOWN_TIMER"; +} + +static void sbi_timer_send_event(int timer_id, void *data) +{ + int rv; + ausf_event_t *e = NULL; + ogs_assert(data); + + switch (timer_id) { + case AUSF_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL: + case AUSF_TIMER_NF_INSTANCE_HEARTBEAT_INTERVAL: + case AUSF_TIMER_NF_INSTANCE_HEARTBEAT: + case AUSF_TIMER_NF_INSTANCE_VALIDITY: + case AUSF_TIMER_SUBSCRIPTION_VALIDITY: + case AUSF_TIMER_SBI_CLIENT_WAIT: + e = ausf_event_new(AUSF_EVT_SBI_TIMER); + ogs_assert(e); + e->timer_id = timer_id; + e->sbi.data = data; + break; + default: + ogs_fatal("Unknown timer id[%d]", timer_id); + ogs_assert_if_reached(); + break; + } + + rv = ogs_queue_push(ausf_self()->queue, e); + if (rv != OGS_OK) { + ogs_warn("ogs_queue_push() failed [%d] in %s", + (int)rv, ausf_timer_get_name(e->timer_id)); + ausf_event_free(e); + } +} + +void ausf_timer_nf_instance_registration_interval(void *data) +{ + sbi_timer_send_event(AUSF_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL, data); +} + +void ausf_timer_nf_instance_heartbeat_interval(void *data) +{ + sbi_timer_send_event(AUSF_TIMER_NF_INSTANCE_HEARTBEAT_INTERVAL, data); +} + +void ausf_timer_nf_instance_heartbeat(void *data) +{ + sbi_timer_send_event(AUSF_TIMER_NF_INSTANCE_HEARTBEAT, data); +} + +void ausf_timer_nf_instance_validity(void *data) +{ + sbi_timer_send_event(AUSF_TIMER_NF_INSTANCE_VALIDITY, data); +} + +void ausf_timer_subscription_validity(void *data) +{ + sbi_timer_send_event(AUSF_TIMER_SUBSCRIPTION_VALIDITY, data); +} + +void ausf_timer_sbi_client_wait_expire(void *data) +{ + sbi_timer_send_event(AUSF_TIMER_SBI_CLIENT_WAIT, data); +} diff --git a/src/ausf/timer.h b/src/ausf/timer.h new file mode 100644 index 0000000000..f117e16eaa --- /dev/null +++ b/src/ausf/timer.h @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2019 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef AUSF_TIMER_H +#define AUSF_TIMER_H + +#include "ogs-core.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* forward declaration */ +typedef enum { + AUSF_TIMER_BASE = 0, + + AUSF_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL, + AUSF_TIMER_NF_INSTANCE_HEARTBEAT_INTERVAL, + AUSF_TIMER_NF_INSTANCE_HEARTBEAT, + AUSF_TIMER_NF_INSTANCE_VALIDITY, + AUSF_TIMER_SUBSCRIPTION_VALIDITY, + AUSF_TIMER_SBI_CLIENT_WAIT, + + MAX_NUM_OF_AUSF_TIMER, + +} ausf_timer_e; + +typedef struct ausf_timer_cfg_s { + int max_count; + ogs_time_t duration; +} ausf_timer_cfg_t; + +ausf_timer_cfg_t *ausf_timer_cfg(ausf_timer_e id); + +const char *ausf_timer_get_name(ausf_timer_e id); + +void ausf_timer_nf_instance_registration_interval(void *data); +void ausf_timer_nf_instance_heartbeat_interval(void *data); +void ausf_timer_nf_instance_heartbeat(void *data); +void ausf_timer_nf_instance_validity(void *data); +void ausf_timer_subscription_validity(void *data); +void ausf_timer_sbi_client_wait_expire(void *data); + +#ifdef __cplusplus +} +#endif + +#endif /* AUSF_TIMER_H */ diff --git a/src/ausf/ue-sm.c b/src/ausf/ue-sm.c new file mode 100644 index 0000000000..94c830a896 --- /dev/null +++ b/src/ausf/ue-sm.c @@ -0,0 +1,188 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "sbi-path.h" +#include "nnrf-handler.h" +#include "nausf-handler.h" +#include "nudm-handler.h" + +void ausf_ue_state_initial(ogs_fsm_t *s, ausf_event_t *e) +{ + ausf_ue_t *ausf_ue = NULL; + + ogs_assert(s); + ogs_assert(e); + + ausf_sm_debug(e); + + ausf_ue = e->ausf_ue; + ogs_assert(ausf_ue); + + OGS_FSM_TRAN(s, &ausf_ue_state_operational); +} + +void ausf_ue_state_final(ogs_fsm_t *s, ausf_event_t *e) +{ + ausf_ue_t *ausf_ue = NULL; + + ogs_assert(s); + ogs_assert(e); + + ausf_sm_debug(e); + + ausf_ue = e->ausf_ue; + ogs_assert(ausf_ue); +} + +void ausf_ue_state_operational(ogs_fsm_t *s, ausf_event_t *e) +{ + bool handled; + ausf_ue_t *ausf_ue = NULL; + + ogs_sbi_server_t *server = NULL; + ogs_sbi_session_t *session = NULL; + ogs_sbi_message_t *message = NULL; + + ogs_assert(s); + ogs_assert(e); + + ausf_sm_debug(e); + + ausf_ue = e->ausf_ue; + ogs_assert(ausf_ue); + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + break; + + case OGS_FSM_EXIT_SIG: + break; + + case AUSF_EVT_SBI_SERVER: + message = e->sbi.message; + ogs_assert(message); + session = e->sbi.session; + ogs_assert(session); + server = e->sbi.server; + ogs_assert(server); + + SWITCH(message->h.method) + CASE(OGS_SBI_HTTP_METHOD_POST) + handled = ausf_nausf_auth_handle_authenticate( + ausf_ue, message); + if (!handled) { + ogs_error("[%s] Cannot handle SBI message", + ausf_ue->suci); + OGS_FSM_TRAN(s, ausf_ue_state_exception); + } + break; + CASE(OGS_SBI_HTTP_METHOD_PUT) + handled = ausf_nausf_auth_handle_authenticate_confirmation( + ausf_ue, message); + if (!handled) { + ogs_error("[%s] Cannot handle SBI message", + ausf_ue->suci); + OGS_FSM_TRAN(s, ausf_ue_state_exception); + } + break; + DEFAULT + ogs_error("[%s] Invalid HTTP method [%s]", + ausf_ue->suci, message->h.method); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, message, + "Invalid HTTP method", message->h.method); + END + + break; + + case AUSF_EVT_SBI_CLIENT: + message = e->sbi.message; + ogs_assert(message); + ausf_ue = e->sbi.data; + ogs_assert(ausf_ue); + session = ausf_ue->session; + ogs_assert(session); + + SWITCH(message->h.service.name) + CASE(OGS_SBI_SERVICE_NAME_NUDM_UEAU) + ogs_timer_stop(ausf_ue->sbi_client_wait.timer); + + if (message->res_status != OGS_SBI_HTTP_STATUS_OK && + message->res_status != OGS_SBI_HTTP_STATUS_CREATED) { + ogs_error("[%s] HTTP response error [%d]", + ausf_ue->suci, message->res_status); + ogs_sbi_server_send_error( + session, message->res_status, + NULL, "HTTP response error", ausf_ue->suci); + break; + } + + SWITCH(message->h.resource.component[1]) + CASE(OGS_SBI_RESOURCE_NAME_SECURITY_INFORMATION) + ausf_nudm_ueau_handle_get(ausf_ue, message); + break; + + CASE(OGS_SBI_RESOURCE_NAME_AUTH_EVENTS) + ausf_nudm_ueau_handle_result_confirmation_inform( + ausf_ue, message); + break; + + DEFAULT + ogs_error("[%s] Invalid HTTP method [%s]", + ausf_ue->suci, message->h.method); + ogs_assert_if_reached(); + END + break; + + DEFAULT + ogs_error("Invalid API name [%s]", message->h.service.name); + ogs_assert_if_reached(); + END + break; + + + default: + ogs_error("[%s] Unknown event %s", ausf_ue->suci, ausf_event_get_name(e)); + break; + } +} + +void ausf_ue_state_exception(ogs_fsm_t *s, ausf_event_t *e) +{ + ausf_ue_t *ausf_ue = NULL; + ogs_assert(s); + ogs_assert(e); + + ausf_sm_debug(e); + + ausf_ue = e->ausf_ue; + ogs_assert(ausf_ue); + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + break; + + case OGS_FSM_EXIT_SIG: + break; + + default: + ogs_error("[%s] Unknown event %s", ausf_ue->suci, ausf_event_get_name(e)); + break; + } +} diff --git a/src/hss/hss-auc.c b/src/hss/hss-auc.c index 70ed2f9731..7bc1a6bdee 100644 --- a/src/hss/hss-auc.c +++ b/src/hss/hss-auc.c @@ -53,13 +53,13 @@ void hss_auc_sqn( uint8_t *sqn_ms, uint8_t *mac_s) { int i; - uint8_t ak[HSS_AK_LEN]; + uint8_t ak[OGS_AK_LEN]; uint8_t amf[2] = { 0, 0 }; const uint8_t *rand = auts; const uint8_t *conc_sqn_ms = auts + OGS_RAND_LEN; milenage_f2345(opc, k, rand, NULL, NULL, NULL, NULL, ak); - for (i = 0; i < HSS_SQN_LEN; i++) + for (i = 0; i < OGS_SQN_LEN; i++) sqn_ms[i] = ak[i] ^ conc_sqn_ms[i]; milenage_f1(opc, k, auts, sqn_ms, amf, NULL, mac_s); } diff --git a/src/hss/hss-auc.h b/src/hss/hss-auc.h index 130818df0c..4ca30efc45 100644 --- a/src/hss/hss-auc.h +++ b/src/hss/hss-auc.h @@ -22,9 +22,6 @@ #include "ogs-core.h" -#define HSS_SQN_LEN 6 -#define HSS_AK_LEN 6 - #ifdef __cplusplus extern "C" { #endif diff --git a/src/hss/hss-context.c b/src/hss/hss-context.c index 95d3c3d7fa..a052a6ac13 100644 --- a/src/hss/hss-context.c +++ b/src/hss/hss-context.c @@ -193,12 +193,15 @@ int hss_context_parse_config(void) YAML_MAPPING_NODE) { memcpy(&conn_iter, &conn_array, sizeof(ogs_yaml_iter_t)); - } else if (ogs_yaml_iter_type(&conn_array) == + } else if (ogs_yaml_iter_type( + &conn_array) == YAML_SEQUENCE_NODE) { if (!ogs_yaml_iter_next(&conn_array)) break; - ogs_yaml_iter_recurse(&conn_array, &conn_iter); - } else if (ogs_yaml_iter_type(&conn_array) == + ogs_yaml_iter_recurse( + &conn_array, &conn_iter); + } else if (ogs_yaml_iter_type( + &conn_array) == YAML_SCALAR_NODE) { break; } else @@ -212,13 +215,15 @@ int hss_context_parse_config(void) identity = ogs_yaml_iter_value( &conn_iter); } else if (!strcmp(conn_key, "addr")) { - addr = ogs_yaml_iter_value(&conn_iter); + addr = ogs_yaml_iter_value( + &conn_iter); } else if (!strcmp(conn_key, "port")) { const char *v = ogs_yaml_iter_value(&conn_iter); if (v) port = atoi(v); } else - ogs_warn("unknown key `%s`", conn_key); + ogs_warn("unknown key `%s`", + conn_key); } if (identity && addr) { @@ -288,7 +293,7 @@ int hss_db_auth_info( const bson_t *document; bson_iter_t iter; bson_iter_t inner_iter; - char buf[HSS_KEY_LEN]; + char buf[OGS_KEY_LEN]; char *utf8 = NULL; uint32_t length = 0; @@ -334,17 +339,17 @@ int hss_db_auth_info( if (!strcmp(key, "k") && BSON_ITER_HOLDS_UTF8(&inner_iter)) { utf8 = (char *)bson_iter_utf8(&inner_iter, &length); - memcpy(auth_info->k, OGS_HEX(utf8, length, buf), HSS_KEY_LEN); + memcpy(auth_info->k, OGS_HEX(utf8, length, buf), OGS_KEY_LEN); } else if (!strcmp(key, "opc") && BSON_ITER_HOLDS_UTF8(&inner_iter)) { utf8 = (char *)bson_iter_utf8(&inner_iter, &length); auth_info->use_opc = 1; - memcpy(auth_info->opc, OGS_HEX(utf8, length, buf), HSS_KEY_LEN); + memcpy(auth_info->opc, OGS_HEX(utf8, length, buf), OGS_KEY_LEN); } else if (!strcmp(key, "op") && BSON_ITER_HOLDS_UTF8(&inner_iter)) { utf8 = (char *)bson_iter_utf8(&inner_iter, &length); - memcpy(auth_info->op, OGS_HEX(utf8, length, buf), HSS_KEY_LEN); + memcpy(auth_info->op, OGS_HEX(utf8, length, buf), OGS_KEY_LEN); } else if (!strcmp(key, "amf") && BSON_ITER_HOLDS_UTF8(&inner_iter)) { utf8 = (char *)bson_iter_utf8(&inner_iter, &length); - memcpy(auth_info->amf, OGS_HEX(utf8, length, buf), HSS_AMF_LEN); + memcpy(auth_info->amf, OGS_HEX(utf8, length, buf), OGS_AMF_LEN); } else if (!strcmp(key, "rand") && BSON_ITER_HOLDS_UTF8(&inner_iter)) { utf8 = (char *)bson_iter_utf8(&inner_iter, &length); memcpy(auth_info->rand, OGS_HEX(utf8, length, buf), OGS_RAND_LEN); @@ -372,7 +377,8 @@ int hss_db_update_rand_and_sqn( char printable_rand[128]; ogs_assert(rand); - ogs_hex_to_ascii(rand, OGS_RAND_LEN, printable_rand, sizeof(printable_rand)); + ogs_hex_to_ascii(rand, OGS_RAND_LEN, + printable_rand, sizeof(printable_rand)); ogs_thread_mutex_lock(&self.db_lock); @@ -404,7 +410,7 @@ int hss_db_increment_sqn(char *imsi_bcd) bson_t *query = NULL; bson_t *update = NULL; bson_error_t error; - uint64_t max_sqn = HSS_MAX_SQN; + uint64_t max_sqn = OGS_MAX_SQN; ogs_thread_mutex_lock(&self.db_lock); diff --git a/src/hss/hss-context.h b/src/hss/hss-context.h index f1b6fdebc8..19790e1db7 100644 --- a/src/hss/hss-context.h +++ b/src/hss/hss-context.h @@ -27,22 +27,17 @@ extern "C" { #endif -#define HSS_KEY_LEN 16 -#define HSS_AMF_LEN 2 - -#define HSS_MAX_SQN 0x7ffffffffff - extern int __hss_log_domain; #undef OGS_LOG_DOMAIN #define OGS_LOG_DOMAIN __hss_log_domain typedef struct _hss_db_auth_info_t { - uint8_t k[HSS_KEY_LEN]; + uint8_t k[OGS_KEY_LEN]; uint8_t use_opc; - uint8_t opc[HSS_KEY_LEN]; - uint8_t op[HSS_KEY_LEN]; - uint8_t amf[HSS_AMF_LEN]; + uint8_t opc[OGS_KEY_LEN]; + uint8_t op[OGS_KEY_LEN]; + uint8_t amf[OGS_AMF_LEN]; uint8_t rand[OGS_RAND_LEN]; uint64_t sqn; } hss_db_auth_info_t; diff --git a/src/hss/hss-fd-path.c b/src/hss/hss-fd-path.c index df2de868ff..bc442dec99 100644 --- a/src/hss/hss-fd-path.c +++ b/src/hss/hss-fd-path.c @@ -53,12 +53,12 @@ static int hss_ogs_diam_s6a_air_cb( struct msg **msg, struct avp *avp, union avp_value val; char imsi_bcd[OGS_MAX_IMSI_BCD_LEN+1]; - uint8_t opc[HSS_KEY_LEN]; - uint8_t sqn[HSS_SQN_LEN]; + uint8_t opc[OGS_KEY_LEN]; + uint8_t sqn[OGS_SQN_LEN]; uint8_t autn[OGS_AUTN_LEN]; - uint8_t ik[HSS_KEY_LEN]; - uint8_t ck[HSS_KEY_LEN]; - uint8_t ak[HSS_AK_LEN]; + uint8_t ik[OGS_KEY_LEN]; + uint8_t ck[OGS_KEY_LEN]; + uint8_t ak[OGS_AK_LEN]; uint8_t xres[OGS_MAX_RES_LEN]; uint8_t kasme[OGS_SHA256_DIGEST_SIZE]; size_t xres_len = 8; @@ -107,28 +107,29 @@ static int hss_ogs_diam_s6a_air_cb( struct msg **msg, struct avp *avp, ret = fd_msg_search_avp(qry, ogs_diam_s6a_req_eutran_auth_info, &avp); ogs_assert(ret == 0); if (avp) { - ret = fd_avp_search_avp(avp, ogs_diam_s6a_re_synchronization_info, &avpch); + ret = fd_avp_search_avp( + avp, ogs_diam_s6a_re_synchronization_info, &avpch); ogs_assert(ret == 0); if (avpch) { ret = fd_msg_avp_hdr(avpch, &hdr); ogs_assert(ret == 0); hss_auc_sqn(opc, auth_info.k, hdr->avp_value->os.data, sqn, mac_s); if (memcmp(mac_s, hdr->avp_value->os.data + - OGS_RAND_LEN + HSS_SQN_LEN, MAC_S_LEN) == 0) { + OGS_RAND_LEN + OGS_SQN_LEN, MAC_S_LEN) == 0) { ogs_random(auth_info.rand, OGS_RAND_LEN); - auth_info.sqn = ogs_buffer_to_uint64(sqn, HSS_SQN_LEN); + auth_info.sqn = ogs_buffer_to_uint64(sqn, OGS_SQN_LEN); /* 33.102 C.3.4 Guide : IND + 1 */ - auth_info.sqn = (auth_info.sqn + 32 + 1) & HSS_MAX_SQN; + auth_info.sqn = (auth_info.sqn + 32 + 1) & OGS_MAX_SQN; } else { ogs_error("Re-synch MAC failed for IMSI:`%s`", imsi_bcd); ogs_log_print(OGS_LOG_ERROR, "MAC_S: "); ogs_log_hexdump(OGS_LOG_ERROR, mac_s, MAC_S_LEN); ogs_log_hexdump(OGS_LOG_ERROR, (void*)(hdr->avp_value->os.data + - OGS_RAND_LEN + HSS_SQN_LEN), + OGS_RAND_LEN + OGS_SQN_LEN), MAC_S_LEN); ogs_log_print(OGS_LOG_ERROR, "SQN: "); - ogs_log_hexdump(OGS_LOG_ERROR, sqn, HSS_SQN_LEN); + ogs_log_hexdump(OGS_LOG_ERROR, sqn, OGS_SQN_LEN); result_code = OGS_DIAM_S6A_AUTHENTICATION_DATA_UNAVAILABLE; goto out; } @@ -158,7 +159,7 @@ static int hss_ogs_diam_s6a_air_cb( struct msg **msg, struct avp *avp, #endif milenage_generate(opc, auth_info.amf, auth_info.k, - ogs_uint64_to_buffer(auth_info.sqn, HSS_SQN_LEN, sqn), auth_info.rand, + ogs_uint64_to_buffer(auth_info.sqn, OGS_SQN_LEN, sqn), auth_info.rand, autn, ik, ck, ak, xres, &xres_len); hss_auc_kasme(ck, ik, hdr->avp_value->os.data, sqn, ak, kasme); @@ -171,7 +172,7 @@ static int hss_ogs_diam_s6a_air_cb( struct msg **msg, struct avp *avp, ret = fd_msg_avp_new(ogs_diam_s6a_rand, 0, &avp_rand); ogs_assert(ret == 0); val.os.data = auth_info.rand; - val.os.len = HSS_KEY_LEN; + val.os.len = OGS_KEY_LEN; ret = fd_msg_avp_setvalue(avp_rand, &val); ogs_assert(ret == 0); ret = fd_msg_avp_add(avp_e_utran_vector, MSG_BRW_LAST_CHILD, avp_rand); @@ -223,7 +224,8 @@ static int hss_ogs_diam_s6a_air_cb( struct msg **msg, struct avp *avp, ogs_assert(ret == 0); /* Set Vendor-Specific-Application-Id AVP */ - ret = ogs_diam_message_vendor_specific_appid_set(ans, OGS_DIAM_S6A_APPLICATION_ID); + ret = ogs_diam_message_vendor_specific_appid_set( + ans, OGS_DIAM_S6A_APPLICATION_ID); ogs_assert(ret == 0); /* Send the answer */ @@ -253,7 +255,8 @@ out: ogs_assert(ret == 0); /* Set Vendor-Specific-Application-Id AVP */ - ret = ogs_diam_message_vendor_specific_appid_set(ans, OGS_DIAM_S6A_APPLICATION_ID); + ret = ogs_diam_message_vendor_specific_appid_set( + ans, OGS_DIAM_S6A_APPLICATION_ID); ogs_assert(ret == 0); ret = fd_msg_send(msg, NULL, NULL); @@ -361,7 +364,8 @@ static int hss_ogs_diam_s6a_ulr_cb( struct msg **msg, struct avp *avp, ogs_assert(ret == 0); } - ret = fd_msg_avp_new(ogs_diam_s6a_subscriber_status, 0, &avp_subscriber_status); + ret = fd_msg_avp_new( + ogs_diam_s6a_subscriber_status, 0, &avp_subscriber_status); ogs_assert(ret == 0); val.i32 = subscription_data.subscriber_status; ret = fd_msg_avp_setvalue(avp_subscriber_status, &val); @@ -381,7 +385,8 @@ static int hss_ogs_diam_s6a_ulr_cb( struct msg **msg, struct avp *avp, /* Set the AMBR */ ret = fd_msg_avp_new(ogs_diam_s6a_ambr, 0, &avp_ambr); ogs_assert(ret == 0); - ret = fd_msg_avp_new(ogs_diam_s6a_max_bandwidth_ul, 0, &avp_max_bandwidth_ul); + ret = fd_msg_avp_new( + ogs_diam_s6a_max_bandwidth_ul, 0, &avp_max_bandwidth_ul); ogs_assert(ret == 0); val.u32 = subscription_data.ambr.uplink; ret = fd_msg_avp_setvalue(avp_max_bandwidth_ul, &val); @@ -389,7 +394,8 @@ static int hss_ogs_diam_s6a_ulr_cb( struct msg **msg, struct avp *avp, ret = fd_msg_avp_add( avp_ambr, MSG_BRW_LAST_CHILD, avp_max_bandwidth_ul); ogs_assert(ret == 0); - ret = fd_msg_avp_new(ogs_diam_s6a_max_bandwidth_dl, 0, &avp_max_bandwidth_dl); + ret = fd_msg_avp_new( + ogs_diam_s6a_max_bandwidth_dl, 0, &avp_max_bandwidth_dl); ogs_assert(ret == 0); val.u32 = subscription_data.ambr.downlink; ret = fd_msg_avp_setvalue(avp_max_bandwidth_dl, &val); @@ -545,11 +551,13 @@ static int hss_ogs_diam_s6a_ulr_cb( struct msg **msg, struct avp *avp, ogs_assert(ret == 0); /* Set Allocation retention priority */ - ret = fd_msg_avp_new(ogs_diam_s6a_allocation_retention_priority, 0, + ret = fd_msg_avp_new( + ogs_diam_s6a_allocation_retention_priority, 0, &allocation_retention_priority); ogs_assert(ret == 0); - ret = fd_msg_avp_new(ogs_diam_s6a_priority_level, 0, &priority_level); + ret = fd_msg_avp_new( + ogs_diam_s6a_priority_level, 0, &priority_level); ogs_assert(ret == 0); val.u32 = pdn->qos.arp.priority_level; ret = fd_msg_avp_setvalue(priority_level, &val); @@ -668,7 +676,8 @@ static int hss_ogs_diam_s6a_ulr_cb( struct msg **msg, struct avp *avp, } /* Set Vendor-Specific-Application-Id AVP */ - ret = ogs_diam_message_vendor_specific_appid_set(ans, OGS_DIAM_S6A_APPLICATION_ID); + ret = ogs_diam_message_vendor_specific_appid_set( + ans, OGS_DIAM_S6A_APPLICATION_ID); ogs_assert(ret == 0); /* Send the answer */ @@ -698,7 +707,8 @@ out: ogs_assert(ret == 0); /* Set Vendor-Specific-Application-Id AVP */ - ret = ogs_diam_message_vendor_specific_appid_set(ans, OGS_DIAM_S6A_APPLICATION_ID); + ret = ogs_diam_message_vendor_specific_appid_set( + ans, OGS_DIAM_S6A_APPLICATION_ID); ogs_assert(ret == 0); ret = fd_msg_send(msg, NULL, NULL); diff --git a/src/meson.build b/src/meson.build index 546aa95e83..9c7e37bdf9 100644 --- a/src/meson.build +++ b/src/meson.build @@ -28,6 +28,9 @@ subdir('pgw') subdir('pcrf') subdir('nrf') +subdir('udr') +subdir('udm') +subdir('ausf') subdir('upf') subdir('smf') subdir('amf') diff --git a/src/mme/emm-build.c b/src/mme/emm-build.c index 67fc49fb73..927ac75eb2 100644 --- a/src/mme/emm-build.c +++ b/src/mme/emm-build.c @@ -18,7 +18,6 @@ */ #include "nas-security.h" -#include "mme-kdf.h" #include "emm-build.h" #include "mme-sm.h" @@ -300,9 +299,9 @@ ogs_pkbuf_t *emm_build_security_mode_command(mme_ue_t *mme_ue) return NULL; } - mme_kdf_nas(MME_KDF_NAS_INT_ALG, mme_ue->selected_int_algorithm, + ogs_kdf_nas_eps(OGS_KDF_NAS_INT_ALG, mme_ue->selected_int_algorithm, mme_ue->kasme, mme_ue->knas_int); - mme_kdf_nas(MME_KDF_NAS_ENC_ALG, mme_ue->selected_enc_algorithm, + ogs_kdf_nas_eps(OGS_KDF_NAS_ENC_ALG, mme_ue->selected_enc_algorithm, mme_ue->kasme, mme_ue->knas_enc); return nas_eps_security_encode(mme_ue, &message); diff --git a/src/mme/emm-handler.c b/src/mme/emm-handler.c index 0d94b7b116..bc572efdcd 100644 --- a/src/mme/emm-handler.c +++ b/src/mme/emm-handler.c @@ -20,7 +20,6 @@ #include "mme-event.h" #include "mme-sm.h" -#include "mme-kdf.h" #include "nas-security.h" #include "s1ap-path.h" @@ -84,8 +83,8 @@ int emm_handle_attach_request( CLEAR_EPS_BEARER_ID(mme_ue); CLEAR_SERVICE_INDICATOR(mme_ue); if (SECURITY_CONTEXT_IS_VALID(mme_ue)) { - mme_kdf_enb(mme_ue->kasme, mme_ue->ul_count.i32, mme_ue->kenb); - mme_kdf_nh(mme_ue->kasme, mme_ue->kenb, mme_ue->nh); + ogs_kdf_kenb(mme_ue->kasme, mme_ue->ul_count.i32, mme_ue->kenb); + ogs_kdf_nh_enb(mme_ue->kasme, mme_ue->kenb, mme_ue->nh); mme_ue->nhcc = 1; } @@ -158,7 +157,7 @@ int emm_handle_attach_request( eps_mobile_identity->length); memcpy(&mme_ue->nas_mobile_identity_imsi, &eps_mobile_identity->imsi, eps_mobile_identity->length); - ogs_nas_imsi_to_bcd( + ogs_nas_eps_imsi_to_bcd( &eps_mobile_identity->imsi, eps_mobile_identity->length, imsi_bcd); mme_ue_set_imsi(mme_ue, imsi_bcd); @@ -179,7 +178,7 @@ int emm_handle_attach_request( nas_guti.mme_code, nas_guti.m_tmsi, MME_UE_HAVE_IMSI(mme_ue) - ? mme_ue->imsi_bcd : "Unknown"); + ? mme_ue->imsi_bcd : "Unknown IMSI"); break; default: ogs_warn("Not implemented[%d]", eps_mobile_identity->imsi.type); @@ -317,7 +316,7 @@ int emm_handle_identity_response( } memcpy(&mme_ue->nas_mobile_identity_imsi, &mobile_identity->imsi, mobile_identity->length); - ogs_nas_imsi_to_bcd( + ogs_nas_eps_imsi_to_bcd( &mobile_identity->imsi, mobile_identity->length, imsi_bcd); mme_ue_set_imsi(mme_ue, imsi_bcd); @@ -406,8 +405,8 @@ int emm_handle_service_request( CLEAR_MME_UE_ALL_TIMERS(mme_ue); if (SECURITY_CONTEXT_IS_VALID(mme_ue)) { - mme_kdf_enb(mme_ue->kasme, mme_ue->ul_count.i32, mme_ue->kenb); - mme_kdf_nh(mme_ue->kasme, mme_ue->kenb, mme_ue->nh); + ogs_kdf_kenb(mme_ue->kasme, mme_ue->ul_count.i32, mme_ue->kenb); + ogs_kdf_nh_enb(mme_ue->kasme, mme_ue->kenb, mme_ue->nh); mme_ue->nhcc = 1; } diff --git a/src/mme/emm-sm.c b/src/mme/emm-sm.c index 4844de0471..57c96f4e04 100644 --- a/src/mme/emm-sm.c +++ b/src/mme/emm-sm.c @@ -19,7 +19,6 @@ #include "mme-event.h" #include "mme-timer.h" -#include "mme-kdf.h" #include "s1ap-handler.h" #include "mme-fd-path.h" #include "emm-handler.h" @@ -709,17 +708,12 @@ void emm_state_security_mode(ogs_fsm_t *s, mme_event_t *e) break; } - rv = emm_handle_security_mode_complete( + emm_handle_security_mode_complete( mme_ue, &message->emm.security_mode_complete); - if (rv != OGS_OK) { - ogs_error("emm_handle_security_mode_complete() failed"); - OGS_FSM_TRAN(s, emm_state_exception); - return; - } - mme_kdf_enb(mme_ue->kasme, mme_ue->ul_count.i32, + ogs_kdf_kenb(mme_ue->kasme, mme_ue->ul_count.i32, mme_ue->kenb); - mme_kdf_nh(mme_ue->kasme, mme_ue->kenb, mme_ue->nh); + ogs_kdf_nh_enb(mme_ue->kasme, mme_ue->kenb, mme_ue->nh); mme_ue->nhcc = 1; mme_s6a_send_ulr(mme_ue); diff --git a/src/mme/meson.build b/src/mme/meson.build index 6f822e6fcf..ca6a5edf15 100644 --- a/src/mme/meson.build +++ b/src/mme/meson.build @@ -16,7 +16,6 @@ # along with this program. If not, see . libmme_sources = files(''' - mme-kdf.h mme-event.h mme-timer.h mme-context.h @@ -43,7 +42,6 @@ libmme_sources = files(''' mme-sm.h mme-path.h - mme-kdf.c mme-init.c mme-event.c mme-timer.c diff --git a/src/mme/mme-context.c b/src/mme/mme-context.c index a73b796f0d..e983d440de 100644 --- a/src/mme/mme-context.c +++ b/src/mme/mme-context.c @@ -2356,7 +2356,7 @@ mme_ue_t *mme_ue_find_by_message(ogs_nas_eps_message_t *message) switch(eps_mobile_identity->imsi.type) { case OGS_NAS_EPS_MOBILE_IDENTITY_IMSI: - ogs_nas_imsi_to_bcd( + ogs_nas_eps_imsi_to_bcd( &eps_mobile_identity->imsi, eps_mobile_identity->length, imsi_bcd); diff --git a/src/mme/mme-kdf.c b/src/mme/mme-kdf.c deleted file mode 100644 index 5a126ec29b..0000000000 --- a/src/mme/mme-kdf.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2019 by Sukchan Lee - * - * This file is part of Open5GS. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "ogs-crypt.h" - -#include "mme-kdf.h" - -void mme_kdf_nas(uint8_t algorithm_type_distinguishers, - uint8_t algorithm_identity, const uint8_t *kasme, uint8_t *knas) -{ - uint8_t s[7]; - uint8_t out[32]; - - s[0] = 0x15; /* FC Value */ - - s[1] = algorithm_type_distinguishers; - s[2] = 0x00; - s[3] = 0x01; - - s[4] = algorithm_identity; - s[5] = 0x00; - s[6] = 0x01; - - ogs_hmac_sha256(kasme, 32, s, 7, out, 32); - memcpy(knas, out+16, 16); -} - -void mme_kdf_enb(const uint8_t *kasme, uint32_t ul_count, uint8_t *kenb) -{ - uint8_t s[7]; - - s[0] = 0x11; /* FC Value */ - - ul_count = htobe32(ul_count); - memcpy(s+1, &ul_count, 4); - - s[5] = 0x00; - s[6] = 0x04; - - ogs_hmac_sha256(kasme, 32, s, 7, kenb, 32); -} - -void mme_kdf_nh(const uint8_t *kasme, const uint8_t *sync_input, uint8_t *kenb) -{ - uint8_t s[35]; - - s[0] = 0x12; /* FC Value */ - - memcpy(s+1, sync_input, 32); - - s[33] = 0x00; - s[34] = 0x20; - - ogs_hmac_sha256(kasme, 32, s, 35, kenb, 32); -} diff --git a/src/mme/mme-sm.c b/src/mme/mme-sm.c index 27687c7751..023f5bdb88 100644 --- a/src/mme/mme-sm.c +++ b/src/mme/mme-sm.c @@ -241,7 +241,7 @@ void mme_state_operational(ogs_fsm_t *s, mme_event_t *e) e->s1ap_message = &s1ap_message; ogs_fsm_dispatch(&enb->sm, e); } else { - ogs_warn("Cannot process S1AP message"); + ogs_warn("Cannot decode S1AP message"); s1ap_send_error_indication( enb, NULL, NULL, S1AP_Cause_PR_protocol, S1AP_CauseProtocol_abstract_syntax_error_falsely_constructed_message); diff --git a/src/mme/nas-path.h b/src/mme/nas-path.h index 6d940ea4ce..8f23ba748f 100644 --- a/src/mme/nas-path.h +++ b/src/mme/nas-path.h @@ -17,8 +17,8 @@ * along with this program. If not, see . */ -#ifndef NAS_PATH_H -#define NAS_PATH_H +#ifndef NAS_EPS_PATH_H +#define NAS_EPS_PATH_H #include "mme-context.h" @@ -76,4 +76,4 @@ void nas_eps_send_downlink_nas_transport( } #endif -#endif /* NAS_PATH_H */ +#endif /* NAS_EPS_PATH_H */ diff --git a/src/mme/nas-security.h b/src/mme/nas-security.h index 6c6ecae3c6..23ae524a7a 100644 --- a/src/mme/nas-security.h +++ b/src/mme/nas-security.h @@ -17,8 +17,8 @@ * along with this program. If not, see . */ -#ifndef NAS_SECURITY_H -#define NAS_SECURITY_H +#ifndef NAS_EPS_SECURITY_H +#define NAS_EPS_SECURITY_H #include "ogs-crypt.h" #include "mme-context.h" @@ -36,5 +36,5 @@ int nas_eps_security_decode(mme_ue_t *mme_ue, } #endif -#endif /* NAS_SECURITY_H */ +#endif /* NAS_EPS_SECURITY_H */ diff --git a/src/mme/s1ap-build.c b/src/mme/s1ap-build.c index 3cccd3ea3e..c6d11b384f 100644 --- a/src/mme/s1ap-build.c +++ b/src/mme/s1ap-build.c @@ -19,7 +19,6 @@ #include "mme-context.h" -#include "mme-kdf.h" #include "mme-sm.h" #include "s1ap-build.h" diff --git a/src/mme/s1ap-handler.c b/src/mme/s1ap-handler.c index 35db36e2b3..124d3d3b17 100644 --- a/src/mme/s1ap-handler.c +++ b/src/mme/s1ap-handler.c @@ -19,7 +19,6 @@ #include "mme-event.h" -#include "mme-kdf.h" #include "s1ap-path.h" #include "nas-path.h" #include "mme-gtp-path.h" @@ -1129,7 +1128,7 @@ void s1ap_handle_path_switch_request( if (SECURITY_CONTEXT_IS_VALID(mme_ue)) { mme_ue->nhcc++; - mme_kdf_nh(mme_ue->kasme, mme_ue->nh, mme_ue->nh); + ogs_kdf_nh_enb(mme_ue->kasme, mme_ue->nh, mme_ue->nh); } else { s1apbuf = s1ap_build_path_switch_failure( *ENB_UE_S1AP_ID, *MME_UE_S1AP_ID, @@ -1394,7 +1393,7 @@ void s1ap_handle_handover_required(mme_enb_t *enb, ogs_s1ap_message_t *message) if (SECURITY_CONTEXT_IS_VALID(mme_ue)) { mme_ue->nhcc++; - mme_kdf_nh(mme_ue->kasme, mme_ue->nh, mme_ue->nh); + ogs_kdf_nh_enb(mme_ue->kasme, mme_ue->nh, mme_ue->nh); } else { ogs_assert(Cause); diff --git a/src/mme/sgsap-handler.c b/src/mme/sgsap-handler.c index c725b581ec..5e19158b37 100644 --- a/src/mme/sgsap-handler.c +++ b/src/mme/sgsap-handler.c @@ -79,7 +79,7 @@ void sgsap_handle_location_update_accept(mme_vlr_t *vlr, ogs_pkbuf_t *pkbuf) goto error; if (nas_mobile_identity_imsi->type == OGS_NAS_MOBILE_IDENTITY_IMSI) { - ogs_nas_imsi_to_bcd(nas_mobile_identity_imsi, + ogs_nas_eps_imsi_to_bcd(nas_mobile_identity_imsi, nas_mobile_identity_imsi_len, imsi_bcd); mme_ue = mme_ue_find_by_imsi_bcd(imsi_bcd); } else @@ -167,7 +167,7 @@ void sgsap_handle_location_update_reject(mme_vlr_t *vlr, ogs_pkbuf_t *pkbuf) goto error; if (nas_mobile_identity_imsi->type == OGS_NAS_MOBILE_IDENTITY_IMSI) { - ogs_nas_imsi_to_bcd(nas_mobile_identity_imsi, + ogs_nas_eps_imsi_to_bcd(nas_mobile_identity_imsi, nas_mobile_identity_imsi_len, imsi_bcd); mme_ue = mme_ue_find_by_imsi_bcd(imsi_bcd); } else @@ -239,7 +239,7 @@ void sgsap_handle_detach_ack(mme_vlr_t *vlr, ogs_pkbuf_t *pkbuf) ogs_expect_or_return(nas_mobile_identity_imsi_len == SGSAP_IE_IMSI_LEN); if (nas_mobile_identity_imsi->type == OGS_NAS_MOBILE_IDENTITY_IMSI) { - ogs_nas_imsi_to_bcd(nas_mobile_identity_imsi, + ogs_nas_eps_imsi_to_bcd(nas_mobile_identity_imsi, nas_mobile_identity_imsi_len, imsi_bcd); mme_ue = mme_ue_find_by_imsi_bcd(imsi_bcd); } else @@ -305,7 +305,7 @@ void sgsap_handle_paging_request(mme_vlr_t *vlr, ogs_pkbuf_t *pkbuf) if (nas_mobile_identity_imsi->type == OGS_NAS_MOBILE_IDENTITY_IMSI) { - ogs_nas_imsi_to_bcd(nas_mobile_identity_imsi, + ogs_nas_eps_imsi_to_bcd(nas_mobile_identity_imsi, nas_mobile_identity_imsi_len, imsi_bcd); mme_ue = mme_ue_find_by_imsi_bcd(imsi_bcd); } else @@ -408,7 +408,7 @@ void sgsap_handle_downlink_unitdata(mme_vlr_t *vlr, ogs_pkbuf_t *pkbuf) if (nas_mobile_identity_imsi->type == OGS_NAS_MOBILE_IDENTITY_IMSI) { - ogs_nas_imsi_to_bcd(nas_mobile_identity_imsi, + ogs_nas_eps_imsi_to_bcd(nas_mobile_identity_imsi, nas_mobile_identity_imsi_len, imsi_bcd); mme_ue = mme_ue_find_by_imsi_bcd(imsi_bcd); } else @@ -476,7 +476,7 @@ void sgsap_handle_release_request(mme_vlr_t *vlr, ogs_pkbuf_t *pkbuf) if (nas_mobile_identity_imsi->type == OGS_NAS_MOBILE_IDENTITY_IMSI) { - ogs_nas_imsi_to_bcd(nas_mobile_identity_imsi, + ogs_nas_eps_imsi_to_bcd(nas_mobile_identity_imsi, nas_mobile_identity_imsi_len, imsi_bcd); mme_ue = mme_ue_find_by_imsi_bcd(imsi_bcd); } else @@ -533,7 +533,7 @@ void sgsap_handle_mm_information_request(mme_vlr_t *vlr, ogs_pkbuf_t *pkbuf) if (nas_mobile_identity_imsi->type == OGS_NAS_MOBILE_IDENTITY_IMSI) { - ogs_nas_imsi_to_bcd(nas_mobile_identity_imsi, + ogs_nas_eps_imsi_to_bcd(nas_mobile_identity_imsi, nas_mobile_identity_imsi_len, imsi_bcd); mme_ue = mme_ue_find_by_imsi_bcd(imsi_bcd); } else diff --git a/src/nrf/nf-sm.c b/src/nrf/nf-sm.c index 01154534a9..649334dcdd 100644 --- a/src/nrf/nf-sm.c +++ b/src/nrf/nf-sm.c @@ -84,7 +84,6 @@ void nrf_nf_state_will_register(ogs_fsm_t *s, nrf_event_t *e) bool handled; ogs_sbi_nf_instance_t *nf_instance = NULL; - ogs_sbi_server_t *server = NULL; ogs_sbi_session_t *session = NULL; ogs_sbi_message_t *message = NULL; @@ -108,27 +107,25 @@ void nrf_nf_state_will_register(ogs_fsm_t *s, nrf_event_t *e) ogs_assert(message); session = e->sbi.session; ogs_assert(session); - server = e->sbi.server; - ogs_assert(server); SWITCH(message->h.service.name) - CASE(OGS_SBI_SERVICE_NAME_NRF_NFM) + CASE(OGS_SBI_SERVICE_NAME_NNRF_NFM) - SWITCH(message->h.resource.name) + SWITCH(message->h.resource.component[0]) CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES) SWITCH(message->h.method) CASE(OGS_SBI_HTTP_METHOD_PUT) handled = nrf_nnrf_handle_nf_register( - nf_instance, server, session, message); + nf_instance, session, message); if (handled == false) OGS_FSM_TRAN(s, nrf_nf_state_exception); break; DEFAULT - ogs_error("Invalid HTTP method [%s]", - message->h.method); + ogs_error("[%s] Invalid HTTP method [%s]", + nf_instance->id, message->h.method); ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, message, "Invalid HTTP method", message->h.method); @@ -136,16 +133,18 @@ void nrf_nf_state_will_register(ogs_fsm_t *s, nrf_event_t *e) break; DEFAULT - ogs_error("Invalid resource name [%s]", - message->h.resource.name); + ogs_error("[%s] Invalid resource name [%s]", + nf_instance->id, message->h.resource.component[0]); ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, message, - "Invalid resource name", message->h.resource.name); + "Invalid resource name", + message->h.resource.component[0]); END break; DEFAULT - ogs_error("Invalid API name [%s]", message->h.service.name); + ogs_error("[%s] Invalid API name [%s]", + nf_instance->id, message->h.service.name); ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, message, "Invalid resource name", message->h.service.name); @@ -155,7 +154,8 @@ void nrf_nf_state_will_register(ogs_fsm_t *s, nrf_event_t *e) break; default: - ogs_error("Unknown event %s", nrf_event_get_name(e)); + ogs_error("[%s] Unknown event %s", + nf_instance->id, nrf_event_get_name(e)); ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, message, "Unknown event", nrf_event_get_name(e)); @@ -169,7 +169,6 @@ void nrf_nf_state_registered(ogs_fsm_t *s, nrf_event_t *e) bool handled; ogs_sbi_nf_instance_t *nf_instance = NULL; - ogs_sbi_server_t *server = NULL; ogs_sbi_session_t *session = NULL; ogs_sbi_message_t *message = NULL; ogs_sbi_response_t *response = NULL; @@ -184,24 +183,24 @@ void nrf_nf_state_registered(ogs_fsm_t *s, nrf_event_t *e) switch (e->id) { case OGS_FSM_ENTRY_SIG: - ogs_info("NF registred [%s]", nf_instance->id); + ogs_info("[%s] NF registred", nf_instance->id); if (nf_instance->time.heartbeat) { ogs_timer_start(nf_instance->t_heartbeat, ogs_time_from_sec(nf_instance->time.heartbeat) * OGS_SBI_HEARTBEAT_RETRYCOUNT); } - nrf_sbi_send_nf_status_notify_all( + nrf_nnrf_nfm_send_nf_status_notify_all( OpenAPI_notification_event_type_NF_REGISTERED, nf_instance); break; case OGS_FSM_EXIT_SIG: - ogs_info("NF de-registered [%s]", nf_instance->id); + ogs_info("[%s] NF de-registered", nf_instance->id); if (nf_instance->time.heartbeat) { ogs_timer_stop(nf_instance->t_heartbeat); } - nrf_sbi_send_nf_status_notify_all( + nrf_nnrf_nfm_send_nf_status_notify_all( OpenAPI_notification_event_type_NF_DEREGISTERED, nf_instance); break; @@ -210,13 +209,11 @@ void nrf_nf_state_registered(ogs_fsm_t *s, nrf_event_t *e) ogs_assert(message); session = e->sbi.session; ogs_assert(session); - server = e->sbi.server; - ogs_assert(server); SWITCH(message->h.service.name) - CASE(OGS_SBI_SERVICE_NAME_NRF_NFM) + CASE(OGS_SBI_SERVICE_NAME_NNRF_NFM) - SWITCH(message->h.resource.name) + SWITCH(message->h.resource.component[0]) CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES) SWITCH(message->h.method) @@ -229,22 +226,22 @@ void nrf_nf_state_registered(ogs_fsm_t *s, nrf_event_t *e) } handled = nrf_nnrf_handle_nf_update( - nf_instance, server, session, message); + nf_instance, session, message); if (handled == false) OGS_FSM_TRAN(s, nrf_nf_state_exception); break; CASE(OGS_SBI_HTTP_METHOD_DELETE) - response = ogs_sbi_build_response(message); + response = ogs_sbi_build_response( + message, OGS_SBI_HTTP_STATUS_NO_CONTENT); ogs_assert(response); - ogs_sbi_server_send_response(session, response, - OGS_SBI_HTTP_STATUS_NO_CONTENT); + ogs_sbi_server_send_response(session, response); OGS_FSM_TRAN(s, nrf_nf_state_de_registered); break; DEFAULT - ogs_error("Invalid HTTP method [%s]", - message->h.method); + ogs_error("[%s] Invalid HTTP method [%s]", + nf_instance->id, message->h.method); ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, message, "Invalid HTTP method", message->h.method); @@ -252,16 +249,18 @@ void nrf_nf_state_registered(ogs_fsm_t *s, nrf_event_t *e) break; DEFAULT - ogs_error("Invalid resource name [%s]", - message->h.resource.name); + ogs_error("[%s] Invalid resource name [%s]", + nf_instance->id, message->h.resource.component[0]); ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, message, - "Invalid resource name", message->h.resource.name); + "Invalid resource name", + message->h.resource.component[0]); END break; DEFAULT - ogs_error("Invalid API name [%s]", message->h.service.name); + ogs_error("[%s] Invalid API name [%s]", + nf_instance->id, message->h.service.name); ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, message, "Invalid resource name", message->h.service.name); @@ -269,7 +268,8 @@ void nrf_nf_state_registered(ogs_fsm_t *s, nrf_event_t *e) break; default: - ogs_error("Unknown event %s", nrf_event_get_name(e)); + ogs_error("[%s] Unknown event %s", + nf_instance->id, nrf_event_get_name(e)); ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, message, "Unknown event", nrf_event_get_name(e)); diff --git a/src/nrf/nnrf-build.c b/src/nrf/nnrf-build.c index 03dd2d4fca..70cb06cdbf 100644 --- a/src/nrf/nnrf-build.c +++ b/src/nrf/nnrf-build.c @@ -19,7 +19,7 @@ #include "nnrf-build.h" -ogs_sbi_request_t *nrf_nnrf_build_nf_status_notify( +ogs_sbi_request_t *nrf_nnrf_nfm_build_nf_status_notify( ogs_sbi_client_t *client, ogs_sbi_subscription_t *subscription, OpenAPI_notification_event_type_e event, ogs_sbi_nf_instance_t *nf_instance) @@ -41,13 +41,15 @@ ogs_sbi_request_t *nrf_nnrf_build_nf_status_notify( message.h.method = (char *)OGS_SBI_HTTP_METHOD_POST; message.h.url = subscription->notification_uri; + message.http.accept = (char *)OGS_SBI_CONTENT_PROBLEM_TYPE; + NotificationData = ogs_calloc(1, sizeof(*NotificationData)); ogs_assert(NotificationData); NotificationData->event = event; NotificationData->nf_instance_uri = message.h.url; - NFProfile = ogs_sbi_nnrf_build_nf_profile(nf_instance); + NFProfile = ogs_nnrf_nfm_build_nf_profile(nf_instance); ogs_assert(NFProfile); NotificationData->nf_profile = NFProfile; diff --git a/src/nrf/nnrf-build.h b/src/nrf/nnrf-build.h index b592ebdbd0..da71d174b2 100644 --- a/src/nrf/nnrf-build.h +++ b/src/nrf/nnrf-build.h @@ -27,7 +27,7 @@ extern "C" { #endif -ogs_sbi_request_t *nrf_nnrf_build_nf_status_notify( +ogs_sbi_request_t *nrf_nnrf_nfm_build_nf_status_notify( ogs_sbi_client_t *client, ogs_sbi_subscription_t *subscription, OpenAPI_notification_event_type_e event, ogs_sbi_nf_instance_t *nf_instance); diff --git a/src/nrf/nnrf-handler.c b/src/nrf/nnrf-handler.c index 18aba836f8..ebe2210ad8 100644 --- a/src/nrf/nnrf-handler.c +++ b/src/nrf/nnrf-handler.c @@ -19,8 +19,7 @@ #include "nnrf-handler.h" -bool nrf_nnrf_handle_nf_register( - ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_server_t *server, +bool nrf_nnrf_handle_nf_register(ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_session_t *session, ogs_sbi_message_t *message) { int status; @@ -47,22 +46,21 @@ bool nrf_nnrf_handle_nf_register( if (!handled) return false; if (OGS_FSM_CHECK(&nf_instance->sm, nrf_nf_state_will_register)) { - message->http.location = true; + message->http.location = message->h.url; status = OGS_SBI_HTTP_STATUS_CREATED; } else if (OGS_FSM_CHECK(&nf_instance->sm, nrf_nf_state_registered)) { status = OGS_SBI_HTTP_STATUS_OK; } else ogs_assert_if_reached(); - response = ogs_sbi_build_response(message); + response = ogs_sbi_build_response(message, status); ogs_assert(response); - ogs_sbi_server_send_response(session, response, status); + ogs_sbi_server_send_response(session, response); return true; } -bool nrf_nnrf_handle_nf_update( - ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_server_t *server, +bool nrf_nnrf_handle_nf_update(ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_session_t *session, ogs_sbi_message_t *message) { ogs_sbi_response_t *response = NULL; @@ -76,7 +74,7 @@ bool nrf_nnrf_handle_nf_update( SWITCH(message->h.method) CASE(OGS_SBI_HTTP_METHOD_PUT) return nrf_nnrf_handle_nf_register( - nf_instance, server, session, message); + nf_instance, session, message); CASE(OGS_SBI_HTTP_METHOD_PATCH) PatchItemList = message->PatchItemList; @@ -96,22 +94,22 @@ bool nrf_nnrf_handle_nf_update( } } - response = ogs_sbi_build_response(message); + response = ogs_sbi_build_response( + message, OGS_SBI_HTTP_STATUS_NO_CONTENT); ogs_assert(response); - ogs_sbi_server_send_response(session, response, - OGS_SBI_HTTP_STATUS_NO_CONTENT); + ogs_sbi_server_send_response(session, response); break; DEFAULT - ogs_error("Invalid HTTP method [%s]", - message->h.method); + ogs_error("[%s] Invalid HTTP method [%s]", + nf_instance->id, message->h.method); ogs_assert_if_reached(); END return true; } -bool nrf_nnrf_handle_nf_status_subscribe(ogs_sbi_server_t *server, +bool nrf_nnrf_handle_nf_status_subscribe( ogs_sbi_session_t *session, ogs_sbi_message_t *message) { int status; @@ -153,7 +151,7 @@ bool nrf_nnrf_handle_nf_status_subscribe(ogs_sbi_server_t *server, ogs_strdup(SubscriptionData->req_nf_instance_id); if (SubscriptionData->subscription_id) { - ogs_warn("NF should not send SubscriptionID[%s]", + ogs_warn("[%s] NF should not send SubscriptionID", SubscriptionData->subscription_id); ogs_free(SubscriptionData->subscription_id); } @@ -167,6 +165,7 @@ bool nrf_nnrf_handle_nf_status_subscribe(ogs_sbi_server_t *server, if (!addr) { ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, message, "Invalid URI", subscription->notification_uri); + ogs_sbi_subscription_remove(subscription); return false; } @@ -200,46 +199,47 @@ bool nrf_nnrf_handle_nf_status_subscribe(ogs_sbi_server_t *server, ogs_time_from_sec(subscription->time.validity)); } - message->http.location = true; + message->http.location = message->h.url; status = OGS_SBI_HTTP_STATUS_CREATED; - response = ogs_sbi_build_response(message); + response = ogs_sbi_build_response(message, status); ogs_assert(response); - ogs_sbi_server_send_response(session, response, status); + ogs_sbi_server_send_response(session, response); return true; } -bool nrf_nnrf_handle_nf_status_unsubscribe(ogs_sbi_server_t *server, +bool nrf_nnrf_handle_nf_status_unsubscribe( ogs_sbi_session_t *session, ogs_sbi_message_t *message) { ogs_sbi_subscription_t *subscription = NULL; ogs_assert(session); ogs_assert(message); - subscription = ogs_sbi_subscription_find(message->h.resource.id); + subscription = ogs_sbi_subscription_find(message->h.resource.component[1]); if (subscription) { ogs_sbi_response_t *response = NULL; ogs_sbi_subscription_remove(subscription); - response = ogs_sbi_build_response(message); + response = ogs_sbi_build_response( + message, OGS_SBI_HTTP_STATUS_NO_CONTENT); ogs_assert(response); - ogs_sbi_server_send_response(session, response, - OGS_SBI_HTTP_STATUS_NO_CONTENT); + ogs_sbi_server_send_response(session, response); } else { - ogs_error("Not found [%s]", message->h.resource.id); + ogs_error("Not found [%s]", message->h.resource.component[1]); ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_NOT_FOUND, - message, "Not found", message->h.resource.id); + message, "Not found", message->h.resource.component[1]); } return true; } -bool nrf_nnrf_handle_nf_list_retrieval(ogs_sbi_server_t *server, +bool nrf_nnrf_handle_nf_list_retrieval( ogs_sbi_session_t *session, ogs_sbi_message_t *recvmsg) { ogs_sbi_message_t sendmsg; + ogs_sbi_server_t *server = NULL; ogs_sbi_response_t *response = NULL; ogs_sbi_nf_instance_t *nf_instance = NULL; int i = 0; @@ -248,6 +248,7 @@ bool nrf_nnrf_handle_nf_list_retrieval(ogs_sbi_server_t *server, OpenAPI_lnode_t *node = NULL; ogs_assert(session); + server = ogs_sbi_session_get_server(session); ogs_assert(recvmsg); links = ogs_calloc(1, sizeof(*links)); @@ -256,9 +257,7 @@ bool nrf_nnrf_handle_nf_list_retrieval(ogs_sbi_server_t *server, links->items = OpenAPI_list_create(); ogs_assert(links->items); - links->self = ogs_sbi_server_uri(server, - recvmsg->h.service.name, recvmsg->h.api.version, - recvmsg->h.resource.name, NULL); + links->self = ogs_sbi_server_uri(server, &recvmsg->h); i = 0; ogs_list_for_each(&ogs_sbi_self()->nf_instance_list, nf_instance) { @@ -282,9 +281,9 @@ bool nrf_nnrf_handle_nf_list_retrieval(ogs_sbi_server_t *server, sendmsg.links = links; sendmsg.http.content_type = (char *)OGS_SBI_CONTENT_3GPPHAL_TYPE; - response = ogs_sbi_build_response(&sendmsg); + response = ogs_sbi_build_response(&sendmsg, OGS_SBI_HTTP_STATUS_OK); ogs_assert(response); - ogs_sbi_server_send_response(session, response, OGS_SBI_HTTP_STATUS_OK); + ogs_sbi_server_send_response(session, response); OpenAPI_list_for_each(links->items, node) { if (!node->data) continue; @@ -297,7 +296,7 @@ bool nrf_nnrf_handle_nf_list_retrieval(ogs_sbi_server_t *server, return true; } -bool nrf_nnrf_handle_nf_profile_retrieval(ogs_sbi_server_t *server, +bool nrf_nnrf_handle_nf_profile_retrieval( ogs_sbi_session_t *session, ogs_sbi_message_t *recvmsg) { ogs_sbi_message_t sendmsg; @@ -309,32 +308,32 @@ bool nrf_nnrf_handle_nf_profile_retrieval(ogs_sbi_server_t *server, ogs_assert(session); ogs_assert(recvmsg); - ogs_assert(recvmsg->h.resource.id); - nf_instance = ogs_sbi_nf_instance_find(recvmsg->h.resource.id); + ogs_assert(recvmsg->h.resource.component[1]); + nf_instance = ogs_sbi_nf_instance_find(recvmsg->h.resource.component[1]); if (!nf_instance) { - ogs_error("Not found [%s]", recvmsg->h.resource.id); + ogs_error("Not found [%s]", recvmsg->h.resource.component[1]); ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_NOT_FOUND, - recvmsg, "Not found", recvmsg->h.resource.id); + recvmsg, "Not found", recvmsg->h.resource.component[1]); return false; } - NFProfile = ogs_sbi_nnrf_build_nf_profile(nf_instance); + NFProfile = ogs_nnrf_nfm_build_nf_profile(nf_instance); ogs_assert(NFProfile); memset(&sendmsg, 0, sizeof(sendmsg)); sendmsg.NFProfile = NFProfile; - response = ogs_sbi_build_response(&sendmsg); + response = ogs_sbi_build_response(&sendmsg, OGS_SBI_HTTP_STATUS_OK); ogs_assert(response); - ogs_sbi_server_send_response(session, response, OGS_SBI_HTTP_STATUS_OK); + ogs_sbi_server_send_response(session, response); ogs_sbi_nnrf_free_nf_profile(NFProfile); return true; } -bool nrf_nnrf_handle_nf_discover(ogs_sbi_server_t *server, +bool nrf_nnrf_handle_nf_discover( ogs_sbi_session_t *session, ogs_sbi_message_t *recvmsg) { ogs_sbi_message_t sendmsg; @@ -381,7 +380,7 @@ bool nrf_nnrf_handle_nf_discover(ogs_sbi_server_t *server, if (!recvmsg->param.limit || (recvmsg->param.limit && i < recvmsg->param.limit)) { - NFProfile = ogs_sbi_nnrf_build_nf_profile(nf_instance); + NFProfile = ogs_nnrf_nfm_build_nf_profile(nf_instance); ogs_assert(NFProfile); OpenAPI_list_add(SearchResult->nf_instances, NFProfile); @@ -397,9 +396,9 @@ bool nrf_nnrf_handle_nf_discover(ogs_sbi_server_t *server, sendmsg.http.cache_control = ogs_msprintf("max-age=%d", SearchResult->validity_period); - response = ogs_sbi_build_response(&sendmsg); + response = ogs_sbi_build_response(&sendmsg, OGS_SBI_HTTP_STATUS_OK); ogs_assert(response); - ogs_sbi_server_send_response(session, response, OGS_SBI_HTTP_STATUS_OK); + ogs_sbi_server_send_response(session, response); OpenAPI_list_for_each(SearchResult->nf_instances, node) { OpenAPI_nf_profile_t *NFProfile = NULL; diff --git a/src/nrf/nnrf-handler.h b/src/nrf/nnrf-handler.h index b2a00d5b93..8d76f5f2d9 100644 --- a/src/nrf/nnrf-handler.h +++ b/src/nrf/nnrf-handler.h @@ -27,24 +27,22 @@ extern "C" { #endif -bool nrf_nnrf_handle_nf_register( - ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_server_t *server, +bool nrf_nnrf_handle_nf_register(ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_session_t *session, ogs_sbi_message_t *message); -bool nrf_nnrf_handle_nf_update( - ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_server_t *server, +bool nrf_nnrf_handle_nf_update(ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_session_t *session, ogs_sbi_message_t *message); -bool nrf_nnrf_handle_nf_status_subscribe(ogs_sbi_server_t *server, +bool nrf_nnrf_handle_nf_status_subscribe( ogs_sbi_session_t *session, ogs_sbi_message_t *message); -bool nrf_nnrf_handle_nf_status_unsubscribe(ogs_sbi_server_t *server, +bool nrf_nnrf_handle_nf_status_unsubscribe( ogs_sbi_session_t *session, ogs_sbi_message_t *message); -bool nrf_nnrf_handle_nf_list_retrieval(ogs_sbi_server_t *server, +bool nrf_nnrf_handle_nf_list_retrieval( ogs_sbi_session_t *session, ogs_sbi_message_t *message); -bool nrf_nnrf_handle_nf_profile_retrieval(ogs_sbi_server_t *server, +bool nrf_nnrf_handle_nf_profile_retrieval( ogs_sbi_session_t *session, ogs_sbi_message_t *message); -bool nrf_nnrf_handle_nf_discover(ogs_sbi_server_t *server, +bool nrf_nnrf_handle_nf_discover( ogs_sbi_session_t *session, ogs_sbi_message_t *message); #ifdef __cplusplus diff --git a/src/nrf/nrf-sm.c b/src/nrf/nrf-sm.c index 94cfa1beaf..6aff6c5ae8 100644 --- a/src/nrf/nrf-sm.c +++ b/src/nrf/nrf-sm.c @@ -39,7 +39,6 @@ void nrf_state_final(ogs_fsm_t *s, nrf_event_t *e) void nrf_state_operational(ogs_fsm_t *s, nrf_event_t *e) { int rv; - ogs_sbi_server_t *server = NULL; ogs_sbi_session_t *session = NULL; ogs_sbi_request_t *request = NULL; ogs_sbi_message_t message; @@ -69,8 +68,6 @@ void nrf_state_operational(ogs_fsm_t *s, nrf_event_t *e) ogs_assert(request); session = e->sbi.session; ogs_assert(session); - server = e->sbi.server; - ogs_assert(server); rv = ogs_sbi_parse_request(&message, request); if (rv != OGS_OK) { @@ -90,37 +87,37 @@ void nrf_state_operational(ogs_fsm_t *s, nrf_event_t *e) } SWITCH(message.h.service.name) - CASE(OGS_SBI_SERVICE_NAME_NRF_NFM) + CASE(OGS_SBI_SERVICE_NAME_NNRF_NFM) - SWITCH(message.h.resource.name) + SWITCH(message.h.resource.component[0]) CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES) SWITCH(message.h.method) CASE(OGS_SBI_HTTP_METHOD_GET) - if (message.h.resource.id) { - nrf_nnrf_handle_nf_profile_retrieval( - server, session, &message); + if (message.h.resource.component[1]) { + nrf_nnrf_handle_nf_profile_retrieval(session, &message); } else { - nrf_nnrf_handle_nf_list_retrieval( - server, session, &message); + nrf_nnrf_handle_nf_list_retrieval(session, &message); } break; DEFAULT nf_instance = ogs_sbi_nf_instance_find( - message.h.resource.id); + message.h.resource.component[1]); if (!nf_instance) { SWITCH(message.h.method) CASE(OGS_SBI_HTTP_METHOD_PUT) nf_instance = ogs_sbi_nf_instance_add( - message.h.resource.id); + message.h.resource.component[1]); ogs_assert(nf_instance); nrf_nf_fsm_init(nf_instance); break; DEFAULT - ogs_error("Not found [%s]", message.h.resource.id); + ogs_error("Not found [%s]", + message.h.resource.component[1]); ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_NOT_FOUND, - &message, "Not found", message.h.resource.id); + &message, "Not found", + message.h.resource.component[1]); END } @@ -134,17 +131,14 @@ void nrf_state_operational(ogs_fsm_t *s, nrf_event_t *e) nrf_nf_state_de_registered)) { nrf_nf_fsm_fini(nf_instance); ogs_sbi_nf_instance_remove(nf_instance); - - /* FIXME : Remove unnecessary Client */ } else if (OGS_FSM_CHECK(&nf_instance->sm, nrf_nf_state_exception)) { - ogs_error("State machine exception"); + ogs_error("[%s] State machine exception", + nf_instance->id); ogs_sbi_message_free(&message); nrf_nf_fsm_fini(nf_instance); ogs_sbi_nf_instance_remove(nf_instance); - - /* FIXME : Remove unnecessary Client */ } } END @@ -153,13 +147,11 @@ void nrf_state_operational(ogs_fsm_t *s, nrf_event_t *e) CASE(OGS_SBI_RESOURCE_NAME_SUBSCRIPTIONS) SWITCH(message.h.method) CASE(OGS_SBI_HTTP_METHOD_POST) - nrf_nnrf_handle_nf_status_subscribe( - server, session, &message); + nrf_nnrf_handle_nf_status_subscribe(session, &message); break; CASE(OGS_SBI_HTTP_METHOD_DELETE) - nrf_nnrf_handle_nf_status_unsubscribe( - server, session, &message); + nrf_nnrf_handle_nf_status_unsubscribe(session, &message); break; DEFAULT @@ -173,21 +165,22 @@ void nrf_state_operational(ogs_fsm_t *s, nrf_event_t *e) DEFAULT ogs_error("Invalid resource name [%s]", - message.h.resource.name); + message.h.resource.component[0]); ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, &message, - "Unknown resource name", message.h.resource.name); + "Unknown resource name", + message.h.resource.component[0]); END break; - CASE(OGS_SBI_SERVICE_NAME_NRF_DISC) + CASE(OGS_SBI_SERVICE_NAME_NNRF_DISC) - SWITCH(message.h.resource.name) + SWITCH(message.h.resource.component[0]) CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES) SWITCH(message.h.method) CASE(OGS_SBI_HTTP_METHOD_GET) - nrf_nnrf_handle_nf_discover(server, session, &message); + nrf_nnrf_handle_nf_discover(session, &message); break; DEFAULT @@ -203,10 +196,11 @@ void nrf_state_operational(ogs_fsm_t *s, nrf_event_t *e) DEFAULT ogs_error("Invalid resource name [%s]", - message.h.resource.name); + message.h.resource.component[0]); ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, &message, - "Unknown resource name", message.h.resource.name); + "Unknown resource name", + message.h.resource.component[0]); END break; @@ -214,7 +208,7 @@ void nrf_state_operational(ogs_fsm_t *s, nrf_event_t *e) ogs_error("Invalid API name [%s]", message.h.service.name); ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, &message, - "Invalid API name", message.h.resource.name); + "Invalid API name", message.h.resource.component[0]); END /* In lib/sbi/server.c, notify_completed() releases 'request' buffer. */ @@ -227,7 +221,7 @@ void nrf_state_operational(ogs_fsm_t *s, nrf_event_t *e) nf_instance = e->nf_instance; ogs_assert(nf_instance); - ogs_warn("No heartbeat [%s]", nf_instance->id); + ogs_warn("[%s] No heartbeat", nf_instance->id); nf_instance->nf_status = OpenAPI_nf_status_SUSPENDED; nrf_nf_fsm_fini(nf_instance); @@ -240,7 +234,7 @@ void nrf_state_operational(ogs_fsm_t *s, nrf_event_t *e) subscription = e->subscription; ogs_assert(subscription); - ogs_info("Subscription validity expired [%s]", subscription->id); + ogs_info("[%s] Subscription validity expired", subscription->id); ogs_sbi_subscription_remove(subscription); break; diff --git a/src/nrf/sbi-path.c b/src/nrf/sbi-path.c index c474ccb14f..5816ec0da8 100644 --- a/src/nrf/sbi-path.c +++ b/src/nrf/sbi-path.c @@ -84,7 +84,7 @@ void nrf_sbi_close(void) ogs_sbi_server_stop_all(); } -void nrf_sbi_send_nf_status_notify(ogs_sbi_subscription_t *subscription, +void nrf_nnrf_nfm_send_nf_status_notify(ogs_sbi_subscription_t *subscription, OpenAPI_notification_event_type_e event, ogs_sbi_nf_instance_t *nf_instance) { @@ -96,13 +96,14 @@ void nrf_sbi_send_nf_status_notify(ogs_sbi_subscription_t *subscription, ogs_assert(client); client->cb = client_notify_cb; - request = nrf_nnrf_build_nf_status_notify( + request = nrf_nnrf_nfm_build_nf_status_notify( client, subscription, event, nf_instance); ogs_assert(request); ogs_sbi_client_send_request(client, request, client); } -void nrf_sbi_send_nf_status_notify_all(OpenAPI_notification_event_type_e event, +void nrf_nnrf_nfm_send_nf_status_notify_all( + OpenAPI_notification_event_type_e event, ogs_sbi_nf_instance_t *nf_instance) { ogs_sbi_subscription_t *subscription = NULL; @@ -114,6 +115,6 @@ void nrf_sbi_send_nf_status_notify_all(OpenAPI_notification_event_type_e event, if (strcmp(subscription->nf_instance_id, nf_instance->id) == 0) continue; - nrf_sbi_send_nf_status_notify(subscription, event, nf_instance); + nrf_nnrf_nfm_send_nf_status_notify(subscription, event, nf_instance); } } diff --git a/src/nrf/sbi-path.h b/src/nrf/sbi-path.h index db22b4dccd..7dd5db3aae 100644 --- a/src/nrf/sbi-path.h +++ b/src/nrf/sbi-path.h @@ -30,10 +30,11 @@ extern "C" { int nrf_sbi_open(void); void nrf_sbi_close(void); -void nrf_sbi_send_nf_status_notify(ogs_sbi_subscription_t *subscription, +void nrf_nnrf_nfm_send_nf_status_notify(ogs_sbi_subscription_t *subscription, OpenAPI_notification_event_type_e event, ogs_sbi_nf_instance_t *nf_instance); -void nrf_sbi_send_nf_status_notify_all(OpenAPI_notification_event_type_e event, +void nrf_nnrf_nfm_send_nf_status_notify_all( + OpenAPI_notification_event_type_e event, ogs_sbi_nf_instance_t *nf_instance); #ifdef __cplusplus diff --git a/src/smf/context.h b/src/smf/context.h index 748b6780a3..ffd4158a3b 100644 --- a/src/smf/context.h +++ b/src/smf/context.h @@ -88,6 +88,22 @@ typedef struct smf_context_s { uint16_t mtu; /* MTU to advertise in PCO */ ogs_list_t sess_list; + +#define SMF_NF_INSTANCE_CLEAR(_cAUSE, _nFInstance) \ + do { \ + ogs_assert(_nFInstance); \ + if ((_nFInstance)->reference_count == 1) { \ + ogs_info("[%s] (%s) NF removed", (_nFInstance)->id, (_cAUSE)); \ + smf_nf_fsm_fini((_nFInstance)); \ + } else { \ + /* There is an assocation with other context */ \ + ogs_info("[%s:%d] (%s) NF suspended", \ + _nFInstance->id, _nFInstance->reference_count, (_cAUSE)); \ + OGS_FSM_TRAN(&_nFInstance->sm, smf_nf_state_de_registered); \ + ogs_fsm_dispatch(&_nFInstance->sm, NULL); \ + } \ + ogs_sbi_nf_instance_remove(_nFInstance); \ + } while(0) } smf_context_t; typedef struct smf_sess_s { diff --git a/src/smf/nf-sm.c b/src/smf/nf-sm.c index 9cd7f38b4e..cc62b241bb 100644 --- a/src/smf/nf-sm.c +++ b/src/smf/nf-sm.c @@ -118,7 +118,7 @@ void smf_nf_state_will_register(ogs_fsm_t *s, smf_event_t *e) smf_timer_cfg(SMF_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL)-> duration); - smf_sbi_send_nf_register(nf_instance); + ogs_nnrf_nfm_send_nf_register(nf_instance); break; case OGS_FSM_EXIT_SIG: @@ -130,9 +130,9 @@ void smf_nf_state_will_register(ogs_fsm_t *s, smf_event_t *e) ogs_assert(message); SWITCH(message->h.service.name) - CASE(OGS_SBI_SERVICE_NAME_NRF_NFM) + CASE(OGS_SBI_SERVICE_NAME_NNRF_NFM) - SWITCH(message->h.resource.name) + SWITCH(message->h.resource.component[0]) CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES) if (message->res_status == OGS_SBI_HTTP_STATUS_OK || @@ -140,20 +140,21 @@ void smf_nf_state_will_register(ogs_fsm_t *s, smf_event_t *e) smf_nnrf_handle_nf_register(nf_instance, message); OGS_FSM_TRAN(s, &smf_nf_state_registered); } else { - ogs_error("HTTP Response Status Code [%d]", - message->res_status); + ogs_error("[%s] HTTP Response Status Code [%d]", + nf_instance->id, message->res_status); OGS_FSM_TRAN(s, &smf_nf_state_exception); } break; DEFAULT - ogs_error("Invalid resource name [%s]", - message->h.resource.name); + ogs_error("[%s] Invalid resource name [%s]", + nf_instance->id, message->h.resource.component[0]); END break; DEFAULT - ogs_error("Invalid API name [%s]", message->h.service.name); + ogs_error("[%s] Invalid API name [%s]", + nf_instance->id, message->h.service.name); END break; @@ -165,23 +166,24 @@ void smf_nf_state_will_register(ogs_fsm_t *s, smf_event_t *e) addr = client->addr; ogs_assert(addr); - ogs_warn("Retry to registration with NRF [%s]", nf_instance->id); + ogs_warn("[%s] Retry to registration with NRF", nf_instance->id); ogs_timer_start(nf_instance->t_registration_interval, smf_timer_cfg(SMF_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL)-> duration); - smf_sbi_send_nf_register(nf_instance); + ogs_nnrf_nfm_send_nf_register(nf_instance); break; default: - ogs_error("Unknown timer[%s:%d]", + ogs_error("[%s] Unknown timer[%s:%d]", nf_instance->id, smf_timer_get_name(e->timer_id), e->timer_id); } break; default: - ogs_error("Unknown event %s", smf_event_get_name(e)); + ogs_error("[%s] Unknown event %s", + nf_instance->id, smf_event_get_name(e)); break; } } @@ -202,7 +204,7 @@ void smf_nf_state_registered(ogs_fsm_t *s, smf_event_t *e) switch (e->id) { case OGS_FSM_ENTRY_SIG: if (NF_INSTANCE_IS_SELF(nf_instance->id)) { - ogs_info("NF registered [%s]", nf_instance->id); + ogs_info("[%s] NF registered", nf_instance->id); client = nf_instance->client; ogs_assert(client); @@ -215,7 +217,7 @@ void smf_nf_state_registered(ogs_fsm_t *s, smf_event_t *e) OGS_SBI_HEARTBEAT_RETRYCOUNT)); } - smf_sbi_send_nf_status_subscribe(client, + ogs_nnrf_nfm_send_nf_status_subscribe(client, smf_self()->nf_type, nf_instance->id); } @@ -223,14 +225,14 @@ void smf_nf_state_registered(ogs_fsm_t *s, smf_event_t *e) case OGS_FSM_EXIT_SIG: if (NF_INSTANCE_IS_SELF(nf_instance->id)) { - ogs_info("NF de-registered [%s]", nf_instance->id); + ogs_info("[%s] NF de-registered", nf_instance->id); if (nf_instance->time.heartbeat) { ogs_timer_stop(nf_instance->t_heartbeat_interval); ogs_timer_stop(nf_instance->t_heartbeat); } - smf_sbi_send_nf_de_register(nf_instance); + ogs_nnrf_nfm_send_nf_de_register(nf_instance); } break; @@ -239,9 +241,9 @@ void smf_nf_state_registered(ogs_fsm_t *s, smf_event_t *e) ogs_assert(message); SWITCH(message->h.service.name) - CASE(OGS_SBI_SERVICE_NAME_NRF_NFM) + CASE(OGS_SBI_SERVICE_NAME_NNRF_NFM) - SWITCH(message->h.resource.name) + SWITCH(message->h.resource.component[0]) CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES) if (message->res_status == OGS_SBI_HTTP_STATUS_NO_CONTENT || @@ -251,19 +253,21 @@ void smf_nf_state_registered(ogs_fsm_t *s, smf_event_t *e) ogs_time_from_sec(nf_instance->time.heartbeat * OGS_SBI_HEARTBEAT_RETRYCOUNT)); } else { - ogs_error("HTTP response error : %d", message->res_status); + ogs_error("[%s] HTTP response error [%d]", + nf_instance->id, message->res_status); } break; DEFAULT - ogs_error("Invalid resource name [%s]", - message->h.resource.name); + ogs_error("[%s] Invalid resource name [%s]", + nf_instance->id, message->h.resource.component[0]); END break; DEFAULT - ogs_error("Invalid API name [%s]", message->h.service.name); + ogs_error("[%s] Invalid API name [%s]", + nf_instance->id, message->h.service.name); END break; @@ -275,7 +279,7 @@ void smf_nf_state_registered(ogs_fsm_t *s, smf_event_t *e) ogs_time_from_sec(nf_instance->time.heartbeat)); } - smf_sbi_send_nf_update(nf_instance); + ogs_nnrf_nfm_send_nf_update(nf_instance); break; case SMF_TIMER_NF_INSTANCE_HEARTBEAT: @@ -284,20 +288,21 @@ void smf_nf_state_registered(ogs_fsm_t *s, smf_event_t *e) case SMF_TIMER_NF_INSTANCE_VALIDITY: if (NF_INSTANCE_IS_OTHERS(nf_instance->id)) { - ogs_info("NF expired [%s]", nf_instance->id); + ogs_info("[%s] NF expired", nf_instance->id); OGS_FSM_TRAN(s, &smf_nf_state_de_registered); } break; default: - ogs_error("Unknown timer[%s:%d]", + ogs_error("[%s] Unknown timer[%s:%d]", nf_instance->id, smf_timer_get_name(e->timer_id), e->timer_id); break; } break; default: - ogs_error("Unknown event %s", smf_event_get_name(e)); + ogs_error("[%s] Unknown event %s", + nf_instance->id, smf_event_get_name(e)); break; } } @@ -316,7 +321,7 @@ void smf_nf_state_de_registered(ogs_fsm_t *s, smf_event_t *e) switch (e->id) { case OGS_FSM_ENTRY_SIG: if (NF_INSTANCE_IS_SELF(nf_instance->id)) { - ogs_info("NF de-registered [%s]", nf_instance->id); + ogs_info("[%s] NF de-registered", nf_instance->id); } break; @@ -324,7 +329,8 @@ void smf_nf_state_de_registered(ogs_fsm_t *s, smf_event_t *e) break; default: - ogs_error("Unknown event %s", smf_event_get_name(e)); + ogs_error("[%s] Unknown event %s", + nf_instance->id, smf_event_get_name(e)); break; } } @@ -365,20 +371,21 @@ void smf_nf_state_exception(ogs_fsm_t *s, smf_event_t *e) addr = client->addr; ogs_assert(addr); - ogs_warn("Retry to registration with NRF [%s]", nf_instance->id); + ogs_warn("[%s] Retry to registration with NRF", nf_instance->id); OGS_FSM_TRAN(s, &smf_nf_state_will_register); break; default: - ogs_error("Unknown timer[%s:%d]", + ogs_error("[%s] Unknown timer[%s:%d]", nf_instance->id, smf_timer_get_name(e->timer_id), e->timer_id); break; } break; default: - ogs_error("Unknown event %s", smf_event_get_name(e)); + ogs_error("[%s] Unknown event %s", + nf_instance->id, smf_event_get_name(e)); break; } } diff --git a/src/smf/nnrf-build.c b/src/smf/nnrf-build.c index 3bd6f1938e..f600bcd571 100644 --- a/src/smf/nnrf-build.c +++ b/src/smf/nnrf-build.c @@ -19,186 +19,8 @@ #include "nnrf-build.h" -ogs_sbi_request_t *smf_nnrf_build_nf_register( +ogs_sbi_request_t *smf_nnrf_build_test_test( ogs_sbi_nf_instance_t *nf_instance) { - ogs_sbi_message_t message; - ogs_sbi_request_t *request = NULL; - ogs_sbi_client_t *client = NULL; - - OpenAPI_nf_profile_t *NFProfile = NULL; - - ogs_assert(nf_instance); - client = nf_instance->client; - ogs_assert(client); - - memset(&message, 0, sizeof(message)); - message.h.method = (char *)OGS_SBI_HTTP_METHOD_PUT; - message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NRF_NFM; - message.h.api.version = (char *)OGS_SBI_API_VERSION; - message.h.resource.name = (char *)OGS_SBI_RESOURCE_NAME_NF_INSTANCES; - message.h.resource.id = ogs_sbi_self()->nf_instance_id; - - message.http.content_encoding = (char*)ogs_sbi_self()->content_encoding; - - NFProfile = ogs_sbi_nnrf_build_nf_profile(nf_instance); - ogs_assert(NFProfile); - - NFProfile->heart_beat_timer = nf_instance->time.heartbeat; - - message.NFProfile = NFProfile; - - request = ogs_sbi_build_request(&message); - ogs_assert(request); - - ogs_sbi_nnrf_free_nf_profile(NFProfile); - - return request; -} - -ogs_sbi_request_t *smf_nnrf_build_nf_update(ogs_sbi_nf_instance_t *nf_instance) -{ - ogs_sbi_message_t message; - ogs_sbi_request_t *request = NULL; - - OpenAPI_list_t *PatchItemList; - OpenAPI_patch_item_t item; - - ogs_assert(nf_instance); - - memset(&message, 0, sizeof(message)); - message.h.method = (char *)OGS_SBI_HTTP_METHOD_PATCH; - message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NRF_NFM; - message.h.api.version = (char *)OGS_SBI_API_VERSION; - message.h.resource.name = (char *)OGS_SBI_RESOURCE_NAME_NF_INSTANCES; - message.h.resource.id = ogs_sbi_self()->nf_instance_id; - message.http.content_type = (char *)OGS_SBI_CONTENT_PATCH_TYPE; - - PatchItemList = OpenAPI_list_create(); - ogs_assert(PatchItemList); - - memset(&item, 0, sizeof(item)); - item.op = OpenAPI_patch_operation_replace; - item.path = (char *)"/nfStatus"; - item.value = OpenAPI_nf_status_ToString(OpenAPI_nf_status_REGISTERED); - - OpenAPI_list_add(PatchItemList, &item); - - message.PatchItemList = PatchItemList; - - request = ogs_sbi_build_request(&message); - ogs_assert(request); - - OpenAPI_list_free(PatchItemList); - - return request; -} - -ogs_sbi_request_t *smf_nnrf_build_nf_de_register( - ogs_sbi_nf_instance_t *nf_instance) -{ - ogs_sbi_message_t message; - ogs_sbi_request_t *request = NULL; - - ogs_assert(nf_instance); - - memset(&message, 0, sizeof(message)); - message.h.method = (char *)OGS_SBI_HTTP_METHOD_DELETE; - message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NRF_NFM; - message.h.api.version = (char *)OGS_SBI_API_VERSION; - message.h.resource.name = (char *)OGS_SBI_RESOURCE_NAME_NF_INSTANCES; - message.h.resource.id = nf_instance->id; - - request = ogs_sbi_build_request(&message); - ogs_assert(request); - - return request; -} - -ogs_sbi_request_t *smf_nnrf_build_nf_status_subscribe( - ogs_sbi_subscription_t *subscription) -{ - ogs_sbi_message_t message; - ogs_sbi_request_t *request = NULL; - ogs_sbi_server_t *server = NULL; - - OpenAPI_subscription_data_t *SubscriptionData = NULL; - - ogs_assert(subscription); - ogs_assert(subscription->nf_type); - - memset(&message, 0, sizeof(message)); - message.h.method = (char *)OGS_SBI_HTTP_METHOD_POST; - message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NRF_NFM; - message.h.api.version = (char *)OGS_SBI_API_VERSION; - message.h.resource.name = (char *)OGS_SBI_RESOURCE_NAME_SUBSCRIPTIONS; - - SubscriptionData = ogs_calloc(1, sizeof(*SubscriptionData)); - ogs_assert(SubscriptionData); - - server = ogs_list_first(&ogs_sbi_self()->server_list); - ogs_assert(server); - - SubscriptionData->nf_status_notification_uri = ogs_sbi_server_uri(server, - OGS_SBI_SERVICE_NAME_NRF_NFM, OGS_SBI_API_VERSION, - OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY, NULL); - ogs_assert(SubscriptionData->nf_status_notification_uri); - - SubscriptionData->req_nf_type = subscription->nf_type; - SubscriptionData->req_nf_instance_id = subscription->nf_instance_id; - - message.SubscriptionData = SubscriptionData; - - request = ogs_sbi_build_request(&message); - ogs_assert(request); - - ogs_free(SubscriptionData->nf_status_notification_uri); - ogs_free(SubscriptionData); - - return request; -} - -ogs_sbi_request_t *smf_nnrf_build_nf_status_unsubscribe( - ogs_sbi_subscription_t *subscription) -{ - ogs_sbi_message_t message; - ogs_sbi_request_t *request = NULL; - - ogs_assert(subscription); - - memset(&message, 0, sizeof(message)); - message.h.method = (char *)OGS_SBI_HTTP_METHOD_DELETE; - message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NRF_NFM; - message.h.api.version = (char *)OGS_SBI_API_VERSION; - message.h.resource.name = (char *)OGS_SBI_RESOURCE_NAME_SUBSCRIPTIONS; - message.h.resource.id = subscription->id; - - request = ogs_sbi_build_request(&message); - ogs_assert(request); - - return request; -} - -ogs_sbi_request_t *smf_nnrf_build_nf_discover( - OpenAPI_nf_type_e target_nf_type, OpenAPI_nf_type_e requester_nf_type) -{ - ogs_sbi_message_t message; - ogs_sbi_request_t *request = NULL; - - ogs_assert(target_nf_type); - ogs_assert(requester_nf_type); - - memset(&message, 0, sizeof(message)); - message.h.method = (char *)OGS_SBI_HTTP_METHOD_GET; - message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NRF_DISC; - message.h.api.version = (char *)OGS_SBI_API_VERSION; - message.h.resource.name = (char *)OGS_SBI_RESOURCE_NAME_NF_INSTANCES; - - message.param.target_nf_type = target_nf_type; - message.param.requester_nf_type = requester_nf_type; - - request = ogs_sbi_build_request(&message); - ogs_assert(request); - - return request; + return NULL; } diff --git a/src/smf/nnrf-build.h b/src/smf/nnrf-build.h index a2a62fc968..804d6f48a3 100644 --- a/src/smf/nnrf-build.h +++ b/src/smf/nnrf-build.h @@ -27,21 +27,8 @@ extern "C" { #endif -ogs_sbi_request_t *smf_nnrf_build_nf_register( +ogs_sbi_request_t *smf_nnrf_build_test_test( ogs_sbi_nf_instance_t *nf_instance); -ogs_sbi_request_t *smf_nnrf_build_nf_update( - ogs_sbi_nf_instance_t *nf_instance); -ogs_sbi_request_t *smf_nnrf_build_nf_de_register( - ogs_sbi_nf_instance_t *nf_instance); - -ogs_sbi_request_t *smf_nnrf_build_nf_status_subscribe( - ogs_sbi_subscription_t *subscription); -ogs_sbi_request_t *smf_nnrf_build_nf_status_unsubscribe( - ogs_sbi_subscription_t *subscription); - -ogs_sbi_request_t *smf_nnrf_build_nf_discover( - OpenAPI_nf_type_e target_nf_type, OpenAPI_nf_type_e requester_nf_type); - #ifdef __cplusplus } #endif diff --git a/src/smf/nnrf-handler.c b/src/smf/nnrf-handler.c index b0530b4ada..b213d0156e 100644 --- a/src/smf/nnrf-handler.c +++ b/src/smf/nnrf-handler.c @@ -79,10 +79,12 @@ void smf_nnrf_handle_nf_status_subscribe( duration = diff - (int)VALIDITY_MARGIN; if (duration < (int)VALIDITY_MINIMUM) { - ogs_warn("Validation period [%d seconds, %s] is too small", + ogs_warn("[%s] Validation period [%d seconds, %s] is too small", + subscription->id, (int)diff, SubscriptionData->validity_time); duration = VALIDITY_MINIMUM; - ogs_warn("Forced to %d seconds", VALIDITY_MINIMUM); + ogs_warn("[%s] Forced to %d seconds", + subscription->id, VALIDITY_MINIMUM); } subscription->t_validity = ogs_timer_add(smf_self()->timer_mgr, @@ -94,7 +96,7 @@ void smf_nnrf_handle_nf_status_subscribe( } } -bool smf_nnrf_handle_nf_status_notify(ogs_sbi_server_t *server, +bool smf_nnrf_handle_nf_status_notify( ogs_sbi_session_t *session, ogs_sbi_message_t *message) { ogs_sbi_response_t *response = NULL; @@ -147,7 +149,6 @@ bool smf_nnrf_handle_nf_status_notify(ogs_sbi_server_t *server, if (NotificationData->event == OpenAPI_notification_event_type_NF_REGISTERED) { - ogs_sbi_client_t *client = NULL; nf_instance = ogs_sbi_nf_instance_find(NFProfile->nf_instance_id); if (!nf_instance) { @@ -155,41 +156,47 @@ bool smf_nnrf_handle_nf_status_notify(ogs_sbi_server_t *server, ogs_assert(nf_instance); smf_nf_fsm_init(nf_instance); - ogs_info("(NRF-notify) NF registered [%s]", nf_instance->id); - } else - ogs_warn("(NRF-notify) NF [%s] has already been added", + + ogs_info("[%s] (NRF-notify) NF registered", nf_instance->id); + } else { + OGS_FSM_TRAN(&nf_instance->sm, smf_nf_state_registered); + ogs_fsm_dispatch(&nf_instance->sm, NULL); + + ogs_warn("[%s] (NRF-notify) NF has already been added", NFProfile->nf_instance_id); + } handled = ogs_sbi_nnrf_handle_nf_profile( nf_instance, NFProfile, session, message); - if (!handled) return false; - - ogs_info("(NRF-notify) NF Profile updated [%s]", nf_instance->id); - - client = ogs_sbi_nf_instance_find_client(nf_instance); - if (!client) { - ogs_error("Cannot find client [%s]", nf_instance->id); - ogs_sbi_server_send_error(session, - OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "Cannot find client", nf_instance->id); + if (!handled) { + SMF_NF_INSTANCE_CLEAR("NRF-notify", nf_instance); return false; } - smf_sbi_nf_associate_client(nf_instance, client); + + ogs_info("[%s] (NRF-notify) NF Profile updated", nf_instance->id); + + handled = ogs_sbi_client_associate(nf_instance); + if (!handled) { + ogs_error("[%s] Cannot associate NF EndPoint", nf_instance->id); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_BAD_REQUEST, + message, "Cannot find NF EndPoint", nf_instance->id); + SMF_NF_INSTANCE_CLEAR("NRF-notify", nf_instance); + return false; + } + + smf_sbi_setup_client_callback(nf_instance); } else if (NotificationData->event == OpenAPI_notification_event_type_NF_DEREGISTERED) { nf_instance = ogs_sbi_nf_instance_find(NFProfile->nf_instance_id); if (nf_instance) { - ogs_info("(NRF-notify) NF de-registered [%s]", nf_instance->id); - smf_nf_fsm_fini(nf_instance); - ogs_sbi_nf_instance_remove(nf_instance); - - /* FIXME : Remove unnecessary Client */ + SMF_NF_INSTANCE_CLEAR("NRF-notify", nf_instance); } else { - ogs_warn("(NRF-notify) Not found [%s]", NFProfile->nf_instance_id); + ogs_warn("[%s] (NRF-notify) Not found", NFProfile->nf_instance_id); ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_NOT_FOUND, - message, "Not found", message->h.resource.id); + message, "Not found", message->h.resource.component[1]); return false; } } else { @@ -203,10 +210,9 @@ bool smf_nnrf_handle_nf_status_notify(ogs_sbi_server_t *server, return false; } - response = ogs_sbi_build_response(message); + response = ogs_sbi_build_response(message, OGS_SBI_HTTP_STATUS_NO_CONTENT); ogs_assert(response); - ogs_sbi_server_send_response(session, response, - OGS_SBI_HTTP_STATUS_NO_CONTENT); + ogs_sbi_server_send_response(session, response); return true; } @@ -228,7 +234,6 @@ void smf_nnrf_handle_nf_discover(ogs_sbi_message_t *message) OpenAPI_list_for_each(SearchResult->nf_instances, node) { OpenAPI_nf_profile_t *NFProfile = NULL; ogs_sbi_nf_instance_t *nf_instance = NULL; - ogs_sbi_client_t *client = NULL; if (!node->data) continue; @@ -240,26 +245,43 @@ void smf_nnrf_handle_nf_discover(ogs_sbi_message_t *message) ogs_assert(nf_instance); smf_nf_fsm_init(nf_instance); - ogs_info("(NF-discover) NF registered [%s]", nf_instance->id); - } else - ogs_warn("(NF-discover) NF [%s] has already been added", + ogs_info("[%s] (NF-discover) NF registered", nf_instance->id); + } else { + OGS_FSM_TRAN(&nf_instance->sm, smf_nf_state_registered); + ogs_fsm_dispatch(&nf_instance->sm, NULL); + + ogs_warn("[%s] (NF-discover) NF has already been added", NFProfile->nf_instance_id); + } if (NF_INSTANCE_IS_OTHERS(nf_instance->id)) { handled = ogs_sbi_nnrf_handle_nf_profile( nf_instance, NFProfile, NULL, NULL); if (!handled) { - ogs_error("ogs_sbi_nnrf_handle_nf_profile() failed [%s]", + ogs_error("[%s] ogs_sbi_nnrf_handle_nf_profile() failed", nf_instance->id); + SMF_NF_INSTANCE_CLEAR("NRF-discover", nf_instance); continue; } - client = ogs_sbi_nf_instance_find_client(nf_instance); - if (!client) { - ogs_error("Cannot find client [%s]", nf_instance->id); + handled = ogs_sbi_client_associate(nf_instance); + if (!handled) { + ogs_error("[%s] Cannot assciate NF EndPoint", nf_instance->id); + SMF_NF_INSTANCE_CLEAR("NRF-discover", nf_instance); continue; } - smf_sbi_nf_associate_client(nf_instance, client); + + smf_sbi_setup_client_callback(nf_instance); + +#if 0 + if (!OGS_SBI_NF_INSTANCE_GET( + amf_ue->nf_types, nf_instance->nf_type)) + ogs_sbi_nf_types_associate(amf_ue->nf_types, + nf_instance->nf_type, amf_nf_state_registered); +#else + ogs_assert_if_reached(); /* TODO implement */ +#endif + /* TIME : Update validity from NRF */ if (SearchResult->validity_period) { @@ -270,9 +292,10 @@ void smf_nnrf_handle_nf_discover(ogs_sbi_message_t *message) ogs_time_from_sec(nf_instance->time.validity)); } else - ogs_warn("NF Instance validity-time should not 0"); + ogs_warn("[%s] NF Instance validity-time should not 0", + nf_instance->id); - ogs_info("(NF-discover) NF Profile updated [%s]", nf_instance->id); + ogs_info("[%s] (NF-discover) NF Profile updated", nf_instance->id); } } } diff --git a/src/smf/nnrf-handler.h b/src/smf/nnrf-handler.h index ed000cb969..2dede51324 100644 --- a/src/smf/nnrf-handler.h +++ b/src/smf/nnrf-handler.h @@ -20,7 +20,6 @@ #ifndef SMF_NNRF_HANDLER_H #define SMF_NNRF_HANDLER_H -#include "ogs-sbi.h" #include "context.h" #ifdef __cplusplus @@ -32,7 +31,7 @@ void smf_nnrf_handle_nf_register( void smf_nnrf_handle_nf_status_subscribe( ogs_sbi_subscription_t *subscription, ogs_sbi_message_t *message); -bool smf_nnrf_handle_nf_status_notify(ogs_sbi_server_t *server, +bool smf_nnrf_handle_nf_status_notify( ogs_sbi_session_t *session, ogs_sbi_message_t *message); void smf_nnrf_handle_nf_discover(ogs_sbi_message_t *message); diff --git a/src/smf/sbi-path.c b/src/smf/sbi-path.c index 2661c2ccc0..16a5296ee5 100644 --- a/src/smf/sbi-path.c +++ b/src/smf/sbi-path.c @@ -71,25 +71,22 @@ static int client_cb(ogs_sbi_response_t *response, void *data) int smf_sbi_open(void) { ogs_sbi_nf_instance_t *nf_instance = NULL; - ogs_sbi_client_t *client = NULL; ogs_sbi_server_start_all(server_cb); - ogs_list_for_each(&ogs_sbi_self()->client_list, client) { + ogs_list_for_each(&ogs_sbi_self()->nf_instance_list, nf_instance) { ogs_sbi_nf_service_t *service = NULL; - nf_instance = ogs_sbi_nf_instance_build_default( - smf_self()->nf_type, client); - ogs_assert(nf_instance); + ogs_sbi_nf_instance_build_default(nf_instance, smf_self()->nf_type); service = ogs_sbi_nf_service_build_default(nf_instance, - (char*)OGS_SBI_SERVICE_NAME_SMF_PDUSESSION, client); + (char*)OGS_SBI_SERVICE_NAME_NSMF_PDUSESSION); ogs_assert(service); ogs_sbi_nf_service_add_version(service, (char*)OGS_SBI_API_VERSION, (char*)OGS_SBI_API_FULL_VERSION, NULL); - smf_sbi_nf_associate_client(nf_instance, client); smf_nf_fsm_init(nf_instance); + smf_sbi_setup_client_callback(nf_instance); } return OGS_OK; @@ -100,100 +97,20 @@ void smf_sbi_close(void) ogs_sbi_server_stop_all(); } -void smf_sbi_nf_associate_client( - ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_client_t *client) +void smf_sbi_setup_client_callback(ogs_sbi_nf_instance_t *nf_instance) { + ogs_sbi_client_t *client = NULL; + ogs_sbi_nf_service_t *nf_service = NULL; ogs_assert(nf_instance); + + client = nf_instance->client; ogs_assert(client); - OGS_SETUP_SBI_CLIENT(nf_instance, client); client->cb = client_cb; -} - -void smf_sbi_send_nf_register(ogs_sbi_nf_instance_t *nf_instance) -{ - ogs_sbi_request_t *request = NULL; - ogs_sbi_client_t *client = NULL; - - ogs_assert(nf_instance); - client = nf_instance->client; - ogs_assert(client); - - request = smf_nnrf_build_nf_register(nf_instance); - ogs_assert(request); - ogs_sbi_client_send_request(client, request, nf_instance); -} - -void smf_sbi_send_nf_update(ogs_sbi_nf_instance_t *nf_instance) -{ - ogs_sbi_request_t *request = NULL; - ogs_sbi_client_t *client = NULL; - - ogs_assert(nf_instance); - client = nf_instance->client; - ogs_assert(client); - - request = smf_nnrf_build_nf_update(nf_instance); - ogs_assert(request); - ogs_sbi_client_send_request(client, request, nf_instance); -} - -void smf_sbi_send_nf_de_register(ogs_sbi_nf_instance_t *nf_instance) -{ - ogs_sbi_request_t *request = NULL; - ogs_sbi_client_t *client = NULL; - - ogs_assert(nf_instance); - client = nf_instance->client; - ogs_assert(client); - - request = smf_nnrf_build_nf_de_register(nf_instance); - ogs_assert(request); - ogs_sbi_client_send_request(client, request, nf_instance); -} - -void smf_sbi_send_nf_status_subscribe(ogs_sbi_client_t *client, - OpenAPI_nf_type_e nf_type, char *nf_instance_id) -{ - ogs_sbi_request_t *request = NULL; - ogs_sbi_subscription_t *subscription = NULL; - - ogs_assert(client); - - subscription = ogs_sbi_subscription_add(); - ogs_assert(subscription); - subscription->client = client; - subscription->nf_type = nf_type; - if (nf_instance_id) - subscription->nf_instance_id = ogs_strdup(nf_instance_id); - - request = smf_nnrf_build_nf_status_subscribe(subscription); - ogs_assert(request); - ogs_sbi_client_send_request(client, request, subscription); -} - -void smf_sbi_send_nf_status_unsubscribe(ogs_sbi_subscription_t *subscription) -{ - ogs_sbi_request_t *request = NULL; - ogs_sbi_client_t *client = NULL; - - ogs_assert(subscription); - client = subscription->client; - ogs_assert(client); - - request = smf_nnrf_build_nf_status_unsubscribe(subscription); - ogs_assert(request); - ogs_sbi_client_send_request(client, request, subscription); -} - -void smf_sbi_send_nf_discover(ogs_sbi_client_t *client, - OpenAPI_nf_type_e target_nf_type, OpenAPI_nf_type_e requester_nf_type) -{ - ogs_sbi_request_t *request = NULL; - - ogs_assert(client); - - request = smf_nnrf_build_nf_discover(target_nf_type, requester_nf_type); - ogs_assert(request); - ogs_sbi_client_send_request(client, request, NULL); + + ogs_list_for_each(&nf_instance->nf_service_list, nf_service) { + client = nf_service->client; + if (client) + client->cb = client_cb; + } } diff --git a/src/smf/sbi-path.h b/src/smf/sbi-path.h index 66e20861f4..8abab22516 100644 --- a/src/smf/sbi-path.h +++ b/src/smf/sbi-path.h @@ -29,20 +29,7 @@ extern "C" { int smf_sbi_open(void); void smf_sbi_close(void); -void smf_sbi_nf_associate_client( - ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_client_t *client); - -void smf_sbi_send_nf_register(ogs_sbi_nf_instance_t *nf_instance); -void smf_sbi_send_nf_update(ogs_sbi_nf_instance_t *nf_instance); -void smf_sbi_send_nf_de_register(ogs_sbi_nf_instance_t *nf_instance); - -void smf_sbi_send_nf_status_subscribe(ogs_sbi_client_t *client, - OpenAPI_nf_type_e nf_type, char *nf_instance_id); -void smf_sbi_send_nf_status_unsubscribe(ogs_sbi_subscription_t *subscription); - -void smf_sbi_send_nf_discover(ogs_sbi_client_t *client, - OpenAPI_nf_type_e target_nf_type, OpenAPI_nf_type_e requester_nf_type); - +void smf_sbi_setup_client_callback(ogs_sbi_nf_instance_t *nf_instance); #ifdef __cplusplus } diff --git a/src/smf/smf-sm.c b/src/smf/smf-sm.c index a95074c764..5ec4c00238 100644 --- a/src/smf/smf-sm.c +++ b/src/smf/smf-sm.c @@ -58,7 +58,6 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e) ogs_pfcp_xact_t *pfcp_xact = NULL; ogs_pfcp_message_t pfcp_message; - ogs_sbi_server_t *server = NULL; ogs_sbi_session_t *session = NULL; ogs_sbi_request_t *sbi_request = NULL; @@ -255,8 +254,6 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e) ogs_assert(sbi_request); session = e->sbi.session; ogs_assert(session); - server = e->sbi.server; - ogs_assert(server); rv = ogs_sbi_parse_request(&sbi_message, sbi_request); if (rv != OGS_OK) { @@ -276,14 +273,13 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e) } SWITCH(sbi_message.h.service.name) - CASE(OGS_SBI_SERVICE_NAME_NRF_NFM) + CASE(OGS_SBI_SERVICE_NAME_NNRF_NFM) - SWITCH(sbi_message.h.resource.name) + SWITCH(sbi_message.h.resource.component[0]) CASE(OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY) SWITCH(sbi_message.h.method) CASE(OGS_SBI_HTTP_METHOD_POST) - smf_nnrf_handle_nf_status_notify( - server, session, &sbi_message); + smf_nnrf_handle_nf_status_notify(session, &sbi_message); break; DEFAULT @@ -298,10 +294,11 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e) DEFAULT ogs_error("Invalid resource name [%s]", - sbi_message.h.resource.name); + sbi_message.h.resource.component[0]); ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, &sbi_message, - "Unknown resource name", sbi_message.h.resource.name); + "Unknown resource name", + sbi_message.h.resource.component[0]); END break; @@ -309,7 +306,7 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e) ogs_error("Invalid API name [%s]", sbi_message.h.service.name); ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, &sbi_message, - "Invalid API name", sbi_message.h.resource.name); + "Invalid API name", sbi_message.h.resource.component[0]); END /* In lib/sbi/server.c, notify_completed() releases 'request' buffer. */ @@ -337,9 +334,9 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e) } SWITCH(sbi_message.h.service.name) - CASE(OGS_SBI_SERVICE_NAME_NRF_NFM) + CASE(OGS_SBI_SERVICE_NAME_NNRF_NFM) - SWITCH(sbi_message.h.resource.name) + SWITCH(sbi_message.h.resource.component[0]) CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES) nf_instance = e->sbi.data; ogs_assert(nf_instance); @@ -381,17 +378,19 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e) DEFAULT ogs_error("Invalid HTTP method [%s]", sbi_message.h.method); + ogs_assert_if_reached(); END break; DEFAULT ogs_error("Invalid resource name [%s]", - sbi_message.h.resource.name); + sbi_message.h.resource.component[0]); + ogs_assert_if_reached(); END break; - CASE(OGS_SBI_SERVICE_NAME_NRF_DISC) - SWITCH(sbi_message.h.resource.name) + CASE(OGS_SBI_SERVICE_NAME_NNRF_DISC) + SWITCH(sbi_message.h.resource.component[0]) CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES) if (sbi_message.res_status == OGS_SBI_HTTP_STATUS_OK) { smf_nnrf_handle_nf_discover(&sbi_message); @@ -403,12 +402,14 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e) DEFAULT ogs_error("Invalid resource name [%s]", - sbi_message.h.resource.name); + sbi_message.h.resource.component[0]); + ogs_assert_if_reached(); END break; DEFAULT ogs_error("Invalid API name [%s]", sbi_message.h.service.name); + ogs_assert_if_reached(); END ogs_sbi_message_free(&sbi_message); @@ -428,14 +429,8 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e) ogs_assert(OGS_FSM_STATE(&nf_instance->sm)); ogs_fsm_dispatch(&nf_instance->sm, e); - if (OGS_FSM_CHECK(&nf_instance->sm, smf_nf_state_de_registered)) { - smf_nf_fsm_fini(nf_instance); - ogs_sbi_nf_instance_remove(nf_instance); - - } else if (OGS_FSM_CHECK(&nf_instance->sm, - smf_nf_state_exception)) { - ogs_error("State machine exception"); - } + if (OGS_FSM_CHECK(&nf_instance->sm, smf_nf_state_exception)) + ogs_error("State machine exception [%d]", e->timer_id); break; case SMF_TIMER_SUBSCRIPTION_VALIDITY: @@ -445,7 +440,7 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e) ogs_info("Subscription validity expired [%s]", subscription->id); ogs_sbi_subscription_remove(subscription); - smf_sbi_send_nf_status_subscribe(subscription->client, + ogs_nnrf_nfm_send_nf_status_subscribe(subscription->client, smf_self()->nf_type, subscription->nf_instance_id); break; diff --git a/src/smf/timer.c b/src/smf/timer.c index 7c12108346..f35f43df7b 100644 --- a/src/smf/timer.c +++ b/src/smf/timer.c @@ -28,6 +28,8 @@ static smf_timer_cfg_t g_smf_timer_cfg[MAX_NUM_OF_SMF_TIMER] = { { .duration = ogs_time_from_sec(12) }, [SMF_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL] = { .duration = ogs_time_from_sec(3) }, + [SMF_TIMER_SBI_CLIENT_WAIT] = + { .duration = ogs_time_from_sec(2) }, }; smf_timer_cfg_t *smf_timer_cfg(smf_timer_e id) @@ -53,6 +55,8 @@ const char *smf_timer_get_name(smf_timer_e id) return "SMF_TIMER_NF_INSTANCE_VALIDITY"; case SMF_TIMER_SUBSCRIPTION_VALIDITY: return "SMF_TIMER_SUBSCRIPTION_VALIDITY"; + case SMF_TIMER_SBI_CLIENT_WAIT: + return "SMF_TIMER_SBI_CLIENT_WAIT"; default: break; } @@ -84,6 +88,12 @@ static void timer_send_event(int timer_id, void *data) e->timer_id = timer_id; e->sbi.data = data; break; + case SMF_TIMER_SBI_CLIENT_WAIT: + e = smf_event_new(SMF_EVT_SBI_TIMER); + ogs_assert(e); + e->timer_id = timer_id; + e->sbi.data = data; + break; default: ogs_fatal("Unknown timer id[%d]", timer_id); ogs_assert_if_reached(); @@ -132,3 +142,8 @@ void smf_timer_subscription_validity(void *data) { timer_send_event(SMF_TIMER_SUBSCRIPTION_VALIDITY, data); } + +void smf_timer_sbi_client_wait_expire(void *data) +{ + timer_send_event(SMF_TIMER_SBI_CLIENT_WAIT, data); +} diff --git a/src/smf/timer.h b/src/smf/timer.h index c39c510092..b113ed6116 100644 --- a/src/smf/timer.h +++ b/src/smf/timer.h @@ -38,6 +38,7 @@ typedef enum { SMF_TIMER_NF_INSTANCE_HEARTBEAT, SMF_TIMER_NF_INSTANCE_VALIDITY, SMF_TIMER_SUBSCRIPTION_VALIDITY, + SMF_TIMER_SBI_CLIENT_WAIT, MAX_NUM_OF_SMF_TIMER, @@ -60,6 +61,7 @@ void smf_timer_nf_instance_heartbeat_interval(void *data); void smf_timer_nf_instance_heartbeat(void *data); void smf_timer_nf_instance_validity(void *data); void smf_timer_subscription_validity(void *data); +void smf_timer_sbi_client_wait_expire(void *data); #ifdef __cplusplus } diff --git a/src/udm/app.c b/src/udm/app.c new file mode 100644 index 0000000000..ab55a8a04c --- /dev/null +++ b/src/udm/app.c @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "ogs-app.h" + +int app_initialize(const char *const argv[]) +{ + int rv; + + rv = udm_initialize(); + if (rv != OGS_OK) { + ogs_error("Failed to intialize UDM"); + return rv; + } + ogs_info("UDM initialize...done"); + + return OGS_OK; +} + +void app_terminate(void) +{ + udm_terminate(); + ogs_info("UDM terminate...done"); +} diff --git a/src/udm/context.c b/src/udm/context.c new file mode 100644 index 0000000000..2f1b4fef13 --- /dev/null +++ b/src/udm/context.c @@ -0,0 +1,229 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "sbi-path.h" + +static udm_context_t self; + +int __udm_log_domain; + +static OGS_POOL(udm_ue_pool, udm_ue_t); + +static int context_initialized = 0; + +void udm_context_init(void) +{ + ogs_assert(context_initialized == 0); + + /* Initialize UDM context */ + memset(&self, 0, sizeof(udm_context_t)); + + ogs_log_install_domain(&__udm_log_domain, "udm", ogs_core()->log.level); + + /* Allocate TWICE the pool to check if maximum number of gNBs is reached */ + ogs_pool_init(&udm_ue_pool, ogs_config()->pool.ue); + + ogs_list_init(&self.udm_ue_list); + self.suci_hash = ogs_hash_make(); + self.supi_hash = ogs_hash_make(); + + context_initialized = 1; +} + +void udm_context_final(void) +{ + ogs_assert(context_initialized == 1); + + udm_ue_remove_all(); + + ogs_assert(self.suci_hash); + ogs_hash_destroy(self.suci_hash); + ogs_assert(self.supi_hash); + ogs_hash_destroy(self.supi_hash); + + ogs_pool_final(&udm_ue_pool); + + context_initialized = 0; +} + +udm_context_t *udm_self(void) +{ + return &self; +} + +static int udm_context_prepare(void) +{ + self.nf_type = OpenAPI_nf_type_UDM; + + return OGS_OK; +} + +static int udm_context_validation(void) +{ + return OGS_OK; +} + +int udm_context_parse_config(void) +{ + int rv; + yaml_document_t *document = NULL; + ogs_yaml_iter_t root_iter; + + document = ogs_config()->document; + ogs_assert(document); + + rv = udm_context_prepare(); + if (rv != OGS_OK) return rv; + + ogs_yaml_iter_init(&root_iter, document); + while (ogs_yaml_iter_next(&root_iter)) { + const char *root_key = ogs_yaml_iter_key(&root_iter); + ogs_assert(root_key); + if (!strcmp(root_key, "udm")) { + ogs_yaml_iter_t udm_iter; + ogs_yaml_iter_recurse(&root_iter, &udm_iter); + while (ogs_yaml_iter_next(&udm_iter)) { + const char *udm_key = ogs_yaml_iter_key(&udm_iter); + ogs_assert(udm_key); + if (!strcmp(udm_key, "sbi")) { + /* handle config in sbi library */ + } else + ogs_warn("unknown key `%s`", udm_key); + } + } + } + + rv = udm_context_validation(); + if (rv != OGS_OK) return rv; + + return OGS_OK; +} + +udm_ue_t *udm_ue_add(char *suci) +{ + udm_event_t e; + udm_ue_t *udm_ue = NULL; + + ogs_assert(suci); + + ogs_pool_alloc(&udm_ue_pool, &udm_ue); + ogs_assert(udm_ue); + memset(udm_ue, 0, sizeof *udm_ue); + + udm_ue->ctx_id = ogs_msprintf("%ld", ogs_pool_index(&udm_ue_pool, udm_ue)); + ogs_assert(udm_ue->ctx_id); + + udm_ue->suci = ogs_strdup(suci); + ogs_assert(udm_ue->suci); + ogs_hash_set(self.suci_hash, udm_ue->suci, strlen(udm_ue->suci), udm_ue); + + udm_ue->supi = ogs_supi_from_suci(udm_ue->suci); + ogs_assert(udm_ue->supi); + ogs_hash_set(self.supi_hash, udm_ue->supi, strlen(udm_ue->supi), udm_ue); + + udm_ue->sbi_client_wait.timer = ogs_timer_add(udm_self()->timer_mgr, + udm_timer_sbi_client_wait_expire, udm_ue); + + e.udm_ue = udm_ue; + ogs_fsm_create(&udm_ue->sm, udm_ue_state_initial, udm_ue_state_final); + ogs_fsm_init(&udm_ue->sm, &e); + + ogs_list_add(&self.udm_ue_list, udm_ue); + + return udm_ue; +} + +void udm_ue_remove(udm_ue_t *udm_ue) +{ + udm_event_t e; + int i; + + ogs_assert(udm_ue); + + ogs_list_remove(&self.udm_ue_list, udm_ue); + + e.udm_ue = udm_ue; + ogs_fsm_fini(&udm_ue->sm, &e); + ogs_fsm_delete(&udm_ue->sm); + + ogs_timer_delete(udm_ue->sbi_client_wait.timer); + + ogs_assert(udm_ue->ctx_id); + ogs_free(udm_ue->ctx_id); + + ogs_assert(udm_ue->suci); + ogs_hash_set(self.suci_hash, udm_ue->suci, strlen(udm_ue->suci), NULL); + ogs_free(udm_ue->suci); + + ogs_assert(udm_ue->supi); + ogs_hash_set(self.supi_hash, udm_ue->supi, strlen(udm_ue->supi), NULL); + ogs_free(udm_ue->supi); + + if (udm_ue->state.component1) + ogs_free(udm_ue->state.component1); + + if (udm_ue->serving_network_name) + ogs_free(udm_ue->serving_network_name); + if (udm_ue->ausf_instance_id) + ogs_free(udm_ue->ausf_instance_id); + if (udm_ue->auth_timestamp) + ogs_free(udm_ue->auth_timestamp); + + for (i = 0; i < OGS_SBI_MAX_NF_TYPE; i++) { + if (udm_ue->nf_types[i].nf_instance) + ogs_sbi_nf_instance_remove(udm_ue->nf_types[i].nf_instance); + } + + ogs_pool_free(&udm_ue_pool, udm_ue); +} + +void udm_ue_remove_all() +{ + udm_ue_t *udm_ue = NULL, *next = NULL;; + + ogs_list_for_each_safe(&self.udm_ue_list, next, udm_ue) + udm_ue_remove(udm_ue); +} + +udm_ue_t *udm_ue_find_by_suci(char *suci) +{ + ogs_assert(suci); + return (udm_ue_t *)ogs_hash_get(self.suci_hash, suci, strlen(suci)); +} + +udm_ue_t *udm_ue_find_by_supi(char *supi) +{ + ogs_assert(supi); + return (udm_ue_t *)ogs_hash_get(self.supi_hash, supi, strlen(supi)); +} + +udm_ue_t *udm_ue_find_by_suci_or_supi(char *suci_or_supi) +{ + ogs_assert(suci_or_supi); + if (strncmp(suci_or_supi, "suci-", strlen("suci-")) == 0) + return udm_ue_find_by_suci(suci_or_supi); + else + return udm_ue_find_by_supi(suci_or_supi); +} + +udm_ue_t *udm_ue_find_by_ctx_id(char *ctx_id) +{ + ogs_assert(ctx_id); + return ogs_pool_find(&udm_ue_pool, atoll(ctx_id)); +} diff --git a/src/udm/context.h b/src/udm/context.h new file mode 100644 index 0000000000..03a5a56f99 --- /dev/null +++ b/src/udm/context.h @@ -0,0 +1,115 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef UDM_CONTEXT_H +#define UDM_CONTEXT_H + +#include "ogs-app.h" +#include "ogs-crypt.h" +#include "ogs-sbi.h" + +#include "udm-sm.h" +#include "timer.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define MAX_NUM_OF_SERVED_GUAMI 8 + +extern int __udm_log_domain; + +#undef OGS_LOG_DOMAIN +#define OGS_LOG_DOMAIN __udm_log_domain + +typedef struct udm_context_s { + ogs_queue_t *queue; /* Queue for processing UPF control */ + ogs_timer_mgr_t *timer_mgr; /* Timer Manager */ + ogs_pollset_t *pollset; /* Poll Set for I/O Multiplexing */ + + OpenAPI_nf_type_e nf_type; + + ogs_list_t udm_ue_list; + ogs_hash_t *suci_hash; + ogs_hash_t *supi_hash; + +} udm_context_t; + +struct udm_ue_s { + ogs_lnode_t lnode; + ogs_fsm_t sm; /* A state machine */ + + struct { + char *component1; + } state; + + char *ctx_id; + char *suci; + char *supi; + char *serving_network_name; + char *ausf_instance_id; + + OpenAPI_auth_type_e auth_type; + int auth_success; + char *auth_timestamp; + + struct { + ogs_timer_t *timer; + } sbi_client_wait; + +#define UDM_NF_INSTANCE_CLEAR(_cAUSE, _nFInstance) \ + do { \ + ogs_assert(_nFInstance); \ + if ((_nFInstance)->reference_count == 1) { \ + ogs_info("[%s] (%s) NF removed", (_nFInstance)->id, (_cAUSE)); \ + udm_nf_fsm_fini((_nFInstance)); \ + } else { \ + /* There is an assocation with other context */ \ + ogs_info("[%s:%d] (%s) NF suspended", \ + _nFInstance->id, _nFInstance->reference_count, (_cAUSE)); \ + OGS_FSM_TRAN(&_nFInstance->sm, udm_nf_state_de_registered); \ + ogs_fsm_dispatch(&_nFInstance->sm, NULL); \ + } \ + ogs_sbi_nf_instance_remove(_nFInstance); \ + } while(0) + + ogs_sbi_nf_types_t nf_types; + + ogs_sbi_session_t *session; +}; + +void udm_context_init(void); +void udm_context_final(void); +udm_context_t *udm_self(void); + +int udm_context_parse_config(void); + +udm_ue_t *udm_ue_add(char *suci); +void udm_ue_remove(udm_ue_t *udm_ue); +void udm_ue_remove_all(void); +udm_ue_t *udm_ue_find_by_suci(char *suci); +udm_ue_t *udm_ue_find_by_supi(char *supi); +udm_ue_t *udm_ue_find_by_suci_or_supi(char *suci_or_supi); +udm_ue_t *udm_ue_find_by_ctx_id(char *ctx_id); + +#ifdef __cplusplus +} +#endif + +#endif /* UDM_CONTEXT_H */ diff --git a/src/udm/event.c b/src/udm/event.c new file mode 100644 index 0000000000..d87ff1775a --- /dev/null +++ b/src/udm/event.c @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "event.h" +#include "context.h" + +#define EVENT_POOL 32 /* FIXME : 32 */ +static OGS_POOL(pool, udm_event_t); + +void udm_event_init(void) +{ + ogs_pool_init(&pool, EVENT_POOL); + + udm_self()->queue = ogs_queue_create(EVENT_POOL); + ogs_assert(udm_self()->queue); + udm_self()->timer_mgr = ogs_timer_mgr_create(); + ogs_assert(udm_self()->timer_mgr); + udm_self()->pollset = ogs_pollset_create(); + ogs_assert(udm_self()->pollset); +} + +void udm_event_final(void) +{ + if (udm_self()->pollset) + ogs_pollset_destroy(udm_self()->pollset); + if (udm_self()->timer_mgr) + ogs_timer_mgr_destroy(udm_self()->timer_mgr); + if (udm_self()->queue) + ogs_queue_destroy(udm_self()->queue); + + ogs_pool_final(&pool); +} + +udm_event_t *udm_event_new(udm_event_e id) +{ + udm_event_t *e = NULL; + + ogs_pool_alloc(&pool, &e); + ogs_assert(e); + memset(e, 0, sizeof(*e)); + + e->id = id; + + return e; +} + +void udm_event_free(udm_event_t *e) +{ + ogs_assert(e); + ogs_pool_free(&pool, e); +} + +const char *udm_event_get_name(udm_event_t *e) +{ + if (e == NULL) + return OGS_FSM_NAME_INIT_SIG; + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + return OGS_FSM_NAME_ENTRY_SIG; + case OGS_FSM_EXIT_SIG: + return OGS_FSM_NAME_EXIT_SIG; + + case UDM_EVT_SBI_SERVER: + return "UDM_EVT_SBI_SERVER"; + case UDM_EVT_SBI_CLIENT: + return "UDM_EVT_SBI_CLIENT"; + case UDM_EVT_SBI_TIMER: + return "UDM_EVT_SBI_TIMER"; + + default: + break; + } + + return "UNKNOWN_EVENT"; +} diff --git a/src/udm/event.h b/src/udm/event.h new file mode 100644 index 0000000000..e67ff6a8d0 --- /dev/null +++ b/src/udm/event.h @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef UDM_EVENT_H +#define UDM_EVENT_H + +#include "ogs-core.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct ogs_sbi_server_s ogs_sbi_server_t; +typedef struct ogs_sbi_session_s ogs_sbi_session_t; +typedef struct ogs_sbi_request_s ogs_sbi_request_t; +typedef struct ogs_sbi_response_s ogs_sbi_response_t; +typedef struct ogs_sbi_message_s ogs_sbi_message_t; +typedef struct ogs_sbi_nf_instance_s ogs_sbi_nf_instance_t; +typedef struct ogs_sbi_subscription_s ogs_sbi_subscription_t; + +typedef struct udm_ue_s udm_ue_t; + +typedef enum { + UDM_EVT_BASE = OGS_FSM_USER_SIG, + + UDM_EVT_SBI_SERVER, + UDM_EVT_SBI_CLIENT, + UDM_EVT_SBI_TIMER, + + UDM_EVT_TOP, + +} udm_event_e; + +typedef struct udm_event_s { + int id; + int timer_id; + + struct { + /* OGS_EVT_SBI_SERVER */ + ogs_sbi_request_t *request; + ogs_sbi_session_t *session; + ogs_sbi_server_t *server; + + /* OGS_EVT_SBI_CLIENT */ + ogs_sbi_response_t *response; + void *data; + + ogs_sbi_message_t *message; + } sbi; + + udm_ue_t *udm_ue; + + ogs_timer_t *timer; +} udm_event_t; + +void udm_event_init(void); +void udm_event_final(void); + +udm_event_t *udm_event_new(udm_event_e id); +void udm_event_free(udm_event_t *e); + +const char *udm_event_get_name(udm_event_t *e); + +#ifdef __cplusplus +} +#endif + +#endif /* UDM_EVENT_H */ diff --git a/src/udm/init.c b/src/udm/init.c new file mode 100644 index 0000000000..2362c4f1e1 --- /dev/null +++ b/src/udm/init.c @@ -0,0 +1,134 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "context.h" + +static ogs_thread_t *thread; +static void udm_main(void *data); +static int initialized = 0; + +int udm_initialize() +{ + int rv; + + udm_context_init(); + udm_event_init(); /* Create event with poll, timer */ + ogs_sbi_context_init(udm_self()->pollset, udm_self()->timer_mgr); + + rv = ogs_sbi_context_parse_config("udm", "nrf"); + if (rv != OGS_OK) return rv; + + rv = udm_context_parse_config(); + if (rv != OGS_OK) return rv; + + rv = ogs_log_config_domain( + ogs_config()->logger.domain, ogs_config()->logger.level); + if (rv != OGS_OK) return rv; + + thread = ogs_thread_create(udm_main, NULL); + if (!thread) return OGS_ERROR; + + initialized = 1; + + return OGS_OK; +} + +static ogs_timer_t *t_termination_holding = NULL; + +static void event_termination(void) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + + /* Sending NF Instance De-registeration to NRF */ + ogs_list_for_each(&ogs_sbi_self()->nf_instance_list, nf_instance) + udm_nf_fsm_fini(nf_instance); + + /* Starting holding timer */ + t_termination_holding = ogs_timer_add(udm_self()->timer_mgr, NULL, NULL); + ogs_assert(t_termination_holding); +#define TERMINATION_HOLDING_TIME ogs_time_from_msec(300) + ogs_timer_start(t_termination_holding, TERMINATION_HOLDING_TIME); + + /* Sending termination event to the queue */ + ogs_queue_term(udm_self()->queue); + ogs_pollset_notify(udm_self()->pollset); +} + +void udm_terminate(void) +{ + if (!initialized) return; + + /* Daemon terminating */ + event_termination(); + ogs_thread_destroy(thread); + ogs_timer_delete(t_termination_holding); + + udm_context_final(); + ogs_sbi_context_final(); + + udm_event_final(); /* Destroy event */ +} + +static void udm_main(void *data) +{ + ogs_fsm_t udm_sm; + int rv; + + ogs_fsm_create(&udm_sm, udm_state_initial, udm_state_final); + ogs_fsm_init(&udm_sm, 0); + + for ( ;; ) { + ogs_pollset_poll(udm_self()->pollset, + ogs_timer_mgr_next(udm_self()->timer_mgr)); + + /* + * After ogs_pollset_poll(), ogs_timer_mgr_expire() must be called. + * + * The reason is why ogs_timer_mgr_next() can get the corrent value + * when ogs_timer_stop() is called internally in ogs_timer_mgr_expire(). + * + * You should not use event-queue before ogs_timer_mgr_expire(). + * In this case, ogs_timer_mgr_expire() does not work + * because 'if rv == OGS_DONE' statement is exiting and + * not calling ogs_timer_mgr_expire(). + */ + ogs_timer_mgr_expire(udm_self()->timer_mgr); + + for ( ;; ) { + udm_event_t *e = NULL; + + rv = ogs_queue_trypop(udm_self()->queue, (void**)&e); + ogs_assert(rv != OGS_ERROR); + + if (rv == OGS_DONE) + goto done; + + if (rv == OGS_RETRY) + break; + + ogs_assert(e); + ogs_fsm_dispatch(&udm_sm, e); + udm_event_free(e); + } + } +done: + + ogs_fsm_fini(&udm_sm, 0); + ogs_fsm_delete(&udm_sm); +} diff --git a/src/udm/meson.build b/src/udm/meson.build new file mode 100644 index 0000000000..cdab3e909c --- /dev/null +++ b/src/udm/meson.build @@ -0,0 +1,63 @@ +# Copyright (C) 2019,2020 by Sukchan Lee + +# This file is part of Open5GS. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +libudm_sources = files(''' + context.c + event.c + timer.c + + nnrf-handler.c + nf-sm.c + + nudm-handler.c + + nudr-build.c + nudr-handler.c + ue-sm.c + + sbi-path.c + udm-sm.c + + init.c +'''.split()) + +libudm = static_library('udm', + sources : libudm_sources, + link_with : libipfw, + dependencies : [libapp_dep, + libcrypt_dep, + libsbi_dep], + install : false) + +libudm_dep = declare_dependency( + link_with : libudm, + dependencies : [libapp_dep, + libcrypt_dep, + libsbi_dep]) + +udm_sources = files(''' + app.c + ../main.c +'''.split()) + +executable('open5gs-udmd', + sources : udm_sources, + c_args : '-DDEFAULT_CONFIG_FILENAME="@0@/udm.yaml"'.format(open5gs_sysconfdir), + include_directories : srcinc, + dependencies : libudm_dep, + install_rpath : libdir, + install : true) diff --git a/src/udm/nf-sm.c b/src/udm/nf-sm.c new file mode 100644 index 0000000000..80215655b1 --- /dev/null +++ b/src/udm/nf-sm.c @@ -0,0 +1,390 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "context.h" + +#include "sbi-path.h" +#include "nnrf-handler.h" + +void udm_nf_fsm_init(ogs_sbi_nf_instance_t *nf_instance) +{ + udm_event_t e; + + ogs_assert(nf_instance); + + e.sbi.data = nf_instance; + + ogs_fsm_create(&nf_instance->sm, + udm_nf_state_initial, udm_nf_state_final); + ogs_fsm_init(&nf_instance->sm, &e); +} + +void udm_nf_fsm_fini(ogs_sbi_nf_instance_t *nf_instance) +{ + udm_event_t e; + + ogs_assert(nf_instance); + e.sbi.data = nf_instance; + + ogs_fsm_fini(&nf_instance->sm, &e); + ogs_fsm_delete(&nf_instance->sm); +} + +void udm_nf_state_initial(ogs_fsm_t *s, udm_event_t *e) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + + ogs_assert(s); + ogs_assert(e); + + udm_sm_debug(e); + + nf_instance = e->sbi.data; + ogs_assert(nf_instance); + ogs_assert(nf_instance->id); + + nf_instance->t_registration_interval = ogs_timer_add(udm_self()->timer_mgr, + udm_timer_nf_instance_registration_interval, nf_instance); + ogs_assert(nf_instance->t_registration_interval); + nf_instance->t_heartbeat_interval = ogs_timer_add(udm_self()->timer_mgr, + udm_timer_nf_instance_heartbeat_interval, nf_instance); + ogs_assert(nf_instance->t_heartbeat_interval); + nf_instance->t_heartbeat = ogs_timer_add(udm_self()->timer_mgr, + udm_timer_nf_instance_heartbeat, nf_instance); + ogs_assert(nf_instance->t_heartbeat); + nf_instance->t_validity = ogs_timer_add(udm_self()->timer_mgr, + udm_timer_nf_instance_validity, nf_instance); + ogs_assert(nf_instance->t_validity); + + if (NF_INSTANCE_IS_SELF(nf_instance->id)) { + OGS_FSM_TRAN(s, &udm_nf_state_will_register); + } else { + OGS_FSM_TRAN(s, &udm_nf_state_registered); + } +} + +void udm_nf_state_final(ogs_fsm_t *s, udm_event_t *e) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + + ogs_assert(s); + ogs_assert(e); + + udm_sm_debug(e); + + nf_instance = e->sbi.data; + ogs_assert(nf_instance); + + ogs_timer_delete(nf_instance->t_registration_interval); + ogs_timer_delete(nf_instance->t_heartbeat_interval); + ogs_timer_delete(nf_instance->t_heartbeat); + ogs_timer_delete(nf_instance->t_validity); +} + +void udm_nf_state_will_register(ogs_fsm_t *s, udm_event_t *e) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + ogs_sbi_client_t *client = NULL; + ogs_sbi_message_t *message = NULL; + ogs_sockaddr_t *addr = NULL; + + ogs_assert(s); + ogs_assert(e); + + udm_sm_debug(e); + + nf_instance = e->sbi.data; + ogs_assert(nf_instance); + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + ogs_timer_start(nf_instance->t_registration_interval, + udm_timer_cfg(UDM_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL)-> + duration); + + ogs_nnrf_nfm_send_nf_register(nf_instance); + break; + + case OGS_FSM_EXIT_SIG: + ogs_timer_stop(nf_instance->t_registration_interval); + break; + + case UDM_EVT_SBI_CLIENT: + message = e->sbi.message; + ogs_assert(message); + + SWITCH(message->h.service.name) + CASE(OGS_SBI_SERVICE_NAME_NNRF_NFM) + + SWITCH(message->h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES) + + if (message->res_status == OGS_SBI_HTTP_STATUS_OK || + message->res_status == OGS_SBI_HTTP_STATUS_CREATED) { + udm_nnrf_handle_nf_register(nf_instance, message); + OGS_FSM_TRAN(s, &udm_nf_state_registered); + } else { + ogs_error("[%s] HTTP response error [%d]", + nf_instance->id, message->res_status); + OGS_FSM_TRAN(s, &udm_nf_state_exception); + } + break; + + DEFAULT + ogs_error("[%s] Invalid resource name [%s]", + nf_instance->id, message->h.resource.component[0]); + END + break; + + DEFAULT + ogs_error("[%s] Invalid API name [%s]", + nf_instance->id, message->h.service.name); + END + break; + + case UDM_EVT_SBI_TIMER: + switch(e->timer_id) { + case UDM_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL: + client = nf_instance->client; + ogs_assert(client); + addr = client->addr; + ogs_assert(addr); + + ogs_warn("[%s] Retry to registration with NRF", nf_instance->id); + + ogs_timer_start(nf_instance->t_registration_interval, + udm_timer_cfg(UDM_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL)-> + duration); + + ogs_nnrf_nfm_send_nf_register(nf_instance); + break; + + default: + ogs_error("[%s] Unknown timer[%s:%d]", nf_instance->id, + udm_timer_get_name(e->timer_id), e->timer_id); + } + break; + + default: + ogs_error("Unknown event %s", udm_event_get_name(e)); + break; + } +} + +void udm_nf_state_registered(ogs_fsm_t *s, udm_event_t *e) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + ogs_sbi_client_t *client = NULL; + ogs_sbi_message_t *message = NULL; + ogs_assert(s); + ogs_assert(e); + + udm_sm_debug(e); + + nf_instance = e->sbi.data; + ogs_assert(nf_instance); + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + if (NF_INSTANCE_IS_SELF(nf_instance->id)) { + ogs_info("[%s] NF registered", nf_instance->id); + + client = nf_instance->client; + ogs_assert(client); + + if (nf_instance->time.heartbeat) { + ogs_timer_start(nf_instance->t_heartbeat_interval, + ogs_time_from_sec(nf_instance->time.heartbeat)); + ogs_timer_start(nf_instance->t_heartbeat, + ogs_time_from_sec(nf_instance->time.heartbeat * + OGS_SBI_HEARTBEAT_RETRYCOUNT)); + } + + ogs_nnrf_nfm_send_nf_status_subscribe(client, + udm_self()->nf_type, nf_instance->id); + } + + break; + + case OGS_FSM_EXIT_SIG: + if (NF_INSTANCE_IS_SELF(nf_instance->id)) { + ogs_info("[%s] NF de-registered", nf_instance->id); + + if (nf_instance->time.heartbeat) { + ogs_timer_stop(nf_instance->t_heartbeat_interval); + ogs_timer_stop(nf_instance->t_heartbeat); + } + + ogs_nnrf_nfm_send_nf_de_register(nf_instance); + } + break; + + case UDM_EVT_SBI_CLIENT: + message = e->sbi.message; + ogs_assert(message); + + SWITCH(message->h.service.name) + CASE(OGS_SBI_SERVICE_NAME_NNRF_NFM) + + SWITCH(message->h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES) + + if (message->res_status == OGS_SBI_HTTP_STATUS_NO_CONTENT || + message->res_status == OGS_SBI_HTTP_STATUS_OK) { + if (nf_instance->time.heartbeat) + ogs_timer_start(nf_instance->t_heartbeat, + ogs_time_from_sec(nf_instance->time.heartbeat * + OGS_SBI_HEARTBEAT_RETRYCOUNT)); + } else { + ogs_error("[%s] HTTP response error [%d]", + nf_instance->id, message->res_status); + } + + break; + + DEFAULT + ogs_error("[%s] Invalid resource name [%s]", + nf_instance->id, message->h.resource.component[0]); + END + break; + + DEFAULT + ogs_error("[%s] Invalid API name [%s]", + nf_instance->id, message->h.service.name); + END + break; + + case UDM_EVT_SBI_TIMER: + switch(e->timer_id) { + case UDM_TIMER_NF_INSTANCE_HEARTBEAT_INTERVAL: + if (nf_instance->time.heartbeat) { + ogs_timer_start(nf_instance->t_heartbeat_interval, + ogs_time_from_sec(nf_instance->time.heartbeat)); + } + + ogs_nnrf_nfm_send_nf_update(nf_instance); + break; + + case UDM_TIMER_NF_INSTANCE_HEARTBEAT: + OGS_FSM_TRAN(s, &udm_nf_state_will_register); + break; + + case UDM_TIMER_NF_INSTANCE_VALIDITY: + if (NF_INSTANCE_IS_OTHERS(nf_instance->id)) { + ogs_info("[%s] NF expired", nf_instance->id); + OGS_FSM_TRAN(s, &udm_nf_state_de_registered); + } + break; + + default: + ogs_error("[%s] Unknown timer[%s:%d]", nf_instance->id, + udm_timer_get_name(e->timer_id), e->timer_id); + break; + } + break; + + default: + ogs_error("[%s] Unknown event %s", + nf_instance->id, udm_event_get_name(e)); + break; + } +} + +void udm_nf_state_de_registered(ogs_fsm_t *s, udm_event_t *e) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + ogs_assert(s); + ogs_assert(e); + + udm_sm_debug(e); + + nf_instance = e->sbi.data; + ogs_assert(nf_instance); + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + if (NF_INSTANCE_IS_SELF(nf_instance->id)) { + ogs_info("[%s] NF de-registered", nf_instance->id); + } + break; + + case OGS_FSM_EXIT_SIG: + break; + + default: + ogs_error("[%s] Unknown event %s", + nf_instance->id, udm_event_get_name(e)); + break; + } +} + +void udm_nf_state_exception(ogs_fsm_t *s, udm_event_t *e) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + ogs_sbi_client_t *client = NULL; + ogs_sockaddr_t *addr = NULL; + ogs_assert(s); + ogs_assert(e); + + udm_sm_debug(e); + + nf_instance = e->sbi.data; + ogs_assert(nf_instance); + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + if (NF_INSTANCE_IS_SELF(nf_instance->id)) { + ogs_timer_start(nf_instance->t_registration_interval, + udm_timer_cfg(UDM_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL)-> + duration); + } + break; + + case OGS_FSM_EXIT_SIG: + if (NF_INSTANCE_IS_SELF(nf_instance->id)) { + ogs_timer_stop(nf_instance->t_registration_interval); + } + break; + + case UDM_EVT_SBI_TIMER: + switch(e->timer_id) { + case UDM_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL: + client = nf_instance->client; + ogs_assert(client); + addr = client->addr; + ogs_assert(addr); + + ogs_warn("[%s] Retry to registration with NRF", nf_instance->id); + + OGS_FSM_TRAN(s, &udm_nf_state_will_register); + break; + + default: + ogs_error("[%s] Unknown timer[%s:%d]", nf_instance->id, + udm_timer_get_name(e->timer_id), e->timer_id); + break; + } + break; + + default: + ogs_error("[%s] Unknown event %s", + nf_instance->id, udm_event_get_name(e)); + break; + } +} diff --git a/src/udm/nnrf-handler.c b/src/udm/nnrf-handler.c new file mode 100644 index 0000000000..28c7fbe743 --- /dev/null +++ b/src/udm/nnrf-handler.c @@ -0,0 +1,325 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "sbi-path.h" +#include "nnrf-handler.h" + +void udm_nnrf_handle_nf_register( + ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_message_t *message) +{ + OpenAPI_nf_profile_t *NFProfile = NULL; + ogs_sbi_client_t *client = NULL; + + ogs_assert(message); + ogs_assert(nf_instance); + client = nf_instance->client; + ogs_assert(client); + + NFProfile = message->NFProfile; + if (!NFProfile) { + ogs_error("No NFProfile"); + return; + } + + /* TIME : Update heartbeat from NRF */ + nf_instance->time.heartbeat = NFProfile->heart_beat_timer; +} + +void udm_nnrf_handle_nf_status_subscribe( + ogs_sbi_subscription_t *subscription, ogs_sbi_message_t *message) +{ + OpenAPI_subscription_data_t *SubscriptionData = NULL; + ogs_sbi_client_t *client = NULL; + + ogs_assert(message); + ogs_assert(subscription); + client = subscription->client; + ogs_assert(client); + + SubscriptionData = message->SubscriptionData; + if (!SubscriptionData) { + ogs_error("No SubscriptionData"); + return; + } + + if (!SubscriptionData->subscription_id) { + ogs_error("No SubscriptionId"); + return; + } + ogs_sbi_subscription_set_id( + subscription, SubscriptionData->subscription_id); + + if (SubscriptionData->validity_time) { + struct timeval tv; + struct tm local, next; + ogs_time_t diff, duration; + if (ogs_strptime(SubscriptionData->validity_time, + OGS_TIME_ISO8601_FORMAT, &next)) { + ogs_gettimeofday(&tv); + ogs_localtime(tv.tv_sec, &local); + diff = ogs_mktime(&next) - ogs_mktime(&local); +#define VALIDITY_MARGIN 5 /* 5 seconds */ +#define VALIDITY_MINIMUM 60 /* 60 seconds */ + duration = diff - (int)VALIDITY_MARGIN; + + if (duration < (int)VALIDITY_MINIMUM) { + ogs_warn("[%s] Validation period [%d seconds, %s] is too small", + subscription->id, + (int)diff, SubscriptionData->validity_time); + duration = VALIDITY_MINIMUM; + ogs_warn("[%s] Forced to %d seconds", + subscription->id, VALIDITY_MINIMUM); + } + + subscription->t_validity = ogs_timer_add(udm_self()->timer_mgr, + udm_timer_subscription_validity, subscription); + ogs_assert(subscription->t_validity); + ogs_timer_start( + subscription->t_validity, ogs_time_from_sec(duration)); + } + } +} + +bool udm_nnrf_handle_nf_status_notify( + ogs_sbi_session_t *session, ogs_sbi_message_t *message) +{ + ogs_sbi_response_t *response = NULL; + OpenAPI_notification_data_t *NotificationData = NULL; + OpenAPI_nf_profile_t *NFProfile = NULL; + ogs_sbi_nf_instance_t *nf_instance = NULL; + bool handled; + + ogs_assert(session); + ogs_assert(message); + + NotificationData = message->NotificationData; + if (!NotificationData) { + ogs_error("No NotificationData"); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + message, "No NotificationData", NULL); + return false; + } + + NFProfile = NotificationData->nf_profile; + if (!NFProfile) { + ogs_error("No NFProfile"); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + message, "No NFProfile", NULL); + return false; + } + + if (!NFProfile->nf_instance_id) { + ogs_error("No NFProfile.NFInstanceId"); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + message, "No NFProfile", "NFInstanceId"); + return false; + } + + if (!NFProfile->nf_instance_id) { + ogs_error("No NFProfile.NFInstanceId"); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + message, "No NFProfile", "NFInstanceId"); + return false; + } + + if (NF_INSTANCE_IS_SELF(NFProfile->nf_instance_id)) { + ogs_error("The notification is not allowed [%s]", + NFProfile->nf_instance_id); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_FORBIDDEN, + message, "The notification is not allowed", + NFProfile->nf_instance_id); + return false; + } + + if (NotificationData->event == + OpenAPI_notification_event_type_NF_REGISTERED) { + + nf_instance = ogs_sbi_nf_instance_find(NFProfile->nf_instance_id); + if (!nf_instance) { + nf_instance = ogs_sbi_nf_instance_add(NFProfile->nf_instance_id); + ogs_assert(nf_instance); + + udm_nf_fsm_init(nf_instance); + + ogs_info("[%s] (NRF-notify) NF registered", nf_instance->id); + } else { + OGS_FSM_TRAN(&nf_instance->sm, udm_nf_state_registered); + ogs_fsm_dispatch(&nf_instance->sm, NULL); + + ogs_warn("[%s] (NRF-notify) NF has already been added", + NFProfile->nf_instance_id); + } + + handled = ogs_sbi_nnrf_handle_nf_profile( + nf_instance, NFProfile, session, message); + if (!handled) { + UDM_NF_INSTANCE_CLEAR("NRF-notify", nf_instance); + return false; + } + + ogs_info("[%s] (NRF-notify) NF Profile updated", nf_instance->id); + + handled = ogs_sbi_client_associate(nf_instance); + if (!handled) { + ogs_error("[%s] Cannot associate NF EndPoint", nf_instance->id); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_BAD_REQUEST, + message, "Cannot find NF EndPoint", nf_instance->id); + UDM_NF_INSTANCE_CLEAR("NRF-notify", nf_instance); + return false; + } + + udm_sbi_setup_client_callback(nf_instance); + + } else if (NotificationData->event == + OpenAPI_notification_event_type_NF_DEREGISTERED) { + nf_instance = ogs_sbi_nf_instance_find(NFProfile->nf_instance_id); + if (nf_instance) { + UDM_NF_INSTANCE_CLEAR("NRF-notify", nf_instance); + } else { + ogs_warn("[%s] (NRF-notify) Not found", NFProfile->nf_instance_id); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_NOT_FOUND, + message, "Not found", message->h.resource.component[1]); + return false; + } + } else { + char *eventstr = OpenAPI_notification_event_type_ToString( + NotificationData->event); + ogs_error("Not supported event [%d:%s]", + NotificationData->event, eventstr ? eventstr : "Unknown"); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + message, "Not supported event", + eventstr ? eventstr : "Unknown"); + return false; + } + + response = ogs_sbi_build_response(message, OGS_SBI_HTTP_STATUS_NO_CONTENT); + ogs_assert(response); + ogs_sbi_server_send_response(session, response); + + return true; +} + +void udm_nnrf_handle_nf_discover(udm_ue_t *udm_ue, ogs_sbi_message_t *message) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + ogs_sbi_session_t *session = NULL; + + OpenAPI_search_result_t *SearchResult = NULL; + OpenAPI_lnode_t *node = NULL; + bool handled; + + ogs_assert(udm_ue); + session = udm_ue->session; + ogs_assert(session); + ogs_assert(message); + + SearchResult = message->SearchResult; + if (!SearchResult) { + ogs_error("No SearchResult"); + return; + } + + OpenAPI_list_for_each(SearchResult->nf_instances, node) { + OpenAPI_nf_profile_t *NFProfile = NULL; + + if (!node->data) continue; + + NFProfile = node->data; + + nf_instance = ogs_sbi_nf_instance_find(NFProfile->nf_instance_id); + if (!nf_instance) { + nf_instance = ogs_sbi_nf_instance_add(NFProfile->nf_instance_id); + ogs_assert(nf_instance); + + udm_nf_fsm_init(nf_instance); + + ogs_info("[%s] (NF-discover) NF registered", nf_instance->id); + } else { + OGS_FSM_TRAN(&nf_instance->sm, udm_nf_state_registered); + ogs_fsm_dispatch(&nf_instance->sm, NULL); + + ogs_warn("[%s] (NF-discover) NF has already been added", + NFProfile->nf_instance_id); + } + + if (NF_INSTANCE_IS_OTHERS(nf_instance->id)) { + handled = ogs_sbi_nnrf_handle_nf_profile( + nf_instance, NFProfile, NULL, NULL); + if (!handled) { + ogs_error("[%s] ogs_sbi_nnrf_handle_nf_profile() failed", + nf_instance->id); + UDM_NF_INSTANCE_CLEAR("NRF-discover", nf_instance); + continue; + } + + handled = ogs_sbi_client_associate(nf_instance); + if (!handled) { + ogs_error("[%s] Cannot assciate NF EndPoint", nf_instance->id); + UDM_NF_INSTANCE_CLEAR("NRF-discover", nf_instance); + continue; + } + + udm_sbi_setup_client_callback(nf_instance); + + if (!OGS_SBI_NF_INSTANCE_GET( + udm_ue->nf_types, nf_instance->nf_type)) + ogs_sbi_nf_types_associate(udm_ue->nf_types, + nf_instance->nf_type, udm_nf_state_registered); + + /* TIME : Update validity from NRF */ + if (SearchResult->validity_period) { + nf_instance->time.validity = SearchResult->validity_period; + + ogs_assert(nf_instance->t_validity); + ogs_timer_start(nf_instance->t_validity, + ogs_time_from_sec(nf_instance->time.validity)); + + } else + ogs_warn("[%s] NF Instance validity-time should not 0", + nf_instance->id); + + ogs_info("[%s] (NF-discover) NF Profile updated", nf_instance->id); + } + } + + nf_instance = OGS_SBI_NF_INSTANCE_GET( + udm_ue->nf_types, OpenAPI_nf_type_UDR); + if (!nf_instance) { + ogs_error("[%s] (NF discover) No UDR", udm_ue->suci); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_SERVICE_UNAVAILABLE, NULL, + "(NF discover) No UDR", udm_ue->suci); + } else { + ogs_assert(udm_ue->state.component1); + SWITCH(udm_ue->state.component1) + CASE(OGS_SBI_RESOURCE_NAME_SECURITY_INFORMATION) + udm_nudr_dr_send_query(udm_ue, nf_instance); + break; + CASE(OGS_SBI_RESOURCE_NAME_AUTH_EVENTS) + udm_nudr_dr_send_update(udm_ue, nf_instance); + break; + DEFAULT + ogs_fatal("[%s] Unknown state [%s]", + udm_ue->suci, udm_ue->state.component1); + ogs_assert_if_reached(); + END + } +} diff --git a/src/udm/nnrf-handler.h b/src/udm/nnrf-handler.h new file mode 100644 index 0000000000..6573d82d89 --- /dev/null +++ b/src/udm/nnrf-handler.h @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef UDM_NNRF_HANDLER_H +#define UDM_NNRF_HANDLER_H + +#include "context.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void udm_nnrf_handle_nf_register( + ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_message_t *message); +void udm_nnrf_handle_nf_status_subscribe( + ogs_sbi_subscription_t *subscription, ogs_sbi_message_t *message); + +bool udm_nnrf_handle_nf_status_notify( + ogs_sbi_session_t *session, ogs_sbi_message_t *message); + +void udm_nnrf_handle_nf_discover(udm_ue_t *udm_ue, ogs_sbi_message_t *message); + +#ifdef __cplusplus +} +#endif + +#endif /* UDM_NNRF_HANDLER_H */ diff --git a/src/udm/nudm-handler.c b/src/udm/nudm-handler.c new file mode 100644 index 0000000000..7218c5009c --- /dev/null +++ b/src/udm/nudm-handler.c @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "sbi-path.h" +#include "nnrf-handler.h" +#include "nudm-handler.h" + +bool udm_nudm_ueau_handle_get(udm_ue_t *udm_ue, ogs_sbi_message_t *recvmsg) +{ + ogs_sbi_session_t *session = NULL; + + OpenAPI_authentication_info_request_t *AuthenticationInfoRequest = NULL; + char *serving_network_name = NULL; + char *ausf_instance_id = NULL; + + ogs_assert(udm_ue); + session = udm_ue->session; + ogs_assert(session); + + ogs_assert(recvmsg); + + AuthenticationInfoRequest = recvmsg->AuthenticationInfoRequest; + if (!AuthenticationInfoRequest) { + ogs_error("[%s] No AuthenticationInfoRequest", udm_ue->suci); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + recvmsg, "No AuthenticationInfoRequest", udm_ue->suci); + return false; + } + + serving_network_name = AuthenticationInfoRequest->serving_network_name; + if (!AuthenticationInfoRequest) { + ogs_error("[%s] No servingNetworkName", udm_ue->suci); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + recvmsg, "No servingNetworkName", udm_ue->suci); + return false; + } + + ausf_instance_id = AuthenticationInfoRequest->ausf_instance_id; + if (!AuthenticationInfoRequest) { + ogs_error("[%s] No ausfInstanceId", udm_ue->suci); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + recvmsg, "No ausfInstanceId", udm_ue->suci); + return false; + } + + udm_ue->serving_network_name = ogs_strdup(serving_network_name); + ogs_assert(udm_ue->serving_network_name); + udm_ue->ausf_instance_id = ogs_strdup(ausf_instance_id); + ogs_assert(udm_ue->ausf_instance_id); + + udm_nudr_dr_discover_and_send_query(udm_ue); + + return true; +} + +bool udm_nudm_ueau_handle_result_confirmation_inform( + udm_ue_t *udm_ue, ogs_sbi_message_t *recvmsg) +{ + ogs_sbi_session_t *session = NULL; + + OpenAPI_auth_event_t *AuthEvent = NULL; + char *timestamp = NULL; + + ogs_assert(udm_ue); + session = udm_ue->session; + ogs_assert(session); + + ogs_assert(recvmsg); + + AuthEvent = recvmsg->AuthEvent; + if (!AuthEvent) { + ogs_error("[%s] No AuthEvent", udm_ue->suci); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + recvmsg, "No AuthEvent", udm_ue->suci); + return false; + } + + timestamp = AuthEvent->time_stamp; + if (!AuthEvent) { + ogs_error("[%s] No timeStamp", udm_ue->suci); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + recvmsg, "No timeStamp", udm_ue->suci); + return false; + } + + udm_ue->auth_success = AuthEvent->success; + udm_ue->auth_timestamp = ogs_strdup(timestamp); + ogs_assert(udm_ue->auth_timestamp); + + udm_nudr_dr_discover_and_send_update(udm_ue); + + return true; +} diff --git a/src/udm/nudm-handler.h b/src/udm/nudm-handler.h new file mode 100644 index 0000000000..6f2e08634d --- /dev/null +++ b/src/udm/nudm-handler.h @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef UDM_NUDM_HANDLER_H +#define UDM_NUDM_HANDLER_H + +#include "context.h" + +#ifdef __cplusplus +extern "C" { +#endif + +bool udm_nudm_ueau_handle_get(udm_ue_t *udm_ue, ogs_sbi_message_t *recvmsg); +bool udm_nudm_ueau_handle_result_confirmation_inform( + udm_ue_t *udm_ue, ogs_sbi_message_t *recvmsg); + +#ifdef __cplusplus +} +#endif + +#endif /* UDM_NUDM_HANDLER_H */ diff --git a/src/udm/nudr-build.c b/src/udm/nudr-build.c new file mode 100644 index 0000000000..a362eebd9b --- /dev/null +++ b/src/udm/nudr-build.c @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2019 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "nudr-build.h" + +ogs_sbi_request_t *udm_nudr_dr_build_query(udm_ue_t *udm_ue) +{ + ogs_sbi_message_t message; + ogs_sbi_request_t *request = NULL; + + ogs_assert(udm_ue); + + memset(&message, 0, sizeof(message)); + message.h.method = (char *)OGS_SBI_HTTP_METHOD_GET; + message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NUDR_DR; + message.h.api.version = (char *)OGS_SBI_API_VERSION; + message.h.resource.component[0] = + (char *)OGS_SBI_RESOURCE_NAME_SUBSCRIPTION_DATA; + message.h.resource.component[1] = udm_ue->supi; + message.h.resource.component[2] = + (char *)OGS_SBI_RESOURCE_NAME_AUTHENTICATION_DATA; + message.h.resource.component[3] = + (char *)OGS_SBI_RESOURCE_NAME_AUTHENTICATION_SUBSCRIPTION; + + request = ogs_sbi_build_request(&message); + ogs_assert(request); + + return request; +} + +ogs_sbi_request_t *udm_nudr_dr_build_update(udm_ue_t *udm_ue) +{ + ogs_sbi_message_t message; + ogs_sbi_request_t *request = NULL; + + OpenAPI_auth_event_t *AuthEvent = NULL; + + ogs_assert(udm_ue); + + memset(&message, 0, sizeof(message)); + message.h.method = (char *)OGS_SBI_HTTP_METHOD_PUT; + message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NUDR_DR; + message.h.api.version = (char *)OGS_SBI_API_VERSION; + message.h.resource.component[0] = + (char *)OGS_SBI_RESOURCE_NAME_SUBSCRIPTION_DATA; + message.h.resource.component[1] = udm_ue->supi; + message.h.resource.component[2] = + (char *)OGS_SBI_RESOURCE_NAME_AUTHENTICATION_DATA; + message.h.resource.component[3] = + (char *)OGS_SBI_RESOURCE_NAME_AUTHENTICATION_STATUS; + + AuthEvent = ogs_calloc(1, sizeof(*AuthEvent)); + ogs_assert(AuthEvent); + + AuthEvent->nf_instance_id = udm_ue->ausf_instance_id; + AuthEvent->success = udm_ue->auth_success; + AuthEvent->auth_type = udm_ue->auth_type; + AuthEvent->serving_network_name = udm_ue->serving_network_name; + AuthEvent->time_stamp = udm_ue->auth_timestamp; + + message.AuthEvent = AuthEvent; + + request = ogs_sbi_build_request(&message); + ogs_assert(request); + + ogs_free(AuthEvent); + + return request; +} diff --git a/src/udm/nudr-build.h b/src/udm/nudr-build.h new file mode 100644 index 0000000000..20f25f66ad --- /dev/null +++ b/src/udm/nudr-build.h @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2019 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef UDM_NUDR_BUILD_H +#define UDM_NUDR_BUILD_H + +#include "context.h" + +#ifdef __cplusplus +extern "C" { +#endif + +ogs_sbi_request_t *udm_nudr_dr_build_query(udm_ue_t *udm_ue); +ogs_sbi_request_t *udm_nudr_dr_build_update(udm_ue_t *udm_ue); + +#ifdef __cplusplus +} +#endif + +#endif /* UDM_NUDR_BUILD_H */ diff --git a/src/udm/nudr-handler.c b/src/udm/nudr-handler.c new file mode 100644 index 0000000000..5cd971323b --- /dev/null +++ b/src/udm/nudr-handler.c @@ -0,0 +1,251 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "nudr-handler.h" + +bool udm_nudr_dr_handle_subscription_authentication( + udm_ue_t *udm_ue, ogs_sbi_message_t *recvmsg) +{ + ogs_sbi_server_t *server = NULL; + ogs_sbi_session_t *session = NULL; + + ogs_sbi_message_t sendmsg; + ogs_sbi_header_t header; + ogs_sbi_response_t *response = NULL; + + const char *tmp = "4d45b0eeb8386b629f136968837a7b0b"; /* For test */ + uint8_t k[OGS_KEY_LEN]; + uint8_t opc[OGS_KEY_LEN]; + uint8_t amf[OGS_AMF_LEN]; + uint8_t sqn[OGS_SQN_LEN]; + uint8_t rand[OGS_RAND_LEN]; + uint8_t autn[OGS_AUTN_LEN]; + uint8_t ik[OGS_KEY_LEN]; + uint8_t ck[OGS_KEY_LEN]; + uint8_t ak[OGS_AK_LEN]; + uint8_t xres[OGS_MAX_RES_LEN]; + size_t xres_len = 8; + uint8_t xres_star[OGS_MAX_RES_LEN]; + uint8_t kausf[OGS_SHA256_DIGEST_SIZE]; + + char rand_string[OGS_KEYSTRLEN(OGS_RAND_LEN)]; + char autn_string[OGS_KEYSTRLEN(OGS_AUTN_LEN)]; + char kausf_string[OGS_KEYSTRLEN(OGS_SHA256_DIGEST_SIZE)]; + char xres_star_string[OGS_KEYSTRLEN(OGS_MAX_RES_LEN)]; + + OpenAPI_authentication_subscription_t *AuthenticationSubscription = NULL; + OpenAPI_authentication_info_result_t AuthenticationInfoResult; + OpenAPI_authentication_vector_t AuthenticationVector; + OpenAPI_auth_event_t *AuthEvent = NULL; + + ogs_assert(udm_ue); + session = udm_ue->session; + ogs_assert(session); + server = ogs_sbi_session_get_server(session); + ogs_assert(server); + + ogs_assert(recvmsg); + + SWITCH(recvmsg->h.resource.component[3]) + CASE(OGS_SBI_RESOURCE_NAME_AUTHENTICATION_SUBSCRIPTION) + + AuthenticationSubscription = recvmsg->AuthenticationSubscription; + if (!AuthenticationSubscription) { + ogs_error("[%s] No AuthenticationSubscription", udm_ue->suci); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, + recvmsg, "No AuthenticationSubscription", udm_ue->suci); + return false; + } + + if (AuthenticationSubscription->authentication_method != + OpenAPI_auth_method_5G_AKA) { + ogs_error("[%s] Not supported Auth Method [%d]", + udm_ue->suci, + AuthenticationSubscription->authentication_method); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_FORBIDDEN, + recvmsg, "Not supported Auth Method", udm_ue->suci); + return false; + + } + + if (!AuthenticationSubscription->enc_permanent_key) { + ogs_error("[%s] No encPermanentKey", udm_ue->suci); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, + recvmsg, "No encPermanentKey", udm_ue->suci); + return false; + } + if (!AuthenticationSubscription->enc_opc_key) { + ogs_error("[%s] No encPermanentKey", udm_ue->suci); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, + recvmsg, "No encPermanentKey", udm_ue->suci); + return false; + } + if (!AuthenticationSubscription->authentication_management_field) { + ogs_error("[%s] No authenticationManagementField", + udm_ue->suci); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, + recvmsg, "No authenticationManagementField", udm_ue->suci); + return false; + } + if (!AuthenticationSubscription->sequence_number) { + ogs_error("[%s] No SequenceNumber", udm_ue->suci); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, + recvmsg, "No SequenceNumber", udm_ue->suci); + return false; + } + if (AuthenticationSubscription->sequence_number->sqn_scheme != + OpenAPI_sqn_scheme_NON_TIME_BASED) { + ogs_error("[%s] No SequenceNumber.sqnScheme [%d]", udm_ue->suci, + AuthenticationSubscription->sequence_number->sqn_scheme); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_FORBIDDEN, + recvmsg, "No SequenceNumber.sqnScheme", udm_ue->suci); + return false; + } + if (!AuthenticationSubscription->sequence_number->sqn) { + ogs_error("[%s] No SequenceNumber.sqn", udm_ue->suci); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, + recvmsg, "No SequenceNumber.sqn", udm_ue->suci); + return false; + } + + udm_ue->auth_type = OpenAPI_auth_type_5G_AKA; + + memset(&AuthenticationInfoResult, + 0, sizeof(AuthenticationInfoResult)); + + AuthenticationInfoResult.auth_type = udm_ue->auth_type; + + /* FIX IT! TODO! NEW! */ + ogs_random(rand, OGS_RAND_LEN); + OGS_HEX(tmp, strlen(tmp), rand); + + ogs_ascii_to_hex( + AuthenticationSubscription->enc_opc_key, + strlen(AuthenticationSubscription->enc_opc_key), + opc, sizeof(opc)); + ogs_ascii_to_hex( + AuthenticationSubscription->authentication_management_field, + strlen(AuthenticationSubscription-> + authentication_management_field), + amf, sizeof(amf)); + ogs_ascii_to_hex( + AuthenticationSubscription->enc_permanent_key, + strlen(AuthenticationSubscription->enc_permanent_key), + k, sizeof(k)); + ogs_ascii_to_hex( + AuthenticationSubscription->sequence_number->sqn, + strlen(AuthenticationSubscription->sequence_number->sqn), + sqn, sizeof(sqn)); + milenage_generate(opc, amf, k, sqn, rand, autn, ik, ck, ak, + xres, &xres_len); + + ogs_assert(udm_ue->serving_network_name); + + /* TS33.501 Annex A.2 : Kausf derviation function */ + ogs_kdf_kausf( + ck, ik, + udm_ue->serving_network_name, autn, + kausf); + + /* TS33.501 Annex A.4 : RES* and XRES* derivation function */ + ogs_kdf_xres_star( + ck, ik, + udm_ue->serving_network_name, rand, xres, xres_len, + xres_star); + + memset(&AuthenticationVector, 0, sizeof(AuthenticationVector)); + AuthenticationVector.av_type = OpenAPI_av_type_5G_HE_AKA; + + ogs_hex_to_ascii(rand, sizeof(rand), + rand_string, sizeof(rand_string)); + AuthenticationVector.rand = rand_string; + ogs_hex_to_ascii(xres_star, sizeof(xres_star), + xres_star_string, sizeof(xres_star_string)); + AuthenticationVector.xres_star = xres_star_string; + ogs_hex_to_ascii(autn, sizeof(autn), + autn_string, sizeof(autn_string)); + AuthenticationVector.autn = autn_string; + ogs_hex_to_ascii(kausf, sizeof(kausf), + kausf_string, sizeof(kausf_string)); + AuthenticationVector.kausf = kausf_string; + + AuthenticationInfoResult.authentication_vector = + &AuthenticationVector; + + memset(&sendmsg, 0, sizeof(sendmsg)); + + ogs_assert(AuthenticationInfoResult.auth_type); + sendmsg.AuthenticationInfoResult = &AuthenticationInfoResult; + + response = ogs_sbi_build_response(&sendmsg, OGS_SBI_HTTP_STATUS_OK); + ogs_assert(response); + ogs_sbi_server_send_response(session, response); + + return true; + + CASE(OGS_SBI_RESOURCE_NAME_AUTHENTICATION_STATUS) + + memset(&sendmsg, 0, sizeof(sendmsg)); + + AuthEvent = ogs_calloc(1, sizeof(*AuthEvent)); + ogs_assert(AuthEvent); + + AuthEvent->nf_instance_id = udm_ue->ausf_instance_id; + AuthEvent->success = udm_ue->auth_success; + AuthEvent->auth_type = udm_ue->auth_type; + AuthEvent->serving_network_name = udm_ue->serving_network_name; + AuthEvent->time_stamp = udm_ue->auth_timestamp; + + sendmsg.AuthEvent = AuthEvent; + + memset(&header, 0, sizeof(header)); + header.service.name = (char *)OGS_SBI_SERVICE_NAME_NUDM_UEAU; + header.api.version = (char *)OGS_SBI_API_VERSION; + header.resource.component[0] = udm_ue->supi; + header.resource.component[1] = + (char *)OGS_SBI_RESOURCE_NAME_AUTH_EVENTS; + header.resource.component[2] = udm_ue->ctx_id; + + sendmsg.http.location = ogs_sbi_server_uri(server, &header); + + response = ogs_sbi_build_response(&sendmsg, + OGS_SBI_HTTP_STATUS_CREATED); + ogs_assert(response); + ogs_sbi_server_send_response(session, response); + + ogs_free(AuthEvent); + ogs_free(sendmsg.http.location); + + return true; + + DEFAULT + ogs_error("Invalid resource name [%s]", + recvmsg->h.resource.component[3]); + END + + return false; +} diff --git a/src/udm/nudr-handler.h b/src/udm/nudr-handler.h new file mode 100644 index 0000000000..5d0093c45b --- /dev/null +++ b/src/udm/nudr-handler.h @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef UDM_NUDR_HANDLER_H +#define UDM_NUDR_HANDLER_H + +#include "context.h" + +#ifdef __cplusplus +extern "C" { +#endif + +bool udm_nudr_dr_handle_subscription_authentication( + udm_ue_t *udm_ue, ogs_sbi_message_t *recvmsg); + +#ifdef __cplusplus +} +#endif + +#endif /* UDM_NUDR_HANDLER_H */ diff --git a/src/udm/sbi-path.c b/src/udm/sbi-path.c new file mode 100644 index 0000000000..9697b09aea --- /dev/null +++ b/src/udm/sbi-path.c @@ -0,0 +1,229 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "sbi-path.h" + +static int server_cb(ogs_sbi_server_t *server, + ogs_sbi_session_t *session, ogs_sbi_request_t *request) +{ + udm_event_t *e = NULL; + int rv; + + ogs_assert(session); + ogs_assert(request); + + e = udm_event_new(UDM_EVT_SBI_SERVER); + ogs_assert(e); + + e->sbi.server = server; + e->sbi.session = session; + e->sbi.request = request; + + rv = ogs_queue_push(udm_self()->queue, e); + if (rv != OGS_OK) { + ogs_warn("ogs_queue_push() failed:%d", (int)rv); + udm_event_free(e); + return OGS_ERROR; + } + + return OGS_OK; +} + +static int client_cb(ogs_sbi_response_t *response, void *data) +{ + udm_event_t *e = NULL; + int rv; + + ogs_assert(response); + + e = udm_event_new(UDM_EVT_SBI_CLIENT); + ogs_assert(e); + e->sbi.response = response; + e->sbi.data = data; + + rv = ogs_queue_push(udm_self()->queue, e); + if (rv != OGS_OK) { + ogs_warn("ogs_queue_push() failed:%d", (int)rv); + udm_event_free(e); + return OGS_ERROR; + } + + return OGS_OK; +} + +int udm_sbi_open(void) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + + ogs_sbi_server_start_all(server_cb); + + ogs_list_for_each(&ogs_sbi_self()->nf_instance_list, nf_instance) { + ogs_sbi_nf_service_t *service = NULL; + + ogs_sbi_nf_instance_build_default(nf_instance, udm_self()->nf_type); + + service = ogs_sbi_nf_service_build_default(nf_instance, + (char*)OGS_SBI_SERVICE_NAME_NUDM_UEAU); + ogs_assert(service); + ogs_sbi_nf_service_add_version(service, (char*)OGS_SBI_API_VERSION, + (char*)OGS_SBI_API_FULL_VERSION, NULL); + + udm_nf_fsm_init(nf_instance); + udm_sbi_setup_client_callback(nf_instance); + } + + return OGS_OK; +} + +void udm_sbi_close(void) +{ + ogs_sbi_server_stop_all(); +} + +void udm_sbi_setup_client_callback(ogs_sbi_nf_instance_t *nf_instance) +{ + ogs_sbi_client_t *client = NULL; + ogs_sbi_nf_service_t *nf_service = NULL; + ogs_assert(nf_instance); + + client = nf_instance->client; + ogs_assert(client); + + client->cb = client_cb; + + ogs_list_for_each(&nf_instance->nf_service_list, nf_service) { + client = nf_service->client; + if (client) + client->cb = client_cb; + } +} + +static ogs_sbi_nf_instance_t *find_or_discover_nf_instance( + udm_ue_t *udm_ue, OpenAPI_nf_type_e nf_type) +{ + ogs_sbi_session_t *session = NULL; + bool nrf = true; + bool nf = true; + + ogs_assert(udm_ue); + session = udm_ue->session; + ogs_assert(session); + ogs_assert(nf_type); + + if (!OGS_SBI_NF_INSTANCE_GET(udm_ue->nf_types, OpenAPI_nf_type_NRF)) + nrf = ogs_sbi_nf_types_associate( + udm_ue->nf_types, OpenAPI_nf_type_NRF, udm_nf_state_registered); + if (!OGS_SBI_NF_INSTANCE_GET(udm_ue->nf_types, nf_type)) + nf = ogs_sbi_nf_types_associate( + udm_ue->nf_types, nf_type, udm_nf_state_registered); + + if (nrf == false && nf == false) { + ogs_error("[%s] Cannot discover UDR", udm_ue->suci); + + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_SERVICE_UNAVAILABLE, NULL, + "Cannot discover UDR", udm_ue->suci); + + return NULL; + } + + if (nf == false) { + ogs_warn("[%s] Try to discover UDR", udm_ue->suci); + ogs_timer_start(udm_ue->sbi_client_wait.timer, + udm_timer_cfg(UDM_TIMER_SBI_CLIENT_WAIT)->duration); + + ogs_nnrf_disc_send_nf_discover( + udm_ue->nf_types[OpenAPI_nf_type_NRF].nf_instance, + nf_type, OpenAPI_nf_type_UDM, udm_ue); + + return NULL; + } + + return udm_ue->nf_types[nf_type].nf_instance; +} + +void udm_nudr_dr_send_query( + udm_ue_t *udm_ue, ogs_sbi_nf_instance_t *nf_instance) +{ + ogs_sbi_request_t *request = NULL; + ogs_sbi_client_t *client = NULL; + + ogs_assert(udm_ue); + ogs_assert(nf_instance); + + client = ogs_sbi_client_find_by_service_name( + nf_instance, (char *)OGS_SBI_SERVICE_NAME_NUDR_DR); + ogs_assert(client); + + ogs_timer_start(udm_ue->sbi_client_wait.timer, + udm_timer_cfg(UDM_TIMER_SBI_CLIENT_WAIT)->duration); + + request = udm_nudr_dr_build_query(udm_ue); + ogs_assert(request); + ogs_sbi_client_send_request(client, request, udm_ue); +} + +void udm_nudr_dr_discover_and_send_query(udm_ue_t *udm_ue) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + + ogs_assert(udm_ue); + + if (!nf_instance) + nf_instance = find_or_discover_nf_instance(udm_ue, OpenAPI_nf_type_UDR); + + if (!nf_instance) return; + + udm_nudr_dr_send_query(udm_ue, nf_instance); +} + +void udm_nudr_dr_send_update( + udm_ue_t *udm_ue, ogs_sbi_nf_instance_t *nf_instance) +{ + ogs_sbi_request_t *request = NULL; + ogs_sbi_client_t *client = NULL; + + ogs_assert(udm_ue); + ogs_assert(nf_instance); + + client = ogs_sbi_client_find_by_service_name( + nf_instance, (char *)OGS_SBI_SERVICE_NAME_NUDR_DR); + ogs_assert(client); + + ogs_timer_start(udm_ue->sbi_client_wait.timer, + udm_timer_cfg(UDM_TIMER_SBI_CLIENT_WAIT)->duration); + + request = udm_nudr_dr_build_update(udm_ue); + ogs_assert(request); + ogs_sbi_client_send_request(client, request, udm_ue); +} + +void udm_nudr_dr_discover_and_send_update(udm_ue_t *udm_ue) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + + ogs_assert(udm_ue); + + if (!nf_instance) + nf_instance = find_or_discover_nf_instance(udm_ue, OpenAPI_nf_type_UDR); + + if (!nf_instance) return; + + udm_nudr_dr_send_update(udm_ue, nf_instance); +} diff --git a/src/udm/sbi-path.h b/src/udm/sbi-path.h new file mode 100644 index 0000000000..710448380c --- /dev/null +++ b/src/udm/sbi-path.h @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef UDM_SBI_PATH_H +#define UDM_SBI_PATH_H + +#include "context.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#include "nudr-build.h" + +int udm_sbi_open(void); +void udm_sbi_close(void); + +void udm_sbi_setup_client_callback(ogs_sbi_nf_instance_t *nf_instance); + +void udm_nudr_dr_send_query( + udm_ue_t *udm_ue, ogs_sbi_nf_instance_t *nf_instance); +void udm_nudr_dr_discover_and_send_query(udm_ue_t *udm_ue); + +void udm_nudr_dr_send_update( + udm_ue_t *udm_ue, ogs_sbi_nf_instance_t *nf_instance); +void udm_nudr_dr_discover_and_send_update(udm_ue_t *udm_ue); + +#ifdef __cplusplus +} +#endif + +#endif /* UDM_SBI_PATH_H */ diff --git a/src/udm/timer.c b/src/udm/timer.c new file mode 100644 index 0000000000..d9b032e6f6 --- /dev/null +++ b/src/udm/timer.c @@ -0,0 +1,117 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "context.h" + +static udm_timer_cfg_t g_udm_timer_cfg[MAX_NUM_OF_UDM_TIMER] = { + [UDM_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL] = + { .duration = ogs_time_from_sec(3) }, + [UDM_TIMER_SBI_CLIENT_WAIT] = + { .duration = ogs_time_from_sec(2) }, +}; + +udm_timer_cfg_t *udm_timer_cfg(udm_timer_e id) +{ + ogs_assert(id < MAX_NUM_OF_UDM_TIMER); + return &g_udm_timer_cfg[id]; +} + +const char *udm_timer_get_name(udm_timer_e id) +{ + switch (id) { + case UDM_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL: + return "UDM_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL"; + case UDM_TIMER_NF_INSTANCE_HEARTBEAT_INTERVAL: + return "UDM_TIMER_NF_INSTANCE_HEARTBEAT_INTERVAL"; + case UDM_TIMER_NF_INSTANCE_HEARTBEAT: + return "UDM_TIMER_NF_INSTANCE_HEARTBEAT"; + case UDM_TIMER_NF_INSTANCE_VALIDITY: + return "UDM_TIMER_NF_INSTANCE_VALIDITY"; + case UDM_TIMER_SUBSCRIPTION_VALIDITY: + return "UDM_TIMER_SUBSCRIPTION_VALIDITY"; + case UDM_TIMER_SBI_CLIENT_WAIT: + return "UDM_TIMER_SBI_CLIENT_WAIT"; + default: + break; + } + + return "UNKNOWN_TIMER"; +} + +static void sbi_timer_send_event(int timer_id, void *data) +{ + int rv; + udm_event_t *e = NULL; + ogs_assert(data); + + switch (timer_id) { + case UDM_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL: + case UDM_TIMER_NF_INSTANCE_HEARTBEAT_INTERVAL: + case UDM_TIMER_NF_INSTANCE_HEARTBEAT: + case UDM_TIMER_NF_INSTANCE_VALIDITY: + case UDM_TIMER_SUBSCRIPTION_VALIDITY: + case UDM_TIMER_SBI_CLIENT_WAIT: + e = udm_event_new(UDM_EVT_SBI_TIMER); + ogs_assert(e); + e->timer_id = timer_id; + e->sbi.data = data; + break; + default: + ogs_fatal("Unknown timer id[%d]", timer_id); + ogs_assert_if_reached(); + break; + } + + rv = ogs_queue_push(udm_self()->queue, e); + if (rv != OGS_OK) { + ogs_warn("ogs_queue_push() failed [%d] in %s", + (int)rv, udm_timer_get_name(e->timer_id)); + udm_event_free(e); + } +} + +void udm_timer_nf_instance_registration_interval(void *data) +{ + sbi_timer_send_event(UDM_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL, data); +} + +void udm_timer_nf_instance_heartbeat_interval(void *data) +{ + sbi_timer_send_event(UDM_TIMER_NF_INSTANCE_HEARTBEAT_INTERVAL, data); +} + +void udm_timer_nf_instance_heartbeat(void *data) +{ + sbi_timer_send_event(UDM_TIMER_NF_INSTANCE_HEARTBEAT, data); +} + +void udm_timer_nf_instance_validity(void *data) +{ + sbi_timer_send_event(UDM_TIMER_NF_INSTANCE_VALIDITY, data); +} + +void udm_timer_subscription_validity(void *data) +{ + sbi_timer_send_event(UDM_TIMER_SUBSCRIPTION_VALIDITY, data); +} + +void udm_timer_sbi_client_wait_expire(void *data) +{ + sbi_timer_send_event(UDM_TIMER_SBI_CLIENT_WAIT, data); +} diff --git a/src/udm/timer.h b/src/udm/timer.h new file mode 100644 index 0000000000..5b344b43fc --- /dev/null +++ b/src/udm/timer.h @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2019 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef UDM_TIMER_H +#define UDM_TIMER_H + +#include "ogs-core.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* forward declaration */ +typedef enum { + UDM_TIMER_BASE = 0, + + UDM_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL, + UDM_TIMER_NF_INSTANCE_HEARTBEAT_INTERVAL, + UDM_TIMER_NF_INSTANCE_HEARTBEAT, + UDM_TIMER_NF_INSTANCE_VALIDITY, + UDM_TIMER_SUBSCRIPTION_VALIDITY, + UDM_TIMER_SBI_CLIENT_WAIT, + + MAX_NUM_OF_UDM_TIMER, + +} udm_timer_e; + +typedef struct udm_timer_cfg_s { + int max_count; + ogs_time_t duration; +} udm_timer_cfg_t; + +udm_timer_cfg_t *udm_timer_cfg(udm_timer_e id); + +const char *udm_timer_get_name(udm_timer_e id); + +void udm_timer_nf_instance_registration_interval(void *data); +void udm_timer_nf_instance_heartbeat_interval(void *data); +void udm_timer_nf_instance_heartbeat(void *data); +void udm_timer_nf_instance_validity(void *data); +void udm_timer_subscription_validity(void *data); +void udm_timer_sbi_client_wait_expire(void *data); + +#ifdef __cplusplus +} +#endif + +#endif /* UDM_TIMER_H */ diff --git a/src/udm/udm-sm.c b/src/udm/udm-sm.c new file mode 100644 index 0000000000..f68a69555e --- /dev/null +++ b/src/udm/udm-sm.c @@ -0,0 +1,381 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "sbi-path.h" +#include "nnrf-handler.h" + +void udm_state_initial(ogs_fsm_t *s, udm_event_t *e) +{ + udm_sm_debug(e); + + ogs_assert(s); + + OGS_FSM_TRAN(s, &udm_state_operational); +} + +void udm_state_final(ogs_fsm_t *s, udm_event_t *e) +{ + udm_sm_debug(e); +} + +void udm_state_operational(ogs_fsm_t *s, udm_event_t *e) +{ + int rv; + + ogs_sbi_session_t *session = NULL; + ogs_sbi_request_t *request = NULL; + + ogs_sbi_nf_instance_t *nf_instance = NULL; + ogs_sbi_subscription_t *subscription = NULL; + ogs_sbi_response_t *response = NULL; + ogs_sbi_message_t message; + + udm_ue_t *udm_ue = NULL; + + udm_sm_debug(e); + + ogs_assert(s); + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + rv = udm_sbi_open(); + if (rv != OGS_OK) { + ogs_fatal("Can't establish SBI path"); + } + + break; + + case OGS_FSM_EXIT_SIG: + udm_sbi_close(); + break; + + case UDM_EVT_SBI_SERVER: + request = e->sbi.request; + ogs_assert(request); + session = e->sbi.session; + ogs_assert(session); + + rv = ogs_sbi_parse_request(&message, request); + if (rv != OGS_OK) { + /* 'message' buffer is released in ogs_sbi_parse_request() */ + ogs_error("cannot parse HTTP message"); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + NULL, "cannot parse HTTP message", NULL); + break; + } + + if (strcmp(message.h.api.version, OGS_SBI_API_VERSION) != 0) { + ogs_error("Not supported version [%s]", message.h.api.version); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + &message, "Not supported version", NULL); + ogs_sbi_message_free(&message); + break; + } + + SWITCH(message.h.service.name) + CASE(OGS_SBI_SERVICE_NAME_NNRF_NFM) + + SWITCH(message.h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY) + SWITCH(message.h.method) + CASE(OGS_SBI_HTTP_METHOD_POST) + udm_nnrf_handle_nf_status_notify(session, &message); + break; + + DEFAULT + ogs_error("Invalid HTTP method [%s]", + message.h.method); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, + &message, + "Invalid HTTP method", message.h.method); + END + break; + + DEFAULT + ogs_error("Invalid resource name [%s]", + message.h.resource.component[0]); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, &message, + "Unknown resource name", + message.h.resource.component[0]); + END + break; + + CASE(OGS_SBI_SERVICE_NAME_NUDM_UEAU) + if (!message.h.resource.component[0]) { + ogs_error("Not found [%s]", message.h.method); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_NOT_FOUND, + &message, "Not found", message.h.method); + break; + } + + if (!message.h.resource.component[1]) { + ogs_error("Invalid resource name [%s]", message.h.method); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, + &message, "Invalid resource name", message.h.method); + break; + } + + SWITCH(message.h.resource.component[2]) + CASE(OGS_SBI_RESOURCE_NAME_AUTH_EVENTS) + udm_ue = udm_ue_find_by_ctx_id( + message.h.resource.component[2]); + break; + + DEFAULT + udm_ue = udm_ue_find_by_suci_or_supi( + message.h.resource.component[0]); + if (!udm_ue) { + udm_ue = udm_ue_add(message.h.resource.component[0]); + ogs_assert(udm_ue); + } + END + + if (!udm_ue) { + ogs_error("Not found [%s]", message.h.method); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_NOT_FOUND, + &message, "Not found", message.h.method); + break; + } + + ogs_assert(OGS_FSM_STATE(&udm_ue->sm)); + + OGS_SETUP_SBI_SESSION(udm_ue, session); + + if (udm_ue->state.component1) + ogs_free(udm_ue->state.component1); + udm_ue->state.component1 = ogs_strdup( + message.h.resource.component[1]); + + e->udm_ue = udm_ue; + e->sbi.message = &message; + ogs_fsm_dispatch(&udm_ue->sm, e); + if (OGS_FSM_CHECK(&udm_ue->sm, udm_ue_state_exception)) { + ogs_error("[%s] State machine exception", udm_ue->suci); + udm_ue_remove(udm_ue); + } + break; + + DEFAULT + ogs_error("Invalid API name [%s]", message.h.service.name); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, &message, + "Invalid API name", message.h.resource.component[0]); + END + + /* In lib/sbi/server.c, notify_completed() releases 'request' buffer. */ + ogs_sbi_message_free(&message); + break; + + case UDM_EVT_SBI_CLIENT: + ogs_assert(e); + + response = e->sbi.response; + ogs_assert(response); + rv = ogs_sbi_parse_response(&message, response); + if (rv != OGS_OK) { + ogs_error("cannot parse HTTP response"); + ogs_sbi_message_free(&message); + ogs_sbi_response_free(response); + break; + } + + if (strcmp(message.h.api.version, OGS_SBI_API_VERSION) != 0) { + ogs_error("Not supported version [%s]", message.h.api.version); + ogs_sbi_message_free(&message); + ogs_sbi_response_free(response); + break; + } + + SWITCH(message.h.service.name) + CASE(OGS_SBI_SERVICE_NAME_NNRF_NFM) + + SWITCH(message.h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES) + nf_instance = e->sbi.data; + ogs_assert(nf_instance); + ogs_assert(OGS_FSM_STATE(&nf_instance->sm)); + + e->sbi.message = &message; + ogs_fsm_dispatch(&nf_instance->sm, e); + + if (OGS_FSM_CHECK(&nf_instance->sm, udm_nf_state_exception)) { + ogs_error("[%s] State machine exception", nf_instance->id); + } + break; + + CASE(OGS_SBI_RESOURCE_NAME_SUBSCRIPTIONS) + subscription = e->sbi.data; + ogs_assert(subscription); + + SWITCH(message.h.method) + CASE(OGS_SBI_HTTP_METHOD_POST) + if (message.res_status == OGS_SBI_HTTP_STATUS_CREATED || + message.res_status == OGS_SBI_HTTP_STATUS_OK) { + udm_nnrf_handle_nf_status_subscribe( + subscription, &message); + } else { + ogs_error("[%s] HTTP response error [%d]", + subscription->id, message.res_status); + } + break; + + CASE(OGS_SBI_HTTP_METHOD_DELETE) + if (message.res_status == + OGS_SBI_HTTP_STATUS_NO_CONTENT) { + ogs_sbi_subscription_remove(subscription); + } else { + ogs_error("[%s] HTTP response error [%d]", + subscription->id, message.res_status); + } + break; + + DEFAULT + ogs_error("[%s] Invalid HTTP method [%s]", + subscription->id, message.h.method); + ogs_assert_if_reached(); + END + break; + + DEFAULT + ogs_error("Invalid resource name [%s]", + message.h.resource.component[0]); + ogs_assert_if_reached(); + END + break; + + CASE(OGS_SBI_SERVICE_NAME_NNRF_DISC) + SWITCH(message.h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES) + udm_ue = e->sbi.data; + ogs_assert(udm_ue); + + SWITCH(message.h.method) + CASE(OGS_SBI_HTTP_METHOD_GET) + if (message.res_status == OGS_SBI_HTTP_STATUS_OK) { + ogs_timer_stop(udm_ue->sbi_client_wait.timer); + + udm_nnrf_handle_nf_discover(udm_ue, &message); + } else { + ogs_error("[%s] HTTP response error [%d]", + udm_ue->suci, message.res_status); + } + break; + + DEFAULT + ogs_error("[%s] Invalid HTTP method [%s]", + udm_ue->suci, message.h.method); + ogs_assert_if_reached(); + END + break; + + DEFAULT + ogs_error("Invalid resource name [%s]", + message.h.resource.component[0]); + ogs_assert_if_reached(); + END + break; + + CASE(OGS_SBI_SERVICE_NAME_NUDR_DR) + SWITCH(message.h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_SUBSCRIPTION_DATA) + udm_ue = e->sbi.data; + ogs_assert(udm_ue); + + e->udm_ue = udm_ue; + e->sbi.message = &message; + ogs_fsm_dispatch(&udm_ue->sm, e); + if (OGS_FSM_CHECK(&udm_ue->sm, udm_ue_state_exception)) { + ogs_error("[%s] State machine exception", udm_ue->suci); + udm_ue_remove(udm_ue); + } + break; + + DEFAULT + ogs_error("Invalid resource name [%s]", + message.h.resource.component[0]); + ogs_assert_if_reached(); + END + break; + + DEFAULT + ogs_error("Invalid API name [%s]", message.h.service.name); + ogs_assert_if_reached(); + END + + ogs_sbi_message_free(&message); + ogs_sbi_response_free(response); + break; + + case UDM_EVT_SBI_TIMER: + ogs_assert(e); + + switch(e->timer_id) { + case UDM_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL: + case UDM_TIMER_NF_INSTANCE_HEARTBEAT_INTERVAL: + case UDM_TIMER_NF_INSTANCE_HEARTBEAT: + case UDM_TIMER_NF_INSTANCE_VALIDITY: + nf_instance = e->sbi.data; + ogs_assert(nf_instance); + ogs_assert(OGS_FSM_STATE(&nf_instance->sm)); + + ogs_fsm_dispatch(&nf_instance->sm, e); + if (OGS_FSM_CHECK(&nf_instance->sm, udm_nf_state_exception)) + ogs_error("[%s] State machine exception [%d]", + nf_instance->id, e->timer_id); + break; + + case UDM_TIMER_SUBSCRIPTION_VALIDITY: + subscription = e->sbi.data; + ogs_assert(subscription); + + ogs_info("[%s] Subscription validity expired", subscription->id); + ogs_sbi_subscription_remove(subscription); + + ogs_nnrf_nfm_send_nf_status_subscribe(subscription->client, + udm_self()->nf_type, subscription->nf_instance_id); + break; + + case UDM_TIMER_SBI_CLIENT_WAIT: + udm_ue = e->sbi.data; + ogs_assert(udm_ue); + session = udm_ue->session; + ogs_assert(session); + + ogs_error("[%s] Cannot receive SBI message", udm_ue->suci); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT, NULL, + "Cannot receive SBI message", udm_ue->suci); + break; + + default: + ogs_error("Unknown timer[%s:%d]", + udm_timer_get_name(e->timer_id), e->timer_id); + } + break; + + default: + ogs_error("No handler for event %s", udm_event_get_name(e)); + break; + } +} diff --git a/src/udm/udm-sm.h b/src/udm/udm-sm.h new file mode 100644 index 0000000000..4019700187 --- /dev/null +++ b/src/udm/udm-sm.h @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef UDM_SM_H +#define UDM_SM_H + +#include "event.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void udm_state_initial(ogs_fsm_t *s, udm_event_t *e); +void udm_state_final(ogs_fsm_t *s, udm_event_t *e); +void udm_state_operational(ogs_fsm_t *s, udm_event_t *e); + +void udm_nf_fsm_init(ogs_sbi_nf_instance_t *nf_instance); +void udm_nf_fsm_fini(ogs_sbi_nf_instance_t *nf_instance); + +void udm_nf_state_initial(ogs_fsm_t *s, udm_event_t *e); +void udm_nf_state_final(ogs_fsm_t *s, udm_event_t *e); +void udm_nf_state_will_register(ogs_fsm_t *s, udm_event_t *e); +void udm_nf_state_registered(ogs_fsm_t *s, udm_event_t *e); +void udm_nf_state_de_registered(ogs_fsm_t *s, udm_event_t *e); +void udm_nf_state_exception(ogs_fsm_t *s, udm_event_t *e); + +void udm_ue_state_initial(ogs_fsm_t *s, udm_event_t *e); +void udm_ue_state_final(ogs_fsm_t *s, udm_event_t *e); +void udm_ue_state_operational(ogs_fsm_t *s, udm_event_t *e); +void udm_ue_state_exception(ogs_fsm_t *s, udm_event_t *e); + +#define udm_sm_debug(__pe) \ + ogs_debug("%s(): %s", __func__, udm_event_get_name(__pe)) + +#ifdef __cplusplus +} +#endif + +#endif /* UDM_SM_H */ diff --git a/src/udm/ue-sm.c b/src/udm/ue-sm.c new file mode 100644 index 0000000000..819baba284 --- /dev/null +++ b/src/udm/ue-sm.c @@ -0,0 +1,170 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "sbi-path.h" +#include "nnrf-handler.h" +#include "nudm-handler.h" +#include "nudr-handler.h" + +void udm_ue_state_initial(ogs_fsm_t *s, udm_event_t *e) +{ + ogs_assert(s); + + OGS_FSM_TRAN(s, &udm_ue_state_operational); +} + +void udm_ue_state_final(ogs_fsm_t *s, udm_event_t *e) +{ +} + +void udm_ue_state_operational(ogs_fsm_t *s, udm_event_t *e) +{ + udm_ue_t *udm_ue = NULL; + + ogs_sbi_session_t *session = NULL; + ogs_sbi_message_t *message = NULL; + + ogs_assert(s); + ogs_assert(e); + + udm_sm_debug(e); + + udm_ue = e->udm_ue; + ogs_assert(udm_ue); + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + break; + + case OGS_FSM_EXIT_SIG: + break; + + case UDM_EVT_SBI_SERVER: + message = e->sbi.message; + ogs_assert(message); + session = e->sbi.session; + ogs_assert(session); + + SWITCH(message->h.method) + CASE(OGS_SBI_HTTP_METHOD_POST) + SWITCH(message->h.resource.component[1]) + CASE(OGS_SBI_RESOURCE_NAME_SECURITY_INFORMATION) + udm_nudm_ueau_handle_get(udm_ue, message); + break; + CASE(OGS_SBI_RESOURCE_NAME_AUTH_EVENTS) + udm_nudm_ueau_handle_result_confirmation_inform( + udm_ue, message); + break; + DEFAULT + ogs_error("[%s] Invalid resource name [%s]", + udm_ue->suci, message->h.resource.component[1]); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, message, + "Invalid HTTP method", message->h.method); + END + break; + DEFAULT + ogs_error("[%s] Invalid HTTP method [%s]", + udm_ue->suci, message->h.method); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, message, + "Invalid HTTP method", message->h.method); + END + break; + + case UDM_EVT_SBI_CLIENT: + message = e->sbi.message; + ogs_assert(message); + udm_ue = e->sbi.data; + ogs_assert(udm_ue); + session = udm_ue->session; + ogs_assert(session); + + SWITCH(message->h.service.name) + CASE(OGS_SBI_SERVICE_NAME_NUDR_DR) + SWITCH(message->h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_SUBSCRIPTION_DATA) + SWITCH(message->h.resource.component[2]) + CASE(OGS_SBI_RESOURCE_NAME_AUTHENTICATION_DATA) + ogs_timer_stop(udm_ue->sbi_client_wait.timer); + + if (message->res_status != OGS_SBI_HTTP_STATUS_OK && + message->res_status != OGS_SBI_HTTP_STATUS_NO_CONTENT) { + ogs_error("[%s] HTTP response error [%d]", + udm_ue->suci, message->res_status); + ogs_sbi_server_send_error( + session, message->res_status, + NULL, "HTTP response error", udm_ue->suci); + break; + } + + udm_nudr_dr_handle_subscription_authentication( + udm_ue, message); + break; + + DEFAULT + ogs_error("Invalid resource name [%s]", + message->h.resource.component[2]); + ogs_assert_if_reached(); + END + break; + DEFAULT + ogs_error("Invalid resource name [%s]", + message->h.resource.component[0]); + ogs_assert_if_reached(); + END + break; + + DEFAULT + ogs_error("Invalid API name [%s]", message->h.service.name); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, message, + "Invalid API name", message->h.resource.component[0]); + END + break; + + default: + ogs_error("[%s] Unknown event %s", udm_ue->suci, udm_event_get_name(e)); + break; + } +} + +void udm_ue_state_exception(ogs_fsm_t *s, udm_event_t *e) +{ + udm_ue_t *udm_ue = NULL; + ogs_assert(s); + ogs_assert(e); + + udm_sm_debug(e); + + udm_ue = e->udm_ue; + ogs_assert(udm_ue); + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + break; + + case OGS_FSM_EXIT_SIG: + break; + + default: + ogs_error("[%s] Unknown event %s", udm_ue->suci, udm_event_get_name(e)); + break; + } +} diff --git a/src/udr/app.c b/src/udr/app.c new file mode 100644 index 0000000000..1b30bf2cb4 --- /dev/null +++ b/src/udr/app.c @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "ogs-app.h" + +int app_initialize(const char *const argv[]) +{ + int rv; + + rv = udr_initialize(); + if (rv != OGS_OK) { + ogs_error("Failed to intialize UDR"); + return rv; + } + ogs_info("UDR initialize...done"); + + return OGS_OK; +} + +void app_terminate(void) +{ + udr_terminate(); + ogs_info("UDR terminate...done"); +} diff --git a/src/udr/context.c b/src/udr/context.c new file mode 100644 index 0000000000..da001f849c --- /dev/null +++ b/src/udr/context.c @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "sbi-path.h" + +static udr_context_t self; + +int __udr_log_domain; + +static int context_initialized = 0; + +void udr_context_init(void) +{ + ogs_assert(context_initialized == 0); + + /* Initialize UDR context */ + memset(&self, 0, sizeof(udr_context_t)); + + ogs_log_install_domain(&__ogs_dbi_domain, "dbi", ogs_core()->log.level); + ogs_log_install_domain(&__udr_log_domain, "udr", ogs_core()->log.level); + + context_initialized = 1; +} + +void udr_context_final(void) +{ + ogs_assert(context_initialized == 1); + + context_initialized = 0; +} + +udr_context_t *udr_self(void) +{ + return &self; +} + +static int udr_context_prepare(void) +{ + self.nf_type = OpenAPI_nf_type_UDR; + + return OGS_OK; +} + +static int udr_context_validation(void) +{ + return OGS_OK; +} + +int udr_context_parse_config(void) +{ + int rv; + yaml_document_t *document = NULL; + ogs_yaml_iter_t root_iter; + + document = ogs_config()->document; + ogs_assert(document); + + rv = udr_context_prepare(); + if (rv != OGS_OK) return rv; + + ogs_yaml_iter_init(&root_iter, document); + while (ogs_yaml_iter_next(&root_iter)) { + const char *root_key = ogs_yaml_iter_key(&root_iter); + ogs_assert(root_key); + if (!strcmp(root_key, "udr")) { + ogs_yaml_iter_t udr_iter; + ogs_yaml_iter_recurse(&root_iter, &udr_iter); + while (ogs_yaml_iter_next(&udr_iter)) { + const char *udr_key = ogs_yaml_iter_key(&udr_iter); + ogs_assert(udr_key); + if (!strcmp(udr_key, "sbi")) { + /* handle config in sbi library */ + } else + ogs_warn("unknown key `%s`", udr_key); + } + } + } + + rv = udr_context_validation(); + if (rv != OGS_OK) return rv; + + return OGS_OK; +} diff --git a/src/udr/context.h b/src/udr/context.h new file mode 100644 index 0000000000..2bf3f02133 --- /dev/null +++ b/src/udr/context.h @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef UDR_CONTEXT_H +#define UDR_CONTEXT_H + +#include "ogs-app.h" +#include "ogs-dbi.h" +#include "ogs-sbi.h" + +#include "udr-sm.h" +#include "timer.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define MAX_NUM_OF_SERVED_GUAMI 8 + +extern int __udr_log_domain; + +#undef OGS_LOG_DOMAIN +#define OGS_LOG_DOMAIN __udr_log_domain + +typedef struct udr_context_s { + ogs_queue_t *queue; /* Queue for processing UPF control */ + ogs_timer_mgr_t *timer_mgr; /* Timer Manager */ + ogs_pollset_t *pollset; /* Poll Set for I/O Multiplexing */ + + OpenAPI_nf_type_e nf_type; + +} udr_context_t; + +#define UDR_NF_INSTANCE_CLEAR(_cAUSE, _nFInstance) \ + do { \ + ogs_assert(_nFInstance); \ + if ((_nFInstance)->reference_count == 1) { \ + ogs_info("[%s] (%s) NF removed", (_nFInstance)->id, (_cAUSE)); \ + udr_nf_fsm_fini((_nFInstance)); \ + } else { \ + /* There is an assocation with other context */ \ + ogs_info("[%s:%d] (%s) NF suspended", \ + _nFInstance->id, _nFInstance->reference_count, (_cAUSE)); \ + OGS_FSM_TRAN(&_nFInstance->sm, udr_nf_state_de_registered); \ + ogs_fsm_dispatch(&_nFInstance->sm, NULL); \ + } \ + ogs_sbi_nf_instance_remove(_nFInstance); \ + } while(0) + +void udr_context_init(void); +void udr_context_final(void); +udr_context_t *udr_self(void); + +int udr_context_parse_config(void); + +#ifdef __cplusplus +} +#endif + +#endif /* UDR_CONTEXT_H */ diff --git a/src/udr/event.c b/src/udr/event.c new file mode 100644 index 0000000000..e566140dec --- /dev/null +++ b/src/udr/event.c @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "event.h" +#include "context.h" + +#define EVENT_POOL 32 /* FIXME : 32 */ +static OGS_POOL(pool, udr_event_t); + +void udr_event_init(void) +{ + ogs_pool_init(&pool, EVENT_POOL); + + udr_self()->queue = ogs_queue_create(EVENT_POOL); + ogs_assert(udr_self()->queue); + udr_self()->timer_mgr = ogs_timer_mgr_create(); + ogs_assert(udr_self()->timer_mgr); + udr_self()->pollset = ogs_pollset_create(); + ogs_assert(udr_self()->pollset); +} + +void udr_event_final(void) +{ + if (udr_self()->pollset) + ogs_pollset_destroy(udr_self()->pollset); + if (udr_self()->timer_mgr) + ogs_timer_mgr_destroy(udr_self()->timer_mgr); + if (udr_self()->queue) + ogs_queue_destroy(udr_self()->queue); + + ogs_pool_final(&pool); +} + +udr_event_t *udr_event_new(udr_event_e id) +{ + udr_event_t *e = NULL; + + ogs_pool_alloc(&pool, &e); + ogs_assert(e); + memset(e, 0, sizeof(*e)); + + e->id = id; + + return e; +} + +void udr_event_free(udr_event_t *e) +{ + ogs_assert(e); + ogs_pool_free(&pool, e); +} + +const char *udr_event_get_name(udr_event_t *e) +{ + if (e == NULL) + return OGS_FSM_NAME_INIT_SIG; + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + return OGS_FSM_NAME_ENTRY_SIG; + case OGS_FSM_EXIT_SIG: + return OGS_FSM_NAME_EXIT_SIG; + + case UDR_EVT_SBI_SERVER: + return "UDR_EVT_SBI_SERVER"; + case UDR_EVT_SBI_CLIENT: + return "UDR_EVT_SBI_CLIENT"; + case UDR_EVT_SBI_TIMER: + return "UDR_EVT_SBI_TIMER"; + + default: + break; + } + + return "UNKNOWN_EVENT"; +} diff --git a/src/udr/event.h b/src/udr/event.h new file mode 100644 index 0000000000..84ceca74c9 --- /dev/null +++ b/src/udr/event.h @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef UDR_EVENT_H +#define UDR_EVENT_H + +#include "ogs-core.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct ogs_sbi_server_s ogs_sbi_server_t; +typedef struct ogs_sbi_session_s ogs_sbi_session_t; +typedef struct ogs_sbi_request_s ogs_sbi_request_t; +typedef struct ogs_sbi_response_s ogs_sbi_response_t; +typedef struct ogs_sbi_message_s ogs_sbi_message_t; +typedef struct ogs_sbi_nf_instance_s ogs_sbi_nf_instance_t; +typedef struct ogs_sbi_subscription_s ogs_sbi_subscription_t; + +typedef enum { + UDR_EVT_BASE = OGS_FSM_USER_SIG, + + UDR_EVT_SBI_SERVER, + UDR_EVT_SBI_CLIENT, + UDR_EVT_SBI_TIMER, + + UDR_EVT_TOP, + +} udr_event_e; + +typedef struct udr_event_s { + int id; + int timer_id; + + struct { + /* OGS_EVT_SBI_SERVER */ + ogs_sbi_request_t *request; + ogs_sbi_session_t *session; + ogs_sbi_server_t *server; + + /* OGS_EVT_SBI_CLIENT */ + ogs_sbi_response_t *response; + void *data; + + ogs_sbi_message_t *message; + } sbi; + + ogs_timer_t *timer; +} udr_event_t; + +void udr_event_init(void); +void udr_event_final(void); + +udr_event_t *udr_event_new(udr_event_e id); +void udr_event_free(udr_event_t *e); + +const char *udr_event_get_name(udr_event_t *e); + +#ifdef __cplusplus +} +#endif + +#endif /* UDR_EVENT_H */ diff --git a/src/udr/init.c b/src/udr/init.c new file mode 100644 index 0000000000..c6afc8754d --- /dev/null +++ b/src/udr/init.c @@ -0,0 +1,139 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "context.h" + +static ogs_thread_t *thread; +static void udr_main(void *data); +static int initialized = 0; + +int udr_initialize() +{ + int rv; + + udr_context_init(); + udr_event_init(); /* Create event with poll, timer */ + ogs_sbi_context_init(udr_self()->pollset, udr_self()->timer_mgr); + + rv = ogs_sbi_context_parse_config("udr", "nrf"); + if (rv != OGS_OK) return rv; + + rv = udr_context_parse_config(); + if (rv != OGS_OK) return rv; + + rv = ogs_log_config_domain( + ogs_config()->logger.domain, ogs_config()->logger.level); + if (rv != OGS_OK) return rv; + + rv = ogs_dbi_init(ogs_config()->db_uri); + if (rv != OGS_OK) return rv; + + thread = ogs_thread_create(udr_main, NULL); + if (!thread) return OGS_ERROR; + + initialized = 1; + + return OGS_OK; +} + +static ogs_timer_t *t_termination_holding = NULL; + +static void event_termination(void) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + + /* Sending NF Instance De-registeration to NRF */ + ogs_list_for_each(&ogs_sbi_self()->nf_instance_list, nf_instance) + udr_nf_fsm_fini(nf_instance); + + /* Starting holding timer */ + t_termination_holding = ogs_timer_add(udr_self()->timer_mgr, NULL, NULL); + ogs_assert(t_termination_holding); +#define TERMINATION_HOLDING_TIME ogs_time_from_msec(300) + ogs_timer_start(t_termination_holding, TERMINATION_HOLDING_TIME); + + /* Sending termination event to the queue */ + ogs_queue_term(udr_self()->queue); + ogs_pollset_notify(udr_self()->pollset); +} + +void udr_terminate(void) +{ + if (!initialized) return; + + /* Daemon terminating */ + event_termination(); + ogs_thread_destroy(thread); + ogs_timer_delete(t_termination_holding); + + ogs_dbi_final(); + + udr_context_final(); + ogs_sbi_context_final(); + + udr_event_final(); /* Destroy event */ +} + +static void udr_main(void *data) +{ + ogs_fsm_t udr_sm; + int rv; + + ogs_fsm_create(&udr_sm, udr_state_initial, udr_state_final); + ogs_fsm_init(&udr_sm, 0); + + for ( ;; ) { + ogs_pollset_poll(udr_self()->pollset, + ogs_timer_mgr_next(udr_self()->timer_mgr)); + + /* + * After ogs_pollset_poll(), ogs_timer_mgr_expire() must be called. + * + * The reason is why ogs_timer_mgr_next() can get the corrent value + * when ogs_timer_stop() is called internally in ogs_timer_mgr_expire(). + * + * You should not use event-queue before ogs_timer_mgr_expire(). + * In this case, ogs_timer_mgr_expire() does not work + * because 'if rv == OGS_DONE' statement is exiting and + * not calling ogs_timer_mgr_expire(). + */ + ogs_timer_mgr_expire(udr_self()->timer_mgr); + + for ( ;; ) { + udr_event_t *e = NULL; + + rv = ogs_queue_trypop(udr_self()->queue, (void**)&e); + ogs_assert(rv != OGS_ERROR); + + if (rv == OGS_DONE) + goto done; + + if (rv == OGS_RETRY) + break; + + ogs_assert(e); + ogs_fsm_dispatch(&udr_sm, e); + udr_event_free(e); + } + } +done: + + ogs_fsm_fini(&udr_sm, 0); + ogs_fsm_delete(&udr_sm); +} diff --git a/src/udr/meson.build b/src/udr/meson.build new file mode 100644 index 0000000000..c1782f6ecf --- /dev/null +++ b/src/udr/meson.build @@ -0,0 +1,59 @@ +# Copyright (C) 2019,2020 by Sukchan Lee + +# This file is part of Open5GS. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +libudr_sources = files(''' + context.c + event.c + timer.c + + nnrf-handler.c + nf-sm.c + + nudr-handler.c + + sbi-path.c + udr-sm.c + + init.c +'''.split()) + +libudr = static_library('udr', + sources : libudr_sources, + link_with : libipfw, + dependencies : [libapp_dep, + libdbi_dep, + libsbi_dep], + install : false) + +libudr_dep = declare_dependency( + link_with : libudr, + dependencies : [libapp_dep, + libdbi_dep, + libsbi_dep]) + +udr_sources = files(''' + app.c + ../main.c +'''.split()) + +executable('open5gs-udrd', + sources : udr_sources, + c_args : '-DDEFAULT_CONFIG_FILENAME="@0@/udr.yaml"'.format(open5gs_sysconfdir), + include_directories : srcinc, + dependencies : libudr_dep, + install_rpath : libdir, + install : true) diff --git a/src/udr/nf-sm.c b/src/udr/nf-sm.c new file mode 100644 index 0000000000..1be523be95 --- /dev/null +++ b/src/udr/nf-sm.c @@ -0,0 +1,390 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "context.h" + +#include "sbi-path.h" +#include "nnrf-handler.h" + +void udr_nf_fsm_init(ogs_sbi_nf_instance_t *nf_instance) +{ + udr_event_t e; + + ogs_assert(nf_instance); + + e.sbi.data = nf_instance; + + ogs_fsm_create(&nf_instance->sm, + udr_nf_state_initial, udr_nf_state_final); + ogs_fsm_init(&nf_instance->sm, &e); +} + +void udr_nf_fsm_fini(ogs_sbi_nf_instance_t *nf_instance) +{ + udr_event_t e; + + ogs_assert(nf_instance); + e.sbi.data = nf_instance; + + ogs_fsm_fini(&nf_instance->sm, &e); + ogs_fsm_delete(&nf_instance->sm); +} + +void udr_nf_state_initial(ogs_fsm_t *s, udr_event_t *e) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + + ogs_assert(s); + ogs_assert(e); + + udr_sm_debug(e); + + nf_instance = e->sbi.data; + ogs_assert(nf_instance); + ogs_assert(nf_instance->id); + + nf_instance->t_registration_interval = ogs_timer_add(udr_self()->timer_mgr, + udr_timer_nf_instance_registration_interval, nf_instance); + ogs_assert(nf_instance->t_registration_interval); + nf_instance->t_heartbeat_interval = ogs_timer_add(udr_self()->timer_mgr, + udr_timer_nf_instance_heartbeat_interval, nf_instance); + ogs_assert(nf_instance->t_heartbeat_interval); + nf_instance->t_heartbeat = ogs_timer_add(udr_self()->timer_mgr, + udr_timer_nf_instance_heartbeat, nf_instance); + ogs_assert(nf_instance->t_heartbeat); + nf_instance->t_validity = ogs_timer_add(udr_self()->timer_mgr, + udr_timer_nf_instance_validity, nf_instance); + ogs_assert(nf_instance->t_validity); + + if (NF_INSTANCE_IS_SELF(nf_instance->id)) { + OGS_FSM_TRAN(s, &udr_nf_state_will_register); + } else { + OGS_FSM_TRAN(s, &udr_nf_state_registered); + } +} + +void udr_nf_state_final(ogs_fsm_t *s, udr_event_t *e) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + + ogs_assert(s); + ogs_assert(e); + + udr_sm_debug(e); + + nf_instance = e->sbi.data; + ogs_assert(nf_instance); + + ogs_timer_delete(nf_instance->t_registration_interval); + ogs_timer_delete(nf_instance->t_heartbeat_interval); + ogs_timer_delete(nf_instance->t_heartbeat); + ogs_timer_delete(nf_instance->t_validity); +} + +void udr_nf_state_will_register(ogs_fsm_t *s, udr_event_t *e) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + ogs_sbi_client_t *client = NULL; + ogs_sbi_message_t *message = NULL; + ogs_sockaddr_t *addr = NULL; + + ogs_assert(s); + ogs_assert(e); + + udr_sm_debug(e); + + nf_instance = e->sbi.data; + ogs_assert(nf_instance); + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + ogs_timer_start(nf_instance->t_registration_interval, + udr_timer_cfg(UDR_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL)-> + duration); + + ogs_nnrf_nfm_send_nf_register(nf_instance); + break; + + case OGS_FSM_EXIT_SIG: + ogs_timer_stop(nf_instance->t_registration_interval); + break; + + case UDR_EVT_SBI_CLIENT: + message = e->sbi.message; + ogs_assert(message); + + SWITCH(message->h.service.name) + CASE(OGS_SBI_SERVICE_NAME_NNRF_NFM) + + SWITCH(message->h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES) + + if (message->res_status == OGS_SBI_HTTP_STATUS_OK || + message->res_status == OGS_SBI_HTTP_STATUS_CREATED) { + udr_nnrf_handle_nf_register(nf_instance, message); + OGS_FSM_TRAN(s, &udr_nf_state_registered); + } else { + ogs_error("[%s] HTTP response error [%d]", + nf_instance->id, message->res_status); + OGS_FSM_TRAN(s, &udr_nf_state_exception); + } + break; + + DEFAULT + ogs_error("[%s] Invalid resource name [%s]", + nf_instance->id, message->h.resource.component[0]); + END + break; + + DEFAULT + ogs_error("[%s] Invalid API name [%s]", + nf_instance->id, message->h.service.name); + END + break; + + case UDR_EVT_SBI_TIMER: + switch(e->timer_id) { + case UDR_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL: + client = nf_instance->client; + ogs_assert(client); + addr = client->addr; + ogs_assert(addr); + + ogs_warn("[%s] Retry to registration with NRF", nf_instance->id); + + ogs_timer_start(nf_instance->t_registration_interval, + udr_timer_cfg(UDR_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL)-> + duration); + + ogs_nnrf_nfm_send_nf_register(nf_instance); + break; + + default: + ogs_error("[%s] Unknown timer[%s:%d]", nf_instance->id, + udr_timer_get_name(e->timer_id), e->timer_id); + } + break; + + default: + ogs_error("Unknown event %s", udr_event_get_name(e)); + break; + } +} + +void udr_nf_state_registered(ogs_fsm_t *s, udr_event_t *e) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + ogs_sbi_client_t *client = NULL; + ogs_sbi_message_t *message = NULL; + ogs_assert(s); + ogs_assert(e); + + udr_sm_debug(e); + + nf_instance = e->sbi.data; + ogs_assert(nf_instance); + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + if (NF_INSTANCE_IS_SELF(nf_instance->id)) { + ogs_info("[%s] NF registered", nf_instance->id); + + client = nf_instance->client; + ogs_assert(client); + + if (nf_instance->time.heartbeat) { + ogs_timer_start(nf_instance->t_heartbeat_interval, + ogs_time_from_sec(nf_instance->time.heartbeat)); + ogs_timer_start(nf_instance->t_heartbeat, + ogs_time_from_sec(nf_instance->time.heartbeat * + OGS_SBI_HEARTBEAT_RETRYCOUNT)); + } + + ogs_nnrf_nfm_send_nf_status_subscribe(client, + udr_self()->nf_type, nf_instance->id); + } + + break; + + case OGS_FSM_EXIT_SIG: + if (NF_INSTANCE_IS_SELF(nf_instance->id)) { + ogs_info("[%s] NF de-registered", nf_instance->id); + + if (nf_instance->time.heartbeat) { + ogs_timer_stop(nf_instance->t_heartbeat_interval); + ogs_timer_stop(nf_instance->t_heartbeat); + } + + ogs_nnrf_nfm_send_nf_de_register(nf_instance); + } + break; + + case UDR_EVT_SBI_CLIENT: + message = e->sbi.message; + ogs_assert(message); + + SWITCH(message->h.service.name) + CASE(OGS_SBI_SERVICE_NAME_NNRF_NFM) + + SWITCH(message->h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES) + + if (message->res_status == OGS_SBI_HTTP_STATUS_NO_CONTENT || + message->res_status == OGS_SBI_HTTP_STATUS_OK) { + if (nf_instance->time.heartbeat) + ogs_timer_start(nf_instance->t_heartbeat, + ogs_time_from_sec(nf_instance->time.heartbeat * + OGS_SBI_HEARTBEAT_RETRYCOUNT)); + } else { + ogs_error("[%s] HTTP response error [%d]", + nf_instance->id, message->res_status); + } + + break; + + DEFAULT + ogs_error("[%s] Invalid resource name [%s]", + nf_instance->id, message->h.resource.component[0]); + END + break; + + DEFAULT + ogs_error("[%s] Invalid API name [%s]", + nf_instance->id, message->h.service.name); + END + break; + + case UDR_EVT_SBI_TIMER: + switch(e->timer_id) { + case UDR_TIMER_NF_INSTANCE_HEARTBEAT_INTERVAL: + if (nf_instance->time.heartbeat) { + ogs_timer_start(nf_instance->t_heartbeat_interval, + ogs_time_from_sec(nf_instance->time.heartbeat)); + } + + ogs_nnrf_nfm_send_nf_update(nf_instance); + break; + + case UDR_TIMER_NF_INSTANCE_HEARTBEAT: + OGS_FSM_TRAN(s, &udr_nf_state_will_register); + break; + + case UDR_TIMER_NF_INSTANCE_VALIDITY: + if (NF_INSTANCE_IS_OTHERS(nf_instance->id)) { + ogs_info("[%s] NF expired", nf_instance->id); + OGS_FSM_TRAN(s, &udr_nf_state_de_registered); + } + break; + + default: + ogs_error("[%s] Unknown timer[%s:%d]", nf_instance->id, + udr_timer_get_name(e->timer_id), e->timer_id); + break; + } + break; + + default: + ogs_error("[%s] Unknown event %s", + nf_instance->id, udr_event_get_name(e)); + break; + } +} + +void udr_nf_state_de_registered(ogs_fsm_t *s, udr_event_t *e) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + ogs_assert(s); + ogs_assert(e); + + udr_sm_debug(e); + + nf_instance = e->sbi.data; + ogs_assert(nf_instance); + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + if (NF_INSTANCE_IS_SELF(nf_instance->id)) { + ogs_info("[%s] NF de-registered", nf_instance->id); + } + break; + + case OGS_FSM_EXIT_SIG: + break; + + default: + ogs_error("[%s] Unknown event %s", + nf_instance->id, udr_event_get_name(e)); + break; + } +} + +void udr_nf_state_exception(ogs_fsm_t *s, udr_event_t *e) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + ogs_sbi_client_t *client = NULL; + ogs_sockaddr_t *addr = NULL; + ogs_assert(s); + ogs_assert(e); + + udr_sm_debug(e); + + nf_instance = e->sbi.data; + ogs_assert(nf_instance); + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + if (NF_INSTANCE_IS_SELF(nf_instance->id)) { + ogs_timer_start(nf_instance->t_registration_interval, + udr_timer_cfg(UDR_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL)-> + duration); + } + break; + + case OGS_FSM_EXIT_SIG: + if (NF_INSTANCE_IS_SELF(nf_instance->id)) { + ogs_timer_stop(nf_instance->t_registration_interval); + } + break; + + case UDR_EVT_SBI_TIMER: + switch(e->timer_id) { + case UDR_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL: + client = nf_instance->client; + ogs_assert(client); + addr = client->addr; + ogs_assert(addr); + + ogs_warn("[%s] Retry to registration with NRF", nf_instance->id); + + OGS_FSM_TRAN(s, &udr_nf_state_will_register); + break; + + default: + ogs_error("[%s] Unknown timer[%s:%d]", nf_instance->id, + udr_timer_get_name(e->timer_id), e->timer_id); + break; + } + break; + + default: + ogs_error("[%s] Unknown event %s", + nf_instance->id, udr_event_get_name(e)); + break; + } +} diff --git a/src/udr/nnrf-handler.c b/src/udr/nnrf-handler.c new file mode 100644 index 0000000000..c8bcb40f0f --- /dev/null +++ b/src/udr/nnrf-handler.c @@ -0,0 +1,218 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "sbi-path.h" +#include "nnrf-handler.h" + +void udr_nnrf_handle_nf_register( + ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_message_t *message) +{ + OpenAPI_nf_profile_t *NFProfile = NULL; + ogs_sbi_client_t *client = NULL; + + ogs_assert(message); + ogs_assert(nf_instance); + client = nf_instance->client; + ogs_assert(client); + + NFProfile = message->NFProfile; + if (!NFProfile) { + ogs_error("No NFProfile"); + return; + } + + /* TIME : Update heartbeat from NRF */ + nf_instance->time.heartbeat = NFProfile->heart_beat_timer; +} + +void udr_nnrf_handle_nf_status_subscribe( + ogs_sbi_subscription_t *subscription, ogs_sbi_message_t *message) +{ + OpenAPI_subscription_data_t *SubscriptionData = NULL; + ogs_sbi_client_t *client = NULL; + + ogs_assert(message); + ogs_assert(subscription); + client = subscription->client; + ogs_assert(client); + + SubscriptionData = message->SubscriptionData; + if (!SubscriptionData) { + ogs_error("No SubscriptionData"); + return; + } + + if (!SubscriptionData->subscription_id) { + ogs_error("No SubscriptionId"); + return; + } + ogs_sbi_subscription_set_id( + subscription, SubscriptionData->subscription_id); + + if (SubscriptionData->validity_time) { + struct timeval tv; + struct tm local, next; + ogs_time_t diff, duration; + if (ogs_strptime(SubscriptionData->validity_time, + OGS_TIME_ISO8601_FORMAT, &next)) { + ogs_gettimeofday(&tv); + ogs_localtime(tv.tv_sec, &local); + diff = ogs_mktime(&next) - ogs_mktime(&local); +#define VALIDITY_MARGIN 5 /* 5 seconds */ +#define VALIDITY_MINIMUM 60 /* 60 seconds */ + duration = diff - (int)VALIDITY_MARGIN; + + if (duration < (int)VALIDITY_MINIMUM) { + ogs_warn("[%s] Validation period [%d seconds, %s] is too small", + subscription->id, + (int)diff, SubscriptionData->validity_time); + duration = VALIDITY_MINIMUM; + ogs_warn("[%s] Forced to %d seconds", + subscription->id, VALIDITY_MINIMUM); + } + + subscription->t_validity = ogs_timer_add(udr_self()->timer_mgr, + udr_timer_subscription_validity, subscription); + ogs_assert(subscription->t_validity); + ogs_timer_start( + subscription->t_validity, ogs_time_from_sec(duration)); + } + } +} + +bool udr_nnrf_handle_nf_status_notify( + ogs_sbi_session_t *session, ogs_sbi_message_t *message) +{ + ogs_sbi_response_t *response = NULL; + OpenAPI_notification_data_t *NotificationData = NULL; + OpenAPI_nf_profile_t *NFProfile = NULL; + ogs_sbi_nf_instance_t *nf_instance = NULL; + bool handled; + + ogs_assert(session); + ogs_assert(message); + + NotificationData = message->NotificationData; + if (!NotificationData) { + ogs_error("No NotificationData"); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + message, "No NotificationData", NULL); + return false; + } + + NFProfile = NotificationData->nf_profile; + if (!NFProfile) { + ogs_error("No NFProfile"); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + message, "No NFProfile", NULL); + return false; + } + + if (!NFProfile->nf_instance_id) { + ogs_error("No NFProfile.NFInstanceId"); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + message, "No NFProfile", "NFInstanceId"); + return false; + } + + if (!NFProfile->nf_instance_id) { + ogs_error("No NFProfile.NFInstanceId"); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + message, "No NFProfile", "NFInstanceId"); + return false; + } + + if (NF_INSTANCE_IS_SELF(NFProfile->nf_instance_id)) { + ogs_error("The notification is not allowed [%s]", + NFProfile->nf_instance_id); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_FORBIDDEN, + message, "The notification is not allowed", + NFProfile->nf_instance_id); + return false; + } + + if (NotificationData->event == + OpenAPI_notification_event_type_NF_REGISTERED) { + + nf_instance = ogs_sbi_nf_instance_find(NFProfile->nf_instance_id); + if (!nf_instance) { + nf_instance = ogs_sbi_nf_instance_add(NFProfile->nf_instance_id); + ogs_assert(nf_instance); + + udr_nf_fsm_init(nf_instance); + + ogs_info("[%s] (NRF-notify) NF registered", nf_instance->id); + } else { + OGS_FSM_TRAN(&nf_instance->sm, udr_nf_state_registered); + ogs_fsm_dispatch(&nf_instance->sm, NULL); + + ogs_warn("[%s] (NRF-notify) NF has already been added", + NFProfile->nf_instance_id); + } + + handled = ogs_sbi_nnrf_handle_nf_profile( + nf_instance, NFProfile, session, message); + if (!handled) { + UDR_NF_INSTANCE_CLEAR("NRF-notify", nf_instance); + return false; + } + + ogs_info("[%s] (NRF-notify) NF Profile updated", nf_instance->id); + + handled = ogs_sbi_client_associate(nf_instance); + if (!handled) { + ogs_error("[%s] Cannot associate NF EndPoint", nf_instance->id); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_BAD_REQUEST, + message, "Cannot find NF EndPoint", nf_instance->id); + UDR_NF_INSTANCE_CLEAR("NRF-notify", nf_instance); + return false; + } + + udr_sbi_setup_client_callback(nf_instance); + + } else if (NotificationData->event == + OpenAPI_notification_event_type_NF_DEREGISTERED) { + nf_instance = ogs_sbi_nf_instance_find(NFProfile->nf_instance_id); + if (nf_instance) { + UDR_NF_INSTANCE_CLEAR("NRF-notify", nf_instance); + } else { + ogs_warn("[%s] (NRF-notify) Not found", NFProfile->nf_instance_id); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_NOT_FOUND, + message, "Not found", message->h.resource.component[1]); + return false; + } + } else { + char *eventstr = OpenAPI_notification_event_type_ToString( + NotificationData->event); + ogs_error("Not supported event [%d:%s]", + NotificationData->event, eventstr ? eventstr : "Unknown"); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + message, "Not supported event", + eventstr ? eventstr : "Unknown"); + return false; + } + + response = ogs_sbi_build_response(message, OGS_SBI_HTTP_STATUS_NO_CONTENT); + ogs_assert(response); + ogs_sbi_server_send_response(session, response); + + return true; +} diff --git a/src/udr/nnrf-handler.h b/src/udr/nnrf-handler.h new file mode 100644 index 0000000000..bbb289a1d0 --- /dev/null +++ b/src/udr/nnrf-handler.h @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef UDR_NNRF_HANDLER_H +#define UDR_NNRF_HANDLER_H + +#include "context.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void udr_nnrf_handle_nf_register( + ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_message_t *message); +void udr_nnrf_handle_nf_status_subscribe( + ogs_sbi_subscription_t *subscription, ogs_sbi_message_t *message); + +bool udr_nnrf_handle_nf_status_notify( + ogs_sbi_session_t *session, ogs_sbi_message_t *message); + +#ifdef __cplusplus +} +#endif + +#endif /* UDR_NNRF_HANDLER_H */ diff --git a/src/udr/nudr-handler.c b/src/udr/nudr-handler.c new file mode 100644 index 0000000000..856cfa25f4 --- /dev/null +++ b/src/udr/nudr-handler.c @@ -0,0 +1,180 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "sbi-path.h" +#include "nnrf-handler.h" +#include "nudr-handler.h" + +bool udr_nudr_dr_handle_subscription_authentication( + ogs_sbi_session_t *session, ogs_sbi_message_t *recvmsg) +{ + int rv; + + ogs_sbi_message_t sendmsg; + ogs_sbi_response_t *response = NULL; + ogs_dbi_auth_info_t auth_info; + + const char *id_type = NULL; + const char *ue_id = NULL; + + char k_string[OGS_KEYSTRLEN(OGS_KEY_LEN)]; + char opc_string[OGS_KEYSTRLEN(OGS_KEY_LEN)]; + char amf_string[OGS_KEYSTRLEN(OGS_AMF_LEN)]; + char sqn_string[OGS_KEYSTRLEN(OGS_SQN_LEN)]; + + char sqn[OGS_SQN_LEN]; + + OpenAPI_authentication_subscription_t AuthenticationSubscription; + OpenAPI_sequence_number_t SequenceNumber; + OpenAPI_auth_event_t *AuthEvent = NULL; + + ogs_assert(session); + ogs_assert(recvmsg); + + if (!recvmsg->h.resource.component[1]) { + ogs_error("No ueId"); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + recvmsg, "No ueId", NULL); + return false; + } + + if (strncmp(recvmsg->h.resource.component[1], + OGS_DBI_UE_ID_TYPE_IMSI, strlen(OGS_DBI_UE_ID_TYPE_IMSI)) == 0) { + id_type = OGS_DBI_UE_ID_TYPE_IMSI; + ue_id = recvmsg->h.resource.component[1] + + strlen(OGS_DBI_UE_ID_TYPE_IMSI) + 1; + } else { + ogs_error("Unknown ueId Type"); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_FORBIDDEN, + recvmsg, "Unknwon ueId Type", NULL); + return false; + } + + rv = ogs_dbi_auth_info(id_type, ue_id, &auth_info); + if (rv != OGS_OK) { + ogs_fatal("Cannot find IMSI in DB : %s-%s", id_type, ue_id); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_NOT_FOUND, + recvmsg, "Unknwon ueId Type", ue_id); + return false; + } + + SWITCH(recvmsg->h.resource.component[3]) + CASE(OGS_SBI_RESOURCE_NAME_AUTHENTICATION_SUBSCRIPTION) + SWITCH(recvmsg->h.method) + CASE(OGS_SBI_HTTP_METHOD_GET) + memset(&AuthenticationSubscription, 0, + sizeof(AuthenticationSubscription)); + + AuthenticationSubscription.authentication_method = + OpenAPI_auth_method_5G_AKA; + + ogs_hex_to_ascii(auth_info.k, sizeof(auth_info.k), + k_string, sizeof(k_string)); + AuthenticationSubscription.enc_permanent_key = k_string; + + ogs_hex_to_ascii(auth_info.amf, sizeof(auth_info.amf), + amf_string, sizeof(amf_string)); + AuthenticationSubscription.authentication_management_field = + amf_string; + + if (!auth_info.use_opc) + milenage_opc(auth_info.k, auth_info.op, auth_info.opc); + + ogs_hex_to_ascii(auth_info.opc, sizeof(auth_info.opc), + opc_string, sizeof(opc_string)); + AuthenticationSubscription.enc_opc_key = opc_string; + + ogs_uint64_to_buffer(auth_info.sqn, OGS_SQN_LEN, sqn); + ogs_hex_to_ascii(sqn, sizeof(sqn), sqn_string, sizeof(sqn_string)); + + memset(&SequenceNumber, 0, sizeof(SequenceNumber)); + SequenceNumber.sqn_scheme = OpenAPI_sqn_scheme_NON_TIME_BASED; + SequenceNumber.sqn = sqn_string; + AuthenticationSubscription.sequence_number = &SequenceNumber; + + memset(&sendmsg, 0, sizeof(sendmsg)); + + ogs_assert(AuthenticationSubscription.authentication_method); + sendmsg.AuthenticationSubscription = + &AuthenticationSubscription; + + response = ogs_sbi_build_response( + &sendmsg, OGS_SBI_HTTP_STATUS_OK); + ogs_assert(response); + ogs_sbi_server_send_response(session, response); + + return true; + + DEFAULT + ogs_error("Invalid HTTP method [%s]", recvmsg->h.method); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, + recvmsg, "Invalid HTTP method", recvmsg->h.method); + END + break; + + CASE(OGS_SBI_RESOURCE_NAME_AUTHENTICATION_STATUS) + SWITCH(recvmsg->h.method) + CASE(OGS_SBI_HTTP_METHOD_PUT) + AuthEvent = recvmsg->AuthEvent; + if (!AuthEvent) { + ogs_error("[%s-%s] No AuthEvent", id_type, ue_id); + ogs_sbi_server_send_error( + session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + recvmsg, "No AuthEvent", ue_id); + return false; + } + + memset(&sendmsg, 0, sizeof(sendmsg)); + rv = ogs_dbi_increment_sqn(id_type, ue_id); + if (rv != OGS_OK) { + ogs_fatal("Cannot increment SQN : %s-%s", id_type, ue_id); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, + recvmsg, "Cannot increment SQN", ue_id); + return false; + } + + response = ogs_sbi_build_response( + &sendmsg, OGS_SBI_HTTP_STATUS_NO_CONTENT); + ogs_assert(response); + ogs_sbi_server_send_response(session, response); + + return true; + + DEFAULT + ogs_error("Invalid HTTP method [%s]", recvmsg->h.method); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, + recvmsg, "Invalid HTTP method", recvmsg->h.method); + END + break; + + DEFAULT + ogs_error("Invalid resource name [%s]", + recvmsg->h.resource.component[3]); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, + recvmsg, "Unknown resource name", + recvmsg->h.resource.component[3]); + END + + return false; +} diff --git a/src/udr/nudr-handler.h b/src/udr/nudr-handler.h new file mode 100644 index 0000000000..1213ada898 --- /dev/null +++ b/src/udr/nudr-handler.h @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef UDR_NUDR_HANDLER_H +#define UDR_NUDR_HANDLER_H + +#include "context.h" + +#ifdef __cplusplus +extern "C" { +#endif + +bool udr_nudr_dr_handle_subscription_authentication( + ogs_sbi_session_t *session, ogs_sbi_message_t *message); + +#ifdef __cplusplus +} +#endif + +#endif /* UDR_NUDR_HANDLER_H */ diff --git a/src/udr/sbi-path.c b/src/udr/sbi-path.c new file mode 100644 index 0000000000..34bac852f3 --- /dev/null +++ b/src/udr/sbi-path.c @@ -0,0 +1,115 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "sbi-path.h" + +static int server_cb(ogs_sbi_server_t *server, + ogs_sbi_session_t *session, ogs_sbi_request_t *request) +{ + udr_event_t *e = NULL; + int rv; + + ogs_assert(session); + ogs_assert(request); + + e = udr_event_new(UDR_EVT_SBI_SERVER); + ogs_assert(e); + + e->sbi.server = server; + e->sbi.session = session; + e->sbi.request = request; + + rv = ogs_queue_push(udr_self()->queue, e); + if (rv != OGS_OK) { + ogs_warn("ogs_queue_push() failed:%d", (int)rv); + udr_event_free(e); + return OGS_ERROR; + } + + return OGS_OK; +} + +static int client_cb(ogs_sbi_response_t *response, void *data) +{ + udr_event_t *e = NULL; + int rv; + + ogs_assert(response); + + e = udr_event_new(UDR_EVT_SBI_CLIENT); + ogs_assert(e); + e->sbi.response = response; + e->sbi.data = data; + + rv = ogs_queue_push(udr_self()->queue, e); + if (rv != OGS_OK) { + ogs_warn("ogs_queue_push() failed:%d", (int)rv); + udr_event_free(e); + return OGS_ERROR; + } + + return OGS_OK; +} + +int udr_sbi_open(void) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + + ogs_sbi_server_start_all(server_cb); + + ogs_list_for_each(&ogs_sbi_self()->nf_instance_list, nf_instance) { + ogs_sbi_nf_service_t *service = NULL; + + ogs_sbi_nf_instance_build_default(nf_instance, udr_self()->nf_type); + + service = ogs_sbi_nf_service_build_default(nf_instance, + (char*)OGS_SBI_SERVICE_NAME_NUDR_DR); + ogs_assert(service); + ogs_sbi_nf_service_add_version(service, (char*)OGS_SBI_API_VERSION, + (char*)OGS_SBI_API_FULL_VERSION, NULL); + + udr_nf_fsm_init(nf_instance); + udr_sbi_setup_client_callback(nf_instance); + } + + return OGS_OK; +} + +void udr_sbi_close(void) +{ + ogs_sbi_server_stop_all(); +} + +void udr_sbi_setup_client_callback(ogs_sbi_nf_instance_t *nf_instance) +{ + ogs_sbi_client_t *client = NULL; + ogs_sbi_nf_service_t *nf_service = NULL; + ogs_assert(nf_instance); + + client = nf_instance->client; + ogs_assert(client); + + client->cb = client_cb; + + ogs_list_for_each(&nf_instance->nf_service_list, nf_service) { + client = nf_service->client; + if (client) + client->cb = client_cb; + } +} diff --git a/src/udr/sbi-path.h b/src/udr/sbi-path.h new file mode 100644 index 0000000000..c027d2cacd --- /dev/null +++ b/src/udr/sbi-path.h @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef UDR_SBI_PATH_H +#define UDR_SBI_PATH_H + +#include "context.h" + +#ifdef __cplusplus +extern "C" { +#endif + +int udr_sbi_open(void); +void udr_sbi_close(void); + +void udr_sbi_setup_client_callback(ogs_sbi_nf_instance_t *nf_instance); + +#ifdef __cplusplus +} +#endif + +#endif /* UDR_SBI_PATH_H */ diff --git a/src/udr/timer.c b/src/udr/timer.c new file mode 100644 index 0000000000..70a86f52c1 --- /dev/null +++ b/src/udr/timer.c @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "context.h" + +static udr_timer_cfg_t g_udr_timer_cfg[MAX_NUM_OF_UDR_TIMER] = { + [UDR_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL] = + { .duration = ogs_time_from_sec(3) }, +}; + +udr_timer_cfg_t *udr_timer_cfg(udr_timer_e id) +{ + ogs_assert(id < MAX_NUM_OF_UDR_TIMER); + return &g_udr_timer_cfg[id]; +} + +const char *udr_timer_get_name(udr_timer_e id) +{ + switch (id) { + case UDR_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL: + return "UDR_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL"; + case UDR_TIMER_NF_INSTANCE_HEARTBEAT_INTERVAL: + return "UDR_TIMER_NF_INSTANCE_HEARTBEAT_INTERVAL"; + case UDR_TIMER_NF_INSTANCE_HEARTBEAT: + return "UDR_TIMER_NF_INSTANCE_HEARTBEAT"; + case UDR_TIMER_NF_INSTANCE_VALIDITY: + return "UDR_TIMER_NF_INSTANCE_VALIDITY"; + case UDR_TIMER_SUBSCRIPTION_VALIDITY: + return "UDR_TIMER_SUBSCRIPTION_VALIDITY"; + default: + break; + } + + return "UNKNOWN_TIMER"; +} + +static void sbi_timer_send_event(int timer_id, void *data) +{ + int rv; + udr_event_t *e = NULL; + ogs_assert(data); + + switch (timer_id) { + case UDR_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL: + case UDR_TIMER_NF_INSTANCE_HEARTBEAT_INTERVAL: + case UDR_TIMER_NF_INSTANCE_HEARTBEAT: + case UDR_TIMER_NF_INSTANCE_VALIDITY: + case UDR_TIMER_SUBSCRIPTION_VALIDITY: + e = udr_event_new(UDR_EVT_SBI_TIMER); + ogs_assert(e); + e->timer_id = timer_id; + e->sbi.data = data; + break; + default: + ogs_fatal("Unknown timer id[%d]", timer_id); + ogs_assert_if_reached(); + break; + } + + rv = ogs_queue_push(udr_self()->queue, e); + if (rv != OGS_OK) { + ogs_warn("ogs_queue_push() failed [%d] in %s", + (int)rv, udr_timer_get_name(e->timer_id)); + udr_event_free(e); + } +} + +void udr_timer_nf_instance_registration_interval(void *data) +{ + sbi_timer_send_event(UDR_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL, data); +} + +void udr_timer_nf_instance_heartbeat_interval(void *data) +{ + sbi_timer_send_event(UDR_TIMER_NF_INSTANCE_HEARTBEAT_INTERVAL, data); +} + +void udr_timer_nf_instance_heartbeat(void *data) +{ + sbi_timer_send_event(UDR_TIMER_NF_INSTANCE_HEARTBEAT, data); +} + +void udr_timer_nf_instance_validity(void *data) +{ + sbi_timer_send_event(UDR_TIMER_NF_INSTANCE_VALIDITY, data); +} + +void udr_timer_subscription_validity(void *data) +{ + sbi_timer_send_event(UDR_TIMER_SUBSCRIPTION_VALIDITY, data); +} diff --git a/src/udr/timer.h b/src/udr/timer.h new file mode 100644 index 0000000000..b877b8303a --- /dev/null +++ b/src/udr/timer.h @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2019 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef UDR_TIMER_H +#define UDR_TIMER_H + +#include "ogs-core.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* forward declaration */ +typedef enum { + UDR_TIMER_BASE = 0, + + UDR_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL, + UDR_TIMER_NF_INSTANCE_HEARTBEAT_INTERVAL, + UDR_TIMER_NF_INSTANCE_HEARTBEAT, + UDR_TIMER_NF_INSTANCE_VALIDITY, + UDR_TIMER_SUBSCRIPTION_VALIDITY, + + MAX_NUM_OF_UDR_TIMER, + +} udr_timer_e; + +typedef struct udr_timer_cfg_s { + int max_count; + ogs_time_t duration; +} udr_timer_cfg_t; + +udr_timer_cfg_t *udr_timer_cfg(udr_timer_e id); + +const char *udr_timer_get_name(udr_timer_e id); + +void udr_timer_nf_instance_registration_interval(void *data); +void udr_timer_nf_instance_heartbeat_interval(void *data); +void udr_timer_nf_instance_heartbeat(void *data); +void udr_timer_nf_instance_validity(void *data); +void udr_timer_subscription_validity(void *data); + +#ifdef __cplusplus +} +#endif + +#endif /* UDR_TIMER_H */ diff --git a/src/udr/udr-sm.c b/src/udr/udr-sm.c new file mode 100644 index 0000000000..845fe9d444 --- /dev/null +++ b/src/udr/udr-sm.c @@ -0,0 +1,285 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "sbi-path.h" +#include "nnrf-handler.h" +#include "nudr-handler.h" + +void udr_state_initial(ogs_fsm_t *s, udr_event_t *e) +{ + udr_sm_debug(e); + + ogs_assert(s); + + OGS_FSM_TRAN(s, &udr_state_operational); +} + +void udr_state_final(ogs_fsm_t *s, udr_event_t *e) +{ + udr_sm_debug(e); + + ogs_assert(s); +} + +void udr_state_operational(ogs_fsm_t *s, udr_event_t *e) +{ + int rv; + + ogs_sbi_session_t *session = NULL; + ogs_sbi_request_t *request = NULL; + + ogs_sbi_nf_instance_t *nf_instance = NULL; + ogs_sbi_subscription_t *subscription = NULL; + ogs_sbi_response_t *response = NULL; + ogs_sbi_message_t message; + + udr_sm_debug(e); + + ogs_assert(s); + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + rv = udr_sbi_open(); + if (rv != OGS_OK) { + ogs_fatal("Can't establish SBI path"); + } + + break; + + case OGS_FSM_EXIT_SIG: + udr_sbi_close(); + break; + + case UDR_EVT_SBI_SERVER: + request = e->sbi.request; + ogs_assert(request); + session = e->sbi.session; + ogs_assert(session); + + rv = ogs_sbi_parse_request(&message, request); + if (rv != OGS_OK) { + /* 'message' buffer is released in ogs_sbi_parse_request() */ + ogs_error("cannot parse HTTP message"); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + NULL, "cannot parse HTTP message", NULL); + break; + } + + if (strcmp(message.h.api.version, OGS_SBI_API_VERSION) != 0) { + ogs_error("Not supported version [%s]", message.h.api.version); + ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + &message, "Not supported version", NULL); + ogs_sbi_message_free(&message); + break; + } + + SWITCH(message.h.service.name) + CASE(OGS_SBI_SERVICE_NAME_NNRF_NFM) + + SWITCH(message.h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY) + SWITCH(message.h.method) + CASE(OGS_SBI_HTTP_METHOD_POST) + udr_nnrf_handle_nf_status_notify(session, &message); + break; + + DEFAULT + ogs_error("Invalid HTTP method [%s]", + message.h.method); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, + &message, "Invalid HTTP method", message.h.method); + END + break; + + DEFAULT + ogs_error("Invalid resource name [%s]", + message.h.resource.component[0]); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, &message, + "Unknown resource name", + message.h.resource.component[0]); + END + break; + + CASE(OGS_SBI_SERVICE_NAME_NUDR_DR) + SWITCH(message.h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_SUBSCRIPTION_DATA) + SWITCH(message.h.resource.component[2]) + CASE(OGS_SBI_RESOURCE_NAME_AUTHENTICATION_DATA) + udr_nudr_dr_handle_subscription_authentication( + session, &message); + break; + + DEFAULT + ogs_error("Invalid resource name [%s]", + message.h.resource.component[2]); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, + &message, "Unknown resource name", + message.h.resource.component[2]); + END + break; + DEFAULT + ogs_error("Invalid resource name [%s]", + message.h.resource.component[0]); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, + &message, "Unknown resource name", + message.h.resource.component[0]); + END + break; + + DEFAULT + ogs_error("Invalid API name [%s]", message.h.service.name); + ogs_sbi_server_send_error(session, + OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, &message, + "Invalid API name", message.h.resource.component[0]); + END + + /* In lib/sbi/server.c, notify_completed() releases 'request' buffer. */ + ogs_sbi_message_free(&message); + break; + + case UDR_EVT_SBI_CLIENT: + ogs_assert(e); + + response = e->sbi.response; + ogs_assert(response); + rv = ogs_sbi_parse_response(&message, response); + if (rv != OGS_OK) { + ogs_error("cannot parse HTTP response"); + ogs_sbi_message_free(&message); + ogs_sbi_response_free(response); + break; + } + + if (strcmp(message.h.api.version, OGS_SBI_API_VERSION) != 0) { + ogs_error("Not supported version [%s]", message.h.api.version); + ogs_sbi_message_free(&message); + ogs_sbi_response_free(response); + break; + } + + SWITCH(message.h.service.name) + CASE(OGS_SBI_SERVICE_NAME_NNRF_NFM) + + SWITCH(message.h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES) + nf_instance = e->sbi.data; + ogs_assert(nf_instance); + ogs_assert(OGS_FSM_STATE(&nf_instance->sm)); + + e->sbi.message = &message; + ogs_fsm_dispatch(&nf_instance->sm, e); + + if (OGS_FSM_CHECK(&nf_instance->sm, udr_nf_state_exception)) { + ogs_error("[%s] State machine exception", nf_instance->id); + } + break; + + CASE(OGS_SBI_RESOURCE_NAME_SUBSCRIPTIONS) + subscription = e->sbi.data; + ogs_assert(subscription); + + SWITCH(message.h.method) + CASE(OGS_SBI_HTTP_METHOD_POST) + if (message.res_status == OGS_SBI_HTTP_STATUS_CREATED || + message.res_status == OGS_SBI_HTTP_STATUS_OK) { + udr_nnrf_handle_nf_status_subscribe( + subscription, &message); + } else { + ogs_error("[%s] HTTP response error [%d]", + subscription->id, message.res_status); + } + break; + + CASE(OGS_SBI_HTTP_METHOD_DELETE) + if (message.res_status == + OGS_SBI_HTTP_STATUS_NO_CONTENT) { + ogs_sbi_subscription_remove(subscription); + } else { + ogs_error("[%s] HTTP response error [%d]", + subscription->id, message.res_status); + } + break; + + DEFAULT + ogs_error("[%s] Invalid HTTP method [%s]", + subscription->id, message.h.method); + ogs_assert_if_reached(); + END + break; + + DEFAULT + ogs_error("Invalid resource name [%s]", + message.h.resource.component[0]); + ogs_assert_if_reached(); + END + break; + + DEFAULT + ogs_error("Invalid API name [%s]", message.h.service.name); + ogs_assert_if_reached(); + END + + ogs_sbi_message_free(&message); + ogs_sbi_response_free(response); + break; + + case UDR_EVT_SBI_TIMER: + ogs_assert(e); + + switch(e->timer_id) { + case UDR_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL: + case UDR_TIMER_NF_INSTANCE_HEARTBEAT_INTERVAL: + case UDR_TIMER_NF_INSTANCE_HEARTBEAT: + case UDR_TIMER_NF_INSTANCE_VALIDITY: + nf_instance = e->sbi.data; + ogs_assert(nf_instance); + ogs_assert(OGS_FSM_STATE(&nf_instance->sm)); + + ogs_fsm_dispatch(&nf_instance->sm, e); + if (OGS_FSM_CHECK(&nf_instance->sm, udr_nf_state_exception)) + ogs_error("[%s] State machine exception [%d]", + nf_instance->id, e->timer_id); + break; + + case UDR_TIMER_SUBSCRIPTION_VALIDITY: + subscription = e->sbi.data; + ogs_assert(subscription); + + ogs_info("[%s] Subscription validity expired", subscription->id); + ogs_sbi_subscription_remove(subscription); + + ogs_nnrf_nfm_send_nf_status_subscribe(subscription->client, + udr_self()->nf_type, subscription->nf_instance_id); + break; + + default: + ogs_error("Unknown timer[%s:%d]", + udr_timer_get_name(e->timer_id), e->timer_id); + } + break; + + default: + ogs_error("No handler for event %s", udr_event_get_name(e)); + break; + } +} diff --git a/src/udr/udr-sm.h b/src/udr/udr-sm.h new file mode 100644 index 0000000000..a2eb179109 --- /dev/null +++ b/src/udr/udr-sm.h @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef UDR_SM_H +#define UDR_SM_H + +#include "event.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void udr_state_initial(ogs_fsm_t *s, udr_event_t *e); +void udr_state_final(ogs_fsm_t *s, udr_event_t *e); +void udr_state_operational(ogs_fsm_t *s, udr_event_t *e); + +void udr_nf_fsm_init(ogs_sbi_nf_instance_t *nf_instance); +void udr_nf_fsm_fini(ogs_sbi_nf_instance_t *nf_instance); + +void udr_nf_state_initial(ogs_fsm_t *s, udr_event_t *e); +void udr_nf_state_final(ogs_fsm_t *s, udr_event_t *e); +void udr_nf_state_will_register(ogs_fsm_t *s, udr_event_t *e); +void udr_nf_state_registered(ogs_fsm_t *s, udr_event_t *e); +void udr_nf_state_de_registered(ogs_fsm_t *s, udr_event_t *e); +void udr_nf_state_exception(ogs_fsm_t *s, udr_event_t *e); + +#define udr_sm_debug(__pe) \ + ogs_debug("%s(): %s", __func__, udr_event_get_name(__pe)) + +#ifdef __cplusplus +} +#endif + +#endif /* UDR_SM_H */ diff --git a/tests/app/5gc-init.c b/tests/app/5gc-init.c index 41456e121a..abe1323d54 100644 --- a/tests/app/5gc-init.c +++ b/tests/app/5gc-init.c @@ -20,16 +20,15 @@ #include "test-5gc.h" static ogs_thread_t *nrf_thread = NULL; -static ogs_thread_t *smf_thread = NULL; +static ogs_thread_t *ausf_thread = NULL; +static ogs_thread_t *udm_thread = NULL; +static ogs_thread_t *udr_thread = NULL; static ogs_thread_t *upf_thread = NULL; -#if 0 +static ogs_thread_t *smf_thread = NULL; static ogs_thread_t *amf_thread = NULL; -#endif int app_initialize(const char *const argv[]) { - int rv; - const char *argv_out[OGS_ARG_MAX]; bool user_config = false; int i = 0; @@ -50,29 +49,30 @@ int app_initialize(const char *const argv[]) if (ogs_config()->parameter.no_nrf == 0) nrf_thread = test_child_create("nrf", argv_out); + if (ogs_config()->parameter.no_ausf == 0) + ausf_thread = test_child_create("ausf", argv_out); + if (ogs_config()->parameter.no_udm == 0) + udm_thread = test_child_create("udm", argv_out); + if (ogs_config()->parameter.no_udr == 0) + udr_thread = test_child_create("udr", argv_out); if (ogs_config()->parameter.no_upf == 0) upf_thread = test_child_create("upf", argv_out); if (ogs_config()->parameter.no_smf == 0) smf_thread = test_child_create("smf", argv_out); - - ogs_sctp_init(ogs_config()->usrsctp.udp_port); - - rv = amf_initialize(); - ogs_assert(rv == OGS_OK); - ogs_info("AMF initialize...done"); + if (ogs_config()->parameter.no_amf == 0) + amf_thread = test_child_create("amf", argv_out); return OGS_OK;; } void app_terminate(void) { - amf_terminate(); - - ogs_sctp_final(); - ogs_info("AMF terminate...done"); - + if (amf_thread) ogs_thread_destroy(amf_thread); if (smf_thread) ogs_thread_destroy(smf_thread); if (upf_thread) ogs_thread_destroy(upf_thread); + if (udm_thread) ogs_thread_destroy(udm_thread); + if (udr_thread) ogs_thread_destroy(udr_thread); + if (ausf_thread) ogs_thread_destroy(ausf_thread); if (nrf_thread) ogs_thread_destroy(nrf_thread); } @@ -82,7 +82,13 @@ void test_5gc_init(void) ogs_log_install_domain(&__ogs_ngap_domain, "ngap", OGS_LOG_ERROR); ogs_log_install_domain(&__ogs_dbi_domain, "dbi", OGS_LOG_ERROR); ogs_log_install_domain(&__ogs_nas_domain, "nas", OGS_LOG_ERROR); - ogs_log_install_domain(&__ogs_sbi_domain, "sbi", OGS_LOG_ERROR); - ogs_assert(ogs_mongoc_init(ogs_config()->db_uri) == OGS_OK); + ogs_sctp_init(ogs_config()->usrsctp.udp_port); + ogs_assert(ogs_dbi_init(ogs_config()->db_uri) == OGS_OK); +} + +void test_5gc_final(void) +{ + ogs_dbi_final(); + ogs_sctp_final(); } diff --git a/tests/app/epc-init.c b/tests/app/epc-init.c index 34ddc514e5..fb1123caa2 100644 --- a/tests/app/epc-init.c +++ b/tests/app/epc-init.c @@ -85,5 +85,5 @@ void test_epc_init(void) ogs_log_install_domain(&__ogs_dbi_domain, "dbi", OGS_LOG_ERROR); ogs_log_install_domain(&__ogs_nas_domain, "nas", OGS_LOG_ERROR); - ogs_assert(ogs_mongoc_init(ogs_config()->db_uri) == OGS_OK); + ogs_assert(ogs_dbi_init(ogs_config()->db_uri) == OGS_OK); } diff --git a/tests/app/meson.build b/tests/app/meson.build index d6752da552..8d7f441a3e 100644 --- a/tests/app/meson.build +++ b/tests/app/meson.build @@ -69,15 +69,13 @@ libtest5gc = static_library('test5gc', c_args : libtest5gc_cc_args, include_directories : [libtestapp_inc, srcinc], link_with : libamf, - dependencies : [libtestcommon_dep, - libamf_dep], + dependencies : libtestcommon_dep, install : false) libtest5gc_dep = declare_dependency( link_with : libtest5gc, include_directories : [libtestapp_inc, srcinc], - dependencies : [libtestcommon_dep, - libamf_dep]) + dependencies : libtestcommon_dep) test5gc_sources = files(''' ../../src/main.c diff --git a/tests/app/test-5gc.h b/tests/app/test-5gc.h index 83acbdfc73..ed1813cfe9 100644 --- a/tests/app/test-5gc.h +++ b/tests/app/test-5gc.h @@ -23,14 +23,12 @@ #include "test-common.h" #include "test-ngap.h" -#include "amf/context.h" - #ifdef __cplusplus extern "C" { #endif void test_5gc_init(void); -#define test_5gc_final ogs_mongoc_final +void test_5gc_final(void); #ifdef __cplusplus } diff --git a/tests/app/test-epc.h b/tests/app/test-epc.h index b30c04a37d..b229cc3578 100644 --- a/tests/app/test-epc.h +++ b/tests/app/test-epc.h @@ -29,7 +29,7 @@ extern "C" { #endif void test_epc_init(void); -#define test_epc_final ogs_mongoc_final +#define test_epc_final ogs_dbi_final #ifdef __cplusplus } diff --git a/tests/common/context.c b/tests/common/context.c index 60bf499b3d..92cf082a3d 100644 --- a/tests/common/context.c +++ b/tests/common/context.c @@ -53,6 +53,20 @@ static int test_context_prepare(void) static int test_context_validation(void) { + if (test_self()->served_tai[0].list2.num) { + memcpy(&test_self()->tai, + &test_self()->served_tai[0].list2.tai[0], sizeof(ogs_5gs_tai_t)); + } else if (test_self()->served_tai[0].list0.tai[0].num) { + test_self()->tai.tac = test_self()->served_tai[0].list0.tai[0].tac[0]; + memcpy(&test_self()->tai.plmn_id, + &test_self()->served_tai[0].list0.tai[0].plmn_id, + OGS_PLMN_ID_LEN); + } + + memcpy(&test_self()->cgi.plmn_id, &test_self()->tai.plmn_id, + OGS_PLMN_ID_LEN); + test_self()->cgi.cell_id = 1; + return OGS_OK; } @@ -449,3 +463,30 @@ int test_context_parse_config(void) return OGS_OK; } + +void test_ue_set_mobile_identity(test_ue_t *test_ue, + ogs_nas_5gs_mobile_identity_t *mobile_identity) +{ + ogs_assert(test_ue); + ogs_assert(mobile_identity); + + if (test_ue->suci) + ogs_free(test_ue->suci); + test_ue->suci = ogs_nas_5gs_ueid_from_mobile_identity(mobile_identity); + if (test_ue->supi) + ogs_free(test_ue->supi); + test_ue->supi = ogs_supi_from_suci(test_ue->suci); + if (test_ue->imsi) + ogs_free(test_ue->imsi); + test_ue->imsi = ogs_ueid_from_supi(test_ue->supi); +} + +void test_ue_remove(test_ue_t *test_ue) +{ + if (test_ue->suci) + ogs_free(test_ue->suci); + if (test_ue->supi) + ogs_free(test_ue->supi); + if (test_ue->imsi) + ogs_free(test_ue->imsi); +} diff --git a/tests/common/context.h b/tests/common/context.h index 1e7084d856..3082ab9dec 100644 --- a/tests/common/context.h +++ b/tests/common/context.h @@ -53,14 +53,76 @@ typedef struct test_context_s { ogs_s_nssai_t s_nssai[OGS_MAX_NUM_OF_S_NSSAI]; } plmn_support[OGS_MAX_NUM_OF_PLMN]; + ogs_5gs_tai_t tai; + ogs_nr_cgi_t cgi; } test_context_t; +typedef struct test_ue_s { + uint32_t ran_ue_ngap_id; /* eNB-UE-NGAP-ID received from eNB */ + uint64_t amf_ue_ngap_id; /* AMF-UE-NGAP-ID received from AMF */ + + char *imsi; + char *suci; /* TS33.501 : SUCI */ + char *supi; /* TS33.501 : SUPI */ + + uint8_t k[OGS_KEY_LEN]; + uint8_t opc[OGS_KEY_LEN]; + + uint8_t rand[OGS_RAND_LEN]; + uint8_t autn[OGS_AUTN_LEN]; + uint8_t abba[OGS_NAS_MAX_ABBA_LEN]; + uint8_t abba_len; + uint8_t kamf[OGS_SHA256_DIGEST_SIZE]; + + struct { +#define OGS_NAS_SECURITY_BEARER_3GPP 1 +#define OGS_NAS_SECURITY_BEARER_NON_3GPP 2 + uint8_t connection_identifier; + uint8_t ksi; + } nas; + + uint8_t knas_int[OGS_SHA256_DIGEST_SIZE/2]; + uint8_t knas_enc[OGS_SHA256_DIGEST_SIZE/2]; + uint32_t ul_count; + union { + struct { + ED3(uint8_t spare;, + uint16_t overflow;, + uint8_t sqn;) + } __attribute__ ((packed)); + uint32_t i32; + } dl_count; + uint8_t kgnb[OGS_SHA256_DIGEST_SIZE]; + + uint8_t selected_enc_algorithm; + uint8_t selected_int_algorithm; + +#define TEST_SECURITY_CONTEXT_IS_VALID(__tEST) \ + ((__tEST) && \ + ((__tEST)->security_context_available == 1) && \ + ((__tEST)->mac_failed == 0) && \ + ((__tEST)->nas.ksi != OGS_NAS_KSI_NO_KEY_IS_AVAILABLE)) +#define TEST_CLEAR_SECURITY_CONTEXT(__tEST) \ + do { \ + ogs_assert((__tEST)); \ + (__tEST)->security_context_available = 0; \ + (__tEST)->mac_failed = 0; \ + (__tEST)->nas.ksi = 0; \ + } while(0) + int security_context_available; + int mac_failed; +} test_ue_t; + void test_context_init(void); void test_context_final(void); test_context_t *test_self(void); int test_context_parse_config(void); +void test_ue_set_mobile_identity(test_ue_t *test_ue, + ogs_nas_5gs_mobile_identity_t *mobile_identity); +void test_ue_remove(test_ue_t *test_ue); + #ifdef __cplusplus } #endif diff --git a/tests/common/gmm-build.c b/tests/common/gmm-build.c new file mode 100644 index 0000000000..4a1bd72654 --- /dev/null +++ b/tests/common/gmm-build.c @@ -0,0 +1,164 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "test-common.h" + +ogs_pkbuf_t *testgmm_build_registration_request(test_ue_t *test_ue, + ogs_nas_5gs_mobile_identity_t *mobile_identity) +{ + ogs_nas_5gs_message_t message; + ogs_pkbuf_t *pkbuf = NULL; + ogs_nas_5gs_registration_request_t *registration_request = + &message.gmm.registration_request; + ogs_nas_5gs_registration_type_t *registration_type = + ®istration_request->registration_type; + ogs_nas_5gmm_capability_t *gmm_capability = + ®istration_request->gmm_capability; + ogs_nas_ue_security_capability_t *ue_security_capability = + ®istration_request->ue_security_capability; + + ogs_assert(test_ue); + ogs_assert(mobile_identity); + + memset(&message, 0, sizeof(message)); + message.gmm.h.extended_protocol_discriminator = + OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM; + message.gmm.h.message_type = OGS_NAS_5GS_REGISTRATION_REQUEST; + + registration_type->type = 1; + registration_type->follow_on_request = 1; + registration_type->value = 1; + + registration_request->mobile_identity.length = mobile_identity->length; + registration_request->mobile_identity.buffer = mobile_identity->buffer; + + registration_request->presencemask |= + OGS_NAS_5GS_REGISTRATION_REQUEST_5GMM_CAPABILITY_PRESENT; + gmm_capability->length = 1; + gmm_capability->lte_positioning_protocol_capability = 1; + gmm_capability->ho_attach = 1; + gmm_capability->s1_mode = 1; + + registration_request->presencemask |= + OGS_NAS_5GS_REGISTRATION_REQUEST_UE_SECURITY_CAPABILITY_PRESENT; + ue_security_capability->length = 8; + ue_security_capability->nea = 0xff; + ue_security_capability->nia = 0xff; + ue_security_capability->eps_ea = 0xff; + ue_security_capability->eps_ia = 0xff; + + return ogs_nas_5gs_plain_encode(&message); +} + +ogs_pkbuf_t *testgmm_build_authentication_response(test_ue_t *test_ue) +{ + ogs_nas_5gs_message_t message; + ogs_pkbuf_t *pkbuf = NULL; + ogs_nas_5gs_authentication_response_t *authentication_response = + &message.gmm.authentication_response; + ogs_nas_authentication_response_parameter_t *authentication_response_parameter = &authentication_response->authentication_response_parameter; + + uint8_t ik[OGS_KEY_LEN]; + uint8_t ck[OGS_KEY_LEN]; + uint8_t ak[OGS_AK_LEN]; + uint8_t res[OGS_MAX_RES_LEN]; + uint8_t res_star[OGS_MAX_RES_LEN]; + uint8_t kausf[OGS_SHA256_DIGEST_SIZE]; + uint8_t kseaf[OGS_SHA256_DIGEST_SIZE]; + char *serving_network_name; + + ogs_assert(test_ue); + + memset(&message, 0, sizeof(message)); + message.gmm.h.extended_protocol_discriminator = + OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM; + message.gmm.h.message_type = OGS_NAS_5GS_AUTHENTICATION_RESPONSE; + + authentication_response->presencemask |= + OGS_NAS_5GS_AUTHENTICATION_RESPONSE_AUTHENTICATION_RESPONSE_PARAMETER_PRESENT; + + milenage_f2345(test_ue->opc, test_ue->k, test_ue->rand, + res, ck, ik, ak, NULL); + serving_network_name = ogs_plmn_id_string(&test_self()->tai.plmn_id); + ogs_kdf_xres_star( + ck, ik, + serving_network_name, test_ue->rand, res, 8, + authentication_response_parameter->res); + + authentication_response_parameter->length = 16; + + memcpy(res_star, authentication_response_parameter->res, + authentication_response_parameter->length); + ogs_kdf_kausf(ck, ik, serving_network_name, test_ue->autn, kausf); + ogs_kdf_kseaf(serving_network_name, kausf, kseaf); + ogs_kdf_kamf(test_ue->supi, test_ue->abba, test_ue->abba_len, + kseaf, test_ue->kamf); + + ogs_free(serving_network_name); + + return ogs_nas_5gs_plain_encode(&message); +} + +ogs_pkbuf_t *testgmm_build_security_mode_complete( + test_ue_t *test_ue, ogs_pkbuf_t *nasbuf) +{ + ogs_nas_5gs_message_t message; + ogs_pkbuf_t *pkbuf = NULL; + ogs_nas_5gs_security_mode_complete_t *security_mode_complete = + &message.gmm.security_mode_complete; + ogs_nas_message_container_t *nas_message_container = + &security_mode_complete->nas_message_container; + ogs_nas_5gs_mobile_identity_t *imeisv = + &security_mode_complete->imeisv; + + ogs_nas_mobile_identity_imeisv_t mobile_identity_imeisv; + + ogs_assert(test_ue); + + memset(&message, 0, sizeof(message)); + message.h.security_header_type = + OGS_NAS_SECURITY_HEADER_INTEGRITY_PROTECTED_AND_CIPHTERD_WITH_NEW_INTEGRITY_CONTEXT; + message.h.extended_protocol_discriminator = + OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM; + + message.gmm.h.extended_protocol_discriminator = + OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM; + message.gmm.h.message_type = OGS_NAS_5GS_SECURITY_MODE_COMPLETE; + + security_mode_complete->presencemask |= + OGS_NAS_5GS_SECURITY_MODE_COMPLETE_IMEISV_PRESENT; + memset(&mobile_identity_imeisv, 0, sizeof(mobile_identity_imeisv)); + imeisv->length = sizeof(mobile_identity_imeisv); + imeisv->buffer = &mobile_identity_imeisv; + + mobile_identity_imeisv.type = OGS_NAS_5GS_MOBILE_IDENTITY_IMEISV; + mobile_identity_imeisv.odd_even = OGS_NAS_MOBILE_IDENTITY_EVEN; + mobile_identity_imeisv.digit1 = 1; + mobile_identity_imeisv.digit2 = 1; + mobile_identity_imeisv.digit3 = 1; + + if (nasbuf) { + security_mode_complete->presencemask |= + OGS_NAS_5GS_SECURITY_MODE_COMPLETE_NAS_MESSAGE_CONTAINER_PRESENT; + nas_message_container->length = nasbuf->len; + nas_message_container->buffer = nasbuf->data; + } + + return test_nas_5gs_security_encode(test_ue, &message); +} diff --git a/tests/common/gmm-build.h b/tests/common/gmm-build.h new file mode 100644 index 0000000000..95d1fad72b --- /dev/null +++ b/tests/common/gmm-build.h @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef TEST_GMM_BUILD_H +#define TEST_GMM_BUILD_H + +#ifdef __cplusplus +extern "C" { +#endif + +ogs_pkbuf_t *testgmm_build_registration_request(test_ue_t *test_ue, + ogs_nas_5gs_mobile_identity_t *mobile_identity); +ogs_pkbuf_t *testgmm_build_authentication_response(test_ue_t *test_ue); +ogs_pkbuf_t *testgmm_build_security_mode_complete( + test_ue_t *test_ue, ogs_pkbuf_t *nasbuf); + +#ifdef __cplusplus +} +#endif + +#endif /* TEST_GMM_BUILD_H */ diff --git a/tests/common/gmm-handler.c b/tests/common/gmm-handler.c new file mode 100644 index 0000000000..70aeafcf50 --- /dev/null +++ b/tests/common/gmm-handler.c @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "test-common.h" + +void testgmm_handle_authentication_request(test_ue_t *test_ue, + ogs_nas_5gs_authentication_request_t *authentication_request) +{ + ogs_nas_authentication_parameter_rand_t *authentication_parameter_rand = + NULL; + ogs_nas_authentication_parameter_autn_t *authentication_parameter_autn = + NULL; + ogs_nas_key_set_identifier_t *ngksi = NULL; + + ogs_assert(test_ue); + ogs_assert(authentication_request); + + authentication_parameter_rand = &authentication_request-> + authentication_parameter_rand; + authentication_parameter_autn = &authentication_request-> + authentication_parameter_autn; + ngksi = &authentication_request->ngksi; + + test_ue->nas.ksi = ngksi->value; + + memcpy(test_ue->rand, authentication_parameter_rand->rand, OGS_RAND_LEN); + memcpy(test_ue->autn, authentication_parameter_autn->autn, OGS_AUTN_LEN); +} + +void testgmm_handle_security_mode_command(test_ue_t *test_ue, + ogs_nas_5gs_security_mode_command_t *security_mode_command) +{ + ogs_nas_security_algorithms_t *selected_nas_security_algorithms = NULL; + ogs_nas_key_set_identifier_t *ngksi = NULL; + + ogs_assert(test_ue); + ogs_assert(security_mode_command); + + selected_nas_security_algorithms = + &security_mode_command->selected_nas_security_algorithms; + ngksi = &security_mode_command->ngksi; + + test_ue->selected_enc_algorithm = + selected_nas_security_algorithms->type_of_ciphering_algorithm; + test_ue->selected_int_algorithm = + selected_nas_security_algorithms-> + type_of_integrity_protection_algorithm; + + ogs_kdf_nas_5gs(OGS_KDF_NAS_INT_ALG, test_ue->selected_int_algorithm, + test_ue->kamf, test_ue->knas_int); + ogs_kdf_nas_5gs(OGS_KDF_NAS_ENC_ALG, test_ue->selected_enc_algorithm, + test_ue->kamf, test_ue->knas_enc); + + test_ue->nas.ksi = ngksi->value; + + test_ue->security_context_available = 1; +} diff --git a/tests/common/gmm-handler.h b/tests/common/gmm-handler.h new file mode 100644 index 0000000000..68a941459e --- /dev/null +++ b/tests/common/gmm-handler.h @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef TEST_GMM_HANDLE_H +#define TEST_GMM_HANDLE_H + +#ifdef __cplusplus +extern "C" { +#endif + +void testgmm_handle_authentication_request(test_ue_t *test_ue, + ogs_nas_5gs_authentication_request_t *authentication_request); +void testgmm_handle_security_mode_command(test_ue_t *test_ue, + ogs_nas_5gs_security_mode_command_t *security_mode_command); + +#ifdef __cplusplus +} +#endif + +#endif /* TEST_GMM_HANDLE_H */ diff --git a/tests/common/meson.build b/tests/common/meson.build index 82fbd4b9ef..c1f9c7a077 100644 --- a/tests/common/meson.build +++ b/tests/common/meson.build @@ -27,6 +27,13 @@ libtestcommon_sources = files(''' application.c ngap-build.c + ngap-handler.c + ngap-path.c + + gmm-build.c + gmm-handler.c + nas-path.c + nas-security.c '''.split()) libtestcommon_inc = include_directories('.') diff --git a/tests/common/nas-path.c b/tests/common/nas-path.c new file mode 100644 index 0000000000..87e4120c63 --- /dev/null +++ b/tests/common/nas-path.c @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "test-common.h" + +void testgmm_recv(test_ue_t *test_ue, ogs_pkbuf_t *pkbuf) +{ + int rv; + ogs_nas_5gs_message_t message; + + ogs_assert(test_ue); + ogs_assert(pkbuf); + + rv = ogs_nas_5gmm_decode(&message, pkbuf); + ogs_assert(rv == OGS_OK); + + switch (message.gmm.h.message_type) { + case OGS_NAS_5GS_AUTHENTICATION_REQUEST: + testgmm_handle_authentication_request(test_ue, + &message.gmm.authentication_request); + break; + case OGS_NAS_5GS_SECURITY_MODE_COMMAND: + break; + default: + ogs_error("Unknown message[%d]", message.gmm.h.message_type); + break; + } + + ogs_pkbuf_free(pkbuf); +} + +void testgsm_recv(test_ue_t *test_ue, ogs_pkbuf_t *pkbuf) +{ + ogs_assert(test_ue); + ogs_assert(pkbuf); + + ogs_pkbuf_free(pkbuf); +} diff --git a/tests/common/nas-path.h b/tests/common/nas-path.h new file mode 100644 index 0000000000..99a5e75035 --- /dev/null +++ b/tests/common/nas-path.h @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef TEST_NAS_PATH_H +#define TEST_NAS_PATH_H + +#ifdef __cplusplus +extern "C" { +#endif + +void testgmm_recv(test_ue_t *test_ue, ogs_pkbuf_t *pkbuf); +void testgsm_recv(test_ue_t *test_ue, ogs_pkbuf_t *pkbuf); + +#ifdef __cplusplus +} +#endif + +#endif /* TEST_NAS_PATH_H */ diff --git a/tests/common/nas-security.c b/tests/common/nas-security.c new file mode 100644 index 0000000000..f08e4469a0 --- /dev/null +++ b/tests/common/nas-security.c @@ -0,0 +1,190 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "test-common.h" + +#define NAS_SECURITY_DOWNLINK_DIRECTION 1 +#define NAS_SECURITY_UPLINK_DIRECTION 0 + +#define NAS_SECURITY_MAC_SIZE 4 + +ogs_pkbuf_t *test_nas_5gs_security_encode( + test_ue_t *test_ue, ogs_nas_5gs_message_t *message) +{ + int integrity_protected = 0; + int new_security_context = 0; + int ciphered = 0; + ogs_nas_5gs_security_header_t h; + ogs_pkbuf_t *new = NULL; + + ogs_assert(test_ue); + ogs_assert(message); + + switch (message->h.security_header_type) { + case OGS_NAS_SECURITY_HEADER_PLAIN_NAS_MESSAGE: + return ogs_nas_5gs_plain_encode(message); + case OGS_NAS_SECURITY_HEADER_INTEGRITY_PROTECTED: + integrity_protected = 1; + break; + case OGS_NAS_SECURITY_HEADER_INTEGRITY_PROTECTED_AND_CIPHERED: + integrity_protected = 1; + ciphered = 1; + break; + case OGS_NAS_SECURITY_HEADER_INTEGRITY_PROTECTED_AND_NEW_SECURITY_CONTEXT: + integrity_protected = 1; + new_security_context = 1; + break; + case OGS_NAS_SECURITY_HEADER_INTEGRITY_PROTECTED_AND_CIPHTERD_WITH_NEW_INTEGRITY_CONTEXT: + integrity_protected = 1; + new_security_context = 1; + ciphered = 1; + break; + default: + ogs_error("Not implemented(securiry header type:0x%x)", + message->h.security_header_type); + return NULL; + } + + if (new_security_context) { + test_ue->ul_count = 0; + test_ue->dl_count.i32 = 0; + } + + if (test_ue->selected_enc_algorithm == 0) + ciphered = 0; + if (test_ue->selected_int_algorithm == 0) + integrity_protected = 0; + + memset(&h, 0, sizeof(h)); + h.security_header_type = message->h.security_header_type; + h.extended_protocol_discriminator = + message->h.extended_protocol_discriminator; + h.sequence_number = (test_ue->ul_count & 0xff); + + new = ogs_nas_5gs_plain_encode(message); + if (!new) { + ogs_error("ogs_nas_5gs_plain_encode() failed"); + return NULL; + } + + if (ciphered) { + /* encrypt NAS message */ + ogs_nas_encrypt(test_ue->selected_enc_algorithm, + test_ue->knas_enc, test_ue->ul_count, + test_ue->nas.connection_identifier, + NAS_SECURITY_UPLINK_DIRECTION, new); + } + + /* encode sequence number */ + ogs_assert(ogs_pkbuf_push(new, 1)); + *(uint8_t *)(new->data) = h.sequence_number; + + if (integrity_protected) { + uint8_t mac[NAS_SECURITY_MAC_SIZE]; + + /* calculate NAS MAC(message authentication code) */ + ogs_nas_mac_calculate(test_ue->selected_int_algorithm, + test_ue->knas_int, test_ue->ul_count, + test_ue->nas.connection_identifier, + NAS_SECURITY_UPLINK_DIRECTION, new, mac); + memcpy(&h.message_authentication_code, mac, sizeof(mac)); + } + + /* increase ul_count */ + test_ue->ul_count = (test_ue->ul_count + 1) & 0xffffff; /* Use 24bit */ + + /* encode all security header */ + ogs_assert(ogs_pkbuf_push(new, 6)); + memcpy(new->data, &h, sizeof(ogs_nas_5gs_security_header_t)); + + return new; +} + +int test_nas_5gs_security_decode(test_ue_t *test_ue, + ogs_nas_security_header_type_t security_header_type, ogs_pkbuf_t *pkbuf) +{ + ogs_assert(test_ue); + ogs_assert(pkbuf); + ogs_assert(pkbuf->data); + + if (!test_ue->security_context_available) { + security_header_type.integrity_protected = 0; + security_header_type.new_security_context = 0; + security_header_type.ciphered = 0; + } + + if (security_header_type.new_security_context) { + test_ue->dl_count.i32 = 0; + } + + if (test_ue->selected_enc_algorithm == 0) + security_header_type.ciphered = 0; + if (test_ue->selected_int_algorithm == 0) + security_header_type.integrity_protected = 0; + + if (security_header_type.ciphered || + security_header_type.integrity_protected) { + ogs_nas_5gs_security_header_t *h = NULL; + + /* NAS Security Header */ + ogs_assert(ogs_pkbuf_push(pkbuf, 7)); + h = (ogs_nas_5gs_security_header_t *)pkbuf->data; + + /* NAS Security Header.Sequence_Number */ + ogs_assert(ogs_pkbuf_pull(pkbuf, 6)); + + /* calculate dl_count */ + if (test_ue->dl_count.sqn > h->sequence_number) + test_ue->dl_count.overflow++; + test_ue->dl_count.sqn = h->sequence_number; + + if (security_header_type.integrity_protected) { + uint8_t mac[NAS_SECURITY_MAC_SIZE]; + uint32_t mac32; + uint32_t original_mac = h->message_authentication_code; + + /* calculate NAS MAC(message authentication code) */ + ogs_nas_mac_calculate(test_ue->selected_int_algorithm, + test_ue->knas_int, test_ue->dl_count.i32, + test_ue->nas.connection_identifier, + NAS_SECURITY_DOWNLINK_DIRECTION, pkbuf, mac); + h->message_authentication_code = original_mac; + + memcpy(&mac32, mac, NAS_SECURITY_MAC_SIZE); + if (h->message_authentication_code != mac32) { + ogs_error("NAS MAC verification failed(0x%x != 0x%x)", + ntohl(h->message_authentication_code), ntohl(mac32)); + test_ue->mac_failed = 1; + } + } + + /* NAS EMM Header or ESM Header */ + ogs_assert(ogs_pkbuf_pull(pkbuf, 1)); + + if (security_header_type.ciphered) { + /* decrypt NAS message */ + ogs_nas_encrypt(test_ue->selected_enc_algorithm, + test_ue->knas_enc, test_ue->dl_count.i32, + test_ue->nas.connection_identifier, + NAS_SECURITY_DOWNLINK_DIRECTION, pkbuf); + } + } + + return OGS_OK; +} diff --git a/tests/common/nas-security.h b/tests/common/nas-security.h new file mode 100644 index 0000000000..e378f1d115 --- /dev/null +++ b/tests/common/nas-security.h @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef TEST_NAS_5GS_SECURITY_H +#define TEST_NAS_5GS_SECURITY_H + +#ifdef __cplusplus +extern "C" { +#endif + +ogs_pkbuf_t *test_nas_5gs_security_encode( + test_ue_t *test_ue, ogs_nas_5gs_message_t *message); +int test_nas_5gs_security_decode(test_ue_t *test_ue, + ogs_nas_security_header_type_t security_header_type, ogs_pkbuf_t *pkbuf); + +#ifdef __cplusplus +} +#endif + +#endif /* TEST_NAS_5GS_SECURITY_H */ + diff --git a/tests/common/ngap-build.c b/tests/common/ngap-build.c index 9ad2af1f88..7312482976 100644 --- a/tests/common/ngap-build.c +++ b/tests/common/ngap-build.c @@ -19,11 +19,11 @@ #include "test-ngap.h" -int testngap_build_setup_req(ogs_pkbuf_t **pkbuf, uint32_t gnb_id) +ogs_pkbuf_t *testngap_build_ng_setup_request(uint32_t gnb_id) { + ogs_pkbuf_t *pkbuf = NULL; int i, j; ogs_plmn_id_t *plmn_id = NULL; - ogs_uint24_t uint24; NGAP_NGAP_PDU_t pdu; NGAP_InitiatingMessage_t *initiatingMessage = NULL; @@ -41,7 +41,7 @@ int testngap_build_setup_req(ogs_pkbuf_t **pkbuf, uint32_t gnb_id) memset(&pdu, 0, sizeof (NGAP_NGAP_PDU_t)); pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage; - pdu.choice.initiatingMessage = + pdu.choice.initiatingMessage = CALLOC(1, sizeof(NGAP_InitiatingMessage_t)); initiatingMessage = pdu.choice.initiatingMessage; @@ -52,6 +52,14 @@ int testngap_build_setup_req(ogs_pkbuf_t **pkbuf, uint32_t gnb_id) NGSetupRequest = &initiatingMessage->value.choice.NGSetupRequest; + globalGNB_ID = CALLOC(1, sizeof(NGAP_GlobalGNB_ID_t)); + + plmn_id = &test_self()->plmn_support[0].plmn_id; + ogs_asn_buffer_to_OCTET_STRING( + plmn_id, OGS_PLMN_ID_LEN, &globalGNB_ID->pLMNIdentity); + + ogs_ngap_uint32_to_GNB_ID(gnb_id, &globalGNB_ID->gNB_ID); + ie = CALLOC(1, sizeof(NGAP_NGSetupRequestIEs_t)); ASN_SEQUENCE_ADD(&NGSetupRequest->protocolIEs, ie); @@ -79,14 +87,6 @@ int testngap_build_setup_req(ogs_pkbuf_t **pkbuf, uint32_t gnb_id) PagingDRX = &ie->value.choice.PagingDRX; - globalGNB_ID = CALLOC(1, sizeof(NGAP_GlobalGNB_ID_t)); - - plmn_id = &test_self()->plmn_support[0].plmn_id; - ogs_asn_buffer_to_OCTET_STRING( - plmn_id, OGS_PLMN_ID_LEN, &globalGNB_ID->pLMNIdentity); - - ogs_ngap_uint32_to_GNB_ID(gnb_id, &globalGNB_ID->gNB_ID); - GlobalRANNodeID->present = NGAP_GlobalRANNodeID_PR_globalGNB_ID; GlobalRANNodeID->choice.globalGNB_ID = globalGNB_ID; @@ -133,11 +133,210 @@ int testngap_build_setup_req(ogs_pkbuf_t **pkbuf, uint32_t gnb_id) *PagingDRX = NGAP_PagingDRX_v64; - *pkbuf = ogs_ngap_encode(&pdu); - if (*pkbuf == NULL) { - ogs_error("ogs_ngap_encode() failed"); - return OGS_ERROR; - } - return OGS_OK; + return ogs_ngap_encode(&pdu); } +ogs_pkbuf_t *testngap_build_initial_ue_message(ogs_pkbuf_t *gmmbuf) +{ + ogs_pkbuf_t *pkbuf = NULL; + int i, j; + char buf[5]; + + NGAP_NGAP_PDU_t pdu; + NGAP_InitiatingMessage_t *initiatingMessage = NULL; + NGAP_InitialUEMessage_t *InitialUEMessage = NULL; + + NGAP_InitialUEMessage_IEs_t *ie = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; + NGAP_NAS_PDU_t *NAS_PDU = NULL; + NGAP_UserLocationInformation_t *UserLocationInformation = NULL; + NGAP_UserLocationInformationNR_t *userLocationInformationNR = NULL; + NGAP_NR_CGI_t *nR_CGI = NULL; + NGAP_TAI_t *tAI = NULL; + NGAP_RRCEstablishmentCause_t *RRCEstablishmentCause = NULL; + NGAP_UEContextRequest_t *UEContextRequest = NULL; + + memset(&pdu, 0, sizeof (NGAP_NGAP_PDU_t)); + pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage; + pdu.choice.initiatingMessage = + CALLOC(1, sizeof(NGAP_InitiatingMessage_t)); + + initiatingMessage = pdu.choice.initiatingMessage; + initiatingMessage->procedureCode = NGAP_ProcedureCode_id_InitialUEMessage; + initiatingMessage->criticality = NGAP_Criticality_reject; + initiatingMessage->value.present = + NGAP_InitiatingMessage__value_PR_InitialUEMessage; + + InitialUEMessage = &initiatingMessage->value.choice.InitialUEMessage; + + ie = CALLOC(1, sizeof(NGAP_InitialUEMessage_IEs_t)); + ASN_SEQUENCE_ADD(&InitialUEMessage->protocolIEs, ie); + + ie->id = NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID; + ie->criticality = NGAP_Criticality_reject; + ie->value.present = NGAP_InitialUEMessage_IEs__value_PR_RAN_UE_NGAP_ID; + + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; + + ie = CALLOC(1, sizeof(NGAP_InitialUEMessage_IEs_t)); + ASN_SEQUENCE_ADD(&InitialUEMessage->protocolIEs, ie); + + ie->id = NGAP_ProtocolIE_ID_id_NAS_PDU; + ie->criticality = NGAP_Criticality_reject; + ie->value.present = NGAP_InitialUEMessage_IEs__value_PR_NAS_PDU; + + NAS_PDU = &ie->value.choice.NAS_PDU; + + ie = CALLOC(1, sizeof(NGAP_InitialUEMessage_IEs_t)); + ASN_SEQUENCE_ADD(&InitialUEMessage->protocolIEs, ie); + + ie->id = NGAP_ProtocolIE_ID_id_UserLocationInformation; + ie->criticality = NGAP_Criticality_reject; + ie->value.present = + NGAP_InitialUEMessage_IEs__value_PR_UserLocationInformation; + + UserLocationInformation = &ie->value.choice.UserLocationInformation; + + ie = CALLOC(1, sizeof(NGAP_InitialUEMessage_IEs_t)); + ASN_SEQUENCE_ADD(&InitialUEMessage->protocolIEs, ie); + + ie->id = NGAP_ProtocolIE_ID_id_RRCEstablishmentCause; + ie->criticality = NGAP_Criticality_ignore; + ie->value.present = + NGAP_InitialUEMessage_IEs__value_PR_RRCEstablishmentCause; + + RRCEstablishmentCause = &ie->value.choice.RRCEstablishmentCause; + + ie = CALLOC(1, sizeof(NGAP_InitialUEMessage_IEs_t)); + ASN_SEQUENCE_ADD(&InitialUEMessage->protocolIEs, ie); + + ie->id = NGAP_ProtocolIE_ID_id_UEContextRequest; + ie->criticality = NGAP_Criticality_ignore; + ie->value.present = + NGAP_InitialUEMessage_IEs__value_PR_UEContextRequest; + + UEContextRequest = &ie->value.choice.UEContextRequest; + + *RAN_UE_NGAP_ID = 1; + + NAS_PDU->size = gmmbuf->len; + NAS_PDU->buf = CALLOC(NAS_PDU->size, sizeof(uint8_t)); + memcpy(NAS_PDU->buf, gmmbuf->data, NAS_PDU->size); + ogs_pkbuf_free(gmmbuf); + + userLocationInformationNR = + CALLOC(1, sizeof(NGAP_UserLocationInformationNR_t)); + + nR_CGI = &userLocationInformationNR->nR_CGI; + ogs_ngap_nr_cgi_to_ASN(&test_self()->cgi, nR_CGI); + + tAI = &userLocationInformationNR->tAI; + ogs_ngap_5gs_tai_to_ASN(&test_self()->tai, tAI); + + UserLocationInformation->present = + NGAP_UserLocationInformation_PR_userLocationInformationNR; + UserLocationInformation->choice.userLocationInformationNR = + userLocationInformationNR; + + *RRCEstablishmentCause = NGAP_RRCEstablishmentCause_mt_Access; + + *UEContextRequest = NGAP_UEContextRequest_requested; + + return ogs_ngap_encode(&pdu); +} + +ogs_pkbuf_t *testngap_build_uplink_nas_transport( + test_ue_t *test_ue, ogs_pkbuf_t *gmmbuf) +{ + NGAP_NGAP_PDU_t pdu; + NGAP_InitiatingMessage_t *initiatingMessage = NULL; + NGAP_UplinkNASTransport_t *UplinkNASTransport = NULL; + + NGAP_UplinkNASTransport_IEs_t *ie = NULL; + NGAP_AMF_UE_NGAP_ID_t *AMF_UE_NGAP_ID = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; + NGAP_NAS_PDU_t *NAS_PDU = NULL; + NGAP_UserLocationInformation_t *UserLocationInformation = NULL; + NGAP_UserLocationInformationNR_t *userLocationInformationNR = NULL; + NGAP_NR_CGI_t *nR_CGI = NULL; + NGAP_TAI_t *tAI = NULL; + + ogs_assert(gmmbuf); + ogs_assert(test_ue); + + memset(&pdu, 0, sizeof (NGAP_NGAP_PDU_t)); + pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage; + pdu.choice.initiatingMessage = + CALLOC(1, sizeof(NGAP_InitiatingMessage_t)); + + initiatingMessage = pdu.choice.initiatingMessage; + initiatingMessage->procedureCode = + NGAP_ProcedureCode_id_UplinkNASTransport; + initiatingMessage->criticality = NGAP_Criticality_ignore; + initiatingMessage->value.present = + NGAP_InitiatingMessage__value_PR_UplinkNASTransport; + + UplinkNASTransport = + &initiatingMessage->value.choice.UplinkNASTransport; + + ie = CALLOC(1, sizeof(NGAP_UplinkNASTransport_IEs_t)); + ASN_SEQUENCE_ADD(&UplinkNASTransport->protocolIEs, ie); + + ie->id = NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID; + ie->criticality = NGAP_Criticality_reject; + ie->value.present = NGAP_UplinkNASTransport_IEs__value_PR_AMF_UE_NGAP_ID; + + AMF_UE_NGAP_ID = &ie->value.choice.AMF_UE_NGAP_ID; + + ie = CALLOC(1, sizeof(NGAP_UplinkNASTransport_IEs_t)); + ASN_SEQUENCE_ADD(&UplinkNASTransport->protocolIEs, ie); + + ie->id = NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID; + ie->criticality = NGAP_Criticality_reject; + ie->value.present = NGAP_UplinkNASTransport_IEs__value_PR_RAN_UE_NGAP_ID; + + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; + + ie = CALLOC(1, sizeof(NGAP_UplinkNASTransport_IEs_t)); + ASN_SEQUENCE_ADD(&UplinkNASTransport->protocolIEs, ie); + + ie->id = NGAP_ProtocolIE_ID_id_NAS_PDU; + ie->criticality = NGAP_Criticality_reject; + ie->value.present = NGAP_UplinkNASTransport_IEs__value_PR_NAS_PDU; + + NAS_PDU = &ie->value.choice.NAS_PDU; + + ie = CALLOC(1, sizeof(NGAP_UplinkNASTransport_IEs_t)); + ASN_SEQUENCE_ADD(&UplinkNASTransport->protocolIEs, ie); + + ie->id = NGAP_ProtocolIE_ID_id_UserLocationInformation; + ie->criticality = NGAP_Criticality_reject; + ie->value.present = + NGAP_UplinkNASTransport_IEs__value_PR_UserLocationInformation; + + UserLocationInformation = &ie->value.choice.UserLocationInformation; + + asn_uint642INTEGER(AMF_UE_NGAP_ID, test_ue->amf_ue_ngap_id); + *RAN_UE_NGAP_ID = test_ue->ran_ue_ngap_id; + + NAS_PDU->size = gmmbuf->len; + NAS_PDU->buf = CALLOC(NAS_PDU->size, sizeof(uint8_t)); + memcpy(NAS_PDU->buf, gmmbuf->data, NAS_PDU->size); + ogs_pkbuf_free(gmmbuf); + + userLocationInformationNR = + CALLOC(1, sizeof(NGAP_UserLocationInformationNR_t)); + + nR_CGI = &userLocationInformationNR->nR_CGI; + ogs_ngap_nr_cgi_to_ASN(&test_self()->cgi, nR_CGI); + + tAI = &userLocationInformationNR->tAI; + ogs_ngap_5gs_tai_to_ASN(&test_self()->tai, tAI); + + UserLocationInformation->present = + NGAP_UserLocationInformation_PR_userLocationInformationNR; + UserLocationInformation->choice.userLocationInformationNR = + userLocationInformationNR; + + return ogs_ngap_encode(&pdu); +} diff --git a/tests/common/ngap-build.h b/tests/common/ngap-build.h index f080cc3e58..36c990d3a8 100644 --- a/tests/common/ngap-build.h +++ b/tests/common/ngap-build.h @@ -24,7 +24,10 @@ extern "C" { #endif -int testngap_build_setup_req(ogs_pkbuf_t **pkbuf, uint32_t gnb_id); +ogs_pkbuf_t *testngap_build_ng_setup_request(uint32_t gnb_id); +ogs_pkbuf_t *testngap_build_initial_ue_message(ogs_pkbuf_t *gmmbuf); +ogs_pkbuf_t *testngap_build_uplink_nas_transport( + test_ue_t *test_ue, ogs_pkbuf_t *gmmbuf); #ifdef __cplusplus } diff --git a/tests/common/ngap-handler.c b/tests/common/ngap-handler.c new file mode 100644 index 0000000000..488484704d --- /dev/null +++ b/tests/common/ngap-handler.c @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "test-ngap.h" + +void testngap_handle_downlink_nas_transport( + test_ue_t *test_ue, ogs_ngap_message_t *message) +{ + int i; + char buf[OGS_ADDRSTRLEN]; + + NGAP_NGAP_PDU_t pdu; + NGAP_InitiatingMessage_t *initiatingMessage = NULL; + NGAP_DownlinkNASTransport_t *DownlinkNASTransport = NULL; + + NGAP_DownlinkNASTransport_IEs_t *ie = NULL; + NGAP_AMF_UE_NGAP_ID_t *AMF_UE_NGAP_ID = NULL; + NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL; + NGAP_NAS_PDU_t *NAS_PDU = NULL; + + ogs_assert(test_ue); + ogs_assert(message); + + ogs_assert(message); + initiatingMessage = message->choice.initiatingMessage; + ogs_assert(initiatingMessage); + DownlinkNASTransport = + &initiatingMessage->value.choice.DownlinkNASTransport; + ogs_assert(DownlinkNASTransport); + + for (i = 0; i < DownlinkNASTransport->protocolIEs.list.count; i++) { + ie = DownlinkNASTransport->protocolIEs.list.array[i]; + switch (ie->id) { + case NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID: + RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID; + break; + case NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID: + AMF_UE_NGAP_ID = &ie->value.choice.AMF_UE_NGAP_ID; + break; + case NGAP_ProtocolIE_ID_id_NAS_PDU: + NAS_PDU = &ie->value.choice.NAS_PDU; + break; + default: + break; + } + } + + test_ue->ran_ue_ngap_id = *RAN_UE_NGAP_ID; + asn_INTEGER2ulong(AMF_UE_NGAP_ID, &test_ue->amf_ue_ngap_id); + + if (NAS_PDU) + testngap_send_to_nas(test_ue, NAS_PDU); +} diff --git a/tests/common/ngap-handler.h b/tests/common/ngap-handler.h new file mode 100644 index 0000000000..6bc71e6ba1 --- /dev/null +++ b/tests/common/ngap-handler.h @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef TEST_NGAP_HANDLE_H +#define TEST_NGAP_HANDLE_H + +#ifdef __cplusplus +extern "C" { +#endif + +void testngap_handle_downlink_nas_transport( + test_ue_t *test_ue, ogs_ngap_message_t *message); + +#ifdef __cplusplus +} +#endif + +#endif /* TEST_NGAP_HANDLE_H */ diff --git a/tests/common/ngap-path.c b/tests/common/ngap-path.c new file mode 100644 index 0000000000..c243519039 --- /dev/null +++ b/tests/common/ngap-path.c @@ -0,0 +1,169 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "test-ngap.h" + +void testngap_recv(test_ue_t *test_ue, ogs_pkbuf_t *pkbuf) +{ + int rv; + ogs_ngap_message_t message; + + NGAP_NGAP_PDU_t *pdu = NULL; + NGAP_InitiatingMessage_t *initiatingMessage = NULL; + NGAP_SuccessfulOutcome_t *successfulOutcome = NULL; + NGAP_UnsuccessfulOutcome_t *unsuccessfulOutcome = NULL; + + ogs_assert(test_ue); + ogs_assert(pkbuf); + + rv = ogs_ngap_decode(&message, pkbuf); + ogs_assert(rv == OGS_OK); + + pdu = &message; + ogs_assert(pdu); + + switch (pdu->present) { + case NGAP_NGAP_PDU_PR_initiatingMessage: + initiatingMessage = pdu->choice.initiatingMessage; + ogs_assert(initiatingMessage); + + switch (initiatingMessage->procedureCode) { + case NGAP_ProcedureCode_id_DownlinkNASTransport: + testngap_handle_downlink_nas_transport(test_ue, pdu); + break; + default: + ogs_error("Not implemented(choice:%d, proc:%d)", + pdu->present, (int)initiatingMessage->procedureCode); + break; + } + break; + case NGAP_NGAP_PDU_PR_successfulOutcome : + successfulOutcome = pdu->choice.successfulOutcome; + ogs_assert(successfulOutcome); + + switch (successfulOutcome->procedureCode) { + default: + ogs_error("Not implemented(choice:%d, proc:%d)", + pdu->present, (int)successfulOutcome->procedureCode); + break; + } + break; + case NGAP_NGAP_PDU_PR_unsuccessfulOutcome : + unsuccessfulOutcome = pdu->choice.unsuccessfulOutcome; + ogs_assert(unsuccessfulOutcome); + + switch (unsuccessfulOutcome->procedureCode) { + default: + ogs_error("Not implemented(choice:%d, proc:%d)", + pdu->present, (int)unsuccessfulOutcome->procedureCode); + break; + } + break; + default: + ogs_error("Not implemented(choice:%d)", pdu->present); + break; + } + + ogs_ngap_free(&message); + ogs_pkbuf_free(pkbuf); +} + +void testngap_send_to_nas(test_ue_t *test_ue, NGAP_NAS_PDU_t *nasPdu) +{ + ogs_nas_5gs_security_header_t *sh = NULL; + ogs_nas_security_header_type_t security_header_type; + + ogs_nas_5gmm_header_t *h = NULL; + ogs_pkbuf_t *nasbuf = NULL; + + ogs_assert(test_ue); + ogs_assert(nasPdu); + + /* The Packet Buffer(pkbuf_t) for NAS message MUST make a HEADROOM. + * When calculating AES_CMAC, we need to use the headroom of the packet. */ + nasbuf = ogs_pkbuf_alloc(NULL, OGS_NAS_HEADROOM+nasPdu->size); + ogs_pkbuf_reserve(nasbuf, OGS_NAS_HEADROOM); + ogs_pkbuf_put_data(nasbuf, nasPdu->buf, nasPdu->size); + + sh = (ogs_nas_5gs_security_header_t *)nasbuf->data; + ogs_assert(sh); + + memset(&security_header_type, 0, sizeof(ogs_nas_security_header_type_t)); + switch(sh->security_header_type) { + case OGS_NAS_SECURITY_HEADER_PLAIN_NAS_MESSAGE: + break; + case OGS_NAS_SECURITY_HEADER_INTEGRITY_PROTECTED: + security_header_type.integrity_protected = 1; + ogs_pkbuf_pull(nasbuf, 7); + break; + case OGS_NAS_SECURITY_HEADER_INTEGRITY_PROTECTED_AND_CIPHERED: + security_header_type.integrity_protected = 1; + security_header_type.ciphered = 1; + ogs_pkbuf_pull(nasbuf, 7); + break; + case OGS_NAS_SECURITY_HEADER_INTEGRITY_PROTECTED_AND_NEW_SECURITY_CONTEXT: + security_header_type.integrity_protected = 1; + security_header_type.new_security_context = 1; + ogs_pkbuf_pull(nasbuf, 7); + break; + case OGS_NAS_SECURITY_HEADER_INTEGRITY_PROTECTED_AND_CIPHTERD_WITH_NEW_INTEGRITY_CONTEXT: + security_header_type.integrity_protected = 1; + security_header_type.ciphered = 1; + security_header_type.new_security_context = 1; + ogs_pkbuf_pull(nasbuf, 7); + break; + default: + ogs_error("Not implemented(security header type:0x%x)", + sh->security_header_type); + ogs_assert_if_reached(); + } + + h = (ogs_nas_5gmm_header_t *)nasbuf->data; + ogs_assert(h); + + if (h->message_type == OGS_NAS_5GS_SECURITY_MODE_COMMAND) { + ogs_nas_5gs_message_t message; + int rv; + + rv = ogs_nas_5gmm_decode(&message, nasbuf); + ogs_assert(rv == OGS_OK); + + testgmm_handle_security_mode_command(test_ue, + &message.gmm.security_mode_command); + } + + if (test_nas_5gs_security_decode(test_ue, + security_header_type, nasbuf) != OGS_OK) { + ogs_error("nas_eps_security_decode failed()"); + ogs_assert_if_reached(); + } + + if (h->extended_protocol_discriminator == + OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM) { + testgmm_recv(test_ue, nasbuf); + } else if (h->extended_protocol_discriminator == + OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GSM) { + testgsm_recv(test_ue, nasbuf); + } else { + ogs_error("Unknown NAS Protocol discriminator 0x%02x", + h->extended_protocol_discriminator); + ogs_assert_if_reached(); + } +} + diff --git a/tests/common/ngap-path.h b/tests/common/ngap-path.h new file mode 100644 index 0000000000..3187f36423 --- /dev/null +++ b/tests/common/ngap-path.h @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2019,2020 by Sukchan Lee + * + * This file is part of Open5GS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef TEST_NGAP_PATH_H +#define TEST_NGAP_PATH_H + +#ifdef __cplusplus +extern "C" { +#endif + +void testngap_recv(test_ue_t *test_ue, ogs_pkbuf_t *pkbuf); +void testngap_send_to_nas(test_ue_t *test_ue, NGAP_NAS_PDU_t *nasPdu); + +#ifdef __cplusplus +} +#endif + +#endif /* TEST_NGAP_PATH_H */ diff --git a/tests/common/test-common.h b/tests/common/test-common.h index 6fdbd105d6..43051a4cf0 100644 --- a/tests/common/test-common.h +++ b/tests/common/test-common.h @@ -39,6 +39,10 @@ extern "C" { #include "common/sctp.h" #include "common/gtpu.h" #include "common/application.h" +#include "common/gmm-build.h" +#include "common/gmm-handler.h" +#include "common/nas-path.h" +#include "common/nas-security.h" #undef OGS_TEST_INSIDE diff --git a/tests/common/test-ngap.h b/tests/common/test-ngap.h index 3eb6182d4d..b942a96ae0 100644 --- a/tests/common/test-ngap.h +++ b/tests/common/test-ngap.h @@ -31,6 +31,8 @@ extern "C" { #define OGS_TEST_INSIDE #include "common/ngap-build.h" +#include "common/ngap-handler.h" +#include "common/ngap-path.h" #undef OGS_TEST_INSIDE diff --git a/tests/core/conv-test.c b/tests/core/conv-test.c index 0863fb04a3..1afc09adf0 100644 --- a/tests/core/conv-test.c +++ b/tests/core/conv-test.c @@ -56,15 +56,15 @@ static void conv_test3(abts_case *tc, void *data) uint8_t lower[4] = "\x12\xab\xcd\xef"; uint8_t buffer[128]; - ABTS_TRUE(tc, strcmp("465B5CE8 B199B49F AA5F0A2E E238A6BC", + ABTS_TRUE(tc, strcmp("465b5ce8b199b49faa5f0a2ee238a6bc", ogs_hex_to_ascii(k, sizeof(k), buffer, sizeof(buffer))) == 0); - ABTS_TRUE(tc, strcmp("5F1D289C 5D354D0A 140C2548 F5F3E3BA", + ABTS_TRUE(tc, strcmp("5f1d289c5d354d0a140c2548f5f3e3ba", ogs_hex_to_ascii(op, sizeof(op), buffer, sizeof(buffer))) == 0); - ABTS_TRUE(tc, strcmp("E8ED289D EBA952E4 283B54E8 8E6183CA", + ABTS_TRUE(tc, strcmp("e8ed289deba952e4283b54e88e6183ca", ogs_hex_to_ascii(opc, sizeof(opc), buffer, sizeof(buffer))) == 0); ABTS_TRUE(tc, strcmp("8000", ogs_hex_to_ascii(amf, sizeof(amf), buffer, sizeof(buffer))) == 0); - ABTS_TRUE(tc, strcmp("12ABCDEF", + ABTS_TRUE(tc, strcmp("12abcdef", ogs_hex_to_ascii(lower, sizeof(lower), buffer, sizeof(buffer))) == 0); } diff --git a/tests/core/fsm-test.c b/tests/core/fsm-test.c index 21ba6cd074..a5e2ba37eb 100644 --- a/tests/core/fsm-test.c +++ b/tests/core/fsm-test.c @@ -86,8 +86,7 @@ void bomb_timing(bomb_t *s, tick_event_t *e) s->code <<= 1; break; case ARM_SIG: - if (s->code == s->defuse) - { + if (s->code == s->defuse) { OGS_FSM_TRAN(s, &bomb_setting); break; } @@ -217,8 +216,7 @@ void alarm_off(alarm_t *s, set_event_t *e) case ALARM_SET_SIG: alarm = (10 * s->time + e->digit) % 10000; - if ((alarm / 100 < 24) && (alarm % 100 < 60)) - { + if ((alarm / 100 < 24) && (alarm % 100 < 60)) { s->time = alarm; } else diff --git a/tests/minimal/minimal-test.c b/tests/minimal/minimal-test.c index 5f22896172..5941907e6b 100644 --- a/tests/minimal/minimal-test.c +++ b/tests/minimal/minimal-test.c @@ -24,12 +24,18 @@ static void test1_func(abts_case *tc, void *data) int rv; ogs_socknode_t *ngap; ogs_socknode_t *gtpu; + ogs_pkbuf_t *gmmbuf; + ogs_pkbuf_t *nasbuf; ogs_pkbuf_t *sendbuf; ogs_pkbuf_t *recvbuf; ogs_ngap_message_t message; int i; int msgindex = 0; + ogs_nas_5gs_mobile_identity_t mobile_identity; + ogs_nas_5gs_mobile_identity_imsi_t mobile_identity_imsi; + test_ue_t test_ue; + uint8_t tmp[OGS_MAX_SDU_LEN]; const char *_ng_setup_request = "0015002d00000300 1b00080002f83910 0001020066001500 000000010002f839" @@ -59,6 +65,11 @@ static void test1_func(abts_case *tc, void *data) "000b403b00000300 000005c00100009d 000800020001001a 002524271f9b491e" "030761430f10004f 00700065006e0035 0047005347812072 11240563490100"; + const char *_k_string = "5122250214c33e723a5dd523fc145fc0"; + uint8_t k[OGS_KEY_LEN]; + const char *_opc_string = "981d464c7c52eb6e5036234984ad0bcf"; + uint8_t opc[OGS_KEY_LEN]; + mongoc_collection_t *collection = NULL; bson_t *doc = NULL; int64_t count = 0; @@ -66,7 +77,7 @@ static void test1_func(abts_case *tc, void *data) const char *json = "{" "\"_id\" : { \"$oid\" : \"597223158b8861d7605378c6\" }, " - "\"imsi\" : \"001010123456819\", " + "\"imsi\" : \"2089300007487\", " "\"pdn\" : [" "{" "\"apn\" : \"internet\", " @@ -95,10 +106,10 @@ static void test1_func(abts_case *tc, void *data) "\"subscriber_status\" : 0, " "\"access_restriction_data\" : 32, " "\"security\" : { " - "\"k\" : \"465B5CE8 B199B49F AA5F0A2E E238A6BC\", " - "\"opc\" : \"E8ED289D EBA952E4 283B54E8 8E6183CA\", " + "\"k\" : \"5122250214c33e723a5dd523fc145fc0\", " + "\"opc\" : \"981d464c7c52eb6e5036234984ad0bcf\", " "\"amf\" : \"8000\", " - "\"sqn\" : { \"$numberLong\" : \"64\" }, " + "\"sqn\" : { \"$numberLong\" : \"25235952177090\" }, " "\"rand\" : \"20080C38 18183B52 2614162C 07601D0D\" " "}, " "\"__v\" : 0 " @@ -115,8 +126,8 @@ static void test1_func(abts_case *tc, void *data) #endif /* Send NG-Setup Reqeust */ - rv = testngap_build_setup_req(&sendbuf, 0x000102); - ABTS_INT_EQUAL(tc, OGS_OK, rv); + sendbuf = testngap_build_ng_setup_request(0x000102); + ABTS_PTR_NOTNULL(tc, sendbuf); ABTS_TRUE(tc, memcmp(sendbuf->data, OGS_HEX(_ng_setup_request, strlen(_ng_setup_request), tmp), sendbuf->len) == 0); @@ -131,19 +142,48 @@ static void test1_func(abts_case *tc, void *data) recvbuf->len) == 0); ogs_pkbuf_free(recvbuf); -#if 0 + /* Setup Test UE Context */ + memset(&test_ue, 0, sizeof(test_ue)); + + memset(&mobile_identity_imsi, 0, sizeof(mobile_identity_imsi)); + mobile_identity.length = 12; + mobile_identity.buffer = &mobile_identity_imsi; + + mobile_identity_imsi.h.supi_format = OGS_NAS_5GS_SUPI_FORMAT_IMSI; + mobile_identity_imsi.h.type = OGS_NAS_5GS_MOBILE_IDENTITY_SUCI; + ogs_nas_from_plmn_id(&mobile_identity_imsi.nas_plmn_id, + &test_self()->tai.plmn_id); + mobile_identity_imsi.routing_indicator1 = 0; + mobile_identity_imsi.routing_indicator2 = 0xf; + mobile_identity_imsi.routing_indicator3 = 0xf; + mobile_identity_imsi.routing_indicator4 = 0xf; + mobile_identity_imsi.protection_scheme_id = OGS_NAS_5GS_NULL_SCHEME; + mobile_identity_imsi.home_network_pki_value = 0; + mobile_identity_imsi.scheme_output[0] = 0; + mobile_identity_imsi.scheme_output[1] = 0; + mobile_identity_imsi.scheme_output[2] = 0x47; + mobile_identity_imsi.scheme_output[3] = 0x78; + + test_ue_set_mobile_identity(&test_ue, &mobile_identity); + + test_ue.abba_len = 2; + test_ue.nas.connection_identifier = OGS_NAS_SECURITY_BEARER_3GPP; + + OGS_HEX(_k_string, strlen(_k_string), test_ue.k); + OGS_HEX(_opc_string, strlen(_opc_string), test_ue.opc); + + /********** Insert Subscriber in Database */ collection = mongoc_client_get_collection( ogs_mongoc()->client, ogs_mongoc()->name, "subscribers"); ABTS_PTR_NOTNULL(tc, collection); - /********** Insert Subscriber in Database */ doc = bson_new_from_json((const uint8_t *)json, -1, &error);; ABTS_PTR_NOTNULL(tc, doc); - ABTS_TRUE(tc, mongoc_collection_insert(collection, + ABTS_TRUE(tc, mongoc_collection_insert(collection, MONGOC_INSERT_NONE, doc, NULL, &error)); bson_destroy(doc); - doc = BCON_NEW("imsi", BCON_UTF8("310014987654004")); + doc = BCON_NEW("imsi", BCON_UTF8(test_ue.imsi)); ABTS_PTR_NOTNULL(tc, doc); do { count = mongoc_collection_count ( @@ -151,33 +191,55 @@ static void test1_func(abts_case *tc, void *data) } while (count == 0); bson_destroy(doc); - mme_self()->mme_ue_ngap_id = 27263233; - rv = testngap_build_initial_ue_msg(&sendbuf, msgindex); - ABTS_INT_EQUAL(tc, OGS_OK, rv); + /* Send Registration request */ + gmmbuf = testgmm_build_registration_request(&test_ue, &mobile_identity); + ABTS_PTR_NOTNULL(tc, gmmbuf); + sendbuf = testngap_build_initial_ue_message(gmmbuf); + ABTS_PTR_NOTNULL(tc, sendbuf); rv = testgnb_ngap_send(ngap, sendbuf); ABTS_INT_EQUAL(tc, OGS_OK, rv); - /* Receive Authentication Request */ + /* Receive Authentication request */ recvbuf = testgnb_ngap_read(ngap); ABTS_PTR_NOTNULL(tc, recvbuf); + testngap_recv(&test_ue, recvbuf); +#if 0 ABTS_TRUE(tc, memcmp(recvbuf->data, OGS_HEX(_authentication_request, strlen(_authentication_request), tmp), recvbuf->len) == 0); - ogs_pkbuf_free(recvbuf); +#endif - /* Send Authentication Response */ - rv = testngap_build_authentication_response(&sendbuf, msgindex); - ABTS_INT_EQUAL(tc, OGS_OK, rv); + /* Send Authentication response */ + gmmbuf = testgmm_build_authentication_response(&test_ue); + ABTS_PTR_NOTNULL(tc, gmmbuf); + sendbuf = testngap_build_uplink_nas_transport(&test_ue, gmmbuf); + ABTS_PTR_NOTNULL(tc, sendbuf); rv = testgnb_ngap_send(ngap, sendbuf); ABTS_INT_EQUAL(tc, OGS_OK, rv); - /* Receive Security mode Command */ + /* Receive Security mode command */ recvbuf = testgnb_ngap_read(ngap); ABTS_PTR_NOTNULL(tc, recvbuf); + testngap_recv(&test_ue, recvbuf); +#if 0 ABTS_TRUE(tc, memcmp(recvbuf->data, OGS_HEX(_security_mode_command, strlen(_security_mode_command), tmp), recvbuf->len) == 0); - ogs_pkbuf_free(recvbuf); +#endif + + /* Send Security mode complete */ + nasbuf = testgmm_build_registration_request(&test_ue, &mobile_identity); + ABTS_PTR_NOTNULL(tc, nasbuf); + gmmbuf = testgmm_build_security_mode_complete(&test_ue, nasbuf); + ABTS_PTR_NOTNULL(tc, gmmbuf); + sendbuf = testngap_build_uplink_nas_transport(&test_ue, gmmbuf); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + ogs_pkbuf_free(nasbuf); + + ogs_msleep(300); +#if 0 /* Send Security mode Complete */ rv = testngap_build_security_mode_complete(&sendbuf, msgindex); @@ -252,16 +314,21 @@ static void test1_func(abts_case *tc, void *data) recvbuf = testgnb_gtpu_read(gtpu); ABTS_PTR_NOTNULL(tc, recvbuf); ogs_pkbuf_free(recvbuf); +#endif /********** Remove Subscriber in Database */ - doc = BCON_NEW("imsi", BCON_UTF8("310014987654004")); + doc = BCON_NEW("imsi", BCON_UTF8(test_ue.imsi)); ABTS_PTR_NOTNULL(tc, doc); - ABTS_TRUE(tc, mongoc_collection_remove(collection, + ABTS_TRUE(tc, mongoc_collection_remove(collection, MONGOC_REMOVE_SINGLE_REMOVE, doc, NULL, &error)) bson_destroy(doc); mongoc_collection_destroy(collection); + /* Clear Test UE Context */ + test_ue_remove(&test_ue); + +#if 0 /* eNB disonncect from SGW */ testgnb_gtpu_close(gtpu); #endif