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
622905a5
Commit
622905a5
authored
Jul 29, 2021
by
Fang-WANG
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix some data format
parent
9d9ce0a5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
src/smf_app/smf_app.cpp
src/smf_app/smf_app.cpp
+12
-9
No files found.
src/smf_app/smf_app.cpp
View file @
622905a5
...
...
@@ -1309,12 +1309,15 @@ bool smf_app::handle_nf_status_notification(
json_data
[
"nfStatus"
]
=
profile
.
get
()
->
get_nf_status
().
c_str
();
json_data
[
"nfInstanceId"
]
=
profile
.
get
()
->
get_nf_instance_id
().
c_str
();
json_data
[
"nfType"
]
=
profile
.
get
()
->
get_nf_type
().
c_str
();
json_data
[
"ipv4Addresses"
]
=
nlohmann
::
json
::
array
();
//
json_data["ipv4Addresses"] = nlohmann::json::array();
std
::
vector
<
struct
in_addr
>
nfIpv4Addresses
;
profile
.
get
()
->
get_nf_ipv4_addresses
(
nfIpv4Addresses
);
for
(
auto
address
:
nfIpv4Addresses
)
{
/*
for (auto address : nfIpv4Addresses) {
json_data["ipv4Addresses"].push_back(inet_ntoa(address));
}
}*/
string
ipv4
;
ipv4
=
conv
::
toString
(
nfIpv4Addresses
[
0
]);
json_data
[
"ipv4Addresses"
]
=
ipv4
.
c_str
();
time_t
rawtime
;
struct
tm
*
info
;
char
buffer
[
80
];
...
...
@@ -1340,12 +1343,12 @@ bool smf_app::handle_nf_status_notification(
if
(
nf_status_json_arr
[
i
][
"nfType"
].
dump
().
compare
(
json_data
[
"nfType"
].
dump
().
c_str
())
==
0
)
{
Logger
::
smf_app
().
error
(
"the nftype is exist"
);
nf_status_json_arr
[
i
][
"nfInstanceName"
]
=
json_data
[
"nfInstanceName"
]
.
dump
().
c_str
()
;
nf_status_json_arr
[
i
][
"nfEvent"
]
=
json_data
[
"nfEvent"
]
.
dump
().
c_str
()
;
nf_status_json_arr
[
i
][
"nfStatus"
]
=
json_data
[
"nfStatus"
]
.
dump
().
c_str
()
;
nf_status_json_arr
[
i
][
"nfInstanceId"
]
=
json_data
[
"nfInstanceId"
]
.
dump
().
c_str
()
;
nf_status_json_arr
[
i
][
"ipv4Addresses"
]
=
json_data
[
"ipv4Addresses"
]
.
dump
().
c_str
()
;
nf_status_json_arr
[
i
][
"time"
]
=
json_data
[
"time"
]
.
dump
().
c_str
()
;
nf_status_json_arr
[
i
][
"nfInstanceName"
]
=
json_data
[
"nfInstanceName"
];
nf_status_json_arr
[
i
][
"nfEvent"
]
=
json_data
[
"nfEvent"
];
nf_status_json_arr
[
i
][
"nfStatus"
]
=
json_data
[
"nfStatus"
];
nf_status_json_arr
[
i
][
"nfInstanceId"
]
=
json_data
[
"nfInstanceId"
];
nf_status_json_arr
[
i
][
"ipv4Addresses"
]
=
json_data
[
"ipv4Addresses"
];
nf_status_json_arr
[
i
][
"time"
]
=
json_data
[
"time"
];
}
else
{
...
...
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