Commit 74893fdc authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Merge branch 'smf_service_subscribe_notify' into 'develop'

Smf service subscribe notify

See merge request oai/cn5g/oai-cn5g-smf!34
parents 2953cfcc 63c7aca6
......@@ -55,7 +55,7 @@ AlwaysBreakAfterReturnType: None
IndentWrappedFunctionNames: false
# template style
AlwaysBreakTemplateDeclarations: Yes
#AlwaysBreakTemplateDeclarations: Yes
# preprocessor style
IndentPPDirectives: None
......@@ -79,9 +79,9 @@ UseTab: Never
SpaceAfterCStyleCast: true
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeInheritanceColon: true
#SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
#SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
......@@ -92,7 +92,7 @@ SpacesInSquareBrackets: false
# class style
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
#BreakInheritanceList: BeforeColon
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
......@@ -115,3 +115,4 @@ SortUsingDeclarations: true
# PenaltyBreakTemplateDeclaration (unsigned)
# PenaltyExcessCharacter (unsigned)
# PenaltyReturnTypeOnItsOwnLine (unsigned)
......@@ -87,25 +87,61 @@ void IndividualSMContextApi::setupRoutes() {
void IndividualSMContextApi::release_sm_context_handler(
const Pistache::Rest::Request &request,
Pistache::Http::ResponseWriter response) {
// Getting the path params
auto smContextRef = request.param(":smContextRef").as<std::string>();
// Getting the body param
Logger::smf_api_server().debug("");
Logger::smf_api_server().info(
"Received a SM context Release request from AMF.");
Logger::smf_api_server().debug("Request body: %s\n", request.body().c_str());
SmContextReleaseMessage smContextReleaseMessage = { };
//simple parser
mime_parser sp = { };
sp.parse(request.body());
SmContextReleaseData smContextReleaseData;
std::vector<mime_part> parts = { };
sp.get_mime_parts(parts);
uint8_t size = parts.size();
Logger::smf_api_server().debug("Number of MIME parts %d", size);
// Getting the body param
SmContextReleaseData smContextReleaseData = { };
try {
nlohmann::json::parse(request.body()).get_to(smContextReleaseData);
this->release_sm_context(smContextRef, smContextReleaseData, response);
if (size > 0) {
nlohmann::json::parse(parts[0].body.c_str()).get_to(smContextReleaseData);
} else {
nlohmann::json::parse(request.body().c_str()).get_to(
smContextReleaseData);
}
smContextReleaseMessage.setJsonData(smContextReleaseData);
for (int i = 1; i < size; i++) {
if (parts[i].content_type.compare("application/vnd.3gpp.ngap") == 0) {
smContextReleaseMessage.setBinaryDataN2SmInformation(parts[i].body);
Logger::smf_api_server().debug("N2 SM information is set");
}
}
// Getting the path params
auto smContextRef = request.param(":smContextRef").as<std::string>();
this->release_sm_context(smContextRef, smContextReleaseMessage, response);
} catch (nlohmann::detail::exception &e) {
//send a 400 error
Logger::smf_api_server().warn(
"Error in parsing json (error: %s), send a msg with a 400 error code to AMF",
e.what());
response.send(Pistache::Http::Code::Bad_Request, e.what());
return;
} catch (std::exception &e) {
//send a 500 error
Logger::smf_api_server().warn(
"Error (%s ), send a msg with a 500 error code to AMF", e.what());
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
return;
}
}
void IndividualSMContextApi::retrieve_sm_context_handler(
......
......@@ -98,7 +98,7 @@ class IndividualSMContextApi {
/// <param name="smContextReleaseData">representation of the data to be sent to the SMF when releasing the SM context (optional)</param>
virtual void release_sm_context(
const std::string &smContextRef,
const SmContextReleaseData &smContextReleaseData,
const SmContextReleaseMessage &smContextReleaseMessage,
Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
......
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "IndividualSubscriptionDocumentApi.h"
#include "Helpers.h"
#include "smf_config.hpp"
extern smf::smf_config smf_cfg;
namespace oai {
namespace smf_server {
namespace api {
using namespace oai::smf_server::helpers;
using namespace oai::smf_server::model;
IndividualSubscriptionDocumentApi::IndividualSubscriptionDocumentApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
}
void IndividualSubscriptionDocumentApi::init() {
setupRoutes();
}
void IndividualSubscriptionDocumentApi::setupRoutes() {
using namespace Pistache::Rest;
Routes::Delete(*router, base + smf_cfg.sbi_api_version + "/subscriptions/:subId", Routes::bind(&IndividualSubscriptionDocumentApi::delete_individual_subcription_handler, this));
Routes::Get(*router, base + smf_cfg.sbi_api_version + "/subscriptions/:subId", Routes::bind(&IndividualSubscriptionDocumentApi::get_individual_subcription_handler, this));
Routes::Put(*router, base + smf_cfg.sbi_api_version + "/subscriptions/:subId", Routes::bind(&IndividualSubscriptionDocumentApi::replace_individual_subcription_handler, this));
// Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(&IndividualSubscriptionDocumentApi::individual_subscription_document_api_default_handler, this));
}
void IndividualSubscriptionDocumentApi::delete_individual_subcription_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the path params
auto subId = request.param(":subId").as<std::string>();
try {
this->delete_individual_subcription(subId, response);
} catch (nlohmann::detail::exception &e) {
//send a 400 error
response.send(Pistache::Http::Code::Bad_Request, e.what());
return;
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
//send a 500 error
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
return;
}
}
void IndividualSubscriptionDocumentApi::get_individual_subcription_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the path params
auto subId = request.param(":subId").as<std::string>();
try {
this->get_individual_subcription(subId, response);
} catch (nlohmann::detail::exception &e) {
//send a 400 error
response.send(Pistache::Http::Code::Bad_Request, e.what());
return;
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
//send a 500 error
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
return;
}
}
void IndividualSubscriptionDocumentApi::replace_individual_subcription_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the path params
auto subId = request.param(":subId").as<std::string>();
// Getting the body param
NsmfEventExposure nsmfEventExposure;
try {
nlohmann::json::parse(request.body()).get_to(nsmfEventExposure);
this->replace_individual_subcription(subId, nsmfEventExposure, response);
} catch (nlohmann::detail::exception &e) {
//send a 400 error
response.send(Pistache::Http::Code::Bad_Request, e.what());
return;
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
//send a 500 error
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
return;
}
}
void IndividualSubscriptionDocumentApi::individual_subscription_document_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist");
}
}
}
}
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* IndividualSubscriptionDocumentApi.h
*
*
*/
#ifndef IndividualSubscriptionDocumentApi_H_
#define IndividualSubscriptionDocumentApi_H_
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include "NsmfEventExposure.h"
#include "ProblemDetails.h"
#include <string>
namespace oai {
namespace smf_server {
namespace api {
using namespace oai::smf_server::model;
class IndividualSubscriptionDocumentApi {
public:
IndividualSubscriptionDocumentApi(std::shared_ptr<Pistache::Rest::Router>);
virtual ~IndividualSubscriptionDocumentApi() {}
void init();
const std::string base = "/nsmf_event-exposure/";
private:
void setupRoutes();
void delete_individual_subcription_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void get_individual_subcription_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void replace_individual_subcription_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void individual_subscription_document_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// Delete an individual subscription for event notifications from the SMF
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="subId">Event Subscription ID</param>
virtual void delete_individual_subcription(const std::string &subId, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Read an individual subscription for event notifications from the SMF
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="subId">Event Subscription ID</param>
virtual void get_individual_subcription(const std::string &subId, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Replace an individual subscription for event notifications from the SMF
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="subId">Event Subscription ID</param>
/// <param name="nsmfEventExposure"></param>
virtual void replace_individual_subcription(const std::string &subId, const NsmfEventExposure &nsmfEventExposure, Pistache::Http::ResponseWriter &response) = 0;
};
}
}
}
#endif /* IndividualSubscriptionDocumentApi_H_ */
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "SubscriptionsCollectionApi.h"
#include "Helpers.h"
#include "smf_config.hpp"
extern smf::smf_config smf_cfg;
namespace oai {
namespace smf_server {
namespace api {
using namespace oai::smf_server::helpers;
using namespace oai::smf_server::model;
SubscriptionsCollectionApi::SubscriptionsCollectionApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
}
void SubscriptionsCollectionApi::init() {
setupRoutes();
}
void SubscriptionsCollectionApi::setupRoutes() {
using namespace Pistache::Rest;
Routes::Post(*router, base + smf_cfg.sbi_api_version + "/subscriptions", Routes::bind(&SubscriptionsCollectionApi::create_individual_subcription_handler, this));
// Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(&SubscriptionsCollectionApi::subscriptions_collection_api_default_handler, this));
}
void SubscriptionsCollectionApi::create_individual_subcription_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the body param
NsmfEventExposure nsmfEventExposure;
try {
nlohmann::json::parse(request.body()).get_to(nsmfEventExposure);
this->create_individual_subcription(nsmfEventExposure, response);
} catch (nlohmann::detail::exception &e) {
//send a 400 error
response.send(Pistache::Http::Code::Bad_Request, e.what());
return;
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
//send a 500 error
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
return;
}
}
void SubscriptionsCollectionApi::subscriptions_collection_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist");
}
}
}
}
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* SubscriptionsCollectionApi.h
*
*
*/
#ifndef SubscriptionsCollectionApi_H_
#define SubscriptionsCollectionApi_H_
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include "NsmfEventExposure.h"
#include "ProblemDetails.h"
namespace oai {
namespace smf_server {
namespace api {
using namespace oai::smf_server::model;
class SubscriptionsCollectionApi {
public:
SubscriptionsCollectionApi(std::shared_ptr<Pistache::Rest::Router>);
virtual ~SubscriptionsCollectionApi() {}
void init();
const std::string base = "/nsmf_event-exposure/";
private:
void setupRoutes();
void create_individual_subcription_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void subscriptions_collection_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// Create an individual subscription for event notifications from the SMF
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="nsmfEventExposure"></param>
virtual void create_individual_subcription(const NsmfEventExposure &nsmfEventExposure, Pistache::Http::ResponseWriter &response) = 0;
};
}
}
}
#endif /* SubscriptionsCollectionApi_H_ */
......@@ -52,13 +52,41 @@ IndividualSMContextApiImpl::IndividualSMContextApiImpl(
void IndividualSMContextApiImpl::release_sm_context(
const std::string &smContextRef,
const SmContextReleaseData &smContextReleaseData,
const SmContextReleaseMessage &smContextReleaseMessage,
Pistache::Http::ResponseWriter &response) {
//TODO: to be updated as update_sm_context_handler
Logger::smf_api_server().info("release_sm_context...");
//Get the SmContextReleaseData from this message and process in smf_app
Logger::smf_api_server().info(
"Received a PDUSession_ReleaseSMContext Request from AMF.");
smf::pdu_session_release_sm_context_request sm_context_req_msg = { };
SmContextReleaseData smContextReleaseData = smContextReleaseMessage
.getJsonData();
if (smContextReleaseData.n2SmInfoIsSet()) {
//N2 SM (for Session establishment)
std::string n2_sm_information = smContextReleaseMessage
.getBinaryDataN2SmInformation();
Logger::smf_api_server().debug("N2 SM Information %s",
n2_sm_information.c_str());
std::string n2_sm_info_type = smContextReleaseData.getN2SmInfoType();
sm_context_req_msg.set_n2_sm_information(n2_sm_information);
sm_context_req_msg.set_n2_sm_info_type(n2_sm_info_type);
}
//Step 2. TODO: initialize necessary values for sm context req from smContextReleaseData
// cause:
// ngApCause:
// 5gMmCauseValue:
// ueLocation:
//ueTimeZone:
//addUeLocation:
//vsmfReleaseOnly:
//ismfReleaseOnly:
boost::shared_ptr<boost::promise<smf::pdu_session_release_sm_context_response> > p =
boost::shared_ptr
< boost::promise<smf::pdu_session_release_sm_context_response> > p =
boost::make_shared<
boost::promise<smf::pdu_session_release_sm_context_response> >();
boost::shared_future<smf::pdu_session_release_sm_context_response> f;
......@@ -69,16 +97,11 @@ void IndividualSMContextApiImpl::release_sm_context(
Logger::smf_api_server().debug("Promise ID generated %d", promise_id);
m_smf_app->add_promise(promise_id, p);
//handle Nsmf_PDUSession_UpdateSMContext Request
Logger::smf_api_server().info(
"Received a PDUSession_ReleaseSMContext Request: PDU Session Release request from AMF.");
//Step 3. Handle the itti_n11_release_sm_context_request message in smf_app
std::shared_ptr<itti_n11_release_sm_context_request> itti_msg =
std::make_shared<itti_n11_release_sm_context_request>(TASK_SMF_N11,
TASK_SMF_APP,
promise_id,
smContextRef);
itti_msg->scid = smContextRef;
std::make_shared < itti_n11_release_sm_context_request
> (TASK_SMF_N11, TASK_SMF_APP, promise_id, smContextRef);
itti_msg->req = sm_context_req_msg;
itti_msg->http_version = 1;
m_smf_app->handle_pdu_session_release_sm_context_request(itti_msg);
......@@ -86,7 +109,9 @@ void IndividualSMContextApiImpl::release_sm_context(
smf::pdu_session_release_sm_context_response sm_context_response = f.get();
Logger::smf_api_server().debug("Got result for promise ID %d", promise_id);
//TODO: process the response
response.send(Pistache::Http::Code(sm_context_response.get_http_code()));
}
void IndividualSMContextApiImpl::retrieve_sm_context(
......@@ -121,7 +146,8 @@ void IndividualSMContextApiImpl::update_sm_context(
sm_context_req_msg.set_n2_sm_information(n2_sm_information);
sm_context_req_msg.set_n2_sm_info_type(n2_sm_info_type);
} else if (smContextUpdateData.n1SmMsgIsSet()) {
}
if (smContextUpdateData.n1SmMsgIsSet()) {
//N1 SM (for session modification)
std::string n1_sm_message =
smContextUpdateMessage.getBinaryDataN1SmMessage();
......@@ -191,7 +217,9 @@ void IndividualSMContextApiImpl::update_sm_context(
nlohmann::json json_data = { };
mime_parser parser = { };
std::string body = { };
std::string json_format;
sm_context_response.get_json_format(json_format);
sm_context_response.get_json_data(json_data);
Logger::smf_api_server().debug("Json data %s", json_data.dump().c_str());
......@@ -200,7 +228,8 @@ void IndividualSMContextApiImpl::update_sm_context(
parser.create_multipart_related_content(
body, json_data.dump(), CURL_MIME_BOUNDARY,
sm_context_response.get_n1_sm_message(),
sm_context_response.get_n2_sm_information());
sm_context_response.get_n2_sm_information(),
json_format);
response.headers().add<Pistache::Http::Header::ContentType>(
Pistache::Http::Mime::MediaType(
"multipart/related; boundary=" + std::string(CURL_MIME_BOUNDARY)));
......@@ -208,7 +237,8 @@ void IndividualSMContextApiImpl::update_sm_context(
parser.create_multipart_related_content(
body, json_data.dump(), CURL_MIME_BOUNDARY,
sm_context_response.get_n1_sm_message(),
multipart_related_content_part_e::NAS);
multipart_related_content_part_e::NAS,
json_format);
response.headers().add<Pistache::Http::Header::ContentType>(
Pistache::Http::Mime::MediaType(
"multipart/related; boundary=" + std::string(CURL_MIME_BOUNDARY)));
......@@ -216,13 +246,14 @@ void IndividualSMContextApiImpl::update_sm_context(
parser.create_multipart_related_content(
body, json_data.dump(), CURL_MIME_BOUNDARY,
sm_context_response.get_n2_sm_information(),
multipart_related_content_part_e::NGAP);
multipart_related_content_part_e::NGAP,
json_format);
response.headers().add<Pistache::Http::Header::ContentType>(
Pistache::Http::Mime::MediaType(
"multipart/related; boundary=" + std::string(CURL_MIME_BOUNDARY)));
} else if (json_data.size() > 0 ){
response.headers().add<Pistache::Http::Header::ContentType>(
Pistache::Http::Mime::MediaType("application/json"));
Pistache::Http::Mime::MediaType(json_format));
body = json_data.dump().c_str();
} else {
response.send(Pistache::Http::Code(sm_context_response.get_http_code()));
......
......@@ -76,7 +76,7 @@ class IndividualSMContextApiImpl :
void release_sm_context(
const std::string &smContextRef,
const SmContextReleaseData &smContextReleaseData,
const SmContextReleaseMessage &smContextReleaseMessage,
Pistache::Http::ResponseWriter &response);
void retrieve_sm_context(const std::string &smContextRef,
const SmContextRetrieveData &smContextRetrieveData,
......
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "IndividualSubscriptionDocumentApiImpl.h"
namespace oai {
namespace smf_server {
namespace api {
using namespace oai::smf_server::model;
IndividualSubscriptionDocumentApiImpl::IndividualSubscriptionDocumentApiImpl(
std::shared_ptr<Pistache::Rest::Router> rtr, smf::smf_app *smf_app_inst,
std::string address)
:
IndividualSubscriptionDocumentApi(rtr),
m_smf_app(smf_app_inst),
m_address(address) {
}
void IndividualSubscriptionDocumentApiImpl::delete_individual_subcription(const std::string &subId, Pistache::Http::ResponseWriter &response) {
Logger::smf_api_server().info("IndividualSubscriptionDocumentApiImpl::delete_individual_subcription...");
response.send(Pistache::Http::Code::Not_Implemented,
"delete_individual_subcription API has not been implemented yet!\n");
}
void IndividualSubscriptionDocumentApiImpl::get_individual_subcription(const std::string &subId, Pistache::Http::ResponseWriter &response) {
Logger::smf_api_server().info("IndividualSubscriptionDocumentApiImpl::get_individual_subcription...");
response.send(Pistache::Http::Code::Not_Implemented,
"get_individual_subcription API has not been implemented yet!\n");
}
void IndividualSubscriptionDocumentApiImpl::replace_individual_subcription(const std::string &subId, const NsmfEventExposure &nsmfEventExposure, Pistache::Http::ResponseWriter &response) {
Logger::smf_api_server().info("IndividualSubscriptionDocumentApiImpl::replace_individual_subcription...");
response.send(Pistache::Http::Code::Not_Implemented,
"replace_individual_subcription API has not been implemented yet!\n");
}
}
}
}
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* IndividualSubscriptionDocumentApiImpl.h
*
*
*/
#ifndef INDIVIDUAL_SUBSCRIPTION_DOCUMENT_API_IMPL_H_
#define INDIVIDUAL_SUBSCRIPTION_DOCUMENT_API_IMPL_H_
#include <pistache/endpoint.h>
#include <pistache/http.h>
#include <pistache/router.h>
#include <memory>
#include <IndividualSubscriptionDocumentApi.h>
#include <pistache/optional.h>
#include "NsmfEventExposure.h"
#include "ProblemDetails.h"
#include "smf_app.hpp"
#include <string>
namespace oai {
namespace smf_server {
namespace api {
using namespace oai::smf_server::model;
class IndividualSubscriptionDocumentApiImpl : public oai::smf_server::api::IndividualSubscriptionDocumentApi {
public:
IndividualSubscriptionDocumentApiImpl(std::shared_ptr<Pistache::Rest::Router>,
smf::smf_app *smf_app_inst, std::string address);
~IndividualSubscriptionDocumentApiImpl() {}
void delete_individual_subcription(const std::string &subId, Pistache::Http::ResponseWriter &response);
void get_individual_subcription(const std::string &subId, Pistache::Http::ResponseWriter &response);
void replace_individual_subcription(const std::string &subId, const NsmfEventExposure &nsmfEventExposure, Pistache::Http::ResponseWriter &response);
private:
smf::smf_app *m_smf_app;
std::string m_address;
};
}
}
}
#endif
......@@ -132,6 +132,7 @@ void SMContextsCollectionApiImpl::post_sm_contexts(
//anType
//UETimeZone
//SMContextStatusUri
sm_context_req_msg.set_sm_context_status_uri(smContextCreateData.getSmContextStatusUri());
//PCFId
// DNN Selection Mode
......@@ -180,9 +181,11 @@ void SMContextsCollectionApiImpl::post_sm_contexts(
response.headers().add < Pistache::Http::Header::Location
> (sm_context_response.get_smf_context_uri()); //Location header
sm_context_response.get_json_data(json_data);
std::string json_format;
sm_context_response.get_json_format(json_format);
if (!json_data.empty()) {
response.headers().add < Pistache::Http::Header::ContentType
> (Pistache::Http::Mime::MediaType("application/json"));
> (Pistache::Http::Mime::MediaType(json_format));
response.send(Pistache::Http::Code(sm_context_response.get_http_code()),
json_data.dump().c_str());
} else {
......
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "SubscriptionsCollectionApiImpl.h"
#include "logger.hpp"
#include "smf_msg.hpp"
#include "3gpp_29.508.h"
#include "itti_msg_sbi.hpp"
#include "smf_config.hpp"
extern smf::smf_config smf_cfg;
namespace oai {
namespace smf_server {
namespace api {
using namespace oai::smf_server::model;
SubscriptionsCollectionApiImpl::SubscriptionsCollectionApiImpl(
std::shared_ptr<Pistache::Rest::Router> rtr, smf::smf_app *smf_app_inst,
std::string address)
:
SubscriptionsCollectionApi(rtr),
m_smf_app(smf_app_inst),
m_address(address) {
}
void SubscriptionsCollectionApiImpl::create_individual_subcription(
const NsmfEventExposure &nsmfEventExposure,
Pistache::Http::ResponseWriter &response) {
Logger::smf_api_server().info(
"SubscriptionsCollectionApiImpl::create_individual_subcription...");
//Step1. Create a message and store the necessary information
Logger::smf_api_server().debug(
"Create a Event Exposure message and store the necessary information");
smf::event_exposure_msg event_exposure = { };
//Supi
if (nsmfEventExposure.supiIsSet()) {
supi_t supi = { .length = 0 };
std::size_t pos = nsmfEventExposure.getSupi().find("-");
std::string supi_str = nsmfEventExposure.getSupi().substr(pos + 1);
std::string supi_prefix = nsmfEventExposure.getSupi().substr(0, pos);
smf_string_to_supi(&supi, supi_str.c_str());
event_exposure.set_supi(supi);
event_exposure.set_supi_prefix(supi_prefix);
Logger::smf_api_server().debug("SUPI %s, SUPI Prefix %s, IMSI %s",
nsmfEventExposure.getSupi().c_str(),
supi_prefix.c_str(), supi_str.c_str());
}
//PDU session ID
if (nsmfEventExposure.pduSeIdIsSet()) {
Logger::smf_api_server().debug("PDU Session ID %d",
nsmfEventExposure.getPduSeId());
event_exposure.set_pdu_session_id(nsmfEventExposure.getPduSeId());
}
event_exposure.set_notif_id(nsmfEventExposure.getNotifId()); //NotifId
event_exposure.set_notif_uri(nsmfEventExposure.getNotifUri()); //NotifUri
//EventSubscription: TODO
event_subscription_t event_subscription = { };
event_subscription.smf_event = smf_event_t::SMF_EVENT_PDU_SES_REL;
std::vector<event_subscription_t> event_subscriptions = { };
event_subscriptions.push_back(event_subscription);
event_exposure.set_event_subs(event_subscriptions);
//std::vector<EventSubscription> eventSubscriptions;
//for (auto it: nsmfEventExposure.getEventSubs()){
//event_subscription.smf_event = it.getEvent();
//getDnaiChgType
//event_subscriptions.push_back(event_subscription);
//}
//Step 2. Handle the message in smf_app
std::shared_ptr<itti_sbi_event_exposure_request> itti_msg = std::make_shared
< itti_sbi_event_exposure_request > (TASK_SMF_N11, TASK_SMF_APP);
itti_msg->event_exposure = event_exposure;
itti_msg->http_version = 1;
evsub_id_t sub_id = m_smf_app->handle_event_exposure_subscription(itti_msg);
//send response
nlohmann::json json_data = { };
to_json(json_data, nsmfEventExposure);
if (sub_id != -1) {
json_data["subId"] = std::to_string(sub_id);
response.headers().add < Pistache::Http::Header::Location
> (m_address + base + smf_cfg.sbi_api_version + "/nsmf_event-exposure/"
+ std::to_string(sub_id)); //Location header
}
response.headers().add < Pistache::Http::Header::ContentType
> (Pistache::Http::Mime::MediaType("application/json"));
response.send(Pistache::Http::Code(201), json_data.dump().c_str());
}
}
}
}
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* SubscriptionsCollectionApiImpl.h
*
*
*/
#ifndef SUBSCRIPTIONS_COLLECTION_API_IMPL_H_
#define SUBSCRIPTIONS_COLLECTION_API_IMPL_H_
#include <pistache/endpoint.h>
#include <pistache/http.h>
#include <pistache/router.h>
#include <memory>
#include <SubscriptionsCollectionApi.h>
#include <pistache/optional.h>
#include "NsmfEventExposure.h"
#include "ProblemDetails.h"
#include "smf_app.hpp"
namespace oai {
namespace smf_server {
namespace api {
using namespace oai::smf_server::model;
class SubscriptionsCollectionApiImpl : public oai::smf_server::api::SubscriptionsCollectionApi {
public:
SubscriptionsCollectionApiImpl(std::shared_ptr<Pistache::Rest::Router>,
smf::smf_app *smf_app_inst, std::string address);
~SubscriptionsCollectionApiImpl() {}
void create_individual_subcription(const NsmfEventExposure &nsmfEventExposure, Pistache::Http::ResponseWriter &response);
private:
smf::smf_app *m_smf_app;
std::string m_address;
protected:
static uint64_t generate_promise_id() {
return util::uint_uid_generator<uint64_t>::get_instance().get_uid();
}
};
}
}
}
#endif
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "DddStatus.h"
namespace oai {
namespace smf_server {
namespace model {
DddStatus::DddStatus()
{
}
DddStatus::~DddStatus()
{
}
void DddStatus::validate()
{
// TODO: implement validation
}
void to_json(nlohmann::json& j, const DddStatus& o)
{
j = nlohmann::json();
}
void from_json(const nlohmann::json& j, DddStatus& o)
{
}
}
}
}
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* DddStatus.h
*
* Possible values are - BUFFERED: The downlink data are buffered. - TRANSMITTED: The downlink data are transmitted - DISCARDED: The downlink data are discarded.
*/
#ifndef DddStatus_H_
#define DddStatus_H_
#include <nlohmann/json.hpp>
namespace oai {
namespace smf_server {
namespace model {
/// <summary>
/// Possible values are - BUFFERED: The downlink data are buffered. - TRANSMITTED: The downlink data are transmitted - DISCARDED: The downlink data are discarded.
/// </summary>
class DddStatus
{
public:
DddStatus();
virtual ~DddStatus();
void validate();
/////////////////////////////////////////////
/// DddStatus members
friend void to_json(nlohmann::json& j, const DddStatus& o);
friend void from_json(const nlohmann::json& j, DddStatus& o);
protected:
};
}
}
}
#endif /* DddStatus_H_ */
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "DddTrafficDescriptor.h"
namespace oai {
namespace smf_server {
namespace model {
DddTrafficDescriptor::DddTrafficDescriptor()
{
m_Ipv4Addr = "";
m_Ipv4AddrIsSet = false;
m_Ipv6AddrIsSet = false;
m_Port = 0;
m_PortIsSet = false;
}
DddTrafficDescriptor::~DddTrafficDescriptor()
{
}
void DddTrafficDescriptor::validate()
{
// TODO: implement validation
}
void to_json(nlohmann::json& j, const DddTrafficDescriptor& o)
{
j = nlohmann::json();
if(o.ipv4AddrIsSet())
j["ipv4Addr"] = o.m_Ipv4Addr;
if(o.ipv6AddrIsSet())
j["ipv6Addr"] = o.m_Ipv6Addr;
if(o.portIsSet())
j["port"] = o.m_Port;
}
void from_json(const nlohmann::json& j, DddTrafficDescriptor& o)
{
if(j.find("ipv4Addr") != j.end())
{
j.at("ipv4Addr").get_to(o.m_Ipv4Addr);
o.m_Ipv4AddrIsSet = true;
}
if(j.find("ipv6Addr") != j.end())
{
j.at("ipv6Addr").get_to(o.m_Ipv6Addr);
o.m_Ipv6AddrIsSet = true;
}
if(j.find("port") != j.end())
{
j.at("port").get_to(o.m_Port);
o.m_PortIsSet = true;
}
}
std::string DddTrafficDescriptor::getIpv4Addr() const
{
return m_Ipv4Addr;
}
void DddTrafficDescriptor::setIpv4Addr(std::string const& value)
{
m_Ipv4Addr = value;
m_Ipv4AddrIsSet = true;
}
bool DddTrafficDescriptor::ipv4AddrIsSet() const
{
return m_Ipv4AddrIsSet;
}
void DddTrafficDescriptor::unsetIpv4Addr()
{
m_Ipv4AddrIsSet = false;
}
Ipv6Addr DddTrafficDescriptor::getIpv6Addr() const
{
return m_Ipv6Addr;
}
void DddTrafficDescriptor::setIpv6Addr(Ipv6Addr const& value)
{
m_Ipv6Addr = value;
m_Ipv6AddrIsSet = true;
}
bool DddTrafficDescriptor::ipv6AddrIsSet() const
{
return m_Ipv6AddrIsSet;
}
void DddTrafficDescriptor::unsetIpv6Addr()
{
m_Ipv6AddrIsSet = false;
}
int32_t DddTrafficDescriptor::getPort() const
{
return m_Port;
}
void DddTrafficDescriptor::setPort(int32_t const value)
{
m_Port = value;
m_PortIsSet = true;
}
bool DddTrafficDescriptor::portIsSet() const
{
return m_PortIsSet;
}
void DddTrafficDescriptor::unsetPort()
{
m_PortIsSet = false;
}
}
}
}
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* DddTrafficDescriptor.h
*
*
*/
#ifndef DddTrafficDescriptor_H_
#define DddTrafficDescriptor_H_
#include <string>
#include "Ipv6Addr.h"
#include <nlohmann/json.hpp>
namespace oai {
namespace smf_server {
namespace model {
/// <summary>
///
/// </summary>
class DddTrafficDescriptor
{
public:
DddTrafficDescriptor();
virtual ~DddTrafficDescriptor();
void validate();
/////////////////////////////////////////////
/// DddTrafficDescriptor members
/// <summary>
///
/// </summary>
std::string getIpv4Addr() const;
void setIpv4Addr(std::string const& value);
bool ipv4AddrIsSet() const;
void unsetIpv4Addr();
/// <summary>
///
/// </summary>
Ipv6Addr getIpv6Addr() const;
void setIpv6Addr(Ipv6Addr const& value);
bool ipv6AddrIsSet() const;
void unsetIpv6Addr();
/// <summary>
///
/// </summary>
int32_t getPort() const;
void setPort(int32_t const value);
bool portIsSet() const;
void unsetPort();
friend void to_json(nlohmann::json& j, const DddTrafficDescriptor& o);
friend void from_json(const nlohmann::json& j, DddTrafficDescriptor& o);
protected:
std::string m_Ipv4Addr;
bool m_Ipv4AddrIsSet;
Ipv6Addr m_Ipv6Addr;
bool m_Ipv6AddrIsSet;
int32_t m_Port;
bool m_PortIsSet;
};
}
}
}
#endif /* DddTrafficDescriptor_H_ */
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "DnaiChangeType.h"
namespace oai {
namespace smf_server {
namespace model {
DnaiChangeType::DnaiChangeType()
{
}
DnaiChangeType::~DnaiChangeType()
{
}
void DnaiChangeType::validate()
{
// TODO: implement validation
}
void to_json(nlohmann::json& j, const DnaiChangeType& o)
{
j = nlohmann::json();
}
void from_json(const nlohmann::json& j, DnaiChangeType& o)
{
}
}
}
}
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* DnaiChangeType.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 DnaiChangeType_H_
#define DnaiChangeType_H_
#include <nlohmann/json.hpp>
namespace oai {
namespace smf_server {
namespace model {
/// <summary>
/// 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.
/// </summary>
class DnaiChangeType
{
public:
DnaiChangeType();
virtual ~DnaiChangeType();
void validate();
/////////////////////////////////////////////
/// DnaiChangeType members
friend void to_json(nlohmann::json& j, const DnaiChangeType& o);
friend void from_json(const nlohmann::json& j, DnaiChangeType& o);
protected:
};
}
}
}
#endif /* DnaiChangeType_H_ */
This diff is collapsed.
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* EventNotification.h
*
*
*/
#ifndef EventNotification_H_
#define EventNotification_H_
#include "DnaiChangeType.h"
#include "DddStatus.h"
#include <string>
#include "Ipv6Prefix.h"
#include "SmfEvent.h"
#include "PlmnId.h"
#include "RouteToLocation.h"
#include "AccessType.h"
#include <nlohmann/json.hpp>
namespace oai {
namespace smf_server {
namespace model {
/// <summary>
///
/// </summary>
class EventNotification
{
public:
EventNotification();
virtual ~EventNotification();
void validate();
/////////////////////////////////////////////
/// EventNotification members
/// <summary>
///
/// </summary>
SmfEvent getEvent() const;
void setEvent(SmfEvent const& value);
/// <summary>
///
/// </summary>
std::string getTimeStamp() const;
void setTimeStamp(std::string const& value);
/// <summary>
///
/// </summary>
std::string getSupi() const;
void setSupi(std::string const& value);
bool supiIsSet() const;
void unsetSupi();
/// <summary>
///
/// </summary>
std::string getGpsi() const;
void setGpsi(std::string const& value);
bool gpsiIsSet() const;
void unsetGpsi();
/// <summary>
///
/// </summary>
std::string getSourceDnai() const;
void setSourceDnai(std::string const& value);
bool sourceDnaiIsSet() const;
void unsetSourceDnai();
/// <summary>
///
/// </summary>
std::string getTargetDnai() const;
void setTargetDnai(std::string const& value);
bool targetDnaiIsSet() const;
void unsetTargetDnai();
/// <summary>
///
/// </summary>
DnaiChangeType getDnaiChgType() const;
void setDnaiChgType(DnaiChangeType const& value);
bool dnaiChgTypeIsSet() const;
void unsetDnaiChgType();
/// <summary>
///
/// </summary>
std::string getSourceUeIpv4Addr() const;
void setSourceUeIpv4Addr(std::string const& value);
bool sourceUeIpv4AddrIsSet() const;
void unsetSourceUeIpv4Addr();
/// <summary>
///
/// </summary>
Ipv6Prefix getSourceUeIpv6Prefix() const;
void setSourceUeIpv6Prefix(Ipv6Prefix const& value);
bool sourceUeIpv6PrefixIsSet() const;
void unsetSourceUeIpv6Prefix();
/// <summary>
///
/// </summary>
std::string getTargetUeIpv4Addr() const;
void setTargetUeIpv4Addr(std::string const& value);
bool targetUeIpv4AddrIsSet() const;
void unsetTargetUeIpv4Addr();
/// <summary>
///
/// </summary>
Ipv6Prefix getTargetUeIpv6Prefix() const;
void setTargetUeIpv6Prefix(Ipv6Prefix const& value);
bool targetUeIpv6PrefixIsSet() const;
void unsetTargetUeIpv6Prefix();
/// <summary>
///
/// </summary>
RouteToLocation getSourceTraRouting() const;
void setSourceTraRouting(RouteToLocation const& value);
bool sourceTraRoutingIsSet() const;
void unsetSourceTraRouting();
/// <summary>
///
/// </summary>
RouteToLocation getTargetTraRouting() const;
void setTargetTraRouting(RouteToLocation const& value);
bool targetTraRoutingIsSet() const;
void unsetTargetTraRouting();
/// <summary>
///
/// </summary>
std::string getUeMac() const;
void setUeMac(std::string const& value);
bool ueMacIsSet() const;
void unsetUeMac();
/// <summary>
///
/// </summary>
std::string getAdIpv4Addr() const;
void setAdIpv4Addr(std::string const& value);
bool adIpv4AddrIsSet() const;
void unsetAdIpv4Addr();
/// <summary>
///
/// </summary>
Ipv6Prefix getAdIpv6Prefix() const;
void setAdIpv6Prefix(Ipv6Prefix const& value);
bool adIpv6PrefixIsSet() const;
void unsetAdIpv6Prefix();
/// <summary>
///
/// </summary>
std::string getReIpv4Addr() const;
void setReIpv4Addr(std::string const& value);
bool reIpv4AddrIsSet() const;
void unsetReIpv4Addr();
/// <summary>
///
/// </summary>
Ipv6Prefix getReIpv6Prefix() const;
void setReIpv6Prefix(Ipv6Prefix const& value);
bool reIpv6PrefixIsSet() const;
void unsetReIpv6Prefix();
/// <summary>
///
/// </summary>
PlmnId getPlmnId() const;
void setPlmnId(PlmnId const& value);
bool plmnIdIsSet() const;
void unsetPlmnId();
/// <summary>
///
/// </summary>
AccessType getAccType() const;
void setAccType(AccessType const& value);
bool accTypeIsSet() const;
void unsetAccType();
/// <summary>
///
/// </summary>
int32_t getPduSeId() const;
void setPduSeId(int32_t const value);
bool pduSeIdIsSet() const;
void unsetPduSeId();
/// <summary>
///
/// </summary>
DddStatus getDddStatus() const;
void setDddStatus(DddStatus const& value);
bool dddStatusIsSet() const;
void unsetDddStatus();
/// <summary>
///
/// </summary>
std::string getMaxWaitTime() const;
void setMaxWaitTime(std::string const& value);
bool maxWaitTimeIsSet() const;
void unsetMaxWaitTime();
friend void to_json(nlohmann::json& j, const EventNotification& o);
friend void from_json(const nlohmann::json& j, EventNotification& o);
protected:
SmfEvent m_Event;
std::string m_TimeStamp;
std::string m_Supi;
bool m_SupiIsSet;
std::string m_Gpsi;
bool m_GpsiIsSet;
std::string m_SourceDnai;
bool m_SourceDnaiIsSet;
std::string m_TargetDnai;
bool m_TargetDnaiIsSet;
DnaiChangeType m_DnaiChgType;
bool m_DnaiChgTypeIsSet;
std::string m_SourceUeIpv4Addr;
bool m_SourceUeIpv4AddrIsSet;
Ipv6Prefix m_SourceUeIpv6Prefix;
bool m_SourceUeIpv6PrefixIsSet;
std::string m_TargetUeIpv4Addr;
bool m_TargetUeIpv4AddrIsSet;
Ipv6Prefix m_TargetUeIpv6Prefix;
bool m_TargetUeIpv6PrefixIsSet;
RouteToLocation m_SourceTraRouting;
bool m_SourceTraRoutingIsSet;
RouteToLocation m_TargetTraRouting;
bool m_TargetTraRoutingIsSet;
std::string m_UeMac;
bool m_UeMacIsSet;
std::string m_AdIpv4Addr;
bool m_AdIpv4AddrIsSet;
Ipv6Prefix m_AdIpv6Prefix;
bool m_AdIpv6PrefixIsSet;
std::string m_ReIpv4Addr;
bool m_ReIpv4AddrIsSet;
Ipv6Prefix m_ReIpv6Prefix;
bool m_ReIpv6PrefixIsSet;
PlmnId m_PlmnId;
bool m_PlmnIdIsSet;
AccessType m_AccType;
bool m_AccTypeIsSet;
int32_t m_PduSeId;
bool m_PduSeIdIsSet;
DddStatus m_DddStatus;
bool m_DddStatusIsSet;
std::string m_MaxWaitTime;
bool m_MaxWaitTimeIsSet;
};
}
}
}
#endif /* EventNotification_H_ */
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "EventSubscription.h"
namespace oai {
namespace smf_server {
namespace model {
EventSubscription::EventSubscription()
{
m_DnaiChgTypeIsSet = false;
m_DddTraDesIsSet = false;
m_DddStatiIsSet = false;
}
EventSubscription::~EventSubscription()
{
}
void EventSubscription::validate()
{
// TODO: implement validation
}
void to_json(nlohmann::json& j, const EventSubscription& o)
{
j = nlohmann::json();
j["event"] = o.m_Event;
if(o.dnaiChgTypeIsSet())
j["dnaiChgType"] = o.m_DnaiChgType;
if(o.dddTraDesIsSet())
j["dddTraDes"] = o.m_DddTraDes;
if(o.dddStatiIsSet() || !o.m_DddStati.empty())
j["dddStati"] = o.m_DddStati;
}
void from_json(const nlohmann::json& j, EventSubscription& o)
{
j.at("event").get_to(o.m_Event);
if(j.find("dnaiChgType") != j.end())
{
j.at("dnaiChgType").get_to(o.m_DnaiChgType);
o.m_DnaiChgTypeIsSet = true;
}
if(j.find("dddTraDes") != j.end())
{
j.at("dddTraDes").get_to(o.m_DddTraDes);
o.m_DddTraDesIsSet = true;
}
if(j.find("dddStati") != j.end())
{
j.at("dddStati").get_to(o.m_DddStati);
o.m_DddStatiIsSet = true;
}
}
SmfEvent EventSubscription::getEvent() const
{
return m_Event;
}
void EventSubscription::setEvent(SmfEvent const& value)
{
m_Event = value;
}
DnaiChangeType EventSubscription::getDnaiChgType() const
{
return m_DnaiChgType;
}
void EventSubscription::setDnaiChgType(DnaiChangeType const& value)
{
m_DnaiChgType = value;
m_DnaiChgTypeIsSet = true;
}
bool EventSubscription::dnaiChgTypeIsSet() const
{
return m_DnaiChgTypeIsSet;
}
void EventSubscription::unsetDnaiChgType()
{
m_DnaiChgTypeIsSet = false;
}
DddTrafficDescriptor EventSubscription::getDddTraDes() const
{
return m_DddTraDes;
}
void EventSubscription::setDddTraDes(DddTrafficDescriptor const& value)
{
m_DddTraDes = value;
m_DddTraDesIsSet = true;
}
bool EventSubscription::dddTraDesIsSet() const
{
return m_DddTraDesIsSet;
}
void EventSubscription::unsetDddTraDes()
{
m_DddTraDesIsSet = false;
}
std::vector<DddStatus>& EventSubscription::getDddStati()
{
return m_DddStati;
}
void EventSubscription::setDddStati(std::vector<DddStatus> const& value)
{
m_DddStati = value;
m_DddStatiIsSet = true;
}
bool EventSubscription::dddStatiIsSet() const
{
return m_DddStatiIsSet;
}
void EventSubscription::unsetDddStati()
{
m_DddStatiIsSet = false;
}
}
}
}
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* EventSubscription.h
*
*
*/
#ifndef EventSubscription_H_
#define EventSubscription_H_
#include "DnaiChangeType.h"
#include "DddTrafficDescriptor.h"
#include "DddStatus.h"
#include "SmfEvent.h"
#include <vector>
#include <nlohmann/json.hpp>
namespace oai {
namespace smf_server {
namespace model {
/// <summary>
///
/// </summary>
class EventSubscription
{
public:
EventSubscription();
virtual ~EventSubscription();
void validate();
/////////////////////////////////////////////
/// EventSubscription members
/// <summary>
///
/// </summary>
SmfEvent getEvent() const;
void setEvent(SmfEvent const& value);
/// <summary>
///
/// </summary>
DnaiChangeType getDnaiChgType() const;
void setDnaiChgType(DnaiChangeType const& value);
bool dnaiChgTypeIsSet() const;
void unsetDnaiChgType();
/// <summary>
///
/// </summary>
DddTrafficDescriptor getDddTraDes() const;
void setDddTraDes(DddTrafficDescriptor const& value);
bool dddTraDesIsSet() const;
void unsetDddTraDes();
/// <summary>
///
/// </summary>
std::vector<DddStatus>& getDddStati();
void setDddStati(std::vector<DddStatus> const& value);
bool dddStatiIsSet() const;
void unsetDddStati();
friend void to_json(nlohmann::json& j, const EventSubscription& o);
friend void from_json(const nlohmann::json& j, EventSubscription& o);
protected:
SmfEvent m_Event;
DnaiChangeType m_DnaiChgType;
bool m_DnaiChgTypeIsSet;
DddTrafficDescriptor m_DddTraDes;
bool m_DddTraDesIsSet;
std::vector<DddStatus> m_DddStati;
bool m_DddStatiIsSet;
};
}
}
}
#endif /* EventSubscription_H_ */
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Ipv6Addr.h"
namespace oai {
namespace smf_server {
namespace model {
Ipv6Addr::Ipv6Addr()
{
}
Ipv6Addr::~Ipv6Addr()
{
}
void Ipv6Addr::validate()
{
// TODO: implement validation
}
void to_json(nlohmann::json& j, const Ipv6Addr& o)
{
j = nlohmann::json();
}
void from_json(const nlohmann::json& j, Ipv6Addr& o)
{
}
}
}
}
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Ipv6Addr.h
*
*
*/
#ifndef Ipv6Addr_H_
#define Ipv6Addr_H_
#include <nlohmann/json.hpp>
namespace oai {
namespace smf_server {
namespace model {
/// <summary>
///
/// </summary>
class Ipv6Addr
{
public:
Ipv6Addr();
virtual ~Ipv6Addr();
void validate();
/////////////////////////////////////////////
/// Ipv6Addr members
friend void to_json(nlohmann::json& j, const Ipv6Addr& o);
friend void from_json(const nlohmann::json& j, Ipv6Addr& o);
protected:
};
}
}
}
#endif /* Ipv6Addr_H_ */
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Ipv6Prefix.h"
namespace oai {
namespace smf_server {
namespace model {
Ipv6Prefix::Ipv6Prefix()
{
}
Ipv6Prefix::~Ipv6Prefix()
{
}
void Ipv6Prefix::validate()
{
// TODO: implement validation
}
void to_json(nlohmann::json& j, const Ipv6Prefix& o)
{
j = nlohmann::json();
}
void from_json(const nlohmann::json& j, Ipv6Prefix& o)
{
}
}
}
}
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Ipv6Prefix.h
*
*
*/
#ifndef Ipv6Prefix_H_
#define Ipv6Prefix_H_
#include <nlohmann/json.hpp>
namespace oai {
namespace smf_server {
namespace model {
/// <summary>
///
/// </summary>
class Ipv6Prefix
{
public:
Ipv6Prefix();
virtual ~Ipv6Prefix();
void validate();
/////////////////////////////////////////////
/// Ipv6Prefix members
friend void to_json(nlohmann::json& j, const Ipv6Prefix& o);
friend void from_json(const nlohmann::json& j, Ipv6Prefix& o);
protected:
};
}
}
}
#endif /* Ipv6Prefix_H_ */
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "NotificationMethod.h"
namespace oai {
namespace smf_server {
namespace model {
NotificationMethod::NotificationMethod()
{
}
NotificationMethod::~NotificationMethod()
{
}
void NotificationMethod::validate()
{
// TODO: implement validation
}
void to_json(nlohmann::json& j, const NotificationMethod& o)
{
j = nlohmann::json();
}
void from_json(const nlohmann::json& j, NotificationMethod& o)
{
}
}
}
}
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* NotificationMethod.h
*
* Possible values are - PERIODIC - ONE_TIME - ON_EVENT_DETECTION
*/
#ifndef NotificationMethod_H_
#define NotificationMethod_H_
#include <nlohmann/json.hpp>
namespace oai {
namespace smf_server {
namespace model {
/// <summary>
/// Possible values are - PERIODIC - ONE_TIME - ON_EVENT_DETECTION
/// </summary>
class NotificationMethod
{
public:
NotificationMethod();
virtual ~NotificationMethod();
void validate();
/////////////////////////////////////////////
/// NotificationMethod members
friend void to_json(nlohmann::json& j, const NotificationMethod& o);
friend void from_json(const nlohmann::json& j, NotificationMethod& o);
protected:
};
}
}
}
#endif /* NotificationMethod_H_ */
This diff is collapsed.
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* NsmfEventExposure.h
*
*
*/
#ifndef NsmfEventExposure_H_
#define NsmfEventExposure_H_
#include "EventSubscription.h"
#include "NotificationMethod.h"
#include <string>
#include "Ipv6Addr.h"
#include <vector>
#include "Guami.h"
#include <nlohmann/json.hpp>
namespace oai {
namespace smf_server {
namespace model {
/// <summary>
///
/// </summary>
class NsmfEventExposure
{
public:
NsmfEventExposure();
virtual ~NsmfEventExposure();
void validate();
/////////////////////////////////////////////
/// NsmfEventExposure members
/// <summary>
///
/// </summary>
std::string getSupi() const;
void setSupi(std::string const& value);
bool supiIsSet() const;
void unsetSupi();
/// <summary>
///
/// </summary>
std::string getGpsi() const;
void setGpsi(std::string const& value);
bool gpsiIsSet() const;
void unsetGpsi();
/// <summary>
/// Any UE indication. This IE shall be present if the event subscription is applicable to any UE. Default value \&quot;FALSE\&quot; is used, if not present.
/// </summary>
bool isAnyUeInd() const;
void setAnyUeInd(bool const value);
bool anyUeIndIsSet() const;
void unsetAnyUeInd();
/// <summary>
///
/// </summary>
std::string getGroupId() const;
void setGroupId(std::string const& value);
bool groupIdIsSet() const;
void unsetGroupId();
/// <summary>
///
/// </summary>
int32_t getPduSeId() const;
void setPduSeId(int32_t const value);
bool pduSeIdIsSet() const;
void unsetPduSeId();
/// <summary>
/// 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 \&quot;lower-with-hyphen\&quot; naming convention defined in 3GPP TS 29.501 [2]. In an OpenAPI [10] schema, the format shall be designated as \&quot;SubId\&quot;.
/// </summary>
std::string getSubId() const;
void setSubId(std::string const& value);
bool subIdIsSet() const;
void unsetSubId();
/// <summary>
/// Notification Correlation ID assigned by the NF service consumer.
/// </summary>
std::string getNotifId() const;
void setNotifId(std::string const& value);
/// <summary>
///
/// </summary>
std::string getNotifUri() const;
void setNotifUri(std::string const& value);
/// <summary>
/// Alternate or backup IPv4 Addess(es) where to send Notifications.
/// </summary>
std::vector<std::string>& getAltNotifIpv4Addrs();
void setAltNotifIpv4Addrs(std::vector<std::string> const& value);
bool altNotifIpv4AddrsIsSet() const;
void unsetAltNotifIpv4Addrs();
/// <summary>
/// Alternate or backup IPv6 Addess(es) where to send Notifications.
/// </summary>
std::vector<Ipv6Addr>& getAltNotifIpv6Addrs();
void setAltNotifIpv6Addrs(std::vector<Ipv6Addr> const& value);
bool altNotifIpv6AddrsIsSet() const;
void unsetAltNotifIpv6Addrs();
/// <summary>
/// Subscribed events
/// </summary>
std::vector<EventSubscription>& getEventSubs();
void setEventSubs(std::vector<EventSubscription> const& value);
/// <summary>
///
/// </summary>
bool isImmeRep() const;
void setImmeRep(bool const value);
bool immeRepIsSet() const;
void unsetImmeRep();
/// <summary>
///
/// </summary>
NotificationMethod getNotifMethod() const;
void setNotifMethod(NotificationMethod const& value);
bool notifMethodIsSet() const;
void unsetNotifMethod();
/// <summary>
///
/// </summary>
int32_t getMaxReportNbr() const;
void setMaxReportNbr(int32_t const value);
bool maxReportNbrIsSet() const;
void unsetMaxReportNbr();
/// <summary>
///
/// </summary>
std::string getExpiry() const;
void setExpiry(std::string const& value);
bool expiryIsSet() const;
void unsetExpiry();
/// <summary>
///
/// </summary>
int32_t getRepPeriod() const;
void setRepPeriod(int32_t const value);
bool repPeriodIsSet() const;
void unsetRepPeriod();
/// <summary>
///
/// </summary>
Guami getGuami() const;
void setGuami(Guami const& value);
bool guamiIsSet() const;
void unsetGuami();
/// <summary>
/// If the NF service consumer is an AMF, it should provide the name of a service produced by the AMF that makes use of notifications about subscribed events.
/// </summary>
std::string getServiveName() const;
void setServiveName(std::string const& value);
bool serviveNameIsSet() const;
void unsetServiveName();
/// <summary>
///
/// </summary>
std::string getSupportedFeatures() const;
void setSupportedFeatures(std::string const& value);
bool supportedFeaturesIsSet() const;
void unsetSupportedFeatures();
friend void to_json(nlohmann::json& j, const NsmfEventExposure& o);
friend void from_json(const nlohmann::json& j, NsmfEventExposure& o);
protected:
std::string m_Supi;
bool m_SupiIsSet;
std::string m_Gpsi;
bool m_GpsiIsSet;
bool m_AnyUeInd;
bool m_AnyUeIndIsSet;
std::string m_GroupId;
bool m_GroupIdIsSet;
int32_t m_PduSeId;
bool m_PduSeIdIsSet;
std::string m_SubId;
bool m_SubIdIsSet;
std::string m_NotifId;
std::string m_NotifUri;
std::vector<std::string> m_AltNotifIpv4Addrs;
bool m_AltNotifIpv4AddrsIsSet;
std::vector<Ipv6Addr> m_AltNotifIpv6Addrs;
bool m_AltNotifIpv6AddrsIsSet;
std::vector<EventSubscription> m_EventSubs;
bool m_ImmeRep;
bool m_ImmeRepIsSet;
NotificationMethod m_NotifMethod;
bool m_NotifMethodIsSet;
int32_t m_MaxReportNbr;
bool m_MaxReportNbrIsSet;
std::string m_Expiry;
bool m_ExpiryIsSet;
int32_t m_RepPeriod;
bool m_RepPeriodIsSet;
Guami m_Guami;
bool m_GuamiIsSet;
std::string m_ServiveName;
bool m_ServiveNameIsSet;
std::string m_SupportedFeatures;
bool m_SupportedFeaturesIsSet;
};
}
}
}
#endif /* NsmfEventExposure_H_ */
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "NsmfEventExposureNotification.h"
namespace oai {
namespace smf_server {
namespace model {
NsmfEventExposureNotification::NsmfEventExposureNotification()
{
m_NotifId = "";
}
NsmfEventExposureNotification::~NsmfEventExposureNotification()
{
}
void NsmfEventExposureNotification::validate()
{
// TODO: implement validation
}
void to_json(nlohmann::json& j, const NsmfEventExposureNotification& o)
{
j = nlohmann::json();
j["notifId"] = o.m_NotifId;
j["eventNotifs"] = o.m_EventNotifs;
}
void from_json(const nlohmann::json& j, NsmfEventExposureNotification& o)
{
j.at("notifId").get_to(o.m_NotifId);
j.at("eventNotifs").get_to(o.m_EventNotifs);
}
std::string NsmfEventExposureNotification::getNotifId() const
{
return m_NotifId;
}
void NsmfEventExposureNotification::setNotifId(std::string const& value)
{
m_NotifId = value;
}
std::vector<EventNotification>& NsmfEventExposureNotification::getEventNotifs()
{
return m_EventNotifs;
}
void NsmfEventExposureNotification::setEventNotifs(std::vector<EventNotification> const& value)
{
m_EventNotifs = value;
}
}
}
}
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* NsmfEventExposureNotification.h
*
*
*/
#ifndef NsmfEventExposureNotification_H_
#define NsmfEventExposureNotification_H_
#include <string>
#include <vector>
#include "EventNotification.h"
#include <nlohmann/json.hpp>
namespace oai {
namespace smf_server {
namespace model {
/// <summary>
///
/// </summary>
class NsmfEventExposureNotification
{
public:
NsmfEventExposureNotification();
virtual ~NsmfEventExposureNotification();
void validate();
/////////////////////////////////////////////
/// NsmfEventExposureNotification members
/// <summary>
/// Notification correlation ID
/// </summary>
std::string getNotifId() const;
void setNotifId(std::string const& value);
/// <summary>
/// Notifications about Individual Events
/// </summary>
std::vector<EventNotification>& getEventNotifs();
void setEventNotifs(std::vector<EventNotification> const& value);
friend void to_json(nlohmann::json& j, const NsmfEventExposureNotification& o);
friend void from_json(const nlohmann::json& j, NsmfEventExposureNotification& o);
protected:
std::string m_NotifId;
std::vector<EventNotification> m_EventNotifs;
};
}
}
}
#endif /* NsmfEventExposureNotification_H_ */
......@@ -61,7 +61,7 @@ void to_json(nlohmann::json& j, const ProblemDetails& o)
j["instance"] = o.m_Instance;
if(o.causeIsSet())
j["cause"] = o.m_Cause;
if(o.invalidParamsIsSet())
if(o.invalidParamsIsSet() || !o.m_InvalidParams.empty())
j["invalidParams"] = o.m_InvalidParams;
if(o.supportedFeaturesIsSet())
j["supportedFeatures"] = o.m_SupportedFeatures;
......@@ -217,6 +217,11 @@ std::vector<InvalidParam>& ProblemDetails::getInvalidParams()
{
return m_InvalidParams;
}
void ProblemDetails::setInvalidParams(std::vector<InvalidParam> const& value)
{
m_InvalidParams = value;
m_InvalidParamsIsSet = true;
}
bool ProblemDetails::invalidParamsIsSet() const
{
return m_InvalidParamsIsSet;
......
......@@ -88,6 +88,7 @@ public:
///
/// </summary>
std::vector<InvalidParam>& getInvalidParams();
void setInvalidParams(std::vector<InvalidParam> const& value);
bool invalidParamsIsSet() const;
void unsetInvalidParams();
/// <summary>
......
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "RouteInformation.h"
namespace oai {
namespace smf_server {
namespace model {
RouteInformation::RouteInformation()
{
m_Ipv4Addr = "";
m_Ipv4AddrIsSet = false;
m_Ipv6AddrIsSet = false;
m_PortNumber = 0;
}
RouteInformation::~RouteInformation()
{
}
void RouteInformation::validate()
{
// TODO: implement validation
}
void to_json(nlohmann::json& j, const RouteInformation& o)
{
j = nlohmann::json();
if(o.ipv4AddrIsSet())
j["ipv4Addr"] = o.m_Ipv4Addr;
if(o.ipv6AddrIsSet())
j["ipv6Addr"] = o.m_Ipv6Addr;
j["portNumber"] = o.m_PortNumber;
}
void from_json(const nlohmann::json& j, RouteInformation& o)
{
if(j.find("ipv4Addr") != j.end())
{
j.at("ipv4Addr").get_to(o.m_Ipv4Addr);
o.m_Ipv4AddrIsSet = true;
}
if(j.find("ipv6Addr") != j.end())
{
j.at("ipv6Addr").get_to(o.m_Ipv6Addr);
o.m_Ipv6AddrIsSet = true;
}
j.at("portNumber").get_to(o.m_PortNumber);
}
std::string RouteInformation::getIpv4Addr() const
{
return m_Ipv4Addr;
}
void RouteInformation::setIpv4Addr(std::string const& value)
{
m_Ipv4Addr = value;
m_Ipv4AddrIsSet = true;
}
bool RouteInformation::ipv4AddrIsSet() const
{
return m_Ipv4AddrIsSet;
}
void RouteInformation::unsetIpv4Addr()
{
m_Ipv4AddrIsSet = false;
}
Ipv6Addr RouteInformation::getIpv6Addr() const
{
return m_Ipv6Addr;
}
void RouteInformation::setIpv6Addr(Ipv6Addr const& value)
{
m_Ipv6Addr = value;
m_Ipv6AddrIsSet = true;
}
bool RouteInformation::ipv6AddrIsSet() const
{
return m_Ipv6AddrIsSet;
}
void RouteInformation::unsetIpv6Addr()
{
m_Ipv6AddrIsSet = false;
}
int32_t RouteInformation::getPortNumber() const
{
return m_PortNumber;
}
void RouteInformation::setPortNumber(int32_t const value)
{
m_PortNumber = value;
}
}
}
}
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* RouteInformation.h
*
*
*/
#ifndef RouteInformation_H_
#define RouteInformation_H_
#include <string>
#include "Ipv6Addr.h"
#include <nlohmann/json.hpp>
namespace oai {
namespace smf_server {
namespace model {
/// <summary>
///
/// </summary>
class RouteInformation
{
public:
RouteInformation();
virtual ~RouteInformation();
void validate();
/////////////////////////////////////////////
/// RouteInformation members
/// <summary>
///
/// </summary>
std::string getIpv4Addr() const;
void setIpv4Addr(std::string const& value);
bool ipv4AddrIsSet() const;
void unsetIpv4Addr();
/// <summary>
///
/// </summary>
Ipv6Addr getIpv6Addr() const;
void setIpv6Addr(Ipv6Addr const& value);
bool ipv6AddrIsSet() const;
void unsetIpv6Addr();
/// <summary>
///
/// </summary>
int32_t getPortNumber() const;
void setPortNumber(int32_t const value);
friend void to_json(nlohmann::json& j, const RouteInformation& o);
friend void from_json(const nlohmann::json& j, RouteInformation& o);
protected:
std::string m_Ipv4Addr;
bool m_Ipv4AddrIsSet;
Ipv6Addr m_Ipv6Addr;
bool m_Ipv6AddrIsSet;
int32_t m_PortNumber;
};
}
}
}
#endif /* RouteInformation_H_ */
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "RouteToLocation.h"
namespace oai {
namespace smf_server {
namespace model {
RouteToLocation::RouteToLocation()
{
m_Dnai = "";
m_RouteInfoIsSet = false;
m_RouteProfId = "";
m_RouteProfIdIsSet = false;
}
RouteToLocation::~RouteToLocation()
{
}
void RouteToLocation::validate()
{
// TODO: implement validation
}
void to_json(nlohmann::json& j, const RouteToLocation& o)
{
j = nlohmann::json();
j["dnai"] = o.m_Dnai;
if(o.routeInfoIsSet())
j["routeInfo"] = o.m_RouteInfo;
if(o.routeProfIdIsSet())
j["routeProfId"] = o.m_RouteProfId;
}
void from_json(const nlohmann::json& j, RouteToLocation& o)
{
j.at("dnai").get_to(o.m_Dnai);
if(j.find("routeInfo") != j.end())
{
j.at("routeInfo").get_to(o.m_RouteInfo);
o.m_RouteInfoIsSet = true;
}
if(j.find("routeProfId") != j.end())
{
j.at("routeProfId").get_to(o.m_RouteProfId);
o.m_RouteProfIdIsSet = true;
}
}
std::string RouteToLocation::getDnai() const
{
return m_Dnai;
}
void RouteToLocation::setDnai(std::string const& value)
{
m_Dnai = value;
}
RouteInformation RouteToLocation::getRouteInfo() const
{
return m_RouteInfo;
}
void RouteToLocation::setRouteInfo(RouteInformation const& value)
{
m_RouteInfo = value;
m_RouteInfoIsSet = true;
}
bool RouteToLocation::routeInfoIsSet() const
{
return m_RouteInfoIsSet;
}
void RouteToLocation::unsetRouteInfo()
{
m_RouteInfoIsSet = false;
}
std::string RouteToLocation::getRouteProfId() const
{
return m_RouteProfId;
}
void RouteToLocation::setRouteProfId(std::string const& value)
{
m_RouteProfId = value;
m_RouteProfIdIsSet = true;
}
bool RouteToLocation::routeProfIdIsSet() const
{
return m_RouteProfIdIsSet;
}
void RouteToLocation::unsetRouteProfId()
{
m_RouteProfIdIsSet = false;
}
}
}
}
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* RouteToLocation.h
*
*
*/
#ifndef RouteToLocation_H_
#define RouteToLocation_H_
#include <string>
#include "RouteInformation.h"
#include <nlohmann/json.hpp>
namespace oai {
namespace smf_server {
namespace model {
/// <summary>
///
/// </summary>
class RouteToLocation
{
public:
RouteToLocation();
virtual ~RouteToLocation();
void validate();
/////////////////////////////////////////////
/// RouteToLocation members
/// <summary>
///
/// </summary>
std::string getDnai() const;
void setDnai(std::string const& value);
/// <summary>
///
/// </summary>
RouteInformation getRouteInfo() const;
void setRouteInfo(RouteInformation const& value);
bool routeInfoIsSet() const;
void unsetRouteInfo();
/// <summary>
///
/// </summary>
std::string getRouteProfId() const;
void setRouteProfId(std::string const& value);
bool routeProfIdIsSet() const;
void unsetRouteProfId();
friend void to_json(nlohmann::json& j, const RouteToLocation& o);
friend void from_json(const nlohmann::json& j, RouteToLocation& o);
protected:
std::string m_Dnai;
RouteInformation m_RouteInfo;
bool m_RouteInfoIsSet;
std::string m_RouteProfId;
bool m_RouteProfIdIsSet;
};
}
}
}
#endif /* RouteToLocation_H_ */
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "SmfEvent.h"
namespace oai {
namespace smf_server {
namespace model {
SmfEvent::SmfEvent()
{
}
SmfEvent::~SmfEvent()
{
}
void SmfEvent::validate()
{
// TODO: implement validation
}
void to_json(nlohmann::json& j, const SmfEvent& o)
{
j = nlohmann::json();
}
void from_json(const nlohmann::json& j, SmfEvent& o)
{
}
}
}
}
/**
* Nsmf_EventExposure
* Session Management Event Exposure 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* SmfEvent.h
*
* 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
*/
#ifndef SmfEvent_H_
#define SmfEvent_H_
#include <nlohmann/json.hpp>
namespace oai {
namespace smf_server {
namespace model {
/// <summary>
/// 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
/// </summary>
class SmfEvent
{
public:
SmfEvent();
virtual ~SmfEvent();
void validate();
/////////////////////////////////////////////
/// SmfEvent members
friend void to_json(nlohmann::json& j, const SmfEvent& o);
friend void from_json(const nlohmann::json& j, SmfEvent& o);
protected:
};
}
}
}
#endif /* SmfEvent_H_ */
......@@ -82,6 +82,8 @@ void SMFApiServer::init(size_t thr) {
m_individualSMContextApiImpl->init();
m_pduSessionsCollectionApiImpl->init();
m_smContextsCollectionApiImpl->init();
m_individualSubscriptionDocumentApiImpl->init();
m_subscriptionsCollectionApiImpl->init();
}
void SMFApiServer::start() {
......
......@@ -47,6 +47,9 @@
#include "IndividualSMContextApiImpl.h"
#include "PDUSessionsCollectionApiImpl.h"
#include "SMContextsCollectionApiImpl.h"
#include "IndividualSubscriptionDocumentApiImpl.h"
#include "SubscriptionsCollectionApiImpl.h"
#include "smf_app.hpp"
using namespace oai::smf_server::api;
......@@ -66,6 +69,12 @@ class SMFApiServer {
m_smContextsCollectionApiImpl =
std::make_shared<SMContextsCollectionApiImpl>(m_router, smf_app_inst,
m_address);
m_individualSubscriptionDocumentApiImpl = std::make_shared
< IndividualSubscriptionDocumentApiImpl
> (m_router, smf_app_inst, m_address);
m_subscriptionsCollectionApiImpl = std::make_shared
< SubscriptionsCollectionApiImpl > (m_router, smf_app_inst, m_address);
}
void init(size_t thr = 1);
void start();
......@@ -78,6 +87,8 @@ class SMFApiServer {
std::shared_ptr<IndividualSMContextApiImpl> m_individualSMContextApiImpl;
std::shared_ptr<PDUSessionsCollectionApiImpl> m_pduSessionsCollectionApiImpl;
std::shared_ptr<SMContextsCollectionApiImpl> m_smContextsCollectionApiImpl;
std::shared_ptr<IndividualSubscriptionDocumentApiImpl> m_individualSubscriptionDocumentApiImpl;
std::shared_ptr<SubscriptionsCollectionApiImpl> m_subscriptionsCollectionApiImpl;
std::string m_address;
};
......
......@@ -392,6 +392,8 @@ void smf_http2_server::create_sm_contexts_handler(
Logger::smf_api_server().debug("Got result for promise ID %d", promise_id);
nlohmann::json json_data = { };
sm_context_response.get_json_data(json_data);
std::string json_format;
sm_context_response.get_json_format(json_format);
//Add header
header_map h;
......@@ -404,7 +406,7 @@ void smf_http2_server::create_sm_contexts_handler(
sm_context_response.get_smf_context_uri().c_str() });
}
//content-type header
h.emplace("content-type", header_value {"application/json"});
h.emplace("content-type", header_value {json_format});
response.write_head(sm_context_response.get_http_code(), h);
response.end(json_data.dump().c_str());
......@@ -506,7 +508,9 @@ void smf_http2_server::update_sm_context_handler(
mime_parser parser = { };
std::string body = { };
header_map h = { };
std::string json_format;
sm_context_response.get_json_format(json_format);
sm_context_response.get_json_data(json_data);
Logger::smf_api_server().debug("Json data %s", json_data.dump().c_str());
......@@ -515,7 +519,8 @@ void smf_http2_server::update_sm_context_handler(
parser.create_multipart_related_content(
body, json_data.dump(), CURL_MIME_BOUNDARY,
sm_context_response.get_n1_sm_message(),
sm_context_response.get_n2_sm_information());
sm_context_response.get_n2_sm_information(),
json_format);
h.emplace(
"content-type",
header_value { "multipart/related; boundary="
......@@ -524,7 +529,8 @@ void smf_http2_server::update_sm_context_handler(
parser.create_multipart_related_content(
body, json_data.dump(), CURL_MIME_BOUNDARY,
sm_context_response.get_n1_sm_message(),
multipart_related_content_part_e::NAS);
multipart_related_content_part_e::NAS,
json_format);
h.emplace(
"content-type",
header_value { "multipart/related; boundary="
......@@ -533,13 +539,14 @@ void smf_http2_server::update_sm_context_handler(
parser.create_multipart_related_content(
body, json_data.dump(), CURL_MIME_BOUNDARY,
sm_context_response.get_n2_sm_information(),
multipart_related_content_part_e::NGAP);
multipart_related_content_part_e::NGAP,
json_format);
h.emplace(
"content-type",
header_value { "multipart/related; boundary="
+ std::string(CURL_MIME_BOUNDARY) });
} else {
h.emplace("content-type", header_value { "application/json" });
h.emplace("content-type", header_value { json_format });
body = json_data.dump().c_str();
}
......
/*
* 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_3GPP_29_508_SMF_SEEN
#define FILE_3GPP_29_508_SMF_SEEN
#include "smf.h"
typedef enum smf_event_e {
SMF_EVENT_AC_TY_CH = 1,
SMF_EVENT_UP_PATH_CH = 2,
SMF_EVENT_PDU_SES_REL = 3,
SMF_EVENT_PLMN_CH = 4,
SMF_EVENT_UE_IP_CH = 5,
SMF_EVENT_DDDS = 6
} smf_event_t;
static const std::vector<std::string> smf_event_e2str = { "SMF_EVENT_UNKNOWN", "Access Type Change",
"UP Path Change", "PDU Session Release", "PLMN Change", "UE IP address change", "Downlink data delivery status"};
enum class notification_method_e {
PERIODIC = 1,
ONE_TIME = 2,
ON_EVENT_DETECTION = 3
};
static const std::vector<std::string> notification_method_e2str = { "NOTIFICATION_METHOD_UNKNOWN", "PERIODIC",
"ONE_TIME", "ON_EVENT_DETECTION"};
enum class dnai_change_type_e {
EARLY = 1,
EARLY_LATE = 2,
LATE = 3
};
enum class ddd_status_e {
BUFFERED = 1,
TRANSMITTED = 2,
DISCARDED = 3
};
typedef struct event_subscription_s {
smf_event_t smf_event;
dnai_change_type_e dnai_change_type;
//DddTrafficDescriptor
std::vector<ddd_status_e> ddd_status;
} event_subscription_t;
#endif
......@@ -63,6 +63,13 @@ typedef uint32_t scid_t;
#define INVALID_SCID ((scid_t)0x00000000)
#define UNASSIGNED_SCID ((scid_t)0x00000000)
// Event Subscription IDs)
typedef uint32_t evsub_id_t;
#define EVSUB_ID_FMT "0x%" PRIx32
#define EVSUB_ID_SCAN_FMT SCNx32
#define INVALID_EVSUB_ID ((evsub_id_t)0x00000000)
#define UNASSIGNED_EVSUB_ID ((evsub_id_t)0x00000000)
//------------------------------------------------------------------------------
// IMSI
typedef uint64_t imsi64_t;
......
......@@ -466,4 +466,90 @@ class itti_n11_session_report_request : public itti_n11_msg {
};
//-----------------------------------------------------------------------------
class itti_n11_notify_sm_context_status : public itti_n11_msg {
public:
itti_n11_notify_sm_context_status(const task_id_t orig, const task_id_t dest)
:
itti_n11_msg(N11_SESSION_NOTIFY_SM_CONTEXT_STATUS, orig, dest),
scid(0),
sm_context_status(),
amf_status_uri(),
http_version() {
}
itti_n11_notify_sm_context_status(
const itti_n11_notify_sm_context_status &i)
:
itti_n11_msg(i),
scid(i.scid),
sm_context_status(i.sm_context_status),
amf_status_uri (i.amf_status_uri),
http_version(i.http_version) {
}
itti_n11_notify_sm_context_status(
const itti_n11_notify_sm_context_status &i, const task_id_t orig,
const task_id_t dest)
:
itti_n11_msg(i, orig, dest),
scid(i.scid),
sm_context_status(i.sm_context_status),
amf_status_uri(i.amf_status_uri),
http_version(i.http_version) {
}
const char* get_msg_name() {
return "N11_SESSION_NOTIFY_SM_CONTEXT_STATUS";
}
;
void set_scid(scid_t id) {
scid = id;
}
;
void set_sm_context_status(std::string status) {
sm_context_status = status;
}
;
scid_t scid; //SM Context ID
std::string sm_context_status;
std::string amf_status_uri;
uint8_t http_version;
};
//-----------------------------------------------------------------------------
class itti_n11_notify_subscribed_event : public itti_n11_msg {
public:
itti_n11_notify_subscribed_event(const task_id_t orig, const task_id_t dest)
:
itti_n11_msg(N11_NOTIFY_SUBSCRIBED_EVENT, orig, dest),
notif_id(),
http_version() {
}
itti_n11_notify_subscribed_event(
const itti_n11_notify_subscribed_event &i)
:
itti_n11_msg(i),
notif_id(i.notif_id),
http_version(i.http_version) {
}
itti_n11_notify_subscribed_event(
const itti_n11_notify_subscribed_event &i, const task_id_t orig,
const task_id_t dest)
:
itti_n11_msg(i, orig, dest),
notif_id(i.notif_id),
http_version(i.http_version) {
}
const char* get_msg_name() {
return "N11_NOTIFY_SUBSCRIBED_EVENT";
}
;
std::string notif_id;
std::vector<smf::event_notification> event_notifs;
uint8_t http_version;
};
#endif /* ITTI_MSG_N11_HPP_INCLUDED_ */
/*
* 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
*/
/*
* itti_msg_sbi.hpp
*
* Created on:
* Author:
*/
#ifndef ITTI_MSG_SBI_HPP_INCLUDED_
#define ITTI_MSG_SBI_HPP_INCLUDED_
#include "itti_msg.hpp"
#include "smf_msg.hpp"
#include "pistache/http.h"
class itti_sbi_msg : public itti_msg {
public:
itti_sbi_msg(const itti_msg_type_t msg_type, const task_id_t orig,
const task_id_t dest)
:
itti_msg(msg_type, orig, dest) {
}
itti_sbi_msg(const itti_sbi_msg &i)
:
itti_msg(i) {
}
itti_sbi_msg(const itti_sbi_msg &i, const task_id_t orig,
const task_id_t dest)
:
itti_sbi_msg(i) {
origin = orig;
destination = dest;
}
};
//-----------------------------------------------------------------------------
class itti_sbi_event_exposure_request : public itti_sbi_msg {
public:
itti_sbi_event_exposure_request(const task_id_t orig, const task_id_t dest)
:
itti_sbi_msg(SBI_EVENT_EXPOSURE_REQUEST, orig, dest),
event_exposure(),
http_version(1) {
}
itti_sbi_event_exposure_request(
const itti_sbi_event_exposure_request &i)
:
itti_sbi_msg(i),
event_exposure(i.event_exposure),
http_version(1) {
}
itti_sbi_event_exposure_request(
const itti_sbi_event_exposure_request &i, const task_id_t orig,
const task_id_t dest)
:
itti_sbi_msg(i, orig, dest),
event_exposure(i.event_exposure),
http_version(i.http_version) {
}
const char* get_msg_name() {
return "SBI_EVENT_EXPOSURE_REQUEST";
}
;
smf::event_exposure_msg event_exposure;
uint8_t http_version;
};
#endif /* ITTI_MSG_SBI_HPP_INCLUDED_ */
......@@ -154,6 +154,16 @@ static const std::vector<std::string> session_management_procedures_type_e2str =
};
enum class sm_context_status_e {
SM_CONTEXT_STATUS_ACTIVE = 0,
SM_CONTEXT_STATUS_RELEASED = 1
};
static const std::vector<std::string> sm_context_status_e2str =
{ "ACTIVE",
"RELEASED"
};
typedef struct qos_profile_gbr_s {
gfbr_t gfbr; //Guaranteed Flow Bit Rate
mfbr_t mfbr; // Maximum Flow Bit Rate
......@@ -208,4 +218,6 @@ constexpr uint64_t SECONDS_SINCE_FIRST_EPOCH = 2208988800;
#define TEID_GRE_KEY_LENGTH 4
#endif
......@@ -103,7 +103,8 @@ void mime_parser::create_multipart_related_content(std::string &body,
const std::string &json_part,
const std::string boundary,
const std::string &n1_message,
const std::string &n2_message) {
const std::string &n2_message,
std::string json_format) {
//TODO: provide Content-Ids as function parameters
......@@ -113,7 +114,7 @@ void mime_parser::create_multipart_related_content(std::string &body,
std::string CRLF = "\r\n";
body.append("--" + boundary + CRLF);
body.append("Content-Type: application/json" + CRLF);
body.append("Content-Type: "+ json_format + CRLF);
body.append(CRLF);
body.append(json_part + CRLF);
......@@ -135,7 +136,8 @@ void mime_parser::create_multipart_related_content(std::string &body,
//------------------------------------------------------------------------------
void mime_parser::create_multipart_related_content(
std::string &body, const std::string &json_part, const std::string boundary,
const std::string &message, const multipart_related_content_part_e content_type) {
const std::string &message, const multipart_related_content_part_e content_type,
std::string json_format) {
//TODO: provide Content-Id as function parameters
//format string as hex
......@@ -143,7 +145,7 @@ void mime_parser::create_multipart_related_content(
std::string CRLF = "\r\n";
body.append("--" + boundary + CRLF);
body.append("Content-Type: application/json" + CRLF);
body.append("Content-Type: " + json_format + CRLF);
body.append(CRLF);
body.append(json_part + CRLF);
......
......@@ -82,7 +82,8 @@ class mime_parser {
const std::string &json_part,
const std::string boundary,
const std::string &n1_message,
const std::string &n2_message);
const std::string &n2_message,
std::string json_format="application/json");
/*
* Create HTTP body content for multipart/related message
......@@ -96,7 +97,8 @@ class mime_parser {
void create_multipart_related_content(
std::string &body, const std::string &json_part,
const std::string boundary, const std::string &message,
const multipart_related_content_part_e content_type);
const multipart_related_content_part_e content_type,
std::string json_format="application/json");
private:
std::vector<mime_part> mime_parts;
......
......@@ -114,7 +114,10 @@ typedef enum {
N11_SESSION_RELEASE_SM_CONTEXT_REQUEST,
N11_SESSION_RELEASE_SM_CONTEXT_RESPONSE,
N11_SESSION_REPORT_RESPONSE,
N11_SESSION_NOTIFY_SM_CONTEXT_STATUS,
N11_NOTIFY_SUBSCRIBED_EVENT,
NX_TRIGGER_SESSION_MODIFICATION,
SBI_EVENT_EXPOSURE_REQUEST,
UDP_INIT,
UDP_DATA_REQ,
UDP_DATA_IND,
......
......@@ -229,7 +229,9 @@ uint32_t pfcp_l4_stack::send_request(const endpoint& dest, const pfcp_heartbeat_
pending_procedures.insert(std::pair<uint32_t, pfcp_procedure>(msg.get_sequence_number(), proc));
trxn_id2seq_num.insert(std::pair<uint64_t, uint32_t>(proc.trxn_id, msg.get_sequence_number()));
udp_s_allocated.async_send_to(reinterpret_cast<const char*>(bstream.c_str()), bstream.length(), dest);
//TTN: temporary fix to be able to work with UPF from dsTester (should be removed later)
//udp_s_allocated.async_send_to(reinterpret_cast<const char*>(bstream.c_str()), bstream.length(), dest);
udp_s_8805.async_send_to(reinterpret_cast<const char*>(bstream.c_str()), bstream.length(), dest);
return msg.get_sequence_number();
}
//------------------------------------------------------------------------------
......@@ -254,7 +256,10 @@ uint32_t pfcp_l4_stack::send_request(const endpoint& dest, const pfcp_associatio
pending_procedures.insert(std::pair<uint32_t, pfcp_procedure>(msg.get_sequence_number(), proc));
trxn_id2seq_num.insert(std::pair<uint64_t, uint32_t>(proc.trxn_id, msg.get_sequence_number()));
udp_s_allocated.async_send_to(reinterpret_cast<const char*>(bstream.c_str()), bstream.length(), dest);
//TTN: temporary fix to be able to work with UPF from dsTester (should be removed later)
//udp_s_allocated.async_send_to(reinterpret_cast<const char*>(bstream.c_str()), bstream.length(), dest);
udp_s_8805.async_send_to(reinterpret_cast<const char*>(bstream.c_str()), bstream.length(), dest);
return msg.get_sequence_number();
}
//------------------------------------------------------------------------------
......@@ -279,7 +284,10 @@ uint32_t pfcp_l4_stack::send_request(const endpoint& dest, const pfcp_associatio
pending_procedures.insert(std::pair<uint32_t, pfcp_procedure>(msg.get_sequence_number(), proc));
trxn_id2seq_num.insert(std::pair<uint64_t, uint32_t>(proc.trxn_id, msg.get_sequence_number()));
udp_s_allocated.async_send_to(reinterpret_cast<const char*>(bstream.c_str()), bstream.length(), dest);
//TTN: temporary fix to be able to work with UPF from dsTester (should be removed later)
//udp_s_allocated.async_send_to(reinterpret_cast<const char*>(bstream.c_str()), bstream.length(), dest);
udp_s_8805.async_send_to(reinterpret_cast<const char*>(bstream.c_str()), bstream.length(), dest);
return msg.get_sequence_number();
}
////------------------------------------------------------------------------------
......@@ -356,7 +364,9 @@ uint32_t pfcp_l4_stack::send_request(const endpoint& dest, const uint64_t seid,
pending_procedures.insert(std::pair<uint32_t, pfcp_procedure>(msg.get_sequence_number(), proc));
trxn_id2seq_num.insert(std::pair<uint64_t, uint32_t>(proc.trxn_id, msg.get_sequence_number()));
udp_s_allocated.async_send_to(reinterpret_cast<const char*>(bstream.c_str()), bstream.length(), dest);
//TTN: temporary fix to be able to work with UPF from dsTester (should be removed later)
//udp_s_allocated.async_send_to(reinterpret_cast<const char*>(bstream.c_str()), bstream.length(), dest);
udp_s_8805.async_send_to(reinterpret_cast<const char*>(bstream.c_str()), bstream.length(), dest);
return msg.get_sequence_number();
}
//------------------------------------------------------------------------------
......@@ -382,7 +392,9 @@ uint32_t pfcp_l4_stack::send_request(const endpoint& dest, const uint64_t seid,
pending_procedures.insert(std::pair<uint32_t, pfcp_procedure>(msg.get_sequence_number(), proc));
trxn_id2seq_num.insert(std::pair<uint64_t, uint32_t>(proc.trxn_id, msg.get_sequence_number()));
udp_s_allocated.async_send_to(reinterpret_cast<const char*>(bstream.c_str()), bstream.length(), dest);
//TTN: temporary fix to be able to work with UPF from dsTester (should be removed later)
//udp_s_allocated.async_send_to(reinterpret_cast<const char*>(bstream.c_str()), bstream.length(), dest);
udp_s_8805.async_send_to(reinterpret_cast<const char*>(bstream.c_str()), bstream.length(), dest);
return msg.get_sequence_number();
}
//------------------------------------------------------------------------------
......@@ -408,7 +420,9 @@ uint32_t pfcp_l4_stack::send_request(const endpoint& dest, const uint64_t seid,
pending_procedures.insert(std::pair<uint32_t, pfcp_procedure>(msg.get_sequence_number(), proc));
trxn_id2seq_num.insert(std::pair<uint64_t, uint32_t>(proc.trxn_id, msg.get_sequence_number()));
udp_s_allocated.async_send_to(reinterpret_cast<const char*>(bstream.c_str()), bstream.length(), dest);
//TTN: temporary fix to be able to work with UPF from dsTester (should be removed later)
//udp_s_allocated.async_send_to(reinterpret_cast<const char*>(bstream.c_str()), bstream.length(), dest);
udp_s_8805.async_send_to(reinterpret_cast<const char*>(bstream.c_str()), bstream.length(), dest);
return msg.get_sequence_number();
}
////------------------------------------------------------------------------------
......@@ -460,7 +474,9 @@ uint32_t pfcp_l4_stack::send_request(const endpoint& dest, const uint64_t seid,
pending_procedures.insert(std::pair<uint32_t, pfcp_procedure>(msg.get_sequence_number(), proc));
trxn_id2seq_num.insert(std::pair<uint64_t, uint32_t>(proc.trxn_id, msg.get_sequence_number()));
udp_s_allocated.async_send_to(reinterpret_cast<const char*>(bstream.c_str()), bstream.length(), dest);
//TTN: temporary fix to be able to work with UPF from dsTester (should be removed later)
//udp_s_allocated.async_send_to(reinterpret_cast<const char*>(bstream.c_str()), bstream.length(), dest);
udp_s_8805.async_send_to(reinterpret_cast<const char*>(bstream.c_str()), bstream.length(), dest);
return msg.get_sequence_number();
}
//------------------------------------------------------------------------------
......@@ -486,7 +502,9 @@ uint32_t pfcp_l4_stack::send_request(const endpoint& dest, const uint64_t seid,
pending_procedures.insert(std::pair<uint32_t, pfcp_procedure>(msg.get_sequence_number(), proc));
trxn_id2seq_num.insert(std::pair<uint64_t, uint32_t>(proc.trxn_id, msg.get_sequence_number()));
udp_s_allocated.async_send_to(reinterpret_cast<const char*>(bstream.c_str()), bstream.length(), dest);
//TTN: temporary fix to be able to work with UPF from dsTester (should be removed later)
//udp_s_allocated.async_send_to(reinterpret_cast<const char*>(bstream.c_str()), bstream.length(), dest);
udp_s_8805.async_send_to(reinterpret_cast<const char*>(bstream.c_str()), bstream.length(), dest);
return msg.get_sequence_number();
}
//------------------------------------------------------------------------------
......
......@@ -58,6 +58,8 @@ add_library (SMF STATIC
smf_n4.cpp
smf_n10.cpp
smf_n11.cpp
smf_event.cpp
smf_subscription.cpp
smf_msg.cpp
)
This diff is collapsed.
......@@ -45,7 +45,9 @@
#include "3gpp_29.502.h"
#include "itti_msg_n4.hpp"
#include "itti_msg_n11.hpp"
#include "itti_msg_sbi.hpp"
#include "smf_context.hpp"
#include "smf_subscription.hpp"
#include "smf_pco.hpp"
#include "smf_msg.hpp"
#include "SmContextCreateData.h"
......@@ -89,12 +91,14 @@ class smf_context_ref {
nssai = { };
dnn = "";
pdu_session_id = 0;
amf_status_uri = "";
}
supi_t supi;
std::string dnn;
pdu_session_id_t pdu_session_id;
snssai_t nssai;
std::string amf_status_uri;
};
class smf_app {
......@@ -114,9 +118,14 @@ class smf_app {
mutable std::shared_mutex m_supi2smf_context;
util::uint_generator<uint32_t> sm_context_ref_generator;
std::map<scid_t, std::shared_ptr<smf_context_ref>> scid2smf_context;
util::uint_generator<uint32_t> evsub_id_generator;
std::map<std::pair<evsub_id_t, smf_event_t>, std::shared_ptr<smf_subscription>> smf_event_subscriptions;
mutable std::shared_mutex m_scid2smf_context;
mutable std::shared_mutex m_smf_event_subscriptions;
//Store promise IDs for Create/Update session
mutable std::shared_mutex m_sm_context_create_promises;
mutable std::shared_mutex m_sm_context_update_promises;
......@@ -129,6 +138,7 @@ class smf_app {
std::map<uint32_t,
boost::shared_ptr<boost::promise<pdu_session_release_sm_context_response>>> sm_context_release_promises;
/*
* Apply the config from the configuration file for DNN pools
* @param [const smf_config &cfg] cfg
......@@ -370,6 +380,21 @@ class smf_app {
*/
scid_t generate_smf_context_ref();
/*
* Generate an Event Exposure Subscription ID in a form of string
* @param [std::string &] sub_id: Store the generated reference
* @return void
*/
void generate_ev_subscription_id(std::string &sub_id);
/*
* Generate an Event Exposure Subscription ID
* @param [void]
* @return the generated reference
*/
evsub_id_t generate_ev_subscription_id();
/*
* Set the association betwen a SMF Context Reference and a SMF Context
* @param [const scid_t &] id: SMF Context Reference Id
......@@ -437,6 +462,13 @@ class smf_app {
void handle_pdu_session_release_sm_context_request(
std::shared_ptr<itti_n11_release_sm_context_request> smreq);
/*
* Handle Event Exposure Msg from AMF
* @param [std::shared_ptr<itti_sbi_event_exposure_request>&] Request message
* @return [evsub_id_t] ID of the created subscription
*/
evsub_id_t handle_event_exposure_subscription(
std::shared_ptr<itti_sbi_event_exposure_request> msg);
/*
* Trigger pdu session modification
* @param [const supi_t &] supi
......@@ -650,6 +682,42 @@ class smf_app {
*/
void trigger_http_response(const uint32_t &http_code, uint32_t &promise_id,
uint8_t msg_type);
/*
* Add an Event Subscription to the list
* @param [const evsub_id_t&] sub_id: Subscription ID
* @param [smf_event_t] ev: Event type
* @param [std::shared_ptr<smf_subscription>] ss: a shared pointer stored information of the subscription
* @return void
*/
void add_event_subscription(evsub_id_t sub_id, smf_event_t ev, std::shared_ptr<smf_subscription> ss);
/*
* Get a list of subscription associated with a particular event
* @param [smf_event_t] ev: Event type
* @param [std::vector<std::shared_ptr<smf_subscription>>&] subscriptions: store the list of the subscription associated with this event type
* @return void
*/
void get_ee_subscriptions(smf_event_t ev, std::vector<std::shared_ptr<smf_subscription>> &subscriptions);
/*
* Get a list of subscription associated with a particular event
* @param [evsub_id_t] sub_id: Subscription ID
* @param [std::vector<std::shared_ptr<smf_subscription>>&] subscriptions: store the list of the subscription associated with this event type
* @return void
*/
void get_ee_subscriptions(evsub_id_t sub_id, std::vector<std::shared_ptr<smf_subscription>> &subscriptions);
/*
* Get a list of subscription associated with a particular event
* @param [smf_event_t] ev: Event type
* @param [supi64_t] supi: SUPI
* @param [pdu_session_id_t] pdu_session_id: PDU Session ID
* @param [std::vector<std::shared_ptr<smf_subscription>>&] subscriptions: store the list of the subscription associated with this event type
* @return void
*/
void get_ee_subscriptions(smf_event_t ev, supi64_t supi, pdu_session_id_t pdu_session_id, std::vector<std::shared_ptr<smf_subscription>> &subscriptions);
};
}
#include "smf_config.hpp"
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -53,6 +53,12 @@ class smf_n1 {
smf_n1(smf_n1 const&) = delete;
void operator=(smf_n1 const&) = delete;
public:
static smf_n1& get_instance() {
static smf_n1 instance;
return instance;
}
/*
* Create N1 SM Container: PDU Session Establishment Accept
* @param [pdu_session_create_sm_context_response] sm_context_res: include necessary information for encoding NGAP msg
......
This diff is collapsed.
......@@ -33,6 +33,7 @@
#include <map>
#include "smf.h"
#include <curl/curl.h>
#include "3gpp_29.503.h"
#include "smf_context.hpp"
#include "SmContextCreatedData.h"
......@@ -75,6 +76,30 @@ class smf_n11 {
void send_n1n2_message_transfer_request(
std::shared_ptr<itti_n11_session_report_request> report_msg);
/*
* Send SM Context Status Notification to AMF
* @param [std::shared_ptr<itti_n11_notify_sm_context_status>] sm_context_status: Content of message to be sent
* @return void
*/
void send_sm_context_status_notification(
std::shared_ptr<itti_n11_notify_sm_context_status> sm_context_status);
/*
* Send Notification for the associated event to the subscribers
* @param [std::shared_ptr<itti_n11_notify_subscribed_event>] msg: Content of message to be sent
* @return void
*/
void notify_subscribed_event(
std::shared_ptr<itti_n11_notify_subscribed_event> msg);
/*
* Create Curl handle for multi curl
* @param [event_notification&] ev_notif: content of the event notification
* @param [std::string *] data: data
* @return pointer to the created curl
*/
CURL * curl_create_handle (event_notification &ev_notif, std::string *data);
};
}
#endif /* FILE_SMF_N11_HPP_SEEN */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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