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
c5f759d4
Commit
c5f759d4
authored
Aug 20, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup
parent
4eaea279
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
58 additions
and
345 deletions
+58
-345
src/smf_app/smf_app.cpp
src/smf_app/smf_app.cpp
+29
-153
src/smf_app/smf_app.hpp
src/smf_app/smf_app.hpp
+0
-1
src/smf_app/smf_context.cpp
src/smf_app/smf_context.cpp
+21
-135
src/smf_app/smf_context.hpp
src/smf_app/smf_context.hpp
+2
-14
src/smf_app/smf_n1.cpp
src/smf_app/smf_n1.cpp
+2
-31
src/smf_app/smf_procedure.cpp
src/smf_app/smf_procedure.cpp
+4
-11
No files found.
src/smf_app/smf_app.cpp
View file @
c5f759d4
This diff is collapsed.
Click to expand it.
src/smf_app/smf_app.hpp
View file @
c5f759d4
...
@@ -200,7 +200,6 @@ class smf_app {
...
@@ -200,7 +200,6 @@ class smf_app {
void
operator
=
(
smf_app
const
&
)
=
delete
;
void
operator
=
(
smf_app
const
&
)
=
delete
;
void
test_dns
();
/*
/*
* Set the association between Seid and SM Context
* Set the association between Seid and SM Context
* @param [const seid_t &] seid: SessionID
* @param [const seid_t &] seid: SessionID
...
...
src/smf_app/smf_context.cpp
View file @
c5f759d4
This diff is collapsed.
Click to expand it.
src/smf_app/smf_context.hpp
View file @
c5f759d4
...
@@ -597,11 +597,11 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
...
@@ -597,11 +597,11 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
amf_status_uri
=
{};
amf_status_uri
=
{};
target_amf
=
{};
target_amf
=
{};
supi_prefix
=
{};
supi_prefix
=
{};
// Subscribe to
sm context status c
hange
// Subscribe to
SM Context Status C
hange
sm_context_status_connection
=
sm_context_status_connection
=
event_sub
.
subscribe_sm_context_status
(
boost
::
bind
(
event_sub
.
subscribe_sm_context_status
(
boost
::
bind
(
&
smf_context
::
handle_sm_context_status_change
,
this
,
_1
,
_2
,
_3
));
&
smf_context
::
handle_sm_context_status_change
,
this
,
_1
,
_2
,
_3
));
// Subscribe to
pdu session r
elease (event exposure)
// Subscribe to
PDU Session R
elease (event exposure)
ee_pdu_session_release_connection
=
ee_pdu_session_release_connection
=
event_sub
.
subscribe_ee_pdu_session_release
(
boost
::
bind
(
event_sub
.
subscribe_ee_pdu_session_release
(
boost
::
bind
(
&
smf_context
::
handle_ee_pdu_session_release
,
this
,
_1
,
_2
,
_3
));
&
smf_context
::
handle_ee_pdu_session_release
,
this
,
_1
,
_2
,
_3
));
...
@@ -1019,13 +1019,6 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
...
@@ -1019,13 +1019,6 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
*/
*/
supi_t
get_supi
()
const
;
supi_t
get_supi
()
const
;
/*
* Get the number of dnn contexts
* @param
* @return std::size_t: the number of contexts
*/
std
::
size_t
get_number_dnn_contexts
()
const
;
/*
/*
* Get Supi prefix
* Get Supi prefix
* @param [const std::string &] prefix: Supi prefix (e.g., imsi)
* @param [const std::string &] prefix: Supi prefix (e.g., imsi)
...
@@ -1251,12 +1244,10 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
...
@@ -1251,12 +1244,10 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
const
pdu_session_id_t
&
pdu_session_id
)
const
;
const
pdu_session_id_t
&
pdu_session_id
)
const
;
private:
private:
// std::vector<std::shared_ptr<dnn_context>> dnns;
std
::
vector
<
std
::
shared_ptr
<
smf_procedure
>>
pending_procedures
;
std
::
vector
<
std
::
shared_ptr
<
smf_procedure
>>
pending_procedures
;
// snssai-sst <-> session management subscription
// snssai-sst <-> session management subscription
std
::
map
<
uint8_t
,
std
::
shared_ptr
<
session_management_subscription
>>
std
::
map
<
uint8_t
,
std
::
shared_ptr
<
session_management_subscription
>>
dnn_subscriptions
;
dnn_subscriptions
;
std
::
map
<
pdu_session_id_t
,
std
::
shared_ptr
<
smf_pdu_session
>>
std
::
map
<
pdu_session_id_t
,
std
::
shared_ptr
<
smf_pdu_session
>>
pdu_sessions
;
// Store all PDU Sessions associated with this UE
pdu_sessions
;
// Store all PDU Sessions associated with this UE
mutable
std
::
shared_mutex
m_pdu_sessions_mutex
;
mutable
std
::
shared_mutex
m_pdu_sessions_mutex
;
...
@@ -1265,9 +1256,6 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
...
@@ -1265,9 +1256,6 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
std
::
string
supi_prefix
;
std
::
string
supi_prefix
;
plmn_t
plmn
;
plmn_t
plmn
;
// AMF IP addr
// string amf_addr;
std
::
string
amf_id
;
std
::
string
amf_id
;
std
::
string
amf_addr
;
std
::
string
amf_addr
;
std
::
string
amf_status_uri
;
std
::
string
amf_status_uri
;
...
...
src/smf_app/smf_n1.cpp
View file @
c5f759d4
...
@@ -415,8 +415,7 @@ bool smf_n1::create_n1_pdu_session_modification_command(
...
@@ -415,8 +415,7 @@ bool smf_n1::create_n1_pdu_session_modification_command(
Logger
::
smf_n1
().
info
(
"PDU_SESSION_MODIFICATION_COMMAND, encode starting..."
);
Logger
::
smf_n1
().
info
(
"PDU_SESSION_MODIFICATION_COMMAND, encode starting..."
);
// Get the SMF_PDU_Session
// Get the SMF_PDU_Session
std
::
shared_ptr
<
smf_context
>
sc
=
{};
std
::
shared_ptr
<
smf_context
>
sc
=
{};
// std::shared_ptr<dnn_context> sd = {};
std
::
shared_ptr
<
smf_pdu_session
>
sp
=
{};
std
::
shared_ptr
<
smf_pdu_session
>
sp
=
{};
supi_t
supi
=
sm_context_res
.
get_supi
();
supi_t
supi
=
sm_context_res
.
get_supi
();
supi64_t
supi64
=
smf_supi_to_u64
(
supi
);
supi64_t
supi64
=
smf_supi_to_u64
(
supi
);
...
@@ -429,20 +428,6 @@ bool smf_n1::create_n1_pdu_session_modification_command(
...
@@ -429,20 +428,6 @@ bool smf_n1::create_n1_pdu_session_modification_command(
"SMF context with SUPI "
SUPI_64_FMT
" does not exist!"
,
supi64
);
"SMF context with SUPI "
SUPI_64_FMT
" does not exist!"
,
supi64
);
return
false
;
return
false
;
}
}
/*
bool find_dnn = sc.get()->find_dnn_context(
sm_context_res.get_snssai(), sm_context_res.get_dnn(), sd);
bool find_pdu = false;
if (find_dnn) {
find_pdu =
sd.get()->find_pdu_session(sm_context_res.get_pdu_session_id(), sp);
}
if (!find_dnn or !find_pdu) {
// error
Logger::smf_n1().warn("DNN or PDU session context does not exist!");
return false;
}
*/
if
(
!
sc
.
get
()
->
find_pdu_session
(
sm_context_res
.
get_pdu_session_id
(),
sp
))
{
if
(
!
sc
.
get
()
->
find_pdu_session
(
sm_context_res
.
get_pdu_session_id
(),
sp
))
{
// error
// error
...
@@ -573,8 +558,7 @@ bool smf_n1::create_n1_pdu_session_modification_command(
...
@@ -573,8 +558,7 @@ bool smf_n1::create_n1_pdu_session_modification_command(
Logger
::
smf_n1
().
info
(
"PDU_SESSION_MODIFICATION_COMMAND, encode starting..."
);
Logger
::
smf_n1
().
info
(
"PDU_SESSION_MODIFICATION_COMMAND, encode starting..."
);
// Get the SMF_PDU_Session
// Get the SMF_PDU_Session
std
::
shared_ptr
<
smf_context
>
sc
=
{};
std
::
shared_ptr
<
smf_context
>
sc
=
{};
// std::shared_ptr<dnn_context> sd = {};
std
::
shared_ptr
<
smf_pdu_session
>
sp
=
{};
std
::
shared_ptr
<
smf_pdu_session
>
sp
=
{};
supi_t
supi
=
msg
.
get_supi
();
supi_t
supi
=
msg
.
get_supi
();
supi64_t
supi64
=
smf_supi_to_u64
(
supi
);
supi64_t
supi64
=
smf_supi_to_u64
(
supi
);
...
@@ -587,19 +571,6 @@ bool smf_n1::create_n1_pdu_session_modification_command(
...
@@ -587,19 +571,6 @@ bool smf_n1::create_n1_pdu_session_modification_command(
"SMF context with SUPI "
SUPI_64_FMT
" does not exist!"
,
supi64
);
"SMF context with SUPI "
SUPI_64_FMT
" does not exist!"
,
supi64
);
return
false
;
return
false
;
}
}
/*
bool find_dnn =
sc.get()->find_dnn_context(msg.get_snssai(), msg.get_dnn(), sd);
bool find_pdu = false;
if (find_dnn) {
find_pdu = sd.get()->find_pdu_session(msg.get_pdu_session_id(), sp);
}
if (!find_dnn or !find_pdu) {
// error
Logger::smf_n1().warn("DNN or PDU session context does not exist!");
return false;
}
*/
if
(
!
sc
.
get
()
->
find_pdu_session
(
msg
.
get_pdu_session_id
(),
sp
))
{
if
(
!
sc
.
get
()
->
find_pdu_session
(
msg
.
get_pdu_session_id
(),
sp
))
{
// error
// error
...
...
src/smf_app/smf_procedure.cpp
View file @
c5f759d4
...
@@ -125,7 +125,7 @@ int session_create_sm_context_procedure::run(
...
@@ -125,7 +125,7 @@ int session_create_sm_context_procedure::run(
PDU_SESSION_APPLICATION_ERROR_CONTEXT_NOT_FOUND
);
PDU_SESSION_APPLICATION_ERROR_CONTEXT_NOT_FOUND
);
return
RETURNerror
;
return
RETURNerror
;
}
}
if
(
sp
.
get
()
!=
nullptr
)
sp
.
get
()
->
set_upf_node_id
(
up_node_id
);
sp
.
get
()
->
set_upf_node_id
(
up_node_id
);
}
else
{
}
else
{
Logger
::
smf_app
().
warn
(
Logger
::
smf_app
().
warn
(
...
@@ -549,13 +549,9 @@ int session_update_sm_context_procedure::run(
...
@@ -549,13 +549,9 @@ int session_update_sm_context_procedure::run(
std
::
shared_ptr
<
smf_pdu_session
>
sp
=
{};
std
::
shared_ptr
<
smf_pdu_session
>
sp
=
{};
if
(
!
sc
.
get
()
->
find_pdu_session
(
scf
.
get
()
->
pdu_session_id
,
sp
))
{
if
(
!
sc
.
get
()
->
find_pdu_session
(
scf
.
get
()
->
pdu_session_id
,
sp
))
{
Logger
::
smf_app
().
warn
(
"PDU session context does not exist!"
);
Logger
::
smf_app
().
warn
(
"PDU session context does not exist!"
);
}
if
(
sp
.
get
()
!=
nullptr
)
{
sp
.
get
()
->
get_upf_node_id
(
up_node_id
);
}
else
{
Logger
::
smf_app
().
warn
(
"PDU session context does not exist!"
);
return
RETURNerror
;
return
RETURNerror
;
}
}
sp
.
get
()
->
get_upf_node_id
(
up_node_id
);
// TODO: UPF insertion in case of Handover
// TODO: UPF insertion in case of Handover
...
@@ -1421,14 +1417,11 @@ int session_release_sm_context_procedure::run(
...
@@ -1421,14 +1417,11 @@ int session_release_sm_context_procedure::run(
std
::
shared_ptr
<
smf_pdu_session
>
sp
=
{};
std
::
shared_ptr
<
smf_pdu_session
>
sp
=
{};
if
(
!
sc
.
get
()
->
find_pdu_session
(
scf
.
get
()
->
pdu_session_id
,
sp
))
{
if
(
!
sc
.
get
()
->
find_pdu_session
(
scf
.
get
()
->
pdu_session_id
,
sp
))
{
Logger
::
smf_app
().
warn
(
"PDU session context does not exist!"
);
Logger
::
smf_app
().
warn
(
"PDU session context does not exist!"
);
}
if
(
sp
.
get
()
!=
nullptr
)
{
sp
.
get
()
->
get_upf_node_id
(
up_node_id
);
}
else
{
Logger
::
smf_app
().
warn
(
"PDU session context does not exist!"
);
return
RETURNerror
;
return
RETURNerror
;
}
}
sp
.
get
()
->
get_upf_node_id
(
up_node_id
);
/* if (not pfcp_associations::get_instance().select_up_node(
/* if (not pfcp_associations::get_instance().select_up_node(
up_node_id, NODE_SELECTION_CRITERIA_MIN_PFCP_SESSIONS)) {
up_node_id, NODE_SELECTION_CRITERIA_MIN_PFCP_SESSIONS)) {
sm_context_res->res.set_cause(
sm_context_res->res.set_cause(
...
...
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