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
deb6de9e
Commit
deb6de9e
authored
Aug 08, 2022
by
ferrerod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add UR trigger on Time Quota reached
parent
61a32dc3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
52 deletions
+66
-52
src/pfcp/3gpp_29.244.hpp
src/pfcp/3gpp_29.244.hpp
+55
-46
src/smf_app/smf_procedure.cpp
src/smf_app/smf_procedure.cpp
+11
-6
No files found.
src/pfcp/3gpp_29.244.hpp
View file @
deb6de9e
...
...
@@ -4465,52 +4465,56 @@ class pfcp_volume_quota_ie : public pfcp_ie {
}
}
;
////-------------------------------------
//// 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 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
{
...
...
@@ -9275,6 +9279,11 @@ class pfcp_create_urr_ie : public pfcp_grouped_ie {
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
}
...
...
src/smf_app/smf_procedure.cpp
View file @
deb6de9e
...
...
@@ -323,15 +323,18 @@ int session_create_sm_context_procedure::run(
pfcp
::
volume_threshold_t
volume_threshold
=
{};
pfcp
::
volume_quota_t
volume_quota
=
{};
pfcp
::
time_threshold_t
time_threshold
=
{};
pfcp
::
time_quota_t
time_quota
=
{};
// 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.volqu = 1;
reporting_triggers
.
timth
=
1
;
reporting_triggers
.
perio
=
0
;
// Periodic usage report
reporting_triggers
.
volth
=
0
;
reporting_triggers
.
volqu
=
0
;
reporting_triggers
.
timth
=
0
;
reporting_triggers
.
timqu
=
1
;
// volume_quota.tovol = 1;
// volume_threshold.dlvol = 1;
// volume_threshold.ulvol = 1;
...
...
@@ -339,13 +342,15 @@ int session_create_sm_context_procedure::run(
// volume_threshold.downlink_volume = 10;
// volume_threshold.uplink_volume = 10;
// volume_quota.total_volume = 1000;
time_threshold
.
time_threshold
=
30
;
// time_threshold.time_threshold = 30;
time_quota
.
time_quota
=
15
;
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
(
time_quota
);
// create_urr.set(time_threshold);
// create_urr.set(volume_threshold);
// create_urr.set(volume_quota);
...
...
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