Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-NRF
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-NRF
Commits
b2f0ddab
Commit
b2f0ddab
authored
Jan 10, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue to allow sending response for the first NF update
parent
f813c1ee
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
21 deletions
+27
-21
src/api-server/impl/NFInstanceIDDocumentApiImpl.cpp
src/api-server/impl/NFInstanceIDDocumentApiImpl.cpp
+1
-0
src/nrf_app/nrf_app.cpp
src/nrf_app/nrf_app.cpp
+13
-10
src/nrf_app/nrf_app.hpp
src/nrf_app/nrf_app.hpp
+2
-2
src/nrf_app/nrf_jwt.cpp
src/nrf_app/nrf_jwt.cpp
+2
-2
src/nrf_app/nrf_profile.cpp
src/nrf_app/nrf_profile.cpp
+5
-4
src/nrf_app/nrf_profile.hpp
src/nrf_app/nrf_profile.hpp
+4
-3
No files found.
src/api-server/impl/NFInstanceIDDocumentApiImpl.cpp
View file @
b2f0ddab
...
...
@@ -173,6 +173,7 @@ void NFInstanceIDDocumentApiImpl::update_nf_instance(
// content type
response
.
headers
().
add
<
Pistache
::
Http
::
Header
::
ContentType
>
(
Pistache
::
Http
::
Mime
::
MediaType
(
content_type
));
if
(
http_code
!=
HTTP_STATUS_CODE_204_NO_CONTENT
)
response
.
send
(
Pistache
::
Http
::
Code
(
http_code
),
json_data
.
dump
().
c_str
());
else
...
...
src/nrf_app/nrf_app.cpp
View file @
b2f0ddab
...
...
@@ -4,8 +4,8 @@
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this
*file except in compliance with the License. You may obtain a copy of the
*License at
*
file except in compliance with the License. You may obtain a copy of the
*
License at
*
* http://www.openairinterface.org/?page_id=698
*
...
...
@@ -237,18 +237,18 @@ void nrf_app::handle_update_nf_instance(
}
// for NF Heartbeat procedure
if
(
is_heartbeart_procedure
&&
(
http_code
=
HTTP_STATUS_CODE_200_OK
))
{
if
(
is_heartbeart_procedure
and
(
http_code
=
=
HTTP_STATUS_CODE_200_OK
))
{
http_code
=
HTTP_STATUS_CODE_204_NO_CONTENT
;
uint64_t
ms
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
milliseconds
>
(
std
::
chrono
::
system_clock
::
now
().
time_since_epoch
())
.
count
();
Logger
::
nrf_app
().
debug
(
"Received a NF update %ld"
,
ms
);
Logger
::
nrf_app
().
debug
(
"Received a NF update
for Heartbeat update, current time
%ld"
,
ms
);
// If this happens before the first Heartbeattimer expires -> remove this
// timer
if
(
sn
.
get
()
->
unsubscribe_heartbeat_timeout_nfregistration
())
{
// Sleep 10
0
ms to avoid Boost connection related issue
unsigned
int
microsecond
=
10000
0
;
// 10
0ms
// Sleep 10ms to avoid Boost connection related issue
unsigned
int
microsecond
=
10000
;
// 1
0ms
usleep
(
microsecond
);
ms
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
milliseconds
>
(
std
::
chrono
::
system_clock
::
now
().
time_since_epoch
())
...
...
@@ -261,6 +261,9 @@ void nrf_app::handle_update_nf_instance(
// sn.get()->subscribe_heartbeat_timeout_nfupdate(ms);
// update NF updated flag
sn
.
get
()
->
set_status_updated
(
true
);
//update NF status
sn
.
get
()
->
set_nf_status
(
"REGISTERED"
);
return
;
}
}
else
{
...
...
@@ -696,7 +699,7 @@ bool nrf_app::update_nf_profile(const std::string &profile_id,
// if profile with this id exist, return false
if
(
instance_id2nrf_profile
.
count
(
profile_id
)
>
0
)
{
// if not, update to the list
Logger
::
nrf_app
().
info
(
"Update
a NF profile to the list
(profile ID %s)"
,
Logger
::
nrf_app
().
info
(
"Update
d the NF profile
(profile ID %s)"
,
profile_id
.
c_str
());
instance_id2nrf_profile
.
at
(
profile_id
)
=
p
;
return
true
;
...
...
@@ -905,7 +908,7 @@ void nrf_app::handle_nf_status_registered(const std::string &profile_id) {
std
::
shared_ptr
<
nrf_profile
>
profile
=
{};
Logger
::
nrf_app
().
info
(
"
\t
Find a NF profile with ID %s"
,
profile_id
.
c_str
());
find_nf_profile
(
profile_id
,
profile
);
if
(
profile
!=
nullptr
)
{
if
(
profile
.
get
()
!=
nullptr
)
{
std
::
vector
<
std
::
string
>
notification_uris
=
{};
get_subscription_list
(
profile_id
,
NOTIFICATION_TYPE_NF_REGISTERED
,
notification_uris
);
...
...
@@ -937,7 +940,7 @@ void nrf_app::handle_nf_status_deregistered(const std::string &profile_id) {
std
::
shared_ptr
<
nrf_profile
>
profile
=
{};
find_nf_profile
(
profile_id
,
profile
);
if
(
profile
!=
nullptr
)
{
if
(
profile
.
get
()
!=
nullptr
)
{
std
::
vector
<
std
::
string
>
notification_uris
=
{};
get_subscription_list
(
profile_id
,
NOTIFICATION_TYPE_NF_DEREGISTERED
,
notification_uris
);
...
...
@@ -965,7 +968,7 @@ void nrf_app::handle_nf_status_profile_changed(const std::string &profile_id) {
profile_id
.
c_str
());
std
::
shared_ptr
<
nrf_profile
>
profile
=
{};
find_nf_profile
(
profile_id
,
profile
);
if
(
profile
!=
nullptr
)
{
if
(
profile
.
get
()
!=
nullptr
)
{
std
::
vector
<
std
::
string
>
notification_uris
=
{};
get_subscription_list
(
profile_id
,
NOTIFICATION_TYPE_NF_PROFILE_CHANGED
,
notification_uris
);
...
...
src/nrf_app/nrf_app.hpp
View file @
b2f0ddab
...
...
@@ -4,8 +4,8 @@
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this
*file except in compliance with the License. You may obtain a copy of the
*License at
*
file except in compliance with the License. You may obtain a copy of the
*
License at
*
* http://www.openairinterface.org/?page_id=698
*
...
...
src/nrf_app/nrf_jwt.cpp
View file @
b2f0ddab
...
...
@@ -4,8 +4,8 @@
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this
*file except in compliance with the License. You may obtain a copy of the
*License at
*
file except in compliance with the License. You may obtain a copy of the
*
License at
*
* http://www.openairinterface.org/?page_id=698
*
...
...
src/nrf_app/nrf_profile.cpp
View file @
b2f0ddab
...
...
@@ -4,8 +4,8 @@
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this
*file except in compliance with the License. You may obtain a copy of the
*License at
*
file except in compliance with the License. You may obtain a copy of the
*
License at
*
* http://www.openairinterface.org/?page_id=698
*
...
...
@@ -76,6 +76,7 @@ nf_type_t nrf_profile::get_nf_type() const { return nf_type; }
//------------------------------------------------------------------------------
void
nrf_profile
::
set_nf_status
(
const
std
::
string
&
status
)
{
Logger
::
nrf_app
().
debug
(
"Set NF status to %s"
,
status
.
c_str
());
std
::
unique_lock
lock
(
heartbeart_mutex
);
nf_status
=
status
;
}
...
...
@@ -458,13 +459,13 @@ void nrf_profile::subscribe_heartbeat_timeout_nfupdate(uint64_t ms) {
"%d, current time %ld"
,
HEART_BEAT_TIMER
,
ms
);
if
(
!
first_update
)
{
if
(
first_update
)
{
ms
=
ms
+
2000
;
// Not a realtime NF: adding 2000ms interval between the
// expected NF update message and HBT
task_connection
=
m_event_sub
.
subscribe_task_tick
(
boost
::
bind
(
&
nrf_profile
::
handle_heartbeart_timeout_nfupdate
,
this
,
_1
),
interval
,
ms
+
interval
);
first_update
=
tru
e
;
first_update
=
fals
e
;
}
}
...
...
src/nrf_app/nrf_profile.hpp
View file @
b2f0ddab
...
...
@@ -64,7 +64,7 @@ class nrf_profile : public std::enable_shared_from_this<nrf_profile> {
nf_instance_name
=
""
;
nf_status
=
""
;
json_data
=
{};
first_update
=
fals
e
;
first_update
=
tru
e
;
is_updated
=
false
;
}
nrf_profile
(
nrf_event
&
ev
,
const
nf_type_t
type
)
...
...
@@ -79,7 +79,7 @@ class nrf_profile : public std::enable_shared_from_this<nrf_profile> {
nf_instance_name
=
""
;
nf_status
=
""
;
json_data
=
{};
first_update
=
fals
e
;
first_update
=
tru
e
;
is_updated
=
false
;
}
...
...
@@ -96,7 +96,7 @@ class nrf_profile : public std::enable_shared_from_this<nrf_profile> {
nf_instance_name
=
""
;
nf_status
=
""
;
json_data
=
{};
first_update
=
fals
e
;
first_update
=
tru
e
;
is_updated
=
false
;
}
...
...
@@ -114,6 +114,7 @@ class nrf_profile : public std::enable_shared_from_this<nrf_profile> {
* @return void
*/
void
set_nf_instance_id
(
const
std
::
string
&
instance_id
);
/*
* Get NF instance ID
* @param [std::string &] instance_id: store instance id
...
...
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