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
98ea303b
Commit
98ea303b
authored
Sep 21, 2022
by
Raphael Defosseux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style(smf): formatting files
Signed-off-by:
Raphael Defosseux
<
raphael.defosseux@openairinterface.org
>
parent
fdd0cf3b
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
231 additions
and
265 deletions
+231
-265
src/api-server/model/EventNotification.cpp
src/api-server/model/EventNotification.cpp
+0
-3
src/api-server/model/SmfEvent.h
src/api-server/model/SmfEvent.h
+4
-2
src/api-server/model/UsageReport.cpp
src/api-server/model/UsageReport.cpp
+42
-60
src/api-server/model/UsageReport.h
src/api-server/model/UsageReport.h
+3
-10
src/pfcp/3gpp_29.244.hpp
src/pfcp/3gpp_29.244.hpp
+127
-132
src/smf_app/smf_context.cpp
src/smf_app/smf_context.cpp
+25
-25
src/smf_app/smf_context.hpp
src/smf_app/smf_context.hpp
+7
-3
src/smf_app/smf_event.hpp
src/smf_app/smf_event.hpp
+2
-2
src/smf_app/smf_event_sig.hpp
src/smf_app/smf_event_sig.hpp
+2
-3
src/smf_app/smf_msg.cpp
src/smf_app/smf_msg.cpp
+0
-6
src/smf_app/smf_msg.hpp
src/smf_app/smf_msg.hpp
+0
-1
src/smf_app/smf_procedure.cpp
src/smf_app/smf_procedure.cpp
+15
-15
src/smf_app/smf_sbi.cpp
src/smf_app/smf_sbi.cpp
+4
-3
No files found.
src/api-server/model/EventNotification.cpp
View file @
98ea303b
...
...
@@ -53,7 +53,6 @@ EventNotification::EventNotification() {
m_MaxWaitTimeIsSet
=
false
;
m_usageReport
=
{};
m_usageReportIsSet
=
false
;
}
EventNotification
::~
EventNotification
()
{}
...
...
@@ -90,7 +89,6 @@ void to_json(nlohmann::json& j, const EventNotification& o) {
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
)
{
...
...
@@ -485,7 +483,6 @@ void EventNotification::unsetUsageReport() {
m_usageReportIsSet
=
false
;
}
}
// namespace model
}
// namespace smf_server
}
// namespace oai
src/api-server/model/SmfEvent.h
View file @
98ea303b
...
...
@@ -15,7 +15,8 @@
*
* 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 - QOS_MON: QoS Monitoring
* UE IP address change - DDDS: Downlink data delivery status - QOS_MON: QoS
* Monitoring
*/
#ifndef SmfEvent_H_
...
...
@@ -30,7 +31,8 @@ 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 - QOS_MON: QoS Monitoring
/// UE IP address change - DDDS: Downlink data delivery status - QOS_MON: QoS
/// Monitoring
/// </summary>
class
SmfEvent
{
public:
...
...
src/api-server/model/UsageReport.cpp
View file @
98ea303b
...
...
@@ -42,21 +42,14 @@ void UsageReport::validate() {
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
.
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"
;
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 :
...
...
@@ -77,20 +70,13 @@ void to_json(nlohmann::json& j, const UsageReport& o) {
}
*/
}
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
;
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
)
{
...
...
@@ -106,14 +92,10 @@ void from_json(const nlohmann::json& j, UsageReport& o) {
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
==
"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
{
...
...
src/api-server/model/UsageReport.h
View file @
98ea303b
...
...
@@ -15,14 +15,7 @@ namespace smf_server {
namespace
model
{
// TODO: Redefine in separate files
enum
UsageReportTrigger
{
PERIO
=
1
,
VOLTH
,
TIMTH
,
VOLQU
,
TIMQU
};
enum
UsageReportTrigger
{
PERIO
=
1
,
VOLTH
,
TIMTH
,
VOLQU
,
TIMQU
};
/// <summary>
///
...
...
src/pfcp/3gpp_29.244.hpp
View file @
98ea303b
...
...
@@ -4478,24 +4478,19 @@ class pfcp_time_quota_ie : public pfcp_ie {
tlv
.
set_length
(
sizeof
(
time_quota
));
}
//--------
pfcp_time_quota_ie
()
:
pfcp_ie
(
PFCP_IE_TIME_QUOTA
),
time_quota
(
0
)
{
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
){};
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
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
));
reinterpret_cast
<
const
char
*>
(
&
be_time_quota
),
sizeof
(
be_time_quota
));
}
//--------
void
load_from
(
std
::
istream
&
is
)
{
...
...
src/smf_app/smf_context.cpp
View file @
98ea303b
...
...
@@ -990,11 +990,17 @@ void smf_context::handle_itti_msg(
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
(
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
);
...
...
@@ -1016,10 +1022,8 @@ void smf_context::handle_itti_msg(
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
);
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
);
...
...
@@ -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
,
oai
::
smf_server
::
model
::
EventNotification
ev_notif_model
,
uint8_t
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
,
"SMF Context-related SEID "
SEID_FMT
,
seid
);
// Get the smf context
...
...
@@ -4153,12 +4157,12 @@ void smf_context::handle_qos_monitoring(seid_t seid,
}
//------------------------------------------------------------------------------
void
smf_context
::
trigger_qos_monitoring
(
seid_t
seid
,
oai
::
smf_server
::
model
::
EventNotification
ev_notif_model
,
uint8_t
http_version
)
{
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
(
...
...
@@ -4416,8 +4420,6 @@ void smf_context::handle_pdusesest(scid_t scid, uint8_t http_version) {
uint64_t
tv_ntp
=
time_epoch_ntp
+
SECONDS_SINCE_FIRST_EPOCH
;
ev_notif
.
set_timestamp
(
std
::
to_string
(
tv_ntp
));
// UE IPv4
if
(
sp
->
ipv4
)
{
ev_notif
.
set_ad_ipv4_addr
(
conv
::
toString
(
sp
->
ipv4_address
));
...
...
@@ -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_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_sd
(
std
::
to_string
(
sp
->
get_snssai
().
sd
));
ev_notif
.
set_dnn
(
sp
->
get_dnn
());
...
...
@@ -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) {
event_sub
.
ee_plmn_change
(
scid
,
http_version
);
}
//------------------------------------------------------------------------------
void
smf_context
::
handle_plmn_change
(
scid_t
scid
,
uint8_t
http_version
)
{
Logger
::
smf_app
().
debug
(
...
...
src/smf_app/smf_context.hpp
View file @
98ea303b
...
...
@@ -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
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
);
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
);
void
trigger_flexcn_event
(
scid_t
scid
,
uint8_t
http_version
);
void
handle_flexcn_event
(
scid_t
scid
,
uint8_t
http_version
);
...
...
src/smf_app/smf_event.hpp
View file @
98ea303b
...
...
@@ -82,7 +82,7 @@ class smf_event {
// download link data status
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
);
bs2
::
connection
subscribe_ee_qos_monitoring
(
const
ee_qos_monitoring_sig_t
::
slot_type
&
sig
);
...
...
src/smf_app/smf_event_sig.hpp
View file @
98ea303b
...
...
@@ -81,8 +81,7 @@ typedef bs2::signal_type<
// 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
;
bs2
::
keywords
::
mutex_type
<
bs2
::
dummy_mutex
>>::
type
ee_qos_monitoring_sig_t
;
// Signal for FlexCN event (for Event Exposure)
// SCID, HTTP version
...
...
src/smf_app/smf_msg.cpp
View file @
98ea303b
...
...
@@ -1185,9 +1185,6 @@ bool event_notification::is_sst_set() const {
return
m_sst_is_set
;
}
//-----------------------------------------------------------------------------
void
event_notification
::
set_sd
(
std
::
string
const
&
value
)
{
m_sd
=
value
;
...
...
@@ -1204,9 +1201,6 @@ bool event_notification::is_sd_set() const {
return
m_sd_is_set
;
}
//-----------------------------------------------------------------------------
void
event_notification
::
set_pdu_session_type
(
std
::
string
const
&
value
)
{
m_pdu_session_type
=
value
;
...
...
src/smf_app/smf_msg.hpp
View file @
98ea303b
...
...
@@ -632,7 +632,6 @@ class event_notification {
oai
::
smf_server
::
model
::
DddStatus
get_ddds
()
const
;
bool
is_ddds_is_set
()
const
;
void
set_dnn
(
std
::
string
const
&
value
);
std
::
string
get_dnn
()
const
;
bool
is_dnn_set
()
const
;
...
...
src/smf_app/smf_procedure.cpp
View file @
98ea303b
src/smf_app/smf_sbi.cpp
View file @
98ea303b
...
...
@@ -523,8 +523,9 @@ void smf_sbi::notify_subscribed_event(
event_notif
[
"dddStatus"
]
=
"TRANSMITTED"
;
}
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_sst_set
()){
if
(
i
.
is_pdu_session_type_set
())
event_notif
[
"pduSessType"
]
=
i
.
get_pdu_session_type
();
if
(
i
.
is_sst_set
())
{
nlohmann
::
json
snssai_data
=
{};
snssai_data
[
"sst"
]
=
i
.
get_sst
();
if
(
i
.
is_sd_set
())
snssai_data
[
"sd"
]
=
i
.
get_sd
();
...
...
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