Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-AMF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
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-AMF
Commits
776c8949
Commit
776c8949
authored
Feb 07, 2022
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get common S-NSSAIs between AMF and gNB
parent
53e642ea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
25 deletions
+50
-25
src/amf-app/amf_n2.cpp
src/amf-app/amf_n2.cpp
+48
-23
src/amf-app/amf_n2.hpp
src/amf-app/amf_n2.hpp
+2
-2
No files found.
src/amf-app/amf_n2.cpp
View file @
776c8949
...
...
@@ -376,8 +376,10 @@ void amf_n2::handle_itti_message(itti_ng_setup_request& itti_msg) {
// Verify PLMN Identity and TAC with configuration and store supportedTAList
// in gNB context, if verified; else response NG SETUP FAILURE with cause
// "Unknown PLMN"(9.3.1.2, ts38413)
std
::
vector
<
SupportedItem_t
>
common_plmn_list
=
get_common_plmn
(
s_ta_list
);
if
(
common_plmn_list
.
size
()
==
0
)
{
// std::vector<SupportedItem_t> common_plmn_list = get_common_plmn(s_ta_list);
get_common_plmn
(
s_ta_list
,
gc
->
s_ta_list
);
if
(
gc
->
s_ta_list
.
size
()
==
0
)
{
// if (!verifyPlmn(s_ta_list)) {
// encode NG SETUP FAILURE MESSAGE and send back
void
*
buffer
=
calloc
(
1
,
BUFFER_SIZE_1024
);
...
...
@@ -394,22 +396,23 @@ void amf_n2::handle_itti_message(itti_ng_setup_request& itti_msg) {
return
;
}
else
{
// store only the common PLMN
gc
->
s_ta_list
=
common_plmn_list
;
Logger
::
amf_n2
().
debug
(
"Common PLMN"
);
for
(
auto
ta
:
gc
->
s_ta_list
)
{
for
(
auto
p
:
ta
.
b_plmn_list
)
{
std
::
string
mcc
;
std
::
string
mnc
;
Logger
::
amf_n2
().
debug
(
"PLMN MCC %s, MNC %s"
,
p
.
mcc
.
c_str
(),
p
.
mnc
.
c_str
());
for
(
auto
s
:
p
.
slice_list
)
{
Logger
::
amf_n2
().
debug
(
"S-NSSAI (SST %s, SD %s)"
,
s
.
sst
.
c_str
(),
s
.
sd
.
c_str
());
}
}
}
for
(
auto
i
:
common_plmn_list
)
{
// gc->s_ta_list = common_plmn_list;
/*
Logger::amf_n2().debug("Common PLMN");
for (auto ta : gc->s_ta_list) {
for (auto p : ta.b_plmn_list) {
std::string mcc;
std::string mnc;
Logger::amf_n2().debug(
"PLMN MCC %s, MNC %s", p.mcc.c_str(), p.mnc.c_str());
for (auto s : p.slice_list) {
Logger::amf_n2().debug(
"S-NSSAI (SST %s, SD %s)", s.sst.c_str(), s.sd.c_str());
}
}
}
*/
for
(
auto
i
:
gc
->
s_ta_list
)
{
gnbItem
.
plmn_list
.
push_back
(
i
);
}
}
...
...
@@ -2120,8 +2123,8 @@ bool amf_n2::verifyPlmn(vector<SupportedItem_t> list) {
}
//------------------------------------------------------------------------------
std
::
vector
<
SupportedItem_t
>
amf_n2
::
get_common_plmn
(
std
::
vector
<
SupportedItem_t
>
list
)
{
void
amf_n2
::
get_common_plmn
(
std
::
vector
<
SupportedItem_t
>
list
,
std
::
vector
<
SupportedItem_t
>&
result
)
{
std
::
vector
<
SupportedItem_t
>
plmn_list
=
{};
for
(
int
i
=
0
;
i
<
amf_cfg
.
plmn_list
.
size
();
i
++
)
{
...
...
@@ -2135,11 +2138,33 @@ std::vector<SupportedItem_t> amf_n2::get_common_plmn(
for
(
int
k
=
0
;
k
<
list
[
j
].
b_plmn_list
.
size
();
k
++
)
{
if
(
!
(
list
[
j
].
b_plmn_list
[
k
].
mcc
.
compare
(
amf_cfg
.
plmn_list
[
i
].
mcc
))
&&
!
(
list
[
j
].
b_plmn_list
[
k
].
mnc
.
compare
(
amf_cfg
.
plmn_list
[
i
].
mnc
)))
{
// TODO: compare NSSAI
plmn_list
.
push_back
(
list
[
j
]);
Logger
::
amf_n2
().
debug
(
"Common PLMN MCC %s, MNC %s"
,
amf_cfg
.
plmn_list
[
i
].
mcc
.
c_str
(),
amf_cfg
.
plmn_list
[
i
].
mnc
.
c_str
());
// Get the common S-NSSAI
SupportedItem_t
item
=
{};
PlmnSliceSupport_t
plmn_slice_support_item
=
{};
item
.
tac
=
list
[
j
].
tac
;
plmn_slice_support_item
.
mcc
=
list
[
j
].
b_plmn_list
[
k
].
mcc
;
plmn_slice_support_item
.
mnc
=
list
[
j
].
b_plmn_list
[
k
].
mnc
;
for
(
auto
s1
:
list
[
j
].
b_plmn_list
[
k
].
slice_list
)
{
for
(
auto
s2
:
amf_cfg
.
plmn_list
[
i
].
slice_list
)
{
if
((
s1
.
sst
.
compare
(
std
::
to_string
(
s2
.
sst
))
==
0
)
and
(
s1
.
sd
.
compare
(
std
::
to_string
(
s2
.
sd
))
==
0
))
{
Logger
::
amf_n2
().
debug
(
"Common S-NSSAI (SST %s, SD %s)"
,
s1
.
sst
.
c_str
(),
s1
.
sd
.
c_str
());
plmn_slice_support_item
.
slice_list
.
push_back
(
s1
);
}
}
}
item
.
b_plmn_list
.
push_back
(
plmn_slice_support_item
);
result
.
push_back
(
item
);
}
}
}
}
return
plmn_list
;
//
return plmn_list;
}
src/amf-app/amf_n2.hpp
View file @
776c8949
...
...
@@ -68,8 +68,8 @@ class amf_n2 : public ngap::ngap_app {
void
handle_itti_message
(
itti_paging
&
itti_msg
);
bool
verifyPlmn
(
std
::
vector
<
SupportedItem_t
>
list
);
std
::
vector
<
SupportedItem_t
>
get_common_plmn
(
std
::
vector
<
SupportedItem_t
>
list
);
void
get_common_plmn
(
std
::
vector
<
SupportedItem_t
>
list
,
std
::
vector
<
SupportedItem_t
>&
result
);
std
::
shared_ptr
<
ue_ngap_context
>
ran_ue_id_2_ue_ngap_context
(
const
uint32_t
&
ran_ue_ngap_id
)
const
;
...
...
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