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
d6da8700
Commit
d6da8700
authored
Oct 19, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix_upf_selection' into 'develop'
Fix upf selection See merge request oai/cn5g/oai-cn5g-smf!101
parents
11614b91
2f2b2ea2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
3 deletions
+57
-3
src/common/smf.h
src/common/smf.h
+45
-0
src/smf_app/smf_pfcp_association.cpp
src/smf_app/smf_pfcp_association.cpp
+10
-1
src/smf_app/smf_profile.cpp
src/smf_app/smf_profile.cpp
+1
-1
src/smf_app/smf_profile.hpp
src/smf_app/smf_profile.hpp
+1
-1
No files found.
src/common/smf.h
View file @
d6da8700
...
...
@@ -324,11 +324,23 @@ typedef struct dnn_upf_info_item_s {
std
::
string
dnn
;
// std::vector<std::string> dnai_list
// std::vector<std::string> pdu_session_types
dnn_upf_info_item_s
&
operator
=
(
const
dnn_upf_info_item_s
&
d
)
{
dnn
=
d
.
dnn
;
return
*
this
;
}
}
dnn_upf_info_item_t
;
typedef
struct
snssai_upf_info_item_s
{
snssai_t
snssai
;
std
::
vector
<
dnn_upf_info_item_t
>
dnn_upf_info_list
;
snssai_upf_info_item_s
&
operator
=
(
const
snssai_upf_info_item_s
&
s
)
{
snssai
=
s
.
snssai
;
dnn_upf_info_list
=
s
.
dnn_upf_info_list
;
return
*
this
;
}
}
snssai_upf_info_item_t
;
typedef
struct
interface_upf_info_item_s
{
...
...
@@ -337,11 +349,44 @@ typedef struct interface_upf_info_item_s {
std
::
vector
<
struct
in6_addr
>
ipv6_addresses
;
std
::
string
endpoint_fqdn
;
std
::
string
network_instance
;
interface_upf_info_item_s
&
operator
=
(
const
interface_upf_info_item_s
&
i
)
{
interface_type
=
i
.
interface_type
;
ipv4_addresses
=
i
.
ipv4_addresses
;
ipv6_addresses
=
i
.
ipv6_addresses
;
endpoint_fqdn
=
i
.
endpoint_fqdn
;
network_instance
=
i
.
network_instance
;
return
*
this
;
}
}
interface_upf_info_item_t
;
typedef
struct
upf_info_s
{
std
::
vector
<
interface_upf_info_item_t
>
interface_upf_info_list
;
std
::
vector
<
snssai_upf_info_item_t
>
snssai_upf_info_list
;
upf_info_s
&
operator
=
(
const
upf_info_s
&
s
)
{
interface_upf_info_list
=
s
.
interface_upf_info_list
;
snssai_upf_info_list
=
s
.
snssai_upf_info_list
;
return
*
this
;
}
std
::
string
to_string
()
const
{
std
::
string
s
=
{};
// TODO: Interface UPF Info List
if
(
!
snssai_upf_info_list
.
empty
())
{
s
.
append
(
"SNSSAI UPF Info: "
);
for
(
auto
sn
:
snssai_upf_info_list
)
{
s
.
append
(
"{"
+
sn
.
snssai
.
toString
()
+
", "
);
for
(
auto
d
:
sn
.
dnn_upf_info_list
)
{
s
.
append
(
"{DNN = "
+
d
.
dnn
+
"}, "
);
}
s
.
append
(
"};"
);
}
}
return
s
;
}
}
upf_info_t
;
typedef
struct
patch_item_s
{
...
...
src/smf_app/smf_pfcp_association.cpp
View file @
d6da8700
...
...
@@ -209,6 +209,8 @@ bool pfcp_associations::add_association(
}
}
associations
.
insert
((
int32_t
)
hash_node_id
,
sa
);
// Display UPF Node profile
sa
->
get_upf_node_profile
().
display
();
trigger_heartbeat_request_procedure
(
sa
);
}
return
true
;
...
...
@@ -418,6 +420,7 @@ bool pfcp_associations::select_up_node(
pfcp
::
node_id_t
&
node_id
,
const
snssai_t
&
snssai
,
const
std
::
string
&
dnn
)
{
node_id
=
{};
if
(
associations
.
empty
())
{
Logger
::
smf_app
().
debug
(
"No UPF available"
);
return
false
;
}
folly
::
AtomicHashMap
<
int32_t
,
std
::
shared_ptr
<
pfcp_association
>>::
iterator
it
;
...
...
@@ -433,7 +436,13 @@ bool pfcp_associations::select_up_node(
// else, verify that UPF belongs to the same slice and supports this dnn
std
::
vector
<
snssai_t
>
snssais
=
{};
upf_info_t
upf_info
=
{};
a
->
upf_node_profile
.
get_upf_info
(
upf_info
);
a
->
get_upf_node_profile
().
get_upf_info
(
upf_info
);
// UPF info
a
->
get_upf_node_profile
().
display
();
Logger
::
smf_app
().
debug
(
"UPF info: %s"
,
upf_info
.
to_string
().
c_str
());
for
(
auto
ui
:
upf_info
.
snssai_upf_info_list
)
{
if
(
ui
.
snssai
==
snssai
)
{
for
(
auto
d
:
ui
.
dnn_upf_info_list
)
{
...
...
src/smf_app/smf_profile.cpp
View file @
d6da8700
...
...
@@ -203,7 +203,7 @@ void nf_profile::display() const {
Logger
::
smf_app
().
debug
(
"
\t
SNSSAI:"
);
}
for
(
auto
s
:
snssais
)
{
Logger
::
smf_app
().
debug
(
"
\t\t
SST
, SD: %d,
%s"
,
s
.
sST
,
s
.
sD
.
c_str
());
Logger
::
smf_app
().
debug
(
"
\t\t
SST
%d, SD
%s"
,
s
.
sST
,
s
.
sD
.
c_str
());
}
if
(
!
fqdn
.
empty
())
{
Logger
::
smf_app
().
debug
(
"
\t
FQDN: %s"
,
fqdn
.
c_str
());
...
...
src/smf_app/smf_profile.hpp
View file @
d6da8700
...
...
@@ -482,7 +482,7 @@ class upf_profile : public nf_profile {
// upf_profile(upf_profile &b) = delete;
virtual
~
upf_profile
()
{
Logger
::
smf_app
().
debug
(
"Delete UPF Profile instance..."
);
//
Logger::smf_app().debug("Delete UPF Profile instance...");
}
/*
...
...
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