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
Hide 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
/**
* Nsmf_EventExposure
*
*
* UsageReport.cpp
*/
...
...
@@ -12,26 +12,26 @@ 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
;
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
()
{}
...
...
@@ -41,22 +41,15 @@ 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
;
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"
;
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
)
{
...
...
@@ -104,16 +90,12 @@ void from_json(const nlohmann::json& j, UsageReport& o) {
}
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
;
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
{
...
...
src/api-server/model/UsageReport.h
View file @
98ea303b
/**
* Nsmf_EventExposure
*
*
* UsageReport.h
*/
...
...
@@ -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>
///
...
...
@@ -79,7 +72,7 @@ class UsageReport {
/// <summary>
///
/// </summary>
/// </summary>
int64_t
getDlNoP
()
const
;
void
setDlNoP
(
int64_t
const
&
value
);
bool
dlNoPIsSet
()
const
;
...
...
src/pfcp/3gpp_29.244.hpp
View file @
98ea303b
...
...
@@ -4336,133 +4336,133 @@ class pfcp_time_of_last_packet_ie : public pfcp_ie {
//-------------------------------------
// 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
;
}
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
;
}
//--------
pfcp_volume_quota_ie
()
:
pfcp_ie
(
PFCP_IE_VOLUME_QUOTA
)
{
tlv
.
set_length
(
1
);
u1
.
b
=
0
;
total_volume
=
0
;
uplink_volume
=
0
;
if
(
u1
.
bf
.
dlvol
)
{
downlink_volume
=
b
.
downlink_volume
;
tlv
.
add_length
(
sizeof
(
downlink_volume
));
}
else
{
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
;
}
}
//--------
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
));
}
//--------
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
));
}
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
));
}
//--------
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
);
}
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
);
}
//--------
void
to_core_type
(
pfcp_ies_container
&
s
)
{
pfcp
::
volume_quota_t
v
=
{};
to_core_type
(
v
);
s
.
set
(
v
);
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
);
}
}
;
//-------------------------------------
...
...
@@ -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
)
{
...
...
@@ -9266,22 +9261,22 @@ class pfcp_create_urr_ie : public pfcp_grouped_ie {
}
if
(
b
.
volume_threshold
.
first
)
{
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
);
}
if
(
b
.
volume_quota
.
first
)
{
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
);
}
if
(
b
.
time_threshold
.
first
)
{
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
);
}
if
(
b
.
time_quota
.
first
)
{
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
);
}
}
...
...
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
);
...
...
@@ -1013,13 +1019,11 @@ void smf_context::handle_itti_msg(
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
=
{};
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
...
...
@@ -4105,8 +4109,8 @@ void smf_context::handle_qos_monitoring(seid_t seid,
return
;
}
supi_t
supi
=
pc
.
get
()
->
supi
;
supi64_t
supi64
=
smf_supi_to_u64
(
supi
);
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
(
...
...
@@ -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
(
...
...
@@ -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
);
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
)
{
...
...
@@ -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
...
...
@@ -691,7 +691,7 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
// Subscribe to DDDS event
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
));
...
...
@@ -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
);
...
...
@@ -100,7 +100,7 @@ bs2::connection subscribe_ee_pdusesest(
ee_ddds_sig_t
ee_ddds
;
ee_pdusesest_sig_t
ee_pdusesest
;
// Signal for pdu session establishment
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
#endif
/* FILE_SMF_EVENT_HPP_SEEN */
src/smf_app/smf_event_sig.hpp
View file @
98ea303b
...
...
@@ -71,7 +71,7 @@ typedef bs2::signal_type<
void
(
scid_t
,
uint8_t
),
bs2
::
keywords
::
mutex_type
<
bs2
::
dummy_mutex
>>::
type
ee_ddds_sig_t
;
// Signal for PDU SESSION ESTABLISHMENT
// 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
...
...
@@ -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
...
...
@@ -324,21 +324,21 @@ int session_create_sm_context_procedure::run(
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
;
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
);
...
...
src/smf_app/smf_sbi.cpp
View file @
98ea303b
...
...
@@ -523,10 +523,11 @@ 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
();
snssai_data
[
"sst"
]
=
i
.
get_sst
();
if
(
i
.
is_sd_set
())
snssai_data
[
"sd"
]
=
i
.
get_sd
();
event_notif
[
"snssai"
]
=
snssai_data
;
}
...
...
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