Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-AUSF
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-AUSF
Commits
75a0d250
Commit
75a0d250
authored
Jul 15, 2021
by
Niuhaiwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix some bug
parent
5726bbd5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
src/ausf_app/ausf_app.cpp
src/ausf_app/ausf_app.cpp
+12
-7
src/ausf_app/ausf_app.hpp
src/ausf_app/ausf_app.hpp
+1
-0
No files found.
src/ausf_app/ausf_app.cpp
View file @
75a0d250
...
@@ -137,15 +137,14 @@ void ausf_app::register_nf_instance(std::shared_ptr<itti_sbi_register_nf_instanc
...
@@ -137,15 +137,14 @@ void ausf_app::register_nf_instance(std::shared_ptr<itti_sbi_register_nf_instanc
msg
->
profile
.
to_json
(
json_data
);
msg
->
profile
.
to_json
(
json_data
);
std
::
string
url
=
std
::
string
url
=
std
::
string
(
inet_ntoa
(
*
((
struct
in_addr
*
)
&
ausf_cfg
.
nrf_addr
.
ipv4_addr
)))
+
std
::
string
(
inet_ntoa
(
*
((
struct
in_addr
*
)
&
ausf_cfg
.
n
n
rf_addr
.
ipv4_addr
)))
+
":"
+
std
::
to_string
(
ausf_cfg
.
nrf_addr
.
port
)
+
"/nnrf-nfm/"
+
":"
+
std
::
to_string
(
ausf_cfg
.
nrf_addr
.
port
)
+
"/nnrf-nfm/"
+
ausf_cfg
.
nrf_addr
.
api_version
+
"/nf-instances/"
+
ausf_cfg
.
n
n
rf_addr
.
api_version
+
"/nf-instances/"
+
msg
->
profile
.
get_nf_instance_id
();
msg
->
profile
.
get_nf_instance_id
();
Logger
::
ausf_app
().
debug
(
Logger
::
ausf_app
().
debug
(
"Send NF Instance Registration to NRF, NRF URL %s"
,
url
.
c_str
());
"Send NF Instance Registration to NRF, NRF URL %s"
,
url
.
c_str
());
std
::
string
body
=
json_data
.
dump
();
std
::
string
body
=
json_data
.
dump
();
Logger
::
ausf_app
().
debug
(
"Send NF Instance Registration to NRF, msg body
Logger
::
ausf_app
().
debug
(
"Send NF Instance Registration to NRF, msg body:
\n
% s "
,
body
.
c_str
());
:
\n
% s "
,
body
.
c_str
());
curl_global_init
(
CURL_GLOBAL_ALL
);
curl_global_init
(
CURL_GLOBAL_ALL
);
CURL
*
curl
=
curl
=
curl_easy_init
();
CURL
*
curl
=
curl
=
curl_easy_init
();
...
@@ -158,7 +157,7 @@ void ausf_app::register_nf_instance(std::shared_ptr<itti_sbi_register_nf_instanc
...
@@ -158,7 +157,7 @@ void ausf_app::register_nf_instance(std::shared_ptr<itti_sbi_register_nf_instanc
curl_easy_setopt
(
curl
,
CURLOPT_URL
,
url
.
c_str
());
curl_easy_setopt
(
curl
,
CURLOPT_URL
,
url
.
c_str
());
curl_easy_setopt
(
curl
,
CURLOPT_HTTPGET
,
1
);
curl_easy_setopt
(
curl
,
CURLOPT_HTTPGET
,
1
);
curl_easy_setopt
(
curl
,
CURLOPT_CUSTOMREQUEST
,
"PUT"
);
curl_easy_setopt
(
curl
,
CURLOPT_CUSTOMREQUEST
,
"PUT"
);
curl_easy_setopt
(
curl
,
CURLOPT_TIMEOUT_MS
,
NRF_CURL_TIMEOUT_MS
);
curl_easy_setopt
(
curl
,
CURLOPT_TIMEOUT_MS
,
100L
);
if
(
msg
->
http_version
==
2
)
{
if
(
msg
->
http_version
==
2
)
{
curl_easy_setopt
(
curl
,
CURLOPT_VERBOSE
,
1L
);
curl_easy_setopt
(
curl
,
CURLOPT_VERBOSE
,
1L
);
...
@@ -186,7 +185,7 @@ void ausf_app::register_nf_instance(std::shared_ptr<itti_sbi_register_nf_instanc
...
@@ -186,7 +185,7 @@ void ausf_app::register_nf_instance(std::shared_ptr<itti_sbi_register_nf_instanc
nlohmann
::
json
response_data
=
{};
nlohmann
::
json
response_data
=
{};
try
{
try
{
response_data
=
nlohmann
::
json
::
parse
(
*
httpData
.
get
());
response_data
=
nlohmann
::
json
::
parse
(
*
httpData
.
get
());
}
catch
(
json
::
exception
&
e
)
{
}
catch
(
nlohmann
::
json
::
exception
&
e
)
{
Logger
::
ausf_app
().
warn
(
Logger
::
ausf_app
().
warn
(
"NF Instance Registration, could not parse json from the NRF "
"NF Instance Registration, could not parse json from the NRF "
"response"
);
"response"
);
...
@@ -220,3 +219,9 @@ void ausf_app::register_nf_instance(std::shared_ptr<itti_sbi_register_nf_instanc
...
@@ -220,3 +219,9 @@ void ausf_app::register_nf_instance(std::shared_ptr<itti_sbi_register_nf_instanc
}
}
curl_global_cleanup
();
curl_global_cleanup
();
}
}
static
std
::
size_t
callback
(
const
char
*
in
,
std
::
size_t
size
,
std
::
size_t
num
,
std
::
string
*
out
)
{
const
std
::
size_t
totalBytes
(
size
*
num
);
out
->
append
(
in
,
totalBytes
);
return
totalBytes
;
}
src/ausf_app/ausf_app.hpp
View file @
75a0d250
...
@@ -24,6 +24,7 @@ namespace ausf_application{
...
@@ -24,6 +24,7 @@ namespace ausf_application{
void
generate_uuid
();
void
generate_uuid
();
void
timer_nrf_heartbeat_timeout
(
timer_id_t
timer_id
,
uint64_t
arg2_user
);
void
timer_nrf_heartbeat_timeout
(
timer_id_t
timer_id
,
uint64_t
arg2_user
);
void
register_nf_instance
(
std
::
shared_ptr
<
itti_sbi_register_nf_instance_request
>
msg
);
void
register_nf_instance
(
std
::
shared_ptr
<
itti_sbi_register_nf_instance_request
>
msg
);
static
std
::
size_t
callback
(
const
char
*
in
,
std
::
size_t
size
,
std
::
size_t
num
,
std
::
string
*
out
);
private:
private:
std
::
string
ausf_instance_id
;
std
::
string
ausf_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