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
97450c68
Commit
97450c68
authored
Jun 23, 2022
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update condition to process AMF configuration update
parent
9a3d4c98
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
8 deletions
+32
-8
src/amf-app/amf_app.cpp
src/amf-app/amf_app.cpp
+17
-6
src/amf-app/amf_config.hpp
src/amf-app/amf_config.hpp
+2
-2
src/amf-app/amf_statistics.cpp
src/amf-app/amf_statistics.cpp
+6
-0
src/amf-app/amf_statistics.hpp
src/amf-app/amf_statistics.hpp
+7
-0
No files found.
src/amf-app/amf_app.cpp
View file @
97450c68
...
...
@@ -88,7 +88,10 @@ amf_app::amf_app(const amf_config& amf_cfg)
throw
;
}
// Generate an AMF profile (including NF instance)
// Generate NF Instance ID (UUID)
generate_uuid
();
// Generate an AMF profile
generate_amf_profile
();
// Register to NRF if needed
...
...
@@ -756,6 +759,16 @@ void amf_app::handle_itti_message(itti_sbi_update_amf_configuration& itti_msg) {
"AMF configuration:
\n
%s"
,
response_data
[
"content"
].
dump
().
c_str
());
response_data
[
"httpResponseCode"
]
=
200
;
// TODO:
// TODO: Send message to update AMF profile at NRF
// Update AMF profile
generate_amf_profile
();
// Update AMF profile at NRF
/* if (amf_cfg.support_features.enable_nf_registration and
amf_cfg.support_features.enable_external_nrf)
update_amf_profile();
*/
}
else
{
response_data
[
"httpResponseCode"
]
=
400
;
// TODO:
oai
::
amf
::
model
::
ProblemDetails
problem_details
=
{};
...
...
@@ -778,9 +791,9 @@ bool amf_app::read_amf_configuration(nlohmann::json& json_data) {
//---------------------------------------------------------------------------------------------
bool
amf_app
::
update_amf_configuration
(
nlohmann
::
json
&
json_data
)
{
if
(
get_number_registered_ue
s
()
>
0
)
{
if
(
stacs
.
get_number_connected_gnb
s
()
>
0
)
{
Logger
::
amf_app
().
info
(
"
AMF is actively handling UEs, could not update AMF configuration
"
);
"
Could not update AMF configuration (connected with gNBs)
"
);
return
false
;
}
return
amf_cfg
.
from_json
(
json_data
);
...
...
@@ -998,8 +1011,6 @@ void amf_app::get_ee_subscriptions(
//---------------------------------------------------------------------------------------------
void
amf_app
::
generate_amf_profile
()
{
// generate UUID
generate_uuid
();
nf_instance_profile
.
set_nf_instance_id
(
amf_instance_id
);
nf_instance_profile
.
set_nf_instance_name
(
amf_cfg
.
amf_name
);
nf_instance_profile
.
set_nf_type
(
"AMF"
);
...
...
@@ -1014,7 +1025,7 @@ void amf_app::generate_amf_profile() {
nf_service
.
service_instance_id
=
"namf_communication"
;
nf_service
.
service_name
=
"namf_communication"
;
nf_service_version_t
version
=
{};
version
.
api_version_in_uri
=
"v1"
;
version
.
api_version_in_uri
=
amf_cfg
.
sbi_api_version
;
version
.
api_full_version
=
"1.0.0"
;
// TODO: to be updated
nf_service
.
versions
.
push_back
(
version
);
nf_service
.
scheme
=
"http"
;
...
...
src/amf-app/amf_config.hpp
View file @
97450c68
...
...
@@ -305,10 +305,10 @@ typedef struct {
nlohmann
::
json
json_data
=
{};
json_data
[
"prefered_integrity_algorithm"
]
=
nlohmann
::
json
::
array
();
json_data
[
"prefered_ciphering_algorithm"
]
=
nlohmann
::
json
::
array
();
for
(
auto
s
:
prefered_integrity_algorithm
)
{
for
(
auto
s
:
this
->
prefered_integrity_algorithm
)
{
json_data
[
"prefered_integrity_algorithm"
].
push_back
(
s
);
}
for
(
auto
s
:
prefered_ciphering_algorithm
)
{
for
(
auto
s
:
this
->
prefered_ciphering_algorithm
)
{
json_data
[
"prefered_ciphering_algorithm"
].
push_back
(
s
);
}
return
json_data
;
...
...
src/amf-app/amf_statistics.cpp
View file @
97450c68
...
...
@@ -163,3 +163,9 @@ void statistics::update_gnb(const uint32_t& gnb_id, const gnb_infos& gnb) {
gnbs
[
gnb_id
]
=
gnb
;
}
}
//------------------------------------------------------------------------------
uint32_t
statistics
::
get_number_connected_gnbs
()
const
{
std
::
shared_lock
lock
(
m_gnbs
);
return
gnbs
.
size
();
}
src/amf-app/amf_statistics.hpp
View file @
97450c68
...
...
@@ -124,6 +124,13 @@ class statistics {
*/
void
update_gnb
(
const
uint32_t
&
gnb_id
,
const
gnb_infos
&
gnb
);
/*
* Get number of connected gNBs
* @param void
* @return number of connected gNBs
*/
uint32_t
get_number_connected_gnbs
()
const
;
public:
uint32_t
gNB_connected
;
uint32_t
UE_connected
;
...
...
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