Commit 98ea303b authored by Raphael Defosseux's avatar Raphael Defosseux

style(smf): formatting files

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@openairinterface.org>
parent fdd0cf3b
...@@ -53,7 +53,6 @@ EventNotification::EventNotification() { ...@@ -53,7 +53,6 @@ EventNotification::EventNotification() {
m_MaxWaitTimeIsSet = false; m_MaxWaitTimeIsSet = false;
m_usageReport = {}; m_usageReport = {};
m_usageReportIsSet = false; m_usageReportIsSet = false;
} }
EventNotification::~EventNotification() {} EventNotification::~EventNotification() {}
...@@ -90,7 +89,6 @@ void to_json(nlohmann::json& j, const EventNotification& o) { ...@@ -90,7 +89,6 @@ void to_json(nlohmann::json& j, const EventNotification& o) {
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; 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) {
...@@ -485,7 +483,6 @@ void EventNotification::unsetUsageReport() { ...@@ -485,7 +483,6 @@ void EventNotification::unsetUsageReport() {
m_usageReportIsSet = false; m_usageReportIsSet = false;
} }
} // namespace model } // namespace model
} // namespace smf_server } // namespace smf_server
} // namespace oai } // namespace oai
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
* *
* 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 - QOS_MON: QoS Monitoring * UE IP address change - DDDS: Downlink data delivery status - QOS_MON: QoS
* Monitoring
*/ */
#ifndef SmfEvent_H_ #ifndef SmfEvent_H_
...@@ -30,7 +31,8 @@ namespace model { ...@@ -30,7 +31,8 @@ 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 - QOS_MON: QoS Monitoring /// UE IP address change - DDDS: Downlink data delivery status - QOS_MON: QoS
/// Monitoring
/// </summary> /// </summary>
class SmfEvent { class SmfEvent {
public: public:
......
/** /**
* Nsmf_EventExposure * Nsmf_EventExposure
* *
* UsageReport.cpp * UsageReport.cpp
*/ */
...@@ -12,26 +12,26 @@ namespace smf_server { ...@@ -12,26 +12,26 @@ namespace smf_server {
namespace model { namespace model {
UsageReport::UsageReport() { UsageReport::UsageReport() {
m_SEndID = 0; m_SEndID = 0;
m_SEndIDIsSet = false; m_SEndIDIsSet = false;
m_urSeqN = 0; m_urSeqN = 0;
m_urSeqNIsSet = false; m_urSeqNIsSet = false;
m_duration = 0; m_duration = 0;
m_durationIsSet = false; m_durationIsSet = false;
m_totNoP = 0; m_totNoP = 0;
m_totNoPIsSet = false; m_totNoPIsSet = false;
m_ulNoP = 0; m_ulNoP = 0;
m_ulNoPIsSet = false; m_ulNoPIsSet = false;
m_dlNoP = 0; m_dlNoP = 0;
m_dlNoPIsSet = false; m_dlNoPIsSet = false;
m_totVol = 0; m_totVol = 0;
m_totVolIsSet = false; m_totVolIsSet = false;
m_ulVol = 0; m_ulVol = 0;
m_ulVolIsSet = false; m_ulVolIsSet = false;
m_dlVol = 0; m_dlVol = 0;
m_dlVolIsSet = false; m_dlVolIsSet = false;
m_urTrig = {}; m_urTrig = {};
m_urTrigIsSet = false; m_urTrigIsSet = false;
} }
UsageReport::~UsageReport() {} UsageReport::~UsageReport() {}
...@@ -41,22 +41,15 @@ void UsageReport::validate() { ...@@ -41,22 +41,15 @@ void UsageReport::validate() {
} }
void to_json(nlohmann::json& j, const UsageReport& o) { void to_json(nlohmann::json& j, const UsageReport& o) {
j = nlohmann::json(); j = nlohmann::json();
if (o.SEndIDIsSet()) if (o.SEndIDIsSet()) j["SEID"] = o.m_SEndID;
j["SEID"] = o.m_SEndID; if (o.urSeqNIsSet()) j["UR-SEQN"] = o.m_urSeqN;
if (o.urSeqNIsSet())
j["UR-SEQN"] = o.m_urSeqN;
if (o.urTriggerIsSet()) { if (o.urTriggerIsSet()) {
if (o.m_urTrig.perio) if (o.m_urTrig.perio) j["Trigger"] = "Periodic Reporting";
j["Trigger"] = "Periodic Reporting"; if (o.m_urTrig.volth) j["Trigger"] = "Volume Threshold";
if (o.m_urTrig.volth) if (o.m_urTrig.timth) j["Trigger"] = "Time Threshold";
j["Trigger"] = "Volume Threshold"; if (o.m_urTrig.volqu) j["Trigger"] = "Volume Quota";
if (o.m_urTrig.timth) if (o.m_urTrig.timqu) j["Trigger"] = "Time Quota";
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) { switch (o.m_urTrig) {
case : case :
...@@ -77,20 +70,13 @@ void to_json(nlohmann::json& j, const UsageReport& o) { ...@@ -77,20 +70,13 @@ void to_json(nlohmann::json& j, const UsageReport& o) {
} }
*/ */
} }
if (o.durationIsSet()) if (o.durationIsSet()) j["Duration"] = o.m_duration;
j["Duration"] = o.m_duration; if (o.totNoPIsSet()) j["NoP"]["Total"] = o.m_totNoP;
if (o.totNoPIsSet()) if (o.ulNoPIsSet()) j["NoP"]["Uplink"] = o.m_ulNoP;
j["NoP"]["Total"] = o.m_totNoP; if (o.dlNoPIsSet()) j["NoP"]["Downlink"] = o.m_dlNoP;
if (o.ulNoPIsSet()) if (o.totVolIsSet()) j["Volume"]["Total"] = o.m_totVol;
j["NoP"]["Uplink"] = o.m_ulNoP; if (o.ulVolIsSet()) j["Volume"]["Uplink"] = o.m_ulVol;
if (o.dlNoPIsSet()) if (o.dlVolIsSet()) j["Volume"]["Downlink"] = o.m_dlVol;
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) { void from_json(const nlohmann::json& j, UsageReport& o) {
...@@ -104,16 +90,12 @@ void from_json(const nlohmann::json& j, UsageReport& o) { ...@@ -104,16 +90,12 @@ void from_json(const nlohmann::json& j, UsageReport& o) {
} }
if (j.find("Trigger") != j.end()) { if (j.find("Trigger") != j.end()) {
o.m_urTrigIsSet = true; o.m_urTrigIsSet = true;
auto s = j.get<std::string>(); auto s = j.get<std::string>();
s = j.at("Trigger"); s = j.at("Trigger");
if (s == "Periodic Reporting") if (s == "Periodic Reporting") o.m_urTrig.perio = 1;
o.m_urTrig.perio = 1; if (s == "Volume Threshold") o.m_urTrig.volth = 1;
if (s == "Volume Threshold") if (s == "Time Threshold") o.m_urTrig.timth = 1;
o.m_urTrig.volth = 1; if (s == "Volume Quota") o.m_urTrig.volqu = 1;
if (s == "Time Threshold")
o.m_urTrig.timth = 1;
if (s == "Volume Quota")
o.m_urTrig.volqu = 1;
if (s == "Time Quota") if (s == "Time Quota")
o.m_urTrig.timqu = 1; o.m_urTrig.timqu = 1;
else { else {
......
/** /**
* Nsmf_EventExposure * Nsmf_EventExposure
* *
* UsageReport.h * UsageReport.h
*/ */
...@@ -15,14 +15,7 @@ namespace smf_server { ...@@ -15,14 +15,7 @@ namespace smf_server {
namespace model { namespace model {
// TODO: Redefine in separate files // TODO: Redefine in separate files
enum UsageReportTrigger { enum UsageReportTrigger { PERIO = 1, VOLTH, TIMTH, VOLQU, TIMQU };
PERIO = 1,
VOLTH,
TIMTH,
VOLQU,
TIMQU
};
/// <summary> /// <summary>
/// ///
...@@ -79,7 +72,7 @@ class UsageReport { ...@@ -79,7 +72,7 @@ class UsageReport {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
int64_t getDlNoP() const; int64_t getDlNoP() const;
void setDlNoP(int64_t const& value); void setDlNoP(int64_t const& value);
bool dlNoPIsSet() const; bool dlNoPIsSet() const;
......
...@@ -4336,133 +4336,133 @@ class pfcp_time_of_last_packet_ie : public pfcp_ie { ...@@ -4336,133 +4336,133 @@ class pfcp_time_of_last_packet_ie : public pfcp_ie {
//------------------------------------- //-------------------------------------
// IE VOLUME_QUOTA // IE VOLUME_QUOTA
class pfcp_volume_quota_ie : public pfcp_ie { class pfcp_volume_quota_ie : public pfcp_ie {
public: public:
union { union {
struct { struct {
uint8_t tovol : 1; uint8_t tovol : 1;
uint8_t ulvol : 1; uint8_t ulvol : 1;
uint8_t dlvol : 1; uint8_t dlvol : 1;
uint8_t spare : 5; uint8_t spare : 5;
} bf; } bf;
uint8_t b; uint8_t b;
} u1; } u1;
uint64_t total_volume; uint64_t total_volume;
uint64_t uplink_volume; uint64_t uplink_volume;
uint64_t downlink_volume; uint64_t downlink_volume;
//-------- //--------
explicit pfcp_volume_quota_ie(const pfcp::volume_quota_t& b) explicit pfcp_volume_quota_ie(const pfcp::volume_quota_t& b)
: pfcp_ie(PFCP_IE_VOLUME_QUOTA) { : pfcp_ie(PFCP_IE_VOLUME_QUOTA) {
tlv.set_length(1); tlv.set_length(1);
u1.b = 0; u1.b = 0;
u1.bf.tovol = b.tovol; u1.bf.tovol = b.tovol;
u1.bf.ulvol = b.ulvol; u1.bf.ulvol = b.ulvol;
u1.bf.dlvol = b.dlvol; u1.bf.dlvol = b.dlvol;
if (u1.bf.tovol) { if (u1.bf.tovol) {
total_volume = b.total_volume; total_volume = b.total_volume;
tlv.add_length(sizeof(total_volume)); tlv.add_length(sizeof(total_volume));
} else { } else {
total_volume = 0; total_volume = 0;
} }
if (u1.bf.ulvol) { if (u1.bf.ulvol) {
uplink_volume = b.uplink_volume; uplink_volume = b.uplink_volume;
tlv.add_length(sizeof(uplink_volume)); tlv.add_length(sizeof(uplink_volume));
} else { } else {
uplink_volume = 0; uplink_volume = 0;
}
if (u1.bf.dlvol) {
downlink_volume = b.downlink_volume;
tlv.add_length(sizeof(downlink_volume));
} else {
downlink_volume = 0;
}
} }
//-------- if (u1.bf.dlvol) {
pfcp_volume_quota_ie() : pfcp_ie(PFCP_IE_VOLUME_QUOTA) { downlink_volume = b.downlink_volume;
tlv.set_length(1); tlv.add_length(sizeof(downlink_volume));
u1.b = 0; } else {
total_volume = 0;
uplink_volume = 0;
downlink_volume = 0; downlink_volume = 0;
} }
//-------- }
explicit pfcp_volume_quota_ie(const pfcp_tlv& t) : pfcp_ie(t){}; //--------
//-------- pfcp_volume_quota_ie() : pfcp_ie(PFCP_IE_VOLUME_QUOTA) {
void to_core_type(pfcp::volume_quota_t& b) { tlv.set_length(1);
b = {}; u1.b = 0;
b.tovol = u1.bf.tovol; total_volume = 0;
b.ulvol = u1.bf.ulvol; uplink_volume = 0;
b.dlvol = u1.bf.dlvol; downlink_volume = 0;
if (u1.bf.tovol) { }
b.total_volume = total_volume; //--------
} explicit pfcp_volume_quota_ie(const pfcp_tlv& t) : pfcp_ie(t){};
if (u1.bf.ulvol) { //--------
b.uplink_volume = uplink_volume; void to_core_type(pfcp::volume_quota_t& b) {
} b = {};
if (u1.bf.dlvol) { b.tovol = u1.bf.tovol;
b.downlink_volume = downlink_volume; b.ulvol = u1.bf.ulvol;
} b.dlvol = u1.bf.dlvol;
if (u1.bf.tovol) {
b.total_volume = total_volume;
}
if (u1.bf.ulvol) {
b.uplink_volume = uplink_volume;
}
if (u1.bf.dlvol) {
b.downlink_volume = downlink_volume;
}
}
//--------
void dump_to(std::ostream& os) {
tlv.set_length(1);
if (u1.bf.tovol) {
tlv.add_length(sizeof(total_volume));
}
if (u1.bf.ulvol) {
tlv.add_length(sizeof(uplink_volume));
}
if (u1.bf.dlvol) {
tlv.add_length(sizeof(downlink_volume));
} }
//--------
void dump_to(std::ostream& os) {
tlv.set_length(1);
if (u1.bf.tovol) {
tlv.add_length(sizeof(total_volume));
}
if (u1.bf.ulvol) {
tlv.add_length(sizeof(uplink_volume));
}
if (u1.bf.dlvol) {
tlv.add_length(sizeof(downlink_volume));
}
tlv.dump_to(os); tlv.dump_to(os);
os.write(reinterpret_cast<const char*>(&u1.b), sizeof(u1.b)); os.write(reinterpret_cast<const char*>(&u1.b), sizeof(u1.b));
if (u1.bf.tovol) { if (u1.bf.tovol) {
auto be_total_volume = htobe64(total_volume); auto be_total_volume = htobe64(total_volume);
os.write( os.write(
reinterpret_cast<const char*>(&be_total_volume), reinterpret_cast<const char*>(&be_total_volume),
sizeof(be_total_volume)); 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));
}
} }
//-------- if (u1.bf.ulvol) {
void load_from(std::istream& is) { auto be_uplink_volume = htobe64(uplink_volume);
// tlv.load_from(is); os.write(
if (tlv.get_length() < 1) { reinterpret_cast<const char*>(&be_uplink_volume),
throw pfcp_tlv_bad_length_exception( sizeof(be_uplink_volume));
tlv.type, tlv.get_length(), __FILE__, __LINE__); }
} if (u1.bf.dlvol) {
if (u1.bf.tovol) { auto be_downlink_volume = htobe64(downlink_volume);
is.read(reinterpret_cast<char*>(&total_volume), sizeof(total_volume)); os.write(
total_volume = be64toh(total_volume); reinterpret_cast<const char*>(&be_downlink_volume),
} sizeof(be_downlink_volume));
if (u1.bf.ulvol) { }
is.read(reinterpret_cast<char*>(&uplink_volume), sizeof(uplink_volume)); }
total_volume = be64toh(uplink_volume); //--------
} void load_from(std::istream& is) {
if (u1.bf.dlvol) { // tlv.load_from(is);
is.read( if (tlv.get_length() < 1) {
reinterpret_cast<char*>(&downlink_volume), sizeof(downlink_volume)); throw pfcp_tlv_bad_length_exception(
total_volume = be64toh(downlink_volume); 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) {
void to_core_type(pfcp_ies_container& s) { is.read(reinterpret_cast<char*>(&uplink_volume), sizeof(uplink_volume));
pfcp::volume_quota_t v = {}; total_volume = be64toh(uplink_volume);
to_core_type(v);
s.set(v);
} }
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);
}
}; };
//------------------------------------- //-------------------------------------
...@@ -4478,24 +4478,19 @@ class pfcp_time_quota_ie : public pfcp_ie { ...@@ -4478,24 +4478,19 @@ class pfcp_time_quota_ie : public pfcp_ie {
tlv.set_length(sizeof(time_quota)); tlv.set_length(sizeof(time_quota));
} }
//-------- //--------
pfcp_time_quota_ie() pfcp_time_quota_ie() : pfcp_ie(PFCP_IE_TIME_QUOTA), time_quota(0) {
: pfcp_ie(PFCP_IE_TIME_QUOTA), time_quota(0) {
tlv.set_length(sizeof(time_quota)); tlv.set_length(sizeof(time_quota));
} }
//-------- //--------
explicit pfcp_time_quota_ie(const pfcp_tlv& t) explicit pfcp_time_quota_ie(const pfcp_tlv& t) : pfcp_ie(t), time_quota(0){};
: pfcp_ie(t), time_quota(0){};
//-------- //--------
void to_core_type(pfcp::time_quota_t& b) { void to_core_type(pfcp::time_quota_t& b) { b.time_quota = time_quota; }
b.time_quota = time_quota;
}
//-------- //--------
void dump_to(std::ostream& os) { void dump_to(std::ostream& os) {
tlv.dump_to(os); tlv.dump_to(os);
auto be_time_quota = htobe32(time_quota); auto be_time_quota = htobe32(time_quota);
os.write( os.write(
reinterpret_cast<const char*>(&be_time_quota), reinterpret_cast<const char*>(&be_time_quota), sizeof(be_time_quota));
sizeof(be_time_quota));
} }
//-------- //--------
void load_from(std::istream& is) { void load_from(std::istream& is) {
...@@ -9266,22 +9261,22 @@ class pfcp_create_urr_ie : public pfcp_grouped_ie { ...@@ -9266,22 +9261,22 @@ class pfcp_create_urr_ie : public pfcp_grouped_ie {
} }
if (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) { if (b.volume_quota.first) {
std::shared_ptr<pfcp_volume_quota_ie> sie( std::shared_ptr<pfcp_volume_quota_ie> sie(
new pfcp_volume_quota_ie(b.volume_quota.second)); new pfcp_volume_quota_ie(b.volume_quota.second));
add_ie(sie); add_ie(sie);
} }
if (b.time_threshold.first) { if (b.time_threshold.first) {
std::shared_ptr<pfcp_time_threshold_ie> sie( std::shared_ptr<pfcp_time_threshold_ie> sie(
new pfcp_time_threshold_ie(b.time_threshold.second)); new pfcp_time_threshold_ie(b.time_threshold.second));
add_ie(sie); add_ie(sie);
} }
if (b.time_quota.first) { if (b.time_quota.first) {
std::shared_ptr<pfcp_time_quota_ie> sie( std::shared_ptr<pfcp_time_quota_ie> sie(
new pfcp_time_quota_ie(b.time_quota.second)); new pfcp_time_quota_ie(b.time_quota.second));
add_ie(sie); add_ie(sie);
} }
} }
......
...@@ -990,11 +990,17 @@ void smf_context::handle_itti_msg( ...@@ -990,11 +990,17 @@ void smf_context::handle_itti_msg(
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 (ur.get(trig))
if (trig.perio) Logger::smf_app().info("\t\t Trigger -> Periodic Reporting"); if (trig.perio)
if (trig.timqu) Logger::smf_app().info("\t\t Trigger -> Time Quota"); Logger::smf_app().info(
if (trig.timth) Logger::smf_app().info("\t\t Trigger -> Time Threshold"); "\t\t Trigger -> Periodic Reporting");
if (trig.volqu) Logger::smf_app().info("\t\t Trigger -> Volume Quota"); if (trig.timqu)
if (trig.volth) Logger::smf_app().info("\t\t Trigger -> Volume Threshold"); 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);
...@@ -1013,13 +1019,11 @@ void smf_context::handle_itti_msg( ...@@ -1013,13 +1019,11 @@ void smf_context::handle_itti_msg(
std::shared_ptr<smf_context> pc = {}; std::shared_ptr<smf_context> pc = {};
if (smf_app_inst->seid_2_smf_context(req->seid, pc)) { if (smf_app_inst->seid_2_smf_context(req->seid, pc)) {
oai::smf_server::model::EventNotification ev_notif = {}; oai::smf_server::model::EventNotification ev_notif = {};
oai::smf_server::model::UsageReport ur_model = {}; oai::smf_server::model::UsageReport ur_model = {};
if (ur.get(vm)) { if (ur.get(vm)) {
ur_model.setSEndID(req->seid); ur_model.setSEndID(req->seid);
if (ur.get(seqn)) if (ur.get(seqn)) ur_model.seturSeqN(seqn.ur_seqn);
ur_model.seturSeqN(seqn.ur_seqn); if (ur.get(dm)) ur_model.setDuration(dm.duration);
if (ur.get(dm))
ur_model.setDuration(dm.duration);
ur_model.setTotNoP(vm.total_nop); ur_model.setTotNoP(vm.total_nop);
ur_model.setUlNoP(vm.uplink_nop); ur_model.setUlNoP(vm.uplink_nop);
ur_model.setDlNoP(vm.downlink_nop); ur_model.setDlNoP(vm.downlink_nop);
...@@ -4089,12 +4093,12 @@ void smf_context::trigger_ue_ip_change(scid_t scid, uint8_t http_version) { ...@@ -4089,12 +4093,12 @@ void smf_context::trigger_ue_ip_change(scid_t scid, uint8_t http_version) {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void smf_context::handle_qos_monitoring(seid_t seid, void smf_context::handle_qos_monitoring(
oai::smf_server::model::EventNotification ev_notif_model, uint8_t http_version) { seid_t seid, oai::smf_server::model::EventNotification ev_notif_model,
uint8_t http_version) {
Logger::smf_app().debug( Logger::smf_app().debug(
"Send request to N11 to trigger QoS Monitoring (Usage Report) Event, " "Send request to N11 to trigger QoS Monitoring (Usage Report) Event, "
"SMF Context-related SEID " SEID_FMT , "SMF Context-related SEID " SEID_FMT,
seid); seid);
// Get the smf context // Get the smf context
...@@ -4105,8 +4109,8 @@ void smf_context::handle_qos_monitoring(seid_t seid, ...@@ -4105,8 +4109,8 @@ void smf_context::handle_qos_monitoring(seid_t seid,
return; return;
} }
supi_t supi = pc.get()->supi; supi_t supi = pc.get()->supi;
supi64_t supi64 = smf_supi_to_u64(supi); supi64_t supi64 = smf_supi_to_u64(supi);
std::vector<std::shared_ptr<smf_subscription>> subscriptions = {}; std::vector<std::shared_ptr<smf_subscription>> subscriptions = {};
smf_app_inst->get_ee_subscriptions( smf_app_inst->get_ee_subscriptions(
...@@ -4153,12 +4157,12 @@ void smf_context::handle_qos_monitoring(seid_t seid, ...@@ -4153,12 +4157,12 @@ void smf_context::handle_qos_monitoring(seid_t seid,
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void smf_context::trigger_qos_monitoring(seid_t seid, void smf_context::trigger_qos_monitoring(
oai::smf_server::model::EventNotification ev_notif_model, uint8_t http_version) { 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); 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(
...@@ -4415,8 +4419,6 @@ void smf_context::handle_pdusesest(scid_t scid, uint8_t http_version) { ...@@ -4415,8 +4419,6 @@ void smf_context::handle_pdusesest(scid_t scid, uint8_t http_version) {
std::time_t time_epoch_ntp = std::time(nullptr); std::time_t time_epoch_ntp = std::time(nullptr);
uint64_t tv_ntp = time_epoch_ntp + SECONDS_SINCE_FIRST_EPOCH; uint64_t tv_ntp = time_epoch_ntp + SECONDS_SINCE_FIRST_EPOCH;
ev_notif.set_timestamp(std::to_string(tv_ntp)); ev_notif.set_timestamp(std::to_string(tv_ntp));
// UE IPv4 // UE IPv4
if (sp->ipv4) { if (sp->ipv4) {
...@@ -4431,7 +4433,8 @@ void smf_context::handle_pdusesest(scid_t scid, uint8_t http_version) { ...@@ -4431,7 +4433,8 @@ void smf_context::handle_pdusesest(scid_t scid, uint8_t http_version) {
// ev_notif.set_ad_ipv6_prefix(conv::toString(sp->ipv4_address)); // ev_notif.set_ad_ipv6_prefix(conv::toString(sp->ipv4_address));
} }
} }
ev_notif.set_pdu_session_type(sp->pdu_session_type.toString()); // PDU Session Type ev_notif.set_pdu_session_type(
sp->pdu_session_type.toString()); // PDU Session Type
ev_notif.set_sst(sp->get_snssai().sst); ev_notif.set_sst(sp->get_snssai().sst);
ev_notif.set_sd(std::to_string(sp->get_snssai().sd)); ev_notif.set_sd(std::to_string(sp->get_snssai().sd));
ev_notif.set_dnn(sp->get_dnn()); ev_notif.set_dnn(sp->get_dnn());
...@@ -4463,8 +4466,6 @@ void smf_context::trigger_pdusesest(scid_t scid, uint8_t http_version) { ...@@ -4463,8 +4466,6 @@ void smf_context::trigger_pdusesest(scid_t scid, uint8_t http_version) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
//----------- //-----------
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -4494,7 +4495,6 @@ void smf_context::trigger_plmn_change(scid_t scid, uint8_t http_version) { ...@@ -4494,7 +4495,6 @@ void smf_context::trigger_plmn_change(scid_t scid, uint8_t http_version) {
event_sub.ee_plmn_change(scid, http_version); event_sub.ee_plmn_change(scid, http_version);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void smf_context::handle_plmn_change(scid_t scid, uint8_t http_version) { void smf_context::handle_plmn_change(scid_t scid, uint8_t http_version) {
Logger::smf_app().debug( Logger::smf_app().debug(
......
...@@ -691,7 +691,7 @@ class smf_context : public std::enable_shared_from_this<smf_context> { ...@@ -691,7 +691,7 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
// Subscribe to DDDS event // Subscribe to DDDS event
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 // Subscribe to QoS Monitoring Event
ee_qos_monitoring_connection = event_sub.subscribe_ee_qos_monitoring( ee_qos_monitoring_connection = event_sub.subscribe_ee_qos_monitoring(
boost::bind(&smf_context::handle_qos_monitoring, this, _1, _2, _3)); boost::bind(&smf_context::handle_qos_monitoring, this, _1, _2, _3));
...@@ -1268,8 +1268,12 @@ class smf_context : public std::enable_shared_from_this<smf_context> { ...@@ -1268,8 +1268,12 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
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 trigger_qos_monitoring(
void handle_qos_monitoring(seid_t seid, oai::smf_server::model::EventNotification ev_notif_model, uint8_t http_version); 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);
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);
......
...@@ -82,7 +82,7 @@ class smf_event { ...@@ -82,7 +82,7 @@ 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);
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( bs2::connection subscribe_ee_qos_monitoring(
const ee_qos_monitoring_sig_t::slot_type& sig); const ee_qos_monitoring_sig_t::slot_type& sig);
...@@ -100,7 +100,7 @@ bs2::connection subscribe_ee_pdusesest( ...@@ -100,7 +100,7 @@ bs2::connection subscribe_ee_pdusesest(
ee_ddds_sig_t ee_ddds; ee_ddds_sig_t ee_ddds;
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 ee_qos_monitoring_sig_t ee_qos_monitoring; // Signal for QoS Monitoring
ee_flexcn_sig_t ee_flexcn; // Signal for FlexCN Event ee_flexcn_sig_t ee_flexcn; // Signal for FlexCN Event
}; };
} // namespace smf } // namespace smf
#endif /* FILE_SMF_EVENT_HPP_SEEN */ #endif /* FILE_SMF_EVENT_HPP_SEEN */
...@@ -71,7 +71,7 @@ typedef bs2::signal_type< ...@@ -71,7 +71,7 @@ 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;
// 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
...@@ -81,8 +81,7 @@ typedef bs2::signal_type< ...@@ -81,8 +81,7 @@ typedef bs2::signal_type<
// TODO: use SCID and access PDU Session ID (need binding SCIDs - PDUSessID) // TODO: use SCID and access PDU Session ID (need binding SCIDs - PDUSessID)
typedef bs2::signal_type< typedef bs2::signal_type<
void(seid_t, oai::smf_server::model::EventNotification, uint8_t), void(seid_t, oai::smf_server::model::EventNotification, uint8_t),
bs2::keywords::mutex_type<bs2::dummy_mutex>>::type bs2::keywords::mutex_type<bs2::dummy_mutex>>::type ee_qos_monitoring_sig_t;
ee_qos_monitoring_sig_t;
// Signal for FlexCN event (for Event Exposure) // Signal for FlexCN event (for Event Exposure)
// SCID, HTTP version // SCID, HTTP version
......
...@@ -1185,9 +1185,6 @@ bool event_notification::is_sst_set() const { ...@@ -1185,9 +1185,6 @@ bool event_notification::is_sst_set() const {
return m_sst_is_set; return m_sst_is_set;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void event_notification::set_sd(std::string const& value) { void event_notification::set_sd(std::string const& value) {
m_sd = value; m_sd = value;
...@@ -1204,9 +1201,6 @@ bool event_notification::is_sd_set() const { ...@@ -1204,9 +1201,6 @@ bool event_notification::is_sd_set() const {
return m_sd_is_set; return m_sd_is_set;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void event_notification::set_pdu_session_type(std::string const& value) { void event_notification::set_pdu_session_type(std::string const& value) {
m_pdu_session_type = value; m_pdu_session_type = value;
......
...@@ -632,7 +632,6 @@ class event_notification { ...@@ -632,7 +632,6 @@ class event_notification {
oai::smf_server::model::DddStatus get_ddds() const; oai::smf_server::model::DddStatus get_ddds() const;
bool is_ddds_is_set() const; bool is_ddds_is_set() const;
void set_dnn(std::string const& value); void set_dnn(std::string const& value);
std::string get_dnn() const; std::string get_dnn() const;
bool is_dnn_set() const; bool is_dnn_set() const;
......
...@@ -324,21 +324,21 @@ int session_create_sm_context_procedure::run( ...@@ -324,21 +324,21 @@ int session_create_sm_context_procedure::run(
pfcp::time_threshold_t time_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_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.volth = 1;
reporting_triggers.timth = 1; reporting_triggers.timth = 1;
reporting_triggers.volqu = 0; reporting_triggers.volqu = 0;
reporting_triggers.timqu = 0; reporting_triggers.timqu = 0;
volume_threshold.dlvol = 1; volume_threshold.dlvol = 1;
volume_threshold.ulvol = 0; volume_threshold.ulvol = 0;
volume_threshold.tovol = 0; volume_threshold.tovol = 0;
volume_threshold.downlink_volume = 1000; volume_threshold.downlink_volume = 1000;
time_threshold.time_threshold = 5; 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);
......
...@@ -523,10 +523,11 @@ void smf_sbi::notify_subscribed_event( ...@@ -523,10 +523,11 @@ void smf_sbi::notify_subscribed_event(
event_notif["dddStatus"] = "TRANSMITTED"; event_notif["dddStatus"] = "TRANSMITTED";
} }
if (i.is_dnn_set()) event_notif["dnn"] = i.get_dnn(); if (i.is_dnn_set()) event_notif["dnn"] = i.get_dnn();
if (i.is_pdu_session_type_set()) event_notif["pduSessType"] = i.get_pdu_session_type(); if (i.is_pdu_session_type_set())
if (i.is_sst_set()){ event_notif["pduSessType"] = i.get_pdu_session_type();
if (i.is_sst_set()) {
nlohmann::json snssai_data = {}; nlohmann::json snssai_data = {};
snssai_data["sst"] = i.get_sst(); snssai_data["sst"] = i.get_sst();
if (i.is_sd_set()) snssai_data["sd"] = i.get_sd(); if (i.is_sd_set()) snssai_data["sd"] = i.get_sd();
event_notif["snssai"] = snssai_data; event_notif["snssai"] = snssai_data;
} }
......
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