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
9aa51384
Commit
9aa51384
authored
Nov 16, 2022
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix_sd_issue' into fix_sd_ue_rel_16
parents
d804b703
80e08b65
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
43 deletions
+43
-43
src/api-server/api/NFStatusNotifyApi.cpp
src/api-server/api/NFStatusNotifyApi.cpp
+4
-0
src/common/smf.h
src/common/smf.h
+19
-10
src/smf_app/smf_app.cpp
src/smf_app/smf_app.cpp
+5
-0
src/smf_app/smf_pfcp_association.cpp
src/smf_app/smf_pfcp_association.cpp
+1
-0
src/smf_app/smf_profile.cpp
src/smf_app/smf_profile.cpp
+13
-32
src/smf_app/smf_sbi.cpp
src/smf_app/smf_sbi.cpp
+1
-1
No files found.
src/api-server/api/NFStatusNotifyApi.cpp
View file @
9aa51384
...
@@ -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/common/smf.h
View file @
9aa51384
...
@@ -22,14 +22,15 @@
...
@@ -22,14 +22,15 @@
#ifndef FILE_SMF_SEEN
#ifndef FILE_SMF_SEEN
#define FILE_SMF_SEEN
#define FILE_SMF_SEEN
#include "3gpp_29.274.h"
#include <boost/algorithm/string.hpp>
#include "3gpp_29.571.h"
#include "3gpp_24.501.h"
#include <nlohmann/json.hpp>
#include <map>
#include <map>
#include <
vector
>
#include <
nlohmann/json.hpp
>
#include <unordered_set>
#include <unordered_set>
#include <vector>
#include "3gpp_24.501.h"
#include "3gpp_29.274.h"
#include "3gpp_29.571.h"
typedef
uint64_t
supi64_t
;
typedef
uint64_t
supi64_t
;
#define SUPI_64_FMT "%" SCNu64
#define SUPI_64_FMT "%" SCNu64
...
@@ -85,13 +86,21 @@ typedef struct s_nssai // section 28.4, TS23.003
...
@@ -85,13 +86,21 @@ typedef struct s_nssai // section 28.4, TS23.003
uint32_t
sd
;
uint32_t
sd
;
s_nssai
(
const
uint8_t
&
m_sst
,
const
uint32_t
m_sd
)
:
sst
(
m_sst
),
sd
(
m_sd
)
{}
s_nssai
(
const
uint8_t
&
m_sst
,
const
uint32_t
m_sd
)
:
sst
(
m_sst
),
sd
(
m_sd
)
{}
s_nssai
(
const
uint8_t
&
m_sst
,
const
std
::
string
m_sd
)
:
sst
(
m_sst
)
{
s_nssai
(
const
uint8_t
&
m_sst
,
const
std
::
string
m_sd
)
:
sst
(
m_sst
)
{
sd
=
0xFFFFFF
;
sd
=
SD_NO_VALUE
;
if
(
m_sd
.
empty
())
return
;
uint8_t
base
=
10
;
try
{
try
{
sd
=
std
::
stoul
(
m_sd
,
nullptr
,
10
);
if
(
m_sd
.
size
()
>
2
)
{
if
(
boost
::
iequals
(
m_sd
.
substr
(
0
,
2
),
"0x"
))
{
base
=
16
;
}
}
sd
=
std
::
stoul
(
m_sd
,
nullptr
,
base
);
}
catch
(
const
std
::
exception
&
e
)
{
}
catch
(
const
std
::
exception
&
e
)
{
Logger
::
smf_app
().
warn
(
Logger
::
smf_app
().
error
(
"Error when converting from string to int for
snssai.
SD, error: %s"
,
"Error when converting from string to int for
S-NSSAI
SD, error: %s"
,
e
.
what
());
e
.
what
());
sd
=
SD_NO_VALUE
;
}
}
}
}
s_nssai
()
:
sst
(),
sd
()
{}
s_nssai
()
:
sst
(),
sd
()
{}
...
...
src/smf_app/smf_app.cpp
View file @
9aa51384
...
@@ -690,6 +690,11 @@ void smf_app::handle_itti_msg(
...
@@ -690,6 +690,11 @@ void smf_app::handle_itti_msg(
graph
->
start_asynch_dfs_procedure
(
true
,
empty_flow
);
graph
->
start_asynch_dfs_procedure
(
true
,
empty_flow
);
graph
->
dfs_next_upf
(
dl_edges
,
ul_edges
,
current_upf
);
graph
->
dfs_next_upf
(
dl_edges
,
ul_edges
,
current_upf
);
if
(
!
current_upf
)
{
Logger
::
smf_app
().
warn
(
"Could not select UPF in graph!"
);
return
;
}
up_node_id
=
current_upf
->
node_id
;
up_node_id
=
current_upf
->
node_id
;
std
::
shared_ptr
<
itti_n4_session_failure_indication
>
std
::
shared_ptr
<
itti_n4_session_failure_indication
>
...
...
src/smf_app/smf_pfcp_association.cpp
View file @
9aa51384
...
@@ -1302,6 +1302,7 @@ std::shared_ptr<upf_graph> upf_graph::select_upf_node(
...
@@ -1302,6 +1302,7 @@ std::shared_ptr<upf_graph> upf_graph::select_upf_node(
}
}
return
upf_graph_ptr
;
return
upf_graph_ptr
;
}
}
return
upf_graph_ptr
;
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
...
...
src/smf_app/smf_profile.cpp
View file @
9aa51384
...
@@ -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
())
{
...
...
src/smf_app/smf_sbi.cpp
View file @
9aa51384
...
@@ -927,7 +927,7 @@ bool smf_sbi::get_sm_data(
...
@@ -927,7 +927,7 @@ bool smf_sbi::get_sm_data(
}
}
if
(
jsonData
[
"singleNssai"
].
find
(
"sd"
)
!=
jsonData
[
"singleNssai"
].
end
())
{
if
(
jsonData
[
"singleNssai"
].
find
(
"sd"
)
!=
jsonData
[
"singleNssai"
].
end
())
{
std
::
string
sd_str
=
jsonData
[
"singleNssai"
][
"sd"
];
std
::
string
sd_str
=
jsonData
[
"singleNssai"
][
"sd"
];
uint32_t
sd
=
0xFFFFFF
;
uint32_t
sd
=
SD_NO_VALUE
;
xgpp_conv
::
sd_string_to_int
(
xgpp_conv
::
sd_string_to_int
(
jsonData
[
"singleNssai"
][
"sd"
].
get
<
std
::
string
>
(),
sd
);
jsonData
[
"singleNssai"
][
"sd"
].
get
<
std
::
string
>
(),
sd
);
if
(
sd
!=
snssai
.
sd
)
{
if
(
sd
!=
snssai
.
sd
)
{
...
...
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