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
de2e7a17
Commit
de2e7a17
authored
Nov 15, 2022
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue for getting SD value from UPF profile
parent
2db8bca2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
32 deletions
+17
-32
src/api-server/api/NFStatusNotifyApi.cpp
src/api-server/api/NFStatusNotifyApi.cpp
+4
-0
src/smf_app/smf_profile.cpp
src/smf_app/smf_profile.cpp
+13
-32
No files found.
src/api-server/api/NFStatusNotifyApi.cpp
View file @
de2e7a17
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#include "NFStatusNotifyApi.h"
#include "NFStatusNotifyApi.h"
#include "Helpers.h"
#include "Helpers.h"
#include "logger.hpp"
#include "smf_config.hpp"
#include "smf_config.hpp"
extern
smf
::
smf_config
smf_cfg
;
extern
smf
::
smf_config
smf_cfg
;
...
@@ -56,6 +57,9 @@ void NFStatusNotifyApi::setupRoutes() {
...
@@ -56,6 +57,9 @@ void NFStatusNotifyApi::setupRoutes() {
void
NFStatusNotifyApi
::
notify_nf_status_handler
(
void
NFStatusNotifyApi
::
notify_nf_status_handler
(
const
Pistache
::
Rest
::
Request
&
request
,
const
Pistache
::
Rest
::
Request
&
request
,
Pistache
::
Http
::
ResponseWriter
response
)
{
Pistache
::
Http
::
ResponseWriter
response
)
{
Logger
::
smf_api_server
().
info
(
"Received a NFStatusNotify message"
);
Logger
::
smf_api_server
().
debug
(
"Message body: %s
\n
"
,
request
.
body
().
c_str
());
// Getting the body param
// Getting the body param
NotificationData
notificationData
;
NotificationData
notificationData
;
...
...
src/smf_app/smf_profile.cpp
View file @
de2e7a17
...
@@ -27,11 +27,12 @@
...
@@ -27,11 +27,12 @@
\email: Tien-Thinh.Nguyen@eurecom.fr
\email: Tien-Thinh.Nguyen@eurecom.fr
*/
*/
#include "smf_profile.hpp"
#include "3gpp_conversions.hpp"
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/split.hpp>
#include "logger.hpp"
#include "logger.hpp"
#include "smf_profile.hpp"
#include "string.hpp"
#include "string.hpp"
using
namespace
std
;
using
namespace
std
;
...
@@ -282,17 +283,11 @@ void nf_profile::from_json(const nlohmann::json& data) {
...
@@ -282,17 +283,11 @@ void nf_profile::from_json(const nlohmann::json& data) {
if
(
data
.
find
(
"sNssais"
)
!=
data
.
end
())
{
if
(
data
.
find
(
"sNssais"
)
!=
data
.
end
())
{
for
(
auto
it
:
data
[
"sNssais"
])
{
for
(
auto
it
:
data
[
"sNssais"
])
{
snssai_t
s
=
{};
snssai_t
s
=
{};
s
.
sst
=
it
[
"sst"
].
get
<
int
>
();
s
.
sd
=
SD_NO_VALUE
;
s
.
sd
=
0xFFFFFF
;
if
(
it
.
find
(
"sst"
)
!=
it
.
end
())
s
.
sst
=
it
[
"sst"
].
get
<
int
>
();
try
{
if
(
it
.
find
(
"sd"
)
!=
it
.
end
())
{
s
.
sd
=
std
::
stoul
(
it
[
"sd"
].
get
<
std
::
string
>
(),
nullptr
,
10
);
xgpp_conv
::
sd_string_to_int
(
it
[
"sd"
].
get
<
std
::
string
>
(),
s
.
sd
);
}
catch
(
const
std
::
exception
&
e
)
{
Logger
::
smf_app
().
warn
(
"Error when converting from string to int for snssai.SD, error: %s"
,
e
.
what
());
}
}
// s.sD = it["sd"].get<std::string>();
snssais
.
push_back
(
s
);
snssais
.
push_back
(
s
);
}
}
}
}
...
@@ -472,20 +467,13 @@ void smf_profile::from_json(const nlohmann::json& data) {
...
@@ -472,20 +467,13 @@ void smf_profile::from_json(const nlohmann::json& data) {
for
(
auto
it
:
snssai_smf_info_list
)
{
for
(
auto
it
:
snssai_smf_info_list
)
{
snssai_smf_info_item_t
smf_info_item
=
{};
snssai_smf_info_item_t
smf_info_item
=
{};
smf_info_item
.
snssai
.
sd
=
SD_NO_VALUE
;
if
(
it
.
find
(
"sNssai"
)
!=
it
.
end
())
{
if
(
it
.
find
(
"sNssai"
)
!=
it
.
end
())
{
if
(
it
[
"sNssai"
].
find
(
"sst"
)
!=
it
[
"sNssai"
].
end
())
if
(
it
[
"sNssai"
].
find
(
"sst"
)
!=
it
[
"sNssai"
].
end
())
smf_info_item
.
snssai
.
sst
=
it
[
"sNssai"
][
"sst"
].
get
<
int
>
();
smf_info_item
.
snssai
.
sst
=
it
[
"sNssai"
][
"sst"
].
get
<
int
>
();
if
(
it
[
"sNssai"
].
find
(
"sd"
)
!=
it
[
"sNssai"
].
end
())
{
if
(
it
[
"sNssai"
].
find
(
"sd"
)
!=
it
[
"sNssai"
].
end
())
{
smf_info_item
.
snssai
.
sd
=
0xFFFFFF
;
xgpp_conv
::
sd_string_to_int
(
try
{
it
[
"sNssai"
][
"sd"
].
get
<
std
::
string
>
(),
smf_info_item
.
snssai
.
sd
);
smf_info_item
.
snssai
.
sd
=
std
::
stoul
(
it
[
"sNssai"
][
"sd"
].
get
<
std
::
string
>
(),
nullptr
,
10
);
}
catch
(
const
std
::
exception
&
e
)
{
Logger
::
smf_app
().
warn
(
"Error when converting from string to int for snssai.SD, "
"error: %s"
,
e
.
what
());
}
}
}
}
}
if
(
it
.
find
(
"dnnSmfInfoList"
)
!=
it
.
end
())
{
if
(
it
.
find
(
"dnnSmfInfoList"
)
!=
it
.
end
())
{
...
@@ -629,20 +617,13 @@ void upf_profile::from_json(const nlohmann::json& data) {
...
@@ -629,20 +617,13 @@ void upf_profile::from_json(const nlohmann::json& data) {
for
(
auto
it
:
snssai_upf_info_list
)
{
for
(
auto
it
:
snssai_upf_info_list
)
{
snssai_upf_info_item_t
upf_info_item
=
{};
snssai_upf_info_item_t
upf_info_item
=
{};
upf_info_item
.
snssai
.
sd
=
SD_NO_VALUE
;
if
(
it
.
find
(
"sNssai"
)
!=
it
.
end
())
{
if
(
it
.
find
(
"sNssai"
)
!=
it
.
end
())
{
if
(
it
[
"sNssai"
].
find
(
"sst"
)
!=
it
[
"sNssai"
].
end
())
if
(
it
[
"sNssai"
].
find
(
"sst"
)
!=
it
[
"sNssai"
].
end
())
upf_info_item
.
snssai
.
sst
=
it
[
"sNssai"
][
"sst"
].
get
<
int
>
();
upf_info_item
.
snssai
.
sst
=
it
[
"sNssai"
][
"sst"
].
get
<
int
>
();
if
(
it
[
"sNssai"
].
find
(
"sd"
)
!=
it
[
"sNssai"
].
end
())
{
if
(
it
[
"sNssai"
].
find
(
"sd"
)
!=
it
[
"sNssai"
].
end
())
{
upf_info_item
.
snssai
.
sd
=
0xFFFFFF
;
xgpp_conv
::
sd_string_to_int
(
try
{
it
[
"sNssai"
][
"sd"
].
get
<
std
::
string
>
(),
upf_info_item
.
snssai
.
sd
);
upf_info_item
.
snssai
.
sd
=
std
::
stoul
(
it
[
"sNssai"
][
"sd"
].
get
<
std
::
string
>
(),
nullptr
,
10
);
}
catch
(
const
std
::
exception
&
e
)
{
Logger
::
smf_app
().
warn
(
"Error when converting from string to int for snssai.SD, "
"error: %s"
,
e
.
what
());
}
}
}
}
}
if
(
it
.
find
(
"dnnUpfInfoList"
)
!=
it
.
end
())
{
if
(
it
.
find
(
"dnnUpfInfoList"
)
!=
it
.
end
())
{
...
...
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