Commit b4db73b6 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

integrate API server

parent 5c24d6a5
cmake_minimum_required (VERSION 3.2) ################################################################################
# Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
project(api-server) # contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -pg -g3" ) # The OpenAirInterface Software Alliance licenses this file to You under
# the OAI Public License, Version 1.1 (the "License"); you may not use this file
include(ExternalProject) # except in compliance with the License.
# You may obtain a copy of the License at
set(EXTERNAL_INSTALL_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/external) #
# http://www.openairinterface.org/?page_id=698
ExternalProject_Add(PISTACHE #
GIT_REPOSITORY https://github.com/oktal/pistache.git # Unless required by applicable law or agreed to in writing, software
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION} # distributed under the License is distributed on an "AS IS" BASIS,
) # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
ExternalProject_Add(NLOHMANN # limitations under the License.
GIT_REPOSITORY https://github.com/nlohmann/json.git #-------------------------------------------------------------------------------
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION} # For more information about the OpenAirInterface (OAI) Software Alliance:
# contact@openairinterface.org
) ################################################################################
include_directories(${EXTERNAL_INSTALL_LOCATION}/include)
link_directories(${EXTERNAL_INSTALL_LOCATION}/lib) set(NRF_API_SERVER_DIR "${SRC_TOP_DIR}/api-server")
include_directories(model) include_directories(${NRF_API_SERVER_DIR}/api)
include_directories(api) include_directories(${NRF_API_SERVER_DIR}/impl)
include_directories(impl) include_directories(${NRF_API_SERVER_DIR}/model)
include_directories(${NRF_API_SERVER_DIR}/)
file(GLOB SRCS include_directories(${SRC_TOP_DIR}/nrf_app)
${CMAKE_CURRENT_SOURCE_DIR}/api/*.cpp include_directories(${SRC_TOP_DIR}/common)
${CMAKE_CURRENT_SOURCE_DIR}/impl/*.cpp include_directories(${SRC_TOP_DIR}/common/utils)
${CMAKE_CURRENT_SOURCE_DIR}/model/*.cpp include_directories(${SRC_TOP_DIR}/../build/ext/spdlog/include)
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
file(GLOB NRF_API_SERVER_src_files
${NRF_API_SERVER_DIR}/nrf-api-server.cpp
${NRF_API_SERVER_DIR}/model/*.cpp
${NRF_API_SERVER_DIR}/api/*.cpp
${NRF_API_SERVER_DIR}/impl/*.cpp
) )
add_executable(${PROJECT_NAME} ${SRCS} ) add_library(NRF_API STATIC
add_dependencies(${PROJECT_NAME} PISTACHE NLOHMANN) ${NRF_API_SERVER_src_files})
target_link_libraries(${PROJECT_NAME} pistache pthread) \ No newline at end of file
...@@ -17,7 +17,7 @@ namespace oai { ...@@ -17,7 +17,7 @@ namespace oai {
namespace nrf { namespace nrf {
namespace api { namespace api {
using namespace org::openapitools::server::helpers; using namespace oai::nrf::helpers;
using namespace oai::nrf::model; using namespace oai::nrf::model;
CompleteStoredSearchDocumentApi::CompleteStoredSearchDocumentApi(std::shared_ptr<Pistache::Rest::Router> rtr) { CompleteStoredSearchDocumentApi::CompleteStoredSearchDocumentApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
......
...@@ -17,7 +17,7 @@ namespace oai { ...@@ -17,7 +17,7 @@ namespace oai {
namespace nrf { namespace nrf {
namespace api { namespace api {
using namespace org::openapitools::server::helpers; using namespace oai::nrf::helpers;
using namespace oai::nrf::model; using namespace oai::nrf::model;
NFInstanceIDDocumentApi::NFInstanceIDDocumentApi(std::shared_ptr<Pistache::Rest::Router> rtr) { NFInstanceIDDocumentApi::NFInstanceIDDocumentApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
......
This diff is collapsed.
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include "EventId.h" #include "EventId.h"
#include "Guami.h" #include "Guami.h"
#include "Ipv6Prefix.h" #include "Ipv6Prefix.h"
#include "NFType.h" //#include "NFType.h"
#include "NwdafEvent.h" #include "NwdafEvent.h"
#include "PduSessionType.h" #include "PduSessionType.h"
#include "PlmnId.h" #include "PlmnId.h"
...@@ -40,10 +40,10 @@ ...@@ -40,10 +40,10 @@
#include "ProblemDetails.h" #include "ProblemDetails.h"
#include "SearchResult.h" #include "SearchResult.h"
#include "ServiceName.h" #include "ServiceName.h"
#include "Set.h"
#include "Snssai.h" #include "Snssai.h"
#include "Tai.h" #include "Tai.h"
#include <string> #include <string>
#include <set>
namespace oai { namespace oai {
namespace nrf { namespace nrf {
...@@ -120,7 +120,7 @@ private: ...@@ -120,7 +120,7 @@ private:
/// <param name="atsssCapability">ATSSS Capability (optional, default to AtsssCapability())</param> /// <param name="atsssCapability">ATSSS Capability (optional, default to AtsssCapability())</param>
/// <param name="upfUeIpAddrInd">UPF supporting allocating UE IP addresses/prefixes (optional, default to false)</param> /// <param name="upfUeIpAddrInd">UPF supporting allocating UE IP addresses/prefixes (optional, default to false)</param>
/// <param name="ifNoneMatch">Validator for conditional requests, as described in IETF RFC 7232, 3.2 (optional, default to &quot;&quot;)</param> /// <param name="ifNoneMatch">Validator for conditional requests, as described in IETF RFC 7232, 3.2 (optional, default to &quot;&quot;)</param>
virtual void search_nf_instances(const Pistache::Optional<NFType> &targetNfType, const Pistache::Optional<NFType> &requesterNfType, const Pistache::Optional<std::string> &requesterNfInstanceId, const Pistache::Optional<Set<ServiceName>> &serviceNames, const Pistache::Optional<std::string> &requesterNfInstanceFqdn, const Pistache::Optional<std::vector<PlmnId>> &targetPlmnList, const Pistache::Optional<std::vector<PlmnId>> &requesterPlmnList, const Pistache::Optional<std::string> &targetNfInstanceId, const Pistache::Optional<std::string> &targetNfFqdn, const Pistache::Optional<std::string> &hnrfUri, const Pistache::Optional<std::vector<Snssai>> &snssais, const Pistache::Optional<std::vector<Snssai>> &requesterSnssais, const Pistache::Optional<std::vector<PlmnSnssai>> &plmnSpecificSnssaiList, const Pistache::Optional<std::string> &dnn, const Pistache::Optional<std::vector<std::string>> &nsiList, const Pistache::Optional<std::string> &smfServingArea, const Pistache::Optional<Tai> &tai, const Pistache::Optional<std::string> &amfRegionId, const Pistache::Optional<std::string> &amfSetId, const Pistache::Optional<Guami> &guami, const Pistache::Optional<std::string> &supi, const Pistache::Optional<std::string> &ueIpv4Address, const Pistache::Optional<std::string> &ipDomain, const Pistache::Optional<Ipv6Prefix> &ueIpv6Prefix, const Pistache::Optional<bool> &pgwInd, const Pistache::Optional<std::string> &pgw, const Pistache::Optional<std::string> &gpsi, const Pistache::Optional<std::string> &externalGroupIdentity, const Pistache::Optional<DataSetId> &dataSet, const Pistache::Optional<std::string> &routingIndicator, const Pistache::Optional<std::vector<std::string>> &groupIdList, const Pistache::Optional<std::vector<std::string>> &dnaiList, const Pistache::Optional<std::vector<PduSessionType>> &pduSessionTypes, const Pistache::Optional<std::vector<EventId>> &eventIdList, const Pistache::Optional<std::vector<NwdafEvent>> &nwdafEventList, const Pistache::Optional<std::string> &supportedFeatures, const Pistache::Optional<bool> &upfIwkEpsInd, const Pistache::Optional<PlmnId> &chfSupportedPlmn, const Pistache::Optional<std::string> &preferredLocality, const Pistache::Optional<AccessType> &accessType, const Pistache::Optional<int32_t> &limit, const Pistache::Optional<std::vector<std::string>> &requiredFeatures, const Pistache::Optional<ComplexQuery> &complexQuery, const Pistache::Optional<int32_t> &maxPayloadSize, const Pistache::Optional<AtsssCapability> &atsssCapability, const Pistache::Optional<bool> &upfUeIpAddrInd, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, Pistache::Http::ResponseWriter &response) = 0; virtual void search_nf_instances(const Pistache::Optional<std::string> &targetNfType, const Pistache::Optional<std::string> &requesterNfType, const Pistache::Optional<std::string> &requesterNfInstanceId, const Pistache::Optional<std::vector<ServiceName>> &serviceNames, const Pistache::Optional<std::string> &requesterNfInstanceFqdn, const Pistache::Optional<std::vector<PlmnId>> &targetPlmnList, const Pistache::Optional<std::vector<PlmnId>> &requesterPlmnList, const Pistache::Optional<std::string> &targetNfInstanceId, const Pistache::Optional<std::string> &targetNfFqdn, const Pistache::Optional<std::string> &hnrfUri, const Pistache::Optional<std::vector<Snssai>> &snssais, const Pistache::Optional<std::vector<Snssai>> &requesterSnssais, const Pistache::Optional<std::vector<PlmnSnssai>> &plmnSpecificSnssaiList, const Pistache::Optional<std::string> &dnn, const Pistache::Optional<std::vector<std::string>> &nsiList, const Pistache::Optional<std::string> &smfServingArea, const Pistache::Optional<Tai> &tai, const Pistache::Optional<std::string> &amfRegionId, const Pistache::Optional<std::string> &amfSetId, const Pistache::Optional<Guami> &guami, const Pistache::Optional<std::string> &supi, const Pistache::Optional<std::string> &ueIpv4Address, const Pistache::Optional<std::string> &ipDomain, const Pistache::Optional<Ipv6Prefix> &ueIpv6Prefix, const Pistache::Optional<bool> &pgwInd, const Pistache::Optional<std::string> &pgw, const Pistache::Optional<std::string> &gpsi, const Pistache::Optional<std::string> &externalGroupIdentity, const Pistache::Optional<DataSetId> &dataSet, const Pistache::Optional<std::string> &routingIndicator, const Pistache::Optional<std::vector<std::string>> &groupIdList, const Pistache::Optional<std::vector<std::string>> &dnaiList, const Pistache::Optional<std::vector<PduSessionType>> &pduSessionTypes, const Pistache::Optional<std::vector<EventId>> &eventIdList, const Pistache::Optional<std::vector<NwdafEvent>> &nwdafEventList, const Pistache::Optional<std::string> &supportedFeatures, const Pistache::Optional<bool> &upfIwkEpsInd, const Pistache::Optional<PlmnId> &chfSupportedPlmn, const Pistache::Optional<std::string> &preferredLocality, const Pistache::Optional<AccessType> &accessType, const Pistache::Optional<int32_t> &limit, const Pistache::Optional<std::vector<std::string>> &requiredFeatures, const Pistache::Optional<ComplexQuery> &complexQuery, const Pistache::Optional<int32_t> &maxPayloadSize, const Pistache::Optional<AtsssCapability> &atsssCapability, const Pistache::Optional<bool> &upfUeIpAddrInd, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, Pistache::Http::ResponseWriter &response) = 0;
}; };
......
...@@ -17,7 +17,7 @@ namespace oai { ...@@ -17,7 +17,7 @@ namespace oai {
namespace nrf { namespace nrf {
namespace api { namespace api {
using namespace org::openapitools::server::helpers; using namespace oai::nrf::helpers;
using namespace oai::nrf::model; using namespace oai::nrf::model;
StoredSearchDocumentApi::StoredSearchDocumentApi(std::shared_ptr<Pistache::Rest::Router> rtr) { StoredSearchDocumentApi::StoredSearchDocumentApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
......
...@@ -17,7 +17,7 @@ namespace oai { ...@@ -17,7 +17,7 @@ namespace oai {
namespace nrf { namespace nrf {
namespace api { namespace api {
using namespace org::openapitools::server::helpers; using namespace oai::nrf::helpers;
using namespace oai::nrf::model; using namespace oai::nrf::model;
SubscriptionIDDocumentApi::SubscriptionIDDocumentApi(std::shared_ptr<Pistache::Rest::Router> rtr) { SubscriptionIDDocumentApi::SubscriptionIDDocumentApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
......
...@@ -17,7 +17,7 @@ namespace oai { ...@@ -17,7 +17,7 @@ namespace oai {
namespace nrf { namespace nrf {
namespace api { namespace api {
using namespace org::openapitools::server::helpers; using namespace oai::nrf::helpers;
using namespace oai::nrf::model; using namespace oai::nrf::model;
SubscriptionsCollectionApi::SubscriptionsCollectionApi(std::shared_ptr<Pistache::Rest::Router> rtr) { SubscriptionsCollectionApi::SubscriptionsCollectionApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
......
/** /**
* NRF NFDiscovery Service * NRF NFDiscovery Service
* NRF NFDiscovery Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * NRF NFDiscovery Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
* *
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech
* Do not edit the class manually. * Do not edit the class manually.
*/ */
#include "CompleteStoredSearchDocumentApiImpl.h" #include "CompleteStoredSearchDocumentApiImpl.h"
...@@ -18,11 +18,17 @@ namespace api { ...@@ -18,11 +18,17 @@ namespace api {
using namespace oai::nrf::model; using namespace oai::nrf::model;
CompleteStoredSearchDocumentApiImpl::CompleteStoredSearchDocumentApiImpl(std::shared_ptr<Pistache::Rest::Router> rtr) CompleteStoredSearchDocumentApiImpl::CompleteStoredSearchDocumentApiImpl(
: CompleteStoredSearchDocumentApi(rtr) std::shared_ptr<Pistache::Rest::Router> rtr, nrf::nrf_app *nrf_app_inst,
{ } std::string address)
:
CompleteStoredSearchDocumentApi(rtr),
m_nrf_app(nrf_app_inst),
m_address(address) {
}
void CompleteStoredSearchDocumentApiImpl::retrieve_complete_search(const std::string &searchId, Pistache::Http::ResponseWriter &response) { void CompleteStoredSearchDocumentApiImpl::retrieve_complete_search(
const std::string &searchId, Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic\n"); response.send(Pistache::Http::Code::Ok, "Do some magic\n");
} }
......
...@@ -30,21 +30,30 @@ ...@@ -30,21 +30,30 @@
#include <pistache/optional.h> #include <pistache/optional.h>
#include "StoredSearchResult.h" #include "StoredSearchResult.h"
#include "nrf_app.hpp"
#include <string> #include <string>
namespace oai { namespace oai {
namespace nrf { namespace nrf {
namespace api { namespace api {
using namespace oai::nrf::model; using namespace oai::nrf::model;
class CompleteStoredSearchDocumentApiImpl : public oai::nrf::api::CompleteStoredSearchDocumentApi { class CompleteStoredSearchDocumentApiImpl :
public: public oai::nrf::api::CompleteStoredSearchDocumentApi {
CompleteStoredSearchDocumentApiImpl(std::shared_ptr<Pistache::Rest::Router>); public:
~CompleteStoredSearchDocumentApiImpl() {} CompleteStoredSearchDocumentApiImpl(std::shared_ptr<Pistache::Rest::Router>,
oai::nrf::nrf_app *nrf_app_inst,
void retrieve_complete_search(const std::string &searchId, Pistache::Http::ResponseWriter &response); std::string address);
~CompleteStoredSearchDocumentApiImpl() {
}
void retrieve_complete_search(const std::string &searchId,
Pistache::Http::ResponseWriter &response);
private:
oai::nrf::nrf_app *m_nrf_app;
std::string m_address;
}; };
} }
......
...@@ -18,8 +18,11 @@ namespace api { ...@@ -18,8 +18,11 @@ namespace api {
using namespace oai::nrf::model; using namespace oai::nrf::model;
NFInstanceIDDocumentApiImpl::NFInstanceIDDocumentApiImpl(std::shared_ptr<Pistache::Rest::Router> rtr) NFInstanceIDDocumentApiImpl::NFInstanceIDDocumentApiImpl(std::shared_ptr<Pistache::Rest::Router> rtr,
: NFInstanceIDDocumentApi(rtr) oai::nrf::nrf_app *nrf_app_inst,
std::string address)
: NFInstanceIDDocumentApi(rtr), m_nrf_app(nrf_app_inst),
m_address(address)
{ } { }
void NFInstanceIDDocumentApiImpl::deregister_nf_instance(const std::string &nfInstanceID, Pistache::Http::ResponseWriter &response) { void NFInstanceIDDocumentApiImpl::deregister_nf_instance(const std::string &nfInstanceID, Pistache::Http::ResponseWriter &response) {
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "NFProfile.h" #include "NFProfile.h"
#include "PatchItem.h" #include "PatchItem.h"
#include "ProblemDetails.h" #include "ProblemDetails.h"
#include "nrf_app.hpp"
#include <string> #include <string>
#include <vector> #include <vector>
...@@ -43,14 +44,18 @@ using namespace oai::nrf::model; ...@@ -43,14 +44,18 @@ using namespace oai::nrf::model;
class NFInstanceIDDocumentApiImpl : public oai::nrf::api::NFInstanceIDDocumentApi { class NFInstanceIDDocumentApiImpl : public oai::nrf::api::NFInstanceIDDocumentApi {
public: public:
NFInstanceIDDocumentApiImpl(std::shared_ptr<Pistache::Rest::Router>); NFInstanceIDDocumentApiImpl(std::shared_ptr<Pistache::Rest::Router>,
oai::nrf::nrf_app *nrf_app_inst,
std::string address);
~NFInstanceIDDocumentApiImpl() {} ~NFInstanceIDDocumentApiImpl() {}
void deregister_nf_instance(const std::string &nfInstanceID, Pistache::Http::ResponseWriter &response); void deregister_nf_instance(const std::string &nfInstanceID, Pistache::Http::ResponseWriter &response);
void get_nf_instance(const std::string &nfInstanceID, Pistache::Http::ResponseWriter &response); void get_nf_instance(const std::string &nfInstanceID, Pistache::Http::ResponseWriter &response);
void register_nf_instance(const std::string &nfInstanceID, const NFProfile &nFProfile, const Pistache::Optional<Pistache::Http::Header::Raw> &contentEncoding, Pistache::Http::ResponseWriter &response); void register_nf_instance(const std::string &nfInstanceID, const NFProfile &nFProfile, const Pistache::Optional<Pistache::Http::Header::Raw> &contentEncoding, Pistache::Http::ResponseWriter &response);
void update_nf_instance(const std::string &nfInstanceID, const std::vector<PatchItem> &patchItem, Pistache::Http::ResponseWriter &response); void update_nf_instance(const std::string &nfInstanceID, const std::vector<PatchItem> &patchItem, Pistache::Http::ResponseWriter &response);
private:
oai::nrf::nrf_app *m_nrf_app;
std::string m_address;
}; };
} }
......
/** /**
* NRF NFDiscovery Service * NRF NFDiscovery Service
* NRF NFDiscovery Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * NRF NFDiscovery Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
* *
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech
* Do not edit the class manually. * Do not edit the class manually.
*/ */
#include "NFInstancesStoreApiImpl.h" #include "NFInstancesStoreApiImpl.h"
...@@ -18,11 +18,64 @@ namespace api { ...@@ -18,11 +18,64 @@ namespace api {
using namespace oai::nrf::model; using namespace oai::nrf::model;
NFInstancesStoreApiImpl::NFInstancesStoreApiImpl(std::shared_ptr<Pistache::Rest::Router> rtr) NFInstancesStoreApiImpl::NFInstancesStoreApiImpl(
: NFInstancesStoreApi(rtr) std::shared_ptr<Pistache::Rest::Router> rtr, oai::nrf::nrf_app *nrf_app_inst,
{ } std::string address)
:
NFInstancesStoreApi(rtr),
m_nrf_app(nrf_app_inst),
m_address(address) {
}
void NFInstancesStoreApiImpl::search_nf_instances(const Pistache::Optional<NFType> &targetNfType, const Pistache::Optional<NFType> &requesterNfType, const Pistache::Optional<std::string> &requesterNfInstanceId, const Pistache::Optional<Set<ServiceName>> &serviceNames, const Pistache::Optional<std::string> &requesterNfInstanceFqdn, const Pistache::Optional<std::vector<PlmnId>> &targetPlmnList, const Pistache::Optional<std::vector<PlmnId>> &requesterPlmnList, const Pistache::Optional<std::string> &targetNfInstanceId, const Pistache::Optional<std::string> &targetNfFqdn, const Pistache::Optional<std::string> &hnrfUri, const Pistache::Optional<std::vector<Snssai>> &snssais, const Pistache::Optional<std::vector<Snssai>> &requesterSnssais, const Pistache::Optional<std::vector<PlmnSnssai>> &plmnSpecificSnssaiList, const Pistache::Optional<std::string> &dnn, const Pistache::Optional<std::vector<std::string>> &nsiList, const Pistache::Optional<std::string> &smfServingArea, const Pistache::Optional<Tai> &tai, const Pistache::Optional<std::string> &amfRegionId, const Pistache::Optional<std::string> &amfSetId, const Pistache::Optional<Guami> &guami, const Pistache::Optional<std::string> &supi, const Pistache::Optional<std::string> &ueIpv4Address, const Pistache::Optional<std::string> &ipDomain, const Pistache::Optional<Ipv6Prefix> &ueIpv6Prefix, const Pistache::Optional<bool> &pgwInd, const Pistache::Optional<std::string> &pgw, const Pistache::Optional<std::string> &gpsi, const Pistache::Optional<std::string> &externalGroupIdentity, const Pistache::Optional<DataSetId> &dataSet, const Pistache::Optional<std::string> &routingIndicator, const Pistache::Optional<std::vector<std::string>> &groupIdList, const Pistache::Optional<std::vector<std::string>> &dnaiList, const Pistache::Optional<std::vector<PduSessionType>> &pduSessionTypes, const Pistache::Optional<std::vector<EventId>> &eventIdList, const Pistache::Optional<std::vector<NwdafEvent>> &nwdafEventList, const Pistache::Optional<std::string> &supportedFeatures, const Pistache::Optional<bool> &upfIwkEpsInd, const Pistache::Optional<PlmnId> &chfSupportedPlmn, const Pistache::Optional<std::string> &preferredLocality, const Pistache::Optional<AccessType> &accessType, const Pistache::Optional<int32_t> &limit, const Pistache::Optional<std::vector<std::string>> &requiredFeatures, const Pistache::Optional<ComplexQuery> &complexQuery, const Pistache::Optional<int32_t> &maxPayloadSize, const Pistache::Optional<AtsssCapability> &atsssCapability, const Pistache::Optional<bool> &upfUeIpAddrInd, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, Pistache::Http::ResponseWriter &response) { void NFInstancesStoreApiImpl::search_nf_instances(
const Pistache::Optional<std::string> &targetNfType,
const Pistache::Optional<std::string> &requesterNfType,
const Pistache::Optional<std::string> &requesterNfInstanceId,
const Pistache::Optional<std::vector<ServiceName>> &serviceNames,
const Pistache::Optional<std::string> &requesterNfInstanceFqdn,
const Pistache::Optional<std::vector<PlmnId>> &targetPlmnList,
const Pistache::Optional<std::vector<PlmnId>> &requesterPlmnList,
const Pistache::Optional<std::string> &targetNfInstanceId,
const Pistache::Optional<std::string> &targetNfFqdn,
const Pistache::Optional<std::string> &hnrfUri,
const Pistache::Optional<std::vector<Snssai>> &snssais,
const Pistache::Optional<std::vector<Snssai>> &requesterSnssais,
const Pistache::Optional<std::vector<PlmnSnssai>> &plmnSpecificSnssaiList,
const Pistache::Optional<std::string> &dnn,
const Pistache::Optional<std::vector<std::string>> &nsiList,
const Pistache::Optional<std::string> &smfServingArea,
const Pistache::Optional<Tai> &tai,
const Pistache::Optional<std::string> &amfRegionId,
const Pistache::Optional<std::string> &amfSetId,
const Pistache::Optional<Guami> &guami,
const Pistache::Optional<std::string> &supi,
const Pistache::Optional<std::string> &ueIpv4Address,
const Pistache::Optional<std::string> &ipDomain,
const Pistache::Optional<Ipv6Prefix> &ueIpv6Prefix,
const Pistache::Optional<bool> &pgwInd,
const Pistache::Optional<std::string> &pgw,
const Pistache::Optional<std::string> &gpsi,
const Pistache::Optional<std::string> &externalGroupIdentity,
const Pistache::Optional<DataSetId> &dataSet,
const Pistache::Optional<std::string> &routingIndicator,
const Pistache::Optional<std::vector<std::string>> &groupIdList,
const Pistache::Optional<std::vector<std::string>> &dnaiList,
const Pistache::Optional<std::vector<PduSessionType>> &pduSessionTypes,
const Pistache::Optional<std::vector<EventId>> &eventIdList,
const Pistache::Optional<std::vector<NwdafEvent>> &nwdafEventList,
const Pistache::Optional<std::string> &supportedFeatures,
const Pistache::Optional<bool> &upfIwkEpsInd,
const Pistache::Optional<PlmnId> &chfSupportedPlmn,
const Pistache::Optional<std::string> &preferredLocality,
const Pistache::Optional<AccessType> &accessType,
const Pistache::Optional<int32_t> &limit,
const Pistache::Optional<std::vector<std::string>> &requiredFeatures,
const Pistache::Optional<ComplexQuery> &complexQuery,
const Pistache::Optional<int32_t> &maxPayloadSize,
const Pistache::Optional<AtsssCapability> &atsssCapability,
const Pistache::Optional<bool> &upfUeIpAddrInd,
const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch,
Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic\n"); response.send(Pistache::Http::Code::Ok, "Do some magic\n");
} }
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#include "EventId.h" #include "EventId.h"
#include "Guami.h" #include "Guami.h"
#include "Ipv6Prefix.h" #include "Ipv6Prefix.h"
#include "NFType.h" //#include "NFType.h"
#include "NwdafEvent.h" #include "NwdafEvent.h"
#include "PduSessionType.h" #include "PduSessionType.h"
#include "PlmnId.h" #include "PlmnId.h"
...@@ -44,10 +44,12 @@ ...@@ -44,10 +44,12 @@
#include "ProblemDetails.h" #include "ProblemDetails.h"
#include "SearchResult.h" #include "SearchResult.h"
#include "ServiceName.h" #include "ServiceName.h"
#include "Set.h"
#include "Snssai.h" #include "Snssai.h"
#include "Tai.h" #include "Tai.h"
#include "nrf_app.hpp"
#include <string> #include <string>
#include <set>
namespace oai { namespace oai {
namespace nrf { namespace nrf {
...@@ -57,11 +59,15 @@ using namespace oai::nrf::model; ...@@ -57,11 +59,15 @@ using namespace oai::nrf::model;
class NFInstancesStoreApiImpl : public oai::nrf::api::NFInstancesStoreApi { class NFInstancesStoreApiImpl : public oai::nrf::api::NFInstancesStoreApi {
public: public:
NFInstancesStoreApiImpl(std::shared_ptr<Pistache::Rest::Router>); NFInstancesStoreApiImpl(std::shared_ptr<Pistache::Rest::Router>,
oai::nrf::nrf_app *nrf_app_inst,
std::string address);
~NFInstancesStoreApiImpl() {} ~NFInstancesStoreApiImpl() {}
void search_nf_instances(const Pistache::Optional<NFType> &targetNfType, const Pistache::Optional<NFType> &requesterNfType, const Pistache::Optional<std::string> &requesterNfInstanceId, const Pistache::Optional<Set<ServiceName>> &serviceNames, const Pistache::Optional<std::string> &requesterNfInstanceFqdn, const Pistache::Optional<std::vector<PlmnId>> &targetPlmnList, const Pistache::Optional<std::vector<PlmnId>> &requesterPlmnList, const Pistache::Optional<std::string> &targetNfInstanceId, const Pistache::Optional<std::string> &targetNfFqdn, const Pistache::Optional<std::string> &hnrfUri, const Pistache::Optional<std::vector<Snssai>> &snssais, const Pistache::Optional<std::vector<Snssai>> &requesterSnssais, const Pistache::Optional<std::vector<PlmnSnssai>> &plmnSpecificSnssaiList, const Pistache::Optional<std::string> &dnn, const Pistache::Optional<std::vector<std::string>> &nsiList, const Pistache::Optional<std::string> &smfServingArea, const Pistache::Optional<Tai> &tai, const Pistache::Optional<std::string> &amfRegionId, const Pistache::Optional<std::string> &amfSetId, const Pistache::Optional<Guami> &guami, const Pistache::Optional<std::string> &supi, const Pistache::Optional<std::string> &ueIpv4Address, const Pistache::Optional<std::string> &ipDomain, const Pistache::Optional<Ipv6Prefix> &ueIpv6Prefix, const Pistache::Optional<bool> &pgwInd, const Pistache::Optional<std::string> &pgw, const Pistache::Optional<std::string> &gpsi, const Pistache::Optional<std::string> &externalGroupIdentity, const Pistache::Optional<DataSetId> &dataSet, const Pistache::Optional<std::string> &routingIndicator, const Pistache::Optional<std::vector<std::string>> &groupIdList, const Pistache::Optional<std::vector<std::string>> &dnaiList, const Pistache::Optional<std::vector<PduSessionType>> &pduSessionTypes, const Pistache::Optional<std::vector<EventId>> &eventIdList, const Pistache::Optional<std::vector<NwdafEvent>> &nwdafEventList, const Pistache::Optional<std::string> &supportedFeatures, const Pistache::Optional<bool> &upfIwkEpsInd, const Pistache::Optional<PlmnId> &chfSupportedPlmn, const Pistache::Optional<std::string> &preferredLocality, const Pistache::Optional<AccessType> &accessType, const Pistache::Optional<int32_t> &limit, const Pistache::Optional<std::vector<std::string>> &requiredFeatures, const Pistache::Optional<ComplexQuery> &complexQuery, const Pistache::Optional<int32_t> &maxPayloadSize, const Pistache::Optional<AtsssCapability> &atsssCapability, const Pistache::Optional<bool> &upfUeIpAddrInd, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, Pistache::Http::ResponseWriter &response); void search_nf_instances(const Pistache::Optional<std::string> &targetNfType, const Pistache::Optional<std::string> &requesterNfType, const Pistache::Optional<std::string> &requesterNfInstanceId, const Pistache::Optional<std::vector<ServiceName>> &serviceNames, const Pistache::Optional<std::string> &requesterNfInstanceFqdn, const Pistache::Optional<std::vector<PlmnId>> &targetPlmnList, const Pistache::Optional<std::vector<PlmnId>> &requesterPlmnList, const Pistache::Optional<std::string> &targetNfInstanceId, const Pistache::Optional<std::string> &targetNfFqdn, const Pistache::Optional<std::string> &hnrfUri, const Pistache::Optional<std::vector<Snssai>> &snssais, const Pistache::Optional<std::vector<Snssai>> &requesterSnssais, const Pistache::Optional<std::vector<PlmnSnssai>> &plmnSpecificSnssaiList, const Pistache::Optional<std::string> &dnn, const Pistache::Optional<std::vector<std::string>> &nsiList, const Pistache::Optional<std::string> &smfServingArea, const Pistache::Optional<Tai> &tai, const Pistache::Optional<std::string> &amfRegionId, const Pistache::Optional<std::string> &amfSetId, const Pistache::Optional<Guami> &guami, const Pistache::Optional<std::string> &supi, const Pistache::Optional<std::string> &ueIpv4Address, const Pistache::Optional<std::string> &ipDomain, const Pistache::Optional<Ipv6Prefix> &ueIpv6Prefix, const Pistache::Optional<bool> &pgwInd, const Pistache::Optional<std::string> &pgw, const Pistache::Optional<std::string> &gpsi, const Pistache::Optional<std::string> &externalGroupIdentity, const Pistache::Optional<DataSetId> &dataSet, const Pistache::Optional<std::string> &routingIndicator, const Pistache::Optional<std::vector<std::string>> &groupIdList, const Pistache::Optional<std::vector<std::string>> &dnaiList, const Pistache::Optional<std::vector<PduSessionType>> &pduSessionTypes, const Pistache::Optional<std::vector<EventId>> &eventIdList, const Pistache::Optional<std::vector<NwdafEvent>> &nwdafEventList, const Pistache::Optional<std::string> &supportedFeatures, const Pistache::Optional<bool> &upfIwkEpsInd, const Pistache::Optional<PlmnId> &chfSupportedPlmn, const Pistache::Optional<std::string> &preferredLocality, const Pistache::Optional<AccessType> &accessType, const Pistache::Optional<int32_t> &limit, const Pistache::Optional<std::vector<std::string>> &requiredFeatures, const Pistache::Optional<ComplexQuery> &complexQuery, const Pistache::Optional<int32_t> &maxPayloadSize, const Pistache::Optional<AtsssCapability> &atsssCapability, const Pistache::Optional<bool> &upfUeIpAddrInd, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, Pistache::Http::ResponseWriter &response);
private:
oai::nrf::nrf_app *m_nrf_app;
std::string m_address;
}; };
} }
......
/** /**
* NRF NFDiscovery Service * NRF NFDiscovery Service
* NRF NFDiscovery Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * NRF NFDiscovery Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
* *
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech
* Do not edit the class manually. * Do not edit the class manually.
*/ */
#include "StoredSearchDocumentApiImpl.h" #include "StoredSearchDocumentApiImpl.h"
...@@ -18,11 +18,17 @@ namespace api { ...@@ -18,11 +18,17 @@ namespace api {
using namespace oai::nrf::model; using namespace oai::nrf::model;
StoredSearchDocumentApiImpl::StoredSearchDocumentApiImpl(std::shared_ptr<Pistache::Rest::Router> rtr) StoredSearchDocumentApiImpl::StoredSearchDocumentApiImpl(
: StoredSearchDocumentApi(rtr) std::shared_ptr<Pistache::Rest::Router> rtr, oai::nrf::nrf_app *nrf_app_inst,
{ } std::string address)
:
StoredSearchDocumentApi(rtr),
m_nrf_app(nrf_app_inst),
m_address(address) {
}
void StoredSearchDocumentApiImpl::retrieve_stored_search(const std::string &searchId, Pistache::Http::ResponseWriter &response) { void StoredSearchDocumentApiImpl::retrieve_stored_search(
const std::string &searchId, Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic\n"); response.send(Pistache::Http::Code::Ok, "Do some magic\n");
} }
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <pistache/optional.h> #include <pistache/optional.h>
#include "StoredSearchResult.h" #include "StoredSearchResult.h"
#include "nrf_app.hpp"
#include <string> #include <string>
namespace oai { namespace oai {
...@@ -40,11 +41,15 @@ using namespace oai::nrf::model; ...@@ -40,11 +41,15 @@ using namespace oai::nrf::model;
class StoredSearchDocumentApiImpl : public oai::nrf::api::StoredSearchDocumentApi { class StoredSearchDocumentApiImpl : public oai::nrf::api::StoredSearchDocumentApi {
public: public:
StoredSearchDocumentApiImpl(std::shared_ptr<Pistache::Rest::Router>); StoredSearchDocumentApiImpl(std::shared_ptr<Pistache::Rest::Router>,
oai::nrf::nrf_app *nrf_app_inst,
std::string address);
~StoredSearchDocumentApiImpl() {} ~StoredSearchDocumentApiImpl() {}
void retrieve_stored_search(const std::string &searchId, Pistache::Http::ResponseWriter &response); void retrieve_stored_search(const std::string &searchId, Pistache::Http::ResponseWriter &response);
private:
oai::nrf::nrf_app *m_nrf_app;
std::string m_address;
}; };
} }
......
/** /**
* NRF NFManagement Service * NRF NFManagement Service
* NRF NFManagement Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * NRF NFManagement Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
* *
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech
* Do not edit the class manually. * Do not edit the class manually.
*/ */
#include "SubscriptionIDDocumentApiImpl.h" #include "SubscriptionIDDocumentApiImpl.h"
...@@ -18,14 +18,23 @@ namespace api { ...@@ -18,14 +18,23 @@ namespace api {
using namespace oai::nrf::model; using namespace oai::nrf::model;
SubscriptionIDDocumentApiImpl::SubscriptionIDDocumentApiImpl(std::shared_ptr<Pistache::Rest::Router> rtr) SubscriptionIDDocumentApiImpl::SubscriptionIDDocumentApiImpl(
: SubscriptionIDDocumentApi(rtr) std::shared_ptr<Pistache::Rest::Router> rtr, oai::nrf::nrf_app *nrf_app_inst,
{ } std::string address)
:
SubscriptionIDDocumentApi(rtr),
m_nrf_app(nrf_app_inst),
m_address(address) {
}
void SubscriptionIDDocumentApiImpl::remove_subscription(const std::string &subscriptionID, Pistache::Http::ResponseWriter &response) { void SubscriptionIDDocumentApiImpl::remove_subscription(
const std::string &subscriptionID,
Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic\n"); response.send(Pistache::Http::Code::Ok, "Do some magic\n");
} }
void SubscriptionIDDocumentApiImpl::update_subscription(const std::string &subscriptionID, const std::vector<PatchItem> &patchItem, Pistache::Http::ResponseWriter &response) { void SubscriptionIDDocumentApiImpl::update_subscription(
const std::string &subscriptionID, const std::vector<PatchItem> &patchItem,
Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic\n"); response.send(Pistache::Http::Code::Ok, "Do some magic\n");
} }
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "PatchItem.h" #include "PatchItem.h"
#include "ProblemDetails.h" #include "ProblemDetails.h"
#include "SubscriptionData.h" #include "SubscriptionData.h"
#include "nrf_app.hpp"
#include <string> #include <string>
#include <vector> #include <vector>
...@@ -43,12 +44,16 @@ using namespace oai::nrf::model; ...@@ -43,12 +44,16 @@ using namespace oai::nrf::model;
class SubscriptionIDDocumentApiImpl : public oai::nrf::api::SubscriptionIDDocumentApi { class SubscriptionIDDocumentApiImpl : public oai::nrf::api::SubscriptionIDDocumentApi {
public: public:
SubscriptionIDDocumentApiImpl(std::shared_ptr<Pistache::Rest::Router>); SubscriptionIDDocumentApiImpl(std::shared_ptr<Pistache::Rest::Router>,
oai::nrf::nrf_app *nrf_app_inst,
std::string address);
~SubscriptionIDDocumentApiImpl() {} ~SubscriptionIDDocumentApiImpl() {}
void remove_subscription(const std::string &subscriptionID, Pistache::Http::ResponseWriter &response); void remove_subscription(const std::string &subscriptionID, Pistache::Http::ResponseWriter &response);
void update_subscription(const std::string &subscriptionID, const std::vector<PatchItem> &patchItem, Pistache::Http::ResponseWriter &response); void update_subscription(const std::string &subscriptionID, const std::vector<PatchItem> &patchItem, Pistache::Http::ResponseWriter &response);
private:
oai::nrf::nrf_app *m_nrf_app;
std::string m_address;
}; };
} }
......
/** /**
* NRF NFManagement Service * NRF NFManagement Service
* NRF NFManagement Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * NRF NFManagement Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
* *
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech * https://openapi-generator.tech
* Do not edit the class manually. * Do not edit the class manually.
*/ */
#include "SubscriptionsCollectionApiImpl.h" #include "SubscriptionsCollectionApiImpl.h"
...@@ -18,11 +18,18 @@ namespace api { ...@@ -18,11 +18,18 @@ namespace api {
using namespace oai::nrf::model; using namespace oai::nrf::model;
SubscriptionsCollectionApiImpl::SubscriptionsCollectionApiImpl(std::shared_ptr<Pistache::Rest::Router> rtr) SubscriptionsCollectionApiImpl::SubscriptionsCollectionApiImpl(
: SubscriptionsCollectionApi(rtr) std::shared_ptr<Pistache::Rest::Router> rtr, oai::nrf::nrf_app *nrf_app_inst,
{ } std::string address)
:
SubscriptionsCollectionApi(rtr),
m_nrf_app(nrf_app_inst),
m_address(address) {
}
void SubscriptionsCollectionApiImpl::create_subscription(const SubscriptionData &subscriptionData, Pistache::Http::ResponseWriter &response) { void SubscriptionsCollectionApiImpl::create_subscription(
const SubscriptionData &subscriptionData,
Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic\n"); response.send(Pistache::Http::Code::Ok, "Do some magic\n");
} }
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "ProblemDetails.h" #include "ProblemDetails.h"
#include "SubscriptionData.h" #include "SubscriptionData.h"
#include "nrf_app.hpp"
namespace oai { namespace oai {
namespace nrf { namespace nrf {
...@@ -40,11 +41,15 @@ using namespace oai::nrf::model; ...@@ -40,11 +41,15 @@ using namespace oai::nrf::model;
class SubscriptionsCollectionApiImpl : public oai::nrf::api::SubscriptionsCollectionApi { class SubscriptionsCollectionApiImpl : public oai::nrf::api::SubscriptionsCollectionApi {
public: public:
SubscriptionsCollectionApiImpl(std::shared_ptr<Pistache::Rest::Router>); SubscriptionsCollectionApiImpl(std::shared_ptr<Pistache::Rest::Router>,
oai::nrf::nrf_app *nrf_app_inst,
std::string address);
~SubscriptionsCollectionApiImpl() {} ~SubscriptionsCollectionApiImpl() {}
void create_subscription(const SubscriptionData &subscriptionData, Pistache::Http::ResponseWriter &response); void create_subscription(const SubscriptionData &subscriptionData, Pistache::Http::ResponseWriter &response);
private:
oai::nrf::nrf_app *m_nrf_app;
std::string m_address;
}; };
} }
......
...@@ -62,11 +62,11 @@ void Atom::setAttr(std::string const& value) ...@@ -62,11 +62,11 @@ void Atom::setAttr(std::string const& value)
{ {
m_Attr = value; m_Attr = value;
} }
AnyType Atom::getValue() const std::string Atom::getValue() const
{ {
return m_Value; return m_Value;
} }
void Atom::setValue(AnyType const& value) void Atom::setValue(std::string const& value)
{ {
m_Value = value; m_Value = value;
} }
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include <string> #include <string>
#include "AnyType.h" //#include "AnyType.h"
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai {
...@@ -49,8 +49,8 @@ public: ...@@ -49,8 +49,8 @@ public:
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
AnyType getValue() const; std::string getValue() const;
void setValue(AnyType const& value); void setValue(std::string const& value);
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
...@@ -64,7 +64,7 @@ public: ...@@ -64,7 +64,7 @@ public:
protected: protected:
std::string m_Attr; std::string m_Attr;
AnyType m_Value; std::string m_Value;
bool m_Negative; bool m_Negative;
bool m_NegativeIsSet; bool m_NegativeIsSet;
......
...@@ -103,11 +103,11 @@ void ChangeItem::unsetFrom() ...@@ -103,11 +103,11 @@ void ChangeItem::unsetFrom()
{ {
m_FromIsSet = false; m_FromIsSet = false;
} }
AnyType ChangeItem::getOrigValue() const std::string ChangeItem::getOrigValue() const
{ {
return m_OrigValue; return m_OrigValue;
} }
void ChangeItem::setOrigValue(AnyType const& value) void ChangeItem::setOrigValue(std::string const& value)
{ {
m_OrigValue = value; m_OrigValue = value;
m_OrigValueIsSet = true; m_OrigValueIsSet = true;
...@@ -120,11 +120,11 @@ void ChangeItem::unsetOrigValue() ...@@ -120,11 +120,11 @@ void ChangeItem::unsetOrigValue()
{ {
m_OrigValueIsSet = false; m_OrigValueIsSet = false;
} }
AnyType ChangeItem::getNewValue() const std::string ChangeItem::getNewValue() const
{ {
return m_NewValue; return m_NewValue;
} }
void ChangeItem::setNewValue(AnyType const& value) void ChangeItem::setNewValue(std::string const& value)
{ {
m_NewValue = value; m_NewValue = value;
m_NewValueIsSet = true; m_NewValueIsSet = true;
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include "ChangeType.h" #include "ChangeType.h"
#include <string> #include <string>
#include "AnyType.h" //#include "AnyType.h"
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai {
...@@ -62,15 +62,15 @@ public: ...@@ -62,15 +62,15 @@ public:
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
AnyType getOrigValue() const; std::string getOrigValue() const;
void setOrigValue(AnyType const& value); void setOrigValue(std::string const& value);
bool origValueIsSet() const; bool origValueIsSet() const;
void unsetOrigValue(); void unsetOrigValue();
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
AnyType getNewValue() const; std::string getNewValue() const;
void setNewValue(AnyType const& value); void setNewValue(std::string const& value);
bool newValueIsSet() const; bool newValueIsSet() const;
void unsetNewValue(); void unsetNewValue();
...@@ -83,9 +83,9 @@ protected: ...@@ -83,9 +83,9 @@ protected:
std::string m_From; std::string m_From;
bool m_FromIsSet; bool m_FromIsSet;
AnyType m_OrigValue; std::string m_OrigValue;
bool m_OrigValueIsSet; bool m_OrigValueIsSet;
AnyType m_NewValue; std::string m_NewValue;
bool m_NewValueIsSet; bool m_NewValueIsSet;
}; };
......
...@@ -11,9 +11,8 @@ ...@@ -11,9 +11,8 @@
*/ */
#include "Helpers.h" #include "Helpers.h"
namespace org { namespace oai {
namespace openapitools { namespace nrf {
namespace server {
namespace helpers { namespace helpers {
...@@ -92,7 +91,49 @@ bool fromStringValue(const std::string &inStr, double &value){ ...@@ -92,7 +91,49 @@ bool fromStringValue(const std::string &inStr, double &value){
return true; return true;
} }
bool fromStringValue(const std::string &inStr, oai::nrf::model::ServiceName &value) {
//TODO
return true;
}
bool fromStringValue(const std::string &inStr, oai::nrf::model::PlmnId &value){
//TODO
return true;
}
bool fromStringValue(const std::string &inStr, oai::nrf::model::Snssai &value){
//TODO
return true;
}
bool fromStringValue(const std::string &inStr, oai::nrf::model::PlmnSnssai &value){
//TODO
return true;
}
bool fromStringValue(const std::string &inStr, oai::nrf::model::PduSessionType &value){
//TODO
return true;
} }
bool fromStringValue(const std::string &inStr, oai::nrf::model::EventId &value){
//TODO
return true;
}
bool fromStringValue(const std::string &inStr, oai::nrf::model::NwdafEvent &value){
//TODO
return true;
}
bool fromStringValue(const std::string &inStr, oai::nrf::model::AccessType &value){
//TODO
return true;
}
bool fromStringValue(const std::string &inStr, oai::nrf::model::ComplexQuery &value){
//TODO
return true;
}
bool fromStringValue(const std::string &inStr, oai::nrf::model::AtsssCapability &value){
//TODO
return true;
}
} }
} }
} }
...@@ -23,10 +23,19 @@ ...@@ -23,10 +23,19 @@
#include <sstream> #include <sstream>
#include <vector> #include <vector>
#include <map> #include <map>
#include "ServiceName.h"
#include "PlmnId.h"
#include "Snssai.h"
#include "PlmnSnssai.h"
#include "PduSessionType.h"
#include "EventId.h"
#include "NwdafEvent.h"
#include "AccessType.h"
#include "ComplexQuery.h"
#include "AtsssCapability.h"
namespace org { namespace oai {
namespace openapitools { namespace nrf {
namespace server {
namespace helpers { namespace helpers {
std::string toStringValue(const std::string &value); std::string toStringValue(const std::string &value);
...@@ -42,6 +51,17 @@ namespace helpers { ...@@ -42,6 +51,17 @@ namespace helpers {
bool fromStringValue(const std::string &inStr, bool &value); bool fromStringValue(const std::string &inStr, bool &value);
bool fromStringValue(const std::string &inStr, float &value); bool fromStringValue(const std::string &inStr, float &value);
bool fromStringValue(const std::string &inStr, double &value); bool fromStringValue(const std::string &inStr, double &value);
bool fromStringValue(const std::string &inStr, oai::nrf::model::ServiceName &value);
bool fromStringValue(const std::string &inStr, oai::nrf::model::PlmnId &value);
bool fromStringValue(const std::string &inStr, oai::nrf::model::Snssai &value);
bool fromStringValue(const std::string &inStr, oai::nrf::model::PlmnSnssai &value);
bool fromStringValue(const std::string &inStr, oai::nrf::model::PduSessionType &value);
bool fromStringValue(const std::string &inStr, oai::nrf::model::EventId &value);
bool fromStringValue(const std::string &inStr, oai::nrf::model::NwdafEvent &value);
bool fromStringValue(const std::string &inStr, oai::nrf::model::AccessType &value);
bool fromStringValue(const std::string &inStr, oai::nrf::model::ComplexQuery &value);
bool fromStringValue(const std::string &inStr, oai::nrf::model::AtsssCapability &value);
template<typename T> template<typename T>
bool fromStringValue(const std::vector<std::string> &inStr, std::vector<T> &value){ bool fromStringValue(const std::vector<std::string> &inStr, std::vector<T> &value){
try{ try{
...@@ -71,6 +91,5 @@ namespace helpers { ...@@ -71,6 +91,5 @@ namespace helpers {
} }
} }
} }
}
#endif // Helpers_H_ #endif // Helpers_H_
...@@ -57,7 +57,7 @@ NFProfile::NFProfile() ...@@ -57,7 +57,7 @@ NFProfile::NFProfile()
m_ChfInfoIsSet = false; m_ChfInfoIsSet = false;
m_ChfInfoExtIsSet = false; m_ChfInfoExtIsSet = false;
m_NwdafInfoIsSet = false; m_NwdafInfoIsSet = false;
m_CustomInfoIsSet = false; //m_CustomInfoIsSet = false;
m_RecoveryTime = ""; m_RecoveryTime = "";
m_RecoveryTimeIsSet = false; m_RecoveryTimeIsSet = false;
m_NfServicePersistence = false; m_NfServicePersistence = false;
...@@ -144,8 +144,8 @@ void to_json(nlohmann::json& j, const NFProfile& o) ...@@ -144,8 +144,8 @@ void to_json(nlohmann::json& j, const NFProfile& o)
j["chfInfoExt"] = o.m_ChfInfoExt; j["chfInfoExt"] = o.m_ChfInfoExt;
if(o.nwdafInfoIsSet()) if(o.nwdafInfoIsSet())
j["nwdafInfo"] = o.m_NwdafInfo; j["nwdafInfo"] = o.m_NwdafInfo;
if(o.customInfoIsSet()) //if(o.customInfoIsSet())
j["customInfo"] = o.m_CustomInfo; // j["customInfo"] = o.m_CustomInfo;
if(o.recoveryTimeIsSet()) if(o.recoveryTimeIsSet())
j["recoveryTime"] = o.m_RecoveryTime; j["recoveryTime"] = o.m_RecoveryTime;
if(o.nfServicePersistenceIsSet()) if(o.nfServicePersistenceIsSet())
...@@ -316,11 +316,11 @@ void from_json(const nlohmann::json& j, NFProfile& o) ...@@ -316,11 +316,11 @@ void from_json(const nlohmann::json& j, NFProfile& o)
j.at("nwdafInfo").get_to(o.m_NwdafInfo); j.at("nwdafInfo").get_to(o.m_NwdafInfo);
o.m_NwdafInfoIsSet = true; o.m_NwdafInfoIsSet = true;
} }
if(j.find("customInfo") != j.end()) /*if(j.find("customInfo") != j.end())
{ {
j.at("customInfo").get_to(o.m_CustomInfo); j.at("customInfo").get_to(o.m_CustomInfo);
o.m_CustomInfoIsSet = true; o.m_CustomInfoIsSet = true;
} } */
if(j.find("recoveryTime") != j.end()) if(j.find("recoveryTime") != j.end())
{ {
j.at("recoveryTime").get_to(o.m_RecoveryTime); j.at("recoveryTime").get_to(o.m_RecoveryTime);
...@@ -368,11 +368,11 @@ void NFProfile::unsetNfInstanceName() ...@@ -368,11 +368,11 @@ void NFProfile::unsetNfInstanceName()
{ {
m_NfInstanceNameIsSet = false; m_NfInstanceNameIsSet = false;
} }
NFType NFProfile::getNfType() const std::string NFProfile::getNfType() const
{ {
return m_NfType; return m_NfType;
} }
void NFProfile::setNfType(NFType const& value) void NFProfile::setNfType(std::string const& value)
{ {
m_NfType = value; m_NfType = value;
} }
...@@ -894,23 +894,27 @@ void NFProfile::unsetNwdafInfo() ...@@ -894,23 +894,27 @@ void NFProfile::unsetNwdafInfo()
{ {
m_NwdafInfoIsSet = false; m_NwdafInfoIsSet = false;
} }
Object NFProfile::getCustomInfo() const /*Object NFProfile::getCustomInfo() const
{ {
return m_CustomInfo; return m_CustomInfo;
} }
*/
/*
void NFProfile::setCustomInfo(Object const& value) void NFProfile::setCustomInfo(Object const& value)
{ {
m_CustomInfo = value; m_CustomInfo = value;
m_CustomInfoIsSet = true; m_CustomInfoIsSet = true;
} }*/
bool NFProfile::customInfoIsSet() const /* bool NFProfile::customInfoIsSet() const
{ {
return m_CustomInfoIsSet; return m_CustomInfoIsSet;
} }*/
/*
void NFProfile::unsetCustomInfo() void NFProfile::unsetCustomInfo()
{ {
m_CustomInfoIsSet = false; m_CustomInfoIsSet = false;
} }*/
std::string NFProfile::getRecoveryTime() const std::string NFProfile::getRecoveryTime() const
{ {
return m_RecoveryTime; return m_RecoveryTime;
......
...@@ -35,8 +35,8 @@ ...@@ -35,8 +35,8 @@
#include <vector> #include <vector>
#include "AmfInfo.h" #include "AmfInfo.h"
#include "UdrInfo.h" #include "UdrInfo.h"
#include "NFType.h" //#include "NFType.h"
#include "Object.h" //#include "Object.h"
#include "PlmnSnssai.h" #include "PlmnSnssai.h"
#include "AusfInfo.h" #include "AusfInfo.h"
#include "NwdafInfo.h" #include "NwdafInfo.h"
...@@ -75,8 +75,8 @@ public: ...@@ -75,8 +75,8 @@ public:
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
NFType getNfType() const; std::string getNfType() const;
void setNfType(NFType const& value); void setNfType(std::string const& value);
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
...@@ -295,10 +295,10 @@ public: ...@@ -295,10 +295,10 @@ public:
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
Object getCustomInfo() const; //Object getCustomInfo() const;
void setCustomInfo(Object const& value); //void setCustomInfo(Object const& value);
bool customInfoIsSet() const; //bool customInfoIsSet() const;
void unsetCustomInfo(); //void unsetCustomInfo();
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
...@@ -335,7 +335,7 @@ protected: ...@@ -335,7 +335,7 @@ protected:
std::string m_NfInstanceName; std::string m_NfInstanceName;
bool m_NfInstanceNameIsSet; bool m_NfInstanceNameIsSet;
NFType m_NfType; std::string m_NfType;
NFStatus m_NfStatus; NFStatus m_NfStatus;
...@@ -399,8 +399,8 @@ protected: ...@@ -399,8 +399,8 @@ protected:
bool m_ChfInfoExtIsSet; bool m_ChfInfoExtIsSet;
NwdafInfo m_NwdafInfo; NwdafInfo m_NwdafInfo;
bool m_NwdafInfoIsSet; bool m_NwdafInfoIsSet;
Object m_CustomInfo; //Object m_CustomInfo;
bool m_CustomInfoIsSet; //bool m_CustomInfoIsSet;
std::string m_RecoveryTime; std::string m_RecoveryTime;
bool m_RecoveryTimeIsSet; bool m_RecoveryTimeIsSet;
bool m_NfServicePersistence; bool m_NfServicePersistence;
......
...@@ -42,11 +42,11 @@ void from_json(const nlohmann::json& j, NfTypeCond& o) ...@@ -42,11 +42,11 @@ void from_json(const nlohmann::json& j, NfTypeCond& o)
j.at("nfType").get_to(o.m_NfType); j.at("nfType").get_to(o.m_NfType);
} }
NFType NfTypeCond::getNfType() const std::string NfTypeCond::getNfType() const
{ {
return m_NfType; return m_NfType;
} }
void NfTypeCond::setNfType(NFType const& value) void NfTypeCond::setNfType(std::string const& value)
{ {
m_NfType = value; m_NfType = value;
} }
......
...@@ -19,7 +19,8 @@ ...@@ -19,7 +19,8 @@
#define NfTypeCond_H_ #define NfTypeCond_H_
#include "NFType.h" //#include "NFType.h"
#include <string>
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai {
...@@ -43,13 +44,13 @@ public: ...@@ -43,13 +44,13 @@ public:
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
NFType getNfType() const; std::string getNfType() const;
void setNfType(NFType const& value); void setNfType(std::string const& value);
friend void to_json(nlohmann::json& j, const NfTypeCond& o); friend void to_json(nlohmann::json& j, const NfTypeCond& o);
friend void from_json(const nlohmann::json& j, NfTypeCond& o); friend void from_json(const nlohmann::json& j, NfTypeCond& o);
protected: protected:
NFType m_NfType; std::string m_NfType;
}; };
......
...@@ -95,11 +95,11 @@ void PatchItem::unsetFrom() ...@@ -95,11 +95,11 @@ void PatchItem::unsetFrom()
{ {
m_FromIsSet = false; m_FromIsSet = false;
} }
AnyType PatchItem::getValue() const std::string PatchItem::getValue() const
{ {
return m_Value; return m_Value;
} }
void PatchItem::setValue(AnyType const& value) void PatchItem::setValue(std::string const& value)
{ {
m_Value = value; m_Value = value;
m_ValueIsSet = true; m_ValueIsSet = true;
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include <string> #include <string>
#include "PatchOperation.h" #include "PatchOperation.h"
#include "AnyType.h" //#include "AnyType.h"
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai {
...@@ -62,8 +62,8 @@ public: ...@@ -62,8 +62,8 @@ public:
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
AnyType getValue() const; std::string getValue() const;
void setValue(AnyType const& value); void setValue(std::string const& value);
bool valueIsSet() const; bool valueIsSet() const;
void unsetValue(); void unsetValue();
...@@ -76,7 +76,7 @@ protected: ...@@ -76,7 +76,7 @@ protected:
std::string m_From; std::string m_From;
bool m_FromIsSet; bool m_FromIsSet;
AnyType m_Value; std::string m_Value;
bool m_ValueIsSet; bool m_ValueIsSet;
}; };
......
...@@ -33,6 +33,7 @@ SubscriptionData::SubscriptionData() ...@@ -33,6 +33,7 @@ SubscriptionData::SubscriptionData()
m_ReqNfFqdn = ""; m_ReqNfFqdn = "";
m_ReqNfFqdnIsSet = false; m_ReqNfFqdnIsSet = false;
m_ReqSnssaisIsSet = false; m_ReqSnssaisIsSet = false;
//m_SubscrCond;
} }
...@@ -51,8 +52,9 @@ void to_json(nlohmann::json& j, const SubscriptionData& o) ...@@ -51,8 +52,9 @@ void to_json(nlohmann::json& j, const SubscriptionData& o)
j["nfStatusNotificationUri"] = o.m_NfStatusNotificationUri; j["nfStatusNotificationUri"] = o.m_NfStatusNotificationUri;
if(o.reqNfInstanceIdIsSet()) if(o.reqNfInstanceIdIsSet())
j["reqNfInstanceId"] = o.m_ReqNfInstanceId; j["reqNfInstanceId"] = o.m_ReqNfInstanceId;
if(o.subscrCondIsSet()) /* if(o.subscrCondIsSet())
j["subscrCond"] = o.m_SubscrCond; j["subscrCond"] = o.m_SubscrCond;
*/
j["subscriptionId"] = o.m_SubscriptionId; j["subscriptionId"] = o.m_SubscriptionId;
if(o.validityTimeIsSet()) if(o.validityTimeIsSet())
j["validityTime"] = o.m_ValidityTime; j["validityTime"] = o.m_ValidityTime;
...@@ -78,11 +80,13 @@ void from_json(const nlohmann::json& j, SubscriptionData& o) ...@@ -78,11 +80,13 @@ void from_json(const nlohmann::json& j, SubscriptionData& o)
j.at("reqNfInstanceId").get_to(o.m_ReqNfInstanceId); j.at("reqNfInstanceId").get_to(o.m_ReqNfInstanceId);
o.m_ReqNfInstanceIdIsSet = true; o.m_ReqNfInstanceIdIsSet = true;
} }
/*
if(j.find("subscrCond") != j.end()) if(j.find("subscrCond") != j.end())
{ {
j.at("subscrCond").get_to(o.m_SubscrCond); j.at("subscrCond").get_to(o.m_SubscrCond);
o.m_SubscrCondIsSet = true; o.m_SubscrCondIsSet = true;
} }
*/
j.at("subscriptionId").get_to(o.m_SubscriptionId); j.at("subscriptionId").get_to(o.m_SubscriptionId);
if(j.find("validityTime") != j.end()) if(j.find("validityTime") != j.end())
{ {
...@@ -146,15 +150,20 @@ void SubscriptionData::unsetReqNfInstanceId() ...@@ -146,15 +150,20 @@ void SubscriptionData::unsetReqNfInstanceId()
{ {
m_ReqNfInstanceIdIsSet = false; m_ReqNfInstanceIdIsSet = false;
} }
OneOfNfInstanceIdCondNfTypeCondServiceNameCondAmfCondGuamiListCondNetworkSliceCondNfGroupCond SubscriptionData::getSubscrCond() const /*
m_SubscrCond SubscriptionData::getSubscrCond() const
{ {
return m_SubscrCond; return m_SubscrCond;
} }
void SubscriptionData::setSubscrCond(OneOfNfInstanceIdCondNfTypeCondServiceNameCondAmfCondGuamiListCondNetworkSliceCondNfGroupCond const& value) */
/*
void SubscriptionData::setSubscrCond(m_SubscrCond const& value)
{ {
m_SubscrCond = value; m_SubscrCond = value;
m_SubscrCondIsSet = true; m_SubscrCondIsSet = true;
} }
*/
bool SubscriptionData::subscrCondIsSet() const bool SubscriptionData::subscrCondIsSet() const
{ {
return m_SubscrCondIsSet; return m_SubscrCondIsSet;
...@@ -239,11 +248,11 @@ void SubscriptionData::unsetNotifCondition() ...@@ -239,11 +248,11 @@ void SubscriptionData::unsetNotifCondition()
{ {
m_NotifConditionIsSet = false; m_NotifConditionIsSet = false;
} }
NFType SubscriptionData::getReqNfType() const std::string SubscriptionData::getReqNfType() const
{ {
return m_ReqNfType; return m_ReqNfType;
} }
void SubscriptionData::setReqNfType(NFType const& value) void SubscriptionData::setReqNfType(std::string const& value)
{ {
m_ReqNfType = value; m_ReqNfType = value;
m_ReqNfTypeIsSet = true; m_ReqNfTypeIsSet = true;
......
...@@ -19,8 +19,7 @@ ...@@ -19,8 +19,7 @@
#define SubscriptionData_H_ #define SubscriptionData_H_
#include "OneOfNfInstanceIdCondNfTypeCondServiceNameCondAmfCondGuamiListCondNetworkSliceCondNfGroupCond.h" //#include "OneOfNfInstanceIdCondNfTypeCondServiceNameCondAmfCondGuamiListCondNetworkSliceCondNfGroupCond.h"
#include "NFType.h"
#include <string> #include <string>
#include "NotificationEventType.h" #include "NotificationEventType.h"
#include "PlmnId.h" #include "PlmnId.h"
...@@ -29,10 +28,51 @@ ...@@ -29,10 +28,51 @@
#include "NotifCondition.h" #include "NotifCondition.h"
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
#include "NfInstanceIdCond.h"
#include "NfTypeCond.h"
#include "ServiceNameCond.h"
#include "AmfCond.h"
#include "GuamiListCond.h"
#include "NetworkSliceCond.h"
#include "NfGroupCond.h"
namespace oai { namespace oai {
namespace nrf { namespace nrf {
namespace model { namespace model {
typedef struct subscription_condition_s {
uint8_t type;
union {
NfInstanceIdCond nfInstanceIdCond;
NfTypeCond nfTypeCond;
ServiceNameCond serviceNameCond;
AmfCond amfCond;
GuamiListCond guamiListCond;
NetworkSliceCond networkSliceCond;
NfGroupCond nfGroupCond;
};
subscription_condition_s()
: type(0) {
}
subscription_condition_s(uint8_t t)
: type(t) {
}
bool operator==(const struct subscription_condition_s &s) const {
return (s.type == type);
}
//------------------------------------------------------------------------------
bool operator==(const uint8_t &t) const {
return (t == type);
}
virtual ~subscription_condition_s() {};
} subscription_condition_t;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
...@@ -62,8 +102,11 @@ public: ...@@ -62,8 +102,11 @@ public:
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
OneOfNfInstanceIdCondNfTypeCondServiceNameCondAmfCondGuamiListCondNetworkSliceCondNfGroupCond getSubscrCond() const;
void setSubscrCond(OneOfNfInstanceIdCondNfTypeCondServiceNameCondAmfCondGuamiListCondNetworkSliceCondNfGroupCond const& value); //OneOfNfInstanceIdCondNfTypeCondServiceNameCondAmfCondGuamiListCondNetworkSliceCondNfGroupCond getSubscrCond() const;
subscription_condition_t getSubscrCond() const;
void setSubscrCond(subscription_condition_t const& value);
bool subscrCondIsSet() const; bool subscrCondIsSet() const;
void unsetSubscrCond(); void unsetSubscrCond();
/// <summary> /// <summary>
...@@ -102,8 +145,8 @@ public: ...@@ -102,8 +145,8 @@ public:
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
NFType getReqNfType() const; std::string getReqNfType() const;
void setReqNfType(NFType const& value); void setReqNfType(std::string const& value);
bool reqNfTypeIsSet() const; bool reqNfTypeIsSet() const;
void unsetReqNfType(); void unsetReqNfType();
/// <summary> /// <summary>
...@@ -128,7 +171,8 @@ protected: ...@@ -128,7 +171,8 @@ protected:
std::string m_ReqNfInstanceId; std::string m_ReqNfInstanceId;
bool m_ReqNfInstanceIdIsSet; bool m_ReqNfInstanceIdIsSet;
OneOfNfInstanceIdCondNfTypeCondServiceNameCondAmfCondGuamiListCondNetworkSliceCondNfGroupCond m_SubscrCond; //OneOfNfInstanceIdCondNfTypeCondServiceNameCondAmfCondGuamiListCondNetworkSliceCondNfGroupCond m_SubscrCond;
subscription_condition_t m_SubscrCond;
bool m_SubscrCondIsSet; bool m_SubscrCondIsSet;
std::string m_SubscriptionId; std::string m_SubscriptionId;
...@@ -140,7 +184,7 @@ protected: ...@@ -140,7 +184,7 @@ protected:
bool m_PlmnIdIsSet; bool m_PlmnIdIsSet;
NotifCondition m_NotifCondition; NotifCondition m_NotifCondition;
bool m_NotifConditionIsSet; bool m_NotifConditionIsSet;
NFType m_ReqNfType; std::string m_ReqNfType;
bool m_ReqNfTypeIsSet; bool m_ReqNfTypeIsSet;
std::string m_ReqNfFqdn; std::string m_ReqNfFqdn;
bool m_ReqNfFqdnIsSet; bool m_ReqNfFqdnIsSet;
......
/**
* RNI API
* The ETSI MEC ISG MEC012 Radio Network Information API described using OpenAPI
*
* OpenAPI spec version: 1.1.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "nrf-api-server.h"
#include "logger.hpp"
#include "pistache/endpoint.h"
#include "pistache/http.h"
#include "pistache/router.h"
#ifdef __linux__
#include <vector>
#include <signal.h>
#include <unistd.h>
#endif
#define PISTACHE_SERVER_MAX_PAYLOAD 32768
#ifdef __linux__
void sigHandler(int sig) {
switch (sig) {
case SIGINT:
case SIGQUIT:
case SIGTERM:
case SIGHUP:
default:
break;
}
exit(0);
}
void setUpUnixSignals(std::vector<int> quitSignals) {
sigset_t blocking_mask;
sigemptyset(&blocking_mask);
for (auto sig : quitSignals)
sigaddset(&blocking_mask, sig);
struct sigaction sa;
sa.sa_handler = sigHandler;
sa.sa_mask = blocking_mask;
sa.sa_flags = 0;
for (auto sig : quitSignals)
sigaction(sig, &sa, nullptr);
}
#endif
using namespace oai::nrf::api;
void NRFApiServer::init(size_t thr) {
auto opts = Pistache::Http::Endpoint::options().threads(thr);
opts.flags(Pistache::Tcp::Options::ReuseAddr);
opts.maxRequestSize(PISTACHE_SERVER_MAX_PAYLOAD);
m_httpEndpoint->init(opts);
m_completeStoredSearchDocumentApiImpl->init();
m_nfInstancesStoreApiImpl->init();
m_storedSearchDocumentApiImpl->init();
}
void NRFApiServer::start() {
Logger::nrf_sbi().info("HTTP1 server started");
m_httpEndpoint->setHandler(m_router->handler());
m_httpEndpoint->serve();
}
void NRFApiServer::shutdown() {
m_httpEndpoint->shutdown();
}
/**
* RNI API
* The ETSI MEC ISG MEC012 Radio Network Information API described using OpenAPI
*
* OpenAPI spec version: 1.1.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef FILE_NRF_API_SERVER_SEEN
#define FILE_NRF_API_SERVER_SEEN
#include "pistache/endpoint.h"
#include "pistache/http.h"
#include "pistache/router.h"
#ifdef __linux__
#include <vector>
#include <signal.h>
#include <unistd.h>
#endif
#include "CompleteStoredSearchDocumentApiImpl.h"
#include "NFInstancesStoreApiImpl.h"
#include "StoredSearchDocumentApiImpl.h"
#include "nrf_app.hpp"
using namespace oai::nrf::api;
class NRFApiServer {
public:
NRFApiServer(Pistache::Address address, oai::nrf::nrf_app *nrf_app_inst)
:
m_httpEndpoint(std::make_shared<Pistache::Http::Endpoint>(address)) {
m_router = std::make_shared<Pistache::Rest::Router>();
m_address = address.host() + ":" + (address.port()).toString();
m_completeStoredSearchDocumentApiImpl = std::make_shared<
CompleteStoredSearchDocumentApiImpl>(m_router, nrf_app_inst, m_address);
m_nfInstancesStoreApiImpl = std::make_shared<NFInstancesStoreApiImpl>(
m_router, nrf_app_inst, m_address);
m_storedSearchDocumentApiImpl = std::make_shared<
StoredSearchDocumentApiImpl>(m_router, nrf_app_inst, m_address);
}
void init(size_t thr = 1);
void start();
void shutdown();
private:
std::shared_ptr<Pistache::Http::Endpoint> m_httpEndpoint;
std::shared_ptr<Pistache::Rest::Router> m_router;
std::shared_ptr<CompleteStoredSearchDocumentApiImpl> m_completeStoredSearchDocumentApiImpl;
std::shared_ptr<NFInstancesStoreApiImpl> m_nfInstancesStoreApiImpl;
std::shared_ptr<StoredSearchDocumentApiImpl> m_storedSearchDocumentApiImpl;
std::string m_address;
};
#endif
...@@ -20,9 +20,6 @@ ...@@ -20,9 +20,6 @@
################################################################################ ################################################################################
include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/msg)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/nas)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/ngap)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/common/utils) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/common/utils)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
include_directories(${SRC_TOP_DIR}/../build/ext/spdlog/include) include_directories(${SRC_TOP_DIR}/../build/ext/spdlog/include)
......
...@@ -59,15 +59,8 @@ void Logger::_init(const char *app, const bool log_stdout, ...@@ -59,15 +59,8 @@ void Logger::_init(const char *app, const bool log_stdout,
m_itti = new _Logger("itti ", m_sinks, ss.str().c_str()); m_itti = new _Logger("itti ", m_sinks, ss.str().c_str());
m_smf_app = new _Logger("smf_app", m_sinks, ss.str().c_str()); m_smf_app = new _Logger("smf_app", m_sinks, ss.str().c_str());
m_system = new _Logger("system ", m_sinks, ss.str().c_str()); m_system = new _Logger("system ", m_sinks, ss.str().c_str());
m_udp = new _Logger("udp ", m_sinks, ss.str().c_str());
m_pfcp = new _Logger("pfcp ", m_sinks, ss.str().c_str());
m_pfcp_switch = new _Logger("pfcp_sw ", m_sinks, ss.str().c_str());
m_smf_n1 = new _Logger("smf_n1 ", m_sinks, ss.str().c_str());
m_smf_n2 = new _Logger("smf_n2 ", m_sinks, ss.str().c_str());
m_smf_n4 = new _Logger("smf_n4 ", m_sinks, ss.str().c_str());
m_smf_n10 = new _Logger("smf_n10", m_sinks, ss.str().c_str());
m_smf_n11 = new _Logger("smf_n11", m_sinks, ss.str().c_str()); m_smf_n11 = new _Logger("smf_n11", m_sinks, ss.str().c_str());
m_smf_api_server = new _Logger("sbi_srv", m_sinks, ss.str().c_str()); m_nrf_sbi = new _Logger("sbi_srv", m_sinks, ss.str().c_str());
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
......
...@@ -98,33 +98,11 @@ class Logger { ...@@ -98,33 +98,11 @@ class Logger {
static _Logger& system() { static _Logger& system() {
return *singleton().m_system; return *singleton().m_system;
} }
static _Logger& udp() {
return *singleton().m_udp;
}
static _Logger& pfcp() {
return *singleton().m_pfcp;
}
static _Logger& pfcp_switch() {
return *singleton().m_pfcp_switch;
}
static _Logger& smf_n1() {
return *singleton().m_smf_n1;
}
static _Logger& smf_n2() {
return *singleton().m_smf_n2;
}
static _Logger& smf_n4() {
return *singleton().m_smf_n4;
}
static _Logger& smf_n10() {
return *singleton().m_smf_n10;
}
static _Logger& smf_n11() { static _Logger& smf_n11() {
return *singleton().m_smf_n11; return *singleton().m_smf_n11;
} }
static _Logger& smf_api_server() { static _Logger& nrf_sbi() {
return *singleton().m_smf_api_server; return *singleton().m_nrf_sbi;
} }
private: private:
...@@ -150,15 +128,8 @@ class Logger { ...@@ -150,15 +128,8 @@ class Logger {
_Logger *m_itti; _Logger *m_itti;
_Logger *m_smf_app; _Logger *m_smf_app;
_Logger *m_system; _Logger *m_system;
_Logger *m_udp;
_Logger *m_pfcp;
_Logger *m_pfcp_switch;
_Logger *m_smf_n1;
_Logger *m_smf_n2;
_Logger *m_smf_n4;
_Logger *m_smf_n10;
_Logger *m_smf_n11; _Logger *m_smf_n11;
_Logger *m_smf_api_server; _Logger *m_nrf_sbi;
}; };
#endif // __LOGGER_H #endif // __LOGGER_H
...@@ -43,8 +43,8 @@ bool util::get_iface_l2_addr(const std::string &iface, std::string &mac) { ...@@ -43,8 +43,8 @@ bool util::get_iface_l2_addr(const std::string &iface, std::string &mac) {
char wb[32]; char wb[32];
mac_address_in.get(wb, 32); mac_address_in.get(wb, 32);
mac.assign(wb); mac.assign(wb);
Logger::pfcp_switch().error("Found IFace %s MAC %s", iface.c_str(), //Logger::pfcp_switch().error("Found IFace %s MAC %s", iface.c_str(),
mac.c_str()); // mac.c_str());
mac.erase(std::remove(mac.begin(), mac.end(), ':'), mac.end()); mac.erase(std::remove(mac.begin(), mac.end(), ':'), mac.end());
return true; return true;
// ifr = {}; // ifr = {};
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file smf_app.cpp
\brief
\author Lionel GAUTHIER, Tien-Thinh NGUYEN
\company Eurecom
\date 2019
\email: lionel.gauthier@eurecom.fr, tien-thinh.nguyen@eurecom.fr
*/
#include "nrf_app.hpp"
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file smf_app.hpp
\brief
\author Lionel GAUTHIER, Tien-Thinh NGUYEN
\company Eurecom
\date 2019
\email: lionel.gauthier@eurecom.fr, tien-thinh.nguyen@eurecom.fr
*/
#ifndef FILE_NRF_APP_HPP_SEEN
#define FILE_NRF_APP_HPP_SEEN
namespace oai{
namespace nrf {
class nrf_app{
};
}
}
#include "nrf_config.hpp"
#endif /* FILE_SMF_APP_HPP_SEEN */
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
using namespace std; using namespace std;
//using namespace libconfig; //using namespace libconfig;
using namespace nrf; using namespace oai::nrf;
//extern smf_config smf_cfg; //extern smf_config smf_cfg;
......
...@@ -39,8 +39,10 @@ ...@@ -39,8 +39,10 @@
#include <vector> #include <vector>
//#include "thread_sched.hpp" //#include "thread_sched.hpp"
namespace oai{
namespace nrf {
} // namespace nrf
namespace nrf {} // namespace nrf }
#endif /* FILE_NRF_CONFIG_HPP_SEEN */ #endif /* FILE_NRF_CONFIG_HPP_SEEN */
...@@ -314,5 +314,5 @@ IF(STATIC_LINKING) ...@@ -314,5 +314,5 @@ IF(STATIC_LINKING)
ENDIF(STATIC_LINKING) ENDIF(STATIC_LINKING)
target_link_libraries (nrf ${ASAN} target_link_libraries (nrf ${ASAN}
-Wl,--start-group NRF 3GPP_COMMON_TYPES CN_UTILS -lnettle ${NETTLE_LIBRARIES} ${CRYPTO_LIBRARIES} -lnghttp2_asio -lboost_system -lboost_thread -lssl -lcrypto gflags glog dl double-conversion folly -Wl,--end-group pthread m rt config++ event boost_system pistache curl) -Wl,--start-group NRF 3GPP_COMMON_TYPES NRF_API CN_UTILS -lnettle ${NETTLE_LIBRARIES} ${CRYPTO_LIBRARIES} -lnghttp2_asio -lboost_system -lboost_thread -lssl -lcrypto gflags glog dl double-conversion folly -Wl,--end-group pthread m rt config++ event boost_system pistache curl)
\ No newline at end of file
...@@ -31,7 +31,9 @@ ...@@ -31,7 +31,9 @@
#include <stdlib.h> // srand #include <stdlib.h> // srand
#include <unistd.h> // get_pid(), pause() #include <unistd.h> // get_pid(), pause()
//using namespace smf; #include "logger.hpp"
//using namespace nrf;
//using namespace util; //using namespace util;
using namespace std; using namespace std;
//using namespace oai::smf_server::api; //using namespace oai::smf_server::api;
...@@ -94,9 +96,9 @@ int main(int argc, char **argv) ...@@ -94,9 +96,9 @@ int main(int argc, char **argv)
} }
// Logger // Logger
// Logger::init( "smf" , Options::getlogStdout() , Options::getlogRotFilelog()); Logger::init( "smf" , Options::getlogStdout() , Options::getlogRotFilelog());
// Logger::smf_app().startup( "Options parsed" ); Logger::smf_app().startup( "Options parsed" );
struct sigaction sigIntHandler; struct sigaction sigIntHandler;
sigIntHandler.sa_handler = my_app_signal_handler; sigIntHandler.sa_handler = my_app_signal_handler;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment