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
13c9b4e5
Commit
13c9b4e5
authored
Jan 28, 2022
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get AuthorizedNetworkSliceInfo from NSSF
parent
48e724fc
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
786 additions
and
23 deletions
+786
-23
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+31
-13
src/amf-app/amf_n1.hpp
src/amf-app/amf_n1.hpp
+13
-5
src/amf-app/amf_n11.cpp
src/amf-app/amf_n11.cpp
+1
-0
src/sbi/amf_server/model/AuthorizedNetworkSliceInfo.cpp
src/sbi/amf_server/model/AuthorizedNetworkSliceInfo.cpp
+498
-0
src/sbi/amf_server/model/AuthorizedNetworkSliceInfo.h
src/sbi/amf_server/model/AuthorizedNetworkSliceInfo.h
+185
-0
src/sbi/amf_server/model/ConfiguredSnssai.cpp
src/sbi/amf_server/model/ConfiguredSnssai.cpp
+37
-3
src/sbi/amf_server/model/ConfiguredSnssai.h
src/sbi/amf_server/model/ConfiguredSnssai.h
+21
-2
No files found.
src/amf-app/amf_n1.cpp
View file @
13c9b4e5
...
...
@@ -3718,18 +3718,21 @@ bool amf_n1::reroute_registration_request(std::shared_ptr<nas_context>& nc) {
return
false
;
}
// Process NS selection to select the appropriate AMF
// TODO: use from OpenAPI
authorized_network_slice_info_t
authorized_network_slice_info
=
{};
oai
::
amf
::
model
::
SliceInfoForRegistration
slice_info
=
{};
oai
::
amf
::
model
::
AuthorizedNetworkSliceInfo
authorized_network_slice_info
=
{};
if
(
!
get_network_slice_selection
(
nc
,
amf_app_inst
->
get_nf_instance
(),
slice_info
,
authorized_network_slice_info
))
{
return
false
;
}
// if get_target_amf();
std
::
string
target_amf
=
{};
// Send N1MessageNotify to the Target AMF
send_n1_message_notity
(
nc
,
target_amf
);
if
(
get_target_amf
(
nc
,
target_amf
,
authorized_network_slice_info
))
{
// Send N1MessageNotify to the Target AMF
send_n1_message_notity
(
nc
,
target_amf
);
}
return
true
;
}
...
...
@@ -3816,9 +3819,10 @@ bool amf_n1::get_slice_selection_subscription_data_from_conf_file(
//------------------------------------------------------------------------------
bool
amf_n1
::
get_network_slice_selection
(
std
::
shared_ptr
<
nas_context
>&
nc
,
const
std
::
string
&
nf_instance_id
,
oai
::
amf
::
model
::
SliceInfoForRegistration
&
slice_info
,
authorized_network_slice_info_t
&
authorized_network_slice_info
)
{
const
std
::
shared_ptr
<
nas_context
>&
nc
,
const
std
::
string
&
nf_instance_id
,
const
oai
::
amf
::
model
::
SliceInfoForRegistration
&
slice_info
,
oai
::
amf
::
model
::
AuthorizedNetworkSliceInfo
&
authorized_network_slice_info
)
{
std
::
shared_ptr
<
ue_context
>
uc
=
{};
if
(
!
find_ue_context
(
nc
.
get
()
->
ran_ue_ngap_id
,
nc
.
get
()
->
amf_ue_ngap_id
,
uc
))
{
...
...
@@ -3828,7 +3832,6 @@ bool amf_n1::get_network_slice_selection(
if
(
amf_cfg
.
support_features
.
enable_external_nssf
)
{
// Get Authorized Network Slice Info from an external NSSF
std
::
shared_ptr
<
itti_n11_network_slice_selection_information
>
itti_msg
=
std
::
make_shared
<
itti_n11_network_slice_selection_information
>
(
TASK_AMF_N1
,
TASK_AMF_N11
);
...
...
@@ -3856,8 +3859,8 @@ bool amf_n1::get_network_slice_selection(
itti_msg
->
get_msg_name
());
}
bool
result
=
false
;
boost
::
future_status
status
;
bool
result
=
false
;
boost
::
future_status
status
=
{}
;
// wait for timeout or ready
status
=
f
.
wait_for
(
boost
::
chrono
::
milliseconds
(
FUTURE_STATUS_TIMEOUT_MS
));
if
(
status
==
boost
::
future_status
::
ready
)
{
...
...
@@ -3870,11 +3873,16 @@ bool amf_n1::get_network_slice_selection(
Logger
::
ngap
().
debug
(
"Got Authorized Network Slice Info from NSSF: %s"
,
network_slice_info
.
dump
().
c_str
());
from_json
(
network_slice_info
,
authorized_network_slice_info
);
}
else
{
Logger
::
ngap
().
debug
(
"Could not get Authorized Network Slice Info from NSSF"
);
return
false
;
}
}
else
{
Logger
::
ngap
().
debug
(
"Could not get Authorized Network Slice Info from NSSF"
);
return
false
;
}
...
...
@@ -3889,13 +3897,23 @@ bool amf_n1::get_network_slice_selection(
//------------------------------------------------------------------------------
bool
amf_n1
::
get_network_slice_selection_from_conf_file
(
const
std
::
string
&
nf_instance_id
,
oai
::
amf
::
model
::
SliceInfoForRegistration
&
slice_info
,
authorized_network_slice_info_t
&
authorized_network_slice_info
)
const
{
const
oai
::
amf
::
model
::
SliceInfoForRegistration
&
slice_info
,
oai
::
amf
::
model
::
AuthorizedNetworkSliceInfo
&
authorized_network_slice_info
)
const
{
// TODO: Get Authorized Network Slice Info from local configuration file
return
true
;
}
//------------------------------------------------------------------------------
bool
amf_n1
::
get_target_amf
(
const
std
::
shared_ptr
<
nas_context
>&
nc
,
std
::
string
&
target_amf
,
const
oai
::
amf
::
model
::
AuthorizedNetworkSliceInfo
&
authorized_network_slice_info
)
{
// Get Target AMF from AuthorizedNetworkSliceInfo
return
true
;
}
//------------------------------------------------------------------------------
void
amf_n1
::
send_n1_message_notity
(
const
std
::
shared_ptr
<
nas_context
>&
nc
,
...
...
src/amf-app/amf_n1.hpp
View file @
13c9b4e5
...
...
@@ -51,6 +51,7 @@
#include "ue_context.hpp"
#include "itti.hpp"
#include "SliceInfoForRegistration.h"
#include "AuthorizedNetworkSliceInfo.h"
namespace
amf_application
{
...
...
@@ -228,13 +229,20 @@ class amf_n1 {
bool
check_requested_nssai
(
const
std
::
shared_ptr
<
nas_context
>&
nc
,
const
nssai_t
&
nssai
)
const
;
bool
get_network_slice_selection
(
std
::
shared_ptr
<
nas_context
>&
nc
,
const
std
::
string
&
nf_instance_id
,
oai
::
amf
::
model
::
SliceInfoForRegistration
&
slice_info
,
authorized_network_slice_info_t
&
authorized_network_slice_info
);
const
std
::
shared_ptr
<
nas_context
>&
nc
,
const
std
::
string
&
nf_instance_id
,
const
oai
::
amf
::
model
::
SliceInfoForRegistration
&
slice_info
,
oai
::
amf
::
model
::
AuthorizedNetworkSliceInfo
&
authorized_network_slice_info
);
bool
get_network_slice_selection_from_conf_file
(
const
std
::
string
&
nf_instance_id
,
oai
::
amf
::
model
::
SliceInfoForRegistration
&
slice_info
,
authorized_network_slice_info_t
&
authorized_network_slice_info
)
const
;
const
oai
::
amf
::
model
::
SliceInfoForRegistration
&
slice_info
,
oai
::
amf
::
model
::
AuthorizedNetworkSliceInfo
&
authorized_network_slice_info
)
const
;
bool
get_target_amf
(
const
std
::
shared_ptr
<
nas_context
>&
nc
,
std
::
string
&
target_amf
,
const
oai
::
amf
::
model
::
AuthorizedNetworkSliceInfo
&
authorized_network_slice_info
);
void
send_n1_message_notity
(
const
std
::
shared_ptr
<
nas_context
>&
nc
,
...
...
src/amf-app/amf_n11.cpp
View file @
13c9b4e5
...
...
@@ -618,6 +618,7 @@ void amf_n11::handle_itti_message(
return
;
}
//------------------------------------------------------------------------------
void
amf_n11
::
handle_itti_message
(
itti_n11_network_slice_selection_information
&
itti_msg
)
{
Logger
::
amf_n11
().
debug
(
...
...
src/sbi/amf_server/model/AuthorizedNetworkSliceInfo.cpp
0 → 100644
View file @
13c9b4e5
This diff is collapsed.
Click to expand it.
src/sbi/amf_server/model/AuthorizedNetworkSliceInfo.h
0 → 100644
View file @
13c9b4e5
/**
* NSSF NS Selection
* NSSF Network Slice Selection Service. © 2021, 3GPP Organizational Partners
* (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.1.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* AuthorizedNetworkSliceInfo.h
*
*
*/
#ifndef AuthorizedNetworkSliceInfo_H_
#define AuthorizedNetworkSliceInfo_H_
#include "AllowedNssai.h"
#include "ConfiguredSnssai.h"
#include "NsiInformation.h"
#include "Snssai.h"
#include <nlohmann/json.hpp>
#include <string>
#include <vector>
namespace
oai
{
namespace
amf
{
namespace
model
{
/// <summary>
///
/// </summary>
class
AuthorizedNetworkSliceInfo
{
public:
AuthorizedNetworkSliceInfo
();
virtual
~
AuthorizedNetworkSliceInfo
()
=
default
;
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on
/// failure.
/// </summary>
void
validate
()
const
;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool
validate
(
std
::
stringstream
&
msg
)
const
;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and
/// calls it's validate. Not meant to be called outside that case.
/// </summary>
bool
validate
(
std
::
stringstream
&
msg
,
const
std
::
string
&
pathPrefix
)
const
;
bool
operator
==
(
const
AuthorizedNetworkSliceInfo
&
rhs
)
const
;
bool
operator
!=
(
const
AuthorizedNetworkSliceInfo
&
rhs
)
const
;
/////////////////////////////////////////////
/// AuthorizedNetworkSliceInfo members
/// <summary>
///
/// </summary>
std
::
vector
<
AllowedNssai
>
getAllowedNssaiList
()
const
;
void
setAllowedNssaiList
(
std
::
vector
<
AllowedNssai
>
const
&
value
);
bool
allowedNssaiListIsSet
()
const
;
void
unsetAllowedNssaiList
();
/// <summary>
///
/// </summary>
std
::
vector
<
ConfiguredSnssai
>
getConfiguredNssai
()
const
;
void
setConfiguredNssai
(
std
::
vector
<
ConfiguredSnssai
>
const
&
value
);
bool
configuredNssaiIsSet
()
const
;
void
unsetConfiguredNssai
();
/// <summary>
///
/// </summary>
std
::
string
getTargetAmfSet
()
const
;
void
setTargetAmfSet
(
std
::
string
const
&
value
);
bool
targetAmfSetIsSet
()
const
;
void
unsetTargetAmfSet
();
/// <summary>
///
/// </summary>
std
::
vector
<
std
::
string
>
getCandidateAmfList
()
const
;
void
setCandidateAmfList
(
std
::
vector
<
std
::
string
>
const
&
value
);
bool
candidateAmfListIsSet
()
const
;
void
unsetCandidateAmfList
();
/// <summary>
///
/// </summary>
std
::
vector
<
Snssai
>
getRejectedNssaiInPlmn
()
const
;
void
setRejectedNssaiInPlmn
(
std
::
vector
<
Snssai
>
const
&
value
);
bool
rejectedNssaiInPlmnIsSet
()
const
;
void
unsetRejectedNssaiInPlmn
();
/// <summary>
///
/// </summary>
std
::
vector
<
Snssai
>
getRejectedNssaiInTa
()
const
;
void
setRejectedNssaiInTa
(
std
::
vector
<
Snssai
>
const
&
value
);
bool
rejectedNssaiInTaIsSet
()
const
;
void
unsetRejectedNssaiInTa
();
/// <summary>
///
/// </summary>
NsiInformation
getNsiInformation
()
const
;
void
setNsiInformation
(
NsiInformation
const
&
value
);
bool
nsiInformationIsSet
()
const
;
void
unsetNsiInformation
();
/// <summary>
///
/// </summary>
std
::
string
getSupportedFeatures
()
const
;
void
setSupportedFeatures
(
std
::
string
const
&
value
);
bool
supportedFeaturesIsSet
()
const
;
void
unsetSupportedFeatures
();
/// <summary>
///
/// </summary>
std
::
string
getNrfAmfSet
()
const
;
void
setNrfAmfSet
(
std
::
string
const
&
value
);
bool
nrfAmfSetIsSet
()
const
;
void
unsetNrfAmfSet
();
/// <summary>
///
/// </summary>
std
::
string
getNrfAmfSetNfMgtUri
()
const
;
void
setNrfAmfSetNfMgtUri
(
std
::
string
const
&
value
);
bool
nrfAmfSetNfMgtUriIsSet
()
const
;
void
unsetNrfAmfSetNfMgtUri
();
/// <summary>
///
/// </summary>
std
::
string
getNrfAmfSetAccessTokenUri
()
const
;
void
setNrfAmfSetAccessTokenUri
(
std
::
string
const
&
value
);
bool
nrfAmfSetAccessTokenUriIsSet
()
const
;
void
unsetNrfAmfSetAccessTokenUri
();
/// <summary>
///
/// </summary>
std
::
string
getTargetAmfServiceSet
()
const
;
void
setTargetAmfServiceSet
(
std
::
string
const
&
value
);
bool
targetAmfServiceSetIsSet
()
const
;
void
unsetTargetAmfServiceSet
();
friend
void
to_json
(
nlohmann
::
json
&
j
,
const
AuthorizedNetworkSliceInfo
&
o
);
friend
void
from_json
(
const
nlohmann
::
json
&
j
,
AuthorizedNetworkSliceInfo
&
o
);
protected:
std
::
vector
<
AllowedNssai
>
m_AllowedNssaiList
;
bool
m_AllowedNssaiListIsSet
;
std
::
vector
<
ConfiguredSnssai
>
m_ConfiguredNssai
;
bool
m_ConfiguredNssaiIsSet
;
std
::
string
m_TargetAmfSet
;
bool
m_TargetAmfSetIsSet
;
std
::
vector
<
std
::
string
>
m_CandidateAmfList
;
bool
m_CandidateAmfListIsSet
;
std
::
vector
<
Snssai
>
m_RejectedNssaiInPlmn
;
bool
m_RejectedNssaiInPlmnIsSet
;
std
::
vector
<
Snssai
>
m_RejectedNssaiInTa
;
bool
m_RejectedNssaiInTaIsSet
;
NsiInformation
m_NsiInformation
;
bool
m_NsiInformationIsSet
;
std
::
string
m_SupportedFeatures
;
bool
m_SupportedFeaturesIsSet
;
std
::
string
m_NrfAmfSet
;
bool
m_NrfAmfSetIsSet
;
std
::
string
m_NrfAmfSetNfMgtUri
;
bool
m_NrfAmfSetNfMgtUriIsSet
;
std
::
string
m_NrfAmfSetAccessTokenUri
;
bool
m_NrfAmfSetAccessTokenUriIsSet
;
std
::
string
m_TargetAmfServiceSet
;
bool
m_TargetAmfServiceSetIsSet
;
};
}
// namespace model
}
// namespace amf
}
// namespace oai
#endif
/* AuthorizedNetworkSliceInfo_H_ */
src/sbi/amf_server/model/ConfiguredSnssai.cpp
View file @
13c9b4e5
...
...
@@ -12,6 +12,9 @@
*/
#include "ConfiguredSnssai.h"
#include "Helpers.h"
#include <sstream>
namespace
oai
{
namespace
amf
{
...
...
@@ -21,10 +24,41 @@ ConfiguredSnssai::ConfiguredSnssai() {
m_MappedHomeSnssaiIsSet
=
false
;
}
ConfiguredSnssai
::~
ConfiguredSnssai
()
{}
void
ConfiguredSnssai
::
validate
()
const
{
std
::
stringstream
msg
;
// if (!validate(msg))
// {
// throw oai::nssf_server::helpers::ValidationException(msg.str());
// }
}
bool
ConfiguredSnssai
::
validate
(
std
::
stringstream
&
msg
)
const
{
return
validate
(
msg
,
""
);
}
bool
ConfiguredSnssai
::
validate
(
std
::
stringstream
&
msg
,
const
std
::
string
&
pathPrefix
)
const
{
bool
success
=
true
;
const
std
::
string
_pathPrefix
=
pathPrefix
.
empty
()
?
"ConfiguredSnssai"
:
pathPrefix
;
return
success
;
}
bool
ConfiguredSnssai
::
operator
==
(
const
ConfiguredSnssai
&
rhs
)
const
{
return
(
getConfiguredSnssai
()
==
rhs
.
getConfiguredSnssai
())
&&
((
!
mappedHomeSnssaiIsSet
()
&&
!
rhs
.
mappedHomeSnssaiIsSet
())
||
(
mappedHomeSnssaiIsSet
()
&&
rhs
.
mappedHomeSnssaiIsSet
()
&&
getMappedHomeSnssai
()
==
rhs
.
getMappedHomeSnssai
()))
;
}
void
ConfiguredSnssai
::
validate
()
{
// TODO: implement validation
bool
ConfiguredSnssai
::
operator
!=
(
const
ConfiguredSnssai
&
rhs
)
const
{
return
!
(
*
this
==
rhs
);
}
void
to_json
(
nlohmann
::
json
&
j
,
const
ConfiguredSnssai
&
o
)
{
...
...
src/sbi/amf_server/model/ConfiguredSnssai.h
View file @
13c9b4e5
...
...
@@ -32,9 +32,28 @@ namespace model {
class
ConfiguredSnssai
{
public:
ConfiguredSnssai
();
virtual
~
ConfiguredSnssai
();
virtual
~
ConfiguredSnssai
()
=
default
;
void
validate
();
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on
/// failure.
/// </summary>
void
validate
()
const
;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool
validate
(
std
::
stringstream
&
msg
)
const
;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and
/// calls it's validate. Not meant to be called outside that case.
/// </summary>
bool
validate
(
std
::
stringstream
&
msg
,
const
std
::
string
&
pathPrefix
)
const
;
bool
operator
==
(
const
ConfiguredSnssai
&
rhs
)
const
;
bool
operator
!=
(
const
ConfiguredSnssai
&
rhs
)
const
;
/////////////////////////////////////////////
/// ConfiguredSnssai members
...
...
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