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
f300ca2f
Commit
f300ca2f
authored
Feb 04, 2022
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get Slice Selection Subscription from conf file
parent
c271cfc0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
6 deletions
+55
-6
etc/amf.conf
etc/amf.conf
+1
-1
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+54
-5
No files found.
etc/amf.conf
View file @
f300ca2f
...
...
@@ -123,7 +123,7 @@ AMF =
SMF_SELECTION
=
"@SMF_SELECTION@"
;
# Set to yes to enable SMF discovery and selection
EXTERNAL_AUSF
=
"@EXTERNAL_AUSF@"
;
# Set to yes if AMF works with an external AUSF
EXTERNAL_UDM
=
"@EXTERNAL_UDM@"
;
# Set to yes if AMF works with an external UDM
EXTERNAL_NSSF
=
"no"
;
# Set to yes if AMF works with an external NSSF
EXTERNAL_NSSF
=
"no"
;
# Set to yes if AMF works with an external NSSF
USE_FQDN_DNS
=
"@USE_FQDN_DNS@"
;
# Set to yes if AMF relies on a DNS to resolve NRF/SMF/UDM/AUSF's FQDN
USE_HTTP2
=
"no"
;
# Set to yes to enable HTTP2 for AMF server
}
...
...
src/amf-app/amf_n1.cpp
View file @
f300ca2f
...
...
@@ -3702,6 +3702,7 @@ bool amf_n1::reroute_registration_request(std::shared_ptr<nas_context>& nc) {
"Registration with AMF re-allocation, Reroute Registration Request to "
"the target AMF"
);
/*
// Check if the AMF can serve all the requested S-NSSAIs
if (check_requested_nssai(nc)) {
Logger::amf_n1().debug(
...
...
@@ -3709,6 +3710,7 @@ bool amf_n1::reroute_registration_request(std::shared_ptr<nas_context>& nc) {
"perform AMF Re-allocation procedure");
return false;
}
*/
// Get NSSAI from UDM
oai
::
amf
::
model
::
Nssai
nssai
=
{};
...
...
@@ -3724,8 +3726,7 @@ bool amf_n1::reroute_registration_request(std::shared_ptr<nas_context>& nc) {
if
(
check_subscribed_nssai
(
nc
,
nssai
))
{
Logger
::
amf_n1
().
debug
(
"Current AMF can handle the Requested/Subscribed NSSAIs, do not need "
"to "
"perform AMF Re-allocation procedure"
);
"to perform AMF Re-allocation procedure"
);
return
false
;
}
...
...
@@ -3782,6 +3783,7 @@ bool amf_n1::check_requested_nssai(const std::shared_ptr<nas_context>& nc) {
if
(
nc
->
requestedNssai
.
size
()
==
0
)
{
return
false
;
}
bool
result
=
false
;
for
(
auto
p
:
amf_cfg
.
plmn_list
)
{
// Check PLMN/TAC
...
...
@@ -3792,7 +3794,7 @@ bool amf_n1::check_requested_nssai(const std::shared_ptr<nas_context>& nc) {
}
result
=
true
;
// check if AMF can serve all the
common
NSSAIs
// check if AMF can serve all the
requested
NSSAIs
for
(
auto
n
:
nc
->
requestedNssai
)
{
bool
found_nssai
=
false
;
for
(
auto
s
:
p
.
slice_list
)
{
...
...
@@ -3816,7 +3818,7 @@ bool amf_n1::check_requested_nssai(const std::shared_ptr<nas_context>& nc) {
//------------------------------------------------------------------------------
bool
amf_n1
::
check_subscribed_nssai
(
const
std
::
shared_ptr
<
nas_context
>&
nc
,
oai
::
amf
::
model
::
Nssai
&
nssai
)
{
// Check if the AMF can serve all the subscribed S-NSSAIs
// Check if the AMF can serve all the
requested/
subscribed S-NSSAIs
std
::
shared_ptr
<
ue_context
>
uc
=
{};
if
(
!
find_ue_context
(
...
...
@@ -3992,7 +3994,54 @@ bool amf_n1::get_slice_selection_subscription_data(
//------------------------------------------------------------------------------
bool
amf_n1
::
get_slice_selection_subscription_data_from_conf_file
(
const
std
::
shared_ptr
<
nas_context
>&
nc
,
oai
::
amf
::
model
::
Nssai
&
nssai
)
{
// TODO:
// For now, use the common NSSAIs, supported by AMF and gNB, as subscribed
// NSSAIs
std
::
shared_ptr
<
ue_context
>
uc
=
{};
if
(
!
find_ue_context
(
nc
.
get
()
->
ran_ue_ngap_id
,
nc
.
get
()
->
amf_ue_ngap_id
,
uc
))
{
Logger
::
amf_n1
().
warn
(
"Cannot find the UE context"
);
return
false
;
}
// Get gNB Context
std
::
shared_ptr
<
ue_ngap_context
>
unc
=
amf_n2_inst
->
ran_ue_id_2_ue_ngap_context
(
nc
->
ran_ue_ngap_id
);
std
::
shared_ptr
<
gnb_context
>
gc
=
{};
if
(
!
amf_n2_inst
->
is_assoc_id_2_gnb_context
(
unc
.
get
()
->
gnb_assoc_id
))
{
Logger
::
amf_n2
().
error
(
"No existed gNB context with assoc_id (%d)"
,
unc
.
get
()
->
gnb_assoc_id
);
return
false
;
}
// Find the common NSSAIs between Requested NSSAIs and Subscribed NSSAIs
std
::
vector
<
oai
::
amf
::
model
::
Snssai
>
common_snssais
=
nssai
.
getDefaultSingleNssais
();
for
(
auto
ta
:
gc
->
s_ta_list
)
{
for
(
auto
p
:
ta
.
b_plmn_list
)
{
for
(
auto
s
:
p
.
slice_list
)
{
oai
::
amf
::
model
::
Snssai
nssai
=
{};
uint8_t
sst
=
0
;
try
{
sst
=
std
::
stoi
(
s
.
sst
);
}
catch
(
const
std
::
exception
&
err
)
{
Logger
::
amf_app
().
error
(
"Invalid SST"
);
return
false
;
}
nssai
.
setSst
(
sst
);
nssai
.
setSd
(
s
.
sd
);
common_snssais
.
push_back
(
nssai
);
}
}
}
// Print out the list of subscribed NSSAIs
for
(
auto
n
:
nssai
.
getDefaultSingleNssais
())
{
Logger
::
amf_n1
().
debug
(
"Found S-NSSAI (SST %d, SD %s)"
,
n
.
getSst
(),
n
.
getSd
().
c_str
());
}
return
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