Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-SMF
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-SMF
Commits
2cb98406
Commit
2cb98406
authored
Jan 15, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue for NFSubscribeNotify
parent
09c7657e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
src/common/smf.h
src/common/smf.h
+1
-1
src/smf_app/smf_app.cpp
src/smf_app/smf_app.cpp
+5
-0
src/smf_app/smf_n11.cpp
src/smf_app/smf_n11.cpp
+2
-3
No files found.
src/common/smf.h
View file @
2cb98406
...
@@ -193,7 +193,7 @@ typedef struct qos_profile_s {
...
@@ -193,7 +193,7 @@ typedef struct qos_profile_s {
// NRF
// NRF
#define NNRF_NFM_BASE "/nnrf-nfm/"
#define NNRF_NFM_BASE "/nnrf-nfm/"
#define NNRF_NF_REGISTER_URL "/nf-instances/"
#define NNRF_NF_REGISTER_URL "/nf-instances/"
#define NNRF_NF_STATUS_SUBSCRIBE_URL "/subscriptions
/
"
#define NNRF_NF_STATUS_SUBSCRIBE_URL "/subscriptions"
#define NRF_CURL_TIMEOUT_MS 100L
#define NRF_CURL_TIMEOUT_MS 100L
// for CURL
// for CURL
...
...
src/smf_app/smf_app.cpp
View file @
2cb98406
...
@@ -344,6 +344,10 @@ smf_app::smf_app(const std::string& config_file)
...
@@ -344,6 +344,10 @@ smf_app::smf_app(const std::string& config_file)
// Register to NRF
// Register to NRF
register_to_nrf
();
register_to_nrf
();
// Trigger NFStatusNotify
unsigned
int
microsecond
=
10000
;
// 10ms
usleep
(
microsecond
);
trigger_upf_status_notification_subscribe
();
Logger
::
smf_app
().
startup
(
"Started"
);
Logger
::
smf_app
().
startup
(
"Started"
);
}
}
...
@@ -1950,6 +1954,7 @@ void smf_app::trigger_upf_status_notification_subscribe() {
...
@@ -1950,6 +1954,7 @@ void smf_app::trigger_upf_status_notification_subscribe() {
TASK_SMF_APP
,
TASK_SMF_N11
);
TASK_SMF_APP
,
TASK_SMF_N11
);
nlohmann
::
json
json_data
=
{};
nlohmann
::
json
json_data
=
{};
//TODO: remove hardcoded values
json_data
[
"nfStatusNotificationUri"
]
=
json_data
[
"nfStatusNotificationUri"
]
=
std
::
string
(
inet_ntoa
(
*
((
struct
in_addr
*
)
&
smf_cfg
.
sbi
.
addr4
)))
+
std
::
string
(
inet_ntoa
(
*
((
struct
in_addr
*
)
&
smf_cfg
.
sbi
.
addr4
)))
+
":"
+
std
::
to_string
(
smf_cfg
.
sbi
.
port
)
+
"/nsmf_nfstatus_notify/"
+
":"
+
std
::
to_string
(
smf_cfg
.
sbi
.
port
)
+
"/nsmf_nfstatus_notify/"
+
...
...
src/smf_app/smf_n11.cpp
View file @
2cb98406
...
@@ -921,11 +921,11 @@ void smf_n11::subscribe_upf_status_notify(
...
@@ -921,11 +921,11 @@ void smf_n11::subscribe_upf_status_notify(
msg
->
http_version
);
msg
->
http_version
);
Logger
::
smf_n11
().
debug
(
Logger
::
smf_n11
().
debug
(
"Send NF
De-register to NRF (
NRF URL %s)"
,
msg
->
url
.
c_str
());
"Send NF
StatusNotify to NRF,
NRF URL %s)"
,
msg
->
url
.
c_str
());
std
::
string
body
=
msg
->
json_data
.
dump
();
std
::
string
body
=
msg
->
json_data
.
dump
();
Logger
::
smf_n11
().
debug
(
Logger
::
smf_n11
().
debug
(
"Send NF
Instance Registration to NRF, msg body:
\n
%s"
,
body
.
c_str
());
"Send NF
StatusNotify to NRF, msg body:
%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
();
...
@@ -938,7 +938,6 @@ void smf_n11::subscribe_upf_status_notify(
...
@@ -938,7 +938,6 @@ void smf_n11::subscribe_upf_status_notify(
curl_easy_setopt
(
curl
,
CURLOPT_HTTPHEADER
,
headers
);
curl_easy_setopt
(
curl
,
CURLOPT_HTTPHEADER
,
headers
);
curl_easy_setopt
(
curl
,
CURLOPT_URL
,
msg
->
url
.
c_str
());
curl_easy_setopt
(
curl
,
CURLOPT_URL
,
msg
->
url
.
c_str
());
curl_easy_setopt
(
curl
,
CURLOPT_HTTPGET
,
1
);
curl_easy_setopt
(
curl
,
CURLOPT_HTTPGET
,
1
);
curl_easy_setopt
(
curl
,
CURLOPT_CUSTOMREQUEST
,
"DELETE"
);
curl_easy_setopt
(
curl
,
CURLOPT_TIMEOUT_MS
,
NRF_CURL_TIMEOUT_MS
);
curl_easy_setopt
(
curl
,
CURLOPT_TIMEOUT_MS
,
NRF_CURL_TIMEOUT_MS
);
if
(
msg
->
http_version
==
2
)
{
if
(
msg
->
http_version
==
2
)
{
...
...
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