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
b0f69dc4
Commit
b0f69dc4
authored
Sep 29, 2021
by
Raphael Defosseux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style(http2): formatting leftover files
Signed-off-by:
Raphael Defosseux
<
raphael.defosseux@eurecom.fr
>
parent
f9c48674
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
30 deletions
+33
-30
src/api-server/nrf-http2-server.cpp
src/api-server/nrf-http2-server.cpp
+17
-18
src/nrf_app/nrf_app.cpp
src/nrf_app/nrf_app.cpp
+13
-8
src/nrf_app/nrf_subscription.cpp
src/nrf_app/nrf_subscription.cpp
+1
-1
src/nrf_app/nrf_subscription.hpp
src/nrf_app/nrf_subscription.hpp
+1
-1
src/oai-nrf/main.cpp
src/oai-nrf/main.cpp
+1
-2
No files found.
src/api-server/nrf-http2-server.cpp
View file @
b0f69dc4
...
...
@@ -263,9 +263,9 @@ void nrf_http2_server::register_nf_instance_handler(
}
header_map
h
;
h
.
emplace
(
"location"
,
header_value
{
m_address
+
NNRF_NFM_BASE
+
nrf_cfg
.
sbi_api_version
+
"/nf-instances/"
+
nfInstanceID
});
"location"
,
header_value
{
m_address
+
NNRF_NFM_BASE
+
nrf_cfg
.
sbi_api_version
+
"/nf-instances/"
+
nfInstanceID
});
h
.
emplace
(
"content-type"
,
header_value
{
content_type
});
response
.
write_head
(
http_code
,
h
);
response
.
end
(
json_data
.
dump
().
c_str
());
...
...
@@ -295,9 +295,9 @@ void nrf_http2_server::get_nf_instance_handler(
header_map
h
;
h
.
emplace
(
"location"
,
header_value
{
m_address
+
NNRF_NFM_BASE
+
nrf_cfg
.
sbi_api_version
+
"/nf-instances/"
+
nfInstanceID
});
"location"
,
header_value
{
m_address
+
NNRF_NFM_BASE
+
nrf_cfg
.
sbi_api_version
+
"/nf-instances/"
+
nfInstanceID
});
h
.
emplace
(
"content-type"
,
header_value
{
content_type
});
response
.
write_head
(
http_code
,
h
);
response
.
end
(
json_data
.
dump
().
c_str
());
...
...
@@ -342,9 +342,8 @@ void nrf_http2_server::get_nf_instances_handler(
header_map
h
;
h
.
emplace
(
"location"
,
header_value
{
m_address
+
NNRF_NFM_BASE
+
nrf_cfg
.
sbi_api_version
+
"/nf-instances/"
});
"location"
,
header_value
{
m_address
+
NNRF_NFM_BASE
+
nrf_cfg
.
sbi_api_version
+
"/nf-instances/"
});
h
.
emplace
(
"content-type"
,
header_value
{
content_type
});
response
.
write_head
(
http_code
,
h
);
response
.
end
();
...
...
@@ -382,9 +381,9 @@ void nrf_http2_server::update_instance_handler(
Logger
::
nrf_sbi
().
debug
(
"Json data: %s"
,
json_data
.
dump
().
c_str
());
header_map
h
;
h
.
emplace
(
"location"
,
header_value
{
m_address
+
NNRF_NFM_BASE
+
nrf_cfg
.
sbi_api_version
+
"/nf-instances/"
+
nfInstanceID
});
"location"
,
header_value
{
m_address
+
NNRF_NFM_BASE
+
nrf_cfg
.
sbi_api_version
+
"/nf-instances/"
+
nfInstanceID
});
h
.
emplace
(
"content-type"
,
header_value
{
content_type
});
response
.
write_head
(
http_code
,
h
);
response
.
end
(
json_data
.
dump
().
c_str
());
...
...
@@ -406,9 +405,9 @@ void nrf_http2_server::deregister_nf_instance_handler(
header_map
h
;
h
.
emplace
(
"location"
,
header_value
{
m_address
+
NNRF_NFM_BASE
+
nrf_cfg
.
sbi_api_version
+
"/nf-instances/"
+
nfInstanceID
});
"location"
,
header_value
{
m_address
+
NNRF_NFM_BASE
+
nrf_cfg
.
sbi_api_version
+
"/nf-instances/"
+
nfInstanceID
});
h
.
emplace
(
"content-type"
,
header_value
{
content_type
});
response
.
write_head
(
http_code
,
h
);
response
.
end
();
...
...
@@ -438,9 +437,9 @@ void nrf_http2_server::create_subscription_handler(
header_map
h
;
h
.
emplace
(
"location"
,
header_value
{
m_address
+
NNRF_NFM_BASE
+
nrf_cfg
.
sbi_api_version
+
NNRF_NFM_STATUS_SUBSCRIBE_URL
});
"location"
,
header_value
{
m_address
+
NNRF_NFM_BASE
+
nrf_cfg
.
sbi_api_version
+
NNRF_NFM_STATUS_SUBSCRIBE_URL
});
h
.
emplace
(
"content-type"
,
header_value
{
content_type
});
response
.
write_head
(
http_code
,
h
);
response
.
end
(
json_data
.
dump
().
c_str
());
...
...
src/nrf_app/nrf_app.cpp
View file @
b0f69dc4
...
...
@@ -471,7 +471,8 @@ void nrf_app::handle_create_subscription(
for
(
auto
p
:
profiles
)
{
// send notifications
nrf_client_inst
->
notify_subscribed_event
(
p
,
NOTIFICATION_TYPE_NF_REGISTERED
,
notification_uris
,
http_version
);
p
,
NOTIFICATION_TYPE_NF_REGISTERED
,
notification_uris
,
http_version
);
}
}
...
...
@@ -1025,13 +1026,15 @@ void nrf_app::handle_nf_status_registered(const std::string& profile_id) {
find_nf_profile
(
profile_id
,
profile
);
if
(
profile
.
get
()
!=
nullptr
)
{
std
::
vector
<
std
::
string
>
notification_uris
=
{};
uint8_t
httpVersion
=
1
;
uint8_t
httpVersion
=
1
;
get_subscription_list
(
profile_id
,
NOTIFICATION_TYPE_NF_REGISTERED
,
notification_uris
,
httpVersion
);
profile_id
,
NOTIFICATION_TYPE_NF_REGISTERED
,
notification_uris
,
httpVersion
);
// send notifications
if
(
notification_uris
.
size
()
>
0
)
nrf_client_inst
->
notify_subscribed_event
(
profile
,
NOTIFICATION_TYPE_NF_REGISTERED
,
notification_uris
,
httpVersion
);
profile
,
NOTIFICATION_TYPE_NF_REGISTERED
,
notification_uris
,
httpVersion
);
else
Logger
::
nrf_app
().
debug
(
"
\t
No subscription found"
);
...
...
@@ -1057,7 +1060,7 @@ void nrf_app::handle_nf_status_deregistered(
p
.
get
()
->
get_nf_instance_id
().
c_str
());
std
::
vector
<
std
::
string
>
notification_uris
=
{};
uint8_t
http_version
=
1
;
uint8_t
http_version
=
1
;
get_subscription_list
(
p
.
get
()
->
get_nf_instance_id
(),
NOTIFICATION_TYPE_NF_DEREGISTERED
,
notification_uris
,
http_version
);
...
...
@@ -1087,15 +1090,17 @@ void nrf_app::handle_nf_status_profile_changed(const std::string& profile_id) {
find_nf_profile
(
profile_id
,
profile
);
if
(
profile
.
get
()
!=
nullptr
)
{
std
::
vector
<
std
::
string
>
notification_uris
=
{};
uint8_t
http_version
=
1
;
uint8_t
http_version
=
1
;
get_subscription_list
(
profile_id
,
NOTIFICATION_TYPE_NF_PROFILE_CHANGED
,
notification_uris
,
http_version
);
profile_id
,
NOTIFICATION_TYPE_NF_PROFILE_CHANGED
,
notification_uris
,
http_version
);
// Notification data includes NF profile (other alternative, includes
// profile_changes)
// send notifications
if
(
notification_uris
.
size
()
>
0
)
nrf_client_inst
->
notify_subscribed_event
(
profile
,
NOTIFICATION_TYPE_NF_PROFILE_CHANGED
,
notification_uris
,
http_version
);
profile
,
NOTIFICATION_TYPE_NF_PROFILE_CHANGED
,
notification_uris
,
http_version
);
else
Logger
::
nrf_app
().
debug
(
"
\t
No subscription found"
);
}
else
{
...
...
src/nrf_app/nrf_subscription.cpp
View file @
b0f69dc4
...
...
@@ -121,7 +121,7 @@ void nrf_subscription::set_http_version(const uint8_t& httpVersion) {
}
//------------------------------------------------------------------------------
uint8_t
nrf_subscription
::
get_http_version
()
const
{
uint8_t
nrf_subscription
::
get_http_version
()
const
{
return
http_version
;
}
...
...
src/nrf_app/nrf_subscription.hpp
View file @
b0f69dc4
...
...
@@ -200,7 +200,7 @@ class nrf_subscription {
nrf_event
&
m_event_sub
;
bs2
::
connection
ev_connection
;
boost
::
posix_time
::
ptime
validity_time
;
uint8_t
http_version
=
1
;
uint8_t
http_version
=
1
;
};
}
// namespace app
}
// namespace nrf
...
...
src/oai-nrf/main.cpp
View file @
b0f69dc4
...
...
@@ -40,7 +40,7 @@ using namespace std;
nrf_app
*
nrf_app_inst
=
nullptr
;
nrf_config
nrf_cfg
;
NRFApiServer
*
api_server
=
nullptr
;
NRFApiServer
*
api_server
=
nullptr
;
nrf_http2_server
*
nrf_api_server_2
=
nullptr
;
//------------------------------------------------------------------------------
...
...
@@ -124,7 +124,6 @@ int main(int argc, char** argv) {
nrf_manager
.
join
();
nrf_http2_manager
.
join
();
FILE
*
fp
=
NULL
;
std
::
string
filename
=
fmt
::
format
(
"/tmp/nrf_{}.status"
,
getpid
());
fp
=
fopen
(
filename
.
c_str
(),
"w+"
);
...
...
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