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
defc70b9
Commit
defc70b9
authored
Sep 30, 2020
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle PFCP Association Release Response from UP function
parent
0767d579
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
10 deletions
+62
-10
src/smf_app/smf_n4.cpp
src/smf_app/smf_n4.cpp
+51
-0
src/smf_app/smf_n4.hpp
src/smf_app/smf_n4.hpp
+2
-0
src/smf_app/smf_pfcp_association.cpp
src/smf_app/smf_pfcp_association.cpp
+8
-9
src/smf_app/smf_pfcp_association.hpp
src/smf_app/smf_pfcp_association.hpp
+1
-1
No files found.
src/smf_app/smf_n4.cpp
View file @
defc70b9
...
...
@@ -277,6 +277,8 @@ void smf_n4::handle_receive_pfcp_msg(pfcp_msg &msg,
case
PFCP_ASSOCIATION_UPDATE_RESPONSE
:
case
PFCP_ASSOCIATION_RELEASE_REQUEST
:
case
PFCP_ASSOCIATION_RELEASE_RESPONSE
:
handle_receive_association_release_response
(
msg
,
remote_endpoint
);
break
;
case
PFCP_VERSION_NOT_SUPPORTED_RESPONSE
:
case
PFCP_NODE_REPORT_REQUEST
:
case
PFCP_NODE_REPORT_RESPONSE
:
...
...
@@ -460,6 +462,8 @@ void smf_n4::handle_receive_association_update_request(
handle_receive_message_cb
(
msg
,
remote_endpoint
,
TASK_SMF_N4
,
error
,
trxn_id
);
if
(
error
)
{
Logger
::
smf_n4
().
warn
(
"Received N4 ASSOCIATION UPDATE REQUEST, error in handle_receive_message_cb!"
);
return
;
}
...
...
@@ -525,6 +529,53 @@ void smf_n4::handle_receive_association_update_request(
}
//------------------------------------------------------------------------------
void
smf_n4
::
handle_receive_association_release_response
(
pfcp
::
pfcp_msg
&
msg
,
const
endpoint
&
remote_endpoint
)
{
//TODO: To be completed
Logger
::
smf_n4
().
info
(
"Received N4 ASSOCIATION RELEASE RESPONSE from an UPF"
);
bool
error
=
true
;
uint64_t
trxn_id
=
0
;
pfcp_association_release_response
msg_ies_container
=
{
};
msg
.
to_core_type
(
msg_ies_container
);
handle_receive_message_cb
(
msg
,
remote_endpoint
,
TASK_SMF_N4
,
error
,
trxn_id
);
if
(
error
)
{
Logger
::
smf_n4
().
warn
(
"Received N4 ASSOCIATION RELEASE RESPONSE, error in handle_receive_message_cb!"
);
return
;
}
if
(
not
msg_ies_container
.
node_id
.
first
)
{
Logger
::
smf_n4
().
warn
(
"Received N4 ASSOCIATION RELEASE RESPONSE without node id IE!, ignore message"
);
return
;
}
pfcp
::
node_id_t
node_id
=
{
};
if
(
smf_cfg
.
get_pfcp_node_id
(
node_id
)
!=
RETURNok
)
{
Logger
::
smf_n4
().
warn
(
"Received N4 ASSOCIATION RELEASE RESPONSE with an invalid node ID!, ignore message"
);
return
;
}
if
(
not
msg_ies_container
.
cause
.
first
)
{
Logger
::
smf_n4
().
warn
(
"Received N4 ASSOCIATION RELEASE RESPONSE without cause IE!, ignore message"
);
}
else
{
if
(
msg_ies_container
.
cause
.
second
.
cause_value
==
pfcp
::
CAUSE_VALUE_REQUEST_ACCEPTED
)
{
std
::
shared_ptr
<
pfcp_association
>
sa
=
std
::
shared_ptr
<
pfcp_association
>
(
nullptr
);
if
(
pfcp_associations
::
get_instance
().
get_association
(
node_id
,
sa
))
{
//Delete locally all the PFCP sessions related to that PFCP association
sa
->
del_sessions
();
}
}
}
}
//------------------------------------------------------------------------------
void
smf_n4
::
handle_receive_session_establishment_response
(
pfcp
::
pfcp_msg
&
msg
,
const
endpoint
&
remote_endpoint
)
{
...
...
src/smf_app/smf_n4.hpp
View file @
defc70b9
...
...
@@ -158,6 +158,8 @@ class smf_n4 : public pfcp::pfcp_l4_stack {
pfcp
::
pfcp_msg
&
msg
,
const
endpoint
&
remote_endpoint
);
void
handle_receive_association_update_request
(
pfcp
::
pfcp_msg
&
msg
,
const
endpoint
&
remote_endpoint
);
void
handle_receive_association_release_response
(
pfcp
::
pfcp_msg
&
msg
,
const
endpoint
&
remote_endpoint
);
void
handle_receive_session_establishment_response
(
pfcp
::
pfcp_msg
&
msg
,
const
endpoint
&
r_endpoint
);
void
handle_receive_session_modification_response
(
pfcp
::
pfcp_msg
&
msg
,
...
...
src/smf_app/smf_pfcp_association.cpp
View file @
defc70b9
...
...
@@ -58,16 +58,15 @@ void pfcp_association::notify_del_session(const pfcp::fseid_t &cp_fseid) {
std
::
unique_lock
<
std
::
mutex
>
l
(
m_sessions
);
sessions
.
erase
(
cp_fseid
);
}
// //------------------------------------------------------------------------------
// void pfcp_association::del_sessions()
// {
// std::unique_lock<std::mutex> l(m_sessions);
// for (std::set<pfcp::fseid_t>::iterator it=sessions.begin(); it!=sessions.end();) {
// ???->remove_pfcp_session(*it);
// sessions.erase(it++);
// }
// }
//------------------------------------------------------------------------------
void
pfcp_association
::
del_sessions
()
{
std
::
unique_lock
<
std
::
mutex
>
l
(
m_sessions
);
sessions
.
clear
();
}
//------------------------------------------------------------------------------
void
pfcp_association
::
restore_n4_sessions
()
{
std
::
unique_lock
<
std
::
mutex
>
l
(
m_sessions
);
if
(
sessions
.
size
())
{
...
...
src/smf_app/smf_pfcp_association.hpp
View file @
defc70b9
...
...
@@ -126,7 +126,7 @@ class pfcp_association {
void
notify_add_session
(
const
pfcp
::
fseid_t
&
cp_fseid
);
bool
has_session
(
const
pfcp
::
fseid_t
&
cp_fseid
);
void
notify_del_session
(
const
pfcp
::
fseid_t
&
cp_fseid
);
//
void del_sessions();
void
del_sessions
();
void
restore_n4_sessions
();
void
set
(
const
pfcp
::
up_function_features_s
&
ff
)
{
function_features
.
first
=
true
;
...
...
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