Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-SMF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-SMF
Commits
6927aaf4
Commit
6927aaf4
authored
Sep 07, 2022
by
KARIM BOUTIBA
Browse files
Options
Browse Files
Download
Plain Diff
merge Qos monitoring + fix conflicts
parents
f99ccb40
4c41d0de
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
873 additions
and
106 deletions
+873
-106
src/api-server/model/EventNotification.cpp
src/api-server/model/EventNotification.cpp
+23
-0
src/api-server/model/EventNotification.h
src/api-server/model/EventNotification.h
+10
-0
src/api-server/model/SmfEvent.h
src/api-server/model/SmfEvent.h
+2
-2
src/api-server/model/UsageReport.cpp
src/api-server/model/UsageReport.cpp
+291
-0
src/api-server/model/UsageReport.h
src/api-server/model/UsageReport.h
+151
-0
src/common/3gpp_29.508.h
src/common/3gpp_29.508.h
+9
-0
src/common/utils/3gpp_conversions.cpp
src/common/utils/3gpp_conversions.cpp
+5
-0
src/pfcp/3gpp_29.244.hpp
src/pfcp/3gpp_29.244.hpp
+209
-101
src/smf_app/smf_context.cpp
src/smf_app/smf_context.cpp
+109
-0
src/smf_app/smf_context.hpp
src/smf_app/smf_context.hpp
+15
-0
src/smf_app/smf_event.cpp
src/smf_app/smf_event.cpp
+6
-0
src/smf_app/smf_event.hpp
src/smf_app/smf_event.hpp
+9
-0
src/smf_app/smf_event_sig.hpp
src/smf_app/smf_event_sig.hpp
+12
-0
src/smf_app/smf_procedure.cpp
src/smf_app/smf_procedure.cpp
+22
-3
No files found.
src/api-server/model/EventNotification.cpp
View file @
6927aaf4
...
...
@@ -51,6 +51,9 @@ EventNotification::EventNotification() {
m_DddStatusIsSet
=
false
;
m_MaxWaitTime
=
""
;
m_MaxWaitTimeIsSet
=
false
;
m_usageReport
=
{};
m_usageReportIsSet
=
false
;
}
EventNotification
::~
EventNotification
()
{}
...
...
@@ -86,6 +89,8 @@ void to_json(nlohmann::json& j, const EventNotification& o) {
if
(
o
.
pduSeIdIsSet
())
j
[
"pduSeId"
]
=
o
.
m_PduSeId
;
if
(
o
.
dddStatusIsSet
())
j
[
"dddStatus"
]
=
o
.
m_DddStatus
;
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
)
{
...
...
@@ -175,6 +180,10 @@ void from_json(const nlohmann::json& j, EventNotification& o) {
j
.
at
(
"maxWaitTime"
).
get_to
(
o
.
m_MaxWaitTime
);
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
{
...
...
@@ -462,6 +471,20 @@ bool EventNotification::maxWaitTimeIsSet() const {
void
EventNotification
::
unsetMaxWaitTime
()
{
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 smf_server
...
...
src/api-server/model/EventNotification.h
View file @
6927aaf4
...
...
@@ -27,6 +27,7 @@
#include "PlmnId.h"
#include "RouteToLocation.h"
#include "AccessType.h"
#include "UsageReport.h"
#include <nlohmann/json.hpp>
namespace
oai
{
...
...
@@ -203,6 +204,13 @@ class EventNotification {
void
setMaxWaitTime
(
std
::
string
const
&
value
);
bool
maxWaitTimeIsSet
()
const
;
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
from_json
(
const
nlohmann
::
json
&
j
,
EventNotification
&
o
);
...
...
@@ -254,6 +262,8 @@ class EventNotification {
bool
m_DddStatusIsSet
;
std
::
string
m_MaxWaitTime
;
bool
m_MaxWaitTimeIsSet
;
UsageReport
m_usageReport
;
bool
m_usageReportIsSet
;
};
}
// namespace model
...
...
src/api-server/model/SmfEvent.h
View file @
6927aaf4
...
...
@@ -15,7 +15,7 @@
*
* Possible values are - AC_TY_CH: Access Type Change - UP_PATH_CH: UP Path
* Change - PDU_SES_REL: PDU Session Release - PLMN_CH: PLMN Change - UE_IP_CH:
* UE IP address change - DDDS: Downlink data delivery status
* UE IP address change - DDDS: Downlink data delivery status
- QOS_MON: QoS Monitoring
*/
#ifndef SmfEvent_H_
...
...
@@ -30,7 +30,7 @@ namespace model {
/// <summary>
/// Possible values are - AC_TY_CH: Access Type Change - UP_PATH_CH: UP Path
/// Change - PDU_SES_REL: PDU Session Release - PLMN_CH: PLMN Change - UE_IP_CH:
/// UE IP address change - DDDS: Downlink data delivery status
/// UE IP address change - DDDS: Downlink data delivery status
- QOS_MON: QoS Monitoring
/// </summary>
class
SmfEvent
{
public:
...
...
src/api-server/model/UsageReport.cpp
0 → 100644
View file @
6927aaf4
/**
* 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
src/api-server/model/UsageReport.h
0 → 100644
View file @
6927aaf4
/**
* 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_ */
src/common/3gpp_29.508.h
View file @
6927aaf4
...
...
@@ -31,7 +31,11 @@ typedef enum smf_event_e {
SMF_EVENT_PLMN_CH
=
4
,
SMF_EVENT_UE_IP_CH
=
5
,
SMF_EVENT_DDDS
=
6
,
<<<<<<<
HEAD
SMF_EVENT_PDUSESEST
=
7
,
=======
SMF_EVENT_QOS_MON
=
7
,
>>>>>>>
origin
/
qos_monitoring_event
SMF_EVENT_FLEXCN
=
99
}
smf_event_t
;
...
...
@@ -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_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_QOS_MON
)
return
"QOS_MON"
;
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_FLEXCN
)
return
"FLEXCN"
;
...
...
@@ -55,7 +60,11 @@ static const std::vector<std::string> smf_event_e2str = {
"PLMN Change"
,
"UE IP address change"
,
"Downlink data delivery status"
,
<<<<<<<
HEAD
"PDU Session Establishment"
,
=======
"QoS Monitoring"
,
>>>>>>>
origin
/
qos_monitoring_event
"FlexCN"
};
enum
class
notification_method_e
{
...
...
src/common/utils/3gpp_conversions.cpp
View file @
6927aaf4
...
...
@@ -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
;
}
else
if
(
event_id
.
compare
(
"DDDS"
)
==
0
)
{
event_subscription
.
smf_event
=
smf_event_e
::
SMF_EVENT_DDDS
;
<<<<<<<
HEAD
}
else
if
(
event_id
.
compare
(
"PDU_SES_EST"
)
==
0
)
{
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
)
{
event_subscription
.
smf_event
=
smf_event_e
::
SMF_EVENT_FLEXCN
;
}
else
{
...
...
src/pfcp/3gpp_29.244.hpp
View file @
6927aaf4
...
...
@@ -4332,98 +4332,189 @@ class pfcp_time_of_last_packet_ie : public pfcp_ie {
// s.set(dropped_dl_traffic_threshold);
// }
//};
////-------------------------------------
//// IE VOLUME_QUOTA
// class pfcp_volume_quota_ie : public pfcp_ie {
// public:
// uint8_t todo;
//
// //--------
// pfcp_volume_quota_ie(const pfcp::volume_quota_t& b) :
// pfcp_ie(PFCP_IE_VOLUME_QUOTA){
// todo = 0;
// tlv.set_length(1);
// }
// //--------
// pfcp_volume_quota_ie() : pfcp_ie(PFCP_IE_VOLUME_QUOTA){
// todo = 0;
// tlv.set_length(1);
// }
// //--------
// pfcp_volume_quota_ie(const pfcp_tlv& t) : pfcp_ie(t) {
// todo = 0;
// };
// //--------
// void to_core_type(pfcp::volume_quota_t& b) {
// b.todo = todo;
// }
// //--------
// void dump_to(std::ostream& os) {
// tlv.dump_to(os);
// os.write(reinterpret_cast<const char*>(&todo), sizeof(todo));
// }
// //--------
// 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__);
// }
// is.read(reinterpret_cast<char*>(&todo), sizeof(todo));
// }
// //--------
// void to_core_type(pfcp_ies_container& s) {
// pfcp::volume_quota_t volume_quota = {};
// to_core_type(volume_quota);
// s.set(volume_quota);
// }
//};
////-------------------------------------
//// IE TIME_QUOTA
// class pfcp_time_quota_ie : public pfcp_ie {
// public:
// uint8_t todo;
//
// //--------
// pfcp_time_quota_ie(const pfcp::time_quota_t& b) :
// pfcp_ie(PFCP_IE_TIME_QUOTA){
// todo = 0;
// tlv.set_length(1);
// }
// //--------
// pfcp_time_quota_ie() : pfcp_ie(PFCP_IE_TIME_QUOTA){
// todo = 0;
// tlv.set_length(1);
// }
// //--------
// pfcp_time_quota_ie(const pfcp_tlv& t) : pfcp_ie(t) {
// todo = 0;
// };
// //--------
// void to_core_type(pfcp::time_quota_t& b) {
// b.todo = todo;
// }
// //--------
// void dump_to(std::ostream& os) {
// tlv.dump_to(os);
// os.write(reinterpret_cast<const char*>(&todo), sizeof(todo));
// }
// //--------
// 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__);
// }
// is.read(reinterpret_cast<char*>(&todo), sizeof(todo));
// }
// //--------
// void to_core_type(pfcp_ies_container& s) {
// pfcp::time_quota_t time_quota = {};
// to_core_type(time_quota);
// s.set(time_quota);
// }
//};
//-------------------------------------
// IE VOLUME_QUOTA
class
pfcp_volume_quota_ie
:
public
pfcp_ie
{
public:
union
{
struct
{
uint8_t
tovol
:
1
;
uint8_t
ulvol
:
1
;
uint8_t
dlvol
:
1
;
uint8_t
spare
:
5
;
}
bf
;
uint8_t
b
;
}
u1
;
uint64_t
total_volume
;
uint64_t
uplink_volume
;
uint64_t
downlink_volume
;
//--------
explicit
pfcp_volume_quota_ie
(
const
pfcp
::
volume_quota_t
&
b
)
:
pfcp_ie
(
PFCP_IE_VOLUME_QUOTA
)
{
tlv
.
set_length
(
1
);
u1
.
b
=
0
;
u1
.
bf
.
tovol
=
b
.
tovol
;
u1
.
bf
.
ulvol
=
b
.
ulvol
;
u1
.
bf
.
dlvol
=
b
.
dlvol
;
if
(
u1
.
bf
.
tovol
)
{
total_volume
=
b
.
total_volume
;
tlv
.
add_length
(
sizeof
(
total_volume
));
}
else
{
total_volume
=
0
;
}
if
(
u1
.
bf
.
ulvol
)
{
uplink_volume
=
b
.
uplink_volume
;
tlv
.
add_length
(
sizeof
(
uplink_volume
));
}
else
{
uplink_volume
=
0
;
}
if
(
u1
.
bf
.
dlvol
)
{
downlink_volume
=
b
.
downlink_volume
;
tlv
.
add_length
(
sizeof
(
downlink_volume
));
}
else
{
downlink_volume
=
0
;
}
}
//--------
pfcp_volume_quota_ie
()
:
pfcp_ie
(
PFCP_IE_VOLUME_QUOTA
)
{
tlv
.
set_length
(
1
);
u1
.
b
=
0
;
total_volume
=
0
;
uplink_volume
=
0
;
downlink_volume
=
0
;
}
//--------
explicit
pfcp_volume_quota_ie
(
const
pfcp_tlv
&
t
)
:
pfcp_ie
(
t
){};
//--------
void
to_core_type
(
pfcp
::
volume_quota_t
&
b
)
{
b
=
{};
b
.
tovol
=
u1
.
bf
.
tovol
;
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
));
}
tlv
.
dump_to
(
os
);
os
.
write
(
reinterpret_cast
<
const
char
*>
(
&
u1
.
b
),
sizeof
(
u1
.
b
));
if
(
u1
.
bf
.
tovol
)
{
auto
be_total_volume
=
htobe64
(
total_volume
);
os
.
write
(
reinterpret_cast
<
const
char
*>
(
&
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
));
}
}
//--------
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
class
pfcp_start_time_ie
:
public
pfcp_ie
{
...
...
@@ -9167,16 +9258,33 @@ class pfcp_create_urr_ie : public pfcp_grouped_ie {
new
pfcp_reporting_triggers_ie
(
b
.
reporting_triggers
.
second
));
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
(
new
pfcp_measurement_period_ie
(
b
.
measurement_period
.
second
));
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
(
new
pfcp_volume_threshold_ie
(
b
.
volume_threshold
.
second
));
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
}
pfcp_create_urr_ie
()
:
pfcp_grouped_ie
(
PFCP_IE_CREATE_URR
)
{}
...
...
src/smf_app/smf_context.cpp
View file @
6927aaf4
...
...
@@ -51,6 +51,7 @@
#include "smf_procedure.hpp"
#include "3gpp_conversions.hpp"
#include "string.hpp"
#include "EventNotification.h"
extern
"C"
{
#include "Ngap_AssociatedQosFlowItem.h"
...
...
@@ -981,11 +982,18 @@ void smf_context::handle_itti_msg(
pfcp
::
volume_measurement_t
vm
;
pfcp
::
duration_measurement_t
dm
;
pfcp
::
ur_seqn_t
seqn
;
pfcp
::
usage_report_trigger_t
trig
;
if
(
ur
.
get
(
vm
))
{
Logger
::
smf_app
().
info
(
"
\t\t
SEID -> %lld"
,
req
->
seid
);
if
(
ur
.
get
(
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
))
Logger
::
smf_app
().
info
(
"
\t\t
Duration -> %ld"
,
dm
.
duration
);
Logger
::
smf_app
().
info
(
"
\t\t
NoP Total -> %lld"
,
vm
.
total_nop
);
...
...
@@ -999,7 +1007,37 @@ void smf_context::handle_itti_msg(
Logger
::
smf_app
().
info
(
"
\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
::
make_shared
<
itti_n4_session_report_response
>
(
TASK_SMF_APP
,
TASK_SMF_N4
);
...
...
@@ -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
);
}
//------------------------------------------------------------------------------
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
)
{
Logger
::
smf_app
().
debug
(
...
...
src/smf_app/smf_context.hpp
View file @
6927aaf4
...
...
@@ -690,6 +690,10 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
ee_ddds_connection
=
event_sub
.
subscribe_ee_ddds
(
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
ee_pdusesest
=
event_sub
.
subscribe_ee_pdusesest
(
boost
::
bind
(
&
smf_context
::
handle_pdusesest
,
this
,
_1
,
_2
));
...
...
@@ -712,6 +716,8 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
ee_ue_ip_change_connection
.
disconnect
();
if
(
ee_plmn_change_connection
.
connected
())
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_pdusesest
.
connected
())
ee_pdusesest
.
disconnect
();
if
(
ee_flexcn
.
connected
())
ee_flexcn
.
disconnect
();
...
...
@@ -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
handle_ddds
(
scid_t
scid
,
uint8_t
http_version
);
<<<<<<<
HEAD
void
trigger_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
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> {
bs2
::
connection
ee_ue_ip_change_connection
;
bs2
::
connection
ee_plmn_change_connection
;
bs2
::
connection
ee_ddds_connection
;
<<<<<<<
HEAD
bs2
::
connection
ee_pdusesest
;
=======
bs2
::
connection
ee_qos_monitoring_connection
;
>>>>>>>
origin
/
qos_monitoring_event
bs2
::
connection
ee_flexcn
;
};
}
// namespace smf
...
...
src/smf_app/smf_event.cpp
View file @
6927aaf4
...
...
@@ -73,6 +73,12 @@ bs2::connection smf_event::subscribe_ee_pdusesest(
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
(
const
ee_flexcn_sig_t
::
slot_type
&
sig
)
{
...
...
src/smf_app/smf_event.hpp
View file @
6927aaf4
...
...
@@ -82,8 +82,13 @@ class smf_event {
// download link data status
bs2
::
connection
subscribe_ee_ddds
(
const
ee_ddds_sig_t
::
slot_type
&
sig
);
<<<<<<<
HEAD
bs2
::
connection
subscribe_ee_pdusesest
(
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
(
const
ee_flexcn_sig_t
::
slot_type
&
sig
);
...
...
@@ -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_plmn_change_sig_t
ee_plmn_change
;
// Signal for UE IP Addr change
ee_ddds_sig_t
ee_ddds
;
<<<<<<<
HEAD
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
};
}
// namespace smf
...
...
src/smf_app/smf_event_sig.hpp
View file @
6927aaf4
...
...
@@ -33,6 +33,7 @@
#include <boost/signals2.hpp>
#include <string>
#include "3gpp_24.007.h"
#include "EventNotification.h"
namespace
bs2
=
boost
::
signals2
;
...
...
@@ -70,11 +71,22 @@ typedef bs2::signal_type<
void
(
scid_t
,
uint8_t
),
bs2
::
keywords
::
mutex_type
<
bs2
::
dummy_mutex
>>::
type
ee_ddds_sig_t
;
<<<<<<<
HEAD
// Signal for PDU SESSION ESTABLISHMENT
// SCID, HTTP version
typedef
bs2
::
signal_type
<
void
(
scid_t
,
uint8_t
),
bs2
::
keywords
::
mutex_type
<
bs2
::
dummy_mutex
>>::
type
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)
// SCID, HTTP version
typedef
bs2
::
signal_type
<
...
...
src/smf_app/smf_procedure.cpp
View file @
6927aaf4
...
...
@@ -320,14 +320,33 @@ int session_create_sm_context_procedure::run(
pfcp
::
measurement_method_t
measurement_method
=
{};
pfcp
::
measurement_period_t
measurement_Period
=
{};
pfcp
::
reporting_triggers_t
reporting_triggers
=
{};
pfcp
::
volume_threshold_t
volume_threshold
=
{};
pfcp
::
time_threshold_t
time_threshold
=
{};
// Hardcoded values for the moment
measurement_method
.
volum
=
1
;
// Volume based usage report
measurement_method
.
durat
=
1
;
measurement_Period
.
measurement_period
=
10
;
// Every 10 Sec
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
(
measurement_method
);
create_urr
.
set
(
measurement_Period
);
create_urr
.
set
(
reporting_triggers
);
create_urr
.
set
(
time_threshold
);
create_urr
.
set
(
volume_threshold
);
n4_triggered
->
pfcp_ies
.
set
(
create_urr
);
}
// TODO: list of QoS Enforcement Rule IDs
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment