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
684da9db
Commit
684da9db
authored
Jul 05, 2022
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Accept both hex and decimal value for SD from conf file
parent
64f2bae8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
12 deletions
+16
-12
src/common/utils/3gpp_conversions.cpp
src/common/utils/3gpp_conversions.cpp
+13
-3
src/smf_app/smf_config.cpp
src/smf_app/smf_config.cpp
+3
-9
No files found.
src/common/utils/3gpp_conversions.cpp
View file @
684da9db
...
...
@@ -32,6 +32,8 @@
#include <stdbool.h>
#include <ctype.h>
#include <inttypes.h>
#include <boost/algorithm/string.hpp>
#include "SmContextCreateData.h"
#include "SmContextUpdateData.h"
#include "SmContextReleaseData.h"
...
...
@@ -637,12 +639,20 @@ void xgpp_conv::update_sm_context_response_from_ctx_request(
//------------------------------------------------------------------------------
void
xgpp_conv
::
sd_string_to_int
(
const
std
::
string
&
sd_str
,
uint32_t
&
sd
)
{
sd
=
0xFFFFFF
;
sd
=
SD_NO_VALUE
;
if
(
sd_str
.
empty
())
return
;
uint8_t
base
=
10
;
try
{
sd
=
std
::
stoul
(
sd_str
,
nullptr
,
10
);
if
(
sd_str
.
size
()
>
2
)
{
if
(
boost
::
iequals
(
sd_str
.
substr
(
0
,
2
),
"0x"
))
{
base
=
16
;
}
}
sd
=
std
::
stoul
(
sd_str
,
nullptr
,
base
);
}
catch
(
const
std
::
exception
&
e
)
{
Logger
::
smf_app
().
warn
(
Logger
::
smf_app
().
error
(
"Error when converting from string to int for S-NSSAI SD, error: %s"
,
e
.
what
());
sd
=
SD_NO_VALUE
;
}
}
src/smf_app/smf_config.cpp
View file @
684da9db
...
...
@@ -50,6 +50,7 @@
#include "logger.hpp"
#include "fqdn.hpp"
#include "smf_app.hpp"
#include "3gpp_conversions.hpp"
using
namespace
std
;
using
namespace
libconfig
;
...
...
@@ -844,16 +845,9 @@ int smf_config::load(const string& config_file) {
SMF_CONFIG_STRING_SESSION_AMBR_DL
,
session_ambr_dl
);
sub_item
.
single_nssai
.
sst
=
nssai_sst
;
sub_item
.
single_nssai
.
sd
=
SD_NO_VALUE
;
xgpp_conv
::
sd_string_to_int
(
nssai_sd
,
sub_item
.
single_nssai
.
sd
);
sub_item
.
single_nssai
.
sd
=
0xFFFFFF
;
try
{
sub_item
.
single_nssai
.
sd
=
std
::
stoul
(
nssai_sd
,
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
());
}
sub_item
.
session_type
=
default_session_type
;
sub_item
.
dnn
=
dnn
;
sub_item
.
ssc_mode
=
default_ssc_mode
;
...
...
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