Commit 4ca31398 authored by Stefan Spettel's avatar Stefan Spettel

refact(pcf): Changed class hierarchy and simplified interaction with smf_n7 in...

refact(pcf): Changed class hierarchy and simplified interaction with smf_n7 in smf_context.cpp, added stubs for all CRUD methods
Signed-off-by: default avatarStefan Spettel <stefan.spettel@eurecom.fr>
parent c95fe15a
/**
* Npcf_SMPolicyControl API
* Session Management Policy Control Service © 2020, 3GPP Organizational
* Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.1.alpha-5
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "SmPolicyDeleteData.h"
#include "Helpers.h"
#include <sstream>
namespace oai {
namespace smf_server {
namespace model {
SmPolicyDeleteData::SmPolicyDeleteData() {
m_UserLocationInfoIsSet = false;
m_UeTimeZone = "";
m_UeTimeZoneIsSet = false;
m_ServingNetworkIsSet = false;
m_UserLocationInfoTime = "";
m_UserLocationInfoTimeIsSet = false;
// m_RanNasRelCausesIsSet = false;
// m_AccuUsageReportsIsSet = false;
// m_PduSessRelCauseIsSet = false;
}
void SmPolicyDeleteData::validate() const {
std::stringstream msg;
if (!validate(msg)) {
// throw
// org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool SmPolicyDeleteData::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool SmPolicyDeleteData::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "SmPolicyDeleteData" : pathPrefix;
/*
if (ranNasRelCausesIsSet()) {
const std::vector<RanNasRelCause>& value = m_RanNasRelCauses;
const std::string currentValuePath = _pathPrefix + ".ranNasRelCauses";
if (value.size() < 1) {
success = false;
msg << currentValuePath << ": must have at least 1 elements;";
}
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const RanNasRelCause& value : value) {
const std::string currentValuePath =
oldValuePath + "[" + std::to_string(i) + "]";
success = value.validate(msg, currentValuePath + ".ranNasRelCauses") &&
success;
i++;
}
}
}
if (accuUsageReportsIsSet()) {
const std::vector<AccuUsageReport>& value = m_AccuUsageReports;
const std::string currentValuePath = _pathPrefix + ".accuUsageReports";
if (value.size() < 1) {
success = false;
msg << currentValuePath << ": must have at least 1 elements;";
}
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const AccuUsageReport& value : value) {
const std::string currentValuePath =
oldValuePath + "[" + std::to_string(i) + "]";
success = value.validate(msg, currentValuePath + ".accuUsageReports") &&
success;
i++;
}
}
}
*/
return success;
}
bool SmPolicyDeleteData::operator==(const SmPolicyDeleteData& rhs) const {
return
((!userLocationInfoIsSet() && !rhs.userLocationInfoIsSet()) ||
(userLocationInfoIsSet() && rhs.userLocationInfoIsSet() &&
getUserLocationInfo() == rhs.getUserLocationInfo())) &&
((!ueTimeZoneIsSet() && !rhs.ueTimeZoneIsSet()) ||
(ueTimeZoneIsSet() && rhs.ueTimeZoneIsSet() &&
getUeTimeZone() == rhs.getUeTimeZone())) &&
((!servingNetworkIsSet() && !rhs.servingNetworkIsSet()) ||
(servingNetworkIsSet() && rhs.servingNetworkIsSet() &&
getServingNetwork() == rhs.getServingNetwork())) &&
((!userLocationInfoTimeIsSet() && !rhs.userLocationInfoTimeIsSet()) ||
(userLocationInfoTimeIsSet() && rhs.userLocationInfoTimeIsSet() &&
getUserLocationInfoTime() == rhs.getUserLocationInfoTime()))
/* &&
((!ranNasRelCausesIsSet() && !rhs.ranNasRelCausesIsSet()) ||
(ranNasRelCausesIsSet() && rhs.ranNasRelCausesIsSet() &&
getRanNasRelCauses() == rhs.getRanNasRelCauses())) &&
((!accuUsageReportsIsSet() && !rhs.accuUsageReportsIsSet()) ||
(accuUsageReportsIsSet() && rhs.accuUsageReportsIsSet() &&
getAccuUsageReports() == rhs.getAccuUsageReports())) &&
((!pduSessRelCauseIsSet() && !rhs.pduSessRelCauseIsSet()) ||
(pduSessRelCauseIsSet() && rhs.pduSessRelCauseIsSet() &&
getPduSessRelCause() == rhs.getPduSessRelCause()))
*/
;
}
bool SmPolicyDeleteData::operator!=(const SmPolicyDeleteData& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const SmPolicyDeleteData& o) {
j = nlohmann::json();
if (o.userLocationInfoIsSet()) j["userLocationInfo"] = o.m_UserLocationInfo;
if (o.ueTimeZoneIsSet()) j["ueTimeZone"] = o.m_UeTimeZone;
if (o.servingNetworkIsSet()) j["servingNetwork"] = o.m_ServingNetwork;
if (o.userLocationInfoTimeIsSet())
j["userLocationInfoTime"] = o.m_UserLocationInfoTime;
/*
if (o.ranNasRelCausesIsSet() || !o.m_RanNasRelCauses.empty())
j["ranNasRelCauses"] = o.m_RanNasRelCauses;
if (o.accuUsageReportsIsSet() || !o.m_AccuUsageReports.empty())
j["accuUsageReports"] = o.m_AccuUsageReports;
if (o.pduSessRelCauseIsSet()) j["pduSessRelCause"] = o.m_PduSessRelCause;
*/
}
void from_json(const nlohmann::json& j, SmPolicyDeleteData& o) {
if (j.find("userLocationInfo") != j.end()) {
j.at("userLocationInfo").get_to(o.m_UserLocationInfo);
o.m_UserLocationInfoIsSet = true;
}
if (j.find("ueTimeZone") != j.end()) {
j.at("ueTimeZone").get_to(o.m_UeTimeZone);
o.m_UeTimeZoneIsSet = true;
}
if (j.find("servingNetwork") != j.end()) {
j.at("servingNetwork").get_to(o.m_ServingNetwork);
o.m_ServingNetworkIsSet = true;
}
if (j.find("userLocationInfoTime") != j.end()) {
j.at("userLocationInfoTime").get_to(o.m_UserLocationInfoTime);
o.m_UserLocationInfoTimeIsSet = true;
}
/*
if (j.find("ranNasRelCauses") != j.end()) {
j.at("ranNasRelCauses").get_to(o.m_RanNasRelCauses);
o.m_RanNasRelCausesIsSet = true;
}
if (j.find("accuUsageReports") != j.end()) {
j.at("accuUsageReports").get_to(o.m_AccuUsageReports);
o.m_AccuUsageReportsIsSet = true;
}
if (j.find("pduSessRelCause") != j.end()) {
j.at("pduSessRelCause").get_to(o.m_PduSessRelCause);
o.m_PduSessRelCauseIsSet = true;
}
*/
}
UserLocation SmPolicyDeleteData::getUserLocationInfo() const {
return m_UserLocationInfo;
}
void SmPolicyDeleteData::setUserLocationInfo(UserLocation const& value) {
m_UserLocationInfo = value;
m_UserLocationInfoIsSet = true;
}
bool SmPolicyDeleteData::userLocationInfoIsSet() const {
return m_UserLocationInfoIsSet;
}
void SmPolicyDeleteData::unsetUserLocationInfo() {
m_UserLocationInfoIsSet = false;
}
std::string SmPolicyDeleteData::getUeTimeZone() const {
return m_UeTimeZone;
}
void SmPolicyDeleteData::setUeTimeZone(std::string const& value) {
m_UeTimeZone = value;
m_UeTimeZoneIsSet = true;
}
bool SmPolicyDeleteData::ueTimeZoneIsSet() const {
return m_UeTimeZoneIsSet;
}
void SmPolicyDeleteData::unsetUeTimeZone() {
m_UeTimeZoneIsSet = false;
}
PlmnIdNid SmPolicyDeleteData::getServingNetwork() const {
return m_ServingNetwork;
}
void SmPolicyDeleteData::setServingNetwork(PlmnIdNid const& value) {
m_ServingNetwork = value;
m_ServingNetworkIsSet = true;
}
bool SmPolicyDeleteData::servingNetworkIsSet() const {
return m_ServingNetworkIsSet;
}
void SmPolicyDeleteData::unsetServingNetwork() {
m_ServingNetworkIsSet = false;
}
std::string SmPolicyDeleteData::getUserLocationInfoTime() const {
return m_UserLocationInfoTime;
}
void SmPolicyDeleteData::setUserLocationInfoTime(std::string const& value) {
m_UserLocationInfoTime = value;
m_UserLocationInfoTimeIsSet = true;
}
bool SmPolicyDeleteData::userLocationInfoTimeIsSet() const {
return m_UserLocationInfoTimeIsSet;
}
void SmPolicyDeleteData::unsetUserLocationInfoTime() {
m_UserLocationInfoTimeIsSet = false;
}
/*
std::vector<RanNasRelCause> SmPolicyDeleteData::getRanNasRelCauses() const {
return m_RanNasRelCauses;
}
void SmPolicyDeleteData::setRanNasRelCauses(
std::vector<RanNasRelCause> const& value) {
m_RanNasRelCauses = value;
m_RanNasRelCausesIsSet = true;
}
bool SmPolicyDeleteData::ranNasRelCausesIsSet() const {
return m_RanNasRelCausesIsSet;
}
void SmPolicyDeleteData::unsetRanNasRelCauses() {
m_RanNasRelCausesIsSet = false;
}
std::vector<AccuUsageReport> SmPolicyDeleteData::getAccuUsageReports() const {
return m_AccuUsageReports;
}
void SmPolicyDeleteData::setAccuUsageReports(
std::vector<AccuUsageReport> const& value) {
m_AccuUsageReports = value;
m_AccuUsageReportsIsSet = true;
}
bool SmPolicyDeleteData::accuUsageReportsIsSet() const {
return m_AccuUsageReportsIsSet;
}
void SmPolicyDeleteData::unsetAccuUsageReports() {
m_AccuUsageReportsIsSet = false;
}
PduSessionRelCause SmPolicyDeleteData::getPduSessRelCause() const {
return m_PduSessRelCause;
}
void SmPolicyDeleteData::setPduSessRelCause(PduSessionRelCause const& value) {
m_PduSessRelCause = value;
m_PduSessRelCauseIsSet = true;
}
bool SmPolicyDeleteData::pduSessRelCauseIsSet() const {
return m_PduSessRelCauseIsSet;
}
void SmPolicyDeleteData::unsetPduSessRelCause() {
m_PduSessRelCauseIsSet = false;
}
*/
} // namespace model
} // namespace smf_server
} // namespace oai
/**
* Npcf_SMPolicyControl API
* Session Management Policy Control Service © 2020, 3GPP Organizational
* Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.1.alpha-5
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* SmPolicyDeleteData.h
*
*
*/
#ifndef SmPolicyDeleteData_H_
#define SmPolicyDeleteData_H_
//#include "PduSessionRelCause.h"
#include "PlmnIdNid.h"
#include <string>
#include "UserLocation.h"
//#include "AccuUsageReport.h"
#include <vector>
//#include "RanNasRelCause.h"
#include <nlohmann/json.hpp>
namespace oai {
namespace smf_server {
namespace model {
/// <summary>
///
/// </summary>
class SmPolicyDeleteData {
public:
SmPolicyDeleteData();
virtual ~SmPolicyDeleteData() = default;
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on
/// failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and
/// calls it's validate. Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const SmPolicyDeleteData& rhs) const;
bool operator!=(const SmPolicyDeleteData& rhs) const;
/////////////////////////////////////////////
/// SmPolicyDeleteData members
/// <summary>
///
/// </summary>
UserLocation getUserLocationInfo() const;
void setUserLocationInfo(UserLocation const& value);
bool userLocationInfoIsSet() const;
void unsetUserLocationInfo();
/// <summary>
///
/// </summary>
std::string getUeTimeZone() const;
void setUeTimeZone(std::string const& value);
bool ueTimeZoneIsSet() const;
void unsetUeTimeZone();
/// <summary>
///
/// </summary>
PlmnIdNid getServingNetwork() const;
void setServingNetwork(PlmnIdNid const& value);
bool servingNetworkIsSet() const;
void unsetServingNetwork();
/// <summary>
///
/// </summary>
std::string getUserLocationInfoTime() const;
void setUserLocationInfoTime(std::string const& value);
bool userLocationInfoTimeIsSet() const;
void unsetUserLocationInfoTime();
/// <summary>
/// Contains the RAN and/or NAS release cause.
/// </summary>
/*
std::vector<RanNasRelCause> getRanNasRelCauses() const;
void setRanNasRelCauses(std::vector<RanNasRelCause> const& value);
bool ranNasRelCausesIsSet() const;
void unsetRanNasRelCauses();
*/
/// <summary>
/// Contains the usage report
/// </summary>
/*
std::vector<AccuUsageReport> getAccuUsageReports() const;
void setAccuUsageReports(std::vector<AccuUsageReport> const& value);
bool accuUsageReportsIsSet() const;
void unsetAccuUsageReports();
/// <summary>
///
/// </summary>
PduSessionRelCause getPduSessRelCause() const;
void setPduSessRelCause(PduSessionRelCause const& value);
bool pduSessRelCauseIsSet() const;
void unsetPduSessRelCause();
*/
friend void to_json(nlohmann::json& j, const SmPolicyDeleteData& o);
friend void from_json(const nlohmann::json& j, SmPolicyDeleteData& o);
protected:
UserLocation m_UserLocationInfo;
bool m_UserLocationInfoIsSet;
std::string m_UeTimeZone;
bool m_UeTimeZoneIsSet;
PlmnIdNid m_ServingNetwork;
bool m_ServingNetworkIsSet;
std::string m_UserLocationInfoTime;
bool m_UserLocationInfoTimeIsSet;
// std::vector<RanNasRelCause> m_RanNasRelCauses;
// bool m_RanNasRelCausesIsSet;
// std::vector<AccuUsageReport> m_AccuUsageReports;
// bool m_AccuUsageReportsIsSet;
// PduSessionRelCause m_PduSessRelCause;
// bool m_PduSessRelCauseIsSet;
};
} // namespace model
} // namespace smf_server
} // namespace oai
#endif /* SmPolicyDeleteData_H_ */
/**
* Npcf_SMPolicyControl API
* Session Management Policy Control Service © 2020, 3GPP Organizational
* Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.1.alpha-5
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "SmPolicyUpdateContextData.h"
#include "Helpers.h"
#include <sstream>
namespace oai {
namespace smf_server {
namespace model {
SmPolicyUpdateContextData::SmPolicyUpdateContextData() {
m_RepPolicyCtrlReqTriggersIsSet = false;
// m_AccNetChIdsIsSet = false;
m_AccessTypeIsSet = false;
m_RatTypeIsSet = false;
// m_AddAccessInfoIsSet = false;
// m_RelAccessInfoIsSet = false;
m_ServingNetworkIsSet = false;
m_UserLocationInfoIsSet = false;
m_UeTimeZone = "";
m_UeTimeZoneIsSet = false;
m_RelIpv4Address = "";
m_RelIpv4AddressIsSet = false;
m_Ipv4Address = "";
m_Ipv4AddressIsSet = false;
m_IpDomain = "";
m_IpDomainIsSet = false;
// m_Ipv6AddressPrefixIsSet = false;
// m_RelIpv6AddressPrefixIsSet = false;
// m_AddIpv6AddrPrefixesIsSet = false;
// m_AddRelIpv6AddrPrefixesIsSet = false;
m_RelUeMac = "";
m_RelUeMacIsSet = false;
m_UeMac = "";
m_UeMacIsSet = false;
// m_SubsSessAmbrIsSet = false;
m_AuthProfIndex = "";
m_AuthProfIndexIsSet = false;
// m_SubsDefQosIsSet = false;
m_NumOfPackFilter = 0;
m_NumOfPackFilterIsSet = false;
// m_AccuUsageReportsIsSet = false;
m_r_3gppPsDataOffStatus = false;
m_r_3gppPsDataOffStatusIsSet = false;
// m_AppDetectionInfosIsSet = false;
// m_RuleReportsIsSet = false;
// m_SessRuleReportsIsSet = false;
// m_QncReportsIsSet = false;
m_QosMonReportsIsSet = false;
m_UserLocationInfoTime = "";
m_UserLocationInfoTimeIsSet = false;
// m_RepPraInfosIsSet = false;
// m_UeInitResReqIsSet = false;
m_RefQosIndication = false;
m_RefQosIndicationIsSet = false;
// m_QosFlowUsageIsSet = false;
// m_CreditManageStatusIsSet = false;
// m_ServNfIdIsSet = false;
m_TraceReqIsSet = false;
// m_MaPduIndIsSet = false;
m_AtsssCapabIsSet = false;
// m_TsnBridgeInfoIsSet = false;
// m_TsnPortManContDsttIsSet = false;
// m_TsnPortManContNwttsIsSet = false;
// m_MulAddrInfosIsSet = false;
}
void SmPolicyUpdateContextData::validate() const {
std::stringstream msg;
if (!validate(msg)) {
// throw
// org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool SmPolicyUpdateContextData::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool SmPolicyUpdateContextData::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "SmPolicyUpdateContextData" : pathPrefix;
if (repPolicyCtrlReqTriggersIsSet()) {
const std::vector<PolicyControlRequestTrigger>& value =
m_RepPolicyCtrlReqTriggers;
const std::string currentValuePath =
_pathPrefix + ".repPolicyCtrlReqTriggers";
if (value.size() < 1) {
success = false;
msg << currentValuePath << ": must have at least 1 elements;";
}
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const PolicyControlRequestTrigger& value : value) {
const std::string currentValuePath =
oldValuePath + "[" + std::to_string(i) + "]";
success = value.validate(
msg, currentValuePath + ".repPolicyCtrlReqTriggers") &&
success;
i++;
}
}
}
/*
if (accNetChIdsIsSet()) {
const std::vector<AccNetChId>& value = m_AccNetChIds;
const std::string currentValuePath = _pathPrefix + ".accNetChIds";
if (value.size() < 1) {
success = false;
msg << currentValuePath << ": must have at least 1 elements;";
}
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const AccNetChId& value : value) {
const std::string currentValuePath =
oldValuePath + "[" + std::to_string(i) + "]";
success =
value.validate(msg, currentValuePath + ".accNetChIds") && success;
i++;
}
}
}
*/
if (relIpv4AddressIsSet()) {
const std::string& value = m_RelIpv4Address;
const std::string currentValuePath = _pathPrefix + ".relIpv4Address";
}
if (ipv4AddressIsSet()) {
const std::string& value = m_Ipv4Address;
const std::string currentValuePath = _pathPrefix + ".ipv4Address";
}
if (relUeMacIsSet()) {
const std::string& value = m_RelUeMac;
const std::string currentValuePath = _pathPrefix + ".relUeMac";
}
if (ueMacIsSet()) {
const std::string& value = m_UeMac;
const std::string currentValuePath = _pathPrefix + ".ueMac";
}
/*
if (accuUsageReportsIsSet()) {
const std::vector<AccuUsageReport>& value = m_AccuUsageReports;
const std::string currentValuePath = _pathPrefix + ".accuUsageReports";
if (value.size() < 1) {
success = false;
msg << currentValuePath << ": must have at least 1 elements;";
}
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const AccuUsageReport& value : value) {
const std::string currentValuePath =
oldValuePath + "[" + std::to_string(i) + "]";
success = value.validate(msg, currentValuePath + ".accuUsageReports") &&
success;
i++;
}
}
}
if (appDetectionInfosIsSet()) {
const std::vector<AppDetectionInfo>& value = m_AppDetectionInfos;
const std::string currentValuePath = _pathPrefix + ".appDetectionInfos";
if (value.size() < 1) {
success = false;
msg << currentValuePath << ": must have at least 1 elements;";
}
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const AppDetectionInfo& value : value) {
const std::string currentValuePath =
oldValuePath + "[" + std::to_string(i) + "]";
success =
value.validate(msg, currentValuePath + ".appDetectionInfos") &&
success;
i++;
}
}
}
if (ruleReportsIsSet()) {
const std::vector<RuleReport>& value = m_RuleReports;
const std::string currentValuePath = _pathPrefix + ".ruleReports";
if (value.size() < 1) {
success = false;
msg << currentValuePath << ": must have at least 1 elements;";
}
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const RuleReport& value : value) {
const std::string currentValuePath =
oldValuePath + "[" + std::to_string(i) + "]";
success =
value.validate(msg, currentValuePath + ".ruleReports") && success;
i++;
}
}
}
if (sessRuleReportsIsSet()) {
const std::vector<SessionRuleReport>& value = m_SessRuleReports;
const std::string currentValuePath = _pathPrefix + ".sessRuleReports";
if (value.size() < 1) {
success = false;
msg << currentValuePath << ": must have at least 1 elements;";
}
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const SessionRuleReport& value : value) {
const std::string currentValuePath =
oldValuePath + "[" + std::to_string(i) + "]";
success = value.validate(msg, currentValuePath + ".sessRuleReports") &&
success;
i++;
}
}
}
if (qncReportsIsSet()) {
const std::vector<QosNotificationControlInfo>& value = m_QncReports;
const std::string currentValuePath = _pathPrefix + ".qncReports";
if (value.size() < 1) {
success = false;
msg << currentValuePath << ": must have at least 1 elements;";
}
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const QosNotificationControlInfo& value : value) {
const std::string currentValuePath =
oldValuePath + "[" + std::to_string(i) + "]";
success =
value.validate(msg, currentValuePath + ".qncReports") && success;
i++;
}
}
}
if (qosMonReportsIsSet()) {
const std::vector<QosMonitoringReport>& value = m_QosMonReports;
const std::string currentValuePath = _pathPrefix + ".qosMonReports";
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const QosMonitoringReport& value : value) {
const std::string currentValuePath =
oldValuePath + "[" + std::to_string(i) + "]";
success =
value.validate(msg, currentValuePath + ".qosMonReports") && success;
i++;
}
}
}
if (repPraInfosIsSet()) {
const std::map<std::string, PresenceInfo>& value = m_RepPraInfos;
const std::string currentValuePath = _pathPrefix + ".repPraInfos";
}
if (tsnPortManContNwttsIsSet()) {
const std::vector<PortManagementContainer>& value = m_TsnPortManContNwtts;
const std::string currentValuePath = _pathPrefix + ".tsnPortManContNwtts";
if (value.size() < 1) {
success = false;
msg << currentValuePath << ": must have at least 1 elements;";
}
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const PortManagementContainer& value : value) {
const std::string currentValuePath =
oldValuePath + "[" + std::to_string(i) + "]";
success =
value.validate(msg, currentValuePath + ".tsnPortManContNwtts") &&
success;
i++;
}
}
}
if (mulAddrInfosIsSet()) {
const std::vector<IpMulticastAddressInfo>& value = m_MulAddrInfos;
const std::string currentValuePath = _pathPrefix + ".mulAddrInfos";
if (value.size() < 1) {
success = false;
msg << currentValuePath << ": must have at least 1 elements;";
}
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const IpMulticastAddressInfo& value : value) {
const std::string currentValuePath =
oldValuePath + "[" + std::to_string(i) + "]";
success =
value.validate(msg, currentValuePath + ".mulAddrInfos") && success;
i++;
}
}
} */
return success;
} // namespace model
bool SmPolicyUpdateContextData::operator==(
const SmPolicyUpdateContextData& rhs) const {
return
((!repPolicyCtrlReqTriggersIsSet() &&
!rhs.repPolicyCtrlReqTriggersIsSet()) ||
(repPolicyCtrlReqTriggersIsSet() &&
rhs.repPolicyCtrlReqTriggersIsSet() &&
getRepPolicyCtrlReqTriggers() == rhs.getRepPolicyCtrlReqTriggers())) &&
/*
((!accNetChIdsIsSet() && !rhs.accNetChIdsIsSet()) ||
(accNetChIdsIsSet() && rhs.accNetChIdsIsSet() &&
getAccNetChIds() == rhs.getAccNetChIds())) &&
*/
((!accessTypeIsSet() && !rhs.accessTypeIsSet()) ||
(accessTypeIsSet() && rhs.accessTypeIsSet() &&
getAccessType() == rhs.getAccessType())) &&
((!ratTypeIsSet() && !rhs.ratTypeIsSet()) ||
(ratTypeIsSet() && rhs.ratTypeIsSet() &&
getRatType() == rhs.getRatType())) &&
/*
((!addAccessInfoIsSet() && !rhs.addAccessInfoIsSet()) ||
(addAccessInfoIsSet() && rhs.addAccessInfoIsSet() &&
getAddAccessInfo() == rhs.getAddAccessInfo())) &&
((!relAccessInfoIsSet() && !rhs.relAccessInfoIsSet()) ||
(relAccessInfoIsSet() && rhs.relAccessInfoIsSet() &&
getRelAccessInfo() == rhs.getRelAccessInfo())) &&
*/
((!servingNetworkIsSet() && !rhs.servingNetworkIsSet()) ||
(servingNetworkIsSet() && rhs.servingNetworkIsSet() &&
getServingNetwork() == rhs.getServingNetwork())) &&
((!userLocationInfoIsSet() && !rhs.userLocationInfoIsSet()) ||
(userLocationInfoIsSet() && rhs.userLocationInfoIsSet() &&
getUserLocationInfo() == rhs.getUserLocationInfo())) &&
((!ueTimeZoneIsSet() && !rhs.ueTimeZoneIsSet()) ||
(ueTimeZoneIsSet() && rhs.ueTimeZoneIsSet() &&
getUeTimeZone() == rhs.getUeTimeZone())) &&
((!relIpv4AddressIsSet() && !rhs.relIpv4AddressIsSet()) ||
(relIpv4AddressIsSet() && rhs.relIpv4AddressIsSet() &&
getRelIpv4Address() == rhs.getRelIpv4Address())) &&
((!ipv4AddressIsSet() && !rhs.ipv4AddressIsSet()) ||
(ipv4AddressIsSet() && rhs.ipv4AddressIsSet() &&
getIpv4Address() == rhs.getIpv4Address())) &&
((!ipDomainIsSet() && !rhs.ipDomainIsSet()) ||
(ipDomainIsSet() && rhs.ipDomainIsSet() &&
getIpDomain() == rhs.getIpDomain())) &&
/*
((!ipv6AddressPrefixIsSet() && !rhs.ipv6AddressPrefixIsSet()) ||
(ipv6AddressPrefixIsSet() && rhs.ipv6AddressPrefixIsSet() &&
getIpv6AddressPrefix() == rhs.getIpv6AddressPrefix())) &&
((!relIpv6AddressPrefixIsSet() && !rhs.relIpv6AddressPrefixIsSet()) ||
(relIpv6AddressPrefixIsSet() && rhs.relIpv6AddressPrefixIsSet() &&
getRelIpv6AddressPrefix() == rhs.getRelIpv6AddressPrefix())) &&
((!addIpv6AddrPrefixesIsSet() && !rhs.addIpv6AddrPrefixesIsSet()) ||
(addIpv6AddrPrefixesIsSet() && rhs.addIpv6AddrPrefixesIsSet() &&
getAddIpv6AddrPrefixes() == rhs.getAddIpv6AddrPrefixes())) &&
((!addRelIpv6AddrPrefixesIsSet() && !rhs.addRelIpv6AddrPrefixesIsSet()) ||
(addRelIpv6AddrPrefixesIsSet() && rhs.addRelIpv6AddrPrefixesIsSet() &&
getAddRelIpv6AddrPrefixes() == rhs.getAddRelIpv6AddrPrefixes())) &&
*/
((!relUeMacIsSet() && !rhs.relUeMacIsSet()) ||
(relUeMacIsSet() && rhs.relUeMacIsSet() &&
getRelUeMac() == rhs.getRelUeMac())) &&
((!ueMacIsSet() && !rhs.ueMacIsSet()) ||
(ueMacIsSet() && rhs.ueMacIsSet() && getUeMac() == rhs.getUeMac())) &&
/*
((!subsSessAmbrIsSet() && !rhs.subsSessAmbrIsSet()) ||
(subsSessAmbrIsSet() && rhs.subsSessAmbrIsSet() &&
getSubsSessAmbr() == rhs.getSubsSessAmbr())) &&
*/
((!authProfIndexIsSet() && !rhs.authProfIndexIsSet()) ||
(authProfIndexIsSet() && rhs.authProfIndexIsSet() &&
getAuthProfIndex() == rhs.getAuthProfIndex())) &&
/*
((!subsDefQosIsSet() && !rhs.subsDefQosIsSet()) ||
(subsDefQosIsSet() && rhs.subsDefQosIsSet() &&
getSubsDefQos() == rhs.getSubsDefQos())) &&
*/
((!numOfPackFilterIsSet() && !rhs.numOfPackFilterIsSet()) ||
(numOfPackFilterIsSet() && rhs.numOfPackFilterIsSet() &&
getNumOfPackFilter() == rhs.getNumOfPackFilter())) &&
/*
((!accuUsageReportsIsSet() && !rhs.accuUsageReportsIsSet()) ||
(accuUsageReportsIsSet() && rhs.accuUsageReportsIsSet() &&
getAccuUsageReports() == rhs.getAccuUsageReports())) &&
*/
((!r3gppPsDataOffStatusIsSet() && !rhs.r3gppPsDataOffStatusIsSet()) ||
(r3gppPsDataOffStatusIsSet() && rhs.r3gppPsDataOffStatusIsSet() &&
isR3gppPsDataOffStatus() == rhs.isR3gppPsDataOffStatus())) &&
/*
((!appDetectionInfosIsSet() && !rhs.appDetectionInfosIsSet()) ||
(appDetectionInfosIsSet() && rhs.appDetectionInfosIsSet() &&
getAppDetectionInfos() == rhs.getAppDetectionInfos())) &&
((!ruleReportsIsSet() && !rhs.ruleReportsIsSet()) ||
(ruleReportsIsSet() && rhs.ruleReportsIsSet() &&
getRuleReports() == rhs.getRuleReports())) &&
((!sessRuleReportsIsSet() && !rhs.sessRuleReportsIsSet()) ||
(sessRuleReportsIsSet() && rhs.sessRuleReportsIsSet() &&
getSessRuleReports() == rhs.getSessRuleReports())) &&
((!qncReportsIsSet() && !rhs.qncReportsIsSet()) ||
(qncReportsIsSet() && rhs.qncReportsIsSet() &&
getQncReports() == rhs.getQncReports())) &&
((!qosMonReportsIsSet() && !rhs.qosMonReportsIsSet()) ||
(qosMonReportsIsSet() && rhs.qosMonReportsIsSet() &&
getQosMonReports() == rhs.getQosMonReports())) &&
*/
((!userLocationInfoTimeIsSet() && !rhs.userLocationInfoTimeIsSet()) ||
(userLocationInfoTimeIsSet() && rhs.userLocationInfoTimeIsSet() &&
getUserLocationInfoTime() == rhs.getUserLocationInfoTime())) &&
/*
((!repPraInfosIsSet() && !rhs.repPraInfosIsSet()) ||
(repPraInfosIsSet() && rhs.repPraInfosIsSet() &&
getRepPraInfos() == rhs.getRepPraInfos())) &&
((!ueInitResReqIsSet() && !rhs.ueInitResReqIsSet()) ||
(ueInitResReqIsSet() && rhs.ueInitResReqIsSet() &&
getUeInitResReq() == rhs.getUeInitResReq())) &&
*/
((!refQosIndicationIsSet() && !rhs.refQosIndicationIsSet()) ||
(refQosIndicationIsSet() && rhs.refQosIndicationIsSet() &&
isRefQosIndication() == rhs.isRefQosIndication())) &&
/*
((!qosFlowUsageIsSet() && !rhs.qosFlowUsageIsSet()) ||
(qosFlowUsageIsSet() && rhs.qosFlowUsageIsSet() &&
getQosFlowUsage() == rhs.getQosFlowUsage())) &&
((!creditManageStatusIsSet() && !rhs.creditManageStatusIsSet()) ||
(creditManageStatusIsSet() && rhs.creditManageStatusIsSet() &&
getCreditManageStatus() == rhs.getCreditManageStatus())) &&
((!servNfIdIsSet() && !rhs.servNfIdIsSet()) ||
(servNfIdIsSet() && rhs.servNfIdIsSet() &&
getServNfId() == rhs.getServNfId())) &&
*/
((!traceReqIsSet() && !rhs.traceReqIsSet()) ||
(traceReqIsSet() && rhs.traceReqIsSet() &&
getTraceReq() == rhs.getTraceReq()))
/*
&&
((!maPduIndIsSet() && !rhs.maPduIndIsSet()) ||
(maPduIndIsSet() && rhs.maPduIndIsSet() &&
getMaPduInd() == rhs.getMaPduInd())) &&
((!atsssCapabIsSet() && !rhs.atsssCapabIsSet()) ||
(atsssCapabIsSet() && rhs.atsssCapabIsSet() &&
getAtsssCapab() == rhs.getAtsssCapab())) &&
((!tsnBridgeInfoIsSet() && !rhs.tsnBridgeInfoIsSet()) ||
(tsnBridgeInfoIsSet() && rhs.tsnBridgeInfoIsSet() &&
getTsnBridgeInfo() == rhs.getTsnBridgeInfo())) &&
((!tsnPortManContDsttIsSet() && !rhs.tsnPortManContDsttIsSet()) ||
(tsnPortManContDsttIsSet() && rhs.tsnPortManContDsttIsSet() &&
getTsnPortManContDstt() == rhs.getTsnPortManContDstt())) &&
((!tsnPortManContNwttsIsSet() && !rhs.tsnPortManContNwttsIsSet()) ||
(tsnPortManContNwttsIsSet() && rhs.tsnPortManContNwttsIsSet() &&
getTsnPortManContNwtts() == rhs.getTsnPortManContNwtts())) &&
((!mulAddrInfosIsSet() && !rhs.mulAddrInfosIsSet()) ||
(mulAddrInfosIsSet() && rhs.mulAddrInfosIsSet() &&
getMulAddrInfos() == rhs.getMulAddrInfos()))
*/
;
}
bool SmPolicyUpdateContextData::operator!=(
const SmPolicyUpdateContextData& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const SmPolicyUpdateContextData& o) {
j = nlohmann::json();
if (o.repPolicyCtrlReqTriggersIsSet() ||
!o.m_RepPolicyCtrlReqTriggers.empty())
j["repPolicyCtrlReqTriggers"] = o.m_RepPolicyCtrlReqTriggers;
// if (o.accNetChIdsIsSet() || !o.m_AccNetChIds.empty())
// j["accNetChIds"] = o.m_AccNetChIds;
if (o.accessTypeIsSet()) j["accessType"] = o.m_AccessType;
if (o.ratTypeIsSet()) j["ratType"] = o.m_RatType;
// if (o.addAccessInfoIsSet()) j["addAccessInfo"] = o.m_AddAccessInfo;
// if (o.relAccessInfoIsSet()) j["relAccessInfo"] = o.m_RelAccessInfo;
if (o.servingNetworkIsSet()) j["servingNetwork"] = o.m_ServingNetwork;
if (o.userLocationInfoIsSet()) j["userLocationInfo"] = o.m_UserLocationInfo;
if (o.ueTimeZoneIsSet()) j["ueTimeZone"] = o.m_UeTimeZone;
if (o.relIpv4AddressIsSet()) j["relIpv4Address"] = o.m_RelIpv4Address;
if (o.ipv4AddressIsSet()) j["ipv4Address"] = o.m_Ipv4Address;
if (o.ipDomainIsSet()) j["ipDomain"] = o.m_IpDomain;
// if (o.ipv6AddressPrefixIsSet())
// j["ipv6AddressPrefix"] = o.m_Ipv6AddressPrefix;
// if (o.relIpv6AddressPrefixIsSet())
// j["relIpv6AddressPrefix"] = o.m_RelIpv6AddressPrefix;
// if (o.addIpv6AddrPrefixesIsSet())
// j["addIpv6AddrPrefixes"] = o.m_AddIpv6AddrPrefixes;
// if (o.addRelIpv6AddrPrefixesIsSet())
// j["addRelIpv6AddrPrefixes"] = o.m_AddRelIpv6AddrPrefixes;
if (o.relUeMacIsSet()) j["relUeMac"] = o.m_RelUeMac;
if (o.ueMacIsSet()) j["ueMac"] = o.m_UeMac;
// if (o.subsSessAmbrIsSet()) j["subsSessAmbr"] = o.m_SubsSessAmbr;
if (o.authProfIndexIsSet()) j["authProfIndex"] = o.m_AuthProfIndex;
// if (o.subsDefQosIsSet()) j["subsDefQos"] = o.m_SubsDefQos;
if (o.numOfPackFilterIsSet()) j["numOfPackFilter"] = o.m_NumOfPackFilter;
// if (o.accuUsageReportsIsSet() || !o.m_AccuUsageReports.empty())
// j["accuUsageReports"] = o.m_AccuUsageReports;
if (o.r3gppPsDataOffStatusIsSet())
j["3gppPsDataOffStatus"] = o.m_r_3gppPsDataOffStatus;
// if (o.appDetectionInfosIsSet() || !o.m_AppDetectionInfos.empty())
// j["appDetectionInfos"] = o.m_AppDetectionInfos;
// if (o.ruleReportsIsSet() || !o.m_RuleReports.empty())
// j["ruleReports"] = o.m_RuleReports;
// if (o.sessRuleReportsIsSet() || !o.m_SessRuleReports.empty())
// j["sessRuleReports"] = o.m_SessRuleReports;
// if (o.qncReportsIsSet() || !o.m_QncReports.empty())
// j["qncReports"] = o.m_QncReports;
// if (o.qosMonReportsIsSet() || !o.m_QosMonReports.empty())
// j["qosMonReports"] = o.m_QosMonReports;
if (o.userLocationInfoTimeIsSet())
j["userLocationInfoTime"] = o.m_UserLocationInfoTime;
// if (o.repPraInfosIsSet() || !o.m_RepPraInfos.empty())
// j["repPraInfos"] = o.m_RepPraInfos;
// if (o.ueInitResReqIsSet()) j["ueInitResReq"] = o.m_UeInitResReq;
if (o.refQosIndicationIsSet()) j["refQosIndication"] = o.m_RefQosIndication;
// if (o.qosFlowUsageIsSet()) j["qosFlowUsage"] = o.m_QosFlowUsage;
// if (o.creditManageStatusIsSet())
// j["creditManageStatus"] = o.m_CreditManageStatus;
// if (o.servNfIdIsSet()) j["servNfId"] = o.m_ServNfId;
// if (o.traceReqIsSet()) j["traceReq"] = o.m_TraceReq;
// if (o.maPduIndIsSet()) j["maPduInd"] = o.m_MaPduInd;
// if (o.atsssCapabIsSet()) j["atsssCapab"] = o.m_AtsssCapab;
// if (o.tsnBridgeInfoIsSet()) j["tsnBridgeInfo"] = o.m_TsnBridgeInfo;
// if (o.tsnPortManContDsttIsSet())
// j["tsnPortManContDstt"] = o.m_TsnPortManContDstt;
// if (o.tsnPortManContNwttsIsSet() || !o.m_TsnPortManContNwtts.empty())
// j["tsnPortManContNwtts"] = o.m_TsnPortManContNwtts;
// if (o.mulAddrInfosIsSet() || !o.m_MulAddrInfos.empty())
// j["mulAddrInfos"] = o.m_MulAddrInfos;
}
void from_json(const nlohmann::json& j, SmPolicyUpdateContextData& o) {
if (j.find("repPolicyCtrlReqTriggers") != j.end()) {
j.at("repPolicyCtrlReqTriggers").get_to(o.m_RepPolicyCtrlReqTriggers);
o.m_RepPolicyCtrlReqTriggersIsSet = true;
}
/*
if (j.find("accNetChIds") != j.end()) {
j.at("accNetChIds").get_to(o.m_AccNetChIds);
o.m_AccNetChIdsIsSet = true;
}
*/
if (j.find("accessType") != j.end()) {
j.at("accessType").get_to(o.m_AccessType);
o.m_AccessTypeIsSet = true;
}
if (j.find("ratType") != j.end()) {
j.at("ratType").get_to(o.m_RatType);
o.m_RatTypeIsSet = true;
}
/*
if (j.find("addAccessInfo") != j.end()) {
j.at("addAccessInfo").get_to(o.m_AddAccessInfo);
o.m_AddAccessInfoIsSet = true;
}
if (j.find("relAccessInfo") != j.end()) {
j.at("relAccessInfo").get_to(o.m_RelAccessInfo);
o.m_RelAccessInfoIsSet = true;
}
*/
if (j.find("servingNetwork") != j.end()) {
j.at("servingNetwork").get_to(o.m_ServingNetwork);
o.m_ServingNetworkIsSet = true;
}
if (j.find("userLocationInfo") != j.end()) {
j.at("userLocationInfo").get_to(o.m_UserLocationInfo);
o.m_UserLocationInfoIsSet = true;
}
if (j.find("ueTimeZone") != j.end()) {
j.at("ueTimeZone").get_to(o.m_UeTimeZone);
o.m_UeTimeZoneIsSet = true;
}
if (j.find("relIpv4Address") != j.end()) {
j.at("relIpv4Address").get_to(o.m_RelIpv4Address);
o.m_RelIpv4AddressIsSet = true;
}
if (j.find("ipv4Address") != j.end()) {
j.at("ipv4Address").get_to(o.m_Ipv4Address);
o.m_Ipv4AddressIsSet = true;
}
if (j.find("ipDomain") != j.end()) {
j.at("ipDomain").get_to(o.m_IpDomain);
o.m_IpDomainIsSet = true;
}
if (j.find("ipv6AddressPrefix") != j.end()) {
j.at("ipv6AddressPrefix").get_to(o.m_Ipv6AddressPrefix);
o.m_Ipv6AddressPrefixIsSet = true;
}
if (j.find("relIpv6AddressPrefix") != j.end()) {
j.at("relIpv6AddressPrefix").get_to(o.m_RelIpv6AddressPrefix);
o.m_RelIpv6AddressPrefixIsSet = true;
}
if (j.find("addIpv6AddrPrefixes") != j.end()) {
j.at("addIpv6AddrPrefixes").get_to(o.m_AddIpv6AddrPrefixes);
o.m_AddIpv6AddrPrefixesIsSet = true;
}
if (j.find("addRelIpv6AddrPrefixes") != j.end()) {
j.at("addRelIpv6AddrPrefixes").get_to(o.m_AddRelIpv6AddrPrefixes);
o.m_AddRelIpv6AddrPrefixesIsSet = true;
}
if (j.find("relUeMac") != j.end()) {
j.at("relUeMac").get_to(o.m_RelUeMac);
o.m_RelUeMacIsSet = true;
}
if (j.find("ueMac") != j.end()) {
j.at("ueMac").get_to(o.m_UeMac);
o.m_UeMacIsSet = true;
}
/*
if (j.find("subsSessAmbr") != j.end()) {
j.at("subsSessAmbr").get_to(o.m_SubsSessAmbr);
o.m_SubsSessAmbrIsSet = true;
}
*/
if (j.find("authProfIndex") != j.end()) {
j.at("authProfIndex").get_to(o.m_AuthProfIndex);
o.m_AuthProfIndexIsSet = true;
}
/*
if (j.find("subsDefQos") != j.end()) {
j.at("subsDefQos").get_to(o.m_SubsDefQos);
o.m_SubsDefQosIsSet = true;
}
*/
if (j.find("numOfPackFilter") != j.end()) {
j.at("numOfPackFilter").get_to(o.m_NumOfPackFilter);
o.m_NumOfPackFilterIsSet = true;
}
/*
if (j.find("accuUsageReports") != j.end()) {
j.at("accuUsageReports").get_to(o.m_AccuUsageReports);
o.m_AccuUsageReportsIsSet = true;
}
*/
if (j.find("3gppPsDataOffStatus") != j.end()) {
j.at("3gppPsDataOffStatus").get_to(o.m_r_3gppPsDataOffStatus);
o.m_r_3gppPsDataOffStatusIsSet = true;
}
/*
if (j.find("appDetectionInfos") != j.end()) {
j.at("appDetectionInfos").get_to(o.m_AppDetectionInfos);
o.m_AppDetectionInfosIsSet = true;
}
if (j.find("ruleReports") != j.end()) {
j.at("ruleReports").get_to(o.m_RuleReports);
o.m_RuleReportsIsSet = true;
}
if (j.find("sessRuleReports") != j.end()) {
j.at("sessRuleReports").get_to(o.m_SessRuleReports);
o.m_SessRuleReportsIsSet = true;
}
if (j.find("qncReports") != j.end()) {
j.at("qncReports").get_to(o.m_QncReports);
o.m_QncReportsIsSet = true;
}
if (j.find("qosMonReports") != j.end()) {
j.at("qosMonReports").get_to(o.m_QosMonReports);
o.m_QosMonReportsIsSet = true;
}
*/
if (j.find("userLocationInfoTime") != j.end()) {
j.at("userLocationInfoTime").get_to(o.m_UserLocationInfoTime);
o.m_UserLocationInfoTimeIsSet = true;
}
/*
if (j.find("repPraInfos") != j.end()) {
j.at("repPraInfos").get_to(o.m_RepPraInfos);
o.m_RepPraInfosIsSet = true;
}
if (j.find("ueInitResReq") != j.end()) {
j.at("ueInitResReq").get_to(o.m_UeInitResReq);
o.m_UeInitResReqIsSet = true;
}
if (j.find("refQosIndication") != j.end()) {
j.at("refQosIndication").get_to(o.m_RefQosIndication);
o.m_RefQosIndicationIsSet = true;
}
if (j.find("qosFlowUsage") != j.end()) {
j.at("qosFlowUsage").get_to(o.m_QosFlowUsage);
o.m_QosFlowUsageIsSet = true;
}
if (j.find("creditManageStatus") != j.end()) {
j.at("creditManageStatus").get_to(o.m_CreditManageStatus);
o.m_CreditManageStatusIsSet = true;
}
if (j.find("servNfId") != j.end()) {
j.at("servNfId").get_to(o.m_ServNfId);
o.m_ServNfIdIsSet = true;
}
if (j.find("traceReq") != j.end()) {
j.at("traceReq").get_to(o.m_TraceReq);
o.m_TraceReqIsSet = true;
}
if (j.find("maPduInd") != j.end()) {
j.at("maPduInd").get_to(o.m_MaPduInd);
o.m_MaPduIndIsSet = true;
}
if (j.find("atsssCapab") != j.end()) {
j.at("atsssCapab").get_to(o.m_AtsssCapab);
o.m_AtsssCapabIsSet = true;
}
if (j.find("tsnBridgeInfo") != j.end()) {
j.at("tsnBridgeInfo").get_to(o.m_TsnBridgeInfo);
o.m_TsnBridgeInfoIsSet = true;
}
if (j.find("tsnPortManContDstt") != j.end()) {
j.at("tsnPortManContDstt").get_to(o.m_TsnPortManContDstt);
o.m_TsnPortManContDsttIsSet = true;
}
if (j.find("tsnPortManContNwtts") != j.end()) {
j.at("tsnPortManContNwtts").get_to(o.m_TsnPortManContNwtts);
o.m_TsnPortManContNwttsIsSet = true;
}
if (j.find("mulAddrInfos") != j.end()) {
j.at("mulAddrInfos").get_to(o.m_MulAddrInfos);
o.m_MulAddrInfosIsSet = true;
}
*/
}
std::vector<PolicyControlRequestTrigger>
SmPolicyUpdateContextData::getRepPolicyCtrlReqTriggers() const {
return m_RepPolicyCtrlReqTriggers;
}
void SmPolicyUpdateContextData::setRepPolicyCtrlReqTriggers(
std::vector<PolicyControlRequestTrigger> const& value) {
m_RepPolicyCtrlReqTriggers = value;
m_RepPolicyCtrlReqTriggersIsSet = true;
}
bool SmPolicyUpdateContextData::repPolicyCtrlReqTriggersIsSet() const {
return m_RepPolicyCtrlReqTriggersIsSet;
}
void SmPolicyUpdateContextData::unsetRepPolicyCtrlReqTriggers() {
m_RepPolicyCtrlReqTriggersIsSet = false;
}
/*
std::vector<AccNetChId> SmPolicyUpdateContextData::getAccNetChIds() const {
return m_AccNetChIds;
}
void SmPolicyUpdateContextData::setAccNetChIds(
std::vector<AccNetChId> const& value) {
m_AccNetChIds = value;
m_AccNetChIdsIsSet = true;
}
bool SmPolicyUpdateContextData::accNetChIdsIsSet() const {
return m_AccNetChIdsIsSet;
}
void SmPolicyUpdateContextData::unsetAccNetChIds() {
m_AccNetChIdsIsSet = false;
}
*/
AccessType SmPolicyUpdateContextData::getAccessType() const {
return m_AccessType;
}
void SmPolicyUpdateContextData::setAccessType(AccessType const& value) {
m_AccessType = value;
m_AccessTypeIsSet = true;
}
bool SmPolicyUpdateContextData::accessTypeIsSet() const {
return m_AccessTypeIsSet;
}
void SmPolicyUpdateContextData::unsetAccessType() {
m_AccessTypeIsSet = false;
}
RatType SmPolicyUpdateContextData::getRatType() const {
return m_RatType;
}
void SmPolicyUpdateContextData::setRatType(RatType const& value) {
m_RatType = value;
m_RatTypeIsSet = true;
}
bool SmPolicyUpdateContextData::ratTypeIsSet() const {
return m_RatTypeIsSet;
}
void SmPolicyUpdateContextData::unsetRatType() {
m_RatTypeIsSet = false;
}
/*
AdditionalAccessInfo SmPolicyUpdateContextData::getAddAccessInfo() const {
return m_AddAccessInfo;
}
void SmPolicyUpdateContextData::setAddAccessInfo(
AdditionalAccessInfo const& value) {
m_AddAccessInfo = value;
m_AddAccessInfoIsSet = true;
}
bool SmPolicyUpdateContextData::addAccessInfoIsSet() const {
return m_AddAccessInfoIsSet;
}
void SmPolicyUpdateContextData::unsetAddAccessInfo() {
m_AddAccessInfoIsSet = false;
}
AdditionalAccessInfo SmPolicyUpdateContextData::getRelAccessInfo() const {
return m_RelAccessInfo;
}
void SmPolicyUpdateContextData::setRelAccessInfo(
AdditionalAccessInfo const& value) {
m_RelAccessInfo = value;
m_RelAccessInfoIsSet = true;
}
bool SmPolicyUpdateContextData::relAccessInfoIsSet() const {
return m_RelAccessInfoIsSet;
}
void SmPolicyUpdateContextData::unsetRelAccessInfo() {
m_RelAccessInfoIsSet = false;
}
*/
PlmnIdNid SmPolicyUpdateContextData::getServingNetwork() const {
return m_ServingNetwork;
}
void SmPolicyUpdateContextData::setServingNetwork(PlmnIdNid const& value) {
m_ServingNetwork = value;
m_ServingNetworkIsSet = true;
}
bool SmPolicyUpdateContextData::servingNetworkIsSet() const {
return m_ServingNetworkIsSet;
}
void SmPolicyUpdateContextData::unsetServingNetwork() {
m_ServingNetworkIsSet = false;
}
UserLocation SmPolicyUpdateContextData::getUserLocationInfo() const {
return m_UserLocationInfo;
}
void SmPolicyUpdateContextData::setUserLocationInfo(UserLocation const& value) {
m_UserLocationInfo = value;
m_UserLocationInfoIsSet = true;
}
bool SmPolicyUpdateContextData::userLocationInfoIsSet() const {
return m_UserLocationInfoIsSet;
}
void SmPolicyUpdateContextData::unsetUserLocationInfo() {
m_UserLocationInfoIsSet = false;
}
std::string SmPolicyUpdateContextData::getUeTimeZone() const {
return m_UeTimeZone;
}
void SmPolicyUpdateContextData::setUeTimeZone(std::string const& value) {
m_UeTimeZone = value;
m_UeTimeZoneIsSet = true;
}
bool SmPolicyUpdateContextData::ueTimeZoneIsSet() const {
return m_UeTimeZoneIsSet;
}
void SmPolicyUpdateContextData::unsetUeTimeZone() {
m_UeTimeZoneIsSet = false;
}
std::string SmPolicyUpdateContextData::getRelIpv4Address() const {
return m_RelIpv4Address;
}
void SmPolicyUpdateContextData::setRelIpv4Address(std::string const& value) {
m_RelIpv4Address = value;
m_RelIpv4AddressIsSet = true;
}
bool SmPolicyUpdateContextData::relIpv4AddressIsSet() const {
return m_RelIpv4AddressIsSet;
}
void SmPolicyUpdateContextData::unsetRelIpv4Address() {
m_RelIpv4AddressIsSet = false;
}
std::string SmPolicyUpdateContextData::getIpv4Address() const {
return m_Ipv4Address;
}
void SmPolicyUpdateContextData::setIpv4Address(std::string const& value) {
m_Ipv4Address = value;
m_Ipv4AddressIsSet = true;
}
bool SmPolicyUpdateContextData::ipv4AddressIsSet() const {
return m_Ipv4AddressIsSet;
}
void SmPolicyUpdateContextData::unsetIpv4Address() {
m_Ipv4AddressIsSet = false;
}
std::string SmPolicyUpdateContextData::getIpDomain() const {
return m_IpDomain;
}
void SmPolicyUpdateContextData::setIpDomain(std::string const& value) {
m_IpDomain = value;
m_IpDomainIsSet = true;
}
bool SmPolicyUpdateContextData::ipDomainIsSet() const {
return m_IpDomainIsSet;
}
void SmPolicyUpdateContextData::unsetIpDomain() {
m_IpDomainIsSet = false;
}
/*
Ipv6Prefix SmPolicyUpdateContextData::getIpv6AddressPrefix() const {
return m_Ipv6AddressPrefix;
}
void SmPolicyUpdateContextData::setIpv6AddressPrefix(Ipv6Prefix const& value) {
m_Ipv6AddressPrefix = value;
m_Ipv6AddressPrefixIsSet = true;
}
bool SmPolicyUpdateContextData::ipv6AddressPrefixIsSet() const {
return m_Ipv6AddressPrefixIsSet;
}
void SmPolicyUpdateContextData::unsetIpv6AddressPrefix() {
m_Ipv6AddressPrefixIsSet = false;
}
Ipv6Prefix SmPolicyUpdateContextData::getRelIpv6AddressPrefix() const {
return m_RelIpv6AddressPrefix;
}
void SmPolicyUpdateContextData::setRelIpv6AddressPrefix(
Ipv6Prefix const& value) {
m_RelIpv6AddressPrefix = value;
m_RelIpv6AddressPrefixIsSet = true;
}
bool SmPolicyUpdateContextData::relIpv6AddressPrefixIsSet() const {
return m_RelIpv6AddressPrefixIsSet;
}
void SmPolicyUpdateContextData::unsetRelIpv6AddressPrefix() {
m_RelIpv6AddressPrefixIsSet = false;
}
Ipv6Prefix SmPolicyUpdateContextData::getAddIpv6AddrPrefixes() const {
return m_AddIpv6AddrPrefixes;
}
void SmPolicyUpdateContextData::setAddIpv6AddrPrefixes(
Ipv6Prefix const& value) {
m_AddIpv6AddrPrefixes = value;
m_AddIpv6AddrPrefixesIsSet = true;
}
bool SmPolicyUpdateContextData::addIpv6AddrPrefixesIsSet() const {
return m_AddIpv6AddrPrefixesIsSet;
}
void SmPolicyUpdateContextData::unsetAddIpv6AddrPrefixes() {
m_AddIpv6AddrPrefixesIsSet = false;
}
Ipv6Prefix SmPolicyUpdateContextData::getAddRelIpv6AddrPrefixes() const {
return m_AddRelIpv6AddrPrefixes;
}
void SmPolicyUpdateContextData::setAddRelIpv6AddrPrefixes(
Ipv6Prefix const& value) {
m_AddRelIpv6AddrPrefixes = value;
m_AddRelIpv6AddrPrefixesIsSet = true;
}
bool SmPolicyUpdateContextData::addRelIpv6AddrPrefixesIsSet() const {
return m_AddRelIpv6AddrPrefixesIsSet;
}
void SmPolicyUpdateContextData::unsetAddRelIpv6AddrPrefixes() {
m_AddRelIpv6AddrPrefixesIsSet = false;
}
*/
std::string SmPolicyUpdateContextData::getRelUeMac() const {
return m_RelUeMac;
}
void SmPolicyUpdateContextData::setRelUeMac(std::string const& value) {
m_RelUeMac = value;
m_RelUeMacIsSet = true;
}
bool SmPolicyUpdateContextData::relUeMacIsSet() const {
return m_RelUeMacIsSet;
}
void SmPolicyUpdateContextData::unsetRelUeMac() {
m_RelUeMacIsSet = false;
}
std::string SmPolicyUpdateContextData::getUeMac() const {
return m_UeMac;
}
void SmPolicyUpdateContextData::setUeMac(std::string const& value) {
m_UeMac = value;
m_UeMacIsSet = true;
}
bool SmPolicyUpdateContextData::ueMacIsSet() const {
return m_UeMacIsSet;
}
void SmPolicyUpdateContextData::unsetUeMac() {
m_UeMacIsSet = false;
}
/*
Ambr SmPolicyUpdateContextData::getSubsSessAmbr() const {
return m_SubsSessAmbr;
}
void SmPolicyUpdateContextData::setSubsSessAmbr(Ambr const& value) {
m_SubsSessAmbr = value;
m_SubsSessAmbrIsSet = true;
}
bool SmPolicyUpdateContextData::subsSessAmbrIsSet() const {
return m_SubsSessAmbrIsSet;
}
void SmPolicyUpdateContextData::unsetSubsSessAmbr() {
m_SubsSessAmbrIsSet = false;
}
*/
std::string SmPolicyUpdateContextData::getAuthProfIndex() const {
return m_AuthProfIndex;
}
void SmPolicyUpdateContextData::setAuthProfIndex(std::string const& value) {
m_AuthProfIndex = value;
m_AuthProfIndexIsSet = true;
}
bool SmPolicyUpdateContextData::authProfIndexIsSet() const {
return m_AuthProfIndexIsSet;
}
void SmPolicyUpdateContextData::unsetAuthProfIndex() {
m_AuthProfIndexIsSet = false;
}
/*
SubscribedDefaultQos SmPolicyUpdateContextData::getSubsDefQos() const {
return m_SubsDefQos;
}
void SmPolicyUpdateContextData::setSubsDefQos(
SubscribedDefaultQos const& value) {
m_SubsDefQos = value;
m_SubsDefQosIsSet = true;
}
bool SmPolicyUpdateContextData::subsDefQosIsSet() const {
return m_SubsDefQosIsSet;
}
void SmPolicyUpdateContextData::unsetSubsDefQos() {
m_SubsDefQosIsSet = false;
}
*/
int32_t SmPolicyUpdateContextData::getNumOfPackFilter() const {
return m_NumOfPackFilter;
}
void SmPolicyUpdateContextData::setNumOfPackFilter(int32_t const value) {
m_NumOfPackFilter = value;
m_NumOfPackFilterIsSet = true;
}
bool SmPolicyUpdateContextData::numOfPackFilterIsSet() const {
return m_NumOfPackFilterIsSet;
}
void SmPolicyUpdateContextData::unsetNumOfPackFilter() {
m_NumOfPackFilterIsSet = false;
}
/*
std::vector<AccuUsageReport> SmPolicyUpdateContextData::getAccuUsageReports()
const {
return m_AccuUsageReports;
}
void SmPolicyUpdateContextData::setAccuUsageReports(
std::vector<AccuUsageReport> const& value) {
m_AccuUsageReports = value;
m_AccuUsageReportsIsSet = true;
}
bool SmPolicyUpdateContextData::accuUsageReportsIsSet() const {
return m_AccuUsageReportsIsSet;
}
void SmPolicyUpdateContextData::unsetAccuUsageReports() {
m_AccuUsageReportsIsSet = false;
}
*/
bool SmPolicyUpdateContextData::isR3gppPsDataOffStatus() const {
return m_r_3gppPsDataOffStatus;
}
void SmPolicyUpdateContextData::setR3gppPsDataOffStatus(bool const value) {
m_r_3gppPsDataOffStatus = value;
m_r_3gppPsDataOffStatusIsSet = true;
}
bool SmPolicyUpdateContextData::r3gppPsDataOffStatusIsSet() const {
return m_r_3gppPsDataOffStatusIsSet;
}
void SmPolicyUpdateContextData::unsetr_3gppPsDataOffStatus() {
m_r_3gppPsDataOffStatusIsSet = false;
}
/*
std::vector<AppDetectionInfo> SmPolicyUpdateContextData::getAppDetectionInfos()
const {
return m_AppDetectionInfos;
}
void SmPolicyUpdateContextData::setAppDetectionInfos(
std::vector<AppDetectionInfo> const& value) {
m_AppDetectionInfos = value;
m_AppDetectionInfosIsSet = true;
}
bool SmPolicyUpdateContextData::appDetectionInfosIsSet() const {
return m_AppDetectionInfosIsSet;
}
void SmPolicyUpdateContextData::unsetAppDetectionInfos() {
m_AppDetectionInfosIsSet = false;
}
std::vector<RuleReport> SmPolicyUpdateContextData::getRuleReports() const {
return m_RuleReports;
}
void SmPolicyUpdateContextData::setRuleReports(
std::vector<RuleReport> const& value) {
m_RuleReports = value;
m_RuleReportsIsSet = true;
}
bool SmPolicyUpdateContextData::ruleReportsIsSet() const {
return m_RuleReportsIsSet;
}
void SmPolicyUpdateContextData::unsetRuleReports() {
m_RuleReportsIsSet = false;
}
std::vector<SessionRuleReport> SmPolicyUpdateContextData::getSessRuleReports()
const {
return m_SessRuleReports;
}
void SmPolicyUpdateContextData::setSessRuleReports(
std::vector<SessionRuleReport> const& value) {
m_SessRuleReports = value;
m_SessRuleReportsIsSet = true;
}
bool SmPolicyUpdateContextData::sessRuleReportsIsSet() const {
return m_SessRuleReportsIsSet;
}
void SmPolicyUpdateContextData::unsetSessRuleReports() {
m_SessRuleReportsIsSet = false;
}
std::vector<QosNotificationControlInfo>
SmPolicyUpdateContextData::getQncReports() const {
return m_QncReports;
}
void SmPolicyUpdateContextData::setQncReports(
std::vector<QosNotificationControlInfo> const& value) {
m_QncReports = value;
m_QncReportsIsSet = true;
}
bool SmPolicyUpdateContextData::qncReportsIsSet() const {
return m_QncReportsIsSet;
}
void SmPolicyUpdateContextData::unsetQncReports() {
m_QncReportsIsSet = false;
}
std::vector<QosMonitoringReport> SmPolicyUpdateContextData::getQosMonReports()
const {
return m_QosMonReports;
}
void SmPolicyUpdateContextData::setQosMonReports(
std::vector<QosMonitoringReport> const& value) {
m_QosMonReports = value;
m_QosMonReportsIsSet = true;
}
bool SmPolicyUpdateContextData::qosMonReportsIsSet() const {
return m_QosMonReportsIsSet;
}
void SmPolicyUpdateContextData::unsetQosMonReports() {
m_QosMonReportsIsSet = false;
}
*/
std::string SmPolicyUpdateContextData::getUserLocationInfoTime() const {
return m_UserLocationInfoTime;
}
void SmPolicyUpdateContextData::setUserLocationInfoTime(
std::string const& value) {
m_UserLocationInfoTime = value;
m_UserLocationInfoTimeIsSet = true;
}
bool SmPolicyUpdateContextData::userLocationInfoTimeIsSet() const {
return m_UserLocationInfoTimeIsSet;
}
void SmPolicyUpdateContextData::unsetUserLocationInfoTime() {
m_UserLocationInfoTimeIsSet = false;
}
/*
std::map<std::string, PresenceInfo> SmPolicyUpdateContextData::getRepPraInfos()
const {
return m_RepPraInfos;
}
void SmPolicyUpdateContextData::setRepPraInfos(
std::map<std::string, PresenceInfo> const& value) {
m_RepPraInfos = value;
m_RepPraInfosIsSet = true;
}
bool SmPolicyUpdateContextData::repPraInfosIsSet() const {
return m_RepPraInfosIsSet;
}
void SmPolicyUpdateContextData::unsetRepPraInfos() {
m_RepPraInfosIsSet = false;
}
UeInitiatedResourceRequest SmPolicyUpdateContextData::getUeInitResReq() const {
return m_UeInitResReq;
}
void SmPolicyUpdateContextData::setUeInitResReq(
UeInitiatedResourceRequest const& value) {
m_UeInitResReq = value;
m_UeInitResReqIsSet = true;
}
bool SmPolicyUpdateContextData::ueInitResReqIsSet() const {
return m_UeInitResReqIsSet;
}
void SmPolicyUpdateContextData::unsetUeInitResReq() {
m_UeInitResReqIsSet = false;
}
*/
bool SmPolicyUpdateContextData::isRefQosIndication() const {
return m_RefQosIndication;
}
void SmPolicyUpdateContextData::setRefQosIndication(bool const value) {
m_RefQosIndication = value;
m_RefQosIndicationIsSet = true;
}
bool SmPolicyUpdateContextData::refQosIndicationIsSet() const {
return m_RefQosIndicationIsSet;
}
void SmPolicyUpdateContextData::unsetRefQosIndication() {
m_RefQosIndicationIsSet = false;
}
/*
QosFlowUsage SmPolicyUpdateContextData::getQosFlowUsage() const {
return m_QosFlowUsage;
}
void SmPolicyUpdateContextData::setQosFlowUsage(QosFlowUsage const& value) {
m_QosFlowUsage = value;
m_QosFlowUsageIsSet = true;
}
bool SmPolicyUpdateContextData::qosFlowUsageIsSet() const {
return m_QosFlowUsageIsSet;
}
void SmPolicyUpdateContextData::unsetQosFlowUsage() {
m_QosFlowUsageIsSet = false;
}
CreditManagementStatus SmPolicyUpdateContextData::getCreditManageStatus()
const {
return m_CreditManageStatus;
}
void SmPolicyUpdateContextData::setCreditManageStatus(
CreditManagementStatus const& value) {
m_CreditManageStatus = value;
m_CreditManageStatusIsSet = true;
}
bool SmPolicyUpdateContextData::creditManageStatusIsSet() const {
return m_CreditManageStatusIsSet;
}
void SmPolicyUpdateContextData::unsetCreditManageStatus() {
m_CreditManageStatusIsSet = false;
}
ServingNfIdentity SmPolicyUpdateContextData::getServNfId() const {
return m_ServNfId;
}
void SmPolicyUpdateContextData::setServNfId(ServingNfIdentity const& value) {
m_ServNfId = value;
m_ServNfIdIsSet = true;
}
bool SmPolicyUpdateContextData::servNfIdIsSet() const {
return m_ServNfIdIsSet;
}
void SmPolicyUpdateContextData::unsetServNfId() {
m_ServNfIdIsSet = false;
}
TraceData SmPolicyUpdateContextData::getTraceReq() const {
return m_TraceReq;
}
void SmPolicyUpdateContextData::setTraceReq(TraceData const& value) {
m_TraceReq = value;
m_TraceReqIsSet = true;
}
bool SmPolicyUpdateContextData::traceReqIsSet() const {
return m_TraceReqIsSet;
}
void SmPolicyUpdateContextData::unsetTraceReq() {
m_TraceReqIsSet = false;
}
MaPduIndication SmPolicyUpdateContextData::getMaPduInd() const {
return m_MaPduInd;
}
void SmPolicyUpdateContextData::setMaPduInd(MaPduIndication const& value) {
m_MaPduInd = value;
m_MaPduIndIsSet = true;
}
bool SmPolicyUpdateContextData::maPduIndIsSet() const {
return m_MaPduIndIsSet;
}
void SmPolicyUpdateContextData::unsetMaPduInd() {
m_MaPduIndIsSet = false;
}
AtsssCapability SmPolicyUpdateContextData::getAtsssCapab() const {
return m_AtsssCapab;
}
void SmPolicyUpdateContextData::setAtsssCapab(AtsssCapability const& value) {
m_AtsssCapab = value;
m_AtsssCapabIsSet = true;
}
bool SmPolicyUpdateContextData::atsssCapabIsSet() const {
return m_AtsssCapabIsSet;
}
void SmPolicyUpdateContextData::unsetAtsssCapab() {
m_AtsssCapabIsSet = false;
}
TsnBridgeInfo SmPolicyUpdateContextData::getTsnBridgeInfo() const {
return m_TsnBridgeInfo;
}
void SmPolicyUpdateContextData::setTsnBridgeInfo(TsnBridgeInfo const& value) {
m_TsnBridgeInfo = value;
m_TsnBridgeInfoIsSet = true;
}
bool SmPolicyUpdateContextData::tsnBridgeInfoIsSet() const {
return m_TsnBridgeInfoIsSet;
}
void SmPolicyUpdateContextData::unsetTsnBridgeInfo() {
m_TsnBridgeInfoIsSet = false;
}
PortManagementContainer SmPolicyUpdateContextData::getTsnPortManContDstt()
const {
return m_TsnPortManContDstt;
}
void SmPolicyUpdateContextData::setTsnPortManContDstt(
PortManagementContainer const& value) {
m_TsnPortManContDstt = value;
m_TsnPortManContDsttIsSet = true;
}
bool SmPolicyUpdateContextData::tsnPortManContDsttIsSet() const {
return m_TsnPortManContDsttIsSet;
}
void SmPolicyUpdateContextData::unsetTsnPortManContDstt() {
m_TsnPortManContDsttIsSet = false;
}
std::vector<PortManagementContainer>
SmPolicyUpdateContextData::getTsnPortManContNwtts() const {
return m_TsnPortManContNwtts;
}
void SmPolicyUpdateContextData::setTsnPortManContNwtts(
std::vector<PortManagementContainer> const& value) {
m_TsnPortManContNwtts = value;
m_TsnPortManContNwttsIsSet = true;
}
bool SmPolicyUpdateContextData::tsnPortManContNwttsIsSet() const {
return m_TsnPortManContNwttsIsSet;
}
void SmPolicyUpdateContextData::unsetTsnPortManContNwtts() {
m_TsnPortManContNwttsIsSet = false;
}
std::vector<IpMulticastAddressInfo> SmPolicyUpdateContextData::getMulAddrInfos()
const {
return m_MulAddrInfos;
}
void SmPolicyUpdateContextData::setMulAddrInfos(
std::vector<IpMulticastAddressInfo> const& value) {
m_MulAddrInfos = value;
m_MulAddrInfosIsSet = true;
}
bool SmPolicyUpdateContextData::mulAddrInfosIsSet() const {
return m_MulAddrInfosIsSet;
}
void SmPolicyUpdateContextData::unsetMulAddrInfos() {
m_MulAddrInfosIsSet = false;
}
*/
} // namespace model
} // namespace smf_server
} // namespace oai
/**
* Npcf_SMPolicyControl API
* Session Management Policy Control Service © 2020, 3GPP Organizational
* Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.1.alpha-5
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* SmPolicyUpdateContextData.h
*
*
*/
#ifndef SmPolicyUpdateContextData_H_
#define SmPolicyUpdateContextData_H_
//#include "SubscribedDefaultQos.h"
//#include "QosNotificationControlInfo.h"
//#include "PresenceInfo.h"
//#include "MaPduIndication.h"
//#include "AccuUsageReport.h"
#include "TraceData.h"
#include "PlmnIdNid.h"
#include "PolicyControlRequestTrigger.h"
#include "Ipv6Prefix.h"
//#include "PortManagementContainer.h"
//#include "AppDetectionInfo.h"
//#include "CreditManagementStatus.h"
#include <map>
//#include "AdditionalAccessInfo.h"
//#include "AccNetChId.h"
//#include "Ambr.h"
#include "AtsssCapability.h"
#include "RatType.h"
//#include "SessionRuleReport.h"
#include <string>
//#include "ServingNfIdentity.h"
//#include "UeInitiatedResourceRequest.h"
#include <vector>
#include "AccessType.h"
//#include "QosFlowUsage.h"
//#include "QosMonitoringReport.h"
//#include "RuleReport.h"
#include "UserLocation.h"
//#include "TsnBridgeInfo.h"
//#include "IpMulticastAddressInfo.h"
#include <nlohmann/json.hpp>
namespace oai {
namespace smf_server {
namespace model {
/// <summary>
///
/// </summary>
class SmPolicyUpdateContextData {
public:
SmPolicyUpdateContextData();
virtual ~SmPolicyUpdateContextData() = default;
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on
/// failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and
/// calls it's validate. Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const SmPolicyUpdateContextData& rhs) const;
bool operator!=(const SmPolicyUpdateContextData& rhs) const;
/////////////////////////////////////////////
/// SmPolicyUpdateContextData members
/// <summary>
/// The policy control reqeust trigges which are met.
/// </summary>
std::vector<PolicyControlRequestTrigger> getRepPolicyCtrlReqTriggers() const;
void setRepPolicyCtrlReqTriggers(
std::vector<PolicyControlRequestTrigger> const& value);
bool repPolicyCtrlReqTriggersIsSet() const;
void unsetRepPolicyCtrlReqTriggers();
/// <summary>
/// Indicates the access network charging identifier for the PCC rule(s) or
/// whole PDU session.
/// </summary>
/*
std::vector<AccNetChId> getAccNetChIds() const;
void setAccNetChIds(std::vector<AccNetChId> const& value);
bool accNetChIdsIsSet() const;
void unsetAccNetChIds();
*/
/// <summary>
///
/// </summary>
AccessType getAccessType() const;
void setAccessType(AccessType const& value);
bool accessTypeIsSet() const;
void unsetAccessType();
/// <summary>
///
/// </summary>
RatType getRatType() const;
void setRatType(RatType const& value);
bool ratTypeIsSet() const;
void unsetRatType();
/// <summary>
///
/// </summary>
/*
AdditionalAccessInfo getAddAccessInfo() const;
void setAddAccessInfo(AdditionalAccessInfo const& value);
bool addAccessInfoIsSet() const;
void unsetAddAccessInfo();
*/
/// <summary>
///
/// </summary>
/*
AdditionalAccessInfo getRelAccessInfo() const;
void setRelAccessInfo(AdditionalAccessInfo const& value);
bool relAccessInfoIsSet() const;
void unsetRelAccessInfo();
*/
/// <summary>
///
/// </summary>
PlmnIdNid getServingNetwork() const;
void setServingNetwork(PlmnIdNid const& value);
bool servingNetworkIsSet() const;
void unsetServingNetwork();
/// <summary>
///
/// </summary>
UserLocation getUserLocationInfo() const;
void setUserLocationInfo(UserLocation const& value);
bool userLocationInfoIsSet() const;
void unsetUserLocationInfo();
/// <summary>
///
/// </summary>
std::string getUeTimeZone() const;
void setUeTimeZone(std::string const& value);
bool ueTimeZoneIsSet() const;
void unsetUeTimeZone();
/// <summary>
///
/// </summary>
std::string getRelIpv4Address() const;
void setRelIpv4Address(std::string const& value);
bool relIpv4AddressIsSet() const;
void unsetRelIpv4Address();
/// <summary>
///
/// </summary>
std::string getIpv4Address() const;
void setIpv4Address(std::string const& value);
bool ipv4AddressIsSet() const;
void unsetIpv4Address();
/// <summary>
/// Indicates the IPv4 address domain
/// </summary>
std::string getIpDomain() const;
void setIpDomain(std::string const& value);
bool ipDomainIsSet() const;
void unsetIpDomain();
/// <summary>
///
/// </summary>
/*
Ipv6Prefix getIpv6AddressPrefix() const;
void setIpv6AddressPrefix(Ipv6Prefix const& value);
bool ipv6AddressPrefixIsSet() const;
void unsetIpv6AddressPrefix();
/// <summary>
///
/// </summary>
Ipv6Prefix getRelIpv6AddressPrefix() const;
void setRelIpv6AddressPrefix(Ipv6Prefix const& value);
bool relIpv6AddressPrefixIsSet() const;
void unsetRelIpv6AddressPrefix();
/// <summary>
///
/// </summary>
Ipv6Prefix getAddIpv6AddrPrefixes() const;
void setAddIpv6AddrPrefixes(Ipv6Prefix const& value);
bool addIpv6AddrPrefixesIsSet() const;
void unsetAddIpv6AddrPrefixes();
/// <summary>
///
/// </summary>
Ipv6Prefix getAddRelIpv6AddrPrefixes() const;
void setAddRelIpv6AddrPrefixes(Ipv6Prefix const& value);
bool addRelIpv6AddrPrefixesIsSet() const;
void unsetAddRelIpv6AddrPrefixes();
*/
/// <summary>
///
/// </summary>
std::string getRelUeMac() const;
void setRelUeMac(std::string const& value);
bool relUeMacIsSet() const;
void unsetRelUeMac();
/// <summary>
///
/// </summary>
std::string getUeMac() const;
void setUeMac(std::string const& value);
bool ueMacIsSet() const;
void unsetUeMac();
/// <summary>
///
/// </summary>
/*
Ambr getSubsSessAmbr() const;
void setSubsSessAmbr(Ambr const& value);
bool subsSessAmbrIsSet() const;
void unsetSubsSessAmbr();
*/
/// <summary>
/// Indicates the DN-AAA authorization profile index
/// </summary>
std::string getAuthProfIndex() const;
void setAuthProfIndex(std::string const& value);
bool authProfIndexIsSet() const;
void unsetAuthProfIndex();
/// <summary>
///
/// </summary>
/*
SubscribedDefaultQos getSubsDefQos() const;
void setSubsDefQos(SubscribedDefaultQos const& value);
bool subsDefQosIsSet() const;
void unsetSubsDefQos();
*/
/// <summary>
/// Contains the number of supported packet filter for signalled QoS rules.
/// </summary>
int32_t getNumOfPackFilter() const;
void setNumOfPackFilter(int32_t const value);
bool numOfPackFilterIsSet() const;
void unsetNumOfPackFilter();
/// <summary>
/// Contains the usage report
/// </summary>
/*
std::vector<AccuUsageReport> getAccuUsageReports() const;
void setAccuUsageReports(std::vector<AccuUsageReport> const& value);
bool accuUsageReportsIsSet() const;
void unsetAccuUsageReports();
*/
/// <summary>
/// If it is included and set to true, the 3GPP PS Data Off is activated by
/// the UE.
/// </summary>
bool isR3gppPsDataOffStatus() const;
void setR3gppPsDataOffStatus(bool const value);
bool r3gppPsDataOffStatusIsSet() const;
void unsetr_3gppPsDataOffStatus();
/// <summary>
/// Report the start/stop of the application traffic and detected SDF
/// descriptions if applicable.
/// </summary>
/*
std::vector<AppDetectionInfo> getAppDetectionInfos() const;
void setAppDetectionInfos(std::vector<AppDetectionInfo> const& value);
bool appDetectionInfosIsSet() const;
void unsetAppDetectionInfos();
/// <summary>
/// Used to report the PCC rule failure.
/// </summary>
std::vector<RuleReport> getRuleReports() const;
void setRuleReports(std::vector<RuleReport> const& value);
bool ruleReportsIsSet() const;
void unsetRuleReports();
/// <summary>
/// Used to report the session rule failure.
/// </summary>
std::vector<SessionRuleReport> getSessRuleReports() const;
void setSessRuleReports(std::vector<SessionRuleReport> const& value);
bool sessRuleReportsIsSet() const;
void unsetSessRuleReports();
/// <summary>
/// QoS Notification Control information.
/// </summary>
std::vector<QosNotificationControlInfo> getQncReports() const;
void setQncReports(std::vector<QosNotificationControlInfo> const& value);
bool qncReportsIsSet() const;
void unsetQncReports();
/// <summary>
///
/// </summary>
std::vector<QosMonitoringReport> getQosMonReports() const;
void setQosMonReports(std::vector<QosMonitoringReport> const& value);
bool qosMonReportsIsSet() const;
void unsetQosMonReports();
*/
/// <summary>
///
/// </summary>
std::string getUserLocationInfoTime() const;
void setUserLocationInfoTime(std::string const& value);
bool userLocationInfoTimeIsSet() const;
void unsetUserLocationInfoTime();
/// <summary>
/// Reports the changes of presence reporting area.
/// </summary>
/*
std::map<std::string, PresenceInfo> getRepPraInfos() const;
void setRepPraInfos(std::map<std::string, PresenceInfo> const& value);
bool repPraInfosIsSet() const;
void unsetRepPraInfos();
/// <summary>
///
/// </summary>
UeInitiatedResourceRequest getUeInitResReq() const;
void setUeInitResReq(UeInitiatedResourceRequest const& value);
bool ueInitResReqIsSet() const;
void unsetUeInitResReq();
*/
/// <summary>
/// If it is included and set to true, the reflective QoS is supported by the
/// UE. If it is included and set to false, the reflective QoS is revoked by
/// the UE.
/// </summary>
bool isRefQosIndication() const;
void setRefQosIndication(bool const value);
bool refQosIndicationIsSet() const;
void unsetRefQosIndication();
/// <summary>
///
/// </summary>
/*
QosFlowUsage getQosFlowUsage() const;
void setQosFlowUsage(QosFlowUsage const& value);
bool qosFlowUsageIsSet() const;
void unsetQosFlowUsage();
/// <summary>
///
/// </summary>
CreditManagementStatus getCreditManageStatus() const;
void setCreditManageStatus(CreditManagementStatus const& value);
bool creditManageStatusIsSet() const;
void unsetCreditManageStatus();
/// <summary>
///
/// </summary>
ServingNfIdentity getServNfId() const;
void setServNfId(ServingNfIdentity const& value);
bool servNfIdIsSet() const;
void unsetServNfId();
*/
/// <summary>
///
/// </summary>
TraceData getTraceReq() const;
void setTraceReq(TraceData const& value);
bool traceReqIsSet() const;
void unsetTraceReq();
/// <summary>
///
/// </summary>
/*
MaPduIndication getMaPduInd() const;
void setMaPduInd(MaPduIndication const& value);
bool maPduIndIsSet() const;
void unsetMaPduInd();
/// <summary>
///
/// </summary>
AtsssCapability getAtsssCapab() const;
void setAtsssCapab(AtsssCapability const& value);
bool atsssCapabIsSet() const;
void unsetAtsssCapab();
/// <summary>
///
/// </summary>
TsnBridgeInfo getTsnBridgeInfo() const;
void setTsnBridgeInfo(TsnBridgeInfo const& value);
bool tsnBridgeInfoIsSet() const;
void unsetTsnBridgeInfo();
/// <summary>
///
/// </summary>
PortManagementContainer getTsnPortManContDstt() const;
void setTsnPortManContDstt(PortManagementContainer const& value);
bool tsnPortManContDsttIsSet() const;
void unsetTsnPortManContDstt();
/// <summary>
///
/// </summary>
std::vector<PortManagementContainer> getTsnPortManContNwtts() const;
void setTsnPortManContNwtts(
std::vector<PortManagementContainer> const& value);
bool tsnPortManContNwttsIsSet() const;
void unsetTsnPortManContNwtts();
/// <summary>
///
/// </summary>
std::vector<IpMulticastAddressInfo> getMulAddrInfos() const;
void setMulAddrInfos(std::vector<IpMulticastAddressInfo> const& value);
bool mulAddrInfosIsSet() const;
void unsetMulAddrInfos();
*/
friend void to_json(nlohmann::json& j, const SmPolicyUpdateContextData& o);
friend void from_json(const nlohmann::json& j, SmPolicyUpdateContextData& o);
protected:
std::vector<PolicyControlRequestTrigger> m_RepPolicyCtrlReqTriggers;
bool m_RepPolicyCtrlReqTriggersIsSet;
// std::vector<AccNetChId> m_AccNetChIds;
// bool m_AccNetChIdsIsSet;
AccessType m_AccessType;
bool m_AccessTypeIsSet;
RatType m_RatType;
bool m_RatTypeIsSet;
// AdditionalAccessInfo m_AddAccessInfo;
// bool m_AddAccessInfoIsSet;
// AdditionalAccessInfo m_RelAccessInfo;
// bool m_RelAccessInfoIsSet;
PlmnIdNid m_ServingNetwork;
bool m_ServingNetworkIsSet;
UserLocation m_UserLocationInfo;
bool m_UserLocationInfoIsSet;
std::string m_UeTimeZone;
bool m_UeTimeZoneIsSet;
std::string m_RelIpv4Address;
bool m_RelIpv4AddressIsSet;
std::string m_Ipv4Address;
bool m_Ipv4AddressIsSet;
std::string m_IpDomain;
bool m_IpDomainIsSet;
Ipv6Prefix m_Ipv6AddressPrefix;
bool m_Ipv6AddressPrefixIsSet;
Ipv6Prefix m_RelIpv6AddressPrefix;
bool m_RelIpv6AddressPrefixIsSet;
Ipv6Prefix m_AddIpv6AddrPrefixes;
bool m_AddIpv6AddrPrefixesIsSet;
Ipv6Prefix m_AddRelIpv6AddrPrefixes;
bool m_AddRelIpv6AddrPrefixesIsSet;
std::string m_RelUeMac;
bool m_RelUeMacIsSet;
std::string m_UeMac;
bool m_UeMacIsSet;
// Ambr m_SubsSessAmbr;
// bool m_SubsSessAmbrIsSet;
std::string m_AuthProfIndex;
bool m_AuthProfIndexIsSet;
// SubscribedDefaultQos m_SubsDefQos;
// bool m_SubsDefQosIsSet;
int32_t m_NumOfPackFilter;
bool m_NumOfPackFilterIsSet;
// std::vector<AccuUsageReport> m_AccuUsageReports;
// bool m_AccuUsageReportsIsSet;
bool m_r_3gppPsDataOffStatus;
bool m_r_3gppPsDataOffStatusIsSet;
// std::vector<AppDetectionInfo> m_AppDetectionInfos;
// bool m_AppDetectionInfosIsSet;
// std::vector<RuleReport> m_RuleReports;
// bool m_RuleReportsIsSet;
// std::vector<SessionRuleReport> m_SessRuleReports;
// bool m_SessRuleReportsIsSet;
// std::vector<QosNotificationControlInfo> m_QncReports;
// bool m_QncReportsIsSet;
// std::vector<QosMonitoringReport> m_QosMonReports;
bool m_QosMonReportsIsSet;
std::string m_UserLocationInfoTime;
bool m_UserLocationInfoTimeIsSet;
// std::map<std::string, PresenceInfo> m_RepPraInfos;
// bool m_RepPraInfosIsSet;
// UeInitiatedResourceRequest m_UeInitResReq;
////bool m_UeInitResReqIsSet;
bool m_RefQosIndication;
bool m_RefQosIndicationIsSet;
// QosFlowUsage m_QosFlowUsage;
// bool m_QosFlowUsageIsSet;
// CreditManagementStatus m_CreditManageStatus;
// bool m_CreditManageStatusIsSet;
// ServingNfIdentity m_ServNfId;
// bool m_ServNfIdIsSet;
TraceData m_TraceReq;
bool m_TraceReqIsSet;
// MaPduIndication m_MaPduInd;
// bool m_MaPduIndIsSet;
AtsssCapability m_AtsssCapab;
bool m_AtsssCapabIsSet;
// TsnBridgeInfo m_TsnBridgeInfo;
// bool m_TsnBridgeInfoIsSet;
// PortManagementContainer m_TsnPortManContDstt;
// bool m_TsnPortManContDsttIsSet;
// std::vector<PortManagementContainer> m_TsnPortManContNwtts;
// bool m_TsnPortManContNwttsIsSet;
// std::vector<IpMulticastAddressInfo> m_MulAddrInfos;
// bool m_MulAddrInfosIsSet;
};
} // namespace model
} // namespace smf_server
} // namespace oai
#endif /* SmPolicyUpdateContextData_H_ */
...@@ -1499,69 +1499,35 @@ void smf_context::handle_pdu_session_create_sm_context_request( ...@@ -1499,69 +1499,35 @@ void smf_context::handle_pdu_session_create_sm_context_request(
// Maximum Data Rate // Maximum Data Rate
// TODO: (Optional) Secondary authentication/authorization // TODO: (Optional) Secondary authentication/authorization
// Step 5. PCF selection // Step 5. Create SM Policy Association with PCF or local PCC rules
std::string smContextRef = std::to_string(smreq->scid); std::string smContextRef = std::to_string(smreq->scid);
oai::smf_server::model::SmPolicyDecision policy_decision; oai::smf_server::model::SmPolicyDecision policy_decision;
n7::policy_association policy_ass;
bool use_pcf_policy = false; bool use_pcf_policy = false;
if (!smf_cfg.use_local_pcc_rules) { if (!smf_cfg.use_local_pcc_rules) {
std::string pcf_addr; policy_ass.set_context(
std::string pcf_api_version; smf_supi_to_string(smreq->req.get_supi()), smreq->req.get_dnn(), snssai,
oai::smf_server::model::Snssai snssai_model; plmn, smreq->req.get_pdu_session_id(),
snssai_model.setSst(snssai.sST); smreq->req.get_pdu_session_type());
snssai_model.setSd(snssai.sD);
oai::smf_server::model::PlmnId plmn_id_model; // TODO what is the exact meaning of SCID? Is this unique per registration
std::string mnc_string = std::to_string(plmn.mnc_digit1) + // or unique per PDU session?
std::to_string(plmn.mnc_digit2) + policy_ass.id = smreq->scid;
std::to_string(plmn.mnc_digit3);
std::string mcc_string = std::to_string(plmn.mcc_digit1) + n7::sm_policy_status_code status =
std::to_string(plmn.mcc_digit2) + n7::smf_n7::get_instance().create_sm_policy_association(policy_ass);
std::to_string(plmn.mcc_digit3); if (status != n7::sm_policy_status_code::CREATED) {
plmn_id_model.setMnc(mnc_string);
plmn_id_model.setMcc(mcc_string);
// get the PCF (either from config file, DNS or NRF based on local config)
bool pcf_found = n7::smf_n7::get_instance().discover_pcf(
pcf_addr, pcf_api_version, snssai_model, plmn_id_model, dnn);
if (pcf_found) {
oai::smf_server::model::SmPolicyContextData context;
context.setPduSessionId(pdu_session_id);
std::string supi_string = smf_supi_to_string(smreq->req.get_supi());
// TODO only support imsi SUPI, not NAI
context.setSupi("imsi-" + supi_string);
oai::smf_server::model::PduSessionType pdu_session_type;
// hacky
pdu_session_type_t pdu_type = smreq->req.get_pdu_session_type();
from_json(pdu_type.toString(), pdu_session_type);
context.setPduSessionType(pdu_session_type);
context.setDnn(smreq->req.get_dnn());
// TODO which notification URI should we use for PCF updates?
// atm it is
// {apiRoot}/nsmf-pdusession/{apiVersion}/sm-contexts-policy/{smContextRef}
std::string notification_uri =
smreq->req.get_api_root() + "-policy/" + smContextRef;
n7::sm_policy_status_code status =
n7::smf_n7::get_instance().create_sm_policy_association(
pcf_addr, pcf_api_version, context, policy_decision);
if (status != n7::sm_policy_status_code::CREATED) {
Logger::smf_n7().info(
"PCF SM Policy Association Creation was not successful. Continue "
"using local rules");
use_pcf_policy = false;
// Here, the standard says that we could reject the PDU session or allow
// the PDU session applying local policies 29.512 Chapter 4.2.2.2
// TODO I propose to have this behavior configurable, for now we
// continue
} else {
use_pcf_policy = true;
}
} else {
Logger::smf_n7().info( Logger::smf_n7().info(
"PCF can not be found. Continue with local PCC rules"); "PCF SM Policy Association Creation was not successful. Continue "
"using default rules");
use_pcf_policy = false;
// Here, the standard says that we could reject the PDU session or allow
// the PDU session applying local policies 29.512 Chapter 4.2.2.2
// TODO I propose to have this behavior configurable, for now we
// continue
} else {
use_pcf_policy = true;
} }
} }
// TODO use the PCC rules also for QoS and other policy information // TODO use the PCC rules also for QoS and other policy information
......
...@@ -41,34 +41,92 @@ using namespace oai::smf_server::model; ...@@ -41,34 +41,92 @@ using namespace oai::smf_server::model;
extern smf_config smf_cfg; extern smf_config smf_cfg;
extern smf_sbi* smf_sbi_inst; extern smf_sbi* smf_sbi_inst;
sm_policy_status_code smf_n7::create_sm_policy_association( uint32_t smf_n7::select_pcf(const SmPolicyContextData& context) {
const std::string pcf_addr, const std::string pcf_api_version,
const oai::smf_server::model::SmPolicyContextData& context,
oai::smf_server::model::SmPolicyDecision& policy_decision) {
// TODO abstraction: Here we should choose between local PCC rules and PCF // TODO abstraction: Here we should choose between local PCC rules and PCF
// client // client
return policy_api_client.send_create_policy_association( // TODO PCF selection
pcf_addr, pcf_api_version, context, policy_decision);
if (policy_storages.empty()) {
// TODO choose between local PCC rules and PCF client, for now only PCF
// client
PlmnId plmn_id = {};
plmn_id.setMcc(context.getServingNetwork().getMcc());
plmn_id.setMnc(context.getServingNetwork().getMnc());
std::shared_ptr<smf_pcf_client> storage = smf_pcf_client::discover_pcf(
context.getSliceInfo(), plmn_id, context.getDnn());
if (storage) {
// TODO for now, only use the first PCF
policy_storages.insert(1, storage);
return 1; // ID is always 1, only one PF
} else {
return -1;
}
}
} }
bool smf_n7::discover_pcf( sm_policy_status_code smf_n7::create_sm_policy_association(
std::string& addr, std::string& api_version, const Snssai snssai, policy_association& association) {
const PlmnId plmn_id, const std::string dnn) { uint32_t pcf_id = select_pcf(association.context);
if (pcf_id == 0) {
return sm_policy_status_code::PCF_NOT_AVAILABLE;
}
/*std::shared_ptr<policy_storage> store;
try {
store = policy_storages.at(pcf_id);
} catch (std::exception) {
return sm_policy_status_code::PCF_NOT_AVAILABLE;
} */
folly::AtomicHashMap<uint32_t, std::shared_ptr<policy_storage>>::iterator it =
policy_storages.find(pcf_id);
if (it == policy_storages.end()) {
return sm_policy_status_code::PCF_NOT_AVAILABLE;
}
return it->second->create_policy_association(association);
// return store->create_policy_association(association);
}
smf_n7::~smf_n7() {
Logger::smf_n7().info("Deleting SMF N7 instance...");
}
///////////////////////////////////////////////////////////////////////////
/////////////////////// smf_pcf_client ////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
std::shared_ptr<smf_pcf_client> smf_pcf_client::discover_pcf(
const Snssai snssai, const PlmnId plmn_id, const std::string dnn) {
if (smf_cfg.use_local_pcc_rules) { if (smf_cfg.use_local_pcc_rules) {
Logger::smf_n7().info("Local PCC rules are enabled, do not discover PCF"); Logger::smf_n7().info("Local PCC rules are enabled, do not discover PCF");
return false; return nullptr;
} }
std::string pcf_addr;
std::string api_version;
if (smf_cfg.discover_pcf) { if (smf_cfg.discover_pcf) {
return discover_pcf_with_nrf(addr, api_version, snssai, plmn_id, dnn); if (!discover_pcf_with_nrf(pcf_addr, api_version, snssai, plmn_id, dnn)) {
Logger::smf_n7().warn("Could not discover PCF from NRF");
return nullptr;
}
} else { } else {
return discover_pcf_from_config_file( if (!discover_pcf_from_config_file(
addr, api_version, snssai, plmn_id, dnn); pcf_addr, api_version, snssai, plmn_id, dnn)) {
Logger::smf_n7().warn("Could not discover PCF from config file");
return nullptr;
}
} }
Logger::smf_n7().info("Created new PCF connection: %s", pcf_addr.c_str());
return std::make_unique<smf_pcf_client>(pcf_addr, api_version);
} }
bool smf_n7::discover_pcf_with_nrf( bool smf_pcf_client::discover_pcf_with_nrf(
std::string& addr, std::string& api_version, const Snssai snssai, std::string& addr, std::string& api_version, const Snssai snssai,
const PlmnId plmn_id, const std::string dnn) { const PlmnId plmn_id, const std::string dnn) {
Logger::smf_n7().debug("Discover PCF with NRF"); Logger::smf_n7().debug("Discover PCF with NRF");
...@@ -76,7 +134,7 @@ bool smf_n7::discover_pcf_with_nrf( ...@@ -76,7 +134,7 @@ bool smf_n7::discover_pcf_with_nrf(
return false; return false;
} }
bool smf_n7::discover_pcf_from_config_file( bool smf_pcf_client::discover_pcf_from_config_file(
std::string& addr, std::string& api_version, const Snssai snssai, std::string& addr, std::string& api_version, const Snssai snssai,
const PlmnId plmn_id, const std::string dnn) { const PlmnId plmn_id, const std::string dnn) {
// TODO ignore snssai, plmn_id and dnn, because it is not part of // TODO ignore snssai, plmn_id and dnn, because it is not part of
...@@ -116,25 +174,14 @@ bool smf_n7::discover_pcf_from_config_file( ...@@ -116,25 +174,14 @@ bool smf_n7::discover_pcf_from_config_file(
} }
} }
} }
smf_n7::~smf_n7() {
Logger::smf_n7().info("Deleting SMF N7 instance...");
}
///////////////////////////////////////////////////////////////////////////
/////////////////////// smf_pcf_client ////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
sm_policy_status_code smf_pcf_client::send_create_policy_association( sm_policy_status_code smf_pcf_client::create_policy_association(
const std::string pcf_addr, const std::string pcf_api_version, policy_association& association) {
const SmPolicyContextData& context, SmPolicyDecision& policy_decision) {
nlohmann::json json_data; nlohmann::json json_data;
to_json(json_data, context); to_json(json_data, association.context);
Logger::smf_n7().info("Sending PCF SM policy association creation request"); Logger::smf_n7().info("Sending PCF SM policy association creation request");
std::string url = "http://" + pcf_addr + "/" + sm_api_name + "/" +
pcf_api_version + "/" + sm_api_policy_resource_part;
std::string response_data; std::string response_data;
// generate a promise for the curl handle // generate a promise for the curl handle
...@@ -150,7 +197,7 @@ sm_policy_status_code smf_pcf_client::send_create_policy_association( ...@@ -150,7 +197,7 @@ sm_policy_status_code smf_pcf_client::send_create_policy_association(
// Create a new curl easy handle and add to the multi handle // Create a new curl easy handle and add to the multi handle
if (!smf_sbi_inst->curl_create_handle( if (!smf_sbi_inst->curl_create_handle(
url, json_data.dump(), response_data, pid_ptr, "POST", root_uri, json_data.dump(), response_data, pid_ptr, "POST",
smf_cfg.http_version)) { smf_cfg.http_version)) {
Logger::smf_sbi().warn( Logger::smf_sbi().warn(
"Could not create a new handle to send message to PCF"); "Could not create a new handle to send message to PCF");
...@@ -159,10 +206,6 @@ sm_policy_status_code smf_pcf_client::send_create_policy_association( ...@@ -159,10 +206,6 @@ sm_policy_status_code smf_pcf_client::send_create_policy_association(
} }
// Wait for the response // Wait for the response
// TODO what happens if PCF is not reachable? Should check that scenario
// TODO it seems that it just hangs and is stuck "forever".. The problem is
// that the CURL ERROR CODE in curl_release_handles are just ignored. e.g when
// I have an error code 28, does that mean that this thread is just stuck?
uint32_t response_code = smf_sbi_inst->get_available_response(f); uint32_t response_code = smf_sbi_inst->get_available_response(f);
...@@ -170,10 +213,10 @@ sm_policy_status_code smf_pcf_client::send_create_policy_association( ...@@ -170,10 +213,10 @@ sm_policy_status_code smf_pcf_client::send_create_policy_association(
Logger::smf_sbi().debug("Response data %s", response_data.c_str()); Logger::smf_sbi().debug("Response data %s", response_data.c_str());
if (response_code == http_status_code_e::HTTP_STATUS_CODE_201_CREATED) { if (response_code == http_status_code_e::HTTP_STATUS_CODE_201_CREATED) {
from_json(response_data, policy_decision); from_json(response_data, association.decision);
Logger::smf_n7().info( Logger::smf_n7().info(
"Successfully created SM Policy Association for SUPI %s", "Successfully created SM Policy Association for SUPI %s",
context.getSupi().c_str()); association.context.getSupi().c_str());
return sm_policy_status_code::CREATED; return sm_policy_status_code::CREATED;
} }
...@@ -213,4 +256,27 @@ sm_policy_status_code smf_pcf_client::send_create_policy_association( ...@@ -213,4 +256,27 @@ sm_policy_status_code smf_pcf_client::send_create_policy_association(
"%s -- Details: %s - %s", info.c_str(), "%s -- Details: %s - %s", info.c_str(),
problem_details.getCause().c_str(), problem_details.getDetail().c_str()); problem_details.getCause().c_str(), problem_details.getDetail().c_str());
return response; return response;
}
sm_policy_status_code smf_pcf_client::remove_policy_association(
uint32_t policy_id, const SmPolicyDeleteData& delete_data) {
// TODO
return sm_policy_status_code::INTERNAL_ERROR;
}
sm_policy_status_code smf_pcf_client::update_policy_association(
uint32_t policy_id, const SmPolicyUpdateContextData& update_data,
policy_association& association) {
// TODO
return sm_policy_status_code::INTERNAL_ERROR;
}
sm_policy_status_code smf_pcf_client::get_policy_association(
uint32_t policy_id, policy_association& association) {
// TODO
return sm_policy_status_code::INTERNAL_ERROR;
}
smf_pcf_client::~smf_pcf_client() {
Logger::smf_n7().debug("Deleting PCF client instance");
} }
\ No newline at end of file
...@@ -30,10 +30,17 @@ ...@@ -30,10 +30,17 @@
#define FILE_SMF_N7_HPP_SEEN #define FILE_SMF_N7_HPP_SEEN
#include <string> #include <string>
#include <memory>
//#include <folly/concurrency/ConcurrentHashMap.h>
#include <folly/AtomicHashMap.h>
#include "Snssai.h" #include "Snssai.h"
#include "PlmnId.h" #include "PlmnId.h"
#include "SmPolicyDecision.h" #include "SmPolicyDecision.h"
#include "SmPolicyContextData.h" #include "SmPolicyContextData.h"
#include "SmPolicyUpdateContextData.h"
#include "SmPolicyDeleteData.h"
#include "smf.h"
namespace smf::n7 { namespace smf::n7 {
...@@ -53,28 +60,181 @@ enum class sm_policy_status_code { ...@@ -53,28 +60,181 @@ enum class sm_policy_status_code {
}; };
/** /**
* @brief Used to store all policy-related fields in one struct.
*
*/
struct policy_association {
oai::smf_server::model::SmPolicyDecision decision;
oai::smf_server::model::SmPolicyContextData context;
uint32_t id = -1;
uint32_t pcf_id = -1;
std::string pcf_location;
void set_context(
std::string supi, std::string dnn, snssai_t snssai, plmn_t plmn,
uint8_t pdu_session_id, pdu_session_type_t pdu_session_type) {
oai::smf_server::model::Snssai snssai_model;
snssai_model.setSst(snssai.sST);
snssai_model.setSd(snssai.sD);
oai::smf_server::model::PlmnId plmn_id_model;
std::string mnc_string = std::to_string(plmn.mnc_digit1) +
std::to_string(plmn.mnc_digit2) +
std::to_string(plmn.mnc_digit3);
std::string mcc_string = std::to_string(plmn.mcc_digit1) +
std::to_string(plmn.mcc_digit2) +
std::to_string(plmn.mcc_digit3);
plmn_id_model.setMnc(mnc_string);
plmn_id_model.setMcc(mcc_string);
context = {};
context.setPduSessionId(pdu_session_id);
// TODO only support imsi SUPI, not NAI
context.setSupi("imsi-" + supi);
oai::smf_server::model::PduSessionType pdu_session_type_model;
// hacky
from_json(pdu_session_type.toString(), pdu_session_type_model);
context.setPduSessionType(pdu_session_type_model);
context.setDnn(dnn);
}
};
/**
* @brief Abstract class to receive policies based on the source (either PCF or
* local files)
* *
*/ */
class smf_pcf_client { class policy_storage {
public:
/**
* @brief Creates a policy association based on the given context and provides
* a policy decision.
*
* Precondition: context data needs to be set
* Postcondition: In case of success, return CREATED,
* association.decision and policy_association.id is set
*
* @param association when the ID is already set, this ID is used and the
* client ensures uniqueness
* @return sm_policy_status_code CREATED in case of success, otherwise
* USER_UNKNOWN, INVALID_PARAMETERS, CONTEXT_DENIED, INTERNAL_ERROR
*/
virtual sm_policy_status_code create_policy_association(
policy_association& association) = 0;
/**
* @brief Removes a policy association, identified by the ID,
*
* @param policy_id input: policy ID
* @param delete_data input: must not be null, but values are optional
* @return sm_policy_status_code OK in case of success, otherwise NOT_FOUND,
* INTERNAL_ERROR, PCF_NOT_AVAILABLE
*/
virtual sm_policy_status_code remove_policy_association(
uint32_t policy_id,
const oai::smf_server::model::SmPolicyDeleteData& delete_data) = 0;
/**
* @brief Updates a policy association, identified by the ID
*
* @param policy_id input: policy ID
* @param update_data input: must not be null and set accordingly to the
* triggers
* @param policy_association output: Updated policy association with new
* context and decision in case of OK status code
* @return sm_policy_status_code OK in case of success, otherwise NOT_FOUND,
* INTERNAL_ERROR, PCF_NOT_AVAILABLE
*/
virtual sm_policy_status_code update_policy_association(
uint32_t policy_id,
const oai::smf_server::model::SmPolicyUpdateContextData& update_data,
policy_association& association) = 0;
/**
* @brief Get the the policy association together with the original context
*
* @param policy_id input: policy ID
* @param association output: contains the original context and the policy
* decision
* @return sm_policy_status_code OK in case of success, otherwise NOT_FOUND,
* ITERNAL_ERROR, PCF_NOT_AVAILABLE
*/
virtual sm_policy_status_code get_policy_association(
uint32_t policy_id, policy_association& association) = 0;
};
/**
* @brief Implements Npcf_SMPolicyControlAPI to interact with a PCF to recieve
* policies
*/
class smf_pcf_client : public policy_storage {
public: public:
const std::string sm_api_name = "npcf-smpolicycontrol"; const std::string sm_api_name = "npcf-smpolicycontrol";
const std::string sm_api_policy_resource_part = "sm-policies"; const std::string sm_api_policy_resource_part = "sm-policies";
sm_policy_status_code send_create_policy_association( explicit smf_pcf_client(std::string pcf_addr, std::string pcf_api_version) {
const std::string pcf_addr, const std::string pcf_api_version, root_uri = "http://" + pcf_addr + "/" + sm_api_name + "/" +
const oai::smf_server::model::SmPolicyContextData& context, pcf_api_version + "/" + sm_api_policy_resource_part;
oai::smf_server::model::SmPolicyDecision& policy_decision); }
virtual ~smf_pcf_client();
/**
* @brief Discover PCF either based on NRF or local configuration (based on
* the config file)
*
* @param snssai
* @param plmn_id
* @param dnn
* @return & smf_pcf_client nullptr in case of an error
*/
static std::shared_ptr<smf_pcf_client> discover_pcf(
const oai::smf_server::model::Snssai snssai,
const oai::smf_server::model::PlmnId plmn_id, const std::string dnn);
sm_policy_status_code create_policy_association(
policy_association& association) override;
sm_policy_status_code remove_policy_association(
uint32_t policy_id,
const oai::smf_server::model::SmPolicyDeleteData& delete_data) override;
sm_policy_status_code update_policy_association(
uint32_t policy_id,
const oai::smf_server::model::SmPolicyUpdateContextData& update_data,
policy_association& association) override;
sm_policy_status_code get_policy_association(
uint32_t policy_id, policy_association& association) override;
private:
static bool discover_pcf_with_nrf(
std::string& addr, std::string& api_version,
const oai::smf_server::model::Snssai snssai,
const oai::smf_server::model::PlmnId plmn_id, const std::string dnn);
static bool discover_pcf_from_config_file(
std::string& addr, std::string& api_version,
const oai::smf_server::model::Snssai snssai,
const oai::smf_server::model::PlmnId plmn_id, const std::string dnn);
std::string root_uri;
}; };
// TODO implement for file based policy rules
// class smf_file_pcc_rules : public policy_storage {};
/** /**
* @brief Implements the N7 procedures (communication between SMF and PCF). It * @brief Implements the N7 procedures (communication between SMF and PCF). It
* is the interface for PCF communication that should be used by other * is the interface for PCF communication that should be used by other
* components * components. Depending on the configuration, the policy rules may come from a
* PCF or from local files (currently not supported)
* *
*/ */
class smf_n7 { class smf_n7 {
public: public:
smf_n7(){}; const uint32_t ASSOCIATIONS_SIZE = 1024;
const uint32_t PCF_CLIENTS = 16;
smf_n7() : associations(ASSOCIATIONS_SIZE), policy_storages(PCF_CLIENTS){};
smf_n7(smf_n7 const&) = delete; smf_n7(smf_n7 const&) = delete;
void operator=(smf_n7 const&) = delete; void operator=(smf_n7 const&) = delete;
virtual ~smf_n7(); virtual ~smf_n7();
...@@ -85,53 +245,41 @@ class smf_n7 { ...@@ -85,53 +245,41 @@ class smf_n7 {
} }
/** /**
* @brief Creates a SM Policy Association (as defined in 3GPP TS 29.512) * @brief Creates a SM Policy Association (as defined in 3GPP TS 29.512).
* towards the PCF specified with pcf_addr. * The PCF is selected based on the configuration file (NRF or pre-configured)
* The PCC rules may also be selected from local configuration (depending on
* option in config file)
* @param association: context needs to be set, if id is set, client ensures
* that the value is unique, if not, other associations may be overwritten
*
* *
* @param pcf_addr PCF address in format ip:port (see discover_pcf) * @param context input: context data, the mandatory parameters need to be set
* @param pcf_api_version PCF API version * @param policy_decision output: policy decision
* @param context context data, the mandatory parameters need to be set * @param policy_id output: ID of the policy association
* @param policy_decision policy decision received from the PCF (is empty on * @return sm_policy_status_code
* error)
* @return smf::n7::sm_policy_status_code Status code depending on the result
* from the PCF API
*/ */
smf::n7::sm_policy_status_code create_sm_policy_association( sm_policy_status_code create_sm_policy_association(
const std::string pcf_addr, const std::string pcf_api_version, policy_association& association);
const oai::smf_server::model::SmPolicyContextData& context,
oai::smf_server::model::SmPolicyDecision& policy_decision);
private:
/** /**
* @brief Allows the discovery of a PCF, either via NRF or local * @brief Allows the discovery of a PCF, either via NRF or local
* configuration, depending on the DISCOVER_PCF option in the configuration * configuration, depending on the DISCOVER_PCF option in the configuration
* file. * file.
* In case the input parameters are not set, they are ignored.
* *
* @param addr output: The address of the PCF, ip:port * @param context: Context containing at least Snssai, plmn ID and DNN
* @param api_version output: The API version of the PCF * @return 0 in case of failure, otherwise ID > 0
* @param snssai input: The Snssai of the context
* @param plmn_id input: The PLMN of the context
* @param dnn input: The DNN of the context
* @return true
* @return false
*/ */
bool discover_pcf( uint32_t select_pcf(
std::string& addr, std::string& api_version, const oai::smf_server::model::SmPolicyContextData& context);
const oai::smf_server::model::Snssai snssai,
const oai::smf_server::model::PlmnId plmn_id, const std::string dnn);
private: // TODO the ConcurrentHashMap of folly would be much better, but I get a
bool discover_pcf_with_nrf( // linker error, we should fix that Reason: AtomicHashMap requires that the
std::string& addr, std::string& api_version, // amount of objects is known upfront.
const oai::smf_server::model::Snssai snssai, folly::AtomicHashMap<uint32_t, std::shared_ptr<policy_storage>>
const oai::smf_server::model::PlmnId plmn_id, const std::string dnn); policy_storages;
folly::AtomicHashMap<uint32_t, smf::n7::policy_association> associations;
bool discover_pcf_from_config_file(
std::string& addr, std::string& api_version,
const oai::smf_server::model::Snssai snssai,
const oai::smf_server::model::PlmnId plmn_id, const std::string dnn);
smf_pcf_client policy_api_client = {};
}; };
} // namespace smf::n7 } // namespace smf::n7
#endif /* FILE_SMF_N4_HPP_SEEN */ #endif /* FILE_SMF_N4_HPP_SEEN */
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