Commit 6927aaf4 authored by KARIM BOUTIBA's avatar KARIM BOUTIBA

merge Qos monitoring + fix conflicts

parents f99ccb40 4c41d0de
...@@ -51,6 +51,9 @@ EventNotification::EventNotification() { ...@@ -51,6 +51,9 @@ EventNotification::EventNotification() {
m_DddStatusIsSet = false; m_DddStatusIsSet = false;
m_MaxWaitTime = ""; m_MaxWaitTime = "";
m_MaxWaitTimeIsSet = false; m_MaxWaitTimeIsSet = false;
m_usageReport = {};
m_usageReportIsSet = false;
} }
EventNotification::~EventNotification() {} EventNotification::~EventNotification() {}
...@@ -86,6 +89,8 @@ void to_json(nlohmann::json& j, const EventNotification& o) { ...@@ -86,6 +89,8 @@ void to_json(nlohmann::json& j, const EventNotification& o) {
if (o.pduSeIdIsSet()) j["pduSeId"] = o.m_PduSeId; if (o.pduSeIdIsSet()) j["pduSeId"] = o.m_PduSeId;
if (o.dddStatusIsSet()) j["dddStatus"] = o.m_DddStatus; if (o.dddStatusIsSet()) j["dddStatus"] = o.m_DddStatus;
if (o.maxWaitTimeIsSet()) j["maxWaitTime"] = o.m_MaxWaitTime; if (o.maxWaitTimeIsSet()) j["maxWaitTime"] = o.m_MaxWaitTime;
if (o.usageReportIsSet()) j["Usage Report"] = o.m_usageReport;
} }
void from_json(const nlohmann::json& j, EventNotification& o) { void from_json(const nlohmann::json& j, EventNotification& o) {
...@@ -175,6 +180,10 @@ void from_json(const nlohmann::json& j, EventNotification& o) { ...@@ -175,6 +180,10 @@ void from_json(const nlohmann::json& j, EventNotification& o) {
j.at("maxWaitTime").get_to(o.m_MaxWaitTime); j.at("maxWaitTime").get_to(o.m_MaxWaitTime);
o.m_MaxWaitTimeIsSet = true; o.m_MaxWaitTimeIsSet = true;
} }
if (j.find("Usage Report") != j.end()) {
j.at("Usage Report").get_to(o.m_usageReport);
o.m_usageReportIsSet = true;
}
} }
SmfEvent EventNotification::getEvent() const { SmfEvent EventNotification::getEvent() const {
...@@ -462,6 +471,20 @@ bool EventNotification::maxWaitTimeIsSet() const { ...@@ -462,6 +471,20 @@ bool EventNotification::maxWaitTimeIsSet() const {
void EventNotification::unsetMaxWaitTime() { void EventNotification::unsetMaxWaitTime() {
m_MaxWaitTimeIsSet = false; m_MaxWaitTimeIsSet = false;
} }
UsageReport EventNotification::getUsageReport() const {
return m_usageReport;
}
void EventNotification::setUsageReport(UsageReport const& value) {
m_usageReport = value;
m_usageReportIsSet = true;
}
bool EventNotification::usageReportIsSet() const {
return m_usageReportIsSet;
}
void EventNotification::unsetUsageReport() {
m_usageReportIsSet = false;
}
} // namespace model } // namespace model
} // namespace smf_server } // namespace smf_server
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "PlmnId.h" #include "PlmnId.h"
#include "RouteToLocation.h" #include "RouteToLocation.h"
#include "AccessType.h" #include "AccessType.h"
#include "UsageReport.h"
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai {
...@@ -203,6 +204,13 @@ class EventNotification { ...@@ -203,6 +204,13 @@ class EventNotification {
void setMaxWaitTime(std::string const& value); void setMaxWaitTime(std::string const& value);
bool maxWaitTimeIsSet() const; bool maxWaitTimeIsSet() const;
void unsetMaxWaitTime(); void unsetMaxWaitTime();
/// <summary>
///
/// </summary>
UsageReport getUsageReport() const;
void setUsageReport(UsageReport const& value);
bool usageReportIsSet() const;
void unsetUsageReport();
friend void to_json(nlohmann::json& j, const EventNotification& o); friend void to_json(nlohmann::json& j, const EventNotification& o);
friend void from_json(const nlohmann::json& j, EventNotification& o); friend void from_json(const nlohmann::json& j, EventNotification& o);
...@@ -254,6 +262,8 @@ class EventNotification { ...@@ -254,6 +262,8 @@ class EventNotification {
bool m_DddStatusIsSet; bool m_DddStatusIsSet;
std::string m_MaxWaitTime; std::string m_MaxWaitTime;
bool m_MaxWaitTimeIsSet; bool m_MaxWaitTimeIsSet;
UsageReport m_usageReport;
bool m_usageReportIsSet;
}; };
} // namespace model } // namespace model
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* *
* Possible values are - AC_TY_CH: Access Type Change - UP_PATH_CH: UP Path * Possible values are - AC_TY_CH: Access Type Change - UP_PATH_CH: UP Path
* Change - PDU_SES_REL: PDU Session Release - PLMN_CH: PLMN Change - UE_IP_CH: * Change - PDU_SES_REL: PDU Session Release - PLMN_CH: PLMN Change - UE_IP_CH:
* UE IP address change - DDDS: Downlink data delivery status * UE IP address change - DDDS: Downlink data delivery status - QOS_MON: QoS Monitoring
*/ */
#ifndef SmfEvent_H_ #ifndef SmfEvent_H_
...@@ -30,7 +30,7 @@ namespace model { ...@@ -30,7 +30,7 @@ namespace model {
/// <summary> /// <summary>
/// Possible values are - AC_TY_CH: Access Type Change - UP_PATH_CH: UP Path /// Possible values are - AC_TY_CH: Access Type Change - UP_PATH_CH: UP Path
/// Change - PDU_SES_REL: PDU Session Release - PLMN_CH: PLMN Change - UE_IP_CH: /// Change - PDU_SES_REL: PDU Session Release - PLMN_CH: PLMN Change - UE_IP_CH:
/// UE IP address change - DDDS: Downlink data delivery status /// UE IP address change - DDDS: Downlink data delivery status - QOS_MON: QoS Monitoring
/// </summary> /// </summary>
class SmfEvent { class SmfEvent {
public: public:
......
/**
* Nsmf_EventExposure
*
* UsageReport.cpp
*/
#include "UsageReport.h"
// #include <sstream>
namespace oai {
namespace smf_server {
namespace model {
UsageReport::UsageReport() {
m_SEndID = 0;
m_SEndIDIsSet = false;
m_urSeqN = 0;
m_urSeqNIsSet = false;
m_duration = 0;
m_durationIsSet = false;
m_totNoP = 0;
m_totNoPIsSet = false;
m_ulNoP = 0;
m_ulNoPIsSet = false;
m_dlNoP = 0;
m_dlNoPIsSet = false;
m_totVol = 0;
m_totVolIsSet = false;
m_ulVol = 0;
m_ulVolIsSet = false;
m_dlVol = 0;
m_dlVolIsSet = false;
m_urTrig = {};
m_urTrigIsSet = false;
}
UsageReport::~UsageReport() {}
void UsageReport::validate() {
// TODO: implement validation
}
void to_json(nlohmann::json& j, const UsageReport& o) {
j = nlohmann::json();
if (o.SEndIDIsSet())
j["SEID"] = o.m_SEndID;
if (o.urSeqNIsSet())
j["UR-SEQN"] = o.m_urSeqN;
if (o.urTriggerIsSet()) {
if (o.m_urTrig.perio)
j["Trigger"] = "Periodic Reporting";
if (o.m_urTrig.volth)
j["Trigger"] = "Volume Threshold";
if (o.m_urTrig.timth)
j["Trigger"] = "Time Threshold";
if (o.m_urTrig.volqu)
j["Trigger"] = "Volume Quota";
if (o.m_urTrig.timqu)
j["Trigger"] = "Time Quota";
/*
switch (o.m_urTrig) {
case :
j["Trigger"] = "Periodic Reporting";
break;
case UsageReportTrigger::VOLTH:
j["Trigger"] = "Volume Threshold";
break;
case UsageReportTrigger::TIMTH:
j["Trigger"] = "Time Threshold";
break;
case UsageReportTrigger::VOLQU:
j["Trigger"] = "Volume Quota";
break;
case UsageReportTrigger::TIMQU:
j["Trigger"] = "Time Quota";
break;
}
*/
}
if (o.durationIsSet())
j["Duration"] = o.m_duration;
if (o.totNoPIsSet())
j["NoP"]["Total"] = o.m_totNoP;
if (o.ulNoPIsSet())
j["NoP"]["Uplink"] = o.m_ulNoP;
if (o.dlNoPIsSet())
j["NoP"]["Downlink"] = o.m_dlNoP;
if (o.totVolIsSet())
j["Volume"]["Total"] = o.m_totVol;
if (o.ulVolIsSet())
j["Volume"]["Uplink"] = o.m_ulVol;
if (o.dlVolIsSet())
j["Volume"]["Downlink"] = o.m_dlVol;
}
void from_json(const nlohmann::json& j, UsageReport& o) {
if (j.find("SEID") != j.end()) {
j.at("SEID").get_to(o.m_SEndID);
o.m_SEndIDIsSet = true;
}
if (j.find("UR-SEQN") != j.end()) {
j.at("UR-SEQN").get_to(o.m_urSeqN);
o.m_urSeqNIsSet = true;
}
if (j.find("Trigger") != j.end()) {
o.m_urTrigIsSet = true;
auto s = j.get<std::string>();
s = j.at("Trigger");
if (s == "Periodic Reporting")
o.m_urTrig.perio = 1;
if (s == "Volume Threshold")
o.m_urTrig.volth = 1;
if (s == "Time Threshold")
o.m_urTrig.timth = 1;
if (s == "Volume Quota")
o.m_urTrig.volqu = 1;
if (s == "Time Quota")
o.m_urTrig.timqu = 1;
else {
o.m_urTrigIsSet = false;
// TODO: Handle invalid JSON
}
}
if (j.find("Duration") != j.end()) {
j.at("Duration").get_to(o.m_duration);
o.m_durationIsSet = true;
}
if (j.find("NoP") != j.end()) {
if (j.find("Total") != j.end()) {
j.at("Total").get_to(o.m_totNoP);
o.m_totNoPIsSet = true;
}
if (j.find("Uplink") != j.end()) {
j.at("Uplink").get_to(o.m_ulNoP);
o.m_ulNoPIsSet = true;
}
if (j.find("Downlink") != j.end()) {
j.at("Downlink").get_to(o.m_dlNoP);
o.m_dlNoPIsSet = true;
}
}
if (j.find("Volume") != j.end()) {
if (j.find("Total") != j.end()) {
j.at("Total").get_to(o.m_totVol);
o.m_totVolIsSet = true;
}
if (j.find("Uplink") != j.end()) {
j.at("Uplink").get_to(o.m_ulVol);
o.m_ulVolIsSet = true;
}
if (j.find("Downlink") != j.end()) {
j.at("Downlink").get_to(o.m_dlVol);
o.m_dlVolIsSet = true;
}
}
}
int64_t UsageReport::getSEndID() const {
return m_SEndID;
}
void UsageReport::setSEndID(int64_t const& value) {
m_SEndID = value;
m_SEndIDIsSet = true;
}
bool UsageReport::SEndIDIsSet() const {
return m_SEndIDIsSet;
}
void UsageReport::unsetSEndID() {
m_SEndIDIsSet = false;
}
int32_t UsageReport::geturSeqN() const {
return m_urSeqN;
}
void UsageReport::seturSeqN(int32_t const& value) {
m_urSeqN = value;
m_urSeqNIsSet = true;
}
bool UsageReport::urSeqNIsSet() const {
return m_urSeqNIsSet;
}
void UsageReport::unseturSeqN() {
m_urSeqNIsSet = false;
}
int32_t UsageReport::getDuration() const {
return m_duration;
}
void UsageReport::setDuration(int32_t const& value) {
m_duration = value;
m_durationIsSet = true;
}
bool UsageReport::durationIsSet() const {
return m_durationIsSet;
}
void UsageReport::unsetDuration() {
m_durationIsSet = false;
}
int64_t UsageReport::getTotNoP() const {
return m_totNoP;
}
void UsageReport::setTotNoP(int64_t const& value) {
m_totNoP = value;
m_totNoPIsSet = true;
}
bool UsageReport::totNoPIsSet() const {
return m_totNoPIsSet;
}
void UsageReport::unsetTotNoP() {
m_totNoPIsSet = false;
}
int64_t UsageReport::getUlNoP() const {
return m_ulNoP;
}
void UsageReport::setUlNoP(int64_t const& value) {
m_ulNoP = value;
m_ulNoPIsSet = true;
}
bool UsageReport::ulNoPIsSet() const {
return m_ulNoPIsSet;
}
void UsageReport::unsetUlNoP() {
m_ulNoPIsSet = false;
}
int64_t UsageReport::getDlNoP() const {
return m_dlNoP;
}
void UsageReport::setDlNoP(int64_t const& value) {
m_dlNoP = value;
m_dlNoPIsSet = true;
}
bool UsageReport::dlNoPIsSet() const {
return m_dlNoPIsSet;
}
void UsageReport::unsetDlNoP() {
m_dlNoPIsSet = false;
}
int64_t UsageReport::getTotVol() const {
return m_totVol;
}
void UsageReport::setTotVol(int64_t const& value) {
m_totVol = value;
m_totVolIsSet = true;
}
bool UsageReport::totVolIsSet() const {
return m_totVolIsSet;
}
void UsageReport::unsetTotVol() {
m_totVolIsSet = false;
}
int64_t UsageReport::getUlVol() const {
return m_ulVol;
}
void UsageReport::setUlVol(int64_t const& value) {
m_ulVol = value;
m_ulVolIsSet = true;
}
bool UsageReport::ulVolIsSet() const {
return m_ulVolIsSet;
}
void UsageReport::unsetUlVol() {
m_ulVolIsSet = false;
}
int64_t UsageReport::getDlVol() const {
return m_dlVol;
}
void UsageReport::setDlVol(int64_t const& value) {
m_dlVol = value;
m_dlVolIsSet = true;
}
bool UsageReport::dlVolIsSet() const {
return m_dlVolIsSet;
}
void UsageReport::unsetDlVol() {
m_dlVolIsSet = false;
}
pfcp::usage_report_trigger_t UsageReport::getURTrigger() const {
return m_urTrig;
}
void UsageReport::setURTrigger(pfcp::usage_report_trigger_t const& value) {
m_urTrig = value;
m_urTrigIsSet = true;
}
bool UsageReport::urTriggerIsSet() const {
return m_urTrigIsSet;
}
void UsageReport::unsetURTrigger() {
m_urTrigIsSet = false;
}
} // namespace model
} // namespace smf_server
} // namespace oai
/**
* Nsmf_EventExposure
*
* UsageReport.h
*/
#ifndef UsageReport_H_
#define UsageReport_H_
#include "msg_pfcp.hpp"
#include <nlohmann/json.hpp>
namespace oai {
namespace smf_server {
namespace model {
// TODO: Redefine in separate files
enum UsageReportTrigger {
PERIO = 1,
VOLTH,
TIMTH,
VOLQU,
TIMQU
};
/// <summary>
///
/// </summary>
class UsageReport {
public:
UsageReport();
virtual ~UsageReport();
void validate();
/////////////////////////////////////////////
/// UsageReport members
/// <summary>
///
/// </summary>
int64_t getSEndID() const;
void setSEndID(int64_t const& value);
bool SEndIDIsSet() const;
void unsetSEndID();
/// <summary>
///
/// </summary>
int32_t geturSeqN() const;
void seturSeqN(int32_t const& value);
bool urSeqNIsSet() const;
void unseturSeqN();
/// <summary>
///
/// </summary>
int32_t getDuration() const;
void setDuration(int32_t const& value);
bool durationIsSet() const;
void unsetDuration();
/// <summary>
///
/// </summary>
int64_t getTotNoP() const;
void setTotNoP(int64_t const& value);
bool totNoPIsSet() const;
void unsetTotNoP();
/// <summary>
///
/// </summary>
int64_t getUlNoP() const;
void setUlNoP(int64_t const& value);
bool ulNoPIsSet() const;
void unsetUlNoP();
/// <summary>
///
/// </summary>
int64_t getDlNoP() const;
void setDlNoP(int64_t const& value);
bool dlNoPIsSet() const;
void unsetDlNoP();
/// <summary>
///
/// </summary>
int64_t getTotVol() const;
void setTotVol(int64_t const& value);
bool totVolIsSet() const;
void unsetTotVol();
/// <summary>
///
/// </summary>
int64_t getUlVol() const;
void setUlVol(int64_t const& value);
bool ulVolIsSet() const;
void unsetUlVol();
/// <summary>
///
/// </summary>
int64_t getDlVol() const;
void setDlVol(int64_t const& value);
bool dlVolIsSet() const;
void unsetDlVol();
/// <summary>
///
/// </summary>
pfcp::usage_report_trigger_t getURTrigger() const;
void setURTrigger(pfcp::usage_report_trigger_t const& value);
bool urTriggerIsSet() const;
void unsetURTrigger();
friend void to_json(nlohmann::json& j, const UsageReport& o);
friend void from_json(const nlohmann::json& j, UsageReport& o);
protected:
int64_t m_SEndID;
bool m_SEndIDIsSet;
int32_t m_urSeqN;
bool m_urSeqNIsSet;
int32_t m_duration;
bool m_durationIsSet;
int64_t m_totNoP;
bool m_totNoPIsSet;
int64_t m_ulNoP;
bool m_ulNoPIsSet;
int64_t m_dlNoP;
bool m_dlNoPIsSet;
int64_t m_totVol;
bool m_totVolIsSet;
int64_t m_ulVol;
bool m_ulVolIsSet;
int64_t m_dlVol;
bool m_dlVolIsSet;
// UsageReportTrigger m_urTrig;
pfcp::usage_report_trigger_t m_urTrig;
bool m_urTrigIsSet;
};
} // namespace model
} // namespace smf_server
} // namespace oai
#endif /* UsageReport_H_ */
...@@ -31,7 +31,11 @@ typedef enum smf_event_e { ...@@ -31,7 +31,11 @@ typedef enum smf_event_e {
SMF_EVENT_PLMN_CH = 4, SMF_EVENT_PLMN_CH = 4,
SMF_EVENT_UE_IP_CH = 5, SMF_EVENT_UE_IP_CH = 5,
SMF_EVENT_DDDS = 6, SMF_EVENT_DDDS = 6,
<<<<<<< HEAD
SMF_EVENT_PDUSESEST = 7, SMF_EVENT_PDUSESEST = 7,
=======
SMF_EVENT_QOS_MON = 7,
>>>>>>> origin/qos_monitoring_event
SMF_EVENT_FLEXCN = 99 SMF_EVENT_FLEXCN = 99
} smf_event_t; } smf_event_t;
...@@ -41,6 +45,7 @@ static std::string smf_event_from_enum(smf_event_t e) { ...@@ -41,6 +45,7 @@ static std::string smf_event_from_enum(smf_event_t e) {
if (e == smf_event_t::SMF_EVENT_PDU_SES_REL) return "PDU_SES_REL"; if (e == smf_event_t::SMF_EVENT_PDU_SES_REL) return "PDU_SES_REL";
if (e == smf_event_t::SMF_EVENT_PLMN_CH) return "PLMN_CH"; if (e == smf_event_t::SMF_EVENT_PLMN_CH) return "PLMN_CH";
if (e == smf_event_t::SMF_EVENT_UE_IP_CH) return "UE_IP_CH"; if (e == smf_event_t::SMF_EVENT_UE_IP_CH) return "UE_IP_CH";
if (e == smf_event_t::SMF_EVENT_QOS_MON) return "QOS_MON";
if (e == smf_event_t::SMF_EVENT_DDDS) return "DDDS"; if (e == smf_event_t::SMF_EVENT_DDDS) return "DDDS";
if (e == smf_event_t::SMF_EVENT_PDUSESEST) return "PDU_SES_EST"; if (e == smf_event_t::SMF_EVENT_PDUSESEST) return "PDU_SES_EST";
if (e == smf_event_t::SMF_EVENT_FLEXCN) return "FLEXCN"; if (e == smf_event_t::SMF_EVENT_FLEXCN) return "FLEXCN";
...@@ -55,7 +60,11 @@ static const std::vector<std::string> smf_event_e2str = { ...@@ -55,7 +60,11 @@ static const std::vector<std::string> smf_event_e2str = {
"PLMN Change", "PLMN Change",
"UE IP address change", "UE IP address change",
"Downlink data delivery status", "Downlink data delivery status",
<<<<<<< HEAD
"PDU Session Establishment", "PDU Session Establishment",
=======
"QoS Monitoring",
>>>>>>> origin/qos_monitoring_event
"FlexCN"}; "FlexCN"};
enum class notification_method_e { enum class notification_method_e {
......
...@@ -538,8 +538,13 @@ void xgpp_conv::smf_event_exposure_notification_from_openapi( ...@@ -538,8 +538,13 @@ void xgpp_conv::smf_event_exposure_notification_from_openapi(
event_subscription.smf_event = smf_event_e::SMF_EVENT_UE_IP_CH; event_subscription.smf_event = smf_event_e::SMF_EVENT_UE_IP_CH;
} else if (event_id.compare("DDDS") == 0) { } else if (event_id.compare("DDDS") == 0) {
event_subscription.smf_event = smf_event_e::SMF_EVENT_DDDS; event_subscription.smf_event = smf_event_e::SMF_EVENT_DDDS;
<<<<<<< HEAD
} else if (event_id.compare("PDU_SES_EST") == 0) { } else if (event_id.compare("PDU_SES_EST") == 0) {
event_subscription.smf_event = smf_event_e::SMF_EVENT_PDUSESEST; event_subscription.smf_event = smf_event_e::SMF_EVENT_PDUSESEST;
=======
} else if (event_id.compare("QOS_MON") == 0) {
event_subscription.smf_event = smf_event_e::SMF_EVENT_QOS_MON;
>>>>>>> origin/qos_monitoring_event
} else if (event_id.compare("FLEXCN") == 0) { } else if (event_id.compare("FLEXCN") == 0) {
event_subscription.smf_event = smf_event_e::SMF_EVENT_FLEXCN; event_subscription.smf_event = smf_event_e::SMF_EVENT_FLEXCN;
} else { } else {
......
...@@ -4332,98 +4332,189 @@ class pfcp_time_of_last_packet_ie : public pfcp_ie { ...@@ -4332,98 +4332,189 @@ class pfcp_time_of_last_packet_ie : public pfcp_ie {
// s.set(dropped_dl_traffic_threshold); // s.set(dropped_dl_traffic_threshold);
// } // }
//}; //};
////-------------------------------------
//// IE VOLUME_QUOTA //-------------------------------------
// class pfcp_volume_quota_ie : public pfcp_ie { // IE VOLUME_QUOTA
// public: class pfcp_volume_quota_ie : public pfcp_ie {
// uint8_t todo; public:
// union {
// //-------- struct {
// pfcp_volume_quota_ie(const pfcp::volume_quota_t& b) : uint8_t tovol : 1;
// pfcp_ie(PFCP_IE_VOLUME_QUOTA){ uint8_t ulvol : 1;
// todo = 0; uint8_t dlvol : 1;
// tlv.set_length(1); uint8_t spare : 5;
// } } bf;
// //-------- uint8_t b;
// pfcp_volume_quota_ie() : pfcp_ie(PFCP_IE_VOLUME_QUOTA){ } u1;
// todo = 0; uint64_t total_volume;
// tlv.set_length(1); uint64_t uplink_volume;
// } uint64_t downlink_volume;
// //-------- //--------
// pfcp_volume_quota_ie(const pfcp_tlv& t) : pfcp_ie(t) { explicit pfcp_volume_quota_ie(const pfcp::volume_quota_t& b)
// todo = 0; : pfcp_ie(PFCP_IE_VOLUME_QUOTA) {
// }; tlv.set_length(1);
// //-------- u1.b = 0;
// void to_core_type(pfcp::volume_quota_t& b) { u1.bf.tovol = b.tovol;
// b.todo = todo; u1.bf.ulvol = b.ulvol;
// } u1.bf.dlvol = b.dlvol;
// //-------- if (u1.bf.tovol) {
// void dump_to(std::ostream& os) { total_volume = b.total_volume;
// tlv.dump_to(os); tlv.add_length(sizeof(total_volume));
// os.write(reinterpret_cast<const char*>(&todo), sizeof(todo)); } else {
// } total_volume = 0;
// //-------- }
// void load_from(std::istream& is) { if (u1.bf.ulvol) {
// //tlv.load_from(is); uplink_volume = b.uplink_volume;
// if (tlv.get_length() != 1) { tlv.add_length(sizeof(uplink_volume));
// throw pfcp_tlv_bad_length_exception(tlv.type, tlv.get_length(), } else {
// __FILE__, __LINE__); uplink_volume = 0;
// } }
// is.read(reinterpret_cast<char*>(&todo), sizeof(todo)); if (u1.bf.dlvol) {
// } downlink_volume = b.downlink_volume;
// //-------- tlv.add_length(sizeof(downlink_volume));
// void to_core_type(pfcp_ies_container& s) { } else {
// pfcp::volume_quota_t volume_quota = {}; downlink_volume = 0;
// to_core_type(volume_quota); }
// s.set(volume_quota); }
// } //--------
//}; pfcp_volume_quota_ie() : pfcp_ie(PFCP_IE_VOLUME_QUOTA) {
////------------------------------------- tlv.set_length(1);
//// IE TIME_QUOTA u1.b = 0;
// class pfcp_time_quota_ie : public pfcp_ie { total_volume = 0;
// public: uplink_volume = 0;
// uint8_t todo; downlink_volume = 0;
// }
// //-------- //--------
// pfcp_time_quota_ie(const pfcp::time_quota_t& b) : explicit pfcp_volume_quota_ie(const pfcp_tlv& t) : pfcp_ie(t){};
// pfcp_ie(PFCP_IE_TIME_QUOTA){ //--------
// todo = 0; void to_core_type(pfcp::volume_quota_t& b) {
// tlv.set_length(1); b = {};
// } b.tovol = u1.bf.tovol;
// //-------- b.ulvol = u1.bf.ulvol;
// pfcp_time_quota_ie() : pfcp_ie(PFCP_IE_TIME_QUOTA){ b.dlvol = u1.bf.dlvol;
// todo = 0; if (u1.bf.tovol) {
// tlv.set_length(1); b.total_volume = total_volume;
// } }
// //-------- if (u1.bf.ulvol) {
// pfcp_time_quota_ie(const pfcp_tlv& t) : pfcp_ie(t) { b.uplink_volume = uplink_volume;
// todo = 0; }
// }; if (u1.bf.dlvol) {
// //-------- b.downlink_volume = downlink_volume;
// void to_core_type(pfcp::time_quota_t& b) { }
// b.todo = todo; }
// } //--------
// //-------- void dump_to(std::ostream& os) {
// void dump_to(std::ostream& os) { tlv.set_length(1);
// tlv.dump_to(os); if (u1.bf.tovol) {
// os.write(reinterpret_cast<const char*>(&todo), sizeof(todo)); tlv.add_length(sizeof(total_volume));
// } }
// //-------- if (u1.bf.ulvol) {
// void load_from(std::istream& is) { tlv.add_length(sizeof(uplink_volume));
// //tlv.load_from(is); }
// if (tlv.get_length() != 1) { if (u1.bf.dlvol) {
// throw pfcp_tlv_bad_length_exception(tlv.type, tlv.get_length(), tlv.add_length(sizeof(downlink_volume));
// __FILE__, __LINE__); }
// }
// is.read(reinterpret_cast<char*>(&todo), sizeof(todo)); tlv.dump_to(os);
// } os.write(reinterpret_cast<const char*>(&u1.b), sizeof(u1.b));
// //-------- if (u1.bf.tovol) {
// void to_core_type(pfcp_ies_container& s) { auto be_total_volume = htobe64(total_volume);
// pfcp::time_quota_t time_quota = {}; os.write(
// to_core_type(time_quota); reinterpret_cast<const char*>(&be_total_volume),
// s.set(time_quota); sizeof(be_total_volume));
// } }
//}; if (u1.bf.ulvol) {
auto be_uplink_volume = htobe64(uplink_volume);
os.write(
reinterpret_cast<const char*>(&be_uplink_volume),
sizeof(be_uplink_volume));
}
if (u1.bf.dlvol) {
auto be_downlink_volume = htobe64(downlink_volume);
os.write(
reinterpret_cast<const char*>(&be_downlink_volume),
sizeof(be_downlink_volume));
}
}
//--------
void load_from(std::istream& is) {
// tlv.load_from(is);
if (tlv.get_length() < 1) {
throw pfcp_tlv_bad_length_exception(
tlv.type, tlv.get_length(), __FILE__, __LINE__);
}
if (u1.bf.tovol) {
is.read(reinterpret_cast<char*>(&total_volume), sizeof(total_volume));
total_volume = be64toh(total_volume);
}
if (u1.bf.ulvol) {
is.read(reinterpret_cast<char*>(&uplink_volume), sizeof(uplink_volume));
total_volume = be64toh(uplink_volume);
}
if (u1.bf.dlvol) {
is.read(
reinterpret_cast<char*>(&downlink_volume), sizeof(downlink_volume));
total_volume = be64toh(downlink_volume);
}
}
//--------
void to_core_type(pfcp_ies_container& s) {
pfcp::volume_quota_t v = {};
to_core_type(v);
s.set(v);
}
};
//-------------------------------------
// IE TIME_QUOTA
class pfcp_time_quota_ie : public pfcp_ie {
public:
uint32_t time_quota;
//--------
explicit pfcp_time_quota_ie(const pfcp::time_quota_t& b)
: pfcp_ie(PFCP_IE_TIME_QUOTA) {
time_quota = b.time_quota;
tlv.set_length(sizeof(time_quota));
}
//--------
pfcp_time_quota_ie()
: pfcp_ie(PFCP_IE_TIME_QUOTA), time_quota(0) {
tlv.set_length(sizeof(time_quota));
}
//--------
explicit pfcp_time_quota_ie(const pfcp_tlv& t)
: pfcp_ie(t), time_quota(0){};
//--------
void to_core_type(pfcp::time_quota_t& b) {
b.time_quota = time_quota;
}
//--------
void dump_to(std::ostream& os) {
tlv.dump_to(os);
auto be_time_quota = htobe32(time_quota);
os.write(
reinterpret_cast<const char*>(&be_time_quota),
sizeof(be_time_quota));
}
//--------
void load_from(std::istream& is) {
// tlv.load_from(is);
if (tlv.get_length() != sizeof(time_quota)) {
throw pfcp_tlv_bad_length_exception(
tlv.type, tlv.get_length(), __FILE__, __LINE__);
}
is.read(reinterpret_cast<char*>(&time_quota), sizeof(time_quota));
time_quota = be32toh(time_quota);
}
//--------
void to_core_type(pfcp_ies_container& s) {
pfcp::time_quota_t v = {};
to_core_type(v);
s.set(v);
}
};
//------------------------------------- //-------------------------------------
// IE START_TIME // IE START_TIME
class pfcp_start_time_ie : public pfcp_ie { class pfcp_start_time_ie : public pfcp_ie {
...@@ -9167,16 +9258,33 @@ class pfcp_create_urr_ie : public pfcp_grouped_ie { ...@@ -9167,16 +9258,33 @@ class pfcp_create_urr_ie : public pfcp_grouped_ie {
new pfcp_reporting_triggers_ie(b.reporting_triggers.second)); new pfcp_reporting_triggers_ie(b.reporting_triggers.second));
add_ie(sie); add_ie(sie);
} }
if (b.urr_id.first && b.measurement_period.first) { if (b.urr_id.first) {
if (b.measurement_period.first) {
std::shared_ptr<pfcp_measurement_period_ie> sie( std::shared_ptr<pfcp_measurement_period_ie> sie(
new pfcp_measurement_period_ie(b.measurement_period.second)); new pfcp_measurement_period_ie(b.measurement_period.second));
add_ie(sie); add_ie(sie);
} }
if (b.urr_id.first && b.volume_threshold.first) { if (b.volume_threshold.first) {
std::shared_ptr<pfcp_volume_threshold_ie> sie( std::shared_ptr<pfcp_volume_threshold_ie> sie(
new pfcp_volume_threshold_ie(b.volume_threshold.second)); new pfcp_volume_threshold_ie(b.volume_threshold.second));
add_ie(sie); add_ie(sie);
} }
if (b.volume_quota.first) {
std::shared_ptr<pfcp_volume_quota_ie> sie(
new pfcp_volume_quota_ie(b.volume_quota.second));
add_ie(sie);
}
if (b.time_threshold.first) {
std::shared_ptr<pfcp_time_threshold_ie> sie(
new pfcp_time_threshold_ie(b.time_threshold.second));
add_ie(sie);
}
if (b.time_quota.first) {
std::shared_ptr<pfcp_time_quota_ie> sie(
new pfcp_time_quota_ie(b.time_quota.second));
add_ie(sie);
}
}
// ToDo: Optional IEs // ToDo: Optional IEs
} }
pfcp_create_urr_ie() : pfcp_grouped_ie(PFCP_IE_CREATE_URR) {} pfcp_create_urr_ie() : pfcp_grouped_ie(PFCP_IE_CREATE_URR) {}
......
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
#include "smf_procedure.hpp" #include "smf_procedure.hpp"
#include "3gpp_conversions.hpp" #include "3gpp_conversions.hpp"
#include "string.hpp" #include "string.hpp"
#include "EventNotification.h"
extern "C" { extern "C" {
#include "Ngap_AssociatedQosFlowItem.h" #include "Ngap_AssociatedQosFlowItem.h"
...@@ -981,11 +982,18 @@ void smf_context::handle_itti_msg( ...@@ -981,11 +982,18 @@ void smf_context::handle_itti_msg(
pfcp::volume_measurement_t vm; pfcp::volume_measurement_t vm;
pfcp::duration_measurement_t dm; pfcp::duration_measurement_t dm;
pfcp::ur_seqn_t seqn; pfcp::ur_seqn_t seqn;
pfcp::usage_report_trigger_t trig;
if (ur.get(vm)) { if (ur.get(vm)) {
Logger::smf_app().info("\t\t SEID -> %lld", req->seid); Logger::smf_app().info("\t\t SEID -> %lld", req->seid);
if (ur.get(seqn)) if (ur.get(seqn))
Logger::smf_app().info("\t\t UR-SEQN -> %ld", seqn.ur_seqn); Logger::smf_app().info("\t\t UR-SEQN -> %ld", seqn.ur_seqn);
if (ur.get(trig))
if (trig.perio) Logger::smf_app().info("\t\t Trigger -> Periodic Reporting");
if (trig.timqu) Logger::smf_app().info("\t\t Trigger -> Time Quota");
if (trig.timth) Logger::smf_app().info("\t\t Trigger -> Time Threshold");
if (trig.volqu) Logger::smf_app().info("\t\t Trigger -> Volume Quota");
if (trig.volth) Logger::smf_app().info("\t\t Trigger -> Volume Threshold");
if (ur.get(dm)) if (ur.get(dm))
Logger::smf_app().info("\t\t Duration -> %ld", dm.duration); Logger::smf_app().info("\t\t Duration -> %ld", dm.duration);
Logger::smf_app().info("\t\t NoP Total -> %lld", vm.total_nop); Logger::smf_app().info("\t\t NoP Total -> %lld", vm.total_nop);
...@@ -999,7 +1007,37 @@ void smf_context::handle_itti_msg( ...@@ -999,7 +1007,37 @@ void smf_context::handle_itti_msg(
Logger::smf_app().info( Logger::smf_app().info(
"\t\t Downlink -> %lld", vm.downlink_volume); "\t\t Downlink -> %lld", vm.downlink_volume);
} }
// Trigger QoS Monitoring Event report notification
std::shared_ptr<smf_context> pc = {};
if (smf_app_inst->seid_2_smf_context(req->seid, pc)) {
oai::smf_server::model::EventNotification ev_notif = {};
oai::smf_server::model::UsageReport ur_model = {};
if (ur.get(vm)) {
ur_model.setSEndID(req->seid);
if (ur.get(seqn))
ur_model.seturSeqN(seqn.ur_seqn);
if (ur.get(dm))
ur_model.setDuration(dm.duration);
ur_model.setTotNoP(vm.total_nop);
ur_model.setUlNoP(vm.uplink_nop);
ur_model.setDlNoP(vm.downlink_nop);
ur_model.setTotVol(vm.total_volume);
ur_model.setUlVol(vm.uplink_volume);
ur_model.setDlVol(vm.downlink_volume);
}
if (ur.usage_report_trigger.first)
ur_model.setURTrigger(ur.usage_report_trigger.second);
ev_notif.setUsageReport(ur_model);
pc.get()->trigger_qos_monitoring(req->seid, ev_notif, 1);
} else {
Logger::smf_app().debug(
"No SFM context found for SEID " TEID_FMT
". Unable to notify QoS Monitoring Event Report.",
req->seid);
} }
}
std::shared_ptr<itti_n4_session_report_response> n4_report_ack = std::shared_ptr<itti_n4_session_report_response> n4_report_ack =
std::make_shared<itti_n4_session_report_response>( std::make_shared<itti_n4_session_report_response>(
TASK_SMF_APP, TASK_SMF_N4); TASK_SMF_APP, TASK_SMF_N4);
...@@ -4049,6 +4087,77 @@ void smf_context::trigger_ue_ip_change(scid_t scid, uint8_t http_version) { ...@@ -4049,6 +4087,77 @@ void smf_context::trigger_ue_ip_change(scid_t scid, uint8_t http_version) {
event_sub.ee_ue_ip_change(scid, http_version); event_sub.ee_ue_ip_change(scid, http_version);
} }
//------------------------------------------------------------------------------
void smf_context::handle_qos_monitoring(seid_t seid,
oai::smf_server::model::EventNotification ev_notif_model, uint8_t http_version) {
Logger::smf_app().debug(
"Send request to N11 to trigger QoS Monitoring (Usage Report) Event, "
"SMF Context-related SEID " SEID_FMT ,
seid);
// Get the smf context
std::shared_ptr<smf_context> pc = {};
if (!smf_app_inst->seid_2_smf_context(seid, pc)) {
Logger::smf_app().warn(
"Context associated with this SEID " SEID_FMT " does not exit!", seid);
return;
}
supi_t supi = pc.get()->supi;
supi64_t supi64 = smf_supi_to_u64(supi);
std::vector<std::shared_ptr<smf_subscription>> subscriptions = {};
smf_app_inst->get_ee_subscriptions(
smf_event_t::SMF_EVENT_QOS_MON, subscriptions);
if (subscriptions.size() > 0) {
// Send request to N11 to trigger the notification to the subscribed event
Logger::smf_app().debug(
"Send ITTI msg to SMF N11 to trigger the event notification");
std::shared_ptr<itti_n11_notify_subscribed_event> itti_msg =
std::make_shared<itti_n11_notify_subscribed_event>(
TASK_SMF_APP, TASK_SMF_SBI);
for (auto i : subscriptions) {
event_notification ev_notif = {};
ev_notif.set_supi(supi64);
ev_notif.set_smf_event(smf_event_t::SMF_EVENT_QOS_MON);
ev_notif.set_notif_uri(i.get()->notif_uri);
ev_notif.set_notif_id(i.get()->notif_id);
// timestamp
std::time_t time_epoch_ntp = std::time(nullptr);
uint64_t tv_ntp = time_epoch_ntp + SECONDS_SINCE_FIRST_EPOCH;
ev_notif.set_timestamp(std::to_string(tv_ntp));
// Custom json for Usage Report
nlohmann::json cj = {};
to_json(cj, ev_notif_model);
ev_notif.set_custom_info(cj);
itti_msg->event_notifs.push_back(ev_notif);
}
itti_msg->http_version = http_version;
int ret = itti_inst->send_msg(itti_msg);
if (RETURNok != ret) {
Logger::smf_app().error(
"Could not send ITTI message %s to task TASK_SMF_SBI",
itti_msg->get_msg_name());
}
} else {
Logger::smf_app().debug("No subscription available for this event");
}
}
//------------------------------------------------------------------------------
void smf_context::trigger_qos_monitoring(seid_t seid,
oai::smf_server::model::EventNotification ev_notif_model, uint8_t http_version) {
event_sub.ee_qos_monitoring(seid, ev_notif_model, http_version);
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void smf_context::handle_flexcn_event(scid_t scid, uint8_t http_version) { void smf_context::handle_flexcn_event(scid_t scid, uint8_t http_version) {
Logger::smf_app().debug( Logger::smf_app().debug(
......
...@@ -690,6 +690,10 @@ class smf_context : public std::enable_shared_from_this<smf_context> { ...@@ -690,6 +690,10 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
ee_ddds_connection = event_sub.subscribe_ee_ddds( ee_ddds_connection = event_sub.subscribe_ee_ddds(
boost::bind(&smf_context::handle_ddds, this, _1, _2)); boost::bind(&smf_context::handle_ddds, this, _1, _2));
// Subscribe to QoS Monitoring Event
ee_qos_monitoring_connection = event_sub.subscribe_ee_qos_monitoring(
boost::bind(&smf_context::handle_qos_monitoring, this, _1, _2, _3));
// Subscribe to PDU SESSION ESTABLISHMENT event // Subscribe to PDU SESSION ESTABLISHMENT event
ee_pdusesest = event_sub.subscribe_ee_pdusesest( ee_pdusesest = event_sub.subscribe_ee_pdusesest(
boost::bind(&smf_context::handle_pdusesest, this, _1, _2)); boost::bind(&smf_context::handle_pdusesest, this, _1, _2));
...@@ -712,6 +716,8 @@ class smf_context : public std::enable_shared_from_this<smf_context> { ...@@ -712,6 +716,8 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
ee_ue_ip_change_connection.disconnect(); ee_ue_ip_change_connection.disconnect();
if (ee_plmn_change_connection.connected()) if (ee_plmn_change_connection.connected())
ee_plmn_change_connection.disconnect(); ee_plmn_change_connection.disconnect();
if (ee_qos_monitoring_connection.connected())
ee_qos_monitoring_connection.disconnect();
if (ee_ddds_connection.connected()) ee_ddds_connection.disconnect(); if (ee_ddds_connection.connected()) ee_ddds_connection.disconnect();
if (ee_pdusesest.connected()) ee_pdusesest.disconnect(); if (ee_pdusesest.connected()) ee_pdusesest.disconnect();
if (ee_flexcn.connected()) ee_flexcn.disconnect(); if (ee_flexcn.connected()) ee_flexcn.disconnect();
...@@ -1257,8 +1263,13 @@ class smf_context : public std::enable_shared_from_this<smf_context> { ...@@ -1257,8 +1263,13 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
void trigger_ddds(scid_t scid, uint8_t http_version); void trigger_ddds(scid_t scid, uint8_t http_version);
void handle_ddds(scid_t scid, uint8_t http_version); void handle_ddds(scid_t scid, uint8_t http_version);
<<<<<<< HEAD
void trigger_pdusesest(scid_t scid, uint8_t http_version); void trigger_pdusesest(scid_t scid, uint8_t http_version);
void handle_pdusesest(scid_t scid, uint8_t http_version); void handle_pdusesest(scid_t scid, uint8_t http_version);
=======
void trigger_qos_monitoring(seid_t seid, oai::smf_server::model::EventNotification ev_notif_model, uint8_t http_version);
void handle_qos_monitoring(seid_t seid, oai::smf_server::model::EventNotification ev_notif_model, uint8_t http_version);
>>>>>>> origin/qos_monitoring_event
void trigger_flexcn_event(scid_t scid, uint8_t http_version); void trigger_flexcn_event(scid_t scid, uint8_t http_version);
void handle_flexcn_event(scid_t scid, uint8_t http_version); void handle_flexcn_event(scid_t scid, uint8_t http_version);
...@@ -1392,7 +1403,11 @@ class smf_context : public std::enable_shared_from_this<smf_context> { ...@@ -1392,7 +1403,11 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
bs2::connection ee_ue_ip_change_connection; bs2::connection ee_ue_ip_change_connection;
bs2::connection ee_plmn_change_connection; bs2::connection ee_plmn_change_connection;
bs2::connection ee_ddds_connection; bs2::connection ee_ddds_connection;
<<<<<<< HEAD
bs2::connection ee_pdusesest; bs2::connection ee_pdusesest;
=======
bs2::connection ee_qos_monitoring_connection;
>>>>>>> origin/qos_monitoring_event
bs2::connection ee_flexcn; bs2::connection ee_flexcn;
}; };
} // namespace smf } // namespace smf
......
...@@ -73,6 +73,12 @@ bs2::connection smf_event::subscribe_ee_pdusesest( ...@@ -73,6 +73,12 @@ bs2::connection smf_event::subscribe_ee_pdusesest(
return ee_pdusesest.connect(sig); return ee_pdusesest.connect(sig);
} }
//------------------------------------------------------------------------------
bs2::connection smf_event::subscribe_ee_qos_monitoring(
const ee_qos_monitoring_sig_t::slot_type& sig) {
return ee_qos_monitoring.connect(sig);
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bs2::connection smf_event::subscribe_ee_flexcn_event( bs2::connection smf_event::subscribe_ee_flexcn_event(
const ee_flexcn_sig_t::slot_type& sig) { const ee_flexcn_sig_t::slot_type& sig) {
......
...@@ -82,8 +82,13 @@ class smf_event { ...@@ -82,8 +82,13 @@ class smf_event {
// download link data status // download link data status
bs2::connection subscribe_ee_ddds(const ee_ddds_sig_t::slot_type& sig); bs2::connection subscribe_ee_ddds(const ee_ddds_sig_t::slot_type& sig);
<<<<<<< HEAD
bs2::connection subscribe_ee_pdusesest( bs2::connection subscribe_ee_pdusesest(
const ee_pdusesest_sig_t::slot_type& sig); const ee_pdusesest_sig_t::slot_type& sig);
=======
bs2::connection subscribe_ee_qos_monitoring(
const ee_qos_monitoring_sig_t::slot_type& sig);
>>>>>>> origin/qos_monitoring_event
bs2::connection subscribe_ee_flexcn_event( bs2::connection subscribe_ee_flexcn_event(
const ee_flexcn_sig_t::slot_type& sig); const ee_flexcn_sig_t::slot_type& sig);
...@@ -96,7 +101,11 @@ bs2::connection subscribe_ee_pdusesest( ...@@ -96,7 +101,11 @@ bs2::connection subscribe_ee_pdusesest(
ee_ue_ip_change_sig_t ee_ue_ip_change; // Signal for UE IP Addr change ee_ue_ip_change_sig_t ee_ue_ip_change; // Signal for UE IP Addr change
ee_plmn_change_sig_t ee_plmn_change; // Signal for UE IP Addr change ee_plmn_change_sig_t ee_plmn_change; // Signal for UE IP Addr change
ee_ddds_sig_t ee_ddds; ee_ddds_sig_t ee_ddds;
<<<<<<< HEAD
ee_pdusesest_sig_t ee_pdusesest; // Signal for pdu session establishment ee_pdusesest_sig_t ee_pdusesest; // Signal for pdu session establishment
=======
ee_qos_monitoring_sig_t ee_qos_monitoring; // Signal for QoS Monitoring
>>>>>>> origin/qos_monitoring_event
ee_flexcn_sig_t ee_flexcn; // Signal for FlexCN Event ee_flexcn_sig_t ee_flexcn; // Signal for FlexCN Event
}; };
} // namespace smf } // namespace smf
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <boost/signals2.hpp> #include <boost/signals2.hpp>
#include <string> #include <string>
#include "3gpp_24.007.h" #include "3gpp_24.007.h"
#include "EventNotification.h"
namespace bs2 = boost::signals2; namespace bs2 = boost::signals2;
...@@ -70,11 +71,22 @@ typedef bs2::signal_type< ...@@ -70,11 +71,22 @@ typedef bs2::signal_type<
void(scid_t, uint8_t), bs2::keywords::mutex_type<bs2::dummy_mutex>>::type void(scid_t, uint8_t), bs2::keywords::mutex_type<bs2::dummy_mutex>>::type
ee_ddds_sig_t; ee_ddds_sig_t;
<<<<<<< HEAD
// Signal for PDU SESSION ESTABLISHMENT // Signal for PDU SESSION ESTABLISHMENT
// SCID, HTTP version // SCID, HTTP version
typedef bs2::signal_type< typedef bs2::signal_type<
void(scid_t, uint8_t), bs2::keywords::mutex_type<bs2::dummy_mutex>>::type void(scid_t, uint8_t), bs2::keywords::mutex_type<bs2::dummy_mutex>>::type
ee_pdusesest_sig_t; ee_pdusesest_sig_t;
=======
// Signal for QoS Monitoring Event exposure (Usage Report)
// SEID, Event Notification Model , HTTP version
// TODO: use SCID and access PDU Session ID (need binding SCIDs - PDUSessID)
typedef bs2::signal_type<
void(seid_t, oai::smf_server::model::EventNotification, uint8_t),
bs2::keywords::mutex_type<bs2::dummy_mutex>>::type
ee_qos_monitoring_sig_t;
>>>>>>> origin/qos_monitoring_event
// Signal for FlexCN event (for Event Exposure) // Signal for FlexCN event (for Event Exposure)
// SCID, HTTP version // SCID, HTTP version
typedef bs2::signal_type< typedef bs2::signal_type<
......
...@@ -320,14 +320,33 @@ int session_create_sm_context_procedure::run( ...@@ -320,14 +320,33 @@ int session_create_sm_context_procedure::run(
pfcp::measurement_method_t measurement_method = {}; pfcp::measurement_method_t measurement_method = {};
pfcp::measurement_period_t measurement_Period = {}; pfcp::measurement_period_t measurement_Period = {};
pfcp::reporting_triggers_t reporting_triggers = {}; pfcp::reporting_triggers_t reporting_triggers = {};
pfcp::volume_threshold_t volume_threshold = {};
pfcp::time_threshold_t time_threshold = {};
// Hardcoded values for the moment // Hardcoded values for the moment
measurement_method.volum = 1; // Volume based usage report measurement_method.volum = 1; // Volume based usage report
measurement_method.durat = 1;
measurement_Period.measurement_period = 10; // Every 10 Sec measurement_Period.measurement_period = 10; // Every 10 Sec
reporting_triggers.perio = 1; // Periodic usage report reporting_triggers.perio = 1; // Periodic usage report
reporting_triggers.volth = 1;
reporting_triggers.timth = 1;
reporting_triggers.volqu = 0;
reporting_triggers.timqu = 0;
volume_threshold.dlvol = 1;
volume_threshold.ulvol = 0;
volume_threshold.tovol = 0;
volume_threshold.downlink_volume = 1000;
time_threshold.time_threshold = 5;
create_urr.set(urr_id); create_urr.set(urr_id);
create_urr.set(measurement_method); create_urr.set(measurement_method);
create_urr.set(measurement_Period); create_urr.set(measurement_Period);
create_urr.set(reporting_triggers); create_urr.set(reporting_triggers);
create_urr.set(time_threshold);
create_urr.set(volume_threshold);
n4_triggered->pfcp_ies.set(create_urr); n4_triggered->pfcp_ies.set(create_urr);
} }
// TODO: list of QoS Enforcement Rule IDs // TODO: list of QoS Enforcement Rule IDs
......
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